Commit Graph

125905 Commits

Author SHA1 Message Date
Andreas Rheinhardt
c8fb970a92 avcodec/x86/huffyuvdsp: Remove ff_add_hfyu_median_prediction_mmxext
Superseded by SSE4. This makes the huffyuv decoders ABI compliant,
e.g. nothing messes up the FPU state at all any more. Therefore
the emms_c() can be removed from huffyuvdec.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:19:04 +02:00
Andreas Rheinhardt
0127016c41 avcodec/x86/huffyuvdsp: Add SSE4 add_hfyu_median_pred_int16
Heavily based upon the existing mmxext function, but
it allows to use p{max,min}uw, so also supports 16bpp
pixel formats. It is also faster:

  add_hfyu_median_pred_int16_c:       14368.1
  add_hfyu_median_pred_int16_mmxext:   7384.2 ( 1.94x)
  add_hfyu_median_pred_int16_sse4:     6474.4 ( 2.21x)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:12:51 +02:00
Andreas Rheinhardt
eb40b0b6b7 tests/checkasm/huffyuvdsp: Add test for add_hfyu_median_pred_int16
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
Andreas Rheinhardt
d8cb1ef0e5 avcodec/x86/huffyuvdsp: Remove remnants of MMX
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
Andreas Rheinhardt
0d342f01f0 avcodec/x86/huffyuvdsp_template: Don't push+pop reg unnecessarily
All calling conventions on x64 have enough volatile GPRs.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
Andreas Rheinhardt
3928c291b7 avcodec/x86/huffyuvdsp: Remove unaligned add_int16 version
Both source and dst are always properly aligned (to stride align)
here; also document this fact.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
Andreas Rheinhardt
b1142ed5be tests/checkasm/huffyuvdsp: Actually test width not multiple of 16
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
Andreas Rheinhardt
dd8730cfe3 tests/checkasm/huffyuvdsp: Actually test masks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
Andreas Rheinhardt
7c9d1fd3c0 tests/checkasm/huffyuvdsp: Return early if there is no function to test
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-02 02:00:49 +02:00
James Almer
d9da090b1d avformat/dashdec: don't stop at the first input EOF
The current logic would stop demuxing the entire manifest once the first Representation
returned EOF, which could result in plenty of packets from other Representations being
lost.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-08-01 19:47:08 -03:00
James Almer
d2476bfd2b avformat/iamf_parse: bound the output mix gain duration by the audio elements
Based on a patch by Michael Niedermayer

Fixes: unbounded allocation
Fixes: poc_output_mix_config_dos.iamf
Fixes: 387qWpjUgeKH
Found-by: Duong Tran Thai (CyStack)
Signed-off-by: James Almer <jamrial@gmail.com>
2026-08-01 19:44:49 -03:00
James Almer
1b946a3abd avformat/iamf_parse: check that num_sub_mixes and num_audio_elements in Mix Presentations are not zero
As required by the spec in Section 3.7

Signed-off-by: James Almer <jamrial@gmail.com>
2026-08-01 19:44:49 -03:00
Andreas Rheinhardt
406c5a37aa avcodec/x86/vc1dsp_inv_trans: Port to SSE2
No change in performance here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Andreas Rheinhardt
3db7a55280 avcodec/x86/vc1dsp_loopfilter: Don't use MMX regs
Up until now ff_vc1_v_loop_filter4_ssse3 used MMX registers
despite being an SSSE3 function. Porting it to XMM registers
didn't lead to any change in benchmarks here, but abides
by the ABI (one function less that does not omit emms).
Unfortunately the size of the function increased by 64B
by this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Andreas Rheinhardt
3ea01992d6 avcodec/x86/vc1dsp_loopfilter: Don't use MMX regs in horiz. loop filter
Using XMM registers in this SSSE3 function leads to fewer shuffles
when transposing the input; it also allows to combine calculating
a1 and a2. Because of this, codesize is the same as before (on Unix64)
although MMX instructions are shorter.

