Commit Graph

5730 Commits

Author SHA1 Message Date
Lynne 77478f6793
av1dec: add Vulkan hwaccel 2023-05-29 00:42:00 +02:00
Lynne 5dc047716a
fate-source: exclude Apache-2 licensed files 2023-05-29 00:41:59 +02:00
Lynne 934525eae0
lsws: add in/out support for the new 12-bit 2-plane 422 and 444 pixfmts 2023-05-29 00:41:35 +02:00
Lynne 0bda3340a3
lavu: add 12-bit 2-plane 422 and 444 pixel formats 2023-05-29 00:41:35 +02:00
Paul B Mahol 2b5166addf avfilter/af_silenceremove: add real peak detector
Rename old peak detector to more correct name one.
2023-05-26 10:13:37 +02:00
Paul B Mahol c6b6356635 avformat/gifdec: switch to using gif parser
Update fate test, more correct as last packet is not truncated.
2023-05-25 19:51:56 +02:00
Anton Khirnov 4e521e6102 fate/tests/ffmpeg: use -idct simple for fate-ffmpeg-input-r
Makes the test bitexact on non-x86_64.
2023-05-23 13:54:10 +02:00
Anton Khirnov 8c0f516133 tests/fate/ffmpeg: add a test for input -r option 2023-05-22 17:10:44 +02:00
Anton Khirnov 900bb3f8e2 tests/fate/ffmpeg: move a misplaced line 2023-05-22 17:10:44 +02:00
James Almer b6066ceb8b fate/checkasm: add h264chroma test
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-20 18:26:13 -03:00
Lynne 783270bfd1
checkasm: add h264chroma tests
Checks all variants of put_h264_chroma and avg_h264_chroma.
2023-05-20 20:07:21 +02:00
James Almer bd9d984c11 fate/demux: fix fate-cavs-demux
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-20 00:10:54 -03:00
Zhao Zhili 47430a3cb1 avcodec/cavs_parser: fix finding the end of a frame
Use the next I/P/B or start code as the end of current frame.

Before the patch, extension start code, user data start code,
sequence end code and so on are treated as the start of next
frame.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-05-20 04:03:44 +08:00
Leo Izen d4c48ee7f3 fate/jpg: add RGB mjpeg fate tests
Adds FATE tests for RGB jpegs to test commit
0b352e350e.
2023-05-17 12:37:42 +02:00
Anton Khirnov 2953ebe7b6 tests/fate: add a simple test for libx264
Since this is an external encoder not under our control, we cannot test
the encoded output exactly as is done for internal encoders. We can
still test however that the output is decodable and produces the
expected number of frames with expected dimensions, pixel formats, and
timestamps.
2023-05-15 10:39:02 +02:00
Pierre-Anthony Lemieux 21696f6122
avformat/tests/imf: add invalid resource test 2023-05-11 09:04:44 -07:00
James Almer 63d7ea38c7 fftools/ffprobe: print exported stream AVOptions
Similar to the decoder AVOptions, this is useful to show values from options
exported by the demuxer.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-08 11:04:37 -03:00
Anton Khirnov 129c7bf53f fftools/ffmpeg: always use the same path for setting InputStream.[next_]dts
Currently those are set in different ways depending on whether the
stream is decoded or not, using some values from the decoder if it is.
This is wrong, because there may be arbitrary amount of delay between
input packets and output frames (depending e.g. on the thread count when
frame threading is used).

Always use the path that was previously used only for streamcopy. This
should not cause any issues, because these values are now used only for
streamcopy and discontinuity handling.

This change will allow to decouple discontinuity processing from
decoding and move it to ffmpeg_demux. It also makes the code simpler.

Changes output in fate-cover-art-aiff-id3v2-remux and
fate-cover-art-mp3-id3v2-remux, where attached pictures are now written
in the correct order. This happens because InputStream.dts is no longer
reset to AV_NOPTS_VALUE after decoding, so streamcopy actually sees
valid dts values.
2023-05-02 10:59:24 +02:00
Anton Khirnov d85c6aba0c fftools/ffmpeg: rework audio-decode timestamp handling
Stop using InputStream.dts for generating missing timestamps for decoded
frames, because it contains pre-decoding timestamps and there may be
arbitrary amount of delay between input packets and output frames (e.g.
dependent on the thread count when frame threading is used). It is also
in AV_TIME_BASE (i.e. microseconds), which may introduce unnecessary
rounding issues.

New code maintains a timebase that is the inverse of the LCM of all the
samplerates seen so far, and thus can accurately represent every audio
sample. This timebase is used to generate missing timestamps after
decoding.

