# HG changeset patch # User michael # Date 1070467661 0 # Node ID ccf7c96a630f4033a0097d436862c9b13efd9964 # Parent bdade3baabfc29e18e1c320d0ec1d818354de9e8 h263 modified quantization fix diff -r bdade3baabfc -r ccf7c96a630f h263dec.c --- a/h263dec.c Wed Dec 03 04:22:15 2003 +0000 +++ b/h263dec.c Wed Dec 03 16:07:41 2003 +0000 @@ -147,7 +147,7 @@ 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 -r bdade3baabfc -r ccf7c96a630f mpegvideo.c --- a/mpegvideo.c Wed Dec 03 04:22:15 2003 +0000 +++ b/mpegvideo.c Wed Dec 03 16:07:41 2003 +0000 @@ -2651,9 +2651,9 @@ /* 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 @@ } 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 -r bdade3baabfc -r ccf7c96a630f msmpeg4.c --- a/msmpeg4.c Wed Dec 03 04:22:15 2003 +0000 +++ b/msmpeg4.c Wed Dec 03 16:07:41 2003 +0000 @@ -1258,7 +1258,7 @@ 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 -r bdade3baabfc -r ccf7c96a630f wmv2.c --- a/wmv2.c Wed Dec 03 04:22:15 2003 +0000 +++ b/wmv2.c Wed Dec 03 16:07:41 2003 +0000 @@ -368,7 +368,7 @@ 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;