VP8_COMMON *cm = &cpi->common;
MACROBLOCKD *mbd = &cpi->mb.e_mbd;
int update = 0;
-
- update |= cm->base_qindex != Q;
+ int new_delta_q;
cm->base_qindex = Q;
+ /* if any of the delta_q values are changing update flag has to be set */
+ /* currently only y2dc_delta_q may change */
+
cm->y1dc_delta_q = 0;
- cm->y2dc_delta_q = 0;
cm->y2ac_delta_q = 0;
cm->uvdc_delta_q = 0;
cm->uvac_delta_q = 0;
- if(Q<4)
+ if (Q < 4)
{
- update |= cm->y2dc_delta_q != 4-Q;
- cm->y2dc_delta_q = 4-Q;
+ new_delta_q = 4-Q;
}
+ else
+ new_delta_q = 0;
+
+ update |= cm->y2dc_delta_q != new_delta_q;
+ cm->y2dc_delta_q = new_delta_q;
+
// Set Segment specific quatizers
mbd->segment_feature_data[MB_LVL_ALT_Q][0] = cpi->segment_feature_data[MB_LVL_ALT_Q][0];
mbd->segment_feature_data[MB_LVL_ALT_Q][2] = cpi->segment_feature_data[MB_LVL_ALT_Q][2];
mbd->segment_feature_data[MB_LVL_ALT_Q][3] = cpi->segment_feature_data[MB_LVL_ALT_Q][3];
+ /* quantizer has to be reinitialized for any delta_q changes */
if(update)
vp8cx_init_quantizer(cpi);