Commit 6beeb962 authored by Michael Niedermayer's avatar Michael Niedermayer

h263 modified quantization fix

Originally committed as revision 2557 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b7cbfc23
......@@ -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;
......
......@@ -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]);
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment