From patchwork Sun Oct 1 12:55:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 44084 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1204:b0:15d:8365:d4b8 with SMTP id v4csp849988pzf; Sun, 1 Oct 2023 05:57:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjNIjvwIDY9Er9WEje3MnakAg0TD7blclNDFFjsI6/aohk2leXLukPbJETaNnFfNHPeUsv X-Received: by 2002:a17:907:985b:b0:9ae:55f5:180a with SMTP id jj27-20020a170907985b00b009ae55f5180amr7831139ejc.9.1696165037962; Sun, 01 Oct 2023 05:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696165037; cv=none; d=google.com; s=arc-20160816; b=0S0Fz3drSgwE9Tp4QuQETAQrcoaDlEjPwo1bf7x7XpS+ROO9P/UAtI1HGSgCZpy4nF Z9qav45wyZe8HSCfnZGwyFQebbmdl88cQvvSLjgq0lIM+auXejqe+VITjktKHwW5evb7 ogqB+Mb0xUAaufz6CtijiAfuK5jY6xQ1QKDcoAGcWBKIocJSzNwZGOUEluaUPp4y/2or 9bpXlV7kfHm3tv+RB7PR5F1wwrjLVz7+dpfwrvzqR46rjQxcnVdUHfvOttU4apjYEOpi 2RiFO9AGhkq5msSCRkfarWVzBeveYwFBLpeYw/NQ49XumfU9kHbwO3QZ4urLiHaNOOFz GHxA== 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=zMN8bbg095PpD5+v2IICofmlZGwgcmgROwkIaAdd3Gs=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=HRBrnEKOAbUGBqt2lM8zg+JNsbopuSMwatQ8zAMI7HT3KWMkX1c0gGd3pKfbfmuEp2 JkCInxnwsiVQHDvxVjXchSbPWrRF3/srHAmZlbpb9lLIP0UOlrFya/iRvpeXLFvijxVL MgYDmmkfiMvtBPEbeeGKn7L3aHV72uZqKqFmcrBo0mn7/htXsO0SJPjMwWegqGNoZnxQ iwwV7N+RaqhdK5EV5g58wz+d1qC8TTBxJjfcgD9zyntVYAg32np3Hm896SIP60/wrQmB EcmM2Xr0ihLza7yiKGxKlajg7xbRhKIE6fdNiiw+1jvwF5pYFALRks5352xku41YWJu7 2cWg== 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 p9-20020a1709061b4900b0099d9947ea10si16720584ejg.166.2023.10.01.05.57.17; Sun, 01 Oct 2023 05:57:17 -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 1DE6268CDFB; Sun, 1 Oct 2023 15:56:21 +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 8EEEC68CDE8 for ; Sun, 1 Oct 2023 15:56:12 +0300 (EEST) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 8DDD05256 for ; Sun, 1 Oct 2023 14:56:09 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id J5xOoxt2JuPr for ; Sun, 1 Oct 2023 14:56:08 +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 7093C5252 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 D670E3A2633 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:51 +0200 Message-Id: <20231001125552.23976-8-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 8/9] fftools/ffmpeg_enc: do not round frame durations prematurely 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: A6hyBzj1B7uk Changes the results of fate-idroq-video-encode and fate-lavf* tests, where different frames now get duplicated by framerate conversion code. --- fftools/ffmpeg_enc.c | 6 +++--- tests/ref/fate/idroq-video-encode | 2 +- tests/ref/lavf/dv_ntsc | 4 ++-- tests/ref/lavf/gxf_ntsc | 6 +++--- tests/ref/lavf/ismv | 6 +++--- tests/ref/lavf/mov | 6 +++--- tests/ref/lavf/mp4 | 6 +++--- tests/ref/lavf/mpg | 4 ++-- tests/ref/lavf/mxf | 6 +++--- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index b40a6211a9..6c00156121 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -1030,11 +1030,11 @@ static void video_sync_process(OutputFile *of, OutputStream *ost, *nb_frames = 0; else if (delta > 0.6) e->next_pts = llrint(sync_ipts); - frame->duration = duration; + frame->duration = llrint(duration); break; case VSYNC_DROP: case VSYNC_PASSTHROUGH: - frame->duration = duration; + frame->duration = llrint(duration); e->next_pts = llrint(sync_ipts); break; default: @@ -1112,7 +1112,7 @@ static int do_video_out(OutputFile *of, OutputStream *ost, AVFrame *frame) if (frame) { FrameData *fd = frame_data(frame); - duration = lrintf(frame->duration * av_q2d(frame->time_base) / av_q2d(enc->time_base)); + duration = frame->duration * av_q2d(frame->time_base) / av_q2d(enc->time_base); if (duration <= 0 && fd->frame_rate_filter.num > 0 && fd->frame_rate_filter.den > 0) diff --git a/tests/ref/fate/idroq-video-encode b/tests/ref/fate/idroq-video-encode index bdb6fedf56..f777247efd 100644 --- a/tests/ref/fate/idroq-video-encode +++ b/tests/ref/fate/idroq-video-encode @@ -1 +1 @@ -e9ff61023826fce304350ff6e7c63b2f +6d8303bb56b8da2a63efef323aea235e diff --git a/tests/ref/lavf/dv_ntsc b/tests/ref/lavf/dv_ntsc index 410b6ec254..c6aa6b1fbb 100644 --- a/tests/ref/lavf/dv_ntsc +++ b/tests/ref/lavf/dv_ntsc @@ -1,3 +1,3 @@ -5569626370c7c72d40de2c4559e32856 *tests/data/lavf/lavf.dv_ntsc +d28a4c67aa8e3413458de9ca7e6f00ed *tests/data/lavf/lavf.dv_ntsc 3480000 tests/data/lavf/lavf.dv_ntsc -tests/data/lavf/lavf.dv_ntsc CRC=0xa0088163 +tests/data/lavf/lavf.dv_ntsc CRC=0xaa69ba6a diff --git a/tests/ref/lavf/gxf_ntsc b/tests/ref/lavf/gxf_ntsc index 60efd80462..d74e8d8ba4 100644 --- a/tests/ref/lavf/gxf_ntsc +++ b/tests/ref/lavf/gxf_ntsc @@ -1,3 +1,3 @@ -9a27673c85f1671ba9ff7cd33e5735de *tests/data/lavf/lavf.gxf_ntsc -794660 tests/data/lavf/lavf.gxf_ntsc -tests/data/lavf/lavf.gxf_ntsc CRC=0xdcd39443 +5071abe1fd46a3ca3d669203c6d45883 *tests/data/lavf/lavf.gxf_ntsc +793900 tests/data/lavf/lavf.gxf_ntsc +tests/data/lavf/lavf.gxf_ntsc CRC=0xb73f184e diff --git a/tests/ref/lavf/ismv b/tests/ref/lavf/ismv index ac7f72ba33..bb89412d8c 100644 --- a/tests/ref/lavf/ismv +++ b/tests/ref/lavf/ismv @@ -1,9 +1,9 @@ 48fb8d7a5d19bd60f3a49ccf4b7d6593 *tests/data/lavf/lavf.ismv 313169 tests/data/lavf/lavf.ismv tests/data/lavf/lavf.ismv CRC=0x9d9a638a -d19cd8e310a2e94fe0a0d11c5dc29217 *tests/data/lavf/lavf.ismv -322075 tests/data/lavf/lavf.ismv -tests/data/lavf/lavf.ismv CRC=0xe8130120 +b3ba38e148c00466441627ea04749f63 *tests/data/lavf/lavf.ismv +322247 tests/data/lavf/lavf.ismv +tests/data/lavf/lavf.ismv CRC=0xc5569484 3b6023766845b51b075aed474c00f73c *tests/data/lavf/lavf.ismv 312546 tests/data/lavf/lavf.ismv tests/data/lavf/lavf.ismv CRC=0x9d9a638a diff --git a/tests/ref/lavf/mov b/tests/ref/lavf/mov index 75a0c4892d..cfc64141aa 100644 --- a/tests/ref/lavf/mov +++ b/tests/ref/lavf/mov @@ -1,9 +1,9 @@ 11bd76730274924e02623172b82b5236 *tests/data/lavf/lavf.mov 357539 tests/data/lavf/lavf.mov tests/data/lavf/lavf.mov CRC=0xbb2b949b -6efa586655e3db043cb29668f5216610 *tests/data/lavf/lavf.mov -366621 tests/data/lavf/lavf.mov -tests/data/lavf/lavf.mov CRC=0xa9793231 +9ed9ce9b636f85b62d3c3583ff84691e *tests/data/lavf/lavf.mov +366793 tests/data/lavf/lavf.mov +tests/data/lavf/lavf.mov CRC=0xc75fc595 c80c625ded376602e71d5aa6ac6fdb1c *tests/data/lavf/lavf.mov 356921 tests/data/lavf/lavf.mov tests/data/lavf/lavf.mov CRC=0xbb2b949b diff --git a/tests/ref/lavf/mp4 b/tests/ref/lavf/mp4 index b05fa34d0b..686e4f48f8 100644 --- a/tests/ref/lavf/mp4 +++ b/tests/ref/lavf/mp4 @@ -1,9 +1,9 @@ a6e44724cab1c4b50c49b0fd227b87d3 *tests/data/lavf/lavf.mp4 312477 tests/data/lavf/lavf.mp4 tests/data/lavf/lavf.mp4 CRC=0x9d9a638a -19cbdb02f2f3e35bae779e2323be1b8e *tests/data/lavf/lavf.mp4 -321363 tests/data/lavf/lavf.mp4 -tests/data/lavf/lavf.mp4 CRC=0xe8130120 +0906d4bcb61dd8bcb21a37d6b5b48ea2 *tests/data/lavf/lavf.mp4 +321535 tests/data/lavf/lavf.mp4 +tests/data/lavf/lavf.mp4 CRC=0xc5569484 8ab9dd09f02b6d8146a40fc3c918d979 *tests/data/lavf/lavf.mp4 312021 tests/data/lavf/lavf.mp4 tests/data/lavf/lavf.mp4 CRC=0x9d9a638a diff --git a/tests/ref/lavf/mpg b/tests/ref/lavf/mpg index 332b7114b5..9cf783d26d 100644 --- a/tests/ref/lavf/mpg +++ b/tests/ref/lavf/mpg @@ -1,9 +1,9 @@ 01bbdea588da51ab4a9d1d26f3443c96 *tests/data/lavf/lavf.mpg 372736 tests/data/lavf/lavf.mpg tests/data/lavf/lavf.mpg CRC=0x000e23ae -87b447b78a7d1141b9d41bb3aa50434d *tests/data/lavf/lavf.mpg +67a87970fae5cbd878ad6353aa9138da *tests/data/lavf/lavf.mpg 389120 tests/data/lavf/lavf.mpg -tests/data/lavf/lavf.mpg CRC=0x60ba4ab9 +tests/data/lavf/lavf.mpg CRC=0x9264985a 284f41c914df75c12de01e223d65f87f *tests/data/lavf/lavf.mpg 372736 tests/data/lavf/lavf.mpg tests/data/lavf/lavf.mpg CRC=0x000e23ae diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf index 3f0c74818a..fdd1ef5c9c 100644 --- a/tests/ref/lavf/mxf +++ b/tests/ref/lavf/mxf @@ -1,9 +1,9 @@ 9ec1ad83b3400de11ca2f70b3b2d4c4d *tests/data/lavf/lavf.mxf 526393 tests/data/lavf/lavf.mxf tests/data/lavf/lavf.mxf CRC=0x8dddfaab -546eb8c864c0d76c6a9d5303701e9031 *tests/data/lavf/lavf.mxf -561721 tests/data/lavf/lavf.mxf -tests/data/lavf/lavf.mxf CRC=0x96ff1b48 +3edfabe839a29f5902969c15ebac6d8d *tests/data/lavf/lavf.mxf +551481 tests/data/lavf/lavf.mxf +tests/data/lavf/lavf.mxf CRC=0xf091e687 5bd0ce691510e6fae969886c32ad7a14 *tests/data/lavf/lavf.mxf 526393 tests/data/lavf/lavf.mxf tests/data/lavf/lavf.mxf CRC=0x8dddfaab