Commit graph

6810 commits

Author SHA1 Message Date
Andreas Rheinhardt
f37cfb370f avcodec/avcodec: Deprecate intra_dc_precision
It is only used by the MPEG-2 encoder, so replace it
by a private option instead. Use a more elaborate term
for it: intra_dc_precision ("dc" could be anything).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 20:14:36 +01:00
Andreas Rheinhardt
ee72731722 tests/fate/vcodec: Test intra_dc_precision
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 20:14:36 +01:00
Nicolas Gaullier
fe86fd07d3 fftools/ffprobe: do not show refs when not processing frames
refs does not belong to AVCodecParameters, so require a decoder:
it should only be showed when frames are actually processed by ffprobe.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
2026-03-05 13:49:59 +00:00
Martin Storsjö
8324c8ea89 checkasm: ac3dsp: Increase the float tolerance for sum_square_butterfly_float
Accept up to 15 ULP difference.

This fixes running "checkasm --test=ac3dsp <seed>" for the seeds
2043066705, 24168 and 111972 on ARM, and the seeds 40552 and
209754 on aarch64.

This is the same change as 8e4c904c8e,
increasing the tolerance further.

With this change, checkasm passes for over 500 000 seeds on both
ARM and aarch64.
2026-03-04 22:30:40 +00:00
Georgii Zagoruiko
905348df9d configure: add detection of SME-I16I64 extension 2026-03-04 23:52:57 +02:00
Georgii Zagoruiko
70691bbb27 configure: add detection of assembler support for SME2 2026-03-04 23:52:36 +02:00
David Christle
86a62388cc tests/checkasm: add rgb32tobgr24 and rgb24tobgr32 tests
Add checkasm coverage for rgb32tobgr24 (alpha drop) and rgb24tobgr32
(alpha insert) with test widths exercising all code tiers and
overwrite detection via sentinel bytes.

Signed-off-by: David Christle <dev@christle.is>
2026-03-04 10:30:08 +00:00
David Christle
78f6cec1b4 tests/checkasm: add rgb24tobgr24 test
Add checkasm coverage for rgb24tobgr24 with test widths exercising
all code tiers (scalar, 8-pixel NEON, 16-pixel NEON).

Signed-off-by: David Christle <dev@christle.is>
2026-03-04 10:30:08 +00:00
Michael Niedermayer
92f8dd1ea1 tests/fate/mov: add quotes to some map arguments
Fixes failures for the tests/data/mov-mp4-iamf-7_1_4-video-first.mp4 target on some systems.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-02 13:05:18 -03:00
David Christle
8f567d5cab tests/checkasm/sw_yuv2rgb: test multi-row conversion with padded strides
Increase test height from 2 to 4 rows and add 32 bytes of source stride
padding. This exercises chroma row sharing across multiple luma row pairs
in YUV420P and the stride increment arithmetic in SIMD implementations,
both of which were previously untested.

Signed-off-by: David Christle <dev@christle.is>
2026-03-02 13:14:07 +00:00
James Almer
40e60a7db0 tests/fate/mov: add tests to demux specific streams within a IAMF Track
Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-02 09:28:36 -03:00
Andreas Rheinhardt
d345e902d2 avcodec/x86/huffyuvencdsp: Remove MMX sub_hfyu_median_pred_int16
Superseded by SSE2 and AVX2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-01 12:04:14 +01:00
Andreas Rheinhardt
6834762d7b avcodec/huffyuvencdsp: Add width parameter to init
This allows to only use certain functions using wide registers
if there is enough work to do and if one can even read a whole
register wide without overreading.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-01 11:58:16 +01:00
Andreas Rheinhardt
2b910f71bb tests/checkasm: Fix huffyuvdsp test criterion
Use CONFIG_HUFFYUVDSP, not CONFIG_HUFFYUV_DECODER
(although they are equivalent).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-01 11:56:57 +01:00
Andreas Rheinhardt
fd44e277c8 tests/checkasm: Add huffyuvencdsp test
Only covers sub_hfyu_median_pred_int16 for now.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-01 11:56:57 +01:00
Steven Liu
2559f263ea tests/fate/flvenc: add vvc in enhanced flv test case 2026-03-01 04:21:45 +00:00
Adrien Guinet
da9a6d51f5
avformat/mov: add support for multiple decryption keys
This commit introduces new options to support more than one decryption
keys:
* add a decryption_keys option to MOV, that supports a dictionary of
  KID=>key (in hex), using AV_OPT_TYPE_DICT