Old benchmarks:
  vc1dsp.vc1_h_loop_filter4_bestcase_c:           3.0
  vc1dsp.vc1_h_loop_filter4_bestcase_ssse3:      32.0 ( 0.09x)
  vc1dsp.vc1_h_loop_filter4_worstcase_c:         42.9
  vc1dsp.vc1_h_loop_filter4_worstcase_ssse3:     31.9 ( 1.35x)

New benchmarks:
  vc1dsp.vc1_h_loop_filter4_bestcase_c:           3.0
  vc1dsp.vc1_h_loop_filter4_bestcase_ssse3:      29.9 ( 0.10x)
  vc1dsp.vc1_h_loop_filter4_worstcase_c:         43.7
  vc1dsp.vc1_h_loop_filter4_worstcase_ssse3:     29.9 ( 1.46x)

Hint: checkasm's benchmark always uses the same buffer that is
partially updated by the horizontal loop filter function (the
middle two of eight columns are updated using word-sized stores).
They therefore lead to store-to-load-forwarding failure. If
checkasm_alternate were used to alternate between two buffers,
the benchmarks would be as follows:

Old benchmarks:
  vc1dsp.vc1_h_loop_filter4_bestcase_c:           3.0
  vc1dsp.vc1_h_loop_filter4_bestcase_ssse3:      16.4 ( 0.18x)
  vc1dsp.vc1_h_loop_filter4_worstcase_c:         23.9
  vc1dsp.vc1_h_loop_filter4_worstcase_ssse3:     16.3 ( 1.47x)

New benchmarks:
  vc1dsp.vc1_h_loop_filter4_bestcase_c:           3.0
  vc1dsp.vc1_h_loop_filter4_bestcase_ssse3:      15.1 ( 0.20x)
  vc1dsp.vc1_h_loop_filter4_worstcase_c:         23.6
  vc1dsp.vc1_h_loop_filter4_worstcase_ssse3:     15.2 ( 1.55x)

Notice that at some callsites, the partially modified buffer
is immediately reloaded again*, so that both scenarios can happen.

*: See the TT_4X4 and TT_4X8 cases at the end of vc1_p_h_loop_filter()
or vc1_b_h_intfi_loop_filter() or the luma field blocks in
vc1_p_h_intfr_loop_filter().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Andreas Rheinhardt
8f05c446a1 avcodec/x86/vc1dsp_loopfilter: Use psignw when available
The VC1 loop filter uses something equivalent to
if (a0_sign ^ clip_sign) {
    if (clip_sign) d = -d;
} else d = 0;
which can be mapped to psignw.

