Commit Graph

52799 Commits

Author SHA1 Message Date
Kacper Michajłow
d6cb0d2c2b ALL: move av_unused to conform with standard requirement
This is required placement by standard [[maybe_unused]] attribute, works
the same for __attribute__((unused)).

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-09-26 16:15:46 +00:00
Andreas Rheinhardt
a54d6b1d91 avcodec/x86/rnd_template: Merge into hpeldsp_init.c
It is now only included exactly once.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:58 +02:00
Andreas Rheinhardt
43fe9554cc avcodec/x86/hpeldsp_init: Avoid complicating macro
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:55 +02:00
Andreas Rheinhardt
00e046df13 avcodec/x86/hpeldsp_init: Remove MMX(EXT) funcs overridden by SSE2
This affects the {avg,put}_no_rnd_pixels16_{x,y}2 MMX and
(put-only) MMXEXT versions. Removing these functions saved
1184B here.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:53 +02:00
Andreas Rheinhardt
30c4007c65 avcodec/x86/hpeldsp: Add SSE2 avg_no_rnd size 16 versions
These currently only exist as MMX versions.
The added functions occupy 320B here. So far, they are only for
the x2 and y2 (i.e. right and down, not down-right) directions.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:49 +02:00
Andreas Rheinhardt
1e677e6964 avcodec/x86/hpeldsp: Add SSE2 put_no_rnd size 16 versions
These currently only exist as MMX and (not bitexact) MMXEXT versions.
The added functions occupy 288B here. So far, they are only for
the x2 and y2 (i.e. right and down, not down-right) directions.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:46 +02:00
Andreas Rheinhardt
262791b8d8 avcodec/hpeldsp: Make put_no_rnd_pixels_tab smaller
Only the blocksizes 16 and 8 are implemented, yet the motion estimation
code touches the blocksize 4 entries. But really nothing touches
the blocksize 2 entries, so that we can reduce the put_no_rnd_pixels_tab
array size to [3][4].

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:43 +02:00
Andreas Rheinhardt
c7161befb4 avcodec/x86/h264_qpel: Remove MMX(EXT) funcs overridden by SSSE3
SSSE3 is already quite old (introduced 2006 for Intel, 2011 for AMD),
so that the overwhelming majority of our users (particularly those
that actually update their FFmpeg) will be using the SSSE3 versions.
This commit therefore removes the MMX(EXT) functions overridden
by them (which don't abide by the ABI) to get closer to a removal
of emms_c.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:39 +02:00
Andreas Rheinhardt
5ef613bcb0 avcodec/x86/mpegvideoencdsp_init: Remove MMX, 3DNOw funcs overridden by SSSE3
SSSE3 is already quite old (introduced 2006 for Intel, 2011 for AMD),
so that the overwhelming majority of our users (particularly those
that actually update their FFmpeg) will be using the SSSE3 versions.
This commit therefore removes the MMX and 3DNOW functions overridden
by them (which don't abide by the ABI) to get closer to a removal
of emms_c.

Also merge the mpegvideoenc_qns_template.c file into the main file.

The 3DNOW functions removed in this commit were the last in the
codebase.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:31 +02:00
Andreas Rheinhardt
6a47ea5f9f avcodec/x86/vvc/sao_10bit: Remove unused functions
Saves 65280B here.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:26 +02:00
Andreas Rheinhardt
918d37d9d1 avcodec/x86/rv40dsp_init: Remove MMX(EXT) funcs overridden by SSSE3
SSSE3 is already quite old (introduced 2006 for Intel, 2011 for AMD),
so that the overwhelming majority of our users (particularly those
that actually update their FFmpeg) will be using the SSSE3 versions.
This commit therefore removes the MMX(EXT) functions overridden
by them (which don't abide by the ABI) to get closer to a removal
of emms_c.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:23 +02:00
Andreas Rheinhardt
e86f137514 avcodec/x86/hpeldsp_init: Remove MMX(EXT) funcs overridden by SSSE3
SSSE3 is already quite old (introduced 2006 for Intel, 2011 for AMD),
so that the overwhelming majority of our users (particularly those
that actually update their FFmpeg) will be using the SSSE3 versions.
This commit therefore removes the MMX(EXT) functions overridden
by them (which don't abide by the ABI) to get closer to a removal
of emms_c.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:19 +02:00
Andreas Rheinhardt
2cf9e733c6 avcodec/x86/qpeldsp_init: Use SSE2 versions where possible
The mc00 versions (i.e. the qdsp functions with no subpixel
interpolation) are just wrappers around their fpel versions.
There are SSE2 versions of these, yet the qpel code only
uses the MMX(EXT) versions. This commit changes this and
also removes the MMX(EXT) versions.

This also allowed to remove ff_avg_pixels16_mmxext,
ff_put_pixels16_mmx.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:16 +02:00
Andreas Rheinhardt
1f9ef6a8dc avcodec/x86/h264_qpel: Remove MMX(EXT) functions overridden by SSE2FAST
CPUs which support SSE2, but not in a fast way (so that
they get the additional AV_CPU_FLAG_SSE2SLOW) are ancient
nowadays (2007 and older), so ignore the distinction between
the two and remove MMX and MMXEXT functions that are now
overridden by SSE2 functions.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:12 +02:00
Andreas Rheinhardt
8a7858dacf avcodec/x86/hpeldsp_init: Remove MMX(EXT) functions overridden by SSE2FAST
CPUs which support SSE2, but not in a fast way (so that
they get the additional AV_CPU_FLAG_SSE2SLOW) are ancient
nowadays (2007 and older), so ignore the distinction between
the two and remove MMX and MMXEXT functions that are now
overridden by SSE2 functions.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:08 +02:00
Andreas Rheinhardt
4d691da5ed avcodec/x86/hpeldsp_init: Remove MMX functions overridden by MMXEXT
Forgotten in a51279bbde because
I only looked for MMX(EXT) functions overridden by SSE2.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:04 +02:00
Andreas Rheinhardt
fcb9e0b5f0 avcodec/hpel{dsp,_template}: Use ptrdiff_t for strides
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:20:56 +02:00
Andreas Rheinhardt
89f2016ece avcodec/hpel_template: Fix unintentional usage of unsigned offsets
The value of sizeof() is of type size_t which means that
an expression like
src1[i * src_stride1 + 4 * (int)sizeof(pixel)]
will use a very large offset if src_stride1 is sufficiently negative.
It works in practice (because it is correct modulo SIZE_MAX),
but UBSan treats it as error:
libavcodec/hpel_template.c:104:1: runtime error: addition of unsigned offset to 0x7ffdfa0391d8 overflowed to 0x7ffdfa0391cc
Fix this by casting sizeof(pixel) to int.

(This has been uncovered by a checkasm test for the hpeldsp
which will be added in a later commit.)

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:20:52 +02:00
Andreas Rheinhardt
b316a1bdd1 avcodec/hpeldsp: Fix documentation
This commit fixes two issues in the documentation:
a) The documentation for {put,avg}_pixels_tab only mentions
widths 16 and 8, although it explicitly mentions that there
are four horizontal blocksizes. This part of the patch
basically reverts e5771f4f37.
b) The restrictions on height don't match the reality. While
most users abide by it, some do not:
i) vp56.c copies a 16x12 block.
ii) indeo3 can copy an arbitrary multiple of four lines
for block widths 4, 8 and 16.
iii) SVQ3 can use block sizes luma block sizes 16x16, 8x16,
16x8, 8x8, 4x8, 8x4 and 4x4 and the corresponding
8x8, 4x8, 8x4, 4x4, 2x4, 4x2 and 2x2 chroma block sizes.