* add the corresponding cenc_decryption_keys option to DASH

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-02-28 04:01:08 +01:00
Niklas Haas
335ca9c4f4 tests/checkasm: Fix whitespace cosmetics
This line was left misaligned in
b863b81500.
2026-02-27 17:08:46 +00:00
Martin Storsjö
5693b07839 tests/checkasm/sw_ops: Switch to opaques for deciding when to test
This uses the new mechanisms introduced in
cf7e2b6773, as used by the crc test
in 0629ebb5ff.
2026-02-27 17:08:31 +00:00
Niklas Haas
b7bbcccbfe tests/swscale: disable fate-sws-ops-list on BE platforms
The issue is that every le/be pair ends up with a swapped op list:

 rgb24 -> rgb48be:
   [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) packed >> 0
   [ u8 ...X -> +++X] SWS_OP_CONVERT      : u8 -> u16 (expand)
-  [u16 ...X -> zzzX] SWS_OP_SWAP_BYTES
-  [u16 ...X -> zzzX] SWS_OP_WRITE        : 3 elem(s) packed >> 0
+  [u16 ...X -> +++X] SWS_OP_WRITE        : 3 elem(s) packed >> 0
     (X = unused, z = byteswapped, + = exact, 0 = zero)
 rgb24 -> rgb48le:
   [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) packed >> 0
   [ u8 ...X -> +++X] SWS_OP_CONVERT      : u8 -> u16 (expand)
-  [u16 ...X -> +++X] SWS_OP_WRITE        : 3 elem(s) packed >> 0
+  [u16 ...X -> zzzX] SWS_OP_SWAP_BYTES
+  [u16 ...X -> zzzX] SWS_OP_WRITE        : 3 elem(s) packed >> 0
     (X = unused, z = byteswapped, + = exact, 0 = zero)

I'm not sure of a good work-around that's not needlessly difficult to
implement, so just disable it on BE platforms for now. The actual underlying
conversions should still be covered by the sws-unscaled test.
2026-02-26 18:08:49 +00:00
Niklas Haas
43f1189af7 swscale/ops_optimizer: eliminate unnecessary dither indices
Generates a lot of incremental diffs due to things like ignored alpha
planes or chroma planes that are not actually modified.

e.g.

 bgr24 -> gbrap10be:
   [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) packed >> 0
   [ u8 ...X -> +++X] SWS_OP_CONVERT      : u8 -> f32
   [f32 ...X -> ...X] SWS_OP_SCALE        : * 341/85
