|
|
@ -70,11 +70,12 @@ const AVOption ff_mpv_generic_options[] = { |
|
|
|
{ NULL }, |
|
|
|
{ NULL }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], |
|
|
|
void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], |
|
|
|
uint16_t (*qmat16)[2][64], |
|
|
|
uint16_t (*qmat16)[2][64], |
|
|
|
const uint16_t *quant_matrix, |
|
|
|
const uint16_t *quant_matrix, |
|
|
|
int bias, int qmin, int qmax, int intra) |
|
|
|
int bias, int qmin, int qmax, int intra) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
DSPContext *dsp = &s->dsp; |
|
|
|
int qscale; |
|
|
|
int qscale; |
|
|
|
int shift = 0; |
|
|
|
int shift = 0; |
|
|
|
|
|
|
|
|
|
|
@ -775,10 +776,10 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) |
|
|
|
/* precompute matrix */ |
|
|
|
/* precompute matrix */ |
|
|
|
/* for mjpeg, we do include qscale in the matrix */ |
|
|
|
/* for mjpeg, we do include qscale in the matrix */ |
|
|
|
if (s->out_format != FMT_MJPEG) { |
|
|
|
if (s->out_format != FMT_MJPEG) { |
|
|
|
ff_convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16, |
|
|
|
ff_convert_matrix(s, s->q_intra_matrix, s->q_intra_matrix16, |
|
|
|
s->intra_matrix, s->intra_quant_bias, avctx->qmin, |
|
|
|
s->intra_matrix, s->intra_quant_bias, avctx->qmin, |
|
|
|
31, 1); |
|
|
|
31, 1); |
|
|
|
ff_convert_matrix(&s->dsp, s->q_inter_matrix, s->q_inter_matrix16, |
|
|
|
ff_convert_matrix(s, s->q_inter_matrix, s->q_inter_matrix16, |
|
|
|
s->inter_matrix, s->inter_quant_bias, avctx->qmin, |
|
|
|
s->inter_matrix, s->inter_quant_bias, avctx->qmin, |
|
|
|
31, 0); |
|
|
|
31, 0); |
|
|
|
} |
|
|
|
} |
|
|
@ -3365,7 +3366,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) |
|
|
|
s->y_dc_scale_table= |
|
|
|
s->y_dc_scale_table= |
|
|
|
s->c_dc_scale_table= ff_mpeg2_dc_scale_table[s->intra_dc_precision]; |
|
|
|
s->c_dc_scale_table= ff_mpeg2_dc_scale_table[s->intra_dc_precision]; |
|
|
|
s->intra_matrix[0] = ff_mpeg2_dc_scale_table[s->intra_dc_precision][8]; |
|
|
|
s->intra_matrix[0] = ff_mpeg2_dc_scale_table[s->intra_dc_precision][8]; |
|
|
|
ff_convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16, |
|
|
|
ff_convert_matrix(s, s->q_intra_matrix, s->q_intra_matrix16, |
|
|
|
s->intra_matrix, s->intra_quant_bias, 8, 8, 1); |
|
|
|
s->intra_matrix, s->intra_quant_bias, 8, 8, 1); |
|
|
|
s->qscale= 8; |
|
|
|
s->qscale= 8; |
|
|
|
} |
|
|
|
} |
|
|
|