Old benchmarks:
  vc1dsp.vc1_h_loop_filter4_bestcase_c:            3.0
  vc1dsp.vc1_h_loop_filter4_bestcase_ssse3:       32.4 ( 0.09x)
  vc1dsp.vc1_h_loop_filter4_worstcase_c:          42.3
  vc1dsp.vc1_h_loop_filter4_worstcase_ssse3:      32.7 ( 1.29x)
  vc1dsp.vc1_h_loop_filter8_bestcase_c:            6.1
  vc1dsp.vc1_h_loop_filter8_bestcase_sse2:        37.1 ( 0.17x)
  vc1dsp.vc1_h_loop_filter8_bestcase_ssse3:       36.4 ( 0.17x)
  vc1dsp.vc1_h_loop_filter8_bestcase_sse4:        36.6 ( 0.17x)
  vc1dsp.vc1_h_loop_filter8_worstcase_c:          87.2
  vc1dsp.vc1_h_loop_filter8_worstcase_sse2:       36.9 ( 2.36x)
  vc1dsp.vc1_h_loop_filter8_worstcase_ssse3:      35.8 ( 2.35x)
  vc1dsp.vc1_h_loop_filter8_worstcase_sse4:       36.7 ( 2.38x)
  vc1dsp.vc1_h_loop_filter16_bestcase_c:          12.0
  vc1dsp.vc1_h_loop_filter16_bestcase_sse2:       40.0 ( 0.30x)
  vc1dsp.vc1_h_loop_filter16_bestcase_ssse3:      39.8 ( 0.30x)
  vc1dsp.vc1_h_loop_filter16_bestcase_sse4:       44.4 ( 0.27x)
  vc1dsp.vc1_h_loop_filter16_worstcase_c:        166.4
  vc1dsp.vc1_h_loop_filter16_worstcase_sse2:      39.9 ( 4.17x)
  vc1dsp.vc1_h_loop_filter16_worstcase_ssse3:     39.7 ( 4.19x)
  vc1dsp.vc1_h_loop_filter16_worstcase_sse4:      43.8 ( 3.80x)
  vc1dsp.vc1_v_loop_filter4_bestcase_c:            3.6
  vc1dsp.vc1_v_loop_filter4_bestcase_ssse3:       16.3 ( 0.22x)
  vc1dsp.vc1_v_loop_filter4_worstcase_c:          49.3
  vc1dsp.vc1_v_loop_filter4_worstcase_ssse3:      16.2 ( 3.04x)
  vc1dsp.vc1_v_loop_filter8_bestcase_c:            6.4
  vc1dsp.vc1_v_loop_filter8_bestcase_sse2:        16.3 ( 0.39x)
  vc1dsp.vc1_v_loop_filter8_bestcase_ssse3:       15.8 ( 0.40x)
  vc1dsp.vc1_v_loop_filter8_worstcase_c:          85.7
  vc1dsp.vc1_v_loop_filter8_worstcase_sse2:       16.3 ( 5.24x)
  vc1dsp.vc1_v_loop_filter8_worstcase_ssse3:      15.8 ( 5.42x)
  vc1dsp.vc1_v_loop_filter16_bestcase_c:          12.7
  vc1dsp.vc1_v_loop_filter16_bestcase_sse2:       24.7 ( 0.52x)
  vc1dsp.vc1_v_loop_filter16_bestcase_ssse3:      22.7 ( 0.56x)
  vc1dsp.vc1_v_loop_filter16_worstcase_c:        169.4
  vc1dsp.vc1_v_loop_filter16_worstcase_sse2:      24.1 ( 7.03x)
  vc1dsp.vc1_v_loop_filter16_worstcase_ssse3:     24.6 ( 6.88x)