-  [f32 ...X -> ...X] SWS_OP_DITHER       : 16x16 matrix + {2 3 0 5}
+  [f32 ...X -> ...X] SWS_OP_DITHER       : 16x16 matrix + {2 3 0 -1}
   [f32 ...X -> ...X] SWS_OP_MIN          : x <= {1023 1023 1023 1023}
   [f32 ...X -> +++X] SWS_OP_CONVERT      : f32 -> u16
   [u16 ...X -> zzzX] SWS_OP_SWAP_BYTES
   [u16 ...X -> zzzX] SWS_OP_SWIZZLE      : 1023
   [u16 ...X -> zzz+] SWS_OP_CLEAR        : {_ _ _ 65283}
   [u16 .... -> zzz+] SWS_OP_WRITE        : 4 elem(s) planar >> 0
     (X = unused, z = byteswapped, + = exact, 0 = zero)

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-02-26 13:09:14 +00:00
Andreas Rheinhardt
13e95746ea tests/checkasm/h264chroma: Don't overalign
The input only needs to have natural alignment
(i.e. 1 in the 8bpp case, 2 otherwise), the output
only needs to have 16 (namely in the width 8 >8bpp case).

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-25 12:42:22 +01:00
Andreas Rheinhardt
e9c2f19e01 tests/checkasm/h264chroma: Add bit depth to error output
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-25 12:42:19 +01:00
Andreas Rheinhardt
34cf7790ef tests/checkasm/h264chroma: Fix initialization, range of values
This commit fixes four related bugs:
1. The >8bpp codepath only initializes half the buffer.
The remaining half used leftover samples from the 8bpp codepath
which initialized the complete buffer.
2. The 8bpp codepath tests only 2 bit inputs (&3). This means
that the second half of the buffer only uses 10 bits (in fact,
only values of the form 000000xx000000xxb) when treated as uint16_t
in the >8bpp test. Due to 1., using more bits in the 8bpp test
would make the >8bpp tests fail (the intermediates would no longer
fit into 16bits).
3. For the >8bpp tests, the first half of the buffer would
only be tested with 8bpp input.
4. The 8bpp codepath initializes the whole buffer, but only
uses half of it.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-25 12:41:13 +01:00
Andreas Rheinhardt
dc65dcec22 avcodec/vvc/inter: Combine offsets early
For bi-predicted weighted averages, only the sum
of the two offsets is ever used, so add the two early.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-25 12:08:33 +01:00
Ramiro Polla
c9977acbc6 swscale/ops: clear range values SWS_OP_{MIN,MAX}
This gives partial range values on conversions with floats, after the
values have been clamped.

 gbrpf32be -> rgb8:
   [f32 XXXX -> zzzX] SWS_OP_READ         : 3 elem(s) planar >> 0
   [f32 ...X -> ...X] SWS_OP_SWAP_BYTES
   [f32 ...X -> ...X] SWS_OP_SWIZZLE      : 2013
   [f32 ...X -> ...X] SWS_OP_LINEAR       : diag3 [[7 0 0 0 0] [0 7 0 0 0] [0 0 3 0 0] [0 0 0 1 0]]
   [f32 ...X -> ...X] SWS_OP_DITHER       : 16x16 matrix + {0 3 2 5}
   [f32 ...X -> ...X] SWS_OP_MAX          : {0 0 0 0} <= x
+    min: {0, 0, 0, _}, max: {nan, nan, nan, _}
   [f32 ...X -> ...X] SWS_OP_MIN          : x <= {7 7 3 _}
+    min: {0, 0, 0, _}, max: {7, 7, 3, _}
   [f32 ...X -> +++X] SWS_OP_CONVERT      : f32 -> u8
+    min: {0, 0, 0, _}, max: {7, 7, 3, _}
   [ u8 ...X -> +XXX] SWS_OP_PACK         : {3 3 2 0}
-    min: {0, _, _, _}, max: {0, _, _, _}
+    min: {0, _, _, _}, max: {255, _, _, _}
   [ u8 .XXX -> +XXX] SWS_OP_WRITE        : 1 elem(s) packed >> 0
-    min: {0, _, _, _}, max: {0, _, _, _}
+    min: {0, _, _, _}, max: {255, _, _, _}
     (X = unused, z = byteswapped, + = exact, 0 = zero)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
2026-02-24 20:25:59 +01:00
Ramiro Polla
9fbb03f428 swscale/tests/sws_ops: don't print unused components in the output
Clean up the output by not printing the flags and range values of
unused components in ff_sws_op_list_print().

 rgb24 -> gray16le:
   [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) packed >> 0
-    min: {0, 0, 0, nan}, max: {255, 255, 255, nan}
+    min: {0, 0, 0, _}, max: {255, 255, 255, _}
   [ u8 ...X -> +++X] SWS_OP_CONVERT      : u8 -> f32
