diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-12-03 16:07:41 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-12-03 16:07:41 +0000 |
commit | 6beeb962a2e62abf9857d4c4a167341acee8b867 (patch) | |
tree | 45cd428fb0c61f2f5f9504c9283bf26690e1cd9a | |
parent | b7cbfc23071ad95b3966441d31fcb18a9bea73e0 (diff) | |
download | ffmpeg-6beeb962a2e62abf9857d4c4a167341acee8b867.tar.gz |
h263 modified quantization fix
Originally committed as revision 2557 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/h263dec.c | 2 | ||||
-rw-r--r-- | libavcodec/mpegvideo.c | 16 | ||||
-rw-r--r-- | libavcodec/msmpeg4.c | 2 | ||||
-rw-r--r-- | libavcodec/wmv2.c | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 8a8dafb554..ef15e1406b 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -147,7 +147,7 @@ static int decode_slice(MpegEncContext *s){ s->resync_mb_y= s->mb_y; s->y_dc_scale= s->y_dc_scale_table[ s->qscale ]; - s->c_dc_scale= s->c_dc_scale_table[ s->qscale ]; + s->c_dc_scale= s->c_dc_scale_table[ s->chroma_qscale ]; if(s->partitioned_frame){ const int qscale= s->qscale; diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 595ab16c2f..525c1f12e9 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -2651,9 +2651,9 @@ static inline void MPV_motion(MpegEncContext *s, /* put block[] to dest[] */ static inline void put_dct(MpegEncContext *s, - DCTELEM *block, int i, uint8_t *dest, int line_size) + DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale) { - s->dct_unquantize(s, block, i, s->qscale); + s->dct_unquantize(s, block, i, qscale); s->dsp.idct_put (dest, line_size, block); } @@ -2857,14 +2857,14 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) } else { /* dct only in intra block */ if(s->encoding || !(s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO)){ - put_dct(s, block[0], 0, dest_y, dct_linesize); - put_dct(s, block[1], 1, dest_y + 8, dct_linesize); - put_dct(s, block[2], 2, dest_y + dct_offset, dct_linesize); - put_dct(s, block[3], 3, dest_y + dct_offset + 8, dct_linesize); + put_dct(s, block[0], 0, dest_y, dct_linesize, s->qscale); + put_dct(s, block[1], 1, dest_y + 8, dct_linesize, s->qscale); + put_dct(s, block[2], 2, dest_y + dct_offset, dct_linesize, s->qscale); + put_dct(s, block[3], 3, dest_y + dct_offset + 8, dct_linesize, s->qscale); if(!(s->flags&CODEC_FLAG_GRAY)){ - put_dct(s, block[4], 4, dest_cb, uvlinesize); - put_dct(s, block[5], 5, dest_cr, uvlinesize); + put_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale); + put_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale); } }else{ s->dsp.idct_put(dest_y , dct_linesize, block[0]); diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index b3f61a26de..d8a8e4873b 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -1258,7 +1258,7 @@ return -1; if(!had_i) return -1; } #endif - s->qscale = get_bits(&s->gb, 5); + s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); if(s->qscale==0){ av_log(s->avctx, AV_LOG_ERROR, "invalid qscale\n"); return -1; diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c index 8b85770661..3ad09f42a7 100644 --- a/libavcodec/wmv2.c +++ b/libavcodec/wmv2.c @@ -368,7 +368,7 @@ return -1; code = get_bits(&s->gb, 7); av_log(s->avctx, AV_LOG_ERROR, "I7:%X/\n", code); } - s->qscale = get_bits(&s->gb, 5); + s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); if(s->qscale < 0) return -1; |