summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-04-09 09:55:55 +0200
committerAnton Khirnov <anton@khirnov.net>2023-04-13 15:34:07 +0200
commit5d407cb2d71176240487171bb0e803c3d2e36f15 (patch)
treebd90f5ae127f86bc91d255d9123bcfbaaa53472d /tests
parent380db569287ba99d903b7629f209b9adc7fd2723 (diff)
downloadffmpeg-5d407cb2d71176240487171bb0e803c3d2e36f15.tar.gz
fftools/ffmpeg: change video decoding timestamp generation
When no timestamps are available from the container, the video decoding code will currently use fake dts values - generated in process_input_packet() based on a combination of information from the decoder and the parser (obtained via the demuxer) - to generate timestamps during decoder flushing. This is fragile, hard to follow, and unnecessarily convoluted, since more reliable information can be obtained directly from post-decoding values. The new code keeps track of the last decoded frame pts and estimates its duration based on a number of heuristics. Timestamps generated when both pts and pkt_dts are missing are then simple pts+duration of the last frame. The heuristics are somewhat complicated by the fact that lavf insists on making up packet timestamps based on its highly incomplete information. That should be removed in the future, allowing to further simplify this code. The results of the following tests change: * h264-3386 now requires -fps_mode passthrough to avoid dropping frames at the end; this is a pathology of the interaction of the new and old code, and the fact that the sample switches from field to frame coding in the last packet, and will be fixed in following commits * hevc-conformance-DELTAQP_A_BRCM_4 stops inventing an arbitrary timestamp gap at the end * hevc-small422chroma - the single frame output by this test now has a timestamp of 0, rather than an arbitrary 7
Diffstat (limited to 'tests')
-rw-r--r--tests/fate/h264.mak2
-rw-r--r--tests/ref/fate/h264-33866
-rw-r--r--tests/ref/fate/hevc-conformance-DELTAQP_A_BRCM_42
-rw-r--r--tests/ref/fate/hevc-small422chroma2
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak
index c8ed23955a..7998879ed3 100644
--- a/tests/fate/h264.mak
+++ b/tests/fate/h264.mak
@@ -444,7 +444,7 @@ fate-h264-mixed-nal-coding: CMD = framecrc -i $(TARGET_SAM
fate-h264-ref-pic-mod-overflow: CMD = framecrc -i $(TARGET_SAMPLES)/h264/ref-pic-mod-overflow.h264
fate-h264-twofields-packet: CMD = framecrc -i $(TARGET_SAMPLES)/h264/twofields_packet.mp4 -an -frames 30
fate-h264-unescaped-extradata: CMD = framecrc -i $(TARGET_SAMPLES)/h264/unescaped_extradata.mp4 -an -frames 10
-fate-h264-3386: CMD = framecrc -i $(TARGET_SAMPLES)/h264/bbc2.sample.h264
+fate-h264-3386: CMD = framecrc -i $(TARGET_SAMPLES)/h264/bbc2.sample.h264 -fps_mode passthrough
fate-h264-missing-frame: CMD = framecrc -i $(TARGET_SAMPLES)/h264/nondeterministic_cut.h264
fate-h264-timecode: CMD = framecrc -i $(TARGET_SAMPLES)/h264/crew_cif_timecode-2.h264
diff --git a/tests/ref/fate/h264-3386 b/tests/ref/fate/h264-3386
index 421581f8c6..f1a25a2dc0 100644
--- a/tests/ref/fate/h264-3386
+++ b/tests/ref/fate/h264-3386
@@ -47,6 +47,6 @@
0, 45, 45, 1, 2332800, 0x80b968d3
0, 46, 46, 1, 2332800, 0xa45f4e6f
0, 47, 47, 1, 2332800, 0xe0fcbade
-0, 48, 48, 1, 2332800, 0x19568f4d
-0, 49, 49, 1, 2332800, 0x33c53f59
-0, 50, 50, 1, 2332800, 0xbdbe8fbf
+0, 47, 47, 1, 2332800, 0x19568f4d
+0, 48, 48, 1, 2332800, 0x33c53f59
+0, 49, 49, 1, 2332800, 0xbdbe8fbf
diff --git a/tests/ref/fate/hevc-conformance-DELTAQP_A_BRCM_4 b/tests/ref/fate/hevc-conformance-DELTAQP_A_BRCM_4
index 5ca3faf58f..2abd58b64b 100644
--- a/tests/ref/fate/hevc-conformance-DELTAQP_A_BRCM_4
+++ b/tests/ref/fate/hevc-conformance-DELTAQP_A_BRCM_4
@@ -98,4 +98,4 @@
0, 92, 92, 1, 3133440, 0x761571be
0, 93, 93, 1, 3133440, 0x34dc14a1
0, 94, 94, 1, 3133440, 0xbb94c2d4
-0, 96, 96, 1, 3133440, 0x5300e459
+0, 95, 95, 1, 3133440, 0x5300e459
diff --git a/tests/ref/fate/hevc-small422chroma b/tests/ref/fate/hevc-small422chroma
index de0ea46c31..dca2af0a1a 100644
--- a/tests/ref/fate/hevc-small422chroma
+++ b/tests/ref/fate/hevc-small422chroma
@@ -3,4 +3,4 @@
#codec_id 0: rawvideo
#dimensions 0: 3840x2160
#sar 0: 1/1
-0, 7, 7, 1, 33177600, 0x53015e18
+0, 0, 0, 1, 33177600, 0x53015e18