-    min: {0, 0, 0, nan}, max: {255, 255, 255, nan}
-  [f32 ...X -> .++X] SWS_OP_LINEAR       : dot3 [[76.843000 150.859000 29.298000 0 0] [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 0]]
-    min: {0, 0, 0, nan}, max: {65535, 255, 255, nan}
-  [f32 .XXX -> +++X] SWS_OP_CONVERT      : f32 -> u16
-    min: {0, 0, 0, nan}, max: {65535, 255, 255, nan}
-  [u16 .XXX -> +++X] SWS_OP_WRITE        : 1 elem(s) planar >> 0
-    min: {0, 0, 0, nan}, max: {65535, 255, 255, nan}
+    min: {0, 0, 0, _}, max: {255, 255, 255, _}
+  [f32 ...X -> .XXX] SWS_OP_LINEAR       : dot3 [[76.843000 150.859000 29.298000 0 0] [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 0]]
+    min: {0, _, _, _}, max: {65535, _, _, _}
+  [f32 .XXX -> +XXX] SWS_OP_CONVERT      : f32 -> u16
+    min: {0, _, _, _}, max: {65535, _, _, _}
+  [u16 .XXX -> +XXX] SWS_OP_WRITE        : 1 elem(s) planar >> 0
+    min: {0, _, _, _}, max: {65535, _, _, _}
     (X = unused, z = byteswapped, + = exact, 0 = zero)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
2026-02-24 20:22:12 +01:00
Ramiro Polla
c7c8c31302 swscale/tests/sws_ops: print range values in the output
This gives more information about each operation and helps catch issues
earlier on.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
2026-02-24 19:27:51 +01:00
Niklas Haas
ea791a4ef1 swscale/tests/swscale: parse flags from string
We don't actually have an SwsContext yet at this point, so just use
AV_OPT_SEARCH_FAKE_OBJ. For the actual evaluation, the signature only
requires that we pass a "pointer to a struct that contains an AVClass as
its first member", so passing a double pointer to the class itself is
sufficient.
2026-02-23 19:23:09 +01:00
Ramiro Polla
0accfde281 avcodec/jpeglsdec: fix decoding of jpegls files with restart markers 2026-02-20 16:32:10 +01:00
Ramiro Polla
80edf78e58 tests/fate/image: add jpegls tests with restart markers
The samples have been generated with:
jpeg -c -ls 0 -z 1 great_wave_128.ppm jpegls/ilv0_rst.jls
jpeg -c -ls 1 -z 1 great_wave_128.ppm jpegls/ilv1_rst.jls

Note: ilv2 is still unsupported
2026-02-20 16:32:10 +01:00
Niklas Haas
46d721a69a swscale/optimizer: compress planar reads with unused planes
After plane splitting, we can end up with a situation where a subpass wants
to read only, say, the alpha plane. In this case, we should compress the
planar read by instead swizzling the alpha plane into the correct place
in the src plane order, and then reading only a single plane.

Results in a bunch of benign diffs like:

 yuva444p -> ya8:
-  [ u8 XXXX -> ++++] SWS_OP_READ         : 4 elem(s) planar >> 0
-  [ u8 .XX. -> ++++] SWS_OP_CONVERT      : u8 -> f32
-  [f32 .XX. -> .+++] SWS_OP_LINEAR       : luma [...]
-  [f32 .XX. -> .+++] SWS_OP_DITHER       : 16x16 matrix + {0 3 2 5}
-  [f32 .XX. -> .+++] SWS_OP_MAX          : {0 0 0 0} <= x
-  [f32 .XX. -> .+++] SWS_OP_MIN          : x <= {255 _ _ 255}
-  [f32 .XX. -> ++++] SWS_OP_CONVERT      : f32 -> u8
-  [ u8 .XX. -> ++++] SWS_OP_SWIZZLE      : 0312
-  [ u8 ..XX -> ++++] SWS_OP_WRITE        : 2 elem(s) packed >> 0
+  [ u8 XXXX -> ++XX] SWS_OP_READ         : 2 elem(s) planar >> 0, via {0, 3}
+  [ u8 ..XX -> ++XX] SWS_OP_CONVERT      : u8 -> f32
+  [f32 ..XX -> +XX+] SWS_OP_SWIZZLE      : 0321
+  [f32 .XX. -> .XX+] SWS_OP_LINEAR       : luma [...]
+  [f32 .XX. -> .XX+] SWS_OP_DITHER       : 16x16 matrix + {0 3 2 5}
+  [f32 .XX. -> .XX+] SWS_OP_MAX          : {0 0 0 0} <= x
+  [f32 .XX. -> .XX+] SWS_OP_MIN          : x <= {255 _ _ 255}
+  [f32 .XX. -> +XX+] SWS_OP_CONVERT      : f32 -> u8
+  [ u8 .XX. -> ++XX] SWS_OP_SWIZZLE      : 0312
+  [ u8 ..XX -> ++XX] SWS_OP_WRITE        : 2 elem(s) packed >> 0

