diff options
author | Aurelien Jacobs | 2007-07-09 21:07:24 +0000 |
---|---|---|
committer | Aurelien Jacobs | 2007-07-09 21:07:24 +0000 |
commit | b776e3d11b9951f9a67aa19239ee1d02f773bbd0 (patch) | |
tree | a2ec5ac621cc65803a0247c0ee94e5a8c2d0e665 /libavcodec/mpegvideo.c | |
parent | 7d6ac9a319087573f4f58ae475546d99bb8f6f1b (diff) |
move ff_set_qscale from h263.c to mpegvideo.c
Originally committed as revision 9567 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 68ee6125d1..01369da8fc 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -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 ]; +} |