Commit Graph

6166 Commits

Author SHA1 Message Date
Andreas Rheinhardt
3933dcd491 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-20 20:27:43 +02:00
Andreas Rheinhardt
d2c568bd77 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-20 20:27:43 +02:00
Andreas Rheinhardt
840eb90aba 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-20 20:27:43 +02:00
Frank Plowman
82226fb431 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-20 20:27:40 +02:00
James Almer
51756aa667 avformat/evc: fix writing reserved bits
They are all zeroes, not ones.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-19 17:49:30 +02:00
James Almer
e0f74ccad7 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-19 17:49:29 +02:00
James Almer
0e8b4c07df fate/lavf-container: add a hevc in ISOBMFF remux test
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-19 17:49:29 +02:00
Derek Buitenhuis
233105196d fftools/ffprobe: Print more Stereo 3D info from side data
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-19 17:49:29 +02:00
Zhao Zhili
4e1c8f1a93 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-19 17:49:28 +02:00
James Almer
c9fd1e1460 fate/checkasm: run the sw_range_convert test
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-17 13:58:41 +02:00
Ramiro Polla
2250a5963e checkasm: add tests for {lum,chr}ConvertRange
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-17 13:37:29 +02:00
James Almer
5200d0b509 checkasm/lls: add missing random values to the test buffers
Fixes valgrind warnings after 18adaf9fe558587cb1b707c647af83015b69da48.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 21:50:47 +02:00
Marton Balint
8f2ee60617 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 17:10:03 +02:00
Andreas Rheinhardt
2f8ea9f62f api/api-band-test: Query codec capabilities to decide admissibility
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
defe49c0d9 api/api-band-test: Perform codec admissibility check earlier
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Andreas Rheinhardt
f2e61dc423 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-12 15:48:49 +02:00
Rémi Denis-Courmont
3312c631bb 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-11 21:52:15 +02:00
Rémi Denis-Courmont
3ea49a7f29 checkasm/lls: adjust buffer sizes and alignments
var must be padded.
param has `order + 1`, not `order` elements and is *not* over-aligned.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-11 21:52:14 +02:00
Anton Khirnov
a509340e41 lavc/hevcdec: output RASL frames based on the value of no_rasl_output_flag
Instead of an ad-hoc scheme. Also, combine skipping RASL frames with
skip_frame handling - current code seems flawed as it only executes for
the first slice of a RASL frame and unnecessarily unsets is_decoded,
which should not be set at this point anyway..

Some RASL frames in fate-hevc-afd-tc-sei that were previously discarded
are now output.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-11 21:52:14 +02:00
Zhao Zhili
d25c581ec4 tests/checkasm: Fix build error when enable linux perf on Android
B0 is defined by system header, see f0f596dbc6 for ref.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-11 16:59:43 +02:00
James Almer
452c2cda30 checkasm/sw_rgb: fix alignment of buffers for rgb_to_yuv tests
src is apparently not guaranteed to be >8 byte aligned, but align to 16
nonetheless as the x86 asm will do unaligned loads anyway.
dst is guaranteed to be 32 byte aligned for the Y plane, but 16 byte for UV.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-09 20:45:22 +02:00
James Almer
5a3ca52691 checkasm/sw_rgb: test rgb32/rgb32_1 to yuv
Test all four pixel formats, but only bench the two native endian ones for a
given target.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-09 20:45:21 +02:00
James Almer
d4ede3f449 x86/aacencdsp: add AVX version of quantize_bands
quant_bands_signed_c: 1928.0
quant_bands_signed_sse2: 406.0
quant_bands_signed_avx: 207.0
quant_bands_unsigned_c: 1702.0
quant_bands_unsigned_sse2: 404.0
quant_bands_unsigned_avx: 209.0

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-09 20:45:21 +02:00
Andreas Rheinhardt
cd606c125c tests/checkasm/sw_rgb: Be more strict about clobbering MMX state
The MMXEXT versions of the rgb2rgb functions tested here
always emit emms on their own. Therefore one can use
a stricter test to ensure that it stays that way.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-09 16:06:34 +02:00
Andreas Rheinhardt
3df9c8fea4 avformat/vvc: Don't use ff_copy_bits()
There is no benefit in using it: The fast path of copying
is not taken because of misalignment; furthermore we are
only dealing with a few byte here anyway, so simply copy
the bytes manually, avoiding the dependency on bitstream.c
in lavf (which also contains a function that is completely
unused in lavf).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-09 11:19:52 +02:00
Nuo Mi
ba9c36d315 avcodec/vvcdec: support mv wraparound
A 360 video specific tool
see https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9503377

passed files:
    DMVR_A_Huawei_3.bit
    WRAP_D_InterDigital_4.bit
    WRAP_A_InterDigital_4.bit
    WRAP_B_InterDigital_4.bit
    WRAP_C_InterDigital_4.bit
    ERP_A_MediaTek_3.bit

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-09 00:01:53 +02:00
Rémi Denis-Courmont
d2583e57f1 checkasm: disable unaligned access emulation
The OS may silently fix (emulate) unaligned hardware access exceptions.
This is extremely slow and code should be fixed not to rely on unaligned
access on affected hardware. Accordingly this requests that the OS
disable emulation and instead throw Bus error, which will be caught by
checkasm's signal handler.

