You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/mpegvideo: Don't initialize [yc]_dc_scale_table by default
Only the H.263-based decoders as well as the encoders need it; so move it to ff_h263_decode_init() as well as ff_mpv_encode_init(). Also for the latter make it only set these tables if none are already set. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -41,8 +41,8 @@
|
|||||||
#include "mpeg_er.h"
|
#include "mpeg_er.h"
|
||||||
#include "mpeg4video.h"
|
#include "mpeg4video.h"
|
||||||
#include "mpeg4videodec.h"
|
#include "mpeg4videodec.h"
|
||||||
#include "mpeg4videodefs.h"
|
|
||||||
#include "mpegvideo.h"
|
#include "mpegvideo.h"
|
||||||
|
#include "mpegvideodata.h"
|
||||||
#include "mpegvideodec.h"
|
#include "mpegvideodec.h"
|
||||||
#include "msmpeg4dec.h"
|
#include "msmpeg4dec.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
@@ -102,6 +102,9 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
|
|||||||
s->decode_mb = ff_h263_decode_mb;
|
s->decode_mb = ff_h263_decode_mb;
|
||||||
s->low_delay = 1;
|
s->low_delay = 1;
|
||||||
|
|
||||||
|
s->y_dc_scale_table =
|
||||||
|
s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
|
||||||
|
|
||||||
// dct_unquantize defaults for H.263;
|
// dct_unquantize defaults for H.263;
|
||||||
// they might change on a per-frame basis for MPEG-4.
|
// they might change on a per-frame basis for MPEG-4.
|
||||||
s->dct_unquantize_intra = s->dct_unquantize_h263_intra;
|
s->dct_unquantize_intra = s->dct_unquantize_h263_intra;
|
||||||
|
@@ -482,8 +482,6 @@ int ff_update_duplicate_context(MpegEncContext *dst, const MpegEncContext *src)
|
|||||||
*/
|
*/
|
||||||
av_cold void ff_mpv_common_defaults(MpegEncContext *s)
|
av_cold void ff_mpv_common_defaults(MpegEncContext *s)
|
||||||
{
|
{
|
||||||
s->y_dc_scale_table =
|
|
||||||
s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
|
|
||||||
s->chroma_qscale_table = ff_default_chroma_qscale_table;
|
s->chroma_qscale_table = ff_default_chroma_qscale_table;
|
||||||
s->progressive_frame = 1;
|
s->progressive_frame = 1;
|
||||||
s->progressive_sequence = 1;
|
s->progressive_sequence = 1;
|
||||||
|
@@ -276,7 +276,6 @@ static av_cold void mpv_encode_init_static(void)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the given MpegEncContext to defaults for encoding.
|
* Set the given MpegEncContext to defaults for encoding.
|
||||||
* the changed fields will not depend upon the prior state of the MpegEncContext.
|
|
||||||
*/
|
*/
|
||||||
static av_cold void mpv_encode_defaults(MpegEncContext *s)
|
static av_cold void mpv_encode_defaults(MpegEncContext *s)
|
||||||
{
|
{
|
||||||
@@ -288,6 +287,11 @@ static av_cold void mpv_encode_defaults(MpegEncContext *s)
|
|||||||
|
|
||||||
s->fcode_tab = default_fcode_tab + MAX_MV;
|
s->fcode_tab = default_fcode_tab + MAX_MV;
|
||||||
|
|
||||||
|
if (!s->y_dc_scale_table) {
|
||||||
|
s->y_dc_scale_table =
|
||||||
|
s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
|
||||||
|
}
|
||||||
|
|
||||||
s->input_picture_number = 0;
|
s->input_picture_number = 0;
|
||||||
s->picture_in_gop_number = 0;
|
s->picture_in_gop_number = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user