New benchmarks:
  vc1dsp.vc1_h_loop_filter4_bestcase_c:            3.0
  vc1dsp.vc1_h_loop_filter4_bestcase_ssse3:       32.0 ( 0.09x)
  vc1dsp.vc1_h_loop_filter4_worstcase_c:          43.2
  vc1dsp.vc1_h_loop_filter4_worstcase_ssse3:      31.8 ( 1.36x)
  vc1dsp.vc1_h_loop_filter8_bestcase_c:            6.0
  vc1dsp.vc1_h_loop_filter8_bestcase_sse2:        36.9 ( 0.16x)
  vc1dsp.vc1_h_loop_filter8_bestcase_ssse3:       35.5 ( 0.17x)
  vc1dsp.vc1_h_loop_filter8_bestcase_sse4:        36.2 ( 0.17x)
  vc1dsp.vc1_h_loop_filter8_worstcase_c:          87.3
  vc1dsp.vc1_h_loop_filter8_worstcase_sse2:       37.6 ( 2.33x)
  vc1dsp.vc1_h_loop_filter8_worstcase_ssse3:      35.3 ( 2.40x)
  vc1dsp.vc1_h_loop_filter8_worstcase_sse4:       36.1 ( 2.42x)
  vc1dsp.vc1_h_loop_filter16_bestcase_c:          11.8
  vc1dsp.vc1_h_loop_filter16_bestcase_sse2:       40.1 ( 0.29x)
  vc1dsp.vc1_h_loop_filter16_bestcase_ssse3:      39.2 ( 0.30x)
  vc1dsp.vc1_h_loop_filter16_bestcase_sse4:       42.9 ( 0.28x)
  vc1dsp.vc1_h_loop_filter16_worstcase_c:        166.5
  vc1dsp.vc1_h_loop_filter16_worstcase_sse2:      39.8 ( 4.18x)
  vc1dsp.vc1_h_loop_filter16_worstcase_ssse3:     39.1 ( 4.26x)
  vc1dsp.vc1_h_loop_filter16_worstcase_sse4:      42.9 ( 3.88x)
  vc1dsp.vc1_v_loop_filter4_bestcase_c:            3.6
  vc1dsp.vc1_v_loop_filter4_bestcase_ssse3:       15.7 ( 0.22x)
  vc1dsp.vc1_v_loop_filter4_worstcase_c:          49.1
  vc1dsp.vc1_v_loop_filter4_worstcase_ssse3:      15.8 ( 3.10x)
  vc1dsp.vc1_v_loop_filter8_bestcase_c:            6.4
  vc1dsp.vc1_v_loop_filter8_bestcase_sse2:        16.3 ( 0.39x)
  vc1dsp.vc1_v_loop_filter8_bestcase_ssse3:       15.3 ( 0.42x)
  vc1dsp.vc1_v_loop_filter8_worstcase_c:          85.7
  vc1dsp.vc1_v_loop_filter8_worstcase_sse2:       16.3 ( 5.26x)
  vc1dsp.vc1_v_loop_filter8_worstcase_ssse3:      15.2 ( 5.62x)
  vc1dsp.vc1_v_loop_filter16_bestcase_c:          13.6
  vc1dsp.vc1_v_loop_filter16_bestcase_sse2:       24.8 ( 0.55x)
  vc1dsp.vc1_v_loop_filter16_bestcase_ssse3:      21.3 ( 0.64x)
  vc1dsp.vc1_v_loop_filter16_worstcase_c:        170.0
  vc1dsp.vc1_v_loop_filter16_worstcase_sse2:      23.9 ( 7.11x)
  vc1dsp.vc1_v_loop_filter16_worstcase_ssse3:     23.3 ( 7.28x)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Andreas Rheinhardt
55bdc109a1 avcodec/x86/vc1dsp_loopfilter: Avoid unnecessary PABSW
The loop filter is only active if min(a1,a2)<abs(a0)
which is done via masking. Ergo the sign of min(a1,a2)-abs(a0)
is known (always negative) and one does not need to use
PABSW to get its absolute value.

