Mercurial > libavcodec.hg
changeset 10636:703cfed31320 libavcodec
Move ff_init_qscale_tab() from h263.c to mpegvideo, the function is not h263 specific.
author | michael |
---|---|
date | Thu, 03 Dec 2009 21:36:58 +0000 |
parents | 2938c3bc34c7 |
children | afd44c3040f5 |
files | h263.c mpegvideo.h mpegvideo_enc.c |
diffstat | 3 files changed, 15 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/h263.c Thu Dec 03 19:19:57 2009 +0000 +++ b/h263.c Thu Dec 03 21:36:58 2009 +0000 @@ -504,20 +504,6 @@ } /** - * 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){
--- a/mpegvideo.h Thu Dec 03 19:19:57 2009 +0000 +++ b/mpegvideo.h Thu Dec 03 21:36:58 2009 +0000 @@ -855,6 +855,7 @@ 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 */
--- a/mpegvideo_enc.c Thu Dec 03 19:19:57 2009 +0000 +++ b/mpegvideo_enc.c Thu Dec 03 21:36:58 2009 +0000 @@ -146,6 +146,20 @@ 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;