From 4b94465927660403d7b5715b34ac5c66e1b17b82 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 22 Jul 2006 03:54:00 +0000 Subject: [PATCH] Don't do non-uniform quantization on zero coeffs. Originally committed as revision 5810 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/vc1.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index fa1d9fa..b6bcd7f 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -2061,13 +2061,13 @@ not_coded: if(dc_pred_dir) { //left for(k = 1; k < 8; k++) { block[k << 3] = ac_val[k] * scale; - if(!v->pquantizer) + if(!v->pquantizer && block[k << 3]) block[k << 3] += (block[k << 3] < 0) ? -v->pq : v->pq; } } else { //top for(k = 1; k < 8; k++) { block[k] = ac_val[k + 8] * scale; - if(!v->pquantizer) + if(!v->pquantizer && block[k]) block[k] += (block[k] < 0) ? -v->pq : v->pq; } } @@ -2260,13 +2260,13 @@ static int vc1_decode_intra_block(VC1Context *v, DCTELEM block[64], int n, int c if(dc_pred_dir) { //left for(k = 1; k < 8; k++) { block[k << 3] = ac_val2[k] * scale; - if(!v->pquantizer) + if(!v->pquantizer && block[k << 3]) block[k << 3] += (block[k << 3] < 0) ? -mquant : mquant; } } else { //top for(k = 1; k < 8; k++) { block[k] = ac_val2[k + 8] * scale; - if(!v->pquantizer) + if(!v->pquantizer && block[k]) block[k] += (block[k] < 0) ? -mquant : mquant; } } -- 2.7.4