diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-06-07 16:13:33 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-07-08 20:10:17 +0200 |
commit | 34ff543672e19d5b6d3879981080ea5639fa6e04 (patch) | |
tree | c2465ca1075234242b79d16bf8d1100c9285723b /libavcodec/mpegvideo_enc.c | |
parent | 19d8077e3172dfac6efd5995903b2ae22cc52744 (diff) | |
download | ffmpeg-34ff543672e19d5b6d3879981080ea5639fa6e04.tar.gz |
avcodec/mpegvideo_enc: Deduplicate ff_mpv_generic_options-based AVClasses
The child_class_next API relied on different AVCodecs to use
different AVClasses; yet this API has been replaced by
child_class_iterate.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 794ca017a4..3d4ffdf021 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -85,7 +85,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s, int16_t *block, int n, int static uint8_t default_mv_penalty[MAX_FCODE + 1][MAX_DMV * 2 + 1]; static uint8_t default_fcode_tab[MAX_MV * 2 + 1]; -const AVOption ff_mpv_generic_options[] = { +static const AVOption mpv_generic_options[] = { FF_MPV_COMMON_OPTS #if FF_API_MPEGVIDEO_OPTS FF_MPV_DEPRECATED_MPEG_QUANT_OPT @@ -96,6 +96,13 @@ const AVOption ff_mpv_generic_options[] = { { NULL }, }; +const AVClass ff_mpv_enc_class = { + .class_name = "generic mpegvideo encoder", + .item_name = av_default_item_name, + .option = mpv_generic_options, + .version = LIBAVUTIL_VERSION_INT, +}; + void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], uint16_t (*qmat16)[2][64], const uint16_t *quant_matrix, @@ -4648,32 +4655,18 @@ const AVCodec ff_h263p_encoder = { .priv_class = &h263p_class, }; -static const AVClass msmpeg4v2_class = { - .class_name = "msmpeg4v2 encoder", - .item_name = av_default_item_name, - .option = ff_mpv_generic_options, - .version = LIBAVUTIL_VERSION_INT, -}; - const AVCodec ff_msmpeg4v2_encoder = { .name = "msmpeg4v2", .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MSMPEG4V2, + .priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &msmpeg4v2_class, -}; - -static const AVClass msmpeg4v3_class = { - .class_name = "msmpeg4v3 encoder", - .item_name = av_default_item_name, - .option = ff_mpv_generic_options, - .version = LIBAVUTIL_VERSION_INT, }; const AVCodec ff_msmpeg4v3_encoder = { @@ -4681,20 +4674,13 @@ const AVCodec ff_msmpeg4v3_encoder = { .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MSMPEG4V3, + .priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &msmpeg4v3_class, -}; - -static const AVClass wmv1_class = { - .class_name = "wmv1 encoder", - .item_name = av_default_item_name, - .option = ff_mpv_generic_options, - .version = LIBAVUTIL_VERSION_INT, }; const AVCodec ff_wmv1_encoder = { @@ -4702,11 +4688,11 @@ const AVCodec ff_wmv1_encoder = { .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV1, + .priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &wmv1_class, }; |