[FFmpeg-cvslog] avcodec/vc1: correct AC inverse quantization scaling

Jerome Borsboom git at videolan.org
Wed Apr 25 23:12:19 EEST 2018


ffmpeg | branch: master | Jerome Borsboom <jerome.borsboom at carpalis.nl> | Mon Apr 23 21:00:15 2018 +0200| [797c1536a46e645304a9325bd58f99420c37e773] | committer: Paul B Mahol

avcodec/vc1: correct AC inverse quantization scaling

HALFQP should only be added to the inverse quantizer when the block is
coded with PQUANT. See 8.1.3.8 in VC-1 spec.

Signed-off-by: Jerome Borsboom <jerome.borsboom at carpalis.nl>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=797c1536a46e645304a9325bd58f99420c37e773
---

 libavcodec/vc1_block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index e78e4806bd..de06b6fb2a 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -944,7 +944,7 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n,
     ac_val = s->ac_val[0][s->block_index[n]];
     ac_val2 = ac_val;
 
-    scale = mquant * 2 + v->halfpq;
+    scale = mquant * 2 + ((mquant == v->pq) ? v->halfpq : 0);
 
     if (dc_pred_dir) //left
         ac_val -= 16;



More information about the ffmpeg-cvslog mailing list