Commit graph

6383 commits

Author SHA1 Message Date
07e54f9b5c
avformat/jpegxl_anim_dec: use new animated JPEG XL codec ID
A new codec ID has been added to avcodec for animated JPEG XL, so
we should use that in the animated JPEG XL demuxer.

Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-01-03 19:37:36 -05:00
James Almer
547408ce1d avformat/iamfdec: swap back and side streams if both are present
Layouts with both pairs (7.1, 7.1.2, etc) in IAMF that follow the definition in
ITU-R BS.2051-3 for Systems I and J also follow its ordering. This means side
comes before back, which is the inverse of how it's defined in AVChannel.

To workaround this without having to use custom order channel layouts, swap the
stream ids in the input IAMF structure, so packets for one are mapped to the
other.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:13 -03:00
James Almer
8f6a1a06a6 avformat/iamf: use the correct layouts for Sound Systems B and C
They have the side channels, not back, as defined in ITU-R - BS.2051-3

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:13 -03:00
James Almer
aba9fafee7 avutil/channel_layout: fix definition of 5.1.4 layout
It's meant to have the side channels, as defined in Sound System D from
ITU-R - BS.2051-3

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:12 -03:00
James Almer
da9dcaba69 avutil/channel_layout: add a 5.1.2 layout using side channels
And rename the existing 5.1.2 to explicitly state it contains back channels.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:12 -03:00
James Almer
658a645e18 tests/checkasm/sw_rgb: remove bogus value truncation in check_yuv2packed1()
Fixes out of array accesses.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:53:18 -03:00
James Almer
376bb8481a avcodec/ac3dec_float: define the downmix related options as exported and read-only
They are not user settable options.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:30:09 -03:00
64043d7b18 fate/flvenc: add test for multitrack flv 2024-12-27 20:24:23 +01:00
Niklas Haas
af6d52eec6 swscale: use 16-bit intermediate precision for RGB/XYZ conversion
The current logic uses 12-bit linear light math, which is woefully insufficient
and leads to nasty postarization artifacts. This patch simply switches the
internal logic to 16-bit precision.

This raises the memory requirement of these tables from 32 kB to 272 kB.

All relevant FATE tests updated for improved accuracy.

Fixes: #4829
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-26 20:31:36 +01:00
Niklas Haas
c6bf7f6645 swscale/unscaled: correctly round yuv2yuv when not dithering
We should at least bias towards the nearest integer, instead of always
rounding down, when not dithering. This is a bit more correct.

The FATE changes are only in the cases where sws_dither was explicitly set
to "none", which is exactly as expected.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:29:22 +01:00
Niklas Haas
a9ae2cc14d checkasm/sw_rgb: add alpToYV12 check
Mirroring lumToYV12 and chrToYV12.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:20:59 +01:00
Niklas Haas
c601bb8df5 checkasm/sw_rgb: add tests for yuv2packed{1,2,X}
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:20:58 +01:00
Niklas Haas
57bbdb4fb1 checkasm/sw_scale: add test for yuv2nv12cX
Mirroring yuv2yuvX.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:20:58 +01:00
Niklas Haas
fe9bf7cd52 checkasm/sw_scale: add assertion for hscale assumption
This code only checks hcScale. In practice this is not an issue because
the function pointers should always be identical to hyScale for the same
filter size.

Add an assertion just to make sure this assumption never regresses.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:20:58 +01:00
Peter Ross
b2cba76d4f avformat/riff: map 0069 twocc to ADPCM IMA XBOX decoder 2024-12-22 16:08:33 +11:00
90af8e07b0 fftools/ffprobe: add analyze_frames option for CC and grain detection
Currently, ffprobe has two stream-level fields that do not work,
closed_captions and film_grain).

Their value is always 0 because ffprobe cannot access the internal
codec properties when it is setting up its stream contexts.

In this commit, add the new option -analyze_frames to ffprobe,
allowing the user to read frames up to the interval they have defined
and fill these fields based on what is exposed in AVPacketSideData.

Additionally, in the same commit, don't write these fields to
the output unless analyze_frames is enabled. Finally, fix the
FATE test refs accordingly and update the docs.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-13 22:41:31 -06:00
James Almer
b164dea68c fate/iamf: add a test for expanded layouts
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-13 16:36:10 -03:00
James Almer
6eb4bf04e9 avutil/channel_layout: add a 9.1.6 layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-13 16:35:47 -03:00
Martin Storsjö
eb79c316c7 fate: Add a dependency on ffprobe for fate-flcl1905
This fixes occasional failed tests, if doing "make fate" without a
regular "make" or "make all" inbetween.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-13 09:48:17 +02:00
Martin Storsjö
1e76bd2f39 fate: Add a target for listing failed tests
If running tests with "make -j<N> fate", the execution will stop
after the first failing test. To get an overview of the whole
test suite, one rather would run "make -k -j<N> fate", which then
again buries the results about what tests actually failed further
up in the console log.

Add a target so one can run "make fate-list-failing", to see a list
of all tests that failed the last time they were executed.

