diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 7f018e313b50e92579dda2d1e8dabd425494b0d9..450781886d1b7cf4aef1ce8e759692b250ef27c1 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -626,7 +626,7 @@ OBJS-$(CONFIG_SONIC_DECODER) += sonic.o OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o OBJS-$(CONFIG_SONIC_LS_ENCODER) += sonic.o OBJS-$(CONFIG_SPEEDHQ_DECODER) += speedhq.o mpeg12.o mpeg12data.o simple_idct.o -OBJS-$(CONFIG_SPEEDHQ_ENCODER) += speedhq.o mpeg12data.o speedhqenc.o +OBJS-$(CONFIG_SPEEDHQ_ENCODER) += speedhq.o mpeg12data.o mpeg12enc.o speedhqenc.o OBJS-$(CONFIG_SP5X_DECODER) += sp5xdec.o OBJS-$(CONFIG_SRGC_DECODER) += mscc.o OBJS-$(CONFIG_SRT_DECODER) += srtdec.o ass.o htmlsubtitles.o diff --git a/libavcodec/mpeg12.h b/libavcodec/mpeg12.h index 345d473d3a23ee0e1a15c6dfb5256a8320548d5e..9a7c2b66b38c74ce5e2e4054d166eca4494a7c52 100644 --- a/libavcodec/mpeg12.h +++ b/libavcodec/mpeg12.h @@ -37,6 +37,7 @@ void ff_mpeg12_common_init(MpegEncContext *s); } void ff_init_2d_vlc_rl(RLTable *rl, unsigned static_size, int flags); +void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len); static inline int decode_dc(GetBitContext *gb, int component) { diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index ac4af19ae736463a382451064252757788300b1e..d399e9e75ec7b551eefc56f769118f678b3ac0af 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -27,6 +27,7 @@ #include +#include "config.h" #include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/log.h" @@ -44,6 +45,7 @@ #include "mpegvideo.h" #include "profiles.h" +#if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER static const uint8_t svcd_scan_offset_placeholder[] = { 0x10, 0x0E, 0x00, 0x80, 0x81, 0x00, 0x80, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -64,8 +66,9 @@ static uint8_t mpeg1_index_run[2][64]; static int8_t mpeg1_max_level[2][64]; #define A53_MAX_CC_COUNT 0x1f +#endif /* CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER */ -static av_cold void init_uni_ac_vlc(RLTable *rl, uint8_t *uni_ac_vlc_len) +av_cold void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len) { int i; @@ -100,6 +103,7 @@ static av_cold void init_uni_ac_vlc(RLTable *rl, uint8_t *uni_ac_vlc_len) } } +#if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER static int find_frame_rate_index(MpegEncContext *s) { int i; @@ -1045,8 +1049,8 @@ static av_cold void mpeg12_encode_init_static(void) mpeg1_index_run[0][i] = ff_rl_mpeg1.index_run[0][i]; } - init_uni_ac_vlc(&ff_rl_mpeg1, uni_mpeg1_ac_vlc_len); - init_uni_ac_vlc(&ff_rl_mpeg2, uni_mpeg2_ac_vlc_len); + ff_mpeg1_init_uni_ac_vlc(&ff_rl_mpeg1, uni_mpeg1_ac_vlc_len); + ff_mpeg1_init_uni_ac_vlc(&ff_rl_mpeg2, uni_mpeg2_ac_vlc_len); /* build unified dc encoding tables */ for (int i = -255; i < 256; i++) { @@ -1222,3 +1226,4 @@ AVCodec ff_mpeg2video_encoder = { .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .priv_class = &mpeg2_class, }; +#endif /* CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER */ diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 3bda2a8453768708cb01a4ff5334c1d16ebe9a00..51f67c0d5ef5221b4eb705defca460e2404df01e 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -104,7 +104,7 @@ static av_cold void speedhq_init_static_data(void) speedhq_chr_dc_uni[i + 255] = bits + (code << 8); } - ff_init_uni_ac_vlc(&ff_rl_speedhq, uni_speedhq_ac_vlc_len); + ff_mpeg1_init_uni_ac_vlc(&ff_rl_speedhq, uni_speedhq_ac_vlc_len); } av_cold int ff_speedhq_encode_init(MpegEncContext *s)