From patchwork Tue Apr 6 21:55:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 26784 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id BA10944AF20 for ; Wed, 7 Apr 2021 00:55:58 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9F51E68A6EB; Wed, 7 Apr 2021 00:55:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-oln040092068010.outbound.protection.outlook.com [40.92.68.10]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E853B68A6B5 for ; Wed, 7 Apr 2021 00:55:54 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=byfkqYttNuM/Rx2ur8Z0tFwW3zpgxZkV7V6ZwlPxtelPKEHXd6k8l54xZStatn4VD5bILAu5d2c3NfxD8VEv3u7+TND3TygXdldGJcBR5TlRZmsBHEeGM0UcSMASO5NgIeou6JURCiaaQSev++96NZo3fE9MsVC8/IsrwKwNMxLHdnM/4DI5zouEu4vBRtG3Ychz+1jwTi5kStbvgnZJ+7B43FAUYm49Gg8bKqMEPvPq2CBSuoe6RmfjCe4FPZxyKx1w0d+6tU7SGuplzRkJ4dqLnK9AtA61yja+Dbw6HwzD7bb+LXeCyFVXqM19szWW+hfRMeJ9vV26thewHVMqQA== 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=aYAMyJnCLttg4pXo5Z4Uq8BgchgZ9SuUbJgb8pTyMoc=; b=F6YZVA56Y2o07WRxEs6hjICL66oGBd31YPzlVKp/8IRJKuiP9fGz9u1BsmLBlpDimf36+QmcAn9gwjeqlZB4bi+pulOWOYujrviM6m3ALPSQ3pboKRt41hjd8GkCeiCY9xi8/8M8Pj49JEK0oV7WjkMh9Lc8p9c0PQg3FWrXVChelu7IaXF/fIpe1EmzhezKqzPRYg1FW+0O+R4GYWkzgDozMST3DWbM4zdTiqEoHZSrQeVYQHwPvzg0rJoLACs6xJQjyszJzP3ad9p43CMNjDolBDo9jksCFHyEHcMkNyLYNvUALaVMWiUja7jbtTMhpqPpjVVf5/lLqTdHByGTtw== 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=aYAMyJnCLttg4pXo5Z4Uq8BgchgZ9SuUbJgb8pTyMoc=; b=K8wuCgA4pKofm4W656tkGY3mTCi6/zSgUpOiYYR+lc2K85uONVLaCww0KRXj0itWGKjolqnKxuTu/boXV/HkHclMRBJxTfsxyjF0lH5ts8PIJlY/z5iO4OAkNPK8aRnNz/bJpuMJbOkUf1YZitlL4NZZfJgSOScb37Z0X3jDACXadY41/iA0iunfnlMNWpgd4lvst+2slwCid4vVH5O6R6Uw3DgLYGx3rvA3k6KJzq/XygJHb4yrVwK+2y/2F+a1oiw3f+hNb/+T/+QfNuQmb3pIePM13bgeZGSSJJtLv3n+lpbjT1aow3e8/kRSls1QLyTnbJLl+z3jzFOETQFFtA== Received: from AM5EUR02FT037.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1c::45) by AM5EUR02HT005.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1c::89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Tue, 6 Apr 2021 21:55:53 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:7e1c::46) by AM5EUR02FT037.mail.protection.outlook.com (2a01:111:e400:7e1c::182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28 via Frontend Transport; Tue, 6 Apr 2021 21:55:53 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A8767CD6EBBCDD173736D639D96A9B47109460B8743366B744CBFDD452812E1F; UpperCasedChecksum:24428FCB2388465AC7FBDDAF94502C82F3FD92DEC3EFF6CC84A20CCDCDACFE63; SizeAsReceived:7611; Count:48 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com ([fe80::8128:5de5:4e94:9a21]) by HE1PR0301MB2154.eurprd03.prod.outlook.com ([fe80::8128:5de5:4e94:9a21%3]) with mapi id 15.20.3999.032; Tue, 6 Apr 2021 21:55:53 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 6 Apr 2021 23:55:15 +0200 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: X-TMN: [aKsOLJhMFdbtuL9TMuNahQOIuKXBasIJ] X-ClientProxiedBy: ZR0P278CA0046.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::15) To HE1PR0301MB2154.eurprd03.prod.outlook.com (2603:10a6:3:2a::22) X-Microsoft-Original-Message-ID: <20210406215516.832944-9-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.137.96) by ZR0P278CA0046.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.16 via Frontend Transport; Tue, 6 Apr 2021 21:55:52 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: d682f9ff-e80a-4d20-2653-08d8f946bfb3 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRct5ooVDkA416xUUNF5iBFPPrWu/Sm0ARzAe4EeYrZx3e0JMG0s4ImwR1hPfDmG0t38VUFTxV4RmSFr5ZiTQLCdr5BdfghYEHF5BvHtL4JVRvlJZKQYz1q1+bnEEmWKTv6Ec8GkaZP6/qBuilNSBdr0rGR4ETahqTk6Vdwp9iHVOVuBxcS4W2sJIL8lJjWzz1xIlpBTojwO9j+tYv/1DvQzP4aLZLKeiVAP3nkdzXp0dzkjuXG55sXQTX+XPzYQkGQ/+Il2huIyQ5CeLoWFXHPyHmuN2nmMiGYNkcodXTygbzIilbGKjM2x84b4kvZ8jLA1aIVZHAhuoxGY2pjNMWjV0JppiWkvlVN5ekr/OBLRVrF5nyJgZLiuG5rc8gAAgjsyC/irmzrrwkyQOPAVA7q6X5zdRx9FFZAKd84Ntcng37Hthi/IbPNKz/CffjgDyuNNh3xjsQm7PkBE9DyyheGU3n5MGBUYzTImsXlJi6rFWCHdfxN9K5/Nd/+ZJr0QpZjqk5v2/94txv7LUHDVp+4SVPV63lil/WqpWCFzJ10GcdrBuZx38hb6xtejvYUHH9SzcJW6DsDa5xbwR5OulSC49KngfHWHBwdgaz7dERrmpiyoObAzs8T7U6DmAQOtJz2yGNThOVr9q/XUzS3uu6+T1+bEgSdIsn33y9bKSpvsCmEaMai6KDnqxl9ehwLX319y1c+MBybi6+P2V9OxBmT/JTKGW28afRGbw+yq6rPBY+Fs6MJVA+Cg4L6HSe1olM= X-MS-TrafficTypeDiagnostic: AM5EUR02HT005: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v84pzypIkGr+2VRlTxNjS9H+dtInnOx3ehdfp4bPIN4rkIhT9dS6m9EDvAuQicM22w0/JU4GHrnZKoGbuAuuTXQ3iY5T9/cNXH1Qa8wGabbtfRSbiZcMJcpVZBRwW+JGZUsgRKHkvf6M6S4h1BVVhejm2tJrcaqMkIq5W9I5gKwiHFC/HzbuqFDyC1zeEU8bxIfhXM+f6XfXNtWDL5J4sjYMDC+5tvo/M3S8CYADhplNt2E/IK+RojW6nCopvQ9JZGP1L+QPOLh+m0UdR31xxEXOjLmJisHH6KlUa0p3+LgN24/aof8OJVTL8ow6ZMHyUYvpCy2Duq4hXUz7FVmsWnEmT8tJVOwOLgomnBV98PL6D8EqZhfYrXSr/U1oS18hpT8Ps1RsIry+cxDl1tv9kg== X-MS-Exchange-AntiSpam-MessageData: 0tsp9+IswUWI6H7xHndgVhqshc2NOk1HFUeqNZl4GJLeudz0c4uNjKSSl7dxPdIvJy4UmYK+YkVgtg6pxDMOoIHMxtoXERh2/XCUpfxgo/VF9I08k1jvACFBXH6tSME9enbWT6n7cZfSDMXtqzrJzg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d682f9ff-e80a-4d20-2653-08d8f946bfb3 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2021 21:55:53.4180 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM5EUR02FT037.eop-EUR02.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: AM5EUR02HT005 Subject: [FFmpeg-devel] [PATCH 18/19] avcodec/mpegvideo: Deprecate bframe opts for encoders not supporting them X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" MPEG-1/2/4 are the only mpegvideo based encoders that support bframes; yet even the encoders not supporting bframes have options that only make sense for an encoder that supports bframes; setting any of these options for such an encoder has no impact on the encoded outcome (but setting b_strategy to two slows down encoding considerably). So deprecate these options. Signed-off-by: Andreas Rheinhardt --- It seems to me that MJPEG/AMV does not use the motion estimation code at all (or rather, the options don't affect the output). If so, these options should be deprecated/removed as well. Will look into this. libavcodec/mjpegenc.c | 1 + libavcodec/mpeg12enc.c | 1 + libavcodec/mpeg4videoenc.c | 1 + libavcodec/mpegvideo.h | 12 +++++++++--- libavcodec/mpegvideo_enc.c | 3 +++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index 792169d6bb..b355f97f14 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -597,6 +597,7 @@ FF_MPV_COMMON_OPTS #if FF_API_MPEGVIDEO_OPTS FF_MPV_DEPRECATED_MPEG_QUANT_OPT FF_MPV_DEPRECATED_A53_CC_OPT +FF_MPV_DEPRECATED_BFRAME_OPTS #endif { NULL}, }; diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 0b88408046..dccb11b222 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -1148,6 +1148,7 @@ av_cold void ff_mpeg1_encode_init(MpegEncContext *s) OFFSET(scan_offset), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, \ { "timecode_frame_start", "GOP timecode frame start number, in non-drop-frame format", \ OFFSET(timecode_frame_start), AV_OPT_TYPE_INT64, {.i64 = -1 }, -1, INT64_MAX, VE}, \ + FF_MPV_COMMON_BFRAME_OPTS static const AVOption mpeg1_options[] = { COMMON_OPTS diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index f97c506d13..7145bfe8ce 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -1377,6 +1377,7 @@ static const AVOption options[] = { { "alternate_scan", "Enable alternate scantable.", OFFSET(alternate_scan), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "mpeg_quant", "Use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, VE }, + FF_MPV_COMMON_BFRAME_OPTS FF_MPV_COMMON_OPTS #if FF_API_MPEGVIDEO_OPTS FF_MPV_DEPRECATED_A53_CC_OPT diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 9a6ad75166..30dcf99188 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -662,9 +662,6 @@ FF_MPV_OPT_CMP_FUNC, \ { "zero", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_ZERO }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \ { "epzs", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_EPZS }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \ { "xone", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_XONE }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \ -{"b_strategy", "Strategy to choose between I/P/B-frames", FF_MPV_OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 2, FF_MPV_OPT_FLAGS }, \ -{"b_sensitivity", "Adjust sensitivity of b_frame_strategy 1", FF_MPV_OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.i64 = 40 }, 1, INT_MAX, FF_MPV_OPT_FLAGS }, \ -{"brd_scale", "Downscale frames for dynamic B-frame decision", FF_MPV_OFFSET(brd_scale), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 3, FF_MPV_OPT_FLAGS }, \ {"skip_threshold", "Frame skip threshold", FF_MPV_OFFSET(frame_skip_threshold), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ {"skip_factor", "Frame skip factor", FF_MPV_OFFSET(frame_skip_factor), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ {"skip_exp", "Frame skip exponent", FF_MPV_OFFSET(frame_skip_exp), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ @@ -677,6 +674,11 @@ FF_MPV_OPT_CMP_FUNC, \ {"intra_penalty", "Penalty for intra blocks in block decision", FF_MPV_OFFSET(intra_penalty), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX/2, FF_MPV_OPT_FLAGS }, \ FF_MPV_RC_STRATEGY_OPTS +#define FF_MPV_COMMON_BFRAME_OPTS \ +{"b_strategy", "Strategy to choose between I/P/B-frames", FF_MPV_OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 2, FF_MPV_OPT_FLAGS }, \ +{"b_sensitivity", "Adjust sensitivity of b_frame_strategy 1", FF_MPV_OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.i64 = 40 }, 1, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"brd_scale", "Downscale frames for dynamic B-frame decision", FF_MPV_OFFSET(brd_scale), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 3, FF_MPV_OPT_FLAGS }, + #if FF_API_MPEGVIDEO_OPTS #define FF_MPV_DEPRECATED_MPEG_QUANT_OPT \ { "mpeg_quant", "Deprecated, does nothing", FF_MPV_OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 0, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED }, @@ -684,6 +686,10 @@ FF_MPV_RC_STRATEGY_OPTS { "a53cc", "Deprecated, does nothing", FF_MPV_OFFSET(a53_cc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED }, #define FF_MPV_DEPRECATED_MATRIX_OPT \ { "force_duplicated_matrix", "Deprecated, does nothing", FF_MPV_OFFSET(force_duplicated_matrix), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED }, +#define FF_MPV_DEPRECATED_BFRAME_OPTS \ + { "b_strategy", "Deprecated, does nothing", FF_MPV_OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED }, \ + { "b_sensitivity", "Deprecated, does nothing", FF_MPV_OFFSET(b_sensitivity), AV_OPT_TYPE_INT, { .i64 = 40 }, 1, INT_MAX, FF_MPV_OPT_FLAGS | AV_OPT_FLAG_DEPRECATED }, \ + { "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[]; diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 2330e4440e..7909a5630a 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -90,6 +90,7 @@ const AVOption ff_mpv_generic_options[] = { FF_MPV_DEPRECATED_MPEG_QUANT_OPT FF_MPV_DEPRECATED_A53_CC_OPT FF_MPV_DEPRECATED_MATRIX_OPT + FF_MPV_DEPRECATED_BFRAME_OPTS #endif { NULL }, }; @@ -4716,6 +4717,7 @@ static const AVOption h263_options[] = { FF_MPV_DEPRECATED_MPEG_QUANT_OPT FF_MPV_DEPRECATED_A53_CC_OPT FF_MPV_DEPRECATED_MATRIX_OPT + FF_MPV_DEPRECATED_BFRAME_OPTS #endif { NULL }, }; @@ -4751,6 +4753,7 @@ static const AVOption h263p_options[] = { FF_MPV_DEPRECATED_MPEG_QUANT_OPT FF_MPV_DEPRECATED_A53_CC_OPT FF_MPV_DEPRECATED_MATRIX_OPT + FF_MPV_DEPRECATED_BFRAME_OPTS #endif { NULL }, };