This may seem noisy, but really is mostly a result of the fact that the unused
middle components are now marked as garbage instead of as valid data.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-02-19 19:44:46 +00:00
Niklas Haas
b01236d5fb swscale/optimizer: try pushing all swizzles towards the output
Now that we can directly promote these to plane swizzles, we generally want
to try pushing them in one direction - ideally towards the output, as in the
case of split subpasses, the output is guaranteed to be planar. (And there
may not even be a read)

Results in a lot of diffs, ranging from the benign, e.g.:

 rgb24 -> bgr48be:
   [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) packed >> 0
   [ u8 ...X -> +++X] SWS_OP_CONVERT      : u8 -> u16 (expand)
-  [u16 ...X -> +++X] SWS_OP_SWIZZLE      : 2103
   [u16 ...X -> zzzX] SWS_OP_SWAP_BYTES
+  [u16 ...X -> zzzX] SWS_OP_SWIZZLE      : 2103
   [u16 ...X -> zzzX] SWS_OP_WRITE        : 3 elem(s) packed >> 0

 rgb24 -> gbrp9be:
   [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) packed >> 0
   [ u8 ...X -> +++X] SWS_OP_CONVERT      : u8 -> f32
   [f32 ...X -> ...X] SWS_OP_SCALE        : * 511/255
   [f32 ...X -> ...X] SWS_OP_DITHER       : 16x16 matrix + {0 3 2 5}
   [f32 ...X -> ...X] SWS_OP_MIN          : x <= {511 511 511 _}
   [f32 ...X -> +++X] SWS_OP_CONVERT      : f32 -> u16
-  [u16 ...X -> +++X] SWS_OP_SWIZZLE      : 1203
   [u16 ...X -> zzzX] SWS_OP_SWAP_BYTES
-  [u16 ...X -> zzzX] SWS_OP_WRITE        : 3 elem(s) planar >> 0
+  [u16 ...X -> zzzX] SWS_OP_WRITE        : 3 elem(s) planar >> 0, via {2, 0, 1}

To the clear improvements, e.g.:

 bgr24 -> gbrp16be:
   [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) packed >> 0
-  [ u8 ...X -> +++X] SWS_OP_SWIZZLE      : 2103
   [ u8 ...X -> +++X] SWS_OP_CONVERT      : u8 -> u16 (expand)
-  [u16 ...X -> +++X] SWS_OP_SWIZZLE      : 1203
   [u16 ...X -> zzzX] SWS_OP_SWAP_BYTES
-  [u16 ...X -> zzzX] SWS_OP_WRITE        : 3 elem(s) planar >> 0
+  [u16 ...X -> zzzX] SWS_OP_WRITE        : 3 elem(s) planar >> 0, via {1, 0, 2}

The only case worth careful consideration is when there are swizzled inputs
that result in unusual plane patterns, e.g.:

 argb -> gbrp9be:
   [ u8 XXXX -> ++++] SWS_OP_READ         : 4 elem(s) packed >> 0
