Commit Graph

6202 Commits

Author SHA1 Message Date
Rémi Denis-Courmont
45d7078a21 lavu/riscv: add CPU flag for B bit manipulations
The B extension was finally ratified in May 2024, encompassing:
- Zba (addresses),
- Zbb (basics) and
- Zbs (single bits).
It does not include Zbc (base-2 polynomials).
2024-07-25 23:09:58 +03:00
Martin Storsjö
97a708a507 checkasm: Increase the tolerance for ac3_sum_square_butterfly_float
Increase the tolerance from 10 ulp to 11 ulp. This fixes occasional
errors for some inputs; the errors could be reproduced on
aarch64/neon builds, with "checkasm --test=ac3dsp 3446175925".

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-24 12:10:33 +03:00
Rémi Denis-Courmont
c4c811b3d9 checkasm/h264dsp: test TX bypass 2024-07-21 22:36:48 +03:00
Leo Izen
e30bc8a963
fate/png: add mDCv and cLLi read and write test
This test confirms that we can write mDCv and cLLi chunks and read them
back via the png decoder. It uses an HEVC conformance sample with this
metadata as the base source for the side data in the frames.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Jan Ekström <jeebjp@gmail.com>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-19 11:30:19 -04:00
James Almer
97fd5d3363 checkasm/lls: increase epsilon value for the update_lls test
Should fix failures for some seeds on x86_32.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-19 09:24:59 -03:00
James Almer
7dabad079b avformat/iamf: byteswap values in OpusHeader
Clause 3.11.1 of IAMF[1] states the values are stored in big endian, in
contrast to the Ogg Encapsulation for Opus[2] where they are in little endian.

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#opus-specific
[2]https://datatracker.ietf.org/doc/html/rfc7845#section-5.1

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
Felicia Lim
180c869faf avformat/movenc: fix channel count and samplerate fields for IAMF tracks
Clause 6.2.3 of IAMF[1] states both of these shall be set to 0.

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#iasampleentry-section

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
James Almer
5d74dcf0e3 fate/lavf-container: add a test for L-HEVC remuxing
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 18:19:00 -03:00
James Almer
32588a9394 avformat/movenc: support writing cropping values
Finishes implementing ticket #7437.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
James Almer
93be6b425e avformat/mov: export cropping values from clap boxes
Addresses part of ticket #7437.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
Anton Khirnov
10185e2d4c fftools/ffmpeg_mux_init: default to input timebase for streamcopy
Stop trying to invent some "framerate-based" timebase when there is no
reason to think the stream is CFR at all.
2024-07-09 11:14:08 +02:00
James Almer
a696b28886 avformat/hevc: don't write NALUs with nuh_layer_id > 0 in hvcC boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
Derek Buitenhuis
46f7ea4456 avformat: Add a new stream disposition for multilayer video
This lets us detect when a container has flagged a stream as multilayer.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-07 12:38:50 -03:00
Anton Khirnov
24b3bad811 tests/fate/mov: add a test for VFR muxing 2024-07-07 11:37:43 +02:00
Anton Khirnov
6cde03739e tests/fate/filter-audio: convert atempo test to oneoff
Filter output is not bitexact.
2024-07-07 11:34:13 +02:00
James Almer
ecd3a97834 fate/filter-video: add missing swscale flags to tiltandshift tests
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-06 17:41:24 -03:00
James Almer
3d5bad7501 fate/filter-video: tests more pixel formats with the tiltandshift filter
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-06 10:50:55 -03:00
Martin Storsjö
affc1acde7 tests: Add a missing dependency for the filter-atempo test
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:03:20 +03:00
Anton Khirnov
9a7686e545 fftools/ffmpeg_mux_init: apply encoder options manually
Do not pass an options dictionary to the avcodec_open2() in enc_open().

This is cleaner and more robust, as previously various bits of code
would try to interpret the contents of the options dictionary, with
varying degrees of correctness. Now they can just access the encoder
AVCodecContext directly.

Cf. 372c78dd42 - analogous change for
decoding.

A non-progressive field order is now written on the container level in
interlaced ProRes encoding tests.
2024-07-03 11:38:52 +02:00
Rajiv Harlalka
fc446eea05 tests/fate/filter-audio.mak: add test for atempo audio filter
Signed-off-by: Rajiv Harlalka <rajivharlalka009@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-03 11:37:40 +02:00
Ramiro Polla
1fb77347c8 checkasm: add tests for yuv2rgb 2024-06-28 14:49:49 +02:00
Ramiro Polla
a8e2714d82 libavcodec/mjpeg: preserve unclipped last_dc value
Perform av_clip_int16(val) _after_ copying the value to last_dc.

