Commit Graph

5819 Commits

Author SHA1 Message Date
Anton Khirnov d2c416fdf1 fftools/ffmpeg_enc: merge -force_key_frames source/source_no_drop
Always use the functionality of the latter, which makes more sense as it
avoids losing keyframes due to vsync code dropping frames.

Deprecate the 'source_no_drop' value, as it is now redundant.
2023-10-10 12:41:31 +02:00
Anton Khirnov a07b2f5f11 tests/fate/ffmpeg: add tests for -force_key_frames source 2023-10-10 12:41:31 +02:00
James Almer d372c2f3d3 fftools/ffmpeg: stop injecting stream side data in packets
This is no longer needed as the side data is available for decoders in the
AVCodecContext.
The tests affected reflect the removal of useless CPB and Stereo 3D side
data in packets.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-06 10:11:19 -03:00
James Almer ae22271620 avcodec/decode: propagate global side data to frames
The changed references for fate-hevc-dv-rpu fate-mov-zombie happen because,
unlike ffmpeg and ffplay, ffprobe never injected packet side data, so the
display matrix side data at the container level is now present in the output
frames.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-06 10:11:18 -03:00
Stefano Sabatini d2d3a83ad9 ffprobe: introduce section type, use for the compact output
Also, avoid spurious end-of-line after side data entries, and improve
rendering of compact output, by adding an indication of the side data
type for each entry.

Also fixes issue:
http://trac.ffmpeg.org/ticket/9266
2023-10-06 00:17:02 +02:00
Stefano Sabatini 8eecd52d8b ffprobe: correct section name for side data piece 2023-10-06 00:17:01 +02:00
Anton Khirnov 9d4ca76c08 fftools/ffmpeg_enc: do not round frame durations prematurely
Changes the results of fate-idroq-video-encode and fate-lavf* tests,
where different frames now get duplicated by framerate conversion code.
2023-10-03 16:57:02 +02:00
Anton Khirnov 303f10d4dd fftools/ffmpeg_dec: disregard demuxer timestamps for NOTIMESTAMPS formats
In this case any timestamps are guessed by compute_pkt_fields() in
libavformat. Since we are decoding the stream, we have more accurate
information from the decoder and do not need any guesses.

Eliminates spurious PTS gaps in a number of FATE tests.

Also avoids dropping the majority of frames in fate-dirac*
2023-10-03 16:57:02 +02:00
Anton Khirnov cdfd15f4d8 lavc/mpeg4videodec: do not invent a framerate from guessed numbers
Improves timestamps for fate-m4v*
2023-10-03 16:57:02 +02:00
Andreas Rheinhardt 259e1d2bd7 avformat/matroskaenc: Write default duration for audio
This is easily possible for those codecs with a fixed frame-size
(in samples).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-02 12:22:20 +02:00
Andreas Rheinhardt 0c1103d4dc avformat/matroskaenc: Don't create wrong packet durations
We have to write an explicit BlockDuration element (and use
a BlockGroup instead of a SimpleBlock) in case the Track
has a DefaultDuration that is inconsistent with the duration
of the packet.

The matroska-h264-remux test uses a file with coded fields
where the duration of a Block is the duration of a field,
not of a frame, therefore this patch writes said BlockDuration
elements.

(When using a BlockGroup, one has to add ReferenceBlock elements
to distinguish keyframes from non-keyframes. Unfortunately,
the AV1 codec mapping [1] requires us to reference all references
and to really use the real references, which requires a lot of
effort for basically no gain. When BlockGroups are used with AV1,
the created files are most likely invalid, both before and after
this patch, but this patch makes this more likely to happen.)

[1]: https://github.com/ietf-wg-cellar/matroska-specification/blob/master/codec/av1.md

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-02 12:22:05 +02:00
Andreas Rheinhardt 6f7bf64dbc avcodec: Remove DCT, FFT, MDCT and RDFT
They were replaced by TX from libavutil; the tremendous work
to get to this point (both creating TX as well as porting
the users of the components removed in this commit) was
completely performed by Lynne alone.

Removing the subsystems from configure may break some command lines,
because the --disable-fft etc. options are no longer recognized.

Co-authored-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-01 02:25:09 +02:00
Paul B Mahol 3e7e5ec46b fate: add forgotten changes for GBRAP14 2023-09-28 20:07:48 +02:00
Paul B Mahol 29b673bdcf swscale: add GBRAP14 format support 2023-09-28 19:37:58 +02:00
Andreas Rheinhardt 0228e27ded checkasm/motion: Don't allocate AVCodecContext
Instead use one on the stack to avoid pulling in all
of libavcodec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-28 00:17:47 +02:00
Andreas Rheinhardt 80afcc8539 avfilter/bwdif: Add proper BWDIFDSPContext
This already avoids unnecessary indirectly included headers
in the arch-specific vf_bwdif_init.c files; it is also in
preparation for splitting the actual functions out of vf_bwdif.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-28 00:17:47 +02:00
Andreas Rheinhardt 8d5db120c2 tests/fate-run: Ensure that THREADS=random is actually random
From the documentation of GNU awk [1]:
"In most awk implementations, including gawk, rand() starts generating
numbers from the same starting number, or seed, each time you run awk.45
Thus, a program generates the same results each time you run it. The
numbers are random within one awk run but predictable from run to run.
This is convenient for debugging, but if you want a program to do
different things each time it is used, you must change the seed to a
value that is different in each run. To do this, use srand()."