-  [ u8 X... -> ++++] SWS_OP_SWIZZLE      : 1230
-  [ u8 ...X -> ++++] SWS_OP_CONVERT      : u8 -> f32
-  [f32 ...X -> ....] SWS_OP_SCALE        : * 511/255
-  [f32 ...X -> ....] SWS_OP_DITHER       : 16x16 matrix + {0 3 2 5}
-  [f32 ...X -> ....] SWS_OP_MIN          : x <= {511 511 511 _}
-  [f32 ...X -> ++++] SWS_OP_CONVERT      : f32 -> u16
-  [u16 ...X -> ++++] SWS_OP_SWIZZLE      : 1203
-  [u16 ...X -> zzzz] SWS_OP_SWAP_BYTES
-  [u16 ...X -> zzzz] SWS_OP_WRITE        : 3 elem(s) planar >> 0
+  [ u8 X... -> ++++] SWS_OP_CONVERT      : u8 -> f32
+  [f32 X... -> ....] SWS_OP_SCALE        : * 511/255
+  [f32 X... -> ....] SWS_OP_DITHER       : 16x16 matrix + {0 0 3 2}
+  [f32 X... -> ....] SWS_OP_MIN          : x <= {511 511 511 511}
+  [f32 X... -> ++++] SWS_OP_CONVERT      : f32 -> u16
+  [u16 X... -> zzzz] SWS_OP_SWAP_BYTES
+  [u16 X... -> zzzz] SWS_OP_SWIZZLE      : 3120
+  [u16 ...X -> zzzz] SWS_OP_WRITE        : 3 elem(s) planar >> 0, via {1, 2, 0}
     (X = unused, z = byteswapped, + = exact, 0 = zero)

Observe the change from ...X to X..., which is a pattern that doesn't
necessarily have a fast path and would usually end up falling back to the
generic 4-component implementations (rather than the 3-component ones).

That said, this is not a big deal, since we can ultimately re-align the
set of implementations with what's actually needed; once we're done with
plane splitting and so forth.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-02-19 19:44:46 +00:00
Niklas Haas
aaa898a2d1 swscale/optimizer: promote component swizzles to plane swizzles
In some cases, we can just directly swizzle the order of input/output
planes, rather than applying a swizzle operation on the data itself.

This can eliminate some such swizzle operations entirely, for example
yuv444p -> vuya is now just a read, clear and write.

Results in a lot of simplifications like this:

 rgb24 -> gbrp:
   [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) packed >> 0
-  [ u8 ...X -> +++X] SWS_OP_SWIZZLE      : 1203
-  [ u8 ...X -> +++X] SWS_OP_WRITE        : 3 elem(s) planar >> 0
+  [ u8 ...X -> +++X] SWS_OP_WRITE        : 3 elem(s) planar >> 0, via {2, 0, 1}

 rgb24 -> gbrap16le:
   [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) packed >> 0
   [ u8 ...X -> +++X] SWS_OP_CONVERT      : u8 -> u16 (expand)
-  [u16 ...X -> +++X] SWS_OP_SWIZZLE      : 1203
   [u16 ...X -> ++++] SWS_OP_CLEAR        : {_ _ _ 65535}
-  [u16 .... -> ++++] SWS_OP_WRITE        : 4 elem(s) planar >> 0
+  [u16 .... -> ++++] SWS_OP_WRITE        : 4 elem(s) planar >> 0, via {2, 0, 1, 3}

 yuv444p -> vuya:
-  [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) planar >> 0
-  [ u8 ...X -> +++X] SWS_OP_SWIZZLE      : 2103
+  [ u8 XXXX -> +++X] SWS_OP_READ         : 3 elem(s) planar >> 0, via {2, 1, 0}
   [ u8 ...X -> ++++] SWS_OP_CLEAR        : {_ _ _ 255}
   [ u8 .... -> ++++] SWS_OP_WRITE        : 4 elem(s) packed >> 0

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-02-19 19:44:46 +00:00
Niklas Haas
4b8790f107 swscale/optimizer: allow commuting CLEAR past SWAP_BYTES
This requires a bit of a manual check in the 32-bit integer case to
make sure we don't exceed the value range of AVRational; but it still allows
quite a number of optimizations despite that restriction.

e.g.

rgb24 -> yuva444p9be:
-  [u16 ...X -> ++++] SWS_OP_CLEAR        : {_ _ _ 511}
-  [u16 .... -> zzzz] SWS_OP_SWAP_BYTES
-  [u16 .... -> zzzz] SWS_OP_WRITE        : 4 elem(s) planar >> 0
+  [u16 ...X -> zzzX] SWS_OP_SWAP_BYTES
+  [u16 ...X -> zzz+] SWS_OP_CLEAR        : {_ _ _ 65281}
+  [u16 .... -> zzz+] SWS_OP_WRITE        : 4 elem(s) planar >> 0