Also add a companion target "fate-clear-reports" which removes all
the old test reports. (When executing a subset of tests, the report
files of all tests that aren't executed stay untouched. This also
allows getting rid of reports for tests that no longer are present
in the testsuite.)

Co-authored-by: Alexander Strasser <eclipse7@gmx.net>

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-11 14:10:22 +02:00
Martin Storsjö
4b524649ff checkasm: Print benchmarks of C-only functions
This corresponds to commit 9278a14cf406f8edb5052c42b83750112bf5b515
in dav1d.

Omitting the C-only functions doesn't speed up benchmarking
anyway (as those has to be benchmarked before we know if we have
any corresponding assembly functions), and being able to benchmark
those functions without corresponding assembly can be valuable in
a number of cases.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-11 10:51:15 +02:00
sunyuechi
82da769492 checkasm/rv40dsp: cover more cases
Co-Authored-By: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-12-10 11:24:45 -05:00
Martin Storsjö
47b1e1bd84 checkasm: vvc: Use checkasm_check for printing failing output
Share the checkasm_check_pixel macro from hevc_pel in checkasm.h,
to allow other tests to use the same. (To use it in other tests,
those tests need to have a similar setup for high bitdepth pixels,
with a local variable named "bit_depth".)

This simplifies the code for checking the output, and can print
the failing output (including a map of matching/mismatching
elements) if checkasm is run with the -v/--verbose option.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-10 11:26:09 +02:00
c1e3d55f99
avcodec/png{dec,enc}: update mDCV and cLLI chunk capitalization
The PNGv3 Specification Draft [1] has changed the capitalization
of mDCV and cLLI chunks (formerly mDCv and cLLi). This patch updates
FFmpeg to work with the new chunk names while retaining decode-side
compatibility with files created using the old names.

[1]: https://w3c.github.io/png/

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2024-12-09 15:16:59 -05:00
Paul B Mahol
8050a7955e avformat/mm: fix packets pts generation and add seek support
Signed-off-by: Peter Ross <pross@xvid.org>
2024-12-08 09:32:35 +11:00
Zhao Zhili
018ec4fe5f tests/checkasm: Simplify logic for WASI signal handling
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Martin Storsjö <martin@martin.st>
2024-12-06 10:48:11 +08:00
Ramiro Polla
384fe39623 swscale/range_convert: fix mpeg ranges in yuv range conversion for non-8-bit pixel formats
There is an issue with the constants used in YUV to YUV range conversion,
where the upper bound is not respected when converting to mpeg range.

With this commit, the constants are calculated at runtime, depending on
the bit depth. This approach also allows us to more easily understand how
the constants are derived.

For bit depths <= 14, the number of fixed point bits has been set to 14
for all conversions, to simplify the code.
For bit depths > 14, the number of fixed points bits has been raised and
set to 18, to allow for the conversion to be accurate enough for the mpeg
range to be respected.

The convert functions now take the conversion constants (coeff and offset)
as function arguments.
For bit depths <= 14, coeff is unsigned 16-bit and offset is 32-bit.
For bit depths > 14, coeff is unsigned 32-bit and offset is 64-bit.

x86_64:
chrRangeFromJpeg8_1920_c:    2127.4   2125.0  (1.00x)
chrRangeFromJpeg16_1920_c:   2325.2   2127.2  (1.09x)
chrRangeToJpeg8_1920_c:      3166.9   3168.7  (1.00x)
chrRangeToJpeg16_1920_c:     2152.4   3164.8  (0.68x)
lumRangeFromJpeg8_1920_c:    1263.0   1302.5  (0.97x)
lumRangeFromJpeg16_1920_c:   1080.5   1299.2  (0.83x)
lumRangeToJpeg8_1920_c:      1886.8   2112.2  (0.89x)
lumRangeToJpeg16_1920_c:     1077.0   1906.5  (0.56x)

aarch64 A55:
chrRangeFromJpeg8_1920_c:   28835.2  28835.6  (1.00x)
chrRangeFromJpeg16_1920_c:  28839.8  32680.8  (0.88x)
chrRangeToJpeg8_1920_c:     23074.7  23075.4  (1.00x)
chrRangeToJpeg16_1920_c:    17318.9  24996.0  (0.69x)
lumRangeFromJpeg8_1920_c:   15389.7  15384.5  (1.00x)
lumRangeFromJpeg16_1920_c:  15388.2  17306.7  (0.89x)
lumRangeToJpeg8_1920_c:     19227.8  19226.6  (1.00x)
lumRangeToJpeg16_1920_c:    15387.0  21146.3  (0.73x)

aarch64 A76:
chrRangeFromJpeg8_1920_c:    6324.4   6268.1  (1.01x)
chrRangeFromJpeg16_1920_c:   6339.9  11521.5  (0.55x)
chrRangeToJpeg8_1920_c:      9656.0   9612.8  (1.00x)
chrRangeToJpeg16_1920_c:     6340.4  11651.8  (0.54x)
lumRangeFromJpeg8_1920_c:    4422.0   4420.8  (1.00x)
lumRangeFromJpeg16_1920_c:   4420.9   5762.0  (0.77x)
lumRangeToJpeg8_1920_c:      5949.1   5977.5  (1.00x)
lumRangeToJpeg16_1920_c:     4446.8   5946.2  (0.75x)