This implies that for widths 2 and 4 height can be two
and is guaranteed to be at least even. For all other widths,
height can be a multiple of four.

Furthermore, a comment for the SVQ3 blocksizes has been added.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:20:30 +02:00
Andreas Rheinhardt
188440929d avcodec/libmpeghdec: Check channel layouts generically
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 05:38:46 +02:00
Andreas Rheinhardt
ca7679c82f avcodec/libmpeghdec: Don't set AVCodecContext.frame_size
It indicates a constant frame size (in samples); yet the documentation
of the MPEGH_DECODER_OUTPUT_INFO structure says that it
"gives information about the currently decoded audio data"
and makes no guarantees about it being constant.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 05:38:41 +02:00
Andreas Rheinhardt
7cd0641a99 avcodec/libmpeghdec: Align FFCodec initializers
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 05:38:37 +02:00
Andreas Rheinhardt
0ec21ea8d0 avcodec/libmpeghdec: Remove always-false check
The pointer to the decoder is always set after init has been
called successfully.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 05:38:32 +02:00
Andreas Rheinhardt
f46bd4add2 avcodec/libmpeghdec: Don't use too big buffer
The channel count is fixed, so we don't need to allocate
space to hold samples for nonexisting channels. This also
means that the maximum channel count is no longer hardcoded
in the macro.
Also switch to decoder_buffer_size to be samples-based.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 05:37:55 +02:00
Andreas Rheinhardt
60b88e75e4 avcodec/libmpeghdec: Inline constant
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 05:37:51 +02:00
Andreas Rheinhardt
a98f75d22c avcodec/libmpeghdec: Don't set AVCodec.sample_fmts
It is mostly pointless for decoders (only useful for those
codecs for which a floating-point and a fixed-point decoder
exist).

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 05:37:30 +02:00
Andreas Rheinhardt
839042b0c0 avcodec/libmpeghdec: Remove private class
This decoder doesn't have any options.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 05:37:24 +02:00
Andreas Rheinhardt
b8f341ff05 avcodec/libmpeghdec: Remove redundant manual close calls
This decoder has the INIT_CLEANUP flag set.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 05:36:42 +02:00
Leo Izen
2c8835dd72 avcodec/libjxldec: submit frame after file is complete
This commit causes the libjxl decoder wrapper to hold onto the decoded
frame until the trailing metadata after the frame is possibly complete
before it submits the frame. This allows EXIF and other metadata boxes
that occur after the frame is fully rendered to be attached to it as
side data.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-09-25 12:40:57 -04:00
Niklas Haas
96065d1261 avcodec/aom_film_grain: fix AVCOL_*_NB range check
These should also exclude the _NB values themselves.
2025-09-25 11:08:37 +00:00
Lynne
0599d508c9 prores_raw: use MKBETAG for the frame header tag
Equivalent, but more explicit. All values in the header are big endian.
2025-09-25 19:14:12 +09:00
Lynne
bc4d03c530 prores_raw: set profile based on the codec tag
This is the same as what the parser does.
2025-09-25 19:14:08 +09:00
Andreas Rheinhardt
cb5dbb30ca avcodec/tiff_common: Remove unused ff_tadd_*_metadata() funcs
Unused since ad77345a5d.

