From patchwork Thu Jun 17 02:31:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 28453 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp203159iol; Wed, 16 Jun 2021 19:39:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxco+dPPVhAq1SVvCP70YLtG45e8yp+QQSVtbc6NAaY6NGKrLPTb1b4TPloJH12JU38/ZGS X-Received: by 2002:a17:907:9fd:: with SMTP id ce29mr2561038ejc.396.1623897540570; Wed, 16 Jun 2021 19:39:00 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m21si4157631ejn.309.2021.06.16.19.39.00; Wed, 16 Jun 2021 19:39:00 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b="lDuGMIF/"; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8C3E168A03A; Thu, 17 Jun 2021 05:34:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075048.outbound.protection.outlook.com [40.92.75.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 51065689BE0 for ; Thu, 17 Jun 2021 05:33:59 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ET90Ln2eOpVOlt9BJvWu35FSaKnOmEdBrs97+XCahjRZF/29HoFwumYPRvKK6s/4sWOvktLbJI/SV2ltTdVXEga4N1Iqh7kQPU3hQmSQ3gi7f00WUd1PYMhkyr/HpAf3sG43dGmLUTASIHdlFTOFbTp/bcWOI8ho/KH2iTz4lWkCmYSvA7vSpxZXQ2p7x4D3gqEIAdFyjXv/e9Zp2sQoxmzxOYAXHJc1Q1wpQrFvqOod2NDJbPEDUbcLo7UA7ac9vH9h9RvYly83dt987bTwJ2ZF2nm7iDbutKHXfcwMuOUPkb3uI8tEVEhAKeqODdf7F8htMgVx/jfeX6ez7NQaEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mUW5t7NzlNXZOjGAdKEgC8iujPE70DaY64bzmbcuiT0=; b=de4ZselsZUxhgB8Hd9cmi7vJ+5T97Iz+1sdlFr1q/CbBnnvkkCUOhm5fERN5bS/rDlbaQ2ljiWDJrlMSo+TOfmhWNnFYVPLwkYcnNX0i4o+L+aIBZOCgIRYCED3KX2BqKgMZr9kabiyWzGs/JuGAQE7xW+kzQNOGmSRcfAfXntk3KeRvZwPHKI29DmlkAXC6YmpGZLI4RoeEGuIOcOBbY2WVLFXj6nV0sVzroa2vuQHwiM+8p6+vyk4uYOzHcF0qTbR8jI6qb7kYaoJEBLI4Y+0zkF92gCfVp0cDZFKGBM1u1vcXReDp3F79mPTl4BKtEP0Dkk1NsHERkHOgFVgc5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mUW5t7NzlNXZOjGAdKEgC8iujPE70DaY64bzmbcuiT0=; b=lDuGMIF/f9kty+VaNIYFCiQbYbbrAKTVkcExpjwRSb+wH9Qmd+Ee+vedhLTb1u0VMleWkm4A6u6g6t8DAlUdG+E6RRFMeTfQfV+hRvOS2XXS2cJKkXq2bKIcRscREsQn0tqLxeRLzSAsjtNZMqfH6MPMLOPhO0GwgcqbGWKt41UVtFtKsQL/NYX0XvBQ/61aUat1Nf+uBI5I79V3jmd4fzLmeyL3HUnH1sfkA9m1tk3E1u+Jz1q7hbsbtT9djkNMXF/BT/YMsWsJBcUgwG6A/e3IPTQiqPSsclx8j1zzwxdiXLUYgXHd6DJCftBwrQunt6+B+qj0xpZQA5izEvIsqg== Received: from HE1EUR04FT053.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::40) by HE1EUR04HT161.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16; Thu, 17 Jun 2021 02:33:57 +0000 Received: from VI1PR0301MB2159.eurprd03.prod.outlook.com (2a01:111:e400:7e0d::4b) by HE1EUR04FT053.mail.protection.outlook.com (2a01:111:e400:7e0d::298) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Thu, 17 Jun 2021 02:33:57 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:325C5227A25940C98520FCD124FA094A28B6C5E352492D7F38F8FA2A9A605FFB; UpperCasedChecksum:E5AD6ED588D13EABF0D343DE1BC145CCD14E6ABB95923BC350A562BCDDD2F595; SizeAsReceived:7792; Count:50 Received: from VI1PR0301MB2159.eurprd03.prod.outlook.com ([fe80::d9b:66ba:63ad:967b]) by VI1PR0301MB2159.eurprd03.prod.outlook.com ([fe80::d9b:66ba:63ad:967b%5]) with mapi id 15.20.4242.019; Thu, 17 Jun 2021 02:33:57 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 17 Jun 2021 04:31:58 +0200 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: X-TMN: [Eb1zbtQW0N7rvv1nD7UDLTlLMD9IOo6B] X-ClientProxiedBy: AM0PR04CA0115.eurprd04.prod.outlook.com (2603:10a6:208:55::20) To VI1PR0301MB2159.eurprd03.prod.outlook.com (2603:10a6:800:26::20) X-Microsoft-Original-Message-ID: <20210617023202.1318312-36-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.97.82) by AM0PR04CA0115.eurprd04.prod.outlook.com (2603:10a6:208:55::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Thu, 17 Jun 2021 02:33:28 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 5ef7c735-2476-4479-56e8-08d931384a47 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiSz7Gd0YLSftKT0G4ETHQtWtynlnDzdDr3LaV9oCj0hg7bwIg6UaWCYDNaHAU6u/1374u8WJCZX1oQ4rY3scWiUq/MjOr/iYU7UECuJdfuQVW9vUWHApMY3MFVKtvU4VURtbVuo2kbY2OMHmAGXj0NUKQWZr+QGADOxPCPv27bcO8dMuTIcv7ZIaKQzQLFrKZqq583y638fmrfSn9YxOglzOmaQZzssHl2pytnCgHI5TYpkOk+kaBTTBbFut57BRy+vKT5SONEusKt+8HSOUw9ToEcTsJPMENStt5ZrhsayhLOlBeEvwF+VbCUuAHwbiNEfGlM2GZ9xn9VnwGRl+jDz2vvx3MpyqunPEgeJ8d6Vg+49GJ+jxtRMML+ICUDQe2+H7PLpweibU79OttnEjWPCAQOnUXomaI7AGVJa+6181Nd/FqSv5Uly6pXtoRHHcwTStx+NDsP1yfbFPWgCi/sDnJ4chJnGx9Q/xAVRGOCyFNA7G2zUb/fO3JT80xPSPHvG1XRrA8L1X2fiYICBD0TC0unHc8g0lHe5TlH2NRs3cmICmTwQci5bHD8MjE8/pTS42Inl7HffcX05Nr82K3saL9WQDk4qLS3Uq7++liKOMOJ3p9TXcsbDaVYu1xIlG8f2KWGJhUOETiwcLkfj/RilKOVLJscRO3BI8Ft7LJuNiw+c7Jag47zf2XsjKy0McR9xpqrspr9mX8NBwKGDeMpxuQTAuEGb+1i2r0/9kAiTWw8ByAuCQ4shfbbTnSy0okY= X-MS-TrafficTypeDiagnostic: HE1EUR04HT161: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3xd04TJ9n4m21NaBYLAUo1XzGQVB2p3t7FgrvfphYBdCszHkPEQv9W/VVHAKAaJjdGqsXUtEu6TCig2Vgo0eV/xxr4ZFcARvzUrkACWaM7b8qgNI+8GnZxkFODY1y4fbwGiB44lEQb0yhxq5wzeitNWXZiWg82lcA6tAimxWBNWII17/ldnKr6KtfUkEXnJGE6jYz93/NU9xueK1ZZSjvOgF39UKmE//t6BAJks+zL1JTgCxJ7Rj/vGBiVKEHx5KDd3202oKRKQfns/GJa7Dv1jc+Feh+hmUNYEUJwhVIIY3uAAROJ71ku9OsR8JYW7DbvLJ+PWhTzA7JraIRki48R7ohQ+Wjdh7GnEPZ9VQCq2rX07t7ha0E2bAo0XRgqWq X-MS-Exchange-AntiSpam-MessageData: vNYIGlY/okLHLZEQuZqyyLFTd+Eemhifg4QkxqYm3qd0hVyglXlfIt+RQDzLRGmUmiWb4QkJ78YxSA+HZP3zSIEA28RCvs9/LbGrRDaWUpuDkM9kPT86LpV7IwOl4+E8NLNJ+MpXtsAEThCI7X3GxA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ef7c735-2476-4479-56e8-08d931384a47 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2021 02:33:28.6103 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT053.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR04HT161 Subject: [FFmpeg-devel] [PATCH 37/41] avcodec/mpegvideo_enc: Deduplicate ff_mpv_generic_options-based AVClasses X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: GfYVIj72ZQqv The child_class_next API relied on different (de)muxers to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt --- libavcodec/flvenc.c | 9 +-------- libavcodec/h261enc.c | 9 +-------- libavcodec/mpegvideo.h | 2 +- libavcodec/mpegvideo_enc.c | 36 +++++++++++------------------------- libavcodec/rv10enc.c | 9 +-------- libavcodec/rv20enc.c | 9 +-------- libavcodec/speedhqenc.c | 9 +-------- libavcodec/wmv2enc.c | 9 +-------- 8 files changed, 18 insertions(+), 74 deletions(-) diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c index b40178cd43..614ef20243 100644 --- a/libavcodec/flvenc.c +++ b/libavcodec/flvenc.c @@ -91,18 +91,12 @@ void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, } } -static const AVClass flv_class = { - .class_name = "flv encoder", - .item_name = av_default_item_name, - .option = ff_mpv_generic_options, - .version = LIBAVUTIL_VERSION_INT, -}; - const AVCodec ff_flv_encoder = { .name = "flv", .long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_FLV1, + .priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, @@ -110,5 +104,4 @@ const AVCodec ff_flv_encoder = { .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 = &flv_class, }; diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index da681f140a..79f680f81d 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -385,18 +385,12 @@ av_cold void ff_h261_encode_init(MpegEncContext *s) ff_thread_once(&init_static_once, h261_encode_init_static); } -static const AVClass h261_class = { - .class_name = "h261 encoder", - .item_name = av_default_item_name, - .option = ff_mpv_generic_options, - .version = LIBAVUTIL_VERSION_INT, -}; - const AVCodec ff_h261_encoder = { .name = "h261", .long_name = NULL_IF_CONFIG_SMALL("H.261"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H261, + .priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(H261Context), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, @@ -404,5 +398,4 @@ const AVCodec ff_h261_encoder = { .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 = &h261_class, }; diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 546d9c7929..76b32ea547 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -680,7 +680,7 @@ FF_MPV_OPT_CMP_FUNC, \ { "brd_scale", "Deprecated, does nothing", FF_MPV_OFFSET(brd_scale), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 3, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED }, #endif -extern const AVOption ff_mpv_generic_options[]; +extern const AVClass ff_mpv_enc_class; /** * Set the given MpegEncContext to common defaults (same for encoding 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, }; diff --git a/libavcodec/rv10enc.c b/libavcodec/rv10enc.c index c7bd76bf1a..72b25e0c55 100644 --- a/libavcodec/rv10enc.c +++ b/libavcodec/rv10enc.c @@ -63,23 +63,16 @@ int ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number) return 0; } -static const AVClass rv10_class = { - .class_name = "rv10 encoder", - .item_name = av_default_item_name, - .option = ff_mpv_generic_options, - .version = LIBAVUTIL_VERSION_INT, -}; - const AVCodec ff_rv10_encoder = { .name = "rv10", .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_RV10, + .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 = &rv10_class, }; diff --git a/libavcodec/rv20enc.c b/libavcodec/rv20enc.c index 9da4d144ad..19b6aab278 100644 --- a/libavcodec/rv20enc.c +++ b/libavcodec/rv20enc.c @@ -60,23 +60,16 @@ void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number){ } } -static const AVClass rv20_class = { - .class_name = "rv20 encoder", - .item_name = av_default_item_name, - .option = ff_mpv_generic_options, - .version = LIBAVUTIL_VERSION_INT, -}; - const AVCodec ff_rv20_encoder = { .name = "rv20", .long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_RV20, + .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 = &rv20_class, }; diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 43437223db..4a2b422f13 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -265,18 +265,12 @@ int ff_speedhq_mb_y_order_to_mb(int mb_y_order, int mb_height, int *first_in_sli } #if CONFIG_SPEEDHQ_ENCODER -static const AVClass speedhq_class = { - .class_name = "speedhq encoder", - .item_name = av_default_item_name, - .option = ff_mpv_generic_options, - .version = LIBAVUTIL_VERSION_INT, -}; - const AVCodec ff_speedhq_encoder = { .name = "speedhq", .long_name = NULL_IF_CONFIG_SMALL("NewTek SpeedHQ"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_SPEEDHQ, + .priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, @@ -286,6 +280,5 @@ const AVCodec ff_speedhq_encoder = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, - .priv_class = &speedhq_class, }; #endif diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index b3d2a05c4e..ab5365d1f6 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -214,20 +214,13 @@ void ff_wmv2_encode_mb(MpegEncContext *s, int16_t block[6][64], s->p_tex_bits += get_bits_diff(s); } -static const AVClass wmv2_class = { - .class_name = "wmv2 encoder", - .item_name = av_default_item_name, - .option = ff_mpv_generic_options, - .version = LIBAVUTIL_VERSION_INT, -}; - const AVCodec ff_wmv2_encoder = { .name = "wmv2", .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV2, + .priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(Wmv2Context), - .priv_class = &wmv2_class, .init = wmv2_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end,