Changes the result of the following FATE tests
* pcm_dvd-16-5.1-96000
* lavf-smjpeg
* adpcm-ima-smjpeg
In all of these the timestamps now better correspond to actual frame
durations.
2023-05-02 10:59:24 +02:00
Anton Khirnov 0ed1eeb744 lavf/dv: use a more granular timebase for audio
One that is fine enough to represent all DV audio sample rates. Audio
packet durations are now sample-accurate.

This largely undoes commit 76fbb0052d. To
avoid breaking the issue fixed by that commit, resync audio timestamps
against video if they get more than one frame apart. The sample from
issue #8762 still works correctly after this commit.

Slightly changes the results of the lavf-dv seektest, due to the audio
timebase being more granular.
2023-05-02 10:57:21 +02:00
Anton Khirnov c7a852b638 lavf/dv: do not set video timebase more than once
Current code will call avpriv_set_pts_info() for each video frame,
possibly setting a different timebase if the stream framerate changes.
This violates API conventions, as the timebase is supposed to stay
constant after stream creation.

Change the demuxer to set a single timebase that is fine enough to
handle all supported DV framerates.

The seek tests change slightly because the new timebase is more
granular.
2023-05-02 10:57:21 +02:00
Anton Khirnov af8be7bf43 lavf/dauddec: set timebase to 1/samplerate
Prevents lavf from generating inexact timestamps with the default
timebase of 1/90000.
2023-04-28 14:31:55 +02:00
Ting Fu 78f95f1088 lavfi/dnn: Remove DNN native backend
According to discussion in
https://etherpad.mit.edu/p/FF_dev_meeting_20221202 and the proposal in
http://ffmpeg.org/pipermail/ffmpeg-devel/2022-December/304534.html,
the DNN native backend should be removed at first step.
All the DNN native backend related codes are deleted.

Signed-off-by: Ting Fu <ting.fu@intel.com>
2023-04-28 11:07:41 +08:00
Marton Balint ace9459c41 tests: do not override movflags defaults
It does not matter if the default is 0, but still it is cleaner that way.