This gives a small speedup. Old benchmarks:
  vc1dsp.vc1_h_loop_filter4_bestcase_c:            3.1
  vc1dsp.vc1_h_loop_filter4_bestcase_ssse3:       33.6 ( 0.09x)
  vc1dsp.vc1_h_loop_filter4_worstcase_c:          43.0
  vc1dsp.vc1_h_loop_filter4_worstcase_ssse3:      33.4 ( 1.29x)
  vc1dsp.vc1_h_loop_filter8_bestcase_c:            6.0
  vc1dsp.vc1_h_loop_filter8_bestcase_sse2:        38.4 ( 0.16x)
  vc1dsp.vc1_h_loop_filter8_bestcase_ssse3:       37.2 ( 0.16x)
  vc1dsp.vc1_h_loop_filter8_bestcase_sse4:        37.6 ( 0.16x)
  vc1dsp.vc1_h_loop_filter8_worstcase_c:          87.5
  vc1dsp.vc1_h_loop_filter8_worstcase_sse2:       38.4 ( 2.28x)
  vc1dsp.vc1_h_loop_filter8_worstcase_ssse3:      37.6 ( 2.32x)
  vc1dsp.vc1_h_loop_filter8_worstcase_sse4:       37.6 ( 2.32x)
  vc1dsp.vc1_h_loop_filter16_bestcase_c:          11.7
  vc1dsp.vc1_h_loop_filter16_bestcase_sse2:       42.0 ( 0.28x)
  vc1dsp.vc1_h_loop_filter16_bestcase_ssse3:      41.4 ( 0.28x)
  vc1dsp.vc1_h_loop_filter16_bestcase_sse4:       44.8 ( 0.26x)
  vc1dsp.vc1_h_loop_filter16_worstcase_c:        167.2
  vc1dsp.vc1_h_loop_filter16_worstcase_sse2:      41.8 ( 4.00x)
  vc1dsp.vc1_h_loop_filter16_worstcase_ssse3:     41.7 ( 3.92x)
  vc1dsp.vc1_h_loop_filter16_worstcase_sse4:      45.3 ( 3.69x)
  vc1dsp.vc1_v_loop_filter4_bestcase_c:            3.6
  vc1dsp.vc1_v_loop_filter4_bestcase_ssse3:       17.1 ( 0.21x)
  vc1dsp.vc1_v_loop_filter4_worstcase_c:          49.3
  vc1dsp.vc1_v_loop_filter4_worstcase_ssse3:      17.0 ( 2.89x)
  vc1dsp.vc1_v_loop_filter8_bestcase_c:            6.3
  vc1dsp.vc1_v_loop_filter8_bestcase_sse2:        17.7 ( 0.36x)
  vc1dsp.vc1_v_loop_filter8_bestcase_ssse3:       16.8 ( 0.38x)
  vc1dsp.vc1_v_loop_filter8_worstcase_c:          85.8
  vc1dsp.vc1_v_loop_filter8_worstcase_sse2:       17.7 ( 4.83x)
  vc1dsp.vc1_v_loop_filter8_worstcase_ssse3:      16.7 ( 5.12x)
  vc1dsp.vc1_v_loop_filter16_bestcase_c:          12.7
  vc1dsp.vc1_v_loop_filter16_bestcase_sse2:       26.4 ( 0.48x)
  vc1dsp.vc1_v_loop_filter16_bestcase_ssse3:      24.0 ( 0.53x)
  vc1dsp.vc1_v_loop_filter16_worstcase_c:        170.1
  vc1dsp.vc1_v_loop_filter16_worstcase_sse2:      25.7 ( 6.63x)
  vc1dsp.vc1_v_loop_filter16_worstcase_ssse3:     25.2 ( 6.75x)

New benchmarks:
  vc1dsp.vc1_h_loop_filter4_bestcase_c:            3.0
  vc1dsp.vc1_h_loop_filter4_bestcase_ssse3:       32.4 ( 0.09x)
  vc1dsp.vc1_h_loop_filter4_worstcase_c:          42.3
  vc1dsp.vc1_h_loop_filter4_worstcase_ssse3:      32.7 ( 1.29x)
  vc1dsp.vc1_h_loop_filter8_bestcase_c:            6.1
  vc1dsp.vc1_h_loop_filter8_bestcase_sse2:        37.1 ( 0.17x)
  vc1dsp.vc1_h_loop_filter8_bestcase_ssse3:       36.4 ( 0.17x)
  vc1dsp.vc1_h_loop_filter8_bestcase_sse4:        36.6 ( 0.17x)
  vc1dsp.vc1_h_loop_filter8_worstcase_c:          87.2
  vc1dsp.vc1_h_loop_filter8_worstcase_sse2:       36.9 ( 2.36x)
  vc1dsp.vc1_h_loop_filter8_worstcase_ssse3:      35.8 ( 2.35x)
  vc1dsp.vc1_h_loop_filter8_worstcase_sse4:       36.7 ( 2.38x)
  vc1dsp.vc1_h_loop_filter16_bestcase_c:          12.0
  vc1dsp.vc1_h_loop_filter16_bestcase_sse2:       40.0 ( 0.30x)
  vc1dsp.vc1_h_loop_filter16_bestcase_ssse3:      39.8 ( 0.30x)
  vc1dsp.vc1_h_loop_filter16_bestcase_sse4:       44.4 ( 0.27x)
  vc1dsp.vc1_h_loop_filter16_worstcase_c:        166.4
  vc1dsp.vc1_h_loop_filter16_worstcase_sse2:      39.9 ( 4.17x)
  vc1dsp.vc1_h_loop_filter16_worstcase_ssse3:     39.7 ( 4.19x)
  vc1dsp.vc1_h_loop_filter16_worstcase_sse4:      43.8 ( 3.80x)
  vc1dsp.vc1_v_loop_filter4_bestcase_c:            3.6
  vc1dsp.vc1_v_loop_filter4_bestcase_ssse3:       16.3 ( 0.22x)
  vc1dsp.vc1_v_loop_filter4_worstcase_c:          49.3
  vc1dsp.vc1_v_loop_filter4_worstcase_ssse3:      16.2 ( 3.04x)
  vc1dsp.vc1_v_loop_filter8_bestcase_c:            6.4
  vc1dsp.vc1_v_loop_filter8_bestcase_sse2:        16.3 ( 0.39x)
  vc1dsp.vc1_v_loop_filter8_bestcase_ssse3:       15.8 ( 0.40x)
  vc1dsp.vc1_v_loop_filter8_worstcase_c:          85.7
  vc1dsp.vc1_v_loop_filter8_worstcase_sse2:       16.3 ( 5.24x)
  vc1dsp.vc1_v_loop_filter8_worstcase_ssse3:      15.8 ( 5.42x)
  vc1dsp.vc1_v_loop_filter16_bestcase_c:          12.7
  vc1dsp.vc1_v_loop_filter16_bestcase_sse2:       24.7 ( 0.52x)
  vc1dsp.vc1_v_loop_filter16_bestcase_ssse3:      22.7 ( 0.56x)
  vc1dsp.vc1_v_loop_filter16_worstcase_c:        169.4
  vc1dsp.vc1_v_loop_filter16_worstcase_sse2:      24.1 ( 7.03x)
  vc1dsp.vc1_v_loop_filter16_worstcase_ssse3:     24.6 ( 6.88x)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Andreas Rheinhardt