This change ensures that clipping is applied only within the context of
the current block, preventing the propagation of clipped values to
subsequent DC components.

Related commits: c28f648b19 and dffae122d0
Related ticket: 4683
2024-06-28 14:48:23 +02:00
Nuo Mi
0333b97414 checkasm/vvc_alf: ensure right and bottom boundaries are not overwritten by asm 2024-06-25 19:32:17 +08:00
Nuo Mi
1fa9f5b17f checkasm/vvc_alf: random select alf virtual boundaries position
A picture's virtual boundaries will split a CTU into 4 ALF blocks.
The ALF virtual boundary may cross or not cross a ALF block.
2024-06-25 19:32:17 +08:00
Nuo Mi
b82ef7c0ba checkasm/vvc_alf: only check the valid filter and classify sizes 2024-06-25 19:32:17 +08:00
Lynne
dae12ddb2e
lavu/stereo3d: change the horizontal FOV field to a rational
This avoids hardcoding any implementation-specific limitiations as
part of the API, and allows for future expandability.

This also allows API users to more conveniently convert the
values into floats without hardcoding specific conversion constants.

The API was committed a few days ago, so changing this field now
is within the realms of acceptable.
2024-06-24 23:53:25 +02:00
Pierre-Anthony Lemieux
77ab1c773c
fate/jpeg2000dec: add support for p0_10.j2k
p0_10.j2k is one of the reference codestreams included in Rec. ITU-T T.803 | ISO/IEC 15444-4.
Adding this test was made possible by commit 6f4a95cfb8.
2024-06-24 08:50:59 -07:00
Martin Storsjö
6ec22731ae movenc: Add an option for resilient, hybrid fragmented/non-fragmented muxing
This allows ending up with a normal, non-fragmented file when
the file is finished, while keeping the file readable if writing
is aborted abruptly at any point. (Normally when writing a
mov/mp4 file, the unfinished file is completely useless unless it
is finished properly.)

This results in a file where the mdat atom contains (and hides)
all the moof atoms that were part of the fragmented file structure
initially.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-24 11:24:04 +03:00
James Almer
c3606cad9c avutil/stereo3d: set a sane default value for AVRational fields
Prevent potential divisions by 0 when using them immediately after allocation.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:03:55 -03:00
James Almer
5140d8334e ffprobe: always print all Stereo3D fields
ffprobe is meant to generate parseable output, and if a field is present, it
should be printed even if it has a default value.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:02:44 -03:00
Andreas Rheinhardt
3a5202d026 avcodec/h261enc: Fix ac_vlc_length tables
These tables are supposed to contain the number of bits needed
to encode a given (run, level) pair. Yet the number of bits
for pairs needing the escape code was wrong (it only contained
the escape code and not the bits needed for run and level).

Furthermore, H.261 (a format with explicit end-of-block codes)
does not work well together with the RLTable API from rl.c:
The EOB code is the first one in ff_h261_rl_tcoeff's VLC table
and has a run value of zero. Therefore the result of get_rl_index()
is off by one for run == 0 and level values with explicit
(run, level) pair.

Fixing this necessitated changing the ref files of the
vsynth*-h261-trellis tests. Both filesizes as well as PSNR
decreased. If one used a qscale value of 11 for this test,
one would have received files with about the same size as
before this patch (with qscale 12), but with better PSNR.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
8b4f7c0663 avcodec/me_cmp: Zero MECmpContext in ff_me_cmp_init()
Not every function will be set, so zero the context
to initialize everything.

This also allows to remove an initialization in dvenc.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
b1a31b32ab avcodec/me_cmp,dvenc,mpegvideo: Move ildct_cmp to its users
MECmpContext.ildct_cmp is an array of function pointers that
are not set by ff_me_cmp_init(), but that are set by users
to one of the other arrays via ff_set_cmp().

