Commit graph

52271 commits

Author SHA1 Message Date
Zhao Zhili
808c6853e1 avcodec/mediacodecenc: Fix typo in VP9 option description
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 10:55:59 +08:00
Zhao Zhili
98c281152c avcodec/mediacodecdec: replace memset with direct zero init
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 10:53:09 +08:00
Zhao Zhili
f3bf535696 avcodec/libx264: Remove unnecessary include
eval is for av_strtod, which wasn't been used by libx264 now.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-12 23:07:13 +08:00
Marvin Scholz
9ad6dca28c avcodec/vvc: parse all SEI messages
While the current code iterated over the messages, it always returned
in the first iteration. Instead keep iterating and warn for failure to
parse. At time of writing, none of the parsing functions seems to
actually return an error, ever.

Fix CID 1648348
2025-06-12 21:17:07 +08:00
Marvin Scholz
3d7668dae1 avcodec/vvc/dec: fix possible null-pointer dereference
When checking for filmgrain here, needs_fg can be true even when
film_grain_characteristics is NULL (when aom_film_grain.enable is true),
therefore this check could end up dereferencing film_grain_characteristics
even though it is NULL.

Fix CID 1648347
2025-06-12 21:16:46 +08:00
averne
9e93163268 vulkan/ffv1dec: fix FFVkSPIRVCompiler leak 2025-06-11 13:30:07 +09:00
averne
f604d1093f vulkan/ffv1dec: fix leak in FFVulkanDecodeShared 2025-06-11 13:30:07 +09:00
James Almer
117343c0ba avcodec/ac3_parser: handle more header bits in ff_ac3_parse_header()
Based on a patch by nyanmisaka.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-08 18:39:17 -03:00
James Almer
efbcd31206 avcodec/ac3_parser: use a padded buffer in av_ac3_parse_header()
The GetBitContext API requires the buffer to be padded, and the documentation for
av_ac3_parse_header() does not specify it, so use a temporary local buffer.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-08 18:36:09 -03:00
Araz Iusubov
49e52ca24f avcodec/d3d12va_encode: fix l0 reference count limit
Prevents potential null pointer dereference when querying
MaxL1ReferencesForB from codec-specific support structures
during GOP structure initialization.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2025-06-08 21:24:25 +08:00
Frank Plowman
81370fd796 lavc/vvc: Fix unchecked return code and shadowing
Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-06-07 19:26:11 +08:00
Manuel Lauss
d9797544b4
avcodec/sanm: codec31/32 support
codec31/32 are similar to codec1/3 (RLE coding) but with two 4-bit pixels
per byte; they are only used in the Sega-CD release of Rebel Assault 1.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-06-06 22:07:15 +02:00
Manuel Lauss
b7662ddd15
avcodec/sanm: fix codec33/34 tile generator
Some of the calculated values were wrong and/or assigned
to the wrong pixel of the 4x4 block.
Found during testing with Rebel Assault Sega-CD release.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-06-06 22:07:11 +02:00
Manuel Lauss
c064390736
avcodec/sanm: remove codec4 block smoothing
it has a bug and its effects aren't that noticeable, esp. with
the smoothing applied to the whole picture by modern video display
engines.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-06-06 22:07:04 +02:00
Andreas Rheinhardt
81adbd2d3d avcodec/huffman: Combine allocations
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 17:21:37 +02:00
Andreas Rheinhardt
d0a27e01a6 avcodec/aacpsy: Remove always-true checks
Possible since 03cf101645.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 17:21:37 +02:00
Andreas Rheinhardt
f0e1a315a1 avcodec/iirfilter: Remove iirfilter, psy-preprocessing
The iirfilter is only used in its test tool since
01ecb7172b which
stopped using it in AAC, its only user.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 17:21:31 +02:00
Andreas Rheinhardt
28c0a189b6 avcodec/psymodel: Use av_memdup() where appropriate
Also "fixes" the inverted order of arguments in the av_malloc_array()
calls and therefore part of ticket #11620.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 16:27:12 +02:00
Andreas Rheinhardt
4bd1ce31fc avcodec/libaomenc: Avoid code duplication when setting options
(Some more options could be set via this method
if the order in which the options are applied doesn't matter.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 16:26:35 +02:00
Emma Worley
a4c1a5b084
lavc/dxvenc: fix big-endian issues in dxv_compress_dxt1
We were using a mix of pointers to local variables read via AV_RL32/64 and
pointers directly to the texture buffer as keys to interact with the lookback
hashtables. On big-endian systems, these produced different values. This change
makes all hashtable interactions use direct pointers to the texture buffer and
only invokves AV_RL32 in the event of a lookback hashtable miss.

Signed-off-by: Emma Worley <emma@emma.gg>
2025-06-04 09:53:37 -07:00
Andreas Rheinhardt
3be9b3f156 avcodec/hashtable: Remove null statement
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:32:29 +02:00
Andreas Rheinhardt
a2c3d99478 avcodec/hashtable: Only free buffer if there is buffer to free
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:32:11 +02:00
Andreas Rheinhardt
06958c731e avcodec/hashtable: Mark alloc,free functions as av_cold
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:31:51 +02:00
Andreas Rheinhardt
12a43975d1 avcodec/hashtable: Combine allocations
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:17:37 +02:00
Andreas Rheinhardt
2e45d2f7d3 avcodec/hashtable: Check for overflow
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:13:55 +02:00
Andreas Rheinhardt
1e6fdafce0 avcodec/hashtable: Only align complete entries
It is unnecessary to align both key and val, as they are only accessed
via memcpy()/memcmp(), which has no alignment requirements.
We only need to ensure that that the entries as a whole
are suitable aligned for the probe sequence length.

Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:12:48 +02:00
Andreas Rheinhardt
2fc310b2f2 avcodec/hashtable: Zero-initialize hashtable
Otherwise ff_hashtable_freep() would try to free uninitialized
pointers upon allocation error (which happens in the corresponding
test tool).

Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:11:48 +02:00
Andreas Rheinhardt
7927ac63ef avcodec/Makefile: Only compile hashtable.o when needed
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 14:56:54 +02:00
Emma Worley
d4556c98f0
lavc/dxvenc: improve compatibility with Resolume products
Improves compatibility with Resolume products by adding an additional
hashtable for DXT color+LUT combinations, and padding the DXT texture
dimensions to the next largest multiple of 16. Produces identical
packets to Resolume Alley in manual tests.

Signed-off-by: Emma Worley <emma@emma.gg>
2025-06-02 20:51:34 -07:00
Emma Worley
2de0d095b8
lavc/dxvenc: migrate DXT1 encoder to lavc hashtable
Offers a modest performance gain due to the switch from naive linear
probling to robin hood.

Signed-off-by: Emma Worley <emma@emma.gg>
2025-06-02 20:51:31 -07:00
Emma Worley
6fdb54ddee
lavc/hashtable: create generic robin hood hash table
Adds a generic hash table with the DXV encoder as an initial use case.

Signed-off-by: Emma Worley <emma@emma.gg>
2025-06-02 20:51:27 -07:00
Andreas Rheinhardt
93e53e253a avcodec/vc1dsp: Fix vc1op_pixels_func semantics
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:43:10 +02:00
Andreas Rheinhardt
09aeeeb663 avcodec/hpeldsp_init: Detemplatize
Since a51279bbde,
hpeldsp_rnd_template.c was only included once and
one of the two functions in rnd_template.c was
only enabled once.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:42:53 +02:00
Andreas Rheinhardt
83b3469142 avcodec/x86/hpeldsp_init: Use ff_avg_pixels16_mmxext
avg_pixels_tab[0][0] does the same as avg_no_rnd_pixels_tab[0].

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:41:51 +02:00
Andreas Rheinhardt
6d45668801 avcodec/hpeldsp: Remove duplicate pel functions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:41:44 +02:00
Andreas Rheinhardt
2d5f5e8726 avcodec/ac3dec: Deduplicate tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:37:41 +02:00
Andreas Rheinhardt
dbd2ca3580 avcodec/ac3{dec,enc}: Deduplicate gain levels table
(I don't know why the encoder only uses eight of the nine values.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:37:41 +02:00
Andreas Rheinhardt
11723b3526 avcodec/ac3: Move gain value defines to ac3defs.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:37:41 +02:00
Andreas Rheinhardt
20caa5cf2d avcodec/ac3dec: Deduplicate mantissas and their init code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:37:41 +02:00
Andreas Rheinhardt
9416ffd8b8 avcodec/ac3dec: Hardcode tables to save space
The code to initialize the ungrouped bap mantissa tables
(bap 3 or 5) takes more bytes of .text than the tables itself;
they have therefore been hardcoded.

For GCC (14, -O3, albeit in an av_cold function), the initialization
code takes 99B each for the fixed and floating point decoders
(the code is currently duplicated), whereas the hardcoded tables
only take 96B. For Clang 19 it were 374B each (I don't now what
Clang was doing there).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:37:41 +02:00
Zhao Zhili
c80002aa81 avcodec/h2645_vui: Ensure color primaries/trc/space isn't reserved value
Fix error reported by swscaler:
Unsupported input (Operation not supported): fmt:yuv420p csp:unknown prim:reserved trc:bt709 -> fmt:yuv420p csp:bt709 prim:reserved trc:bt709

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-01 16:35:23 +08:00
Wu Jianhua
a02e880e35 avcodec/vvc/sei: add decode_mastering_display_colour_volume
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
f6d2f38530 avcodec/vvc/sei: add decode_ambient_viewing_environment
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
761f75db74 avcodec/vvc: support fields
passed files:
    FIELD_A_Panasonic_4.bit
    FIELD_B_Panasonic_2.bit

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
870fa133af avcodec/vvc/sei: add decode_frame_field_info
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
299544bd0c avcodec/h274: add H274SEIFrameFieldInfo struct
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
33d511b581 avcodec/cbs_sei_syntax_template: add sei message frame_field_information
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
97137e38c1 avcodec/vvc/sei: add decode_content_light_level_info
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
40bc5e119e avcodec/vvc/sei: add decode_display_orientation
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
d140648c31 avcodec/cbs_sei_syntax_template: add sei message sei_display_orientation
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00