Reviewed-by: Leo Izen <leo.izen@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-25 06:47:30 +02:00
Andreas Rheinhardt
371931250a avcodec/ohdec: Check mutex/conditions initialization
Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-25 05:29:58 +02:00
Andreas Rheinhardt
748fa0a9bb avcodec/ohdec: Switch to RefStruct API for internal refcounting
It avoids allocations and corresponding error conditions.

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-25 05:29:26 +02:00
Andreas Rheinhardt
320133aafc avcodec/ohdec: Release decoder on allocation failure
Normally, the OH_AVCodec is wrapped inside an AVBuffer
to be freed in its free callback; yet when creating
the AVBuffer fails, the decoder is never destroyed.

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-25 05:28:16 +02:00
Stadelmann, Daniel
56c14f2311 avcodec/libmpeghdec: add MPEG-H 3DA Fraunhofer IIS mpeghdec decoder
Adds a wrapper around the Fraunhofer IIS MPEG-H 3D Audio mpeghdec [1]
decoder shared library.

[1] https://github.com/Fraunhofer-IIS/mpeghdec

Signed-off-by: Stadelmann, Daniel <daniel.stadelmann@iis.fraunhofer.de>
2025-09-24 08:25:42 +02:00
rcombs
e5f82ab868 Revert "lavc/libsvtav1: set packet durations"
This reverts commit 5c9b2027bc.

This doesn't actually work the way it'd appeared to in testing;
the output was based on frame *encode latency*.
2025-09-23 20:22:33 -07:00
Andreas Rheinhardt
17d5759bd9 avcodec/x86/apv_dsp: Don't export arrays unnecessarily
The const here is unnecessary, because everything inside
SECTION_RODATA is automatically const and using it exports
these objects from the object file because const is a macro
in x86inc.asm.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-24 01:21:32 +00:00
Andreas Rheinhardt
7c78a63476 avcodec/mpegaudiodec_float: Don't set AVCodec.sample_fmts directly
It is deprecated and doing so gives warnings from Clang.
Use CODEC_SAMPLEFMTS instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-23 22:16:02 +00:00
rcombs
5c9b2027bc lavc/libsvtav1: set packet durations 2025-09-23 14:32:47 +00:00
Krzysztof Pyrkosz
03c054d43c avcodec/aarch64/vvc: Implement dmvr_v_8
A72
dmvr_v_8_12x20_neon:                                   207.0 ( 4.15x)
dmvr_v_8_20x12_neon:                                   170.4 ( 4.37x)
dmvr_v_8_20x20_neon:                                   273.4 ( 4.58x)