NOTE: all simd optimizations for range_convert have been disabled.
      they will be re-enabled when they are fixed for each architecture.

NOTE2: the same issue still exists in rgb2yuv conversions, which is not
       addressed in this commit.
2024-12-05 21:10:29 +01:00
Ramiro Polla
536a44e8dc checkasm/sw_range_convert: test negative input values 2024-12-05 21:10:29 +01:00
Niklas Haas
7b73ea501d avutil/tests/color_utils: add tests for av_csp_itu_eotf 2024-12-05 12:27:33 +01:00
Niklas Haas
bf0a6c4111 avutil/csp: add av_csp_trc_inv_from_id()
Mathematical inverse of av_csp_trc_from_id(), plus testing to make sure it
roundtrips correctly with the corresponding TRC.
2024-12-05 12:26:49 +01:00
Niklas Haas
28f217780b avutil/tests/color_utils: clean up slightly (cosmetic)
Rewrite this test slightly to fix the formatting, improve the readability of
the output, and eliminate some unnecessary branching.
2024-12-05 11:51:18 +01:00
Zhao Zhili
ea3d21c349 tests/checkasm: Add partial support for wasm
WASI mssing signal and siglongjmp support. This patch workaround
build error and add simd128 flag. Please note that many tests use
large array on stack, so you need to increase the stack size when
build checkasm, e.g., --extra-ldflags='-Wl,-z,stack-size=10485760'

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-12-04 16:43:07 +08:00
Marton Balint
4100a2da29 tests/fate/filter-audio: add aloop test
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-29 21:59:56 +01:00
Marton Balint
f5948543f4 fate: revert previous frequency adjustments of the sine filter
With more precise frequency support in the sine filter, several fate tests will
change.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-29 21:16:22 +01:00
Marton Balint
6189cb47fc fate: adjust frequencies of the sine filter
The filter currently uses inaccurate frequencies, this is in preparation for
fixing that, by using numbers that will map to the equivalent value in the
future code.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-29 21:15:22 +01:00
Ramiro Polla
4e1a91112d tests/fate/filter-video: don't convert owdenoise test to mpeg range 2024-11-28 00:58:21 +01:00
James Almer
19f7dae81a avformat/mov: add missing stts array syncing in mov_build_index
Also fix checks for sc->stts_count that assume it may not be in sync with
sample count.
Missed in 865c73c86f. Fixes parsing durations in
some cases.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-25 14:40:15 -03:00
Niklas Haas
6a91a165fd swscale: eliminate redundant SwsInternal accesses
This is a purely cosmetic commit aimed at replacing accesses to
SwsInternal.opts by direct access to SwsContext wherever convenient.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 10:59:52 +01:00
James Almer
4e6d31755b avformat/spdifdec: parse headers for audio codecs
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:14:11 -03:00
Darren Mo
865c73c86f avformat/mov: Populate packet duration using stts atom instead of guessing
Fixes tickets #7855 and #11312.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 20:50:05 -03:00
Niklas Haas
2d077f9acd swscale/internal: group user-facing options together
This is a preliminary step to separating these into a new struct. This
commit contains no functional changes, it is a pure search-and-replace.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-21 12:49:56 +01:00
James Almer
9d8f7bf4b8 tests/checkasm/diracdsp: fix alignment for src and ombc_weight buffers
They are supposed to be 16 byte aligned, not 8.
Should fix crashes in some systems.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-19 12:32:49 -03:00
Rémi Denis-Courmont
55aa81d5cc checkasm: add RISC-V vector width to arch info 2024-11-17 11:28:21 +02:00
Kyosuke Kawakami
711290f9a3 checkasm/diracdsp: test add_dirac_obmc
Signed-off-by: Kyosuke Kawakami <kawakami150708@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:44:53 -05:00
James Almer
edc7b67508 avformat/iamf: use the new Binaural channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:38:04 -03:00
James Almer
20af68b63a avutil/channel_layout: add Binaural channels and layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:38:04 -03:00
James Almer
2b1bf3e228 fate/pixfmt: reintroduce scale filter dependency for some tests
Removed by mistake in 271aea60a4.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-10 20:22:22 -03:00
Osamu Watanabe
82467b635e
avcodec/jpeg2000: Improve FF_DWT97_INT to pass ISO/IEC 15444-4 conformance tests
Fixes https://trac.ffmpeg.org/ticket/10123

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-11-08 08:30:07 -08:00
James Almer
3330b733d3 fate/pixfmt: disable dithering in the scale filter
Should fix fate failures across different systems.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-08 09:19:06 -03:00
James Almer
2eb9c35010 x86/swscale: disable AVX2 yuv2nv12cX functions if accurate_rnd is requested
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-07 11:16:42 -03:00