This commit does exactly this.

[1]: https://www.gnu.org/software/gawk/manual/html_node/Numeric-Functions.html#index-rand_0028_0029-function

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-25 22:02:24 +02:00
Paul B Mahol 3bef108fa9
libswresample/swresample: avoid s16p internal transfer format
Instead use float one by default for sample rate conversions.
The s16p internal transfer format produces visible and hearable
quantization artifacts.

Signed-off-by: Paul B Mahol <onemda@gmail.com>

for S8 we continue to use S16 as it should have enough precision
Fate is adjusted so bitexactness is maintained between mips/arm/x86
if more tests became bit-inexact on some platform, the same change
can be done to them

The use of higher precision and float intermediates inevitably
leads to more differences between platforms.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-09-25 21:41:35 +02:00
Fei Wang 63371cde9d lavc/av1: Add unit test for level handling
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2023-09-22 13:15:01 +08:00
Anton Khirnov 5d58a35f98 fftools/ffmpeg: deprecate the -top option
It is badly named (should have been -top_field_first, or at least -tff),
underdocumented and underspecified, and (most importantly) entirely
redundant with the setfield filter.
2023-09-18 17:16:06 +02:00
Anton Khirnov 43a0004b5c fftools/ffmpeg_enc: apply -top to individual encoded frames
Fixes #9339.
2023-09-18 17:15:53 +02:00
Andreas Rheinhardt a84fe06112 avcodec/idctdsp: Avoid inclusion of avcodec.h
Not every user of idctdsp.h wants to initialize an IDCTDSPContext;
e.g. the proresdsp only uses ff_init_scantable_permutation()
and the IDCT permutation enum; similarly for cavsdsp and wmv2dsp.
Using a forward declaration here avoids an avcodec.h dependency
in the relevant files.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-11 00:26:34 +02:00
Andreas Rheinhardt a234e5cd80 fate/mpegps: Fix argument order
Regression since fb548fba04.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-08 15:48:21 +02:00
James Almer fb548fba04 avcodec/av1dec: export pixel format even if no hardware decoder is present
And remove the AVOID_PROBING flag, given it's the last av1 decoder to be tested
either way.
This fixes a regression introduced in 1652f2492f,
where even if forcing the native av1 decoder, if another decoder was present,
like libdav1d or libaom-av1, they'd be used for probing and some fate tests
would have different results.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-09-08 09:42:25 -03:00
Paul B Mahol 929eb72876 fate: add forgotten rpza reference test 2023-09-07 22:57:01 +02:00
Paul B Mahol 74375305ef fate: add rpza encoder tests 2023-09-07 20:58:08 +02:00
Andreas Rheinhardt f32a83c4eb fate/matroska: Add test for remuxing non-rotation displaymatrix
This provides coverage for the case in which the displaymatrix
is ignored.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-07 00:28:27 +02:00
James Almer 1652f2492f avcodec/av1dec: don't set aspect ratio when it's not yet known
Makes the output of the native decoder consistent with external decoders like
libdav1d with fate-enhanced-flv-av1.

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-09-06 14:37:15 -03:00
Paul B Mahol bfa43447fa fate: add OSQ test 2023-09-06 11:59:20 +02:00
Steven Liu 6c2f49e35f fate/enhanced-flv-vp9: add tests reference data 2023-09-05 15:01:34 +08:00
Steven Liu 62fb730762 tests/fate/flvenc: add av1 in enhanced flv test case
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2023-09-05 09:12:08 +08:00
Steven Liu 1a86cce51e tests/fate/flvenc: add vp9 in enhanced flv test case
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2023-09-05 09:10:46 +08:00
Paul B Mahol 182aef0198 fate: add rka test 2023-09-04 19:29:21 +02:00
Andreas Rheinhardt 091c41794d fate/ffmpeg: Add bitexact flag for ffmpeg-input-r test
Fixes the test when the non-bitexact MMXEXT versions of
the hpeldsp functions are used.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-04 14:38:56 +02:00
Andreas Rheinhardt f8503b4c33 avutil/internal: Don't auto-include emms.h
Instead include emms.h wherever it is needed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-04 11:04:45 +02:00
Andreas Rheinhardt a39d6e81fa tests/checkasm/sw_scale: Avoid declare_func_emms where possible
This makes the test stricter because it is checked that the
MMX registers are not accidentally clobbered.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-04 11:04:45 +02:00
Andreas Rheinhardt e7866e00c8 tests/checkasm/llvidencdsp: Don't use declare_func_emms
Only sub_media_pred has an MMXEXT version, so one can use
the version with the stricter check (that checks that
the MMX registers have not been clobbered) for sub_left_predict.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-04 11:04:45 +02:00
Andreas Rheinhardt 3f82b38516 tests/checkasm/hevc_*: Avoid using declare_func_emms where possible
Only the idct_dc and add_residual functions have MMX versions,
so one can use the version with the stricter check (that checks
that the MMX registers have not been clobbered) for all the other
checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-04 11:04:45 +02:00
Steven Liu 8b7a3c6f10 tests/fate/flvenc: add hevc in enhanced flv test case
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2023-09-04 14:02:40 +08:00
Lynne a810126501
wmavoice: convert DCT-I/DST-I to lavu/tx
This is the very last user of any lavc transform code.