f2035a4605 avcodec/x86/vc1dsp_loopfilter: Reorder instructions slightly
In particular, apply the rounding before adding the result
of the multiplication. No change in performance here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Andreas Rheinhardt
8434869cfd avcodec/x86/vc1dsp_loopfilter: Reduce number of GPRs used
Reuse the register that held pq for this instead of using
another one. This saves a push+pop on 32bit systems and avoids
REX prefixes on Unix64.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Andreas Rheinhardt
f30ef7eec4 avcodec/x86/vc1dsp_loopfilter: Avoid imul
Multipliying a GPR by 0x01010101 splats a byte to a dword;
the intention was to avoid vector shuffles lateron, yet
this is not true because the byte splat necessitates
a byte->word conversion lateron.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Andreas Rheinhardt
933b195bcb avcodec/vc1dsp: Avoid negating unnecessarily
Due to the earlier "if (a1 < a0 || a2 < a0)" check
it is guaranteed that min(a1,a2) is < a0, allowing
simplifications.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Andreas Rheinhardt
b5483446d3 avcodec/x86/vc1dsp_init: Avoid fpel wrappers
One can just reuse the already existing SIZExSIZE fpel
wrappers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-08-01 16:50:06 +02:00
Michael Niedermayer
4f8043e658 avcodec/cbs_h266: size vps_direct_ref_layer_flag for the full layer range
Fixes: out of array access
Fixes: poc_vvc_vps.266
Fixes: 1z6RugPwxp39
Found-by: TainAn Bill
2026-08-01 14:45:45 +00:00
Michael Niedermayer
946272b79a avcodec/vulkan/ffv1_dec_setup: bound the fltmap write 2026-07-31 19:37:52 +00:00
Michael Niedermayer
c91b50659b avcodec/vulkan/ffv1_dec_setup: test mul_count as unsigned 2026-07-31 19:37:52 +00:00
Michael Niedermayer
cc82fdfbd4 avcodec/vulkan/ffv1_dec_setup: reject a remap that produces zero entries 2026-07-31 19:37:52 +00:00
Michael Niedermayer
533a3c254d avcodec/vulkan/ffv1_dec_setup: act on the slice header rejection 2026-07-31 19:37:52 +00:00
Michael Niedermayer
56743898d2 avcodec/ffv1dec: reject a remap that produces zero entries 2026-07-31 19:37:52 +00:00
Michael Niedermayer
8ab8b4fabe avcodec/ffv1dec: mark the slice damaged when its remap fails 2026-07-31 19:37:52 +00:00
Michael Niedermayer
5d4d3bdc61 avcodec/pgssubdec: always give an output rect a palette
Fixes: NULL pointer dereference
Fixes: poc_null_deref.sup
Fixes: Fobbab5Vtlr3
Found-by: VRI with 图龙锋
2026-07-31 13:34:50 +00:00
Dan Dennedy
66a8c37582 scale_d3d11: Fix hw_frame_ctx reference leak
This fixes #20995. The reference is taken twice and assigned to the same pointer (see above in the same function). Only the latter is needed.
2026-07-31 13:29:24 +00:00
younengxiao
0dd50ec535 avfilter/dnn: initialize DNNData at the config_input call sites
vf_dnn_processing.c and vf_dnn_detect.c both declare an uninitialized
DNNData model_input before using it. This commit initialize it.

