Commit graph

53015 commits

Author SHA1 Message Date
Lynne
2c7732a676 Revert "hwcontext_vulkan: fix 3-plane 444 10 and 12-bit formats using the new MSB formats"
This reverts commit 41ecb203c5.
2025-11-06 21:44:13 +01:00
Lynne
38df9ba71b Revert "hwcontext_vulkan: fix planar 10 and 12-bit RGB formats using the new MSB formats"
This reverts commit 98ee3f6718.
2025-11-06 21:44:13 +01:00
Lynne
15e82dc452 Revert "hwcontext_vulkan: remove unsupported/broken pixel formats"
This reverts commit 5b388f2838.
2025-11-06 21:44:13 +01:00
Andreas Rheinhardt
79080a547a avcodec/x86/h264_chromamc: Use xmm regs in chroma_mc4 SSSE3 functions
Doubling the register size allowed to avoid two pmaddubsw.
It is also ABI compliant (the old version lacked an emms)
and the average versions no longer rely on padding (the old versions
used pavgb with a memory operand reading eight bytes,
although only four are needed).

Old benchmarks (the latter four refer to RV40):
avg_h264_chroma_mc4_8_c:                               145.7 ( 1.00x)
avg_h264_chroma_mc4_8_ssse3:                            32.3 ( 4.51x)
put_h264_chroma_mc4_8_c:                               136.1 ( 1.00x)
put_h264_chroma_mc4_8_ssse3:                            29.0 ( 4.70x)
avg_chroma_mc4_c:                                      162.1 ( 1.00x)
avg_chroma_mc4_ssse3:                                   31.1 ( 5.22x)
put_chroma_mc4_c:                                      137.5 ( 1.00x)
put_chroma_mc4_ssse3:                                   28.6 ( 4.81x)

New benchmarks:
avg_h264_chroma_mc4_8_c:                               146.7 ( 1.00x)
avg_h264_chroma_mc4_8_ssse3:                            26.5 ( 5.53x)
put_h264_chroma_mc4_8_c:                               136.8 ( 1.00x)
put_h264_chroma_mc4_8_ssse3:                            22.5 ( 6.09x)
avg_chroma_mc4_c:                                      165.5 ( 1.00x)
avg_chroma_mc4_ssse3:                                   27.2 ( 6.08x)
put_chroma_mc4_c:                                      138.1 ( 1.00x)
put_chroma_mc4_ssse3:                                   23.2 ( 5.96x)

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-06 02:16:28 +01:00
Kacper Michajłow
f478964226
avcodec/vulkan_encode_av1: fix unit_elems check
Wrong enum value was used to check unit_elems. While
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA (11) would trigger when
UNIT_MASTERING_DISPLAY (2) was set, it also would match
UNIT_CONTENT_LIGHT_LEVEL (1) which is not expected.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-11-05 19:04:01 +01:00
Kacper Michajłow
c3ff7d23f5
avcodec/dxva2: move variable declaration to for loop to avoid warning
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-11-05 19:04:01 +01:00
Lynne
873a173328 aacpsy: fix whitespace and code style
The last merged patch contained garbage.
2025-11-05 16:31:59 +00:00
Zhao Zhili
2d241202ff avcodec/bsf/dts2pts: add hevc support 2025-11-05 15:13:54 +00:00
Zhao Zhili
6c83bcadbb avcodec/hevc: add ff_hevc_compute_poc2 which don't depend on HEVCSPS directly
So it can be used in other places like bsf.
2025-11-05 15:13:54 +00:00
Zhao Zhili
5f15734d92 avcodec/bsf/dts2pts: fix return 0 on error path 2025-11-05 15:13:54 +00:00
Zhao Zhili
91b2fe71cc avcodec/bsf/dts2pts: remove always true check 2025-11-05 15:13:54 +00:00
Andreas Rheinhardt
6c1acbbffb avcodec/x86/fdct: Remove obsolete comment
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:41:32 +01:00
Andreas Rheinhardt
18e08101eb avcodec/x86/Makefile: Don't use MMX-OBJS for fdct.o
MMX has been removed in d402ec6be9.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:41:29 +01:00
Andreas Rheinhardt
8157aa1a3f avcodec/x86/me_cmp: Remove MMX sse functions
They are overridden by SSE2 and no longer needed by the no longer
existing nsse MMX functions. Saves 240B here.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:41:11 +01:00
Andreas Rheinhardt
3f596ec478 avcodec/x86/me_cmp: Port nsse{8,16} to SSSE3
Even nsse8 has to operate on eight words and therefore gains
a lot from xmm registers (and pabsw).

Old benchmarks:
nsse_0_c:                                              359.2 ( 1.00x)
nsse_0_mmx:                                            151.8 ( 2.37x)
nsse_1_c:                                              151.2 ( 1.00x)
nsse_1_mmx:                                             77.5 ( 1.95x)

New benchmarks:
nsse_0_c:                                              358.8 ( 1.00x)
nsse_0_ssse3:                                           62.2 ( 5.77x)
nsse_1_c:                                              151.2 ( 1.00x)
nsse_1_ssse3:                                           33.6 ( 4.50x)