Signed-off-by: Marton Balint <cus@passwd.hu>
2023-04-24 23:00:50 +02:00
Anton Khirnov c94e9d03b4 fftools/ffmpeg_enc: always use video frame durations when available
Previously they would only be used with trivial filtergraphs, because
filters did not handle frame durations. That is no longer true - most
filters process frame durations properly (there may still be some that
don't - this change will help finding and fixing them).

Improves output video frame durations in a number of FATE tests.
2023-04-24 16:56:06 +02:00
James Almer 9a258eefae fate/jpeg2000: add missing dependecy checks
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-23 18:54:43 -03:00
Pierre-Anthony Lemieux 7ecf1bff6d
fate/jpeg2000: add JPEG 2000 tests using ITU/ISO conformance materials
Adds JPEG 2000 decoder tests using materials from the conformance suite specified in
Rec. ITU-T T.803 | ISO/IEC 15444-4.

The test materials are available at https://gitlab.com/wg1/htj2k-codestreams

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2023-04-22 15:57:41 -07:00
James Almer 41bbf2e372 fate/h264: test disabling cropping
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-22 11:20:58 -03:00
Leo Izen 453b524974
fate: add tests for RGB jpegs
Added framecrc tests for RGB JPEGs to verify future changes to the
decoder.
2023-04-21 09:55:12 -04:00
Steven Liu 4570ba5d86 fate/png-icc-parse: update ref data
When enable lcms2, the fate-png-icc-parse will get error bellow.
TEST    png-icc-parse
This because updated how PNG handles colors (no
longer using mastering display metadata for that).

Reviewed-by: Leo Izen <leo.izen@gmail.com>
Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2023-04-21 14:06:37 +08:00
Anton Khirnov c17e33c058 fftools/ffmpeg: propagate frame durations to packets when encoding
Remove now-obsolete code setting packet durations pre-muxing for CFR
encoded video.

Changes output in the following FATE tests:
* numerous adpcm tests
* ffmpeg-filter_complex_audio
* lavf-asf
* lavf-mkv
* lavf-mkv_attachment
* matroska-encoding-delay
  All of these change due to the fact that the output duration is now
  the actual input data duration and does not include padding added by
  the encoder.

* apng-osample: less wrong packet durations are now passed to the muxer.
  They are not entirely correct, because the first frame duration should
  be 3 rather than 2. This is caused by the vsync code and should be
  addressed later, but this change is a step in the right direction.
* tscc2-mov: last output frame has a duration of 11 rather than 1 - this
  corresponds to the duration actually returned by the demuxer.
* film-cvid: video frame durations are now 2 rather than 1 - this
  corresponds to durations actually returned by the demuxer and matches
  the timestamps.
* mpeg2-ticket6677: durations of some video frames are now 2 rather than
  1 - this matches the timestamps.
2023-04-19 21:12:03 +02:00
Anton Khirnov cea71b2139 fftools/ffmpeg: stop using fake dts for generating timestamps
When no packet dts values are available from the container, video
decoding code will currently use its own guessed values, which will then
be propagated to pkt_dts on decoded frames and used as pts in certain
cases. This is inaccurate, fragile, and unnecessarily convoluted.
Simply removing this allows the extrapolation code introduced in the
previous commit to do a better job.

Changes the results of numerous h264 and hevc FATE tests, where no
spurious timestamp gaps are generated anymore. Several tests no longer
need -vsync passthrough.
2023-04-13 15:34:07 +02:00
Anton Khirnov 5d407cb2d7 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
2023-04-13 15:34:07 +02:00
Anton Khirnov be3b1e27e5 lavf/rawdec: mark raw demuxers as having no timestamps
Changes the result of the h264_redundant_pps-mov test, where the output
timebase is now 1001/24000 instead of 1/24. This is more correct, as the
source file actually is 23.98fps.
2023-04-13 15:34:07 +02:00
Anton Khirnov ba4b73c977 lavf/rawdec: set avg_frame_rate
Timestamps in two FATE H.264 conformance tests now start at 1 instead
of 0, which also happens in some other H.264 tests before this commit
and so is not a big issue.
Conversely, timestamps in some HEVC conformance tests start from a
smaller value now.
Ideally this should be addressed later in a more general way.

h264-conformance-frext-frext2_panasonic_b no longer requires -vsync
passthrough.
2023-04-13 15:34:07 +02:00
xufuji456 1e91a39502 checkasm: pass context as pointer
Signed-off-by: xufuji456 <839789740@qq.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-04-13 15:17:04 +03:00
xufuji456 30def6365d checkasm/hevc: add transform_luma test
Signed-off-by: xufuji456 <839789740@qq.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-04-13 15:17:04 +03:00
Anton Khirnov 81cca3dae3 fftools/sync_queue: make sure audio duration matches sample count
For audio AVFrames, nb_samples is typically more trustworthy than
duration. Since sync queues look at durations, make sure they match the
sample count.

The last audio frame in the fate-shortest test is now gone. This is more
correct, since it outlasts the last video frame.
2023-04-09 15:47:45 +02:00
James Almer 30f1f89572 fate/matroska: add HDR10+ muxing tests
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-08 10:28:41 -03:00
James Almer bda44f0f39 avformat/matroskaenc: support writing Dynamic HDR10+ packet side data
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-08 10:28:41 -03:00
J. Dekker 68c151cb1b checkasm: add hevc_deblock chroma test
Signed-off-by: J. Dekker <jdek@itanimul.li>
2023-04-06 06:16:57 +02:00
Michael Niedermayer 916be62da1
tests/fate/vcodec.mak: drop strict experimental from j2k tests
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-06 00:49:34 +02:00
Marton Balint 88da4b5fcd fate: split mxf test dependencies to DV and MPEG2
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-04-06 00:40:42 +02:00
James Almer 1c2a1e0750 avformat/matroskaenc: write a MaxBlockAdditionID element
A non zero value is mandatory for Matroska if the track has blocks with BlockAdditions.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-05 09:47:12 -03:00
Michael Niedermayer c6dedaf491
tests: Add more j2k tests to cover a wider range of cases
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:52 +02:00
Michael Niedermayer 816676085e
avcodec/j2kenc: Fix funky bpno errors on decoding
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-02 23:54:49 +02:00
James Almer d6e30291db fate/lavf-container: add missing swscale deps to mxf_dvcpro100 and mxf_ffv1
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-28 08:54:39 -03:00
J. Dekker 2e61ae2cbe fate: specify EC-off for damaged inter samples
The previous commit allowed turning on error correction for interlaced
samples. Turning it off amounts to a no-op for FATE. These samples
should be tested with EC1-3 (guess_mvs/deblock/favor_inter)
additionally.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2023-03-27 14:00:05 +02:00
Jerome Martinez 174ca11d91 avformat/mxfenc: fix stored/sampled/displayed width/height
According to MXF specs the Stored Rectangle corresponds to the data which is
passed to the compressor and received from the decompressor, so they should
contain the width / height extended to the macroblock boundary.

In practice however width and height values rounded to the upper 16 multiples
are only seen when muxing MPEG formats. Therefore this patch changes stored
width and height values to unrounded for all non-MPEG formats, even macroblock
based ones.

For DNXHD the specs (ST 2019-4) explicitly indicates to use 1080 for 1088p.
For ProRes the specs (RDD 44) only refer to to ST 377-1 without precision but
no known commercial implementations are using rounded values.
DV is not using 16x16 macroblocks, so 16 rounding makes no sense.

The patch also fixes Sampled Width / Display Width to use unrounded values.

Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-26 22:04:44 +02:00
James Almer 20dade27d9 fftools/ffprobe: print crop_* frame fields
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-26 16:39:59 -03:00