Commit 19c3df0c authored by Jerome Borsboom's avatar Jerome Borsboom Committed by Michael Niedermayer

avcodec/vc1: fix mquant calculation

In vc1_decode_i_blocks_adv mquant needs to be reset to its default value for
each macroblock, instead of once at the beginning of the slice.

DQPROFILE specifies which macroblocks can have an alternative quantizer step
size. When DQPROFILE specifies edges, the selection is applicable to the edges
of the picture. Slice edges are not selected by DQPROFILE.
Signed-off-by: 's avatarJerome Borsboom <jerome.borsboom@carpalis.nl>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 29fd44ad
...@@ -177,7 +177,7 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v) ...@@ -177,7 +177,7 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
edges = 15; \ edges = 15; \
if ((edges&1) && !s->mb_x) \ if ((edges&1) && !s->mb_x) \
mquant = -v->altpq; \ mquant = -v->altpq; \
if ((edges&2) && s->first_slice_line) \ if ((edges&2) && !s->mb_y) \
mquant = -v->altpq; \ mquant = -v->altpq; \
if ((edges&4) && s->mb_x == (s->mb_width - 1)) \ if ((edges&4) && s->mb_x == (s->mb_width - 1)) \
mquant = -v->altpq; \ mquant = -v->altpq; \
...@@ -2626,7 +2626,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v) ...@@ -2626,7 +2626,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
int cbp, val; int cbp, val;
uint8_t *coded_val; uint8_t *coded_val;
int mb_pos; int mb_pos;
int mquant = v->pq; int mquant;
int mqdiff; int mqdiff;
GetBitContext *gb = &s->gb; GetBitContext *gb = &s->gb;
...@@ -2671,6 +2671,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v) ...@@ -2671,6 +2671,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
init_block_index(v); init_block_index(v);
for (;s->mb_x < s->mb_width; s->mb_x++) { for (;s->mb_x < s->mb_width; s->mb_x++) {
int16_t (*block)[64] = v->block[v->cur_blk_idx]; int16_t (*block)[64] = v->block[v->cur_blk_idx];
mquant = v->pq;
ff_update_block_index(s); ff_update_block_index(s);
s->bdsp.clear_blocks(block[0]); s->bdsp.clear_blocks(block[0]);
mb_pos = s->mb_x + s->mb_y * s->mb_stride; mb_pos = s->mb_x + s->mb_y * s->mb_stride;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment