move ff_set_qscale from h263.c to mpegvideo.c

Originally committed as revision 9567 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Aurelien Jacobs 18 years ago
parent 7d6ac9a319
commit b776e3d11b
  1. 17
      libavcodec/h263.c
  2. 16
      libavcodec/mpegvideo.c

@ -2516,23 +2516,6 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
#endif //CONFIG_ENCODERS
/**
* set qscale and update qscale dependent variables.
*/
void ff_set_qscale(MpegEncContext * s, int qscale)
{
if (qscale < 1)
qscale = 1;
else if (qscale > 31)
qscale = 31;
s->qscale = qscale;
s->chroma_qscale= s->chroma_qscale_table[qscale];
s->y_dc_scale= s->y_dc_scale_table[ qscale ];
s->c_dc_scale= s->c_dc_scale_table[ s->chroma_qscale ];
}
/**
* predicts the dc.
* encoding quantized level -> quantized diff

@ -2352,3 +2352,19 @@ static void dct_unquantize_h263_inter_c(MpegEncContext *s,
}
}
/**
* set qscale and update qscale dependent variables.
*/
void ff_set_qscale(MpegEncContext * s, int qscale)
{
if (qscale < 1)
qscale = 1;
else if (qscale > 31)
qscale = 31;
s->qscale = qscale;
s->chroma_qscale= s->chroma_qscale_table[qscale];
s->y_dc_scale= s->y_dc_scale_table[ qscale ];
s->c_dc_scale= s->c_dc_scale_table[ s->chroma_qscale ];
}

Loading…
Cancel
Save