gray -> yuv444p12be:
-  [u16 .XXX -> +++X] SWS_OP_CLEAR        : {_ 2048 2048 _}
-  [u16 ...X -> zzzX] SWS_OP_SWAP_BYTES
-  [u16 ...X -> zzzX] SWS_OP_WRITE        : 3 elem(s) planar >> 0
+  [u16 .XXX -> zzXX] SWS_OP_SWAP_BYTES
+  [u16 .XXX -> z++X] SWS_OP_CLEAR        : {_ 8 8 _}
+  [u16 ...X -> z++X] SWS_OP_WRITE        : 3 elem(s) planar >> 0

Ultimately, the benefit of this will only become relevant once we start
splitting apart planes, since then we can have planes with only CLEAR
operations.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-02-19 19:44:46 +00:00
Niklas Haas
c17a9ba0b8 tests/sws_ops: explicitly skip no-op operation lists
These are not necessarily empty, as a result of the previous changes.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-02-19 19:44:46 +00:00
Andreas Rheinhardt
ae60f47a2c tests/fate/{dca,qoa,truehd}: Make fate-audio work
Based on the Makefile variables, "make fate-audio"
is supposed to include the tests for several audio
codecs with their own Makefile. Yet because they are
included after audio.mak*, this doesn't work atm.
Fix this by adding explicit prerequisites.

*: Expansion of variables is not deferred in the context
of prerequisites.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-19 14:35:04 +01:00
Andreas Rheinhardt
166b01aefd tests/fate/dca: Add ffprobe dependency to dca-lossless tests
Forgotten in e1484a30e5.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-19 14:34:45 +01:00
Romain Beauxis
0e89d993c5 libavformat/oggenc.c: re-initialize stream on new metadata. 2026-02-18 16:25:06 +00:00
James Almer
e1484a30e5 avformat/dtshddec: properly support priming and padding samples
Don't just export initial_padding, but also take it into account for timestamps
by adjusting the stream's start_time. Also, export the padding samples in a way
that's actually supported, as currently trailing_padding is unused so no user
will look at it.

