|
|
|
@@ -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; |
|
|
|
|
|
|
|
|