Signed-off-by: younengxiao <steven.xiao@amd.com>
2026-07-31 13:21:29 +00:00
Michael Niedermayer
db05df9d13 avcodec/cfhd: reject transform-2 output wider than the plane
Fixes: out of array access
Fixes: cfhd_transform2_output_width_oob.avi
Fixes: MimvoaEVpKow
Found-by: Adrian Junge (vurlo)
2026-07-31 13:18:57 +00:00
shadowcaster3
ad53728984 avformat/mpegtsenc: add mpegts_pcr_pid option for separate PCR PID
Add a new muxer option mpegts_pcr_pid that generates PCR on a dedicated
adaptation-field-only PID, separate from any elementary stream.

ISDB-T 1seg receivers require PCR on a standalone PID. When PCR shares
the video PID, these receivers acquire the service but refuse to decode
video and audio. This is standard practice in Japanese digital
terrestrial broadcasting per ARIB TR-B14.

When mpegts_pcr_pid is set to a valid PID value:
- PCR packets are generated as adaptation-field-only packets on the
  specified PID at the interval set by pcr_period
- The video stream adaptation fields do not carry PCR flags
- The PMT PCR_PID field is set to the specified PID

When mpegts_pcr_pid is -1 (default): existing behavior is unchanged.

The existing mpegts_insert_pcr_only function is refactored into a
parameterized mpegts_insert_pcr_only_pid(s, pid, cc, discontinuity)
to avoid code duplication.

Fixes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/23649
Signed-off-by: shadowcaster3 <vasyl.samoilov@gmail.com>
2026-07-31 06:25:59 +00:00
Zuxy Meng
a83c6ad946 libavcodec/x86/h264_intrapred: Base-4 numbers for shuffling immediates
0xee -> q3232 for example for better readability

Signed-off-by: Zuxy Meng <zuxy.meng@gmail.com>
2026-07-30 22:41:04 -07:00
Zuxy Meng
43efff09ee libavcodec/x86/h264_intrapred: xmmN -> mN, movdqa -> mova
Use m aliases instead of xmm registers directly so that certain macros
can work (e.g. SWAP); likewise replace movdqa with mova

Signed-off-by: Zuxy Meng <zuxy.meng@gmail.com>
2026-07-30 22:41:04 -07:00
Abdessamie
a441a2eb38 avformat/rtsp: clear authentication on cross-origin redirects
RTSP redirects retain URL credentials and authentication state when a
Location URI changes to another origin. This can forward reusable
credentials to a server with a different scheme, host, or port.

Clear the stored credentials and authentication state when the redirect
crosses an origin boundary. Preserve them for same-origin redirects.

