diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-12-03 21:36:58 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-12-03 21:36:58 +0000 |
commit | 9015b095bc2407ebb009c1af0a1d1692ce72c46d (patch) | |
tree | 260ae5536e814d1ca978921dbc32c8198c9dddef | |
parent | bdcc13f2bf251f60bf5af33d5f88f78b63b1c81b (diff) | |
download | ffmpeg-9015b095bc2407ebb009c1af0a1d1692ce72c46d.tar.gz |
Move ff_init_qscale_tab() from h263.c to mpegvideo, the function is not h263 specific.
Originally committed as revision 20725 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/h263.c | 14 | ||||
-rw-r--r-- | libavcodec/mpegvideo.h | 1 | ||||
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 14 |
3 files changed, 15 insertions, 14 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 85da205815..831e4c1697 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -504,20 +504,6 @@ static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], i } /** - * init s->current_picture.qscale_table from s->lambda_table - */ -static void ff_init_qscale_tab(MpegEncContext *s){ - int8_t * const qscale_table= s->current_picture.qscale_table; - int i; - - for(i=0; i<s->mb_num; i++){ - unsigned int lam= s->lambda_table[ s->mb_index2xy[i] ]; - int qp= (lam*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); - qscale_table[ s->mb_index2xy[i] ]= av_clip(qp, s->avctx->qmin, s->avctx->qmax); - } -} - -/** * modify qscale so that encoding is acually possible in h263 (limit difference to -2..2) */ void ff_clean_h263_qscales(MpegEncContext *s){ diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 63d342de62..4a37ada5c9 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -855,6 +855,7 @@ int ff_h263_get_gob_height(MpegEncContext *s); void ff_mpeg4_init_direct_mv(MpegEncContext *s); int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my); void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code); +void ff_init_qscale_tab(MpegEncContext *s); /* rv10.c */ diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 47db1edd91..9b4dad49ef 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -146,6 +146,20 @@ void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix){ put_bits(pb, 1, 0); } +/** + * init s->current_picture.qscale_table from s->lambda_table + */ +void ff_init_qscale_tab(MpegEncContext *s){ + int8_t * const qscale_table= s->current_picture.qscale_table; + int i; + + for(i=0; i<s->mb_num; i++){ + unsigned int lam= s->lambda_table[ s->mb_index2xy[i] ]; + int qp= (lam*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); + qscale_table[ s->mb_index2xy[i] ]= av_clip(qp, s->avctx->qmin, s->avctx->qmax); + } +} + static void copy_picture_attributes(MpegEncContext *s, AVFrame *dst, AVFrame *src){ int i; |