For the sake of not reducing coverage and because the lossy tests have reference
files that contain the priming samples, add the skip_manual flags2 to the tests
so we still output them. A new ffprobe call will ensure the demuxer behavior is
tested too.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-12 09:59:54 -03:00
James Almer
70f0ddd2ca tests/fate/dca: use stream_demux for lossless tests
Unlike md5, the adler32 hash shows the frames with priming samples, which will
be useful in the following commits.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-12 09:59:54 -03:00
John Chadwick
8b9b71494b tests/fate/image: Add psd-rgbxx
This is an rgb test image with two auxilliary channels and no alpha
channels.
2026-02-11 20:35:20 +00:00
Andreas Rheinhardt
3a7c09eb39 avcodec/x86/mpegvideoencdsp_init: Port draw_edges to SSSE3
Benchmarks:
draw_edges_8_1724_4_c:                                2672.2 ( 1.00x)
draw_edges_8_1724_4_mmx:                              3191.5 ( 0.84x)
draw_edges_8_1724_4_ssse3:                            2179.6 ( 1.23x)
draw_edges_8_1724_8_c:                                2852.3 ( 1.00x)
draw_edges_8_1724_8_mmx:                              3683.0 ( 0.77x)
draw_edges_8_1724_8_ssse3:                            2225.7 ( 1.28x)
draw_edges_8_1724_16_c:                               4169.4 ( 1.00x)
draw_edges_8_1724_16_mmx:                             4665.9 ( 0.89x)
draw_edges_8_1724_16_ssse3:                           2765.8 ( 1.51x)
draw_edges_128_407_4_c:                               1126.6 ( 1.00x)
draw_edges_128_407_4_mmx:                              943.9 ( 1.19x)
draw_edges_128_407_4_ssse3:                            925.7 ( 1.22x)
draw_edges_128_407_8_c:                               1208.8 ( 1.00x)
draw_edges_128_407_8_mmx:                             1119.1 ( 1.08x)
draw_edges_128_407_8_ssse3:                            997.8 ( 1.21x)
draw_edges_128_407_16_c:                              1352.4 ( 1.00x)
draw_edges_128_407_16_mmx:                            1368.7 ( 0.99x)
draw_edges_128_407_16_ssse3:                          1148.3 ( 1.18x)
draw_edges_1080_31_4_c:                                228.5 ( 1.00x)
draw_edges_1080_31_4_mmx:                              240.8 ( 0.95x)
draw_edges_1080_31_4_ssse3:                            226.7 ( 1.01x)
draw_edges_1080_31_8_c:                                411.1 ( 1.00x)
draw_edges_1080_31_8_mmx:                              432.9 ( 0.95x)
draw_edges_1080_31_8_ssse3:                            403.2 ( 1.02x)
draw_edges_1080_31_16_c:                              1121.2 ( 1.00x)
draw_edges_1080_31_16_mmx:                            1124.9 ( 1.00x)
draw_edges_1080_31_16_ssse3:                          1125.4 ( 1.00x)
draw_edges_1920_4_4_c:                                 310.8 ( 1.00x)
draw_edges_1920_4_4_mmx:                               311.6 ( 1.00x)
draw_edges_1920_4_4_ssse3:                             311.6 ( 1.00x)
draw_edges_1920_4_4_negstride_c:                       307.0 ( 1.00x)
draw_edges_1920_4_4_negstride_mmx:                     306.7 ( 1.00x)
draw_edges_1920_4_4_negstride_ssse3:                   306.7 ( 1.00x)
draw_edges_1920_4_8_c:                                 724.2 ( 1.00x)
draw_edges_1920_4_8_mmx:                               724.9 ( 1.00x)
draw_edges_1920_4_8_ssse3:                             717.3 ( 1.01x)
draw_edges_1920_4_8_negstride_c:                       719.2 ( 1.00x)
draw_edges_1920_4_8_negstride_mmx:                     717.1 ( 1.00x)
draw_edges_1920_4_8_negstride_ssse3:                   710.9 ( 1.01x)
draw_edges_1920_4_16_c:                               1752.9 ( 1.00x)
draw_edges_1920_4_16_mmx:                             1754.6 ( 1.00x)
draw_edges_1920_4_16_ssse3:                           1751.1 ( 1.00x)
draw_edges_1920_4_16_negstride_c:                     1783.2 ( 1.00x)
draw_edges_1920_4_16_negstride_mmx:                   1778.2 ( 1.00x)
draw_edges_1920_4_16_negstride_ssse3:                 1768.3 ( 1.01x)

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-11 11:15:06 +01:00
James Almer
2e79453549 tests/fate/id3v2: don't use a reference file for fate-id3v2-invalid-tags
This fixes running the test under Valgrind, where more, unrelated lines are
printed, making the comparison fail.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-09 14:04:22 +00:00
James Almer
3ab8b976c1 avformat/matroskaenc: parse Opus packets to write proper durations
Before this patch, the last packet in the affected fate test would be written
without a BlockDuration element despite the packet's duration being shorter
than the Opus frame size.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-05 23:21:49 -03:00
James Almer
11e9a325ec tests/fate/matroska: remove copyts from audio tests
It's not needed after the previous commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-05 23:21:49 -03:00
James Almer
0880458e4c avformat/matroskadec: take into account priming samples in audio tracks
Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-05 23:21:49 -03:00
James Almer
1dd8547193 avformat/demux: don't overwrite already set packet durations with parser ones
Following up on b613eebe78, if a demuxer that exports complete frames sets a
duration, don't overwrite it from the output of the parser.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-05 23:21:49 -03:00
Andreas Rheinhardt
462fac0e0f tests/checkasm/vc1dsp: Use correct function argument
Fixes a stack-buffer overflow (detected by ASAN) when benching
vc1dsp.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-04 13:28:49 +01:00
Zhao Zhili
a0d4c07b86 tests/checkasm: add test for png
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-02-04 12:05:35 +08:00