A53
dmvr_v_8_12x20_neon:                                   450.6 ( 4.21x)
dmvr_v_8_20x12_neon:                                   342.8 ( 3.70x)
dmvr_v_8_20x20_neon:                                   550.9 ( 3.79x)
2025-09-23 11:20:20 +00:00
Krzysztof Pyrkosz
56a638d836 avcodec/aarch64/vvc: Unroll vvc_bdof_grad_filter_8x_neon
Before and after:
A53:
apply_bdof_8_16x8_neon:                               2733.1 ( 4.88x)
apply_bdof_8_16x16_neon:                              5458.6 ( 4.86x)
apply_bdof_10_16x8_neon:                              2789.8 ( 4.64x)
apply_bdof_10_16x16_neon:                             5523.8 ( 4.68x)
apply_bdof_12_16x8_neon:                              2792.8 ( 4.58x)
apply_bdof_12_16x16_neon:                             5519.5 ( 4.63x)

apply_bdof_8_16x8_neon:                               2571.8 ( 5.12x)
apply_bdof_8_16x16_neon:                              5173.3 ( 5.12x)
apply_bdof_10_16x8_neon:                              2635.1 ( 4.87x)
apply_bdof_10_16x16_neon:                             5243.0 ( 4.89x)
apply_bdof_12_16x8_neon:                              2613.0 ( 4.89x)
apply_bdof_12_16x16_neon:                             5231.7 ( 4.90x)

A78:
apply_bdof_8_16x8_neon:                                565.3 ( 8.43x)
apply_bdof_8_16x16_neon:                              1109.5 ( 8.60x)
apply_bdof_10_16x8_neon:                               568.2 ( 7.92x)
apply_bdof_10_16x16_neon:                             1114.1 ( 8.08x)
apply_bdof_12_16x8_neon:                               570.2 ( 7.87x)
apply_bdof_12_16x16_neon:                             1116.3 ( 8.03x)

apply_bdof_8_16x8_neon:                                541.4 ( 8.81x)
apply_bdof_8_16x16_neon:                              1065.9 ( 8.97x)
apply_bdof_10_16x8_neon:                               543.2 ( 8.32x)
apply_bdof_10_16x16_neon:                             1071.5 ( 8.39x)
apply_bdof_12_16x8_neon:                               544.2 ( 8.25x)
apply_bdof_12_16x16_neon:                             1074.1 ( 8.37x)
2025-09-23 11:20:11 +00:00
asivery
97bfb606e3 avformat/aeadec, avcodec/atrac1: Fix 8 and 4-channel ATRAC1 support
Signed-off-by: asivery <asivery@protonmail.com>
(cherry picked from commit 81cdf42222961c2959f1ede2d86fea0d1dcbbfcb)
2025-09-22 23:46:29 +00:00
Paul B Mahol
e0638cee0a avcodec/adpcm: improve decooding output for 4-bit ADPCM IMA WAV
(cherry picked from commit f11422f1a6251e2b3c42b4044efbc722b863778d)
2025-09-22 23:46:29 +00:00
Paul B Mahol
066432ebcf avcodec: add ADPCM IMA Escape audio decoder
(cherry picked from commit 4a663e78c4421da226e7d480d6767de803ee2122)
2025-09-22 23:46:29 +00:00
Paul B Mahol
5d6c9a15eb avcodec: add ADPCM Circus decoder
(cherry picked from commit cdd3d794c7e01e4d6f485e7b975a4b9107d3f2fd)
2025-09-22 23:46:29 +00:00
Paul B Mahol
f6dfb20302 avcodec: add ADPCM PSXC audio decoder
(cherry picked from commit a4055b5cc6d77c26867948e24de6bdfd5c0e6a3b)
2025-09-22 23:46:29 +00:00
Paul B Mahol
a4f778890b avcodec/adpcm: fix non-4bit adpcm ima wav decoding
(cherry picked from commit f4e05abeded46515bd7b4248fc7d65df82d9af2a)
2025-09-22 23:46:29 +00:00
Paul B Mahol
30fc5b1baa avcodec: add ADPCM IMA Magix decoder
(cherry picked from commit 2ec3ad2122484ce2c84f6ba055c5ebc1661c5b14)
2025-09-22 23:46:29 +00:00