Remove these pointers from MECmpContext and add pointers
for the actually used functions to its users. (The DV encoder
already did so.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
cd2e46a350 avcodec/me_cmp, mpegvideo: Move frame_skip_cmp to MpegEncContext
MECmpContext has several arrays of function pointers that
are not set by ff_me_cmp_init(), but that are set by users
to one of the other arrays via ff_set_cmp().

One of these other users is mpegvideo_enc; it is the only user
of MECmpContext.frame_skip_cmp and it only uses one of these
function pointers at all.

This commit therefore moves this function pointer to MpegEncContext;
and removes the array from MECmpContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
182e647a64 avcodec/me_cmp, motion_est: Move me_(pre_)?_cmp etc. to MotionEstContext
MECmpContext has several arrays of function pointers that
are not set by ff_me_cmp_init(), but that are set by users
to one of the other arrays via ff_set_cmp().

One of these other users is the motion estimation API.
It uses MECmpContext.(me_pre|me|me_sub|mb)_cmp. It is
basically the only user of these arrays.

This commit therefore moves these arrays to MotionEstContext;
this has the additional advantage of making motion_est.c
more independent from MpegEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Frank Plowman
0eacad6921 fate/vvc: add vvc-conformance-RPR_A_4
Before    After
-------------------------------------------------
make fate-vvc CPU Time (No ASM)  131.52s  134.83s
libavcodec/vvc/* Line Coverage     95.3%    96.9%
inter_template.c Line Coverage     74.3%    88.2%
inter.c Line Coverage              85.3%    99.2%

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-20 08:57:45 -03:00
James Almer
4e608e90eb avformat/evc: fix writing reserved bits
They are all zeroes, not ones.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-19 10:12:50 -03:00
James Almer
0c0be4b99e fate/lavf-container: add extract_extradata BSF dependency to lavf-fate-hevc.mp4
Otherwise a bunch of SEI units that should not be in hvcC will be included,
and generate different output with builds where extract_extradata_bsf is not
present.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-18 15:47:59 -03:00
James Almer
89779a3cbe fate/lavf-container: add a hevc in ISOBMFF remux test
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-18 12:47:44 -03:00
Derek Buitenhuis
049dfe3f65 fftools/ffprobe: Print more Stereo 3D info from side data
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Zhao Zhili
74b4e550cb tests/checkasm: Remove check on linux perf fd in uninit
The check should be >= 0, not > 0. The check itself is redundant
since uninit only being called after init is success.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-18 15:23:46 +08:00
James Almer
fa325379c9 fate/checkasm: run the sw_range_convert test
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-15 21:02:06 -03:00
Ramiro Polla
874152033d checkasm: add tests for {lum,chr}ConvertRange 2024-06-16 00:34:24 +02:00
James Almer
a7e9f1c1e7 checkasm/lls: add missing random values to the test buffers
Fixes valgrind warnings after 18adaf9fe5.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 14:21:18 -03:00
Marton Balint
e405afdd0a avformat/mov_chan: use the newly added channel ids for more exact mapping
Also make the iso_channel_position table consistent with what the AAC decoder
uses in avcodec/aac/aacdec_usac.c.

Fate changes are caused by the change of how 7.1 layout is mapped, previously
it included Side Surround channels, now it includes the Surround channels.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-12 19:37:01 +02:00
Andreas Rheinhardt
edcfa846cf api/api-band-test: Query codec capabilities to decide admissibility
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt
b8cc5cf233 api/api-band-test: Perform codec admissibility check earlier
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt
4c22b00780 api/api-band-test: Remove write-only variable
Besides being write only it had the wrong type:
An uint8_t is definitely not enough to store the size
of these buffers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Rémi Denis-Courmont
378d1b06c3 riscv: probe for Zbb extension at load time
Due to hysterical raisins, most RISC-V Linux distributions target a
RV64GC baseline excluding the Bit-manipulation ISA extensions, most
notably:
- Zba: address generation extension and
- Zbb: basic bit manipulation extension.
Most CPUs that would make sense to run FFmpeg on support Zba and Zbb
(including the current FATE runner), so it makes sense to optimise for
them. In fact a large chunk of existing assembler optimisations relies
on Zba and/or Zbb.

Since we cannot patch shared library code, the next best thing is to
carry a flag initialised at load-time and check it on need basis.
This results in 3 instructions overhead on isolated use, e.g.:
1:  AUIPC rd, %pcrel_hi(ff_rv_zbb_supported)
    LBU   rd, %pcrel_lo(1b)(rd)
    BEQZ  rd, non_Zbb_fallback_code
    // Zbb code here

The C compiler will typically load the flag ahead of time to reducing
latency, and can also keep it around if Zbb is used multiple times in a
single optimisation scope. For this to work, the flag symbol must be
hidden; otherwise the optimisation degrades with a GOT look-up to
support interposition:
1:  AUIPC rd, GOT_OFFSET_HI
    LD    rd, GOT_OFFSET_LO(rd)
    LBU   rd, (rd)
    BEQZ  rd, non_Zbb_fallback_code
    // Zbb code here

This patch adds code to provision the flag in libraries using bit
manipulation functions from libavutil: byte-swap, bit-weight and
counting leading or trailing zeroes.
2024-06-11 20:12:37 +03:00
Rémi Denis-Courmont
18adaf9fe5 checkasm/lls: adjust buffer sizes and alignments
var must be padded.
param has `order + 1`, not `order` elements and is *not* over-aligned.
2024-06-11 20:07:55 +03:00