The MMX nsse functions have been removed.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:40:39 +01:00
Andreas Rheinhardt
86062cfa03 avcodec/x86/me_cmp: Add ff_sse8_sse2()
Benchmarks:
sse_1_c:                                                51.9 ( 1.00x)
sse_1_mmx:                                              16.5 ( 3.15x)
sse_1_sse2:                                              9.7 ( 5.36x)

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:40:32 +01:00
Andreas Rheinhardt
232e72d00e avcodec/x86/me_cmp: Rename registers
This will avoid using xmm registers that are volatile for Win64
in the next commit.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:40:19 +01:00
Andreas Rheinhardt
87cfbcb74a avcodec/x86/me_cmp: Avoid unnecessary instruction
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-04 11:39:25 +01:00
Manuel Lauss
d058d5db10 avcodec/sanm: implement codec45
This is a post-processing codec: given delta-x/y coordinates and a run length,
the r/g/b components of the 4 surrounding pixels are summed up, and the resulting
15bit value is used as index into a color quantization table to derive the
resulting pixel at the center.

It is only used in 10-20 frames of the Rebel Assault 2 LxxRETRY.SAN files
to slightly blur the outline of the "opening aperture" effect.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-11-04 10:28:57 +00:00
Agent45
a06aee359b revert 458a942481151ede27478e6ac6d9d2866d438b84
revert avcodec/aacenc: add bitrate threshold for PNS
2025-11-04 09:55:51 +00:00
Agent45
e11dfb3f09 trim trailing whitespace in aacpsy.c 2025-11-04 09:55:51 +00:00
Agent45
d907f7d555 avcodec/aacpsy: fix attack detection logic and subblock indexing
Fix several indexing errors in attack detection logic and refine transient handling in the AAC psychoacoustic model.

- Change PSY_LAME_NUM_SUBBLOCKS from 3 to 2 to ensure full coverage of all 1024 MDCT samples, with each subblock containing exactly 1024 / (8 * 2) = 64 samples—matching LAME’s empirical design.
- Introduce next_attack0_zero state flag to stabilize attack[0] prediction across frames.
- Adjust attack threshold presets.

These changes improve the handling of periodic signals such as trumpet, especially under low bitrate conditions.
2025-11-04 09:55:51 +00:00
Agent45
9bded2145f avcodec/aacenc: add bitrate threshold for PNS 2025-11-04 09:55:51 +00:00
James Almer
4bdc932ec9 avcodec/pthread_frame: sync alpha_mode across worker threads and the user context
Signed-off-by: James Almer <jamrial@gmail.com>
2025-11-03 00:16:03 -03:00
James Almer
f5eb11a71d avcodec/decode: add missing syncing of side_data_pref_mask to worker threads
Signed-off-by: James Almer <jamrial@gmail.com>
2025-11-02 18:14:17 -03:00
Andreas Rheinhardt
8e90f150eb avcodec/decode: Optimize lcevc away if disabled
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 16:50:36 +01:00
Andreas Rheinhardt
63685709b9 avcodec/decode: Mark init,close functions as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 16:49:26 +01:00
Andreas Rheinhardt
2786e5a9ad avcodec/decode: Put lcevc fields into structure of their own
Makes it easier to see that width and height in DecodeContext is
actually a lcevc field.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 16:00:06 +01:00
Andreas Rheinhardt
182b9c7a4a avcodec/decode: Don't allocate LCEVC context for non-video
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 15:29:59 +01:00
Andreas Rheinhardt
abf819cff6 avcodec/pthread_frame: Call ff_decode_internal_sync() only during init
It is not necessary to do it more than once, as none of the fields
set change after init.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 15:09:43 +01:00
Andreas Rheinhardt
a2914a1ec3 avcodec/x86/hpeldsp: Don't use PAVGB macro
It was only needed for MMX and there are no MMX functions here any more.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 12:05:52 +01:00
Andreas Rheinhardt
c5e94a564c avcodec/x86/hpeldsp: Don't use saturated addition when unnecessary
The numbers here are small (sums of values unpacked from bytes).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 12:05:52 +01:00
Andreas Rheinhardt
2be1b2ea96 avcodec/x86/hpeldsp: Actually use constants in registers
Forgotten in 36f92206bb.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 12:05:52 +01:00
Andreas Rheinhardt
a677b38298 avcodec/x86/vp3dsp: Remove remnants of MMX
Forgotten in eefec06634.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 12:01:52 +01:00
Andreas Rheinhardt
d355749ca6 avcodec/x86/hevc/add_res: Avoid unnecessary modification
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 09:46:15 +01:00
Andreas Rheinhardt
f4d9fb0bd0 avcodec/x86/hevc/add_res: Reduce number of registers used
This makes these functions use only volatile registers (even on Win64).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 09:46:15 +01:00
Andreas Rheinhardt
23efbb5e2e avcodec/x86/hevc/add_res: Remove AVX add_residual functions
The AVX and SSE2 functions are identical except for the VEX encodings
used since e9abef437f and
8b8492452d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-02 09:46:15 +01:00
James Almer
7770c0bf0d avcodec/exr: don't remove Float2HalfTables tables alongside the deprecated gamma code
It's used by other parts of the module that will fail to build otherwise after
the aforementioned removal.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-11-02 00:21:18 -03:00
Andreas Rheinhardt
fa959bb135 avcodec/parsers: Silence deprecation warnings
Slipped through because Clang (in contrast to GCC) does not warn about
this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-01 18:48:17 +01:00
Andreas Rheinhardt
25968dbb05 avcodec/parser_internal: Rename PASSTHROUGH macro to avoid name conflict
wingdi.h defines its own PASSTHROUGH and it is included implicitly
by the VC-1 parser (which is mpegvideo-based and therefore includes
a lot of stuff).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-01 18:41:27 +01:00
Andreas Rheinhardt
8a322c956f avcodec/avcodec: Schedule parser API to use enum AVCodecID for codec ids
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-01 16:57:03 +01:00
Andreas Rheinhardt
7c43cc4cb7 avcodec/parser_internal: Remove prefix from parser_{init,parse,close}
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-01 16:57:03 +01:00
Andreas Rheinhardt
e0b0ca8111 avcodec/avcodec: Schedule moving private fields of AVCodecParser out of avcodec.h
AVCodecParser has several fields which are not really meant
to be accessed by users, but it has no public-private
demarkation line, so these fields are technically public
and can therefore not simply be made private like
20f9727018 did for AVCodec.*

