Mercurial > libavcodec.hg
comparison h263.c @ 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 | 95f3daa991a2 |
children | f56b8a9be9e1 |
comparison
equal
deleted
inserted
replaced
10635:2938c3bc34c7 | 10636:703cfed31320 |
---|---|
498 /* left prediction */ | 498 /* left prediction */ |
499 for(i=1; i<8; i++){ | 499 for(i=1; i<8; i++){ |
500 block[n][s->dsp.idct_permutation[i<<3]]= ac_val[i ]; | 500 block[n][s->dsp.idct_permutation[i<<3]]= ac_val[i ]; |
501 } | 501 } |
502 } | 502 } |
503 } | |
504 } | |
505 | |
506 /** | |
507 * init s->current_picture.qscale_table from s->lambda_table | |
508 */ | |
509 static void ff_init_qscale_tab(MpegEncContext *s){ | |
510 int8_t * const qscale_table= s->current_picture.qscale_table; | |
511 int i; | |
512 | |
513 for(i=0; i<s->mb_num; i++){ | |
514 unsigned int lam= s->lambda_table[ s->mb_index2xy[i] ]; | |
515 int qp= (lam*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); | |
516 qscale_table[ s->mb_index2xy[i] ]= av_clip(qp, s->avctx->qmin, s->avctx->qmax); | |
517 } | 503 } |
518 } | 504 } |
519 | 505 |
520 /** | 506 /** |
521 * modify qscale so that encoding is acually possible in h263 (limit difference to -2..2) | 507 * modify qscale so that encoding is acually possible in h263 (limit difference to -2..2) |