diff mbox

[FFmpeg-devel] avcodec/vc1: fix mquant calculation

Message ID bd4ee896-35a7-4d87-c50b-9124f1776525@carpalis.nl
State Accepted
Commit 19c3df0cd6ddc21a666e67a0c98b7823a2730003
Headers show

Commit Message

Jerome Borsboom April 28, 2018, 3:15 p.m. UTC
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: Jerome Borsboom <jerome.borsboom@carpalis.nl>
---
 libavcodec/vc1_block.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Michael Niedermayer April 29, 2018, 1:58 a.m. UTC | #1
On Sat, Apr 28, 2018 at 05:15:32PM +0200, Jerome Borsboom wrote:
> 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: Jerome Borsboom <jerome.borsboom@carpalis.nl>
> ---
>  libavcodec/vc1_block.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

will apply

btw, maybe you want to add yourself to the MAINTAINERs file
for vc1.c, you worked more on it than anyone else recently so you
are de facto already maintaining it more than anyone else

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index 0caa5ebb85..f59c440943 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -177,7 +177,7 @@  static void vc1_put_signed_blocks_clamped(VC1Context *v)
             edges = 15;                                        \
         if ((edges&1) && !s->mb_x)                             \
             mquant = -v->altpq;                                \
-        if ((edges&2) && s->first_slice_line)                  \
+        if ((edges&2) && !s->mb_y)                             \
             mquant = -v->altpq;                                \
         if ((edges&4) && s->mb_x == (s->mb_width - 1))         \
             mquant = -v->altpq;                                \
@@ -2626,7 +2626,7 @@  static void vc1_decode_i_blocks_adv(VC1Context *v)
     int cbp, val;
     uint8_t *coded_val;
     int mb_pos;
-    int mquant = v->pq;
+    int mquant;
     int mqdiff;
     GetBitContext *gb = &s->gb;
 
@@ -2671,6 +2671,7 @@  static void vc1_decode_i_blocks_adv(VC1Context *v)
         init_block_index(v);
         for (;s->mb_x < s->mb_width; s->mb_x++) {
             int16_t (*block)[64] = v->block[v->cur_blk_idx];
+            mquant = v->pq;
             ff_update_block_index(s);
             s->bdsp.clear_blocks(block[0]);
             mb_pos = s->mb_x + s->mb_y * s->mb_stride;