This commit therefore deprecates these fields and
schedules them to become private. All parsers have already
been switched to FFCodecParser, which (for now) is a union
of AVCodecParser and an unnamed clone of AVCodecParser
(new fields can be added at the end of this clone).

*: This is also the reason why split has never been removed despite
not being set for several years now.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-01 16:57:02 +01:00
Andreas Rheinhardt
e9fe30ccd1 avcodec/parsers: Add macro to set list of codec ids
The current code relies on AV_CODEC_ID_NONE being zero, so that
unused codec ids are set to their proper value. This commit adds
a macro to set unset ids to AV_CODEC_ID_NONE.

(The actual rationale for this macro is to simplify
the transition to making the private fields that are
currently public in avcodec.h really private.)

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-01 16:57:02 +01:00
Andreas Rheinhardt
12f7a7724d avcodec: Remove unnecessary parser.h inclusions
It only contains declarations for some auxiliary functions for parsing
that parsers that only work with complete packets don't need.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-01 16:57:02 +01:00
James Almer
9c266084fe avcodec/vc1_parser: stop splitting ENDOFSEQ markers into separate packets
The decode API can handle outputting delayed frames without relying on the
parser splitting off the ENDOFSEQ marker.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-11-01 12:23:19 -03:00
James Almer
9ab6a94195 avcodec/vc1dec: look for ENDOFSEQ markers at the end of a packet's payload
This is in preparation for the parser no longer splitting them into their own
packets.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-11-01 12:22:49 -03:00
Andreas Rheinhardt
fc2c030fb2 avcodec/vc1dec: Deduplicate cleanup code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-01 15:47:45 +01:00
Andreas Rheinhardt
a44f7b6c4f avcodec/vc1dec: Don't initialize write-only intra_scantable
VC-1 does not use it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-01 15:47:45 +01:00
Andreas Rheinhardt
b91081274f avcodec/x86/h264_qpel: Add and use ff_{avg,put}_pixels16x16_l2_sse2()
This avoids mmx (the size 16 h264qpel dsp now no longer uses any mmx)
and improves performance, particularly for the avg case:

Old benchmarks:
avg_h264_qpel_16_mc01_8_c:                             780.0 ( 1.00x)
avg_h264_qpel_16_mc01_8_sse2:                           91.2 ( 8.55x)
avg_h264_qpel_16_mc03_8_c:                             804.0 ( 1.00x)
avg_h264_qpel_16_mc03_8_sse2:                           91.2 ( 8.82x)
put_h264_qpel_16_mc01_8_c:                             779.5 ( 1.00x)
put_h264_qpel_16_mc01_8_sse2:                           82.8 ( 9.41x)
put_h264_qpel_16_mc03_8_c:                             770.1 ( 1.00x)
put_h264_qpel_16_mc03_8_sse2:                           82.5 ( 9.33x)

New benchmarks:
avg_h264_qpel_16_mc01_8_c:                             783.9 ( 1.00x)
avg_h264_qpel_16_mc01_8_sse2:                           84.1 ( 9.32x)
avg_h264_qpel_16_mc03_8_c:                             797.4 ( 1.00x)
avg_h264_qpel_16_mc03_8_sse2:                           83.9 ( 9.51x)
put_h264_qpel_16_mc01_8_c:                             767.4 ( 1.00x)
put_h264_qpel_16_mc01_8_sse2:                           80.5 ( 9.53x)
put_h264_qpel_16_mc03_8_c:                             779.9 ( 1.00x)
put_h264_qpel_16_mc03_8_sse2:                           80.3 ( 9.71x)

(qpeldsp will use these functions when it gets ported to SSE2;
then the mmxext functions will be removed as well.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-01 15:17:05 +01:00