This also *corrects* wmavoice decoding, as the previous DCT/DST
transforms were incorrect, bringing it closer to Microsoft's
own wmavoice decoder.
2023-09-01 23:59:11 +02:00
Leo Izen a49d7a1497
fate/jpegxl_anim: add demuxer fate test for jpegxl_anim
Adds a fate test for the jpegxl_anim demuxer, that should allow testing
for true positives and false positives for animated jpegxl files. Note
that two of the test cases are not animated, in order to help sort out
false positives.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-09-01 03:36:02 -04:00
Andreas Rheinhardt 884653ee5b avformat/matroskaenc: Don't add side-data to input stream
When muxing, the AVStreams' side-data is typically set
by the caller before avformat_write_header();
it is not documented to be else. Yet the Matroska muxer
added an AVStereo3D side data if certain metadata
was present:

Since commit 4d686fb721
(adding support for AVStereo3D stream side-data),
the Matroska muxer checked certain stream tags that
contain Matroska's StereoMode and (if they are present)
converted this value into an AVStereo3D struct that
gets attached to the AVStream (reusing a function from
the demuxer). Afterwards the AVStereo3D side data struct
(whether it has just been added by the muxer or not) gets
parsed and converted back into a Matroska StereoMode.

Besides being an API violation this change broke
StereoMode values without a corresponding AVStereo3D
(namely the anaglyph ones).

This commit fixes this: A StereoMode given via tags
is now used-as-is; if no such tag exists and an AVStereo3D
side data exists, it is converted into the corresponding
StereoMode (if possible). This approach also fixes
handling of the anaglyph ones; the changes to the
matroska-stereo_mode are due to this.

The new STEREOMODE_STEREO3D_MAPPING has been put to
good use for this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-30 19:31:30 +02:00
Anton Khirnov 411ada649f fftools/ffmpeg_enc: only use fallback framerate when encoding CFR
When no output video framerate is specified by the user with -r or can
be inferred from the filtergraph, encoder setup will arbitrarily decide
that the framerate is 25fps. However, making up any framerate value for
VFR encoding is at best unnecessary.

Changes the results of the sub2video tests, where the input timebase is
now used instead of 1/25.
2023-08-30 11:53:50 +02:00
Michael Niedermayer b5273c619d
tests/fate: Add NoLegacy-cut.ape test
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-28 01:10:14 +02:00
Matthias Dressel e41bd6e65e checkasm: hevc_sao: Fix a regression in hevc_sao_edge
check_func() might return NULL, in which case the function is not to be
benched. Introduced in cc679054c7.

Signed-off-by: Matthias Dressel <code@deadcode.eu>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-24 22:09:37 +03:00
Martin Storsjö 95433eb3aa fate/matroska: Stop using unicode in command line paramters
The fate-run.sh shell script exports LC_ALL=C before invoking the
test executables; this is probably done for consistency.

When executing Windows binaries with Wine, it normally handles
UTF-8 command line parameters just fine - but with LC_ALL set to
C, it treats them as plain ASCII.

As the unicode command line parameters wasn't the main thing
being tested here, just convert them to plain ASCII, for
portability. This fixes the test for all test configurations that
use Wine.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-22 22:09:40 +03:00
Andreas Rheinhardt f7715feb5d fate/matroska: Fix requirements of fate-matroska-alac-remux test
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-13 16:47:12 +02:00
Andreas Rheinhardt 5d07757c70 fate/matroska: Add test for stereo 3D
Just mark a non-stereo file as stereo to test the code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-13 16:46:54 +02:00
Andreas Rheinhardt d53acf452f avformat/matroskaenc: Don't write \0 unnecessarily
Writing the duration SimpleTag is special: It's size is
reserved in advance via an EBML Void element (if seekable)
and this reserved space is overwritten when writing the trailer;
it does not use put_ebml_string().

The string to write is created via snprintf on a buffer
of size 20; this buffer is then written via put_ebml_binary()
with a size of 20.

EBML strings need not be zero-terminated; if not, they
are implicitly terminated by the element's length field.
snprintf() always zero-terminates the buffer, i.e.
the last byte can be discarded when using an EBML string.
This patch does this.

The FATE changes are as expected: One byte saved for every
track; the only exception is the matroska-qt-mode test:
An additional byte is saved because an additional byte
could be saved from the enclosing Tags length field.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-10 23:56:35 +02:00
Andreas Rheinhardt b5968df9f0 avformat/matroskaenc: Don't reserve space for HDR10+ when unnecessary
Do it only for video (the only thing for type for which HDR10+
makes sense).

This effectively reverts changes to several FATE ref-files
made in bda44f0f39.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-10 23:56:35 +02:00