From patchwork Fri Aug 27 07:13:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 29804 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp1201130iov; Fri, 27 Aug 2021 00:14:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYbg8NGooyAgGbq+W2QEZ7T93zQtWiMKEItAXWqthZGgpfGkcPlsKKoKAQeiB3CXBwAgVU X-Received: by 2002:a17:906:c249:: with SMTP id bl9mr8407634ejb.225.1630048467002; Fri, 27 Aug 2021 00:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630048466; cv=none; d=google.com; s=arc-20160816; b=LhO3d8/TCzKwKeFxGF5SQl1CeTuuHE7JcL+Wa0ArY9/l6RyzbithNv7p8nS/nFWzgD H8mzoALhQ+hOM73ltK348G6dw8VG75xlpOOyDAdDlGyiJ+0TfDhn8GEJDOcYaGgoWqol 35869Ee+oUQThZREEQZy6HpfsytMEsJQUkFCwIJVoocgl62jb5XQxRlFnRf+nRNCZmWQ qPxxjicLYH8GTJjuP/aE15JSNWPY+eRUw8MybFASLmDjngOERT51e+uFy1hG+pNhuXkN 1DFeFFFqAJcuW2HXbvLVleXMtaYzxGPPRbTYOdGqxxwKMQMseHBpMSb5NG7yVR1bhOs1 Igmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:date:to:from:message-id :dkim-signature:delivered-to; bh=M2lm0rqvtHVwXJNn0Pf+UApkoidsJpS+bx9QoKpfDXY=; b=EqOSkj2eDbPWBju+an4VuoOybo7w7j63ZZxJqi+R0eENlwO1g9Ic/p5b2YAO2vfgd2 BBl1AG68hk5Vh75A7DBNIbvGBfQp0QtWF0jXuzq1uoZj2mfmBAKmwR7nbumVk6tHBo/e p88pTZdarFD60YqZ4673IqNzNMo5tRIGsLkS96j/4NWPh0s2zbYq+7ym9WZt9XS6q8zD jNxT8n5e5zmJWKEeS4KwkIfE0+h9IQQrJ91zBpQPKYQsa83xudk6v470IsDjwjfYB99C u8y55VNqqIiVUuwCo6IqpX2N2jqIjNy/hMKSnZTmlpWefd2Xpx6VkEGsx5oCpQQARUxa KzEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=glHoAxpO; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ho39si5349835ejc.235.2021.08.27.00.14.21; Fri, 27 Aug 2021 00:14:26 -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=@foxmail.com header.s=s201512 header.b=glHoAxpO; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6433D68A407; Fri, 27 Aug 2021 10:14:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-221-236.mail.qq.com (out203-205-221-236.mail.qq.com [203.205.221.236]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C2BAC6898B4 for ; Fri, 27 Aug 2021 10:14:08 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1630048445; bh=uEfJxUKKrIw2ZVqtuc8pJSlUqwmwYp2Vl8mIAc943zk=; h=From:To:Cc:Subject:Date; b=glHoAxpO6QtpQKBxvT+o5GpNwkeg7OrcwFiH0ew2nolHwjhB7U8ZMfWuh4gmqxs7f UoF5Nc2V2r/zqpXTpsHCI7S86POej7aLpJBZjGaheGNjmHU3FkXpPcYNOvh5vyo3Ph Tk39IbxojETo3P7yqAl3XKJoTtv28oWB8aSxlZcw= Received: from ZHILIZHAO-MB2.tencent.com ([59.37.125.37]) by newxmesmtplogicsvrsza7.qq.com (NewEsmtp) with SMTP id 36B04EEE; Fri, 27 Aug 2021 15:13:43 +0800 X-QQ-mid: xmsmtpt1630048423tczmeswp7 Message-ID: X-QQ-XMAILINFO: OEaI/iTChbuglwyh7AdoGtkpCVItblr9BkQy/IluTuaq8ePbUOvED6/weuj+9q +P6Q/fB7KIQuwXMCToUnvhsjS0djW49JEezTDWcfsxNcbcXc1OF3JiW+rqOJifdlnDxIKKjBDDUi DZZ0EKyg8GQYeYi9t8tPKAfbqgLGvFlp/UToZ9oY/j2qgSdulX24Z6XkzVa3/wBjUSJNoeQcsr9r tjdopOcDkWUMOzElSVrGsgb2gOkO6fiGxcyCTL77Nq3UuiTyVlk+xhG6qdVsgY0HLNY0DkOko1CI iFKQLLGvn/d82stWyznysdfxq7rufBqG2U27e1peTJzHge0PzFC0XBH074qjHLPQhDrz55kjL9QU BiUnc0noBnWMSycX46gNTPOTIoNaI3xBD42NfIhtXd/VDGX9JOmFu2v+8o6FEi4+m5dog2MnINWH apT8gZ/fd1Ojs6H4zUTBpmHVuhDo/oXVS776vWWEO1CB6kFAC6VdDR16XfHkxkotxg/xpbyqVV21 4NQ7Ing7XolHyMRimAIee5ffRTPd6WzaKPYZrgGcP6hp8ILkLUx/L29zzrUYaeJa5fOQ3c4p+1+d +1odqtLPLDxSl5iOtoe/ogWrR6lqqZy9sMY62sDKPjvntXnxZA1hqQEMCGjHFWtWQoj9YpXpu8Kh w9CvYwhmQvp0tNFAhRT/dmWurek8EqanLErTlQkTgo+kgTYafjETZlvPPc4gUYU6yHaa7VOLsy10 XSOPYbCyYVxdoK+wyPX78vNYzOkArAMje1+162+HU+1w+MLrDh2SEZpddJbkB/RnmbgxzWtq+0ZA Vq1Urze2g1NNC3AqWspK9PSepFw4ElMdidTakq6Th8cQ== From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Fri, 27 Aug 2021 15:13:42 +0800 X-OQ-MSGID: <20210827071342.54534-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavc/{av1, h264, h265}_metadata_bsf: fix description of tick_rate 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: SAaAWPsMr7cq Users may take the description literally which leads to inverted results. --- doc/bitstream_filters.texi | 8 ++++---- libavcodec/av1_metadata_bsf.c | 2 +- libavcodec/h264_metadata_bsf.c | 2 +- libavcodec/h265_metadata_bsf.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/bitstream_filters.texi b/doc/bitstream_filters.texi index 1900eb4352..6051dc28d2 100644 --- a/doc/bitstream_filters.texi +++ b/doc/bitstream_filters.texi @@ -81,7 +81,7 @@ Top-left position. @end table @item tick_rate -Set the tick rate (@emph{num_units_in_display_tick / time_scale}) in +Set the tick rate (@emph{time_scale / num_units_in_display_tick}) in the timing info in the sequence header. @item num_ticks_per_picture Set the number of ticks in each picture, to indicate that the stream @@ -244,7 +244,7 @@ Set the chroma sample location in the stream (see H.264 section E.2.1 and figure E-1). @item tick_rate -Set the tick rate (num_units_in_tick / time_scale) in the VUI +Set the tick rate (time_scale / num_units_in_tick) in the VUI parameters. This is the smallest time unit representable in the stream, and in many cases represents the field rate of the stream (double the frame rate). @@ -352,8 +352,8 @@ Set the chroma sample location in the stream (see H.265 section E.3.1 and figure E.1). @item tick_rate -Set the tick rate in the VPS and VUI parameters (num_units_in_tick / -time_scale). Combined with @option{num_ticks_poc_diff_one}, this can +Set the tick rate in the VPS and VUI parameters (time_scale / +num_units_in_tick). Combined with @option{num_ticks_poc_diff_one}, this can set a constant framerate in the stream. Note that it is likely to be overridden by container parameters when the stream is in a container. diff --git a/libavcodec/av1_metadata_bsf.c b/libavcodec/av1_metadata_bsf.c index 1fb85d88b7..c52673bf6a 100644 --- a/libavcodec/av1_metadata_bsf.c +++ b/libavcodec/av1_metadata_bsf.c @@ -194,7 +194,7 @@ static const AVOption av1_metadata_options[] = { { "colocated", "Top-left chroma sample position", 0, AV_OPT_TYPE_CONST, { .i64 = AV1_CSP_COLOCATED }, .flags = FLAGS, .unit = "csp" }, - { "tick_rate", "Set display tick rate (num_units_in_display_tick / time_scale)", + { "tick_rate", "Set display tick rate (time_scale / num_units_in_display_tick)", OFFSET(tick_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 0.0 }, 0, UINT_MAX, FLAGS }, { "num_ticks_per_picture", "Set display ticks per picture for CFR streams", diff --git a/libavcodec/h264_metadata_bsf.c b/libavcodec/h264_metadata_bsf.c index 452a8ec5dc..c79d91dcef 100644 --- a/libavcodec/h264_metadata_bsf.c +++ b/libavcodec/h264_metadata_bsf.c @@ -617,7 +617,7 @@ static const AVOption h264_metadata_options[] = { OFFSET(chroma_sample_loc_type), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 6, FLAGS }, - { "tick_rate", "Set VUI tick rate (num_units_in_tick / time_scale)", + { "tick_rate", "Set VUI tick rate (time_scale / num_units_in_tick)", OFFSET(tick_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 0.0 }, 0, UINT_MAX, FLAGS }, { "fixed_frame_rate_flag", "Set VUI fixed frame rate flag", diff --git a/libavcodec/h265_metadata_bsf.c b/libavcodec/h265_metadata_bsf.c index d841839762..e5f70cfbc1 100644 --- a/libavcodec/h265_metadata_bsf.c +++ b/libavcodec/h265_metadata_bsf.c @@ -439,7 +439,7 @@ static const AVOption h265_metadata_options[] = { { .i64 = -1 }, -1, 6, FLAGS }, { "tick_rate", - "Set VPS and VUI tick rate (num_units_in_tick / time_scale)", + "Set VPS and VUI tick rate (time_scale / num_units_in_tick)", OFFSET(tick_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 0.0 }, 0, UINT_MAX, FLAGS }, { "num_ticks_poc_diff_one",