From patchwork Fri May 27 08:29:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 35949 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp773048pzj; Fri, 27 May 2022 01:30:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPdDyM8MDpSQ1QPihNcWGC66KLD5tOwxF3QWafFOfYnJ0U4aMzoPS04M4vz1Y2KoUlcYrL X-Received: by 2002:a17:906:99c3:b0:6ff:1254:7227 with SMTP id s3-20020a17090699c300b006ff12547227mr10568890ejn.692.1653640201359; Fri, 27 May 2022 01:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653640201; cv=none; d=google.com; s=arc-20160816; b=K+ZMkqLsFZgg/mL6Vq9QTXGGNpvxXUCu786wGv9BjVh4CYw3GIumN3I33qhT0fwt0D 2bZtQfolPYt47t2xySBRL2kmZraOofQwX3sEe2Ku/Yx9sg9XyCBat4z/BbOanWx7V4Kc HQ++/wJMPwf7COFHFewgARGSgHSuVXxyekrQcfWBOqD40dhIzvx/21ioWZpz+hqoCwoi 3Bt8VmNM4OYpBW3cQ/+SSari/RZV7cIEM40kZXT7obirBr4o34paPWX62X1InKEPzDfF UVo0xGsPqFegvM53jCgNmmb1EFedAeqbORxA8sdilnK1g8HIAtFkl801EaoyixJh4nEz lhyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=btr93LzFanbcIQqZ3eKMkTO2J5RtNX9EH94ZSWUK4K4=; b=vCksVohy+kS7k58xqGy2uPOUMVzVW65tKwokXVs3imB8bF8Ja9OsAFlyCOh1nrtvwg cPXK5TNHt1Ode3xbTq+Gbyx6m1Kq+sRYsxnffRi33TtH3y/+InbLYl4HHf3nQB32wqdV PwAjUIPOV3znASHRQGZFsEJyAweD50UfnMuOyRflf7mQVXLLLh7PD1FjmN9KAJrMrTlk iGk5Ot/sEYLzcBV3JhFSzglpRVYfqsjIsNB9Ltst2Nt3AK09LiMVQliU4W/sCszal/Yl OS68EQJH5EwFmw6utA9kEE+fPCdopOgW2q2re98soOpUhZLkOebrKVMhZunaq5FBlDH3 g0ew== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id nd4-20020a170907628400b006fe9b64d900si3885137ejc.738.2022.05.27.01.30.00; Fri, 27 May 2022 01:30:01 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C3BBC68B1AA; Fri, 27 May 2022 11:29:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3D7EF68B0DB for ; Fri, 27 May 2022 11:29:50 +0300 (EEST) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4L8dJq421bz9sqH for ; Fri, 27 May 2022 10:29:47 +0200 (CEST) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Fri, 27 May 2022 13:59:22 +0530 Message-Id: <20220527082922.994-1-ffmpeg@gyani.pro> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4L8dJq421bz9sqH Subject: [FFmpeg-devel] [PATCH] avcodec/libx264: remove support for x262 MPEG-2 encoder 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 2Bbw+fdreyX9 Support for 'libx262' was added in e56f14659f by merging Libav e1319aa1c1. The Libav commit author believed that "x262 is a subfeature of x264" but this is not the case. Kieran Kuhnya added support for MPEG-2 encoding in *his fork* of x264. See https://github.com/kierank/x262/commit/6851000e27 So there are two issues: 1) Our configure enables libx262 implicitly if libx264 is enabled and a x262 constant is defined in x264.h; this will never be fulfilled with native x264. Users would have to build x262 and use the libx264 generated there. Which brings us to the 2nd issue. 2) Development on the x262 repo stopped in 2015. So, it's likely API and ABI incompatible with native x264 and thus our current wrapper. If support for x262 is desired it will have to be added as a distinct component or by integrating the fork changes in x264. --- Changelog | 1 + configure | 5 +---- libavcodec/Makefile | 1 - libavcodec/allcodecs.c | 1 - libavcodec/libx264.c | 34 ---------------------------------- 5 files changed, 2 insertions(+), 40 deletions(-) diff --git a/Changelog b/Changelog index 53130f072f..40fbaf0ff2 100644 --- a/Changelog +++ b/Changelog @@ -17,6 +17,7 @@ version 5.1: - multiply video filter - PGS subtitle frame merge bitstream filter - blurdetect filter +- removed libx262 support version 5.0: diff --git a/configure b/configure index 5a167613a4..29cb63019b 100755 --- a/configure +++ b/configure @@ -2472,7 +2472,6 @@ CONFIG_EXTRA=" ividsp jpegtables lgplv3 - libx262 llauddsp llviddsp llvidencdsp @@ -3375,7 +3374,6 @@ libvpx_vp9_decoder_deps="libvpx" libvpx_vp9_encoder_deps="libvpx" libwebp_encoder_deps="libwebp" libwebp_anim_encoder_deps="libwebp" -libx262_encoder_deps="libx262" libx264_encoder_deps="libx264" libx264_encoder_select="atsc_a53" libx264rgb_encoder_deps="libx264" @@ -6661,8 +6659,7 @@ enabled libwebp && { enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode || { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" && warn "using libx264 without pkg-config"; } } && - require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && - check_cpp_condition libx262 x264.h "X264_MPEG2" + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && require_cpp_condition libx265 x265.h "X265_BUILD >= 70" enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 38425d2f22..2c6be86b1e 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1096,7 +1096,6 @@ OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o libvpx.o OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o libvpx.o OBJS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc_common.o libwebpenc.o OBJS-$(CONFIG_LIBWEBP_ANIM_ENCODER) += libwebpenc_common.o libwebpenc_animencoder.o -OBJS-$(CONFIG_LIBX262_ENCODER) += libx264.o OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o OBJS-$(CONFIG_LIBX265_ENCODER) += libx265.o OBJS-$(CONFIG_LIBXAVS_ENCODER) += libxavs.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index c47133aa18..f7320fceee 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -780,7 +780,6 @@ extern FFCodec ff_libvpx_vp9_decoder; /* preferred over libwebp */ extern const FFCodec ff_libwebp_anim_encoder; extern const FFCodec ff_libwebp_encoder; -extern const FFCodec ff_libx262_encoder; #if CONFIG_LIBX264_ENCODER #include #if X264_BUILD < 153 diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 4ce3791ae8..ad86665d15 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -644,12 +644,6 @@ static av_cold int X264_init(AVCodecContext *avctx) if (avctx->global_quality > 0) av_log(avctx, AV_LOG_WARNING, "-qscale is ignored, -crf is recommended.\n"); -#if CONFIG_LIBX262_ENCODER - if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO) { - x4->params.b_mpeg2 = 1; - x264_param_default_mpeg2(&x4->params); - } else -#endif x264_param_default(&x4->params); x4->params.b_deblocking_filter = avctx->flags & AV_CODEC_FLAG_LOOP_FILTER; @@ -1275,31 +1269,3 @@ const FFCodec ff_libx264rgb_encoder = { , }; #endif - -#if CONFIG_LIBX262_ENCODER -static const AVClass X262_class = { - .class_name = "libx262", - .item_name = av_default_item_name, - .option = options, - .version = LIBAVUTIL_VERSION_INT, -}; - -const FFCodec ff_libx262_encoder = { - .p.name = "libx262", - .p.long_name = NULL_IF_CONFIG_SMALL("libx262 MPEG2VIDEO"), - .p.type = AVMEDIA_TYPE_VIDEO, - .p.id = AV_CODEC_ID_MPEG2VIDEO, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | - AV_CODEC_CAP_OTHER_THREADS | - AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, - .p.pix_fmts = pix_fmts_8bit, - .p.priv_class = &X262_class, - .p.wrapper_name = "libx264", - .priv_data_size = sizeof(X264Context), - .init = X264_init, - FF_CODEC_ENCODE_CB(X264_frame), - .close = X264_close, - .defaults = x264_defaults, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, -}; -#endif