Fixes: cross-origin credential disclosure
Fixes: rtsp_redirect_auth_leak_poc.py
Fixes: VaKaPOnfN02z
2026-07-31 04:01:32 +00:00
Michael Niedermayer
2c18311d59 avcodec/dovi_rpuenc: normalize vdr_dm_metadata_present to 0/1 2026-07-31 04:00:56 +00:00
Kenan Alghythee
f1ed338541 avcodec/dovi_rpuenc: validate the data mapping before generation
Fixes: out of array access
Fixes: SUcVEyk7r3Gc
Found-by: Kenan Alghythee <kalghy2@uic.edu>
2026-07-31 04:00:56 +00:00
Michael Niedermayer
79e10e5196 avcodec/dovi_rpudec: bound num_x/y_partitions
Fixes: out of array access
Fixes: SUcVEyk7r3Gc
Found-by: Kenan Alghythee <kalghy2@uic.edu>
2026-07-31 04:00:56 +00:00
Kenan Alghythee
372a611913 avcodec/dovi_rpuenc: validate vdr_rpu_id from the input metadata
Fixes: out of array access
Fixes: SUcVEyk7r3Gc
Found-by: Kenan Alghythee <kalghy2@uic.edu>
2026-07-31 04:00:56 +00:00
Kenan Alghythee
534f16d866 avcodec/bsf/dovi_rpu: handle update_rpu() returning no RPU
Fixes: out of array access
Fixes: SUcVEyk7r3Gc
Found-by: Kenan Alghythee <kalghy2@uic.edu>
2026-07-31 04:00:56 +00:00
Michael Niedermayer
e38b5d15bd avfilter/af_arnndn: pad the DCT input buffers to the read length
Fixes: out of array access
Fixes: SUcVEyk7r3Gc
Found-by: Kenan Alghythee <kalghy2@uic.edu>
2026-07-31 04:00:18 +00:00
Andreas Rheinhardt
5f832b7b3f avcodec/x86/h264_intrapred: Avoid shuffles
We only need the shuffle a byte in the lower quadword;
also notice that we don't need the clamping provided
by packuswb as these values are averages of byte values.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-30 23:31:33 +02:00
Andreas Rheinhardt
27a90f6ad4 avcodec/x86/h264_intrapred: Reduce number of regs in pred4x4_tm_vp8_8
Avoids saving and restoring volatile xmm registers on Windows;
no change in benchmarks here (on Unix64).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-30 23:31:33 +02:00
Andreas Rheinhardt
c6bd6abb59 avcodec/x86/h264_intrapred: Report accurate number of registers used
The pred{8x8,16x16}_plane functions only use five xmm register.
The inflated number of seven (which leads to saving and restoring
xmm6 on Win64) has been introduced in
d20f133ef9, probably because
the mmx version of these functions used seven mmx register.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-30 23:31:33 +02:00
James Almer
86940d45af avcodec/bsf/truehd_core: clear profile value on init()
The output stream no longer has Atmos metadata, so the
AV_PROFILE_TRUEHD_ATMOS profile, if it was set, is no longer valid.

Fixes issue #23195.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-30 13:19:39 +00:00
James Almer
c77c0e580a avcodec/bsf/eac3_core: clear profile value on init()
The output stream no longer has Atmos metadata, so the
AV_PROFILE_EAC3_DDP_ATMOS profile, if it was set, is no longer valid.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-30 13:19:39 +00:00
wangnov
2ae2413488 avcodec/vp8, vp9: warn when native decoders ignore WebM alpha
WebM VP8/VP9 alpha is a second bitstream attached via a Matroska
BlockAdditional element (BlockAddID 1). Only the libvpx wrapper
decoders merge it into the output frame; the native vp8/vp9 decoders
have no code path for it and silently return an opaque frame.

Warn once per decoder instance instead of failing silently, pointing
at the decoder that does support it. The av_log_once() state is
synchronized across frame-thread contexts to avoid duplicate warnings
with frame threading.

Reported in https://trac.ffmpeg.org/ticket/11165 and
https://github.com/renpy/renpy/issues/1402.

Signed-off-by: wangnov <wangnov6@gmail.com>
2026-07-30 06:51:57 +00:00
Michael Niedermayer
05be98e3a2 doc/nut.texi: point at the latest spec in the git repository
subversion in 2026 is a bit odd
2026-07-30 04:47:51 +00:00