1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avcodec/mpegvideo_enc: Add intra_chroma_ac_vlc_length, it will be needed for mjpeg

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-02-11 00:34:02 +01:00
parent 194165aed8
commit 7366bb38f1
2 changed files with 16 additions and 4 deletions

View File

@ -443,6 +443,8 @@ typedef struct MpegEncContext {
int ac_esc_length; ///< num of bits needed to encode the longest esc int ac_esc_length; ///< num of bits needed to encode the longest esc
uint8_t *intra_ac_vlc_length; uint8_t *intra_ac_vlc_length;
uint8_t *intra_ac_vlc_last_length; uint8_t *intra_ac_vlc_last_length;
uint8_t *intra_chroma_ac_vlc_length;
uint8_t *intra_chroma_ac_vlc_last_length;
uint8_t *inter_ac_vlc_length; uint8_t *inter_ac_vlc_length;
uint8_t *inter_ac_vlc_last_length; uint8_t *inter_ac_vlc_last_length;
uint8_t *luma_dc_vlc_length; uint8_t *luma_dc_vlc_length;

View File

@ -3813,8 +3813,13 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
qmat = n < 4 ? s->q_intra_matrix[qscale] : s->q_chroma_intra_matrix[qscale]; qmat = n < 4 ? s->q_intra_matrix[qscale] : s->q_chroma_intra_matrix[qscale];
if(s->mpeg_quant || s->out_format == FMT_MPEG1) if(s->mpeg_quant || s->out_format == FMT_MPEG1)
bias= 1<<(QMAT_SHIFT-1); bias= 1<<(QMAT_SHIFT-1);
length = s->intra_ac_vlc_length; if (n > 3 && s->intra_chroma_ac_vlc_length) {
last_length= s->intra_ac_vlc_last_length; length = s->intra_chroma_ac_vlc_length;
last_length= s->intra_chroma_ac_vlc_last_length;
} else {
length = s->intra_ac_vlc_length;
last_length= s->intra_ac_vlc_last_length;
}
} else { } else {
start_i = 0; start_i = 0;
last_non_zero = -1; last_non_zero = -1;
@ -4123,8 +4128,13 @@ static int messed_sign=0;
start_i = 1; start_i = 1;
// if(s->mpeg_quant || s->out_format == FMT_MPEG1) // if(s->mpeg_quant || s->out_format == FMT_MPEG1)
// bias= 1<<(QMAT_SHIFT-1); // bias= 1<<(QMAT_SHIFT-1);
length = s->intra_ac_vlc_length; if (n > 3 && s->intra_chroma_ac_vlc_length) {
last_length= s->intra_ac_vlc_last_length; length = s->intra_chroma_ac_vlc_length;
last_length= s->intra_chroma_ac_vlc_last_length;
} else {
length = s->intra_ac_vlc_length;
last_length= s->intra_ac_vlc_last_length;
}
} else { } else {
dc= 0; dc= 0;
start_i = 0; start_i = 0;