You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/mpeg4videodec: Set [yd]c_scale_table during init
It does not change lateron. (If we were to add short header support later, it would involve a branch in mpeg4_decode_block() anyway and we would then hardcode the dc_scaler value of eight there; the *_scale_tables would stay the same.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -1344,6 +1344,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
|
|||||||
// Note intra & rvlc should be optimized away if this is inlined
|
// Note intra & rvlc should be optimized away if this is inlined
|
||||||
|
|
||||||
if (intra) {
|
if (intra) {
|
||||||
|
// FIXME add short header support
|
||||||
if (use_intra_dc_vlc) {
|
if (use_intra_dc_vlc) {
|
||||||
/* DC coef */
|
/* DC coef */
|
||||||
if (s->partitioned_frame) {
|
if (s->partitioned_frame) {
|
||||||
@ -3407,10 +3408,6 @@ end:
|
|||||||
|
|
||||||
s->picture_number++; // better than pic number==0 always ;)
|
s->picture_number++; // better than pic number==0 always ;)
|
||||||
|
|
||||||
// FIXME add short header support
|
|
||||||
s->y_dc_scale_table = ff_mpeg4_y_dc_scale_table;
|
|
||||||
s->c_dc_scale_table = ff_mpeg4_c_dc_scale_table;
|
|
||||||
|
|
||||||
if (s->workaround_bugs & FF_BUG_EDGE) {
|
if (s->workaround_bugs & FF_BUG_EDGE) {
|
||||||
s->h_edge_pos = s->width;
|
s->h_edge_pos = s->width;
|
||||||
s->v_edge_pos = s->height;
|
s->v_edge_pos = s->height;
|
||||||
@ -3884,6 +3881,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
// so we can already set dct_unquantize_inter here once and for all.
|
// so we can already set dct_unquantize_inter here once and for all.
|
||||||
s->dct_unquantize_inter = unquant_dsp_ctx.dct_unquantize_mpeg2_inter;
|
s->dct_unquantize_inter = unquant_dsp_ctx.dct_unquantize_mpeg2_inter;
|
||||||
|
|
||||||
|
s->y_dc_scale_table = ff_mpeg4_y_dc_scale_table;
|
||||||
|
s->c_dc_scale_table = ff_mpeg4_c_dc_scale_table;
|
||||||
|
|
||||||
s->h263_pred = 1;
|
s->h263_pred = 1;
|
||||||
s->low_delay = 0; /* default, might be overridden in the vol header during header parsing */
|
s->low_delay = 0; /* default, might be overridden in the vol header during header parsing */
|
||||||
s->decode_mb = mpeg4_decode_mb;
|
s->decode_mb = mpeg4_decode_mb;
|
||||||
|
Reference in New Issue
Block a user