This has no effects if the hardware supports unaligned access in
hardware, since no exceptions are generated. prctl() will fail safe in
that case.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-09 00:01:48 +02:00
Zhao Zhili
4f1247e232 checkasm/sw_rgb: test rgb24/bgr24 to yuv
The line width 8 is supposed to test corner case, while the
performance doesn't matter. Width 1080 is also a case of
unaligned to 16.

Width 1920 meant for benchmark (together with --runs options).

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-06 16:47:03 +02:00
Anton Khirnov
cf7d6a9987 lavc/hevc*: move to hevc/ subdir
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-06 16:47:02 +02:00
Rémi Denis-Courmont
49db497336 checkasm: add aacencdsp.quant_bands test
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-04 08:38:16 +02:00
Lynne
c14fa543d9 fate: add tests for xHE-AAC
Starting off small with a few features.
Samples and reference decoded files copied from the official ISO
reference suite.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-02 21:40:37 +02:00
Rémi Denis-Courmont
98525299e0 checkasm: add linear least square tests
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-01 18:25:44 +02:00
James Almer
b913b58cc0 checkasm/lpc: use fixed length to bench apply_welch_window
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-01 18:25:43 +02:00
Rémi Denis-Courmont
f2a38bd7df checkasm/lpc: test compute_autocorr
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-01 18:25:42 +02:00
Rémi Denis-Courmont
d261039da9 checkasm/float_dsp: add double-precision scalar product
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-31 21:53:42 +02:00
James Almer
4a8f4e5e4d tests/checkasm/vvc_mc: don't zero the SAD buffers
They will be filled immediately after.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-31 14:50:27 +02:00
James Almer
054b0d38ba tests/checkasm/vvc_mc: fix indentation
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-31 14:50:27 +02:00
Wu Jianhua
ac5637ae71 tests/checkasm/vvc_alf: change alf step size to 8
From Benjamin Bross:
> for ALF where functions are in increments of 4 while 8 should be sufficient according to the spec.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-31 14:50:27 +02:00
Pierre-Anthony Lemieux
62e094904a avcodec/jpeg2000dec: fix HT block decoder
Addresses https://trac.ffmpeg.org/ticket/10905

Co-authored-by: Osamu Watanabe <owatanab@es.takushoku-u.ac.jp>
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-31 10:09:00 +02:00
Rémi Denis-Courmont
48bcee416b checkasm/vp8dsp: add VP7 tests
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-31 10:09:00 +02:00
Rémi Denis-Courmont
e65e9c389c checkasm/vp8dsp: share DSP context across tests
This will simplify later changes.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-31 10:09:00 +02:00
Stone Chen
434c941f59 tests/checkasm/vvc_mc: for SAD, only test valid subblock sizes
According to the VVC specification (section 8.5.1), the maximum width/height of a subblock passed for DMVR SAD is 16. This along with previous constraint requiring width * height >= 128 means that  8x16, 16x8, and 16x16 are the only allowed sizes.

This changes check_vvc_sad() to only test and benchmark those sizes.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-31 10:08:59 +02:00
Rémi Denis-Courmont
1ebc732fff checkasm: add h263dsp.{h,v}_loop_filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-28 16:28:05 +02:00
Andreas Rheinhardt
67d868a876 tests/fate/source-check: Relax BSD licence check
Several files already had standard license header (namely
2-clause BSD files), yet due to the 80 char line length limit,
they were not treated as such by source-check.sh (which
fate-source uses). Therefore relax the BSD check.

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-28 16:28:05 +02:00
Andreas Rheinhardt
6fbe3bc7ba tests/checkasm/vvc_alf: Don't use declare_func_emms
VVC does not have MMX code at all, so one can use the stricter
declare_func to also check that the MMX state has not been clobbered
with (which would be an ABI violation).

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-25 15:28:18 +02:00
Rémi Denis-Courmont
b575460b82 checkasm/riscv: test misaligned before V
Otherwise V functions mask scalar misaligned ones.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-24 22:47:42 +02:00
James Almer
aea36dcee7 checkasm/flacdsp: add a test for lpc33
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-24 22:47:41 +02:00
Stone Chen
b9be32cced tests/checkasm: Add check_vvc_sad to vvc_mc.c
Adds checkasm for DMVR SAD AVX2 implementation.

Benchmarks ( AMD 7940HS )
vvc_sad_8x8_c: 50.3
vvc_sad_8x8_avx2: 0.3
vvc_sad_16x16_c: 250.3
vvc_sad_16x16_avx2: 10.3
vvc_sad_32x32_c: 1020.3
vvc_sad_32x32_avx2: 60.3
vvc_sad_64x64_c: 3850.3
vvc_sad_64x64_avx2: 220.3
vvc_sad_128x128_c: 14100.3
vvc_sad_128x128_avx2: 840.3

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-23 22:03:01 +02:00
James Almer
029500ce24 avformat/vvc: initialize some ptl flags
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-23 22:03:01 +02:00
Martin Storsjö
9b77a199ac checkasm: h264dsp: Avoid out of buffer writes when benchmarking
The loop filters can write before the pointer given to them;
the actual test invocations correctly used an offset, while
the benchmark calls were lacking an offset. Therefore, when
running with benchmarking, these tests could have spurious
failures.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-23 22:03:00 +02:00