From patchwork Sun Oct 1 12:55:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 44081 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1204:b0:15d:8365:d4b8 with SMTP id v4csp849829pzf; Sun, 1 Oct 2023 05:56:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHuncZ9cFpbnCDOi4BiqJtJlvDAQt17x5/McPkOkWYItPtnbm4UDnzMD8CGDYw5X3dN81d1 X-Received: by 2002:a17:907:7712:b0:9ae:614e:4560 with SMTP id kw18-20020a170907771200b009ae614e4560mr8956367ejc.29.1696165011917; Sun, 01 Oct 2023 05:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696165011; cv=none; d=google.com; s=arc-20160816; b=WY9YjtpL9OjB7olsPFFNA+vpXxpKYBtktcqC3uZru5DZH3mg0SmHisFGlAR9XWECOM 1M7ptV+fepICsAT3yIRmdtJOHNpSDfXUG3ODZ9i7zKVZXS03GtV+vVRZen0sIlvGZFAC P1iQSo2PQQen+/HoqlJ0uhlrmqqWCKW2JyGseju+mFWc4Gk2CvgvmuCUxjBxngmc0idh YNdk+vJbCJqJvE83y4EwWt29bXINJeKfjrKeOJZ5dkpM30gfcic24/LG5YAOZXwhlKFO dA4/G9XaVLj+fRjKeo9uBDovchPe+6POYz8OFDZZR3Hc5hHiHvaH33z9ync1RCEyEK1t ByjQ== 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:references:in-reply-to:message-id :date:to:from:delivered-to; bh=TRuuyXoZ3iLXkniMrqIh/2ILR/G044+LN4jp0b0QRMo=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=IgqqTOUAsTAghKiz5lZNkcQFVxKEPUg18EqKmwbz8t/Ko6A9KShAzKcijiBYLXKyvx G5ptdRfE48Dk4q9peAI+G2mCnTDbSaSWbd+uNv7nZ58fGGyZsfpQ0SbdHZ4YL8yJVP0z EIkYY5eFTyY7u34msx3ydsBoLxw9aQdY+aS3UFRWB/IAlg284M/F1wYS0JmLU/Sr30x3 hgDbPWPZe3D0LwVLitq0QDMIYWNC80jPNqwJ4Kc1b2cljybu3AtS+psm3BPtENKsZKru /gT08bt11vBtZxt522XG7MNfvKQ+MI8X+B2L/q3NaJ4VpT+S1KdgW1XZAb6jVJSBP/tm SWuw== 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 c13-20020a170906694d00b0099caf6c083csi17686381ejs.1044.2023.10.01.05.56.51; Sun, 01 Oct 2023 05:56:51 -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 36D7668CDE0; Sun, 1 Oct 2023 15:56:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9A1C068CCB0 for ; Sun, 1 Oct 2023 15:56:08 +0300 (EEST) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 37B78523E for ; Sun, 1 Oct 2023 14:56:08 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id CZrSExY0xt3O for ; Sun, 1 Oct 2023 14:56:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 4DF25523A for ; Sun, 1 Oct 2023 14:56:02 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id BEDA53A2608 for ; Sun, 1 Oct 2023 14:55:54 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 1 Oct 2023 14:55:49 +0200 Message-Id: <20231001125552.23976-6-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231001125552.23976-1-anton@khirnov.net> References: <20231001125552.23976-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/9] lavc/mpeg4videodec: do not invent a framerate from guessed numbers 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: 6+H71dlL1RP0 Improves timestamps for fate-m4v* --- libavcodec/mpeg4videodec.c | 3 -- tests/ref/fate/m4v | 84 +++++++++++++++++++------------------- tests/ref/fate/m4v-cfr | 1 + 3 files changed, 43 insertions(+), 45 deletions(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index a8dd57bf6b..b24fe3db20 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -3141,9 +3141,6 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb, av_log(s->avctx, AV_LOG_WARNING, "time_increment_bits set to %d bits, based on bitstream analysis\n", ctx->time_increment_bits); - if (s->avctx->framerate.num && 4*s->avctx->framerate.num < 1<time_increment_bits) { - s->avctx->framerate.num = 1<time_increment_bits; - } } if (IS_3IV1) diff --git a/tests/ref/fate/m4v b/tests/ref/fate/m4v index cebe443adc..4eee84d01b 100644 --- a/tests/ref/fate/m4v +++ b/tests/ref/fate/m4v @@ -1,47 +1,47 @@ -#tb 0: 1/60 +#tb 0: 1/5 #media_type 0: video #codec_id 0: rawvideo #dimensions 0: 320x240 #sar 0: 1/1 0, 0, 0, 1, 115200, 0x7262156b -0, 11, 11, 1, 115200, 0xa6aebc2f -0, 22, 22, 1, 115200, 0x9c7beba1 -0, 33, 33, 1, 115200, 0x556037a2 -0, 44, 44, 1, 115200, 0x532e3a23 -0, 60, 60, 1, 115200, 0x110511f4 -0, 71, 71, 1, 115200, 0xb7f929a4 -0, 82, 82, 1, 115200, 0xdab9f3c2 -0, 93, 93, 1, 115200, 0x441413dd -0, 104, 104, 1, 115200, 0x01163f33 -0, 120, 120, 1, 115200, 0x47720c78 -0, 131, 131, 1, 115200, 0x07c21356 -0, 142, 142, 1, 115200, 0x085d4291 -0, 153, 153, 1, 115200, 0xf6db074c -0, 164, 164, 1, 115200, 0x95093e75 -0, 180, 180, 1, 115200, 0x5f8118ef -0, 191, 191, 1, 115200, 0x2b4de34a -0, 202, 202, 1, 115200, 0x0a731857 -0, 213, 213, 1, 115200, 0xd75ef3be -0, 224, 224, 1, 115200, 0x321cf5a9 -0, 240, 240, 1, 115200, 0x3eb222fd -0, 251, 251, 1, 115200, 0xc7d92f3e -0, 262, 262, 1, 115200, 0x6fda0366 -0, 273, 273, 1, 115200, 0x6bb61b03 -0, 284, 284, 1, 115200, 0x5f367ef8 -0, 300, 300, 1, 115200, 0x237d0c77 -0, 311, 311, 1, 115200, 0xafa813ef -0, 322, 322, 1, 115200, 0x39263ef4 -0, 333, 333, 1, 115200, 0x47c70441 -0, 344, 344, 1, 115200, 0xd43fffb0 -0, 360, 360, 1, 115200, 0x75696afb -0, 371, 371, 1, 115200, 0xb0f117a3 -0, 382, 382, 1, 115200, 0x002f42f0 -0, 393, 393, 1, 115200, 0xa192487e -0, 404, 404, 1, 115200, 0x19a7072e -0, 420, 420, 1, 115200, 0xc500669c -0, 431, 431, 1, 115200, 0xe4636ba9 -0, 442, 442, 1, 115200, 0xdf3d5d86 -0, 453, 453, 1, 115200, 0xf30825d5 -0, 464, 464, 1, 115200, 0xe3c944a1 -0, 480, 480, 1, 115200, 0x8fec4420 -0, 491, 491, 1, 115200, 0x9381fdab +0, 1, 1, 1, 115200, 0xa6aebc2f +0, 2, 2, 1, 115200, 0x9c7beba1 +0, 3, 3, 1, 115200, 0x556037a2 +0, 4, 4, 1, 115200, 0x532e3a23 +0, 5, 5, 1, 115200, 0x110511f4 +0, 6, 6, 1, 115200, 0xb7f929a4 +0, 7, 7, 1, 115200, 0xdab9f3c2 +0, 8, 8, 1, 115200, 0x441413dd +0, 9, 9, 1, 115200, 0x01163f33 +0, 10, 10, 1, 115200, 0x47720c78 +0, 11, 11, 1, 115200, 0x07c21356 +0, 12, 12, 1, 115200, 0x085d4291 +0, 13, 13, 1, 115200, 0xf6db074c +0, 14, 14, 1, 115200, 0x95093e75 +0, 15, 15, 1, 115200, 0x5f8118ef +0, 16, 16, 1, 115200, 0x2b4de34a +0, 17, 17, 1, 115200, 0x0a731857 +0, 18, 18, 1, 115200, 0xd75ef3be +0, 19, 19, 1, 115200, 0x321cf5a9 +0, 20, 20, 1, 115200, 0x3eb222fd +0, 21, 21, 1, 115200, 0xc7d92f3e +0, 22, 22, 1, 115200, 0x6fda0366 +0, 23, 23, 1, 115200, 0x6bb61b03 +0, 24, 24, 1, 115200, 0x5f367ef8 +0, 25, 25, 1, 115200, 0x237d0c77 +0, 26, 26, 1, 115200, 0xafa813ef +0, 27, 27, 1, 115200, 0x39263ef4 +0, 28, 28, 1, 115200, 0x47c70441 +0, 29, 29, 1, 115200, 0xd43fffb0 +0, 30, 30, 1, 115200, 0x75696afb +0, 31, 31, 1, 115200, 0xb0f117a3 +0, 32, 32, 1, 115200, 0x002f42f0 +0, 33, 33, 1, 115200, 0xa192487e +0, 34, 34, 1, 115200, 0x19a7072e +0, 35, 35, 1, 115200, 0xc500669c +0, 36, 36, 1, 115200, 0xe4636ba9 +0, 37, 37, 1, 115200, 0xdf3d5d86 +0, 38, 38, 1, 115200, 0xf30825d5 +0, 39, 39, 1, 115200, 0xe3c944a1 +0, 40, 40, 1, 115200, 0x8fec4420 +0, 41, 41, 1, 115200, 0x9381fdab diff --git a/tests/ref/fate/m4v-cfr b/tests/ref/fate/m4v-cfr index e2d02032fe..4eee84d01b 100644 --- a/tests/ref/fate/m4v-cfr +++ b/tests/ref/fate/m4v-cfr @@ -44,3 +44,4 @@ 0, 38, 38, 1, 115200, 0xf30825d5 0, 39, 39, 1, 115200, 0xe3c944a1 0, 40, 40, 1, 115200, 0x8fec4420 +0, 41, 41, 1, 115200, 0x9381fdab