Compare commits

...

2696 Commits

Author SHA1 Message Date
Michael Niedermayer 38e224c2ba */version.h: bump after release/7.1 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:10:35 +02:00
Michael Niedermayer e1094ac45d */version.h: bump minor versions for release/7.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:07:30 +02:00
Michael Niedermayer 27c6f5f6d2 Changelog: Mark for 7.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:05:48 +02:00
Michael Niedermayer 10d8b6f17c doc/APIchanges: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:05:28 +02:00
Michael Niedermayer 56bef2fd58 avcodec/xan: Add basic input size check
Fixes: Timeout
Fixes: 71739/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XAN_WC3_fuzzer-6170301405134848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpe
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:20 +02:00
Michael Niedermayer 03050a0d90 avcodec/vble: Allocate buffer later
Fixes: Timeout
Fixes: 71727/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VBLE_fuzzer-6126342574243840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:19 +02:00
Michael Niedermayer 5f471b500c avcodec/sgirledec: Check input length
Fixes: Timeout
Fixes: 71712/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SGIRLE_fuzzer-5763700835811328

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:19 +02:00
Michael Niedermayer 8367d7e184 avcodec/imm4: Check input size
Fixes: Timeout
Fixes: 71324/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IMM4_fuzzer-5388489435185152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:19 +02:00
Michael Niedermayer 050b5e85cb avcodec/svq3: Check for minimum size input
Fixes: Timeout
Fixes: 71295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-4999941125111808

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:18 +02:00
Michael Niedermayer 6190e82647 tools/target_swr_fuzzer: Limit the number of samples
Fixes: OOM and Timeout
Fixes: 71254/clusterfuzz-testcase-minimized-ffmpeg_SWR_fuzzer-5941896977907712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:18 +02:00
Michael Niedermayer 5ded752241 tools/target_dec_fuzzer: Add threshold for SRGC
Fixes: Timeout
Fixes: 71234/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SRGC_fuzzer-5098445864501248

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:18 +02:00
Michael Niedermayer c3a1cbbf5d avcodec/eacmv: Check input size for intra frames
Fixes: Timeout
Fixes: 71135/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EACMV_fuzzer-6251879028293632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:17 +02:00
Michael Niedermayer 9a823fbcfa tools/target_dec_fuzzer: Adapt threshold for RASC
Fixes: Timeout
Fixes: 71108/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-4799330484027392

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:17 +02:00
Michael Niedermayer 74385dd496 avcodec/encode: Check bitrate
Fixes: -1.80923e+19 is outside the range of representable values of type 'long'
Fixes: 71103/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6542773681979392

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:17 +02:00
Michael Niedermayer 36924fa306 avcodec/aac/aacdec: use correct index in deallocation
Fixes: memleak
Fixes: 71084/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5857751899635712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:16 +02:00
Michael Niedermayer 9d25b9665e avcodec/cbs_h266_syntax_template: Check bit depth with range extension
Fixes: shift exponent 62 is too large for 32-bit type 'int'
Fixes: 71020/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-6444916325023744
Fixes: 71285/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-4761971281428480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:16 +02:00
Michael Niedermayer e9f588af95 avcodec/osq: use unsigned for decorrelation
Fixes: signed integer overflow: 1205469696 + 1901074655 cannot be represented in type 'int'
Fixes: 70773/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-5419594888577024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:16 +02:00
Michael Niedermayer f27c8b04d3 avcodec/jfdctint_template: use unsigned z* in row_fdct()
Fixes: signed integer overflow: 856827136 + 2123580416 cannot be represented in type 'int'
Fixes: 70772/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_KS_fuzzer-5180569961431040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:15 +02:00
Michael Niedermayer fde8637fda avformat/asf: Check picsize
Fixes: signed integer overflow: 1073750247 * 2 cannot be represented in type 'int'
Fixes: 70722/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-5447231587549184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:15 +02:00
Michael Niedermayer ad35eaf848 avcodec/osq: Treat sum = 0 as k = 0
We have no valid sample that triggers this so we do not know if this would decode
correctly, but -inf is not the correct k value

Fixes: Assertion n>=0 && n<=32 failed at libavcodec/get_bits.h:423
Fixes: -inf is outside the range of representable values of type 'int'
Fixes: 70709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6223623839350784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2024-09-24 15:37:15 +02:00
Michael Niedermayer f2aba7bd9f MAINTAINERS: Fix typo in web repository
Found-by: Martin Schitter

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:14 +02:00
Martin Storsjö b4d9fa6cb9 compat: Fix the fallback definition of stdc_trailing_zeros
While shifting "value" to left, we would iterate through all bits
of an unsigned long long, while we only expect to count through
"size * CHAR_BIT" bits; instead shift bits to the right and just
count the trailing zeros.

This fixes fate with MSVC.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-24 14:00:27 +03:00
Zhao Zhili e18b46d95f swscale/aarch64: Fix rgb24toyv12 only works with aligned width
Since c0666d8b, rgb24toyv12 is broken for width non-aligned to 16.
Add a simple wrapper to handle the non-aligned part.

Co-authored-by: johzzy <hellojinqiang@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-09-24 10:24:14 +08:00
James Almer 0dd6f1d5bf avformat/mov: fix setting index of LCEVC enhancement stream
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 23:11:12 -03:00
James Almer cc73bf02ba doc/general_contents: add missing reference to LCEVC
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 13:42:19 -03:00
Anton Khirnov ce5f571e96 tests/fate/hevc: add a test for selecting view by position
Using a real-world iPhone-recorded file.
2024-09-23 17:15:02 +02:00
Anton Khirnov eca95dc38f tests/fate/hevc: add a test for switching between single and multi-view 2024-09-23 17:15:02 +02:00
Anton Khirnov b15af98f6e tests/fate/hevc: add a test for nontrivial values of nuh_layer_id
Typical files use 0 for the base layer and 1 for the secondary one, but
any value for the secondary layer should be supported.
2024-09-23 17:15:02 +02:00
Anton Khirnov 7d4c15cafb tests/fate/hevc: add MV-HEVC conformance sample tests
Only those that can be decoded with our implementation, so excluding
* C and D - independent layers
* G, H, I - more than 2 layers

Frame hashes verified against the reference implementation from
https://hevc.hhi.fraunhofer.de/svn/svn_3DVCSoftware/
2024-09-23 17:15:02 +02:00
Anton Khirnov da420ac6e1 fftools/ffmpeg: add support for multiview video
This extends the syntax for specifying input streams in -map and complex
filtergraph labels, to allow selecting a view by view ID, index, or
position. The corresponding decoder is then set up to decode the
appropriate view and send frames for that view to the correct
filtergraph input(s).
2024-09-23 17:15:02 +02:00
Anton Khirnov 68c198fae2 fftools/ffmpeg_sched: allow decoders to have multiple outputs
Will be useful for multilayer video.
2024-09-23 17:15:02 +02:00
James Almer aef221b22a avcodec/hevc/refs: export Stereo 3D side data
Use the 3D Reference Displays Info SEI message to link a view_id with
an eye.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 17:15:02 +02:00
Anton Khirnov 14746871e1 lavc/hevcdec: implement decoding MV-HEVC
At most two layers are supported.

Aspects of this work were sponsored by Vimeo and Meta.
2024-09-23 17:15:02 +02:00
Anton Khirnov 0fde9c609f lavc/decode: merge stereo3d information from decoder with packet side data
The HEVC decoder will start setting stereoscopic view position (left or
right) based on 3D Reference Displays Info SEI message in future
commits. This information should be merged with container-derived
stereo3D side data.
2024-09-23 17:12:17 +02:00
Anton Khirnov 327080c088 lavc/decode: make sure side data mapping does not produce duplicates
Also, deduplicate the code performing the mapping.
2024-09-23 17:12:15 +02:00
Anton Khirnov bcbe999077 lavc/decode: clear side data in reget_buffer()
Otherwise it may accumulate when e.g. global side data is repeatedly
copied to the frame with in each subsequent reget_buffer() call.
2024-09-23 17:11:40 +02:00
Anton Khirnov e19551d165 lavc/decode: do not clear the frame discard flag in ff_decode_frame_props_from_pkt()
Only do it in reget_buffer().

The purpose of this clearing this flag is to prevent it for
unintentionally persisting across multiple invocations of this function
on one frame, however that is only a problem if the frame is not
unreffed between uses, which is only the case with reget_buffer().

In other cases the caller may legitimately want to set the discard flag
and should have the option of doing so.
2024-09-23 17:11:40 +02:00
Anton Khirnov 75914b5822 lavc/hevc/hevcdec: implement MV-HEVC inter-layer prediction
The per-frame reference picture set contains two more lists -
INTER_LAYER[01]. Assuming at most two layers, INTER_LAYER1 is always
empty, but is added anyway for completeness.

When inter-layer prediction is enabled, INTER_LAYER0 for the
second-layer frame will contain the base-layer frame from the same
access unit, if it exists.

The new lists are then used in per-slice reference picture set
construction as per F.8.3.4 "Decoding process for reference picture
lists construction".
2024-09-23 17:11:40 +02:00
Anton Khirnov 02a9435cb0 lavc/hevcdec: implement slice header parsing for nuh_layer_id>0
Cf. F.7.3.6.1 "General slice segment header syntax"
2024-09-23 17:11:40 +02:00
Anton Khirnov a811ab74f0 lavc/hevc/parser: only split packets on NALUs with nuh_layer_id=0
A packet should contain a full access unit, which for multilayer video
should contain all the layers.
2024-09-23 17:11:40 +02:00
Anton Khirnov 52ce2d2a04 lavc/hevcdec/parse: process NALUs with nuh_layer_id>0
Otherwise parameter sets from extradata with nuh_layer_id>0 would be
ignored. Needed for upcoming MV-HEVC support.
2024-09-23 17:11:40 +02:00
Anton Khirnov 81e9afa6c2 lavc/hevc/ps: reindent 2024-09-23 17:11:40 +02:00
Anton Khirnov 7d245866b8 lavc/hevc/ps: implement SPS parsing for nuh_layer_id>0
Cf. F.7.3.2.2 "Sequence parameter set RBSP syntax", which extends normal
SPS parsing with special clauses depending on MultiLayerExtSpsFlag.
2024-09-23 17:11:40 +02:00
Anton Khirnov 4359467ad6 lavc/hevc/ps: drop a warning for sps_multilayer_extension_flag
SPS multilayer extension contains a single flag that we are free to
ignore, no reason to print a warning.
2024-09-23 17:11:40 +02:00
Niklas Haas 7351e067bc lavc/hevc_ps: parse VPS extension
Only implementing what's needed for MV-HEVC with two views.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:11:40 +02:00
James Almer efa9d3deca avcodec/hevc/sei: add support for 3D Reference Displays Information SEI
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:11:40 +02:00
Anton Khirnov 299d9115d4 lavfi/f_select: allow selection based on view ID
Can be used together with the split filter to decompose multiview video
into individual views.
2024-09-23 17:11:40 +02:00
Anton Khirnov 6940a6de2f lavu/frame: add side data storing view ID for multi-view video 2024-09-23 17:11:38 +02:00
Rémi Denis-Courmont a7505ec562 compat: add a fallback implementation of C23 stdbit.h
Header contents taken from VLC commit 7a970a33329c9836d169727ddbaf49a33240d587.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:08:46 +02:00
Anton Khirnov 8c185ef4e7 compat: drop gcc, suncc, and pthreads stdatomic emulation
Since we now require a C11-compliant compiler, there should be no
supported configurations where any of these is used.
2024-09-23 17:08:46 +02:00
Jonathan Baudanza 6b3f9c2e92 avformat/rtpdec: fix integer overflow in start_time_realtime calculation
I encountered this problem with NTP timestamps that are extremely old,
like from January, 1990.

Although RFC3550 suggests that the timestamps in the RTCP packets use
the actual wallclock, some implementations use other clocks, such as
the CLOCK_MONOTONIC on linux.

I'm my case, I'm dealing with packets from mediasoup.

Without this patch, start_time_realtime shows up in the distance future
instead of around Jan 1900.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:08:33 +02:00
James Almer 660e7e6a0e avcodec: add LCEVC decoding support via LCEVCdec
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:20:47 -03:00
James Almer 6147385393 avcodec: add an export_side_data flag to export picture enhancement layers
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:07:37 -03:00
James Almer d250cc02e2 avcodec/hevc/refs: ensure LCEVC SEI payloads are exported as frame side data before get_buffer() calls
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:05:34 -03:00
James Almer dbbf9a5ff7 avcodec/decode: split ProgressFrame allocator into two functions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:05:34 -03:00
James Almer a48eba0021 fftools/ffmpeg_filter: ensure that the inserted filters exist
If not, report it as a bug. avfilter_graph_create_filter() will return ENOMEM if the
passed filter argument is NULL, which is misleading.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 09:02:23 -03:00
James Almer aeb64d6fa5 configure: add missing filter dependencies to ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 09:02:23 -03:00
Víctor Manuel Jáquez Leal 2bcc124e1a vulkan_encode: set the quality level in session parameters
While running this command

./ffmpeg_g -loglevel debug -hwaccel vulkan -init_hw_device vulkan=vk:0,debug=1 -hwaccel_output_format vulkan -i input.y4m -vf 'format=nv12,hwupload' -c:v h264_vulkan -quality 2 output.mp4 -y

It hit this validation error:

Validation Error: [ VUID-vkCmdEncodeVideoKHR-None-08318 ] Object 0: handle =
0x8f000000008f, type = VK_OBJECT_TYPE_VIDEO_SESSION_KHR; Object 1: handle =
0xfd00000000fd, type = VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR;
| MessageID = 0x5dc3dd39
| vkCmdEncodeVideoKHR(): The currently configured encode quality level (2) for
VkVideoSessionKHR 0x8f000000008f[] does not match the encode quality level (0)
VkVideoSessionParametersKHR 0xfd00000000fd[] was created with. The Vulkan spec
states: The bound video session parameters object must have been created with
the currently set video encode quality level for the bound video session at the
time the command is executed on the
device (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdEncodeVideoKHR-None-08318)

This patch adds a new function helper for creating session parameters, which
also sets the quality level and it's called by the H.264 and H.265 Vulkan
encoders.
2024-09-23 13:42:34 +02:00
Lynne 39c640e1d6 nlmeans_vulkan: split up descriptor sets, rename buffer offset vars 2024-09-23 13:42:34 +02:00
Lynne bc36fe6f1f vulkan: use push descriptors where possible
Push descriptors are in theory slightly faster, but come with
limitations for which we have to check.

Either way, they're not difficult to implement, so even though
no one should be using peasant-tier descriptors, do it anyway.
2024-09-23 13:41:07 +02:00
Lynne 8a7af4aa49 vulkan: add support for regular descriptor pools
This permits:
 - The use of Vulkan filtering on many more devices
 - Better debugging due to lack of descriptor buffer support in layers

Much of the changes here are due to a requirement that updates to
descriptors must happen between the command buffer being waited on,
and the pipeline not being bound.

We routinely did it the other way around, by updating only after
we bind the pipeline.
2024-09-23 13:40:38 +02:00
Lynne 3d75ba7495 vulkan: separate out descriptor layouts from sets
Just avoids a single temporary allocation.
2024-09-23 13:40:38 +02:00
Lynne 2942ca802a hwcontext_vulkan: forward debug_mode to check_extensions() for devices
This allows disabling of certain extensions when debug mode is turned on.
2024-09-23 13:40:37 +02:00
Lynne b5184c5d45 hwcontext_vulkan: add the PROFILE_INDEPENDENT only when needed 2024-09-23 13:40:36 +02:00
Lynne a577d313b2 hwcontext_vulkan: add support for implicit DRM synchronization
More recent kernel versions allow for users to extract a sync_file
handle from a DMA-BUF, which can then be imported into Vulkan as a
binary semaphore.

This finally allows for synchronization between Vulkan and DMA-BUF
images, such as those from screen capture software, or VAAPI,
avoiding any corruption artifacts.

This is done fully asynchronously, where we use the kernel's
given binary semaphores as a dependency to increment the image's
usual VkSemaphores we allocate. The old imported binary semaphores
are cleaned up after execution as usual.

In the future, hwcontext_drm should receive support for explicitly
synchronized images as well, which would make the synchronization
more robust and portable.
2024-09-22 02:11:08 +02:00
Lynne 2395444c80 vulkan: add ff_vk_exec_add_dep_bool_sem
This function simply takes in a binary semaphore as a dependency
to an execution.
2024-09-22 02:11:08 +02:00
Lynne c4048013e5 vulkan: flexibly allocate temporary imageviews
No reason to allocate 16 when 3 will do.
2024-09-22 02:11:07 +02:00
Lynne 1445102e68 hwcontext_vulkan: fix VUID-VkPhysicalDeviceImageFormatInfo2-usage-requiredbitmask
fmt_props.usage was initialized to 0 as create_info.usage was set later.
2024-09-22 02:11:04 +02:00
Brad Smith 2bf588f273 libavutil/ppc: Make use of getauxval() and elf_aux_info() on ppc
Modern Linux has getauxval() and FreeBSD/OpenBSD ppc have elf_aux_info().

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-09-21 03:11:22 -04:00
Marvin Scholz 9e1682761f avcodec/cbs_h266: Fix copy paste mistake
The us macro expect the range_max here, which seems should be
MAX_UINT_BITS(hlen) here.

Fix CID1618757 Copy-paste error
2024-09-20 22:32:54 +02:00
James Almer 2eef902d38 avcodec/bsf/dts2pts: don't zero the node buffers when allocating them
It's unnecessary as the entire struct is written to immediately after it's
allocated.
Restores the behavior prior to fec6a8df31.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 23:23:14 -03:00
Marvin Scholz 720ae6b3f7 avcodec/vaapi_encode_h265: fix missing slice_block_cols assignment
Instead of assigning to unit_opts.slice_block_cols, the slice_block_cols
value from the context was incorrectly assigned to slice_block_rows.

Regression from 12f158ca8f

Fixes CID1619479 Unused value

Reviewed-by: Fei Wang <fei.w.wang@intel.com>
2024-09-20 09:30:11 +08:00
Marvin Scholz 4858a8ee2f configure: do not use interval regexp operators with awk
Some awk implementations like mawk (used on Ubuntu) do not support
these.
2024-09-20 02:50:01 +02:00
Marvin Scholz ed633a1312 MAINTAINERS: add myself as vf_xfade_vulkan maintainer 2024-09-19 21:28:11 +02:00
James Almer dc11c12b64 avfilter: add an LCEVC decoding filter
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:06:05 -03:00
James Almer df609af8e4 avcodec/packet: add an LCEVC enhancement data payload side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:26 -03:00
James Almer 5fa9c4e596 avformat/mov: support for LCEVC tracks
Co-authored-by: V-Nova Team <systems@v-nova.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:24 -03:00
James Almer ba0ef0860f avformat: add an LCEVC stream group
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:02 -03:00
James Almer 5896318229 avcodec/codec_id: add an LCEVC codec id for raw LCEVC data
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:02 -03:00
James Almer 9cea2410a1 avcodec/h2645_sei: export raw LCEVC metadata
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:00 -03:00
James Almer 90d12c24c5 avutil/frame: add an LCEVC enhancement data payload side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 08:45:48 -03:00
Gyan Doshi 0d5b68c27c ffmpeg_mux_init: correct log suggestion
The option is enc_time_base, not enc_timebase
2024-09-19 15:35:15 +05:30
Fei Wang 5211ad1acd lavc/vaapi_encode: Fix potential use of uninitialized value
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-19 12:01:28 +08:00
Fei Wang 061c86a717 lavc/vaapi_encode_av1: Fix encode fail since 9db68ed0
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-19 12:01:18 +08:00
Michael Niedermayer 6be3786c82 avformat/mxfdec: Check timecode for overflow
Fixes: signed integer overflow: 9223372036840103968 + 538976288 cannot be represented in type 'long'
Fixes: 70604/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4844090340999168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:43:22 +02:00
Michael Niedermayer 5a96aa435a avformat/mxfdec: More offset_temp checks
Fixes: signed integer overflow: 9223372036854775807 - -1927491430256034080 cannot be represented in type 'long'
Fixes: 70607/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5282235077951488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:39:21 +02:00
Michael Niedermayer 176db9db6e avformat/flvdec: Free metaVideoColor
Fixes: memeleak
Fixes: 70659/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-4539872627458048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:24:27 +02:00
Michael Niedermayer bd80c97391 swscale/output: Fix undefined integer overflow in yuv2rgba64_2_c_template()
Fixes: signed integer overflow: -1082982400 + -1083218484 cannot be represented in type 'int'
Fixes: 70657/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6707819712675840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:24:26 +02:00
Michael Niedermayer 44c5641ae8 swscale/swscale: Use unsigned operation to avoid undefined behavior
I have not checked that the constant is correct, this just fixes the undefined behavior

Fixes: signed integer overflow: -646656 * 3517 cannot be represented in type 'int
Fixes: 70559/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5209368631508992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:10:38 +02:00
Michael Niedermayer 6df9a0292c avcodec/vc2enc: basic sanity check on slice_max_bytes
Fixes: left shift of 896021632 by 3 places cannot be represented in type 'int'
Fixes: 70544/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC2_fuzzer-6685593652756480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:10:32 +02:00
Tomas Härdin 665bf46ac2 lavf/mxfdec: Handle KLV fill 2024-09-18 21:43:06 +02:00
Tomas Härdin 8f2ba4333d lavf/mxfdec: Switch to mxf_metadata_read_table loop to FF_ARRAY_ELEMS, skip if read == NULL 2024-09-18 21:43:06 +02:00
Marvin Scholz 7091da7129 configure: correctly set sanitizer toolchain compilers
Previously only the C compiler was set, which would lead to
confusing situations where even though clang-asan was selected,
it would still use g++ for C++ code, failing because configure
does not support mixing compilers in this way (which is a separate
issue not addressed by this commit).
2024-09-18 15:24:12 +02:00
Marvin Scholz 910bf33879 configure: fix symbol prefix detection
The symbol prefix check would incorrectly detect a bogus prefix in
circumstances where sanitizers instrument the build, like when
configuring with the clang-asan toolchain where it would detect the
prefix as __odr_asan_gen_, which is obviously wrong.

To fix this, adjust the prefix detection to only detect a
one-character prefix, which is the only case that matters
anywhere right now.
2024-09-18 15:24:12 +02:00
Anton Khirnov 0c9fe2b232 fftools/cmdutils: extend stream specifiers to match by disposition 2024-09-18 11:01:02 +02:00
Lynne 8875da347a hwcontext_vulkan: consider encode DBPs as always independent 2024-09-18 05:59:46 +02:00
Lynne 32d47166c8 hwcontext_vulkan: fix p->img_qfs
The array was tied to our old queue API, which meant that if users
set it, it was never set.
2024-09-18 05:59:41 +02:00
Lynne 0aa4ac0faf lavc: bump minor and add Changelog entry for the Vulkan H265 encoder 2024-09-17 21:12:32 +02:00
Lynne 4b4f0b68f8 lavc: add hevc_vulkan hardware encoder
This commit adds a Vulkan hardware HEVC encoder, with full support
of the spec - I, P, and B-frames.
2024-09-17 21:12:32 +02:00
Dave Airlie b4283f93e1 cbs_h265: add raw filler encoding 2024-09-17 21:12:31 +02:00
Lynne 12f158ca8f hw_base_encode_h265: split off SPS/PPS/VPS generation from VAAPI
This commit splits off the base unit generation from VAAPI to allow
sharing with other encoders.
2024-09-17 21:11:06 +02:00
James Almer 1c706cec46 avformat/mov_chan: add extra checks to channel description count
Make sure it's not zero, and equal or bigger than number of channels

Fixes: Timeout / DOS
Fixes: 67143/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-4858720481771520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-17 15:41:45 -03:00
James Almer fec6a8df31 avcodec/bsf/dts2pts: use a RefStruct pool to allocate nodes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-16 16:45:00 -03:00
James Almer 99ec7a8ced fate/h264: add a test for the dts2pts bsf
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-16 16:45:00 -03:00
Lynne ceb471cfde lavc: bump minor version and add changelog for h264_vulkan 2024-09-16 14:04:06 +02:00
Lynne f85d94730c lavc: add h264_vulkan hardware encoder
This commit adds the first Vulkan hardware encoder.

Currently, P, and **B**-frames are supported. This marks the
first implementation to support both.

The encoder has feature-parity with VAAPI.
2024-09-16 14:04:06 +02:00
Lynne 37243b2a08 lavc: add Vulkan video encoding base code
This commit adds the common Vulkan video encoding framework.
It makes full use of the asynchronous features of our new common
hardware encoding code, and of Vulkan.
The code is able to handle anything from H264 to AV1 and MJPEG.
2024-09-16 14:04:05 +02:00
Lynne 0fa6f33875 hwcontext_vulkan: add support for x2bgr10 and proper DRM mappings for 10-bit images
This allows mapping of 10-bit DRM images.
2024-09-16 14:03:56 +02:00
Steven Liu 76ff97cef5 tests/fate/cbs: make cbs-vvc test depends prerequisites correct
the VVC test cases cbs-vvc should prerequisites
VVC{demuxer, parser, metadata_bsf, muser}

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:45 +08:00
Steven Liu 6832134b7e tests/fate/cbs: refine depend prerequisites for cbs-hevc-discard test
add h264_metadata_bsf and file protocol for cbs-hevc-discard test cases

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:39 +08:00
Steven Liu 75fbff1170 tests/fate/demux: refine depend prerequisites for fate-mov-mp3-demux
fix fate error when --disable-everything --samples=fate-suite/ --enable-demuxer=mov

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:32 +08:00
Steven Liu 09580383c6 tests/fate/cbs: refine depend prerequisites for cbs-h264-discard test
add h264_metadata and file protocol for cbs-h264-discard test

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:25 +08:00
Steven Liu eb20eff903 tests/fate/seek: check seek opertation with mov demuxer and file protocol
fix error at fate-seek-* when
configure with --disable-everything --samples=fate-suite/ --enable-demuxer=mov

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:17 +08:00
Steven Liu 2fb2cd5c79 tests/fate/mov: check mov and framemd5 has enabled when test
fix error st fate-mov-neg-firstpts-discard when
--disable-everything --samples=fate-suite

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:08 +08:00
Steven Liu f3fc7af9fd tests/fate/matroska: check the demuxer and decoder allyes before fate-matroska-side-data-pref-codec
fix error message when use --disable-everything --samples=fate-suite/

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:00 +08:00
Steven Liu 8f100a66a1 tests/fate/audio: set flcl1905 test case with depend formats,decoder,protocol
move fate-flcl1905 with depend on test case,
because there will get an error when disable-everything with fate-suite samples.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:11:52 +08:00
Steven Liu 74553f0026 tests/fate/mov: check mov formats build status be for make test
fix make fate error when make fate with --disable-everything,
should check the mov build into ffmpeg status  before test mov functions.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:11:44 +08:00
Steven Liu 7df89cc1ec tests/fate/libavcodec: add mjpeg encoder depend for fate-libavcodec-huffman
fix make fate failed problem, because fate libavcodec-avcodec need mjpeg encoder
when fate-libavcodec-huffman

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:11:28 +08:00
Anton Khirnov 00f5a34c9a fftools/cmdutils: tighten condition for media type stream specifiers
Require the character indicating media type to be followed by a
non-alphanumeric character (or end of string).

Needed by future syntax extensions.
2024-09-15 22:21:17 +02:00
Marth64 8707c8660d avformat/dvdvideodec: implement seeking
Player applications can now enjoy seeking while playing back
a title. Accuracy is at the mercy of what libdvdnav exposes,
which is currently dvdnav_time_search().

Signed-off-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-15 13:53:00 +02:00
sfan5 e66f977494 lavf/tls_mbedtls: restrict TLSv1.3 verification workaround to affected version
Now that mbedTLS 3.6.1 is released we know that only 3.6.0 contains this regression.

ref: c28e5b597e
Signed-off-by: sfan5 <sfan5@live.de>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-15 13:50:18 +02:00
Zhao Zhili 5c66a3ab51 avcodec/vvc: Fix output and unref a frame which isn't decoding yet
ff_vvc_output_frame is called before actually decoding. It's possible
for ff_vvc_output_frame to select current frame to output. If current
frame is nonref frame, it will be released by ff_vvc_unref_frame.

Fix this by always marking the current frame with
VVC_FRAME_FLAG_SHORT_REF, as is done by the HEVC decoder.
2024-09-15 16:42:14 +08:00
Zhao Zhili 3f84d1d1fb aarch64/vvc: Add avg
avg_8_2x2_c:                                             0.2 ( 1.00x)
avg_8_2x2_neon:                                          0.2 ( 1.00x)
avg_8_4x4_c:                                             0.2 ( 1.00x)
avg_8_4x4_neon:                                          0.2 ( 1.00x)
avg_8_8x8_c:                                             0.9 ( 1.00x)
avg_8_8x8_neon:                                          0.2 ( 5.29x)
avg_8_16x16_c:                                           3.7 ( 1.00x)
avg_8_16x16_neon:                                        0.7 ( 5.44x)
avg_8_32x32_c:                                          14.9 ( 1.00x)
avg_8_32x32_neon:                                        1.7 ( 8.91x)
avg_8_64x64_c:                                          59.7 ( 1.00x)
avg_8_64x64_neon:                                        6.9 ( 8.62x)
avg_8_128x128_c:                                       254.7 ( 1.00x)
avg_8_128x128_neon:                                     26.9 ( 9.46x)
avg_10_2x2_c:                                            0.2 ( 1.00x)
avg_10_2x2_neon:                                         0.2 ( 1.00x)
avg_10_4x4_c:                                            0.2 ( 1.00x)
avg_10_4x4_neon:                                         0.2 ( 1.00x)
avg_10_8x8_c:                                            0.9 ( 1.00x)
avg_10_8x8_neon:                                         0.2 ( 5.29x)
avg_10_16x16_c:                                          3.4 ( 1.00x)
avg_10_16x16_neon:                                       0.4 ( 8.06x)
avg_10_32x32_c:                                         13.9 ( 1.00x)
avg_10_32x32_neon:                                       1.9 ( 7.23x)
avg_10_64x64_c:                                         54.2 ( 1.00x)
avg_10_64x64_neon:                                       8.4 ( 6.43x)
avg_10_128x128_c:                                      232.4 ( 1.00x)
avg_10_128x128_neon:                                    30.9 ( 7.52x)
avg_12_2x2_c:                                            0.0 ( 0.00x)
avg_12_2x2_neon:                                         0.2 ( 0.00x)
avg_12_4x4_c:                                            0.4 ( 1.00x)
avg_12_4x4_neon:                                         0.2 ( 2.43x)
avg_12_8x8_c:                                            0.7 ( 1.00x)
avg_12_8x8_neon:                                         0.2 ( 3.86x)
avg_12_16x16_c:                                          3.7 ( 1.00x)
avg_12_16x16_neon:                                       0.4 ( 8.65x)
avg_12_32x32_c:                                         13.7 ( 1.00x)
avg_12_32x32_neon:                                       2.2 ( 6.29x)
avg_12_64x64_c:                                         53.9 ( 1.00x)
avg_12_64x64_neon:                                       7.7 ( 7.03x)
avg_12_128x128_c:                                      270.9 ( 1.00x)
avg_12_128x128_neon:                                    30.4 ( 8.90x)
2024-09-14 16:36:34 +08:00
Zhao Zhili 1be5a2374f aarch64/vvc: Add put_epel_hv
On Apple M1:

put_chroma_hv_8_4x4_c:                                   1.7 ( 1.00x)
put_chroma_hv_8_4x4_neon:                                0.2 ( 7.67x)
put_chroma_hv_8_8x8_c:                                   5.5 ( 1.00x)
put_chroma_hv_8_8x8_neon:                                0.5 (11.53x)
put_chroma_hv_8_16x16_c:                                18.5 ( 1.00x)
put_chroma_hv_8_16x16_neon:                              1.5 (12.53x)
put_chroma_hv_8_32x32_c:                                72.5 ( 1.00x)
put_chroma_hv_8_32x32_neon:                              4.7 (15.34x)
put_chroma_hv_8_64x64_c:                               274.0 ( 1.00x)
put_chroma_hv_8_64x64_neon:                             18.5 (14.83x)
put_chroma_hv_8_128x128_c:                            1058.7 ( 1.00x)
put_chroma_hv_8_128x128_neon:                           75.2 (14.07x)

On Android Pixel 8 Pro:

put_chroma_hv_8_4x4_c:                                   1.2 ( 1.00x)
put_chroma_hv_8_4x4_neon:                                0.0 ( 0.00x)
put_chroma_hv_8_4x4_i8mm:                                0.2 ( 5.00x)
put_chroma_hv_8_8x8_c:                                   4.0 ( 1.00x)
put_chroma_hv_8_8x8_neon:                                0.5 ( 8.00x)
put_chroma_hv_8_8x8_i8mm:                                0.5 ( 8.00x)
put_chroma_hv_8_16x16_c:                                15.2 ( 1.00x)
put_chroma_hv_8_16x16_neon:                              2.5 ( 6.10x)
put_chroma_hv_8_16x16_i8mm:                              2.2 ( 6.78x)
put_chroma_hv_8_32x32_c:                                61.0 ( 1.00x)
put_chroma_hv_8_32x32_neon:                              9.8 ( 6.26x)
put_chroma_hv_8_32x32_i8mm:                              8.5 ( 7.18x)
put_chroma_hv_8_64x64_c:                               229.5 ( 1.00x)
put_chroma_hv_8_64x64_neon:                             38.5 ( 5.96x)
put_chroma_hv_8_64x64_i8mm:                             34.0 ( 6.75x)
put_chroma_hv_8_128x128_c:                             919.8 ( 1.00x)
put_chroma_hv_8_128x128_neon:                          154.5 ( 5.95x)
put_chroma_hv_8_128x128_i8mm:                          140.0 ( 6.57x)
2024-09-14 16:36:34 +08:00
Zhao Zhili 0dcf204e5d aarch64/vvc: Add put_epel_h i8mm
put_chroma_h_8_4x4_c:                                    0.4 ( 1.00x)
put_chroma_h_8_4x4_neon:                                 0.0 ( 0.00x)
put_chroma_h_8_4x4_i8mm:                                 0.1 ( 2.67x)
put_chroma_h_8_8x8_c:                                    1.6 ( 1.00x)
put_chroma_h_8_8x8_neon:                                 0.1 (11.00x)
put_chroma_h_8_8x8_i8mm:                                 0.1 (11.00x)
put_chroma_h_8_16x16_c:                                  6.9 ( 1.00x)
put_chroma_h_8_16x16_neon:                               1.1 ( 6.00x)
put_chroma_h_8_16x16_i8mm:                               0.7 (10.62x)
put_chroma_h_8_32x32_c:                                 27.6 ( 1.00x)
put_chroma_h_8_32x32_neon:                               4.7 ( 5.95x)
put_chroma_h_8_32x32_i8mm:                               4.4 ( 6.28x)
put_chroma_h_8_64x64_c:                                116.2 ( 1.00x)
put_chroma_h_8_64x64_neon:                              19.1 ( 6.07x)
put_chroma_h_8_64x64_i8mm:                              17.1 ( 6.77x)
put_chroma_h_8_128x128_c:                              466.6 ( 1.00x)
put_chroma_h_8_128x128_neon:                            81.4 ( 5.73x)
put_chroma_h_8_128x128_i8mm:                            71.7 ( 6.51x)
2024-09-14 16:36:34 +08:00
Zhao Zhili 41a1885f7a aarch64/vvc: Add put_epel_h
put_chroma_h_8_4x4_c:                                    0.2 ( 1.00x)
put_chroma_h_8_4x4_neon:                                 0.2 ( 1.00x)
put_chroma_h_8_8x8_c:                                    0.8 ( 1.00x)
put_chroma_h_8_8x8_neon:                                 0.2 ( 3.00x)
put_chroma_h_8_16x16_c:                                  3.8 ( 1.00x)
put_chroma_h_8_16x16_neon:                               0.8 ( 5.00x)
put_chroma_h_8_32x32_c:                                 12.5 ( 1.00x)
put_chroma_h_8_32x32_neon:                               2.2 ( 5.56x)
put_chroma_h_8_64x64_c:                                 47.0 ( 1.00x)
put_chroma_h_8_64x64_neon:                               8.8 ( 5.37x)
put_chroma_h_8_128x128_c:                              200.2 ( 1.00x)
put_chroma_h_8_128x128_neon:                            31.8 ( 6.31x)
2024-09-14 16:36:34 +08:00
Zhao Zhili 260e1b4b62 aarch64/vvc: Add sad
sad_8x16_c:                                              0.8 ( 1.00x)
sad_8x16_neon:                                           0.2 ( 3.00x)
sad_16x8_c:                                              0.5 ( 1.00x)
sad_16x8_neon:                                           0.2 ( 2.00x)
sad_16x16_c:                                             1.5 ( 1.00x)
sad_16x16_neon:                                          0.2 ( 6.00x)
2024-09-14 16:36:34 +08:00
Zhao Zhili 5ac6925803 aarch64/vvc: Add put_qpel_hv
With Apple M1 (no i8mm):

put_luma_hv_8_4x4_c:                                     2.2 ( 1.00x)
put_luma_hv_8_4x4_neon:                                  0.8 ( 3.00x)
put_luma_hv_8_8x8_c:                                     7.0 ( 1.00x)
put_luma_hv_8_8x8_neon:                                  0.8 ( 9.33x)
put_luma_hv_8_16x16_c:                                  22.8 ( 1.00x)
put_luma_hv_8_16x16_neon:                                2.5 ( 9.10x)
put_luma_hv_8_32x32_c:                                  84.8 ( 1.00x)
put_luma_hv_8_32x32_neon:                                9.5 ( 8.92x)
put_luma_hv_8_64x64_c:                                 333.0 ( 1.00x)
put_luma_hv_8_64x64_neon:                               35.5 ( 9.38x)
put_luma_hv_8_128x128_c:                              1294.5 ( 1.00x)
put_luma_hv_8_128x128_neon:                            137.8 ( 9.40x)

With Pixel 8 Pro:

put_luma_hv_8_4x4_c:                                     5.0 ( 1.00x)
put_luma_hv_8_4x4_neon:                                  0.8 ( 6.67x)
put_luma_hv_8_4x4_i8mm:                                  0.2 (20.00x)
put_luma_hv_8_8x8_c:                                    13.2 ( 1.00x)
put_luma_hv_8_8x8_neon:                                  1.2 (10.60x)
put_luma_hv_8_8x8_i8mm:                                  1.2 (10.60x)
put_luma_hv_8_16x16_c:                                  44.2 ( 1.00x)
put_luma_hv_8_16x16_neon:                                4.5 ( 9.83x)
put_luma_hv_8_16x16_i8mm:                                4.2 (10.41x)
put_luma_hv_8_32x32_c:                                 160.8 ( 1.00x)
put_luma_hv_8_32x32_neon:                               17.5 ( 9.19x)
put_luma_hv_8_32x32_i8mm:                               16.0 (10.05x)
put_luma_hv_8_64x64_c:                                 611.2 ( 1.00x)
put_luma_hv_8_64x64_neon:                               68.0 ( 8.99x)
put_luma_hv_8_64x64_i8mm:                               62.2 ( 9.82x)
put_luma_hv_8_128x128_c:                              2384.8 ( 1.00x)
put_luma_hv_8_128x128_neon:                            268.8 ( 8.87x)
put_luma_hv_8_128x128_i8mm:                            245.8 ( 9.70x)
2024-09-14 16:36:34 +08:00
Zhao Zhili a0b52afd32 aarch64/vvc: Add put_qpel_vx
put_luma_v_8_4x4_c:                                      1.0 ( 1.00x)
put_luma_v_8_4x4_neon:                                   0.0 ( 0.00x)
put_luma_v_8_8x8_c:                                      3.5 ( 1.00x)
put_luma_v_8_8x8_neon:                                   0.5 ( 7.00x)
put_luma_v_8_16x16_c:                                   13.8 ( 1.00x)
put_luma_v_8_16x16_neon:                                 1.2 (11.00x)
put_luma_v_8_32x32_c:                                   54.2 ( 1.00x)
put_luma_v_8_32x32_neon:                                 5.0 (10.85x)
put_luma_v_8_64x64_c:                                  217.5 ( 1.00x)
put_luma_v_8_64x64_neon:                                18.8 (11.60x)
put_luma_v_8_128x128_c:                                886.2 ( 1.00x)
put_luma_v_8_128x128_neon:                              74.0 (11.98x)
2024-09-14 16:36:34 +08:00
Zhao Zhili b051bc7cb8 aarch64/h26x: Remove duplicate b.eq instruction
b.eq is added by calc_all after each calc.
2024-09-14 16:36:34 +08:00
Zhao Zhili 11443cc9b1 avcodec/hevc: ff_hevc_(qpel/epel)_filters are signed type 2024-09-14 16:36:34 +08:00
Zhao Zhili 9f6c8eb412 aarch64/vvc: Add put_qpel_hx i8mm
Benchmark on Android pixel 8 with -fno-vectorize

put_luma_h_8_4x4_c:                                      0.2 ( 1.00x)
put_luma_h_8_4x4_neon:                                   0.2 ( 1.00x)
put_luma_h_8_4x4_i8mm:                                   0.0 ( 0.00x)
put_luma_h_8_8x8_c:                                      1.5 ( 1.00x)
put_luma_h_8_8x8_neon:                                   0.5 ( 3.00x)
put_luma_h_8_8x8_i8mm:                                   0.5 ( 3.00x)
put_luma_h_8_16x16_c:                                    6.2 ( 1.00x)
put_luma_h_8_16x16_neon:                                 2.0 ( 3.12x)
put_luma_h_8_16x16_i8mm:                                 1.5 ( 4.17x)
put_luma_h_8_32x32_c:                                   25.5 ( 1.00x)
put_luma_h_8_32x32_neon:                                 9.0 ( 2.83x)
put_luma_h_8_32x32_i8mm:                                 6.8 ( 3.78x)
put_luma_h_8_64x64_c:                                   99.8 ( 1.00x)
put_luma_h_8_64x64_neon:                                35.2 ( 2.83x)
put_luma_h_8_64x64_i8mm:                                27.2 ( 3.66x)
put_luma_h_8_128x128_c:                                422.0 ( 1.00x)
put_luma_h_8_128x128_neon:                             138.5 ( 3.05x)
put_luma_h_8_128x128_i8mm:                             109.2 ( 3.86x)
2024-09-14 16:36:34 +08:00
Zhao Zhili 25448d1716 aarch64/vvc: Add put_pel/put_pel_uni/put_pel_uni_w
put_luma_pixels_8_4x4_c:                                 0.2 ( 1.00x)
put_luma_pixels_8_4x4_neon:                              0.2 ( 1.00x)
put_luma_pixels_8_8x8_c:                                 0.7 ( 1.00x)
put_luma_pixels_8_8x8_neon:                              0.2 ( 3.22x)
put_luma_pixels_8_16x16_c:                               2.2 ( 1.00x)
put_luma_pixels_8_16x16_neon:                            0.2 ( 9.89x)
put_luma_pixels_8_32x32_c:                               8.2 ( 1.00x)
put_luma_pixels_8_32x32_neon:                            1.2 ( 6.71x)
put_luma_pixels_8_64x64_c:                              33.7 ( 1.00x)
put_luma_pixels_8_64x64_neon:                            2.5 (13.63x)
put_luma_pixels_8_128x128_c:                           145.5 ( 1.00x)
put_luma_pixels_8_128x128_neon:                         10.2 (14.23x)
put_uni_pixels_luma_8_4x4_c:                             0.5 ( 1.00x)
put_uni_pixels_luma_8_4x4_neon:                          0.0 ( 0.00x)
put_uni_pixels_luma_8_8x8_c:                             0.5 ( 1.00x)
put_uni_pixels_luma_8_8x8_neon:                          0.2 ( 2.11x)
put_uni_pixels_luma_8_16x16_c:                           1.2 ( 1.00x)
put_uni_pixels_luma_8_16x16_neon:                        0.2 ( 5.44x)
put_uni_pixels_luma_8_32x32_c:                           3.0 ( 1.00x)
put_uni_pixels_luma_8_32x32_neon:                        0.5 ( 6.26x)
put_uni_pixels_luma_8_64x64_c:                           3.0 ( 1.00x)
put_uni_pixels_luma_8_64x64_neon:                        1.7 ( 1.72x)
put_uni_pixels_luma_8_128x128_c:                         6.5 ( 1.00x)
put_uni_pixels_luma_8_128x128_neon:                      6.5 ( 1.00x)
2024-09-14 16:36:34 +08:00
Zhao Zhili 20f2bf5530 aarch64/vvc: Add put_qpel_h_* and put_qpel_uni_h_*
Just share hevc implementation.

checkasm --test=vvc_mc --benchmark:

put_luma_h_8_4x4_c:                                      0.2 ( 1.00x)
put_luma_h_8_4x4_neon:                                   0.2 ( 1.00x)
put_luma_h_8_8x8_c:                                      1.0 ( 1.00x)
put_luma_h_8_8x8_neon:                                   0.2 ( 4.33x)
put_luma_h_8_16x16_c:                                    3.2 ( 1.00x)
put_luma_h_8_16x16_neon:                                 1.2 ( 2.63x)
put_luma_h_8_32x32_c:                                   13.7 ( 1.00x)
put_luma_h_8_32x32_neon:                                 4.0 ( 3.45x)
put_luma_h_8_64x64_c:                                   48.2 ( 1.00x)
put_luma_h_8_64x64_neon:                                15.7 ( 3.07x)
put_luma_h_8_128x128_c:                                203.5 ( 1.00x)
put_luma_h_8_128x128_neon:                              62.0 ( 3.28x)
put_uni_h_luma_8_4x4_c:                                  0.2 ( 1.00x)
put_uni_h_luma_8_4x4_neon:                               0.2 ( 1.00x)
put_uni_h_luma_8_8x8_c:                                  1.5 ( 1.00x)
put_uni_h_luma_8_8x8_neon:                               0.2 ( 6.56x)
put_uni_h_luma_8_16x16_c:                                5.7 ( 1.00x)
put_uni_h_luma_8_16x16_neon:                             1.2 ( 4.67x)
put_uni_h_luma_8_32x32_c:                               24.0 ( 1.00x)
put_uni_h_luma_8_32x32_neon:                             4.7 ( 5.07x)
put_uni_h_luma_8_64x64_c:                               90.0 ( 1.00x)
put_uni_h_luma_8_64x64_neon:                            17.0 ( 5.30x)
put_uni_h_luma_8_128x128_c:                            357.7 ( 1.00x)
put_uni_h_luma_8_128x128_neon:                          67.5 ( 5.30x)
2024-09-14 16:36:34 +08:00
Zhao Zhili 46f07ce7d1 aarch64/hevc: Move epel/qpel to h26x directory
So vvc can reuse the implementation.
2024-09-14 16:36:34 +08:00
Zhao Zhili 8beafb5656 aarch64/hevc: Simplify function prototypes by macro 2024-09-14 16:36:34 +08:00
jiangjie f606872ed0 avformat/dashdec: The segments in dash file doesn't read completely when segment's size and duration is very small.
If the segment is very small, avformat_find_stream_info
will read all audio/video data in this segment.
cur->is_restart_needed is set to 0 later in dash_read_packet,
and no chance to be set to 1 again in the read_data function.

Reproduction:
ffmpeg -f lavfi -i mandelbrot -f lavfi -i anullsrc -c:v vp8 \
 -g 5 -r 5 -c:a libopus -use_template 0 -seg_duration 1 \
 -t 15 -y test_720.mpd
ffprobe -show_packets test_720.mpd
2024-09-14 11:42:09 +08:00
Marvin Scholz 6229e4ac42 avformat/mxfdec: narrow variable scopes 2024-09-13 19:48:15 +02:00
Marvin Scholz f5107e79ce avformat/mxfdec: fix variable shadowing 2024-09-13 19:48:08 +02:00
Marvin Scholz dd002f1588 fftools/ffmpeg_demux: narrow variable scope 2024-09-13 19:41:23 +02:00
Marvin Scholz 0753d17664 avcodec/libx264: fix variable shadowing 2024-09-13 19:40:46 +02:00
Marvin Scholz 0f87ff0db4 avcodec/g2meet: fix variable shadowing 2024-09-13 19:39:58 +02:00
Marvin Scholz fd4f7d0d14 avcodec/mjpegdec: fix variable shadowing 2024-09-13 19:39:19 +02:00
Marvin Scholz 3ebc68d25d fftools/ffmpeg_mux_init: fix variable shadowing 2024-09-13 19:38:40 +02:00
Marvin Scholz 25f0fff9ec fftools/ffmpeg_demux: fix variable shadowing 2024-09-13 19:37:40 +02:00
Marvin Scholz c59a073abe lavfi/af_channelmap: fix channelmap_init error handling
The channelmap_init function was returning success even on error after
7dc81d33c2 due to shadowing of the
outer ret variable.

Fixes CID1619297 Logically dead code
2024-09-13 19:12:58 +02:00
Anton Khirnov c079ebdc57 tests/fate/hevc: add a periodic intra refresh decode test
Would trigger #10887 before it was fixed, sample cut from the one
attached to the bug.
2024-09-13 12:10:11 +02:00
Anton Khirnov 536bb98888 lavc/hevcdec: set per-CTB filter parameters for WPP
Fixes #10887
2024-09-13 12:10:11 +02:00
Anton Khirnov 21ef80f3d9 lavc/hevcdec: remove a duplicate variable
In hls_decode_entry_wpp(), self_id is always identical to thread.
2024-09-13 12:10:11 +02:00
Anton Khirnov b88c88f920 Changelog: elaborate on what YUVJ is
Not all changelog readers may be familiar with it.
2024-09-13 11:56:53 +02:00
Anton Khirnov b53800691c lavc/hevcdec: set output frame pkt_dts
pkt_dts needs to be set manually when using the receive_frame() callback, so
it was unset after 2fdecbb239.

Fixes PTS guessing for certain files with broken timestamps. Cf.
https://github.com/mpv-player/mpv/issues/14806

Reported-by: llyyr <llyyr.public@gmail.com>
2024-09-13 11:56:53 +02:00
Marvin Scholz bb91425eb8 fftools/ffmpeg_mux_init: remove unused variable
This dict is declared and freed but nothing is ever written to it.
2024-09-13 00:31:19 +02:00
Marvin Scholz 0c84b977a9 avdevice/jack: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:30:48 +02:00
Marvin Scholz 5dfc547f25 avutil/file: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:29:10 +02:00
Marvin Scholz 074bf9faf7 avformat/crypto: fix variable shadowing 2024-09-13 00:27:35 +02:00
Marvin Scholz 24711b00c6 avformat/network: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:26:53 +02:00
Marvin Scholz e7126d9648 lavfi/vf_signature: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:26:23 +02:00
Marvin Scholz 8fac5beaf8 lavfi/f_metadata: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:24:47 +02:00
Marvin Scholz 59244a0c50 lavfi/vf_ssim: narrow variable scopes 2024-09-13 00:24:20 +02:00
Marvin Scholz 3f8061afe8 lavfi/vf_ssim: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:23:00 +02:00
Marvin Scholz bd3038b28c lavfi/vf_vmafmotion: fix variable shadowing 2024-09-13 00:22:29 +02:00
Marvin Scholz e93f20c017 lavfi/vf_vmafmotion: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:21:23 +02:00
Marvin Scholz 29d7ed089e lavfi/vf_psnr: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:21:02 +02:00
Marvin Scholz 4c6d07dd28 fftools/cmdutils: fix variable shadowing 2024-09-13 00:20:12 +02:00
Marvin Scholz bbde886b63 lavfi/vf_ssim360: fix variable shadowing 2024-09-13 00:19:46 +02:00
Marvin Scholz c6ab95d009 lavfi/vf_ssim360: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed
to av_log, so av_err2str can be used.
2024-09-13 00:19:20 +02:00
Marvin Scholz 990b80c004 fftools/ffmpeg_opt: fix variable shadowing 2024-09-13 00:17:53 +02:00
Niklas Haas ca77fc2177 avfilter: fix YUV colorspace negotiation for YUVJ
Ironically, despite being introduced to make YUVJ unnecessary, the new
YUV negotiation logic failed to actually negotiate YUVJ formats
themselves correctly, leading to errors when passing YUVJ frames into
a filter graph. (They were effectively treated like RGB or Grayscale
formats, rather than as forced-full-range YUV, and hence did not have
their colorspace matrix correctly negotiated)

Fix this by splitting off the YUVJ check from ff_fmt_is_regular_yuv().
Obviously, we can trivially undo this change again once YUVJ is actually
deleted from the codebase.

Fixes: #11179
2024-09-12 19:13:21 +02:00
Niklas Haas da80ee21ca tests/fate: force MPEG range for rawvideo tests
The input file is MPEG range, so we should also encode to MPEG range
before comparing against it. This bug was avoided in the past because
YUVJ inputs were automatically converted back to limited range when converting
to a different pixfmt (in the absence of tagging). However, with proper YUV
negotiation in place, the default behavior is to preserve the YUV range
wherever possible. Since `rawvideo` does not signal or care about the YUV
range, we need to explicitly request the desired output range to force a
conversion.

Affects all rawvideo tests, in particular vsynth and owdenoise.
2024-09-12 19:13:21 +02:00
Marvin Scholz 504c1ffcd8 fftools/ffmpeg: remove useless error check
When ret is checked here, it was never assigned anything, making this
check useless, as highlighted by Coverity.

It seems to be a copy paste mistake given that opt_match_per_stream_str
does not return an error code that could be checked and the previous
value assigned to ret is already checked above. So just remove this
check.

Fixes: CID1616292
2024-09-12 05:11:14 +02:00
James Almer 2e91532ead avfilter/af_join: pass the correct input layouts to ff_channel_layouts_ref
Should fix memory leaks show in fate-filter-join and fate-filter-crazychannels.

Reviewed-by: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-11 16:26:55 -03:00
Cameron Gutman a15d2fdfd9 avcodec/amfenc: Fix AV1 HDR metadata for delayed surfaces
AMF_VIDEO_ENCODER_AV1_INPUT_HDR_METADATA was set above in the normal
input case but forgotten for the same in the delayed surface codepath.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-09-11 15:45:59 +02:00
Lynne 4646a74d1e lavc/Makefile: only compile hw_base_encode_h264.c when actually needed 2024-09-10 04:59:22 +02:00
Lynne 15c03b79d2 hw_base_encode_h264: remove unused AUD unit structure
Each codec initializes its own AUD structure when needed, which takes 2 lines.
2024-09-10 04:57:29 +02:00
Michael Riedl 9bcb86b0fa avdevice/decklink_dec: extend available actions on signal loss
Deprecate the option 'draw_bars' in favor of the new option 'signal_loss_action',
which controls the behavior when the input signal is not available
(including the behavior previously available through draw_bars).
The default behavior remains unchanged to be backwards compatible.
The new option is more flexible for extending now and in the future.

The new value 'repeat' repeats the last video frame.
This is useful for very short dropouts and was not available before.

Signed-off-by: Michael Riedl <michael.riedl@nativewaves.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-09-09 23:47:49 +02:00
Zhao Zhili 071c499026 avfilter/unsharp: Call function directly rather than via function pointer
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-09-10 00:59:30 +08:00
Anton Khirnov 691e0a1082 lavfi/af_pan: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov b38f4e7f86 lavfi/af_pan: stop modifying private data in query_formats()
It is not supposed to have any side effects, and the modification in
question can just as well be done in filter init.
2024-09-09 17:26:18 +02:00
Anton Khirnov d0f4c08207 lavfi/af_lv2: convert to query_func2() 2024-09-09 17:26:18 +02:00
Anton Khirnov 363d4a7559 lavfi/af_replaygain: convert to query_func2() 2024-09-09 17:26:18 +02:00
Anton Khirnov 75b2f5a7d3 lavfi/af_sidechaincompress: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov 4c4199758c lavfi/af_sofalizer: convert to query_func2() 2024-09-09 17:26:18 +02:00
Anton Khirnov 449f670a14 lavfi/af_stereotools: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov c4d9282a56 lavfi/af_stereowiden: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov d90035c941 lavfi/af_surround: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov 2ee4625d4b lavfi/af_virtualbass: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov 7887d00ee6 lavfi/af_volume: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov e13592c22d lavfi/af_loudnorm: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov bfb139bb8d lavfi/af_ladspa: convert to query_func2() 2024-09-09 17:26:18 +02:00
Anton Khirnov 48d9a4d7ca lavfi/af_join: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov fdc6e31725 lavfi/af_headphone: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov c9c6f07436 lavfi/af_hdcd: convert to query_func2() 2024-09-09 17:26:17 +02:00
Anton Khirnov 0ec382f494 lavfi/af_haas: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov 408587c836 lavfi/af_extrastereo: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov 7896b95430 lavfi/af_earwax: convert to query_func2() 2024-09-09 17:26:17 +02:00
Anton Khirnov e37d1efe65 lavfi/af_dialoguenhance: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov ffbafbfded lavfi/af_crossfeed: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov 84fda7de79 lavfi/af_channelsplit: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov cfbf10412f tests/fate/filter-audio: add a test for handling more than 64 channels
The test constructs 66 sine waves of different frequencies and joins
them into a 7th order ambisonic layout with extra non-diegetic
stereo. The channels are then shifted circularly with channelmap and
separated into individual streams for muxing with channelsplit.

Note that the last step is necessary because swr is not capable of
interleaving planar to packed for more than 64 channels, which would be
necessary to mux such a stream as PCM.
2024-09-09 17:26:17 +02:00
Anton Khirnov 18d492ff41 lavfi/af_channelsplit: support arbitrary channel layouts
Not just those containing channel values under 64. Also, remove an
arbitrary limitation on channel count.
2024-09-09 17:26:17 +02:00
Anton Khirnov 7dc81d33c2 lavfi/af_channelmap: remove an arbitrary limit on channel count 2024-09-09 17:26:17 +02:00
Brad Smith a3f79fd22a aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD
FreeBSD 12.0+, OpenBSD -current and what will be OpenBSD 7.6 support
elf_aux_info(3).

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-09-09 07:17:49 -04:00
Lynne 1709f3830e fftools/opt_common: add missing newline after printing codecs
This fixes
ffmpeg -help bsf=trace_headers =>

Supported codecs: av1 h264 hevc vvc mjpeg mpeg2video vp8 vp9<no newline>
2024-09-09 13:03:04 +02:00
Marvin Scholz 9556379943 lavfi/avfiltergraph: fix leak on error
Introduced in eddffbedb3

Fixes: CID1618897 Resource leak
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-09 12:27:00 +02:00
Brad Smith fe4b9ef69f avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()
Initially used for getauxval() but will be used to add support for
other API, such as elf_aux_info().

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-09-09 06:20:11 -04:00
Lynne 5e9845f11e vulkan(_decode): fix, simplify and improve queries
The old query code never worked properly, and did some hideous
heuristics to read the status bit, and work that into a return
code.
This is all best left to callers to do, which simplifies
our code a lot.

This also fixes minor validation errors regarding calling queries
which are not in their active state.
2024-09-09 07:05:46 +02:00
Lynne 3415e0533f hwcontext_vulkan: disable more false positive validation checks
Both of these are fundamentally incompatible with video decoding.

The third one can be tracked in the following validation layer issue:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/6627
2024-09-09 07:05:46 +02:00
Lynne 9c65325819 vulkan_decode: use ff_vk_init
This solves the issue of an av_log function being called
with a context with invalid class.

Co-authored-by: Anton Khirnov <anton@khirnov.net>
2024-09-09 07:05:45 +02:00
Lynne 620822c0c5 vulkan: add a ff_vk_init function
This function sets the class correctly, and calls functions
that all users have to call anyway.
2024-09-09 07:05:45 +02:00
Lynne 0ffa967170 hwcontext_vulkan: ask for storage images by default
The issue is that we ask for storage images by default if
available, but because that is gated by the format supporting
storage images, and the check for the format supporting storage
images is gated by the usage, this resulted in a catch-22.
2024-09-09 07:05:45 +02:00
Lynne eb5088d28c vulkan_filter: require storage images properly, set usage flags explicitly
This caused images to be created without a storage usage, which broke
at least lavapipe.
2024-09-09 07:05:44 +02:00
Lynne c41ef7f2ff hwcontext_vulkan: add PREP_MODE_GENERAL for non-transfer_dst images
Vulkan filters don't need images which can be transferred into.
2024-09-09 07:05:44 +02:00
Lynne 66e950fcac vulkan_video: move imageview creation and DPB fields to common context
Shared between decoders and encoders.
2024-09-09 07:05:44 +02:00
Lynne 06483d039a vulkan: error out if query is called without being initialized 2024-09-09 07:05:43 +02:00
Lynne fd86c373c2 vulkan: use correct return codes for query errors 2024-09-09 07:05:43 +02:00
Lynne 0a1f724bf4 vulkan_video: add utilities for H264 level/profile mapping 2024-09-09 07:05:42 +02:00
Lynne 3de73f1262 hw_base_encode: make recon_frames_ref optional
Vulkan supports some stupidly odd hardware, that unfortunately,
most modern GPUs happen to be.
The DPB images for encoders may be required to be preallocated
all at once, and rather than be individual frames, be layers of
a single frame.

As the hw_base_encode code is written with the thought that either
the driver or the device itself supports sane image allocation,
Vulkan does not leave us with this option.

So, in the case that the hardware does not support individual
frames to be used as DPBs, make the DBP frames context optional,
and let the subsystem manage this.
2024-09-09 07:05:42 +02:00
Lynne e6019ed075 hw_base_encode: allocate DPB image upfront
Vulkan requires this, as it needs to initialize state upfront.
2024-09-09 07:05:42 +02:00
Lynne 034e25e1a4 hw_base_encode: move VAAPI SPS/PPS constructors to a shared file 2024-09-09 07:05:41 +02:00
Lynne 9db68ed042 hw_base_encode: refactor picture allocation/freeing
This commit cleans up and refactors the mess of private state upon
private state that used to be.

Now, FFHWBaseEncodePicture is fully initialized upon call-time,
and, most importantly, this lets APIs which require initialization
data for frames (VkImageViews) to initialize this for both the
input image, and the reconstruction (DPB) image.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2024-09-09 07:05:24 +02:00
James Almer fdf8025eb6 avcodec/avcodec: remove usage of __typeof__()
It's non-standard C.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-08 20:33:04 -03:00
Niklas Haas b4e918221c doc/APIchanges: mention correct version number
Missed while rebasing
2024-09-08 18:07:30 +02:00
Michael Niedermayer 4bc2f90cff MAINTAINERS: remove Aurelien and David from matroska*
Aurelien last activity in git is from 2017, last activity on the ML is from 2018
David last activity in git is from 2011, and ML from 2013

matroska* is actively maintained

CC: Aurelien Jacobs <aurel@gnuage.org>
CC: David Conrad <lessen42@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:39 +02:00
Michael Niedermayer 85aee1dc31 MAINTAINER: iamf is maintained by James
CC: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:39 +02:00
Michael Niedermayer ec8b5187f9 MAINTAINERS: Add status to icecast
Last icecast threads have Marvin in them so it seems maintained

CC: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:39 +02:00
Michael Niedermayer 49226216b1 MAINTAINERS: Rangecoder looks quite familiar, ill maintain it
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:38 +02:00
Michael Niedermayer c7083738bd MAINTAINERS: Mark parts from Ludmila as unmaintained
Last i see from Ludmila is from 2015

CC: Ludmila Glinskih <lglinskih@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:38 +02:00
Michael Niedermayer 5d02b0f72e MAINTAINERS: Update fate admin
Timothy has not reacted to any fate admin related mails i can remember
last was handled by timo, prior where probably handled by me

CC: Timothy Gu <timothygu99@gmail.com>
CC: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:38 +02:00
Michael Niedermayer 006ee12a9a MAINTAINERS: Mark parts from Robert as unmaintained
Last mail and commit from Robert seems from 2011, thats 13 years ago

CC: Rob <robert.swain@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:37 +02:00
Christian Helmrich 865cd3c056 avfilter: add XPSNR filter
Add XPSNR video filter
Register new filter xpsnr.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:37 +02:00
Niklas Haas e6983ed525 Changelog: mention YUV range negotiation 2024-09-08 14:07:59 +02:00
Niklas Haas 8517ff2082 fftools/ffmpeg_filter: remove YUVJ hack
This is no longer needed, since we now correctly negotiate the required
range from the mjpeg encoder via avcodec_get_supported_config().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-08 13:59:29 +02:00
Niklas Haas a850f80e2c fftools/ffmpeg_filter: propagate codec yuv metadata to filters
To convert between color spaces/ranges, if needed by the codec
properties.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-08 13:59:29 +02:00
Niklas Haas 33d5a4ec4e fftools/ffmpeg_filter: switch to avcodec_get_supported_config()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-08 13:59:29 +02:00
Anton Khirnov f3e265c690 fftools/ffmpeg_mux_init: factor out binding filters to output streams 2024-09-08 13:59:29 +02:00
Niklas Haas 7d6cd13ccb fftools/ffmpeg_filter: simplify choose_pix_fmts
The only meaningful difference between choose_pix_fmts and the default
code was the inclusion of an extra branch for `keep_pix_fmt` being true.

However, in this case, we either:
1. Force the specific `ofp->format` that we inherited from
   ofilter_bind_ost, or if no format was set:
2. Print an empty format list

Both of these goals can be accomplished by simply moving the decision
logic to ofilter_bind_ost, to avoid setting any format list when
keep_pix_fmt is enabled. This is arguably cleaner as it moves format
selection logic to a single function. In the case of branch 1, nothing
else needs to be done as we already force the format provided in
ofp->format, if any is set. Add an assertion to verify this assumption
just in case.

(Side note: The "choose_*" family of functions are arguably misnomers,
as they should really be called "print_*" - their current behavior is to
print the relevant format lists to the `vf/af_format` filter arguments)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-09-08 13:59:29 +02:00
Niklas Haas 7b0eca1e51 fftools/ffmpeg_mux_init: switch to avcodec_get_supported_config() 2024-09-08 13:59:29 +02:00
Niklas Haas 377652da19 fftools: drop unused/hacky macros
Having macros initialize local variables seems strange to me, and there
are no more current users of these macros. (The one that was commented
out was incorrect anyway, since the macro has changed in the meantime)
2024-09-08 13:59:29 +02:00
Niklas Haas 69b8405482 fftools/opt_common: switch to avcodec_get_supported_config()
While rewriting this macro, I decided to make it a bit more flexible so
it can work for all of the fields (including future fields) in a more
generic way, and to also print the channel layout using an AVBPrint to
avoid hard-coding the assumption that the length is less than 128
characters.
2024-09-08 13:59:29 +02:00
Niklas Haas 4524d527bf avcodec/codec_internal: nuke init_static_data()
All hail get_supported_config()
2024-09-08 13:59:29 +02:00
Niklas Haas 2c2dfd9149 avcodec/mjpegenc: switch to get_supported_config()
This codec's capabilities should be set dynamically based on the value
of strict_std_compliance, when available. This will allow us to finally
get rid of the strictness hack in ffmpeg_filter.c.
2024-09-08 13:59:29 +02:00
Niklas Haas a577172c99 avcodec/libaomenc: switch to get_supported_config() 2024-09-08 13:59:29 +02:00
Niklas Haas 0977d968e4 avcodec/libvpxenc: switch to get_supported_config() 2024-09-08 13:59:29 +02:00
Niklas Haas de421cac8b avcodec/libx265: switch to get_supported_config() 2024-09-08 13:59:29 +02:00
Niklas Haas 088108fc7a avcodec/allcodecs: add backcompat for new config API
In order to avoid breaking older clients not yet using the new API, we
need to add backwards compatibility for codecs which have switched from
init_static() to get_supported_config().

This function can be removed entirely once the deprecated static fields
are removed.
2024-09-08 13:59:29 +02:00
Niklas Haas 13cec7bb5f avcodec/encode: switch to avcodec_get_supported_config() 2024-09-08 13:59:29 +02:00
Niklas Haas 3305767560 avcodec: add avcodec_get_supported_config()
This replaces the myriad of existing lists in AVCodec by a unified API
call, allowing us to (ultimately) trim down the sizeof(AVCodec) quite
substantially, while also making this more trivially extensible.

In addition to the already covered lists, add two new entries for color
space and color range, mirroring the newly added negotiable fields in
libavfilter.

Once the deprecation period passes for the existing public fields, the
rough plan is to move the commonly used fields (such as
pix_fmt/sample_fmt) into FFCodec, possibly as a union of audio and video
configuration types, and then implement the rarely used fields with
custom callbacks.
2024-09-08 13:59:25 +02:00
Niklas Haas 703288cec6 avcodec/internal: add FFCodec.color_ranges
I went through all codecs and put them into five basic categories:

1. JPEG range only
2. MPEG range only
3. Explicitly tagged
4. Broken (codec supports both but encoder ignores tags)
5. N/A (headerless or pseudo-formats)

Filters in category 5 remain untouched. The rest gain an explicit
assignment of their supported color ranges, with codecs in category
4 being set to MPEG-only for safety.

It might be considered redundant to distinguish between 0 (category 5)
and MPEG+JPEG (category 3), but in doing so we effectively communicate
that we can guarantee that these tags will be encoded, which is distinct
from the situation where there are some codecs that simply don't have
tagging or implied semantics (e.g. rawvideo).

A full list of codecs follows:

JPEG range only:
 - amv
 - roqvideo

MPEG range only:
 - asv1, asv2
 - avui
 - cfhd
 - cljr
 - dnxhd
 - dvvideo
 - ffv1
 - flv
 - h261, h263, h263p
 - {h263,vp8}_v4l2m2m
 - huffyuv, ffvhuff
 - jpeg2000
 - libopenjpeg
 - libtheora
 - libwebp, libwebp_anim
 - libx262
 - libxavs, libxavs2
 - libxvid
 - mpeg1video, mpeg2video
 - mpeg2_qsv
 - mpeg2_vaapi
 - mpeg4, msmpeg4, msmpeg4v2, wmv1, wmv2
 - mpeg4_omx
 - prores, prores_aw, prores_ks
 - rv10, rv20
 - snow
 - speedhq
 - svq1
 - tiff
 - utvideo

Explicitly tagged (MPEG/JPEG):
 - {av1,h264,hevc}_nvenc
 - {av1,h264,hevc}_vaapi
 - {av1,h264,hevc,vp8,vp9,mpeg4}_mediacodec
 - {av1,h264,hevc,vp9}_qsv
 - h264_amf
 - {h264,hevc,prores}_videotoolbox
 - libaom-av1
 - libkvazaar
 - libopenh264
 - librav1e
 - libsvtav1
 - libvpx, libvpx-vp9
 - libx264
 - libx265
 - ljpeg
 - mjpeg
 - vc2

Broken (encoder ignores tags):
 - {av1,hevc}_amf
 - {h264,hevc,mpeg4}_v4l2m2m
 - h264_omx
 - libxeve
 - magicyuv
 - {vp8,vp9,mjpeg}_vaapi

N/A:
 - ayuv, yuv4, y41p, v308, v210, v410, v408 (headerless)
 - pgmyuv (headerless)
 - rawvideo, bitpacked (headerless)
 - vnull, wrapped_avframe (pseudocodecs)
2024-09-08 13:58:11 +02:00
Marvin Scholz 8a314e3f11 lavu/opt: Fix return of uninitialised value
In one of the failure paths of av_opt_get_array, the ret variable
was accidentally declared again, shadowing the outer one and once when
jumping to the fail label would return the still uninitialised outer
one.

To fix this simply remove the local declaration of ret that shadowed
the outer one.

Introduced in d89930f866

Fixes: CID1618663 Uninitialized scalar variable
2024-09-07 20:42:26 +02:00
Marvin Scholz b4e64b86ad lavu/opt: av_opt_set_array: fix uninitialised return
In one failure path for av_opt_set_array, the ret variable
was declared again, shadowing the outer one and writing the
return value to the wrong one and then after the goto returning
the uninitialized one instead.

Introduced in 450a3f58ed

Fixes: CID1619242 Uninitialized scalar variable
2024-09-07 20:39:42 +02:00
Timo Rothenpieler 7e35aeda03 lavu/opt: properly initialize av_opt_set_array return value 2024-09-07 20:21:01 +02:00
Ramiro Polla c0666d8bed swscale/aarch64/rgb2rgb: add neon implementation for rgb24toyv12
A55               A76
rgb24toyv12_16_200_c:     36890.6           17275.5
rgb24toyv12_16_200_neon:  12460.1 ( 2.96x)   5360.8 ( 3.22x)
rgb24toyv12_128_60_c:     83205.1           39884.8
rgb24toyv12_128_60_neon:  27468.4 ( 3.03x)  13552.5 ( 2.94x)
rgb24toyv12_512_16_c:     88111.6           42346.8
rgb24toyv12_512_16_neon:  29126.6 ( 3.03x)  14411.2 ( 2.94x)
rgb24toyv12_1920_4_c:     82068.1           39620.0
rgb24toyv12_1920_4_neon:  27011.6 ( 3.04x)  13492.2 ( 2.94x)
2024-09-06 23:11:13 +02:00
Ramiro Polla caaec2ea95 swscale/x86/rgb2rgb: disable rgb24toyv12_mmxext for x86_64
The mmxext implementation is slower than the C version in x86_64.

                                m32               m64
rgb24toyv12_16_200_c:       24942.7           14812.6
rgb24toyv12_16_200_mmxext:  17857.2 ( 1.40x)  17400.4 ( 0.85x)
rgb24toyv12_128_60_c:       56892.9           35616.9
rgb24toyv12_128_60_mmxext:  40730.9 ( 1.40x)  39610.4 ( 0.90x)
rgb24toyv12_512_16_c:       58402.7           37209.4
rgb24toyv12_512_16_mmxext:  44842.4 ( 1.30x)  41136.2 ( 0.90x)
rgb24toyv12_1920_4_c:       54827.4           34737.4
rgb24toyv12_1920_4_mmxext:  51169.9 ( 1.07x)  34818.9 ( 1.00x)
2024-09-06 23:06:38 +02:00
Ramiro Polla e0cc06184c checkasm/sw_rgb: add rgb24toyv12 tests 2024-09-06 23:06:35 +02:00
Ramiro Polla 3604b2403c swscale/rgb2rgb: improve chroma conversion in ff_rgb24toyv12_c
The current code subsamples by dropping 3/4 pixels to calculate the
chroma components. This commit calculates the average of 4 rgb pixels
before calculating the chroma components, putting it in line with the
mmxext implementation.
2024-09-06 23:06:32 +02:00
Ramiro Polla d8848325a6 swscale/aarch64/rgb2rgb: add deinterleaveBytes neon implementation
A55               A76
deinterleave_bytes_c:             70342.0           34497.5
deinterleave_bytes_neon:          21594.5 ( 3.26x)   5535.2 ( 6.23x)
deinterleave_bytes_aligned_c:     71340.8           34651.2
deinterleave_bytes_aligned_neon:   8616.8 ( 8.28x)   3996.2 ( 8.67x)
2024-09-06 23:05:09 +02:00
Ramiro Polla c08bb33e41 checkasm/sw_rgb: add deinterleaveBytes 2024-09-06 23:05:06 +02:00
Ramiro Polla 4c824ad391 swscale/x86/rgb2rgb: fix deinterleaveBytes writing past the end of the buffers 2024-09-06 23:05:04 +02:00
Ramiro Polla f17a6bd200 swscale/x86/rgb2rgb: fix deinterleaveBytes for unaligned dst pointers 2024-09-06 23:05:01 +02:00
Frank Plowman 6df0c5f9f4 lavc/vvc: Remove experimental flag
This reverts commit 110d8549d5.

I have been working through fixing bugs, particularly crashes I've
found using a fuzzer, in the VVC decoder for the past few months.
While I won't claim it is now bug-free, it is considerably more
resilient than it was and I think in a position to have the
experimental flag removed for release 7.1.

Additionally, most of the Main 10 features of VVC which were missing
version of the decoder released in 7.0 have now been implemented.
This includes the most major missing features: IBC, subpictures and RPR.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-09-06 22:14:52 +08:00
Anton Khirnov eec1a7a6bb lavc/hevc: check framerate num/den to be strictly positive
Rather than just != 0. These values are read as uint32 and can become
negative when cast to int.
2024-09-06 14:09:03 +02:00
Anton Khirnov fc8df81cb1 lavc/hevcdec: move active SPS from HEVCParamSets to HEVCLayerContext
Currently active SPS is a per-layer property.
2024-09-06 13:59:29 +02:00
Anton Khirnov 9bccc634af lavc/hevcdec: make a HEVCFrame hold a reference to its PPS
ff_hevc_get_ref_list() needs the PPS of a previously decoded frame,
which may be different from the currently active one.
2024-09-06 13:59:29 +02:00
Anton Khirnov 672713761b lavc/hevcdec: move HEVCContext.sao_pixel_buffer_[vh] to HEVCLayerContext
Handle them together with other sps-dependent arrays.

Note that current code only allocates these arrays when hwaccel is not
set, but this is wrong as the relevant code runs BEFORE get_format() is
called and hence before we know whether hwaccel is in use.
2024-09-06 13:59:29 +02:00
Anton Khirnov 6fcf0045cf lavc/hevcdec: move HEVCContext.{tab_mvf,rpl_tab}_pool to HEVCLayerContext
pic_arrays_{init,free}() no longer access HEVCContext
2024-09-06 13:59:29 +02:00
Anton Khirnov 4f87ff7666 lavc/hevcdec: move HEVCContext.{horizontal,vertical}_bs to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov e8baf2fb97 lavc/hevcdec: move HEVCContext.qp_y_tab to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov d5188adba8 lavc/hevcdec: move HEVCContext.tab_slice_address to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov eeb369d24f lavc/hevcdec: move HEVCContext.filter_slice_edges to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov 463a85c5a1 lavc/hevcdec: move HEVCContext.is_pcm to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov 0704559932 lavc/hevcdec: move HEVCContext.tab_ipm to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov 59de042cf6 lavc/hevcdec: move HEVCContext.cbf_luma to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov cf7add8d70 lavc/hevcdec: move HEVCContext.tab_ct_depth to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov 1ca4c2a96d lavc/hevcdec: move HEVCContext.skip_flag to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov ed2d25e7f0 lavc/hevcdec: move HEVCContext.deblock to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov 3d4294e344 lavc/hevcdec: move HEVCContext.sao to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov 747609e967 lavc/hevcdec: move HEVCContext.bs_{width,height} to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov c7f0753a6b lavc/hevcdec: move active VPS from HEVCParamSets to HEVCContext
Active VPS is a property of the decoding process, not of the list of
parameter sets.

Check that the VPS can only change in a base layer - while this can
never happen currently (as no other layers can exist in the decoder), it
will become useful when multilayer decoding is supported.
2024-09-06 13:59:29 +02:00
Anton Khirnov 4c0d669b20 lavc/hevcdec: add a per-layer context
Start by moving the DPB to it.

Only one context exists for now, so decoder behaviour should not change
with this commit, but that will change in the future.
2024-09-06 13:59:29 +02:00
Anton Khirnov c35a51f4bb lavc: add HEVC Multiview Main profile 2024-09-06 13:59:28 +02:00
Anton Khirnov 4cbd1a8a54 MAINTAINERS: add myself for hevc/* 2024-09-06 13:59:04 +02:00
Anton Khirnov 4ef149249a lavu/opt: handle UINT options as the POD they are
Fixes operations on array UINT options.
2024-09-06 13:59:04 +02:00
Anton Khirnov 450a3f58ed lavu/opt: add API for setting array-type option values
Previously one could only replace the entire array with a new one
deserialized from a string. The new API allows inserting, replacing, and
removing arbitrary element ranges.
2024-09-06 13:59:04 +02:00
James Almer 2a6f84718b fate/checkasm/sw_gbrp: don't randomly set internal values
They are set by sws_init_context().
May help with signed integer overflows reported by gcc-usan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-05 22:19:47 -03:00
James Almer a49188297f avfilter/af_bs2b: remove unecessary initializer from layouts
Fixes compilation with msvc.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-05 12:36:04 -03:00
James Almer d98de855a8 avfilter/af_asr: remove unecessary initializer from layouts
Fixes compilation with msvc.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-05 12:36:04 -03:00
James Almer ef6a5c98fb avfilter/af_apulsator: remove unecessary initializer from layouts
Fixes compilation with msvc.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-05 12:35:58 -03:00
Gyan Doshi 3d0d0f68d5 doc/filters: update uspp availability status
The filter was disabled in 95054bfa48 and re-enabled in 771c27119d
2024-09-05 15:47:14 +05:30
Anton Khirnov f0f1cf2697 lavfi/af_channelmap: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov 3045949945 lavfi/af_bs2b: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov 96a8a6139e lavfi/af_biquads: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov 2e899d3bdf lavfi/af_asr: convert to query_func2()
Also, simplify code.
2024-09-05 10:03:33 +02:00
Anton Khirnov cf43a02c2c lavfi/af_asetrate: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov b18f7d7e2d lavfi/af_arnndn: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov dfaa339167 lavfi/af_arls: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov 814c961a78 lavfi/af_aresample: convert to query_func2() 2024-09-05 10:03:33 +02:00
Anton Khirnov c24e0df30b lavfi/af_apulsator: convert to query_func2()
Also, simplify code, and drop a redundant call that also happens
implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov 6f2adb7967 lavfi/af_anlms: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov e0ab1fcc8c lavfi/af_anequalizer: convert to query_func2()
Also, simplify code and drop redundant calls that also happen implicitly
in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov 6e4affc407 lavfi/af_aiir: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov f143723095 lavfi/af_agate: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-05 10:03:33 +02:00
Rémi Denis-Courmont d9f594209f checkasm/riscv: print official extension names 2024-09-04 22:04:11 +03:00
Rémi Denis-Courmont 27d28b68da swscale/rgb2rgb: enable R-V V deinterleaveBytes
T-Head C908:
deinterleave_bytes_c:                               100328.3 ( 1.00x)
deinterleave_bytes_rvv_i32:                          19331.3 ( 5.19x)
deinterleave_bytes_aligned_c:                       100337.5 ( 1.00x)
deinterleave_bytes_aligned_rvv_i32:                  15748.0 ( 6.37x)

SpacemiT X60:
deinterleave_bytes_c:                                95230.6 ( 1.00x)
deinterleave_bytes_rvv_i32:                           9790.3 ( 9.73x)
deinterleave_bytes_aligned_c:                        96564.1 ( 1.00x)
deinterleave_bytes_aligned_rvv_i32:                   7780.1 (12.41x)
2024-09-04 22:04:11 +03:00
Hendrik Leppkes d4cfbf329c hevc/sei: return INVALIDDATA when a referenced SPS is not available
The code previously returned ENOMEM, despite this not being an
allocation problem, but rather a bitstream problem referring to data not
currently available.

Fixes playback of such streams, as it allows further processing of NAL
units after skipping the broken SEI NAL.
2024-09-04 18:34:47 +02:00
Araz Iusubov eda3fc6053 avcodec/amfenc: GPU driver version check
Implemented gpu driver check.
10-bit patch works incorrectly on driver version lower than 23.30.
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-09-04 13:18:41 +02:00
Evgeny Pavlov 9f02408583 avcodec/amfenc: add 10 bit encoding in av1_amf
v2: refactored after review

Signed-off-by: Evgeny Pavlov <lucenticus@gmail.com>
Co-authored-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
Co-authored-by: Araz Iusubov <Primeadvice@gmail.com>
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-09-04 13:18:28 +02:00
nyanmisaka 628762034d avcodec/amfenc: HDR metadata.
v2: fixes for indentation
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-09-04 13:18:18 +02:00
Michael Fabian 'Xaymar' Dirks fb4dd4b6f4 avcodec/amfenc: Fixes the color information in the output.
added 10 bit support for amf hevc.

before:

command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file.mkv -an -c:v h264_amf res.dx11_hw_h264.mkv
output -  Format of input frames context (p010le) is not supported by AMF.
command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v hevc_amf res.dx11_hw_hevc.mkv
output -  Format of input frames context (p010le) is not supported by AMF.

after:

command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v h264_amf res.dx11_hw_h264.mkv
output -  10-bit input video is not supported by AMF H264 encoder
command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v hevc_amf res.dx11_hw_hevc.mkv
output -  10bit file

v2 - lost line returned in ff_amf_pix_fmts
v3 - fixes after review
v4 - extract duplicated code, fix incorrect processing of 10-bit input for h264
v5 - non-functional changes after review

Co-authored-by: Evgeny Pavlov <lucenticus@gmail.com>
Co-authored-by: Araz Iusubov <Primeadvice@gmail.com>
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-09-04 13:18:09 +02:00
Nicolas Gaullier ee9ae4e8ba fftools/ffmpeg: Fix honor -r output option with streamcopy
Fix "ost->st->avg_frame_rate = ost->frame_rate" in streamcopy_init()
being reset to input's frame rate a few lines below.
Note that in current code, there are some discrepancies amongst the
muxers. For example, avienc relies on time_base, so it is not affected
by this patch, whereas mxfenc and matroskaenc do use avg_frame_rate,
so this patch fixes -r being honored.

In the updated fate test, the input is (wrongly) probed as 50fps. With
this patch, the correct value (25fps) is successfully forced with -r.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-04 13:01:37 +02:00
Nicolas Gaullier c14573a4d2 tests: Remove void -time_base overrides when streamcopying to mxf
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-04 13:01:37 +02:00
Nicolas Gaullier 59d2900df7 avformat/mxfenc: Fix guess frame_rate
The time_base was a bad guess.

Currently, fate-time_base test data assumed that overriding the input
time_base would affect the frame_rate, but this behaviour is not
documented, so just fix the fate data now that this is fixed.

Fix regression since 10185e2d4c:
previously, when streamcopying, the time_base was guessed from the
frame_rate considering it is often constant, so guessing the frame_rate
back from the time_base was often not a problem.

To reproduce:
ffmpeg -i fate-suite/mpeg2/dvd_still_frame.vob -an -c copy out.mxf

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-04 13:01:37 +02:00
Fei Wang 0b6d7cd9d9 lavc/qsvenc: Remove duplicate include header file
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-04 12:14:58 +08:00
Fei Wang 36396aff69 doc/av1_qsv: Add missed options
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-04 12:14:57 +08:00
Fei Wang 395d703c91 doc/av1_qsv: Fix typo
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-04 12:14:57 +08:00
Ramiro Polla 3f9b78bd19 avcodec/dnxhdenc: use BlockDSPContext from MpegEncContext
MpegEncContext already has a BlockDSPContext, so we don't need another
one for DNXHDEncContext (which has an MpegEncContext).
2024-09-03 17:47:37 +02:00
Ramiro Polla 4f7aeffd8c avcodec/mpegvideo: remove redundant workaround to recalculate last nonzero coefficient
The x86 optimized dct_quantize only calculates the last nonzero
coefficient correctly if the zigzag scan order is used. For the
alternate scan order, this value is incorrect.

To work around this, the dct_unquantize functions process the entire
block if the alternate scan order is used.

But a second workaround (bb198e198a) was added that recalculates the
last nonzero coefficient after dct_quantize is called if the alternate
scan order is used.

This commit removes the first workaround, which became redundant.
2024-09-03 17:14:24 +02:00
Ramiro Polla b6f7271fa9 avcodec/x86/mpegvideoenc: remove av_assert2() for variable alignment
It's safe to assume that LOCAL_ALIGNED_16 does indeed align. Otherwise
we would have many more problems...

This assert was added in f8188626 all the way back in 2003.
2024-09-03 17:06:19 +02:00
Nuo Mi 3d2fafa229 avcodec/vvcdec: fix potential deadlock in report_frame_progress
Fixes:
https://fate.ffmpeg.org/report.cgi?slot=x86_64-archlinux-gcc-tsan&time=20240823175808

Reproduction steps:
./configure --enable-memory-poisoning --toolchain=gcc-tsan --disable-stripping && make fate-vvc

Root cause:
We hold the current frame's lock while updating progress for other frames,
which also requires acquiring other frame locks. This could potentially lead to a deadlock.
However, I don't think this will happen in practice because progress updates are one-way, with no cyclic dependencies.
But we need this patch to make FATE happy.
2024-09-03 21:32:27 +08:00
Frank Plowman 54291f4383 lavc/vvc: Fix assertion bound on qPy_{a,b}
Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-09-03 20:57:52 +08:00
Fei Wang ae9cf903e8 cbs_av1: Copy loop filter and segment parameters of repeat frame from its mapped frame
Implement load/save loop filter and segment parameters defined in
section 7.20 and 7.21 in spec for show_existing_frame frames.

Fixes ticket #11151.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-03 14:03:40 +08:00
Marton Balint a87a96105e avformat/libzmq: fix check for zmq protocol prefix
Fixes ticket #11134.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-09-02 22:51:17 +02:00
Marton Balint 90f68f7b2d avformat/mxfdec: disallow generic seek search
If the demuxer does not provide per-stream indexes, the generic seek search can
attempt to read the whole media file from the beginning when seeking. For large
MXF files this can cause huge lockups for a seek after the last timestamp,
which will eventually fail. So let's disable the generic seek for mxf, the
demuxer's own seek code should handle seeking just fine.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-09-02 22:50:52 +02:00
Stefano Mandelli 24eff5b547 avformat/rtsp: extend the PATH buffer to 2048
Recently, I have been experiencing an increasing number of user that use ffmpeg
to retrive RTSP stream from personal mediaproxies (e.g. MediaMtx) with
authorization based on JWT. The current length of PATH does not permit to
insert the token in the URL failing the authorization with no possibilities to
get the video.

VLC has just modified the RSTP max URL length, and it permits to use token
inside the URL.

For these reasons, I propose this patch to extend the PATH buffer from 1024 to
2048 in order to use tokens and the authorization process based on JWT.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-09-02 22:50:52 +02:00
Anton Khirnov 3f9ca51015 lavc/opus*: move to opus/ subdir 2024-09-02 11:56:53 +02:00
Anton Khirnov c3fb696311 lavfi/af_aformat: convert to query_func2() 2024-09-02 11:55:22 +02:00
Anton Khirnov 8bc419aeb4 lavfi/af_aformat: change options from strings to arrays
Allows to drop custom parsing code, and also the assumption that
query_formats() is not called more than once.
2024-09-02 11:55:22 +02:00
Anton Khirnov dc488d832c lavfi/af_afir: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-02 11:55:22 +02:00
Anton Khirnov 584be51334 lavfi/af_adynamicequalizer: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-02 11:55:22 +02:00
Anton Khirnov 079834e645 lavfi/af_acrossover: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-02 11:55:22 +02:00
Anton Khirnov edf53e15b4 lavfi/af_aap: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-02 11:55:22 +02:00
Anton Khirnov 0f004a0416 lavfi/aeval: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-02 11:55:22 +02:00
Anton Khirnov eddffbedb3 lavfi: add query_func2()
It differs from query_func() in accepting arrays of input/output format
configurations to be filled as callback parameters. This allows to mark
the filter context as const, ensuring it is not modified by this
function, as it is not supposed to have any side effects beyond
returning the supported formats.
2024-09-02 11:55:20 +02:00
James Almer 01f2d95fbf x86/h264_weight: don't do arithmetic right shift of a 32bit values in 64bit registers
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-01 15:43:18 -03:00
Ramiro Polla 00b64fca55 configure: improve check for POSIX ioctl
Instead of relying on system #ifdefs which may or may not be correct,
detect the POSIX ioctl signature at configure time.
2024-09-01 18:01:43 +02:00
Ramiro Polla 6aafe61285 avcodec/mpegvideoencdsp: convert stride parameters from int to ptrdiff_t 2024-09-01 13:42:30 +02:00
Dale Curtis 7753a9d627 lavc: Check codec_whitelist early in avcodec_open2()
This ensures that if a codec isn't on codec_whitelist, trying to open it
will not trigger ff_codec_close(), which could invalidate useful
information still present in the context.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-01 12:42:20 +02:00
Matthieu Bouron 0a780d3076 avcodec: add Mediacodec audio decoders support
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2024-09-01 12:25:56 +02:00
Rémi Denis-Courmont 7d1dda4892 lavc/h264dsp: R-V V loop_filter_chroma
T-Head C908:
h264_v_loop_filter_chroma_8bpp_c:      137.4
h264_v_loop_filter_chroma_8bpp_rvv_i32: 54.2
2024-09-01 10:58:48 +03:00
Rémi Denis-Courmont 3a53656837 lavc/h264dsp: do not write back unmodified rows in R-V V loop filter 2024-09-01 10:52:26 +03:00
Gyan Doshi b5daaa1503 avfilter/formats: correct error message
The check is for color space, not range.
2024-09-01 10:10:16 +05:30
James Almer a4228a0ac1 avformat/iamf_parser: use ffio_read_size() where useful
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 23:44:13 -03:00
Marvin Scholz b6a0eab528 avformat/iamf_parse: Fix return of uninitialized value
The ret value here is not yet intialized so the return would return
uninitialized data. What was probably meant to be checked here was the
return value of ffio_read_size, which can return an error.

Introduced in 38bcb3ba7b

Fixes: CID1618758
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 21:21:39 -03:00
Michael Niedermayer 8a2c401625 MAINTAINERS: Add webpage link to our mailing list page
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:10:57 +02:00
Michael Niedermayer e5f4c6d7b5 MAINTAINERS: Add 2 git repositories
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:10:57 +02:00
Michael Niedermayer 880ef64c12 MAINTAINERS: Add T field based on the linux kernel MAINTAINERs
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

This allows specifying a git repository for an area

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:10:36 +02:00
Michael Niedermayer 01af5a473a MAINTAINERS: Add a profile entry for fate
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:08:28 +02:00
Michael Niedermayer eabd7e7142 MAINTAINERS: Add P field based on the linux kernel MAINTAINERs
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

This allows specifying more details than what fits on a single line

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:08:28 +02:00
Michael Niedermayer bb870a7fcf MAINTAINERS: Add B field based on the linux kernel MAINTAINERs
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

This allows specifying a bug tracker. It would allow a maintainer to
use gitlab, github, or something else to keep track of bugs

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:08:26 +02:00
Michael Niedermayer e1baf45b12 MAINTAINERS: Add some webpages to some areas
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:07:58 +02:00
Michael Niedermayer 02090abf74 MAINTAINERS: Add W field based on the linux kernel MAINTAINERs
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

This allows specifying a webpage for an area

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:07:36 +02:00
Michael Niedermayer 604f5ad0ba MAINTAINERS: Add some Mail aliases / mailing lists (aka how to contact the specific maintainers)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 20:26:45 +02:00
Michael Niedermayer a0b487c0e3 MAINTAINERS: Add L field based on the linux kernel MAINTAINERs
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

This allows specifying a more specific mailing list, if a specific area has
such a list.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 20:26:34 +02:00
James Almer fa5d3cc653 avformat/iamf_parse: use get_bits_long() to read the remaining AAC extradata bits
The output of put_bits_left() here can be as big as 27, which is a bit
count not supported by get_bits().

Fixes fate-iamf-stereo-demux when using --assert-level=2

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 14:51:32 -03:00
James Almer 9c0e0c0b3f fate/iamf: add a demuxing test for a stereo AAC IAMF sample
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 11:22:08 -03:00
James Almer 38bcb3ba7b avformat/iamf_parse: fix parsing AAC DecoderConfigDescriptor
Use ff_mp4_read_descr() to read both the tags and the vlc value
that comes after it, which was not being taken into account.

Ref: https://github.com/AOMediaCodec/libiamf/issues/119

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 11:11:42 -03:00
James Almer 9d095f127a avformat/isom: make parameters used for loging a pointer to void
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 11:11:42 -03:00
Zhao Zhili 4c0372281b aarch64/vvc: Bind h26x/sao filter implementation to vvc
Reviewed-by: Martin Storsjö <martin@martin.st>
2024-08-31 16:07:50 +08:00
Zhao Zhili 8cc10298a7 aarch64/hevc: Move sao to h26x directory
So vvc can reuse the implementation.

Reviewed-by: Martin Storsjö <martin@martin.st>
2024-08-31 16:07:43 +08:00
Frank Plowman 93281630a7 lavc/vvc: Validate explicit subpic locations
Implement the missing requirements from H.266 (V3) p. 106 on the
position and size of subpictures whose dimensions are provided
explicitly.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-08-31 15:06:39 +08:00
Frank Plowman 01701bdcd5 lavc/vvc: Prevent OOB access in subpic_tiles
The previous logic relied on the subpicture boundaries coinciding with
the tile boundaries.  Per 6.3.1 of H.266 (V3), vertical subpicture
boundaries are always tile boundaries however the same cannot be said
for horizontal subpicture boundaries.  Furthermore, it is possible to
construct an illegal bitstream where vertical subpicture boundaries are
not coincident with tile boundaries.  In these cases, the condition of
the while loop would never be satisfied resulting in an OOB read on
col_bd/row_bd.

Patch fixes this issue by replacing != with <, thereby not requiring
subpicture boundaries and tile boundaries to be coincident.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-08-31 15:05:23 +08:00
Nuo Mi b2eabe0ff2 avcodec/vvcdec: format, fix indent for vvc_deblock_bs 2024-08-31 14:16:19 +08:00
Nuo Mi 7bd22342c3 avcodec/vvcdec: filter, fix uninitialized variables for YUV400 format
fix
==135000== Conditional jump or move depends on uninitialised value(s)
==135000==    at 0x169FF95: vvc_deblock_bs (filter.c:699)
and
==135000== Conditional jump or move depends on uninitialised value(s)
==135000==    at 0x16A2E72: ff_vvc_alf_filter (filter.c:1217)

Reported-by: James Almer <jamrial@gmail.com>
2024-08-31 14:16:19 +08:00
Nuo Mi 7175544c0b checkasm: add vvc_bdof test
apply_bdof_8_8x16_c: 5776.5
apply_bdof_8_8x16_avx2: 396.2
apply_bdof_8_16x8_c: 5722.0
apply_bdof_8_16x8_avx2: 216.0
apply_bdof_8_16x16_c: 11213.2
apply_bdof_8_16x16_avx2: 434.5
apply_bdof_10_8x16_c: 5657.7
apply_bdof_10_8x16_avx2: 1096.0
apply_bdof_10_16x8_c: 5531.7
apply_bdof_10_16x8_avx2: 212.5
apply_bdof_10_16x16_c: 11043.7
apply_bdof_10_16x16_avx2: 1252.7
apply_bdof_12_8x16_c: 5680.0
apply_bdof_12_8x16_avx2: 1096.5
apply_bdof_12_16x8_c: 5646.2
apply_bdof_12_16x8_avx2: 624.5
apply_bdof_12_16x16_c: 11076.0
apply_bdof_12_16x16_avx2: 1241.5
2024-08-31 14:08:54 +08:00
Nuo Mi 15eb10c6de x86/vvcdec: inter, add optical flow avx2 code
BDoF used about 10%–25% of the CPU for some clips.
Here are the FPS for one run; please ignore the negative values, as they may be due to round-to-round variation

clips                                       | before | after | delta
--------------------------------------------|--------|-------|------
RitualDance_1920x1080_60_10_420_37_RA.266   | 310.0  | 363.0 | 14.60%
NovosobornayaSquare_1920x1080.bin           | 322.3  | 339.7 |  5.12%
Tango2_3840x2160_60_10_420_27_LD.266        |  71.0  | 68.7  | -3.35%
RitualDance_1920x1080_60_10_420_32_LD.266   | 250.0  | 245.3 | -1.92%
Chimera_8bit_1080P_1000_frames.vvc          | 359.3  | 422.7 | 15.00%
BQTerrace_1920x1080_60_10_420_22_RA.vvc     | 142.3  | 147.7 |  3.66%

Reviewed-by: James Almer <jamrial@gmail.com>
2024-08-31 14:06:19 +08:00
Nuo Mi f851abb4b3 avcodec/vvcdec: bdof, do not pad sources and gradients to simplify the code 2024-08-31 13:57:51 +08:00
Nuo Mi 8347def797 avcodec/vvcdec: misc, rename BDOF_BLOCK_SIZE to BDOF_MIN_BLOCK_SIZE 2024-08-31 13:57:51 +08:00
Michael Niedermayer b730defd52 avcodec/msmpeg4dec: init dc_pred_dir
Its not really used but its passed as a argument and then not used
Fixes: 70965/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSMPEG4V1_fuzzer-5583223747313664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 17:38:30 +02:00
Michael Niedermayer 4e39795c75 avformat/mvdec: Check if name was fully read
Fixes: use of uninitialized value
Fixes: 70901/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-6341913949569024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 17:38:28 +02:00
Michael Niedermayer 5338707930 avcodec/wmavoice: Do not use uninitialized pitch[0]
Fixes: use of uninitialized value
Fixes: 70850/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-4806127362048000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 17:38:24 +02:00
Michael Niedermayer 53066e8cc2 MAINTAINERS: some random updating
Adding level to some of my entries
Adding level to some random entries of other people who i have seen actively maintaining their code
removing some people who have not been active where others where active

For most we will need to contact people and ask if they are still available as maintainers
(but for cases where patches are ignored for many months even with pings sent to the maintainer
 entries should be set to unmaintained)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:56 +02:00
Michael Niedermayer 337e7949da MAINTAINERS: Add a maintaince level field
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:56 +02:00
Michael Niedermayer 815d008681 avformat/argo_brp: Check that ASF chunk header is completely read
Fixes: Use of uninitialized value
Fixes: 71280/clusterfuzz-testcase-minimized-ffmpeg_dem_ARGO_BRP_fuzzer-4692991866896384

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:56 +02:00
Michael Niedermayer 46e3bc2ebd tools/target_swr_fuzzer: Check av_samples_fill_arrays() for failure
Fixes: use of uninitialized value
Fixes: 71242/clusterfuzz-testcase-minimized-ffmpeg_SWR_fuzzer-4905557943713792

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:55 +02:00
Michael Niedermayer b9c7f50c7d avcodec/notchlc: Check bytes left before reading
Fixes: Use of uninitialized value
Fixes: 71230/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NOTCHLC_fuzzer-4624502095413248

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:55 +02:00
Michael Niedermayer 01910ca603 avcodec/vc1_block: propagate error codes
Fixes: use of uninitialized value
Fixes: 71228/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-6188476880453632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:55 +02:00
Michael Niedermayer 796ff2d599 avformat/apetag: Check APETAGEX
Fixes: Use of uninitialized value
Fixes: 71074/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5697034877730816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:54 +02:00
Michael Niedermayer b08776e3ae avcodec/magicyuvenc: better slice height
Fixes: Use of uninitialized value
Fixes: 71072/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MAGICYUV_fuzzer-4835252046987264

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:54 +02:00
J. Dekker e758b24396 checkasm: add wildcompares for test & functions
Added:

  --test=<pattern>    Filter tests by glob style pattern.
  --bench[=<pattern>] Run benchmark and optionally filter functions
                      by glob style pattern.

Example:

$ ./tests/checkasm/checkasm --bench=yuva*
[...]
yuva420p_bgr24_8_c:                                     34.5 ( 1.00x)
yuva420p_bgr24_8_ssse3:                                 31.1 ( 1.11x)
yuva420p_bgr24_128_c:                                  310.6 ( 1.00x)
yuva420p_bgr24_128_ssse3:                              178.1 ( 1.74x)
yuva420p_bgr24_1080_c:                                2509.6 ( 1.00x)
yuva420p_bgr24_1080_ssse3:                            1471.5 ( 1.71x)
yuva420p_bgr24_1920_c:                                4462.6 ( 1.00x)
yuva420p_bgr24_1920_ssse3:                            2331.1 ( 1.91x)
[...]

Ported from dav1d.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-08-28 11:45:46 +02:00
J. Dekker d0986709a8 checkasm: improve print format
Port dav1d's checkasm output format to FFmpeg's checkasm, includes
relative speedups and aligns results.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-08-28 11:45:46 +02:00
J. Dekker 03f26549cd checkasm: print only results to stdout
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-08-28 11:45:46 +02:00
J. Dekker 42528ff835 checkasm: add csv/tsv bench output
When collecting performance information from checkasm it is common
to parse the output for use in graphs to compare vs different
architectures.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-08-28 11:45:46 +02:00
Anton Khirnov d89930f866 lavu/opt: add API for retrieving array-type option values
Previously one could only convert the entire array to a string, not
access individual elements.
2024-08-27 16:53:16 +02:00
Anton Khirnov 4a5bb84515 lavu/opt: forward av_opt_get_video_rate() to av_opt_get_q()
The two functions are exactly the same.
2024-08-27 16:53:16 +02:00
Anton Khirnov efe38286d1 lavu/opt: document underlying C types for enum AVOptionType 2024-08-27 16:53:16 +02:00
Ramiro Polla 7e4784e40c avcodec/mpegvideoencdsp: speed up draw_edges_8_c by inlining it for all used edge widths
This commit also restricts w to 4, 8, or 16.

Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz:
                                    before    after
draw_edges_8_1724_4_c:             46796.5   7141.7  ( 6.55x)
draw_edges_8_1724_8_c:             43584.5   7216.5  ( 6.04x)
draw_edges_8_1724_16_c:            47007.2  10080.5  ( 4.66x)
draw_edges_128_407_4_c:            11199.0   4185.0  ( 2.68x)
draw_edges_128_407_8_c:            10660.2   4418.0  ( 2.41x)
draw_edges_128_407_16_c:           11800.2   4634.5  ( 2.55x)
draw_edges_1080_31_4_c:             1356.5    634.7  ( 2.14x)
draw_edges_1080_31_8_c:             1972.0   1430.2  ( 1.38x)
draw_edges_1080_31_16_c:            4621.0   4009.7  ( 1.15x)
draw_edges_1920_4_4_c:               834.5    795.2  ( 1.05x)
draw_edges_1920_4_4_negstride_c:     821.7    802.0  ( 1.02x)
draw_edges_1920_4_8_c:              2782.2   2650.7  ( 1.05x)
draw_edges_1920_4_8_negstride_c:    2724.7   2670.0  ( 1.02x)
draw_edges_1920_4_16_c:             6437.5   6327.7  ( 1.02x)
draw_edges_1920_4_16_negstride_c:   6395.2   6349.5  ( 1.01x)

A55:
                                    before    after
draw_edges_8_1724_4_c:             52540.4  19739.2  ( 2.66x)
draw_edges_8_1724_8_c:             45386.9  19847.4  ( 2.29x)
draw_edges_8_1724_16_c:            51995.4  23284.7  ( 2.23x)
draw_edges_128_407_4_c:            13401.1   6988.2  ( 1.92x)
draw_edges_128_407_8_c:            12218.4   7527.9  ( 1.62x)
draw_edges_128_407_16_c:           13695.9   8207.2  ( 1.67x)
draw_edges_1080_31_4_c:             3702.9   3110.4  ( 1.19x)
draw_edges_1080_31_8_c:             6015.6   5643.2  ( 1.07x)
draw_edges_1080_31_16_c:           12281.9  11901.4  ( 1.03x)
draw_edges_1920_4_4_c:              3957.9   3970.2  ( 1.00x)
draw_edges_1920_4_4_negstride_c:    3964.1   3825.2  ( 1.04x)
draw_edges_1920_4_8_c:              7757.9   7676.4  ( 1.01x)
draw_edges_1920_4_8_negstride_c:    7923.6   7812.4  ( 1.01x)
draw_edges_1920_4_16_c:            14791.6  15143.9  ( 0.98x)
draw_edges_1920_4_16_negstride_c:  14788.6  15163.4  ( 0.98x)

A76:
                                    before   after
draw_edges_8_1724_4_c:             39786.0  4968.5  ( 8.01x)
draw_edges_8_1724_8_c:             32971.5  5069.5  ( 6.50x)
draw_edges_8_1724_16_c:            40056.0  6017.2  ( 6.66x)
draw_edges_128_407_4_c:             9517.2  1210.5  ( 7.86x)
draw_edges_128_407_8_c:             8035.7  1346.2  ( 5.97x)
draw_edges_128_407_16_c:            9946.5  1648.2  ( 6.03x)
draw_edges_1080_31_4_c:             1308.0   660.7  ( 1.98x)
draw_edges_1080_31_8_c:             1785.5  1270.7  ( 1.41x)
draw_edges_1080_31_16_c:            3266.7  2591.5  ( 1.26x)
draw_edges_1920_4_4_c:              1151.0  1090.7  ( 1.06x)
draw_edges_1920_4_4_negstride_c:    1153.7  1096.5  ( 1.05x)
draw_edges_1920_4_8_c:              2220.7  2186.5  ( 1.02x)
draw_edges_1920_4_8_negstride_c:    2218.5  2193.5  ( 1.01x)
draw_edges_1920_4_16_c:             4324.2  4230.0  ( 1.02x)
draw_edges_1920_4_16_negstride_c:   4310.7  4233.0  ( 1.02x)
2024-08-26 12:50:26 +02:00
Ramiro Polla 3bfce2a104 avcodec/x86/mpegvideoencdsp: speed up draw_edges_mmx by using memcpy()
The mmx memory copy code is not nearly as efficient as memcpy(), which
would make draw_edges_mmx much slower than draw_edges_8_c.

Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz:
                                      before    after
draw_edges_8_1724_4_mmx:              8700.5   8751.8  ( 0.99x)
draw_edges_8_1724_8_mmx:             10441.7  10558.0  ( 0.99x)
draw_edges_8_1724_16_mmx:            10660.7  10799.5  ( 0.99x)
draw_edges_128_407_4_mmx:             4202.2   4099.3  ( 1.03x)
draw_edges_128_407_8_mmx:             4579.0   4511.3  ( 1.02x)
draw_edges_128_407_16_mmx:            5479.7   4729.5  ( 1.16x)
draw_edges_1080_31_4_mmx:             1546.7    658.0  ( 2.35x)
draw_edges_1080_31_8_mmx:             2745.5   1442.5  ( 1.90x)
draw_edges_1080_31_16_mmx:           12511.5   4901.0  ( 2.55x)
draw_edges_1920_4_4_mmx:              2659.0    705.0  ( 3.77x)
draw_edges_1920_4_4_negstride_mmx:    2643.0    729.0  ( 3.63x)
draw_edges_1920_4_8_mmx:              7845.0   2819.0  ( 2.78x)
draw_edges_1920_4_8_negstride_mmx:    7777.0   2747.3  ( 2.83x)
draw_edges_1920_4_16_mmx:            24583.7   6358.3  ( 3.87x)
draw_edges_1920_4_16_negstride_mmx:  24589.0   6367.0  ( 3.86x)
2024-08-26 12:50:21 +02:00
Ramiro Polla 9cdcbb639a avcodec/x86/mpegvideoencdsp: fix comment for draw_edges_mmx
Not only w == 8 and w == 16 are supported, but also w == 4.
2024-08-26 12:49:24 +02:00
Ramiro Polla 8c203ea7c7 avcodec/aarch64/mpegvideoencdsp: add dotprod implementation for pix_norm1
A55             A76
pix_norm1_c:        484.3           235.2
pix_norm1_neon:     193.8 ( 2.50x)   44.7 ( 5.26x)
pix_norm1_dotprod:   91.8 ( 5.28x)   21.2 (11.09x)
2024-08-26 12:49:04 +02:00
Ramiro Polla 9f68a3712e avcodec/aarch64/mpegvideoencdsp: add neon implementations for pix_sum and pix_norm1
A55             A76
pix_norm1_c:     478.2           234.2
pix_norm1_neon:  188.2 ( 2.54x)   41.2 ( 5.68x)
pix_sum_c:       304.2           244.0
pix_sum_neon:     77.2 ( 3.94x)   21.5 (11.35x)
2024-08-26 12:48:31 +02:00
Ramiro Polla 834964ce1a checkasm/mpegvideoencdsp: add pix_sum, pix_norm1, and draw_edges 2024-08-26 12:48:09 +02:00
Ramiro Polla f9074427db avcodec/x86/mpegvideoencdsp: support negative strides in draw_edges_mmx() 2024-08-26 12:44:02 +02:00
Ramiro Polla 98610fe95f fate/checkasm: run the sw_yuv2yuv test 2024-08-26 12:16:40 +02:00
Zhao Zhili 12cdb30e37 avcodec/videotoolboxenc: Fix leaking of supported_props
There are two VTCompressionSessionRef been created, one for generating
extradata, and another for normal encoding. supported_props was been
overwritten without release.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-26 17:09:46 +08:00
Ramiro Polla 420d443600 swscale/aarch64: cosmetics fix (spaces inside curly braces) 2024-08-26 11:07:49 +02:00
Ramiro Polla 52887683e9 swscale/aarch64: add nv24/nv42 to yuv420p unscaled converter
A55               A76
nv24_yuv420p_128_c:       4956.1            1267.0
nv24_yuv420p_128_neon:    3109.1 ( 1.59x)    640.0 ( 1.98x)
nv24_yuv420p_1920_c:     35728.4           11736.2
nv24_yuv420p_1920_neon:   8011.1 ( 4.46x)   2436.0 ( 4.82x)
nv42_yuv420p_128_c:       4956.4            1270.5
nv42_yuv420p_128_neon:    3074.6 ( 1.61x)    639.5 ( 1.99x)
nv42_yuv420p_1920_c:     35685.9           11732.5
nv42_yuv420p_1920_neon:   7995.1 ( 4.46x)   2437.2 ( 4.81x)
2024-08-26 11:04:46 +02:00
Ramiro Polla 88a563ad18 swscale: export ff_copyPlane so it may be used by simd code 2024-08-26 11:04:46 +02:00
Ramiro Polla a2e01cade8 checkasm/yuv2yuv: add tests for semiplanar unscaled converters 2024-08-26 11:04:46 +02:00
Ramiro Polla 4eb5594295 swscale: add nv24/nv42 to yuv420p unscaled converter 2024-08-26 11:04:46 +02:00
Zhao Zhili aa14f9fe63 avcodec/mediacodecdec: Skip dequeue buffer in draining state
There is no more packet to queue in draining state.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-26 16:59:07 +08:00
Zhao Zhili 2e370805da avfilter/unsharp: Merge header into .c
It was shared with opencl implementation.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-26 16:58:25 +08:00
Stefan Oltmanns d42cd5b75b avformat/vapoursynth: load library at runtime
Signed-off-by: Stefan Oltmanns <stefan-oltmanns@gmx.net>
2024-08-26 10:30:52 +02:00
Stefan Oltmanns eac611f1a4 avformat/vapoursynth: Update to API version 4
Signed-off-by: Stefan Oltmanns <stefan-oltmanns@gmx.net>
2024-08-26 10:30:50 +02:00
Ramiro Polla abb4e13a0a avutil/aarch64: add AV_COPY128 and AV_ZERO128 macros 2024-08-26 10:26:59 +02:00
Zhao Zhili 40dda881d6 avcodec/filter_units: Fix extradata and packets can have different bitstream format
Filter init can change extradata from avcc/hvcc to annexb format.
With different passthrough logic, packets can still in avcc/hvcc
format. Use same passthrough logic for init and filter.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-24 00:27:15 +08:00
Zhao Zhili 523189c744 fftools/ffplay: handle flip in display matrix
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-24 00:26:59 +08:00
Gnattu OC 30f090b4f8 avfilter: inherit input color range for videotoolbox filters
The color range should be set to match the input when creating
the VideoToolbox context. Otherwise, the new context will default
to limited range, creates inconsistencies with full range inputs.

Signed-off-by: Gnattu OC <gnattuoc@me.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-24 00:24:06 +08:00
Martin Storsjö cfe0a36352 libswscale: aarch64: Fix the indentation of some macro invocations
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-22 14:40:30 +03:00
James Almer 9d15fe77e3 avcodec/container_fifo: add missing stddef.h include
Fixes make checkheaders

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-21 15:12:46 -03:00
James Almer a754ee0844 avcodec/h2645_parse: replace three bool arguments in ff_h2645_packet_split with a single flags one
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-19 20:23:20 -03:00
James Almer 8060644237 avcodec/shorten: Fix discard of ‘const’ qualifier
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-19 17:40:00 -03:00
Martin Storsjö 507c2a5774 libswscale: arm: Don't assume aligned output in yuv2rgb functions
This fixes failures in recently added checkasm tests.

While the buffers in most cases are aligned, libswscale in general
can't assume the output to be aligned.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-19 23:04:52 +03:00
Anton Khirnov 52471b56ba lavfi: make FFFilterContext private to generic code
Nothing in it needs to be visible to filters.
2024-08-19 21:48:11 +02:00
Anton Khirnov f19c988911 lavfi/filters: move functions only used by generic code to avfilter_internal.h 2024-08-19 21:48:11 +02:00
Anton Khirnov 6d75d44d90 lavfi: drop internal.h
All that remains in it are things that belong in avfilter_internal.h.

Move them there and remove internal.h
2024-08-19 21:48:04 +02:00
Anton Khirnov 90e4af65e1 lavfi/f_streamselect: remove a no-op ff_filter_config_links() call
It does not do anything when the links are already configured.
2024-08-19 21:45:25 +02:00
Anton Khirnov a2314308f2 lavfi/inernal: move ff_fmt_is_regular_yuv() declaration to video.h 2024-08-19 21:45:25 +02:00
Anton Khirnov a83a30e899 lavfi: move ff_parse_{sample_rate,channel_layout}() to audio.[ch]
That is a more appropriate place for those functions.
2024-08-19 21:45:25 +02:00
Anton Khirnov f4bfdf7893 lavfi: move ff_parse_pixel_format() to vf_format, its only caller
The only thing this function does beyond calling av_get_pix_fmt() is
falling back onto parsing the argument as a number. No other filters
should need to do this.
2024-08-19 21:45:25 +02:00
Anton Khirnov 1afe42852b lavfi/internal: move functions used by filters to filters.h
internal.h currently mixes interfaces intended to be used by filters
with those that should be limited to generic filter- or graph-level
code.
2024-08-19 21:45:25 +02:00
Rémi Denis-Courmont d8fb44c0aa lavc/mpegvideoencdsp: R-V V add_8x8basis
T-Head C908:
add_8x8basis_c:      440.6
add_8x8basis_rvv_i32: 70.3

SpacemiT X60:
add_8x8basis_c:      436.3
add_8x8basis_rvv_i32: 40.5
2024-08-19 22:41:13 +03:00
Rémi Denis-Courmont 1907dd7f23 lavc/mpegvideoencdsp: R-V V try_8x8basis
T-Head C908:
try_8x8basis_c:       922.5
try_8x8basis_rvv_i32: 135.3

SpacemiT X60:
try_8x8basis_c:       926.1
try_8x8basis_rvv_i32: 103.1
2024-08-19 22:41:13 +03:00
Rémi Denis-Courmont 0fd37c00d7 lavc/mpegvideoencdsp: R-V V pix_norm1
T-Head C908:
pix_norm1_c:       480.2
pix_norm1_rvv_i64: 146.9

SpacemiT X60:
pix_norm1_c:       478.2
pix_norm1_rvv_i64:  92.7
2024-08-19 22:41:13 +03:00
Rémi Denis-Courmont 63d016aea5 lavc/mpegvideoencdsp: R-V V pix_sum
T-Head C908:
pix_sum_c:      332.2
pix_sum_rvv_i64: 91.2

SpacemiT X60:
pix_sum_c:      321.2
pix_sum_rvv_i64: 60.9
2024-08-19 22:41:13 +03:00
Anton Khirnov 631a725670 lavc/hevcdec: call ff_thread_finish_setup() even if hwaccel is in use
Serializing frame threading for non-threadsafe hwaccels is handled at the
generic level, the decoder does not need to care about it.
2024-08-19 21:37:22 +02:00
Anton Khirnov 4b9adb35b6 lavc/hevcdec: simplify output logic
Current code is written around the "simple" decode API's limitation that
a single input packet (AU/coded frame) triggers the output of at most
one output frame. However the spec contains two cases where a coded
frame may cause multiple frames to be output (cf. C.5.2.2.2):
* start of a new sequence
* overflowing sps_max_dec_pic_buffering

The decoder currently contains rather convoluted logic to handle these
cases:
* decode/output/per-frame sequence counters,
* HEVC_FRAME_FLAG_BUMPING
* ff_hevc_bump_frame()
* special clauses in ff_hevc_output_frame()

However, with the receive_frame() API none of that is necessary, as we
can just output multiple frames at once. Previously added ContainerFifo
allows that to be done in a straightforward and efficient manner.
2024-08-19 21:37:22 +02:00
Anton Khirnov 79afc45c03 lavc/hevcdec: use a ContainerFifo to hold frames scheduled for output
Instead of a single AVFrame.

Will be useful in future commits, where we will want to produce multiple
output frames for a single coded frame.
2024-08-19 21:37:22 +02:00
Anton Khirnov 4bda7f288c lavc/videotoolbox: drop HEVC cropping from start_frame rather than end_frame
HEVCContext.output_frame will be removed in following commits.

Reported-By: Max Bykov
2024-08-19 21:37:22 +02:00
Anton Khirnov 6174818252 lavc: add private container FIFO API
It provides a FIFO for "container" objects like AVFrame/AVPacket and
features an integrated FFRefStructPool-based pool to avoid allocating an
freeing them repeatedly.
2024-08-19 21:37:22 +02:00
Anton Khirnov 2fdecbb239 lavc/hevcdec: switch to receive_frame()
Required by following commits, where we will want to output multiple
frames per packet.
2024-08-19 21:37:22 +02:00
sunyuechi 4e7b5ac48f lavc/vp9dsp: R-V V mc bilin hv
C908   X60
vp9_avg_bilin_4hv_8bpp_c                           :   10.7    9.5
vp9_avg_bilin_4hv_8bpp_rvv_i32                     :    4.0    3.5
vp9_avg_bilin_8hv_8bpp_c                           :   38.5   34.2
vp9_avg_bilin_8hv_8bpp_rvv_i32                     :    7.2    6.5
vp9_avg_bilin_16hv_8bpp_c                          :  147.2  130.5
vp9_avg_bilin_16hv_8bpp_rvv_i32                    :   14.5   12.7
vp9_avg_bilin_32hv_8bpp_c                          :  574.2  509.7
vp9_avg_bilin_32hv_8bpp_rvv_i32                    :   42.5   38.0
vp9_avg_bilin_64hv_8bpp_c                          : 2321.2 2017.7
vp9_avg_bilin_64hv_8bpp_rvv_i32                    :  163.5  131.0
vp9_put_bilin_4hv_8bpp_c                           :   10.0    8.7
vp9_put_bilin_4hv_8bpp_rvv_i32                     :    3.5    3.0
vp9_put_bilin_8hv_8bpp_c                           :   35.2   31.2
vp9_put_bilin_8hv_8bpp_rvv_i32                     :    6.5    5.7
vp9_put_bilin_16hv_8bpp_c                          :  134.0  119.0
vp9_put_bilin_16hv_8bpp_rvv_i32                    :   12.7   11.5
vp9_put_bilin_32hv_8bpp_c                          :  538.5  464.2
vp9_put_bilin_32hv_8bpp_rvv_i32                    :   39.7   35.2
vp9_put_bilin_64hv_8bpp_c                          : 2111.7 1833.2
vp9_put_bilin_64hv_8bpp_rvv_i32                    :  138.5  122.5

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-08-19 22:29:20 +03:00
sunyuechi 9edd2e723b lavc/vp9dsp: R-V V mc bilin h v
C908   X60
vp9_avg_bilin_4h_8bpp_c                            :    5.5    4.7
vp9_avg_bilin_4h_8bpp_rvv_i32                      :    1.7    1.5
vp9_avg_bilin_4v_8bpp_c                            :    5.5    4.7
vp9_avg_bilin_4v_8bpp_rvv_i32                      :    1.5    1.2
vp9_avg_bilin_8h_8bpp_c                            :   20.0   17.7
vp9_avg_bilin_8h_8bpp_rvv_i32                      :    3.0    2.7
vp9_avg_bilin_8v_8bpp_c                            :   20.7   18.7
vp9_avg_bilin_8v_8bpp_rvv_i32                      :    3.0    2.7
vp9_avg_bilin_16h_8bpp_c                           :   78.2   69.7
vp9_avg_bilin_16h_8bpp_rvv_i32                     :    7.0    6.2
vp9_avg_bilin_16v_8bpp_c                           :   98.5   73.2
vp9_avg_bilin_16v_8bpp_rvv_i32                     :    7.0    6.0
vp9_avg_bilin_32h_8bpp_c                           :  325.5  275.5
vp9_avg_bilin_32h_8bpp_rvv_i32                     :   23.0   20.5
vp9_avg_bilin_32v_8bpp_c                           :  342.2  290.0
vp9_avg_bilin_32v_8bpp_rvv_i32                     :   21.7   19.5
vp9_avg_bilin_64h_8bpp_c                           : 1263.7 1095.7
vp9_avg_bilin_64h_8bpp_rvv_i32                     :   91.2   81.2
vp9_avg_bilin_64v_8bpp_c                           : 1331.7 1155.2
vp9_avg_bilin_64v_8bpp_rvv_i32                     :   91.2   81.0
vp9_put_bilin_4h_8bpp_c                            :    4.5    4.0
vp9_put_bilin_4h_8bpp_rvv_i32                      :    1.0    1.0
vp9_put_bilin_4v_8bpp_c                            :    4.7    4.2
vp9_put_bilin_4v_8bpp_rvv_i32                      :    1.0    1.0
vp9_put_bilin_8h_8bpp_c                            :   16.7   15.0
vp9_put_bilin_8h_8bpp_rvv_i32                      :    2.2    2.0
vp9_put_bilin_8v_8bpp_c                            :   17.5   15.7
vp9_put_bilin_8v_8bpp_rvv_i32                      :    2.2    2.0
vp9_put_bilin_16h_8bpp_c                           :   65.2   58.0
vp9_put_bilin_16h_8bpp_rvv_i32                     :    6.0    5.5
vp9_put_bilin_16v_8bpp_c                           :   69.2   61.7
vp9_put_bilin_16v_8bpp_rvv_i32                     :    5.7    5.2
vp9_put_bilin_32h_8bpp_c                           :  273.2  229.0
vp9_put_bilin_32h_8bpp_rvv_i32                     :   19.7   17.7
vp9_put_bilin_32v_8bpp_c                           :  290.5  243.7
vp9_put_bilin_32v_8bpp_rvv_i32                     :   18.7   16.7
vp9_put_bilin_64h_8bpp_c                           : 1040.5  910.5
vp9_put_bilin_64h_8bpp_rvv_i32                     :   82.5   73.0
vp9_put_bilin_64v_8bpp_c                           : 1108.5  971.0
vp9_put_bilin_64v_8bpp_rvv_i32                     :   82.2   73.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-08-19 22:29:20 +03:00
Marvin Scholz 8f36c6f2e7 MAINTAINERS: add CC preference for myself
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-19 17:46:44 +02:00
Michael Niedermayer 7e5410eadb avformat/iamf_parse: clear padding
Fixes: use of uninitialized value
Fixes: 70929/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5931276639469568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-18 23:05:40 +02:00
Michael Niedermayer 67947f2a1c avcodec/hevc/ps: use unsigned shift
Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 70726/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-6149928703819776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-18 23:05:39 +02:00
Michael Niedermayer 043875941f avcodec/cbs_h265_syntax_template:
Fixes: Assertion width > 0 && width <= 32 failed
Fixes: 71012/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-6073354744823808

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-18 23:05:28 +02:00
Michael Niedermayer 8657eb9c3f avcodec/avcodec: Warn about data returned from get_buffer*()
Text based on suggestion by: epirat07@gmail.com
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-18 23:04:28 +02:00
Dale Curtis 4230379835 avformat/mov: Fix nullptr dereference with invalid encryption metadata.
Found by fuzzer.

Bug: https://crbug.com/356720789
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-18 22:43:55 +02:00
Ramiro Polla 181cd260db swscale/aarch64/yuv2rgb: add neon yuv42{0,2}p -> gbrp unscaled colorspace converters
checkasm --bench on a Raspberry Pi 5 Model B Rev 1.0:
yuv420p_gbrp_128_c: 1243.0
yuv420p_gbrp_128_neon: 453.5
yuv420p_gbrp_1920_c: 18165.5
yuv420p_gbrp_1920_neon: 6700.0
yuv422p_gbrp_128_c: 1463.5
yuv422p_gbrp_128_neon: 471.5
yuv422p_gbrp_1920_c: 21343.7
yuv422p_gbrp_1920_neon: 6743.5
2024-08-18 22:26:17 +02:00
Ramiro Polla 8744764a4c swscale/x86/yuv2rgb: add ssse3 yuv42{0,2}p -> gbrp unscaled colorspace converters
Note: this implementation is limited to x86_64 due to general purpose
      register pressure.

checkasm --bench on an Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz:
yuv420p_gbrp_8_c: 118.5
yuv420p_gbrp_8_ssse3: 93.3
yuv420p_gbrp_128_c: 1068.3
yuv420p_gbrp_128_ssse3: 319.3
yuv420p_gbrp_1080_c: 8841.8
yuv420p_gbrp_1080_ssse3: 2211.8
yuv420p_gbrp_1920_c: 15903.8
yuv420p_gbrp_1920_ssse3: 3814.3
yuv422p_gbrp_8_c: 144.8
yuv422p_gbrp_8_ssse3: 93.8
yuv422p_gbrp_128_c: 1395.8
yuv422p_gbrp_128_ssse3: 313.0
yuv422p_gbrp_1080_c: 11551.5
yuv422p_gbrp_1080_ssse3: 2240.8
yuv422p_gbrp_1920_c: 20585.3
yuv422p_gbrp_1920_ssse3: 5249.5
yuva420p_gbrp_8_c: 117.5
yuva420p_gbrp_8_ssse3: 92.0
yuva420p_gbrp_128_c: 1593.0
yuva420p_gbrp_128_ssse3: 319.3
yuva420p_gbrp_1080_c: 8694.5
yuva420p_gbrp_1080_ssse3: 2186.0
yuva420p_gbrp_1920_c: 15946.5
yuva420p_gbrp_1920_ssse3: 3805.3
2024-08-18 22:26:14 +02:00
Ramiro Polla 4545205a26 swscale/yuv2rgb: add yuv42{0,2}p -> gbrp unscaled colorspace converters 2024-08-18 22:26:11 +02:00
Ramiro Polla af5adf57e3 swscale/yuv2rgb: prepare YUV2RGBFUNC macro for multi-planar rgb
This will be used in the upcoming yuv42{0,2}p -> gbrp unscaled
colorspace converters.

There is no difference in performance.
2024-08-18 22:26:08 +02:00
Ramiro Polla 24063e7827 swscale/yuv2rgb: prepare LOADCHROMA/PUTFUNC macros for multi-planar rgb
This will be used in the upcoming yuv42{0,2}p -> gbrp unscaled
colorspace converters.

There is no difference in performance.
2024-08-18 22:26:05 +02:00
Ramiro Polla 5c1c0325cd avcodec/aarch64/me_cmp: add dotprod implementations of sse16 and vsse_intra16
checkasm --bench for Raspberry Pi 5 Model B Rev 1.0:
sse_0_c: 241.5
sse_0_neon: 37.2
sse_0_dotprod: 22.2
vsse_4_c: 148.7
vsse_4_neon: 31.0
vsse_4_dotprod: 15.7
2024-08-17 15:31:48 +02:00
Dale Curtis a31106d849 lavf/demux: don't reallocate a AVCodecContext when closing a non-open codec.
This results in an unnecessary ~800k allocation with H.264. A
nearby callsite uses avcodec_is_open() to avoid this, so do the
same when exiting avformat_find_stream_info().

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-08-17 12:54:41 +02:00
sfan5 c779766b5c avcodec/mediacodecdec: call MediaCodec.stop on close
Usually the MediaCodec context will be released immediately, or it needs to stay
alive due to existing hardware buffers.

However we can free resources early in the case of
hw_buffer_count == 0 && refcount > 1, which can be reproduced by keeping frames
referenced after flushing and closing. mpv currently behaves like this.

Signed-off-by: sfan5 <sfan5@live.de>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2024-08-17 09:03:05 +02:00
Timo Rothenpieler 817c6a6762 avformat/hlsenc: correctly reset subtitle stream counter per-varstream
Without resetting it, if there was a previous set of varstreams with
subtitles, it would subtract from all the streams, leading to chaos and
segfaults when trying to access for example stream -1.
2024-08-16 20:22:09 +02:00
James Almer 211c88b9d5 avfilter/f_zmq: fix graph argument
Fixes regression since d566a37003.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-16 09:53:22 -03:00
Niklas Haas 7b723ebd5a avcodec/dovi_rpudec: error out on strange RPU formats
Better safe than sorry.
2024-08-16 11:48:02 +02:00
Niklas Haas 3e1b70383e avcodec/dovi_rpuenc: slightly improve profile autodetection
In the absence of an RPU header, we can consult the colorspace tags to
make a more informed guess about whether we're looking at profile 5 or
profile 8.
2024-08-16 11:48:02 +02:00
Niklas Haas ecea6ed3c9 avcodec/dovi_rpuenc: implement DM metadata compression
This implements limited metadata compression. To be a bit more lenient,
we try and re-order the static extension blocks when testing for an
exact match.

For sanity, and to avoid producing bitstreams we couldn't ourselves
decode, we don't accept partial matches - if some extension blocks
change while others remain static, compression is disabled for the
entire frame.

This shouldn't be an issue in practice because static extension blocks
are stated to remain constant throughout the entire sequence.
2024-08-16 11:48:02 +02:00
Niklas Haas 9824d1539e avcodec/dovi_rpudec: sanitize DM data before decoding
Some DM types do not fill the whole struct, so just clear it entirely
before going filling the decoded values.
2024-08-16 11:48:02 +02:00
Niklas Haas 45f5f4d3da avcodec/dovi_rpudec: implement limited DM decompression
This implements the limited DM metadata compression scheme described in
chapter 9 of the dolby vision bitstream specification.

The spec is a bit unclear about how to handle the presence of static
metadata inside compressed frames; in that it doesn't explicitly forbid
an encoder from repeating redundant metadata. In theory, we would need
to detect this case and then strip the corresponding duplicate metadata
from the existing set of static metadata. However, this is difficult to
implement - esspecially for the case of metadata blocks which may be
internally repeated (e.g. level 10).

That said, the spec states outright that static metadata should be
constant throughout the entire sequence, so a sane bitstream should not
have any static metadata values changing from one frame to the next (at
least up to a keyframe boundary), and therefore they should never be
present in compressed frames. As a consequence, it makes sense to treat
this as an error state regardless. (Ignoring them by default, or
erroring if either AV_EF_EXPLODE or AV_EF_AGGRESSIVE are set)

I was not able to find such samples in the wild (outside of artificially
produced test cases for this exact scenario), so I don't think we need
to worry about it until somebody produces one.
2024-08-16 11:48:02 +02:00
Niklas Haas 1c4d4cc368 avcodec/dovi_rpudec: don't unnecessarily allocate DOVIExt 2024-08-16 11:48:02 +02:00
Niklas Haas a1f96ae157 avcodec/dovi_rpu: separate static ext blocks
Static and dynamic extension blocks are handled differently by metadata
compression, so we need to separate the extension block array into two.
2024-08-16 11:48:02 +02:00
Niklas Haas f5d6eb4017 avcodec/dovi_rpu: move ext blocks into dedicated struct
Slightly re-organize the logic around extension blocks in order to allow
expanding the state tracking in a following commit.
2024-08-16 11:48:02 +02:00
Niklas Haas b3d33f11fa avcodec/bsf/dovi_rpu: add new bitstream filter
This can be used to strip dovi metadata, or enable/disable dovi
metadata compression. Possibly more use cases in the future.
2024-08-16 11:48:02 +02:00
Niklas Haas 07712a0cab avcodec/dovi_rpuenc: add configuration for compression
In particular, validate that the chosen compression level is compatible
with the chosen profile.
2024-08-16 11:48:02 +02:00
Niklas Haas 1917270d32 avcodec/dovi_rpuenc: add ff_dovi_configure_ext()
More flexible version of ff_dovi_configure() which does not require an
AVCodecContext. Usable, for example, inside a bitstream filter.
2024-08-16 11:48:02 +02:00
Niklas Haas 765f29c61e avcodec/dovi_rpu: add ff_dovi_get_metadata()
Provides direct access to the AVDOVIMetadata without having to attach it
to a frame.
2024-08-16 11:48:02 +02:00
Niklas Haas ae3a78593d avcodec/dovi_rpuenc: add a flag to enable compression
Keyframes must reset the metadata compression state, so we need to
also signal this at rpu generation time.

Default to uncompressed, because encoders cannot generally know if
a given frame will be a keyframe before they finish encoding, but also
cannot retroactively attach the RPU. (Within the confines of current
APIs)
2024-08-16 11:48:02 +02:00
Niklas Haas b3bc8f8e1e avcodec/dovi_rpuenc: make encapsulation optional
And move the choice of desired container to `flags`. This is needed to
handle differing API requirements (e.g. libx265 requires the NAL RBSP,
but CBS BSF requires the unescaped bytes).
2024-08-16 11:48:02 +02:00
Niklas Haas 1e6fdb89bd avcodec/dovi_rpuenc: add flags to ff_dovi_rpu_generate()
Will be used to control compression, encapsulation etc.
2024-08-16 11:48:02 +02:00
Niklas Haas c62b364dcb avcodec/dovi_rpuenc: respect dv_md_compression
Limited mode can only ever maintain a single VDR RPU reference, and
furthermore requires vdr_rpu_id == 0. So in practice, it will only ever
use VDR RPU slot 0. All remaining slots get flushed in this case, to
avoid leaking partial state.
2024-08-16 11:48:02 +02:00
Niklas Haas fd00a56653 avcodec/dovi_rpuenc: eliminate unnecessary loop
This struct itself contains vdr_rpu_id, so we can never match it except
in the case of i == vdr_rpu_id. So just directly use this ID.
2024-08-16 11:48:02 +02:00
Niklas Haas bf92441d6a avcodec/dovi_rpuenc: also copy ext blocks to dovi ctx
As the comment implies, DOVIContext.ext_blocks should also reflect the
current state after ff_dovi_rpu_generate().

Fluff for now, but will be needed once we start implementing metadata
compression for extension blocks as well.
2024-08-16 11:48:02 +02:00
Niklas Haas a93801b626 avcodec/dovi_rpudec: implement validation for compression
Add some error checking. I've limited it to AV_EF_CAREFUL and
AV_EF_COMPLIANT for now, because we can technically decode such RPUs
just fine.
2024-08-16 11:48:02 +02:00
Niklas Haas 2a2e0aced2 avutil/dovi_meta: document static vs dynamic ext blocks 2024-08-16 11:48:02 +02:00
Niklas Haas ae31acd702 fate/scalechroma: switch to standard chroma location
Replace the manually specified chroma location by one using standard
notation, arbitrarily "bottomleft" as it is a less common path.

Required if we want to phase out the use of manual chroma locations.
2024-08-16 11:43:37 +02:00
Niklas Haas f1071dc634 avfilter/vf_zscale: remove unused fields 2024-08-16 11:43:37 +02:00
Niklas Haas c8bc6fabd7 avfilter/vf_scale: fix 4:1:0 interlaced chroma pos
The current logic hard-coded a check for v_sub == 1. We can extend this
logic slightly to cover the case of interlaced 4:1:0 (which has v_sub ==
2).

Here is a diagram explaining this scenario (with center-siting):

a   a   a   a   a   a   a   a

b   b   b   b   b   b   b   b
      X               X
a   a   a   a   a   a   a   a

b   b   b   b   b   b   b   b

a   a   a   a   a   a   a   a

b   b   b   b   b   b   b   b
      Y               Y
a   a   a   a   a   a   a   a

b   b   b   b   b   b   b   b

a = even luma rows
b = odd luma rows
X = even chroma sample
Y = odd chroma sample

In progressive mode, the chroma samples sit at (384, 384) respectively.

Relative to the 8x4 grid of even luma samples (a), the X sample sits at:
  h_chr_pos = 384
  v_chr_pos = 192

Relative to the 8x4 grid of odd luma samples (b), the Y sample sits at:
  h_chr_pos = 384
  v_chr_pos = 576

The new code calculates the correct values in all circumstances.
2024-08-16 11:43:37 +02:00
Niklas Haas 15a67c0947 avfilter/vf_scale: add in/out_chroma_loc
Currently, this just functions as a more principled and user-friendly
replacement for the (undocumented and hard to use) *_chr_pos fields.

However, the goal is to automatically infer these values from the input
frames' chroma location, and deprecate the manual use of *_chr_pos
altogether. (Indeed, my plans for an swscale replacement will most
likely also end up limiting the set of legal chroma locations to those
permissible by AVFrame properties)
2024-08-16 11:43:37 +02:00
Niklas Haas 18b9687308 avfilter/swscale: always fix interlaced chroma location
The current logic only fixes it when the user does not explicitly
specify the chroma location. However, this does not make a lot of sense.
Since there is no way to specify this property per-field, it effectively
*prevents* the user from being able to correctly scale interlaced frames
with top-aligned chroma.

It makes more sense to consider the user setting in the progressive case
only, and automatically adapt it to the correct interlaced field
positions, following the details of the MPEG specification.
2024-08-16 11:43:37 +02:00
Niklas Haas 6b40be941a swscale/options: relax src/dst_h/v_chr_pos value range
When dealing with 4x subsampling ratios (log2 == 2), such as can arise
with 4:1:1 or 4:1:0, a value range of 512 is not enough to cover the
range of possible scenarios.

For example, bottom-sited chroma in 4:1:0 would require an offset of 768
(three luma rows). Simply double the limit to 1024. I don't see any
place in initFilter() that would experience overflow as a result of this
change, especially since get_local_pos() right-shifts it by the
subsampling ratio again.
2024-08-16 11:43:37 +02:00
Niklas Haas 5d964df5da avfilter/vf_setparams: remove unnecessary options bounds
AV_OPT_TYPE_CONST does not use min/max, we can leave them as 0.
2024-08-16 11:43:37 +02:00
Niklas Haas 201f1cba15 avfilter/vf_setparams: allow setting chroma location
Shockingly, there isn't currently _any_ filter for overriding this.
2024-08-16 11:43:37 +02:00
Niklas Haas 3e064f52eb swscale: document SWS_FULL_CHR_H_* flags
Based on my best understanding of what they do, given the source code.
2024-08-16 11:43:37 +02:00
Fei Wang be7ab63552 lavc/qsvdec: Add vvc_mp4toannexb bsf for QSV VVC decoder
Fix error:
$ ffmpeg -hwaccel qsv -i input.mp4 -f null -
..
[vvc_qsv @ 0000026890D966C0] Error decoding stream header: unknown error (-1)
[vvc_qsv @ 0000026890D966C0] Error decoding header

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-08-16 14:15:04 +08:00
Lynne a797317ab1 vulkan_filter: don't require the storage flag for the base frames format
We check for whether subformats support storage immediately below.
Those are the ones we require storage for, rather than the base format
itself.

This permits better reuse of AVHWFrame contexts.

The patch also removes an always-false check in the subformat check.
2024-08-16 01:22:17 +02:00
Lynne b165f144e7 vulkan_filter: allow reusing frame contexts with DRM tiling
There's no reason not to permit this, particularly if a user wants
to manipulate images which will be exported back to DRM.
2024-08-16 01:22:17 +02:00
Lynne 604dfdb44c hwcontext_vulkan: align host mapping size to minImportedHostPointerAlignment
This was left out of the recent rewrite of the system.
2024-08-16 01:22:16 +02:00
Lynne 18d964fc2c vulkan: enable encoding of images if video_maintenance1 is enabled
Vulkan encoding was designed in a very... consolidated way.
You had to know the exact codec and profile that the image was going to
eventually be encoded as at... image creation time. Unfortunately, as good
as our code is, glimpsing into the exact future isn't what its capable of.

video_maintenance1 removed that requirement, which only then made encoding
images practically possible.
2024-08-16 01:22:16 +02:00
Lynne 46c13834b6 hwcontext_vulkan: enable VK_KHR_video_maintenance1
We require it for encoding.
2024-08-16 01:22:15 +02:00
Lynne 97e947a2a7 hwcontext_vulkan: setup extensions before features
The issue is that enabling features requires that the device
extension is supported. The extensions bitfield was set later,
so it was always 0, leading to no features being added.
2024-08-16 01:22:15 +02:00
Lynne c3cbaf39bb hwcontext_vulkan: don't enable deprecated VK_KHR_sampler_ycbcr_conversion extension
It was added to Vulkan 1.1 a long time ago.
Validation layer will warn if this is enabled.
2024-08-16 01:22:15 +02:00
Lynne 3f65d24075 hwcontext_vulkan: fix user layers, add support for different debug modes
The validation layer option only supported GPU-assisted validation.
This is mutually exclusive with shader debug printfs, so we need to
differentiate between the two.

This also fixes issues with user-given layers, and leaks in case of
errors.
2024-08-16 01:22:14 +02:00
Lynne 869f4aec48 vulkan_decode: use the correct queue family for decoding ops
In 680d969a30, the new API was
used to find a queue family for dispatch, but the found queue
family was not used for decoding, just for dispatching.
2024-08-16 01:22:08 +02:00
Anton Khirnov d566a37003 lavfi: move AVFilterLink.graph to FilterLink 2024-08-15 19:34:27 +02:00
Anton Khirnov fb3efef1db lavfi: move AVFilterLink.frame_wanted_out to FilterLinkInternal 2024-08-15 19:34:27 +02:00
Anton Khirnov 42cbf66fff lavfi: move AVFilterLink.{frame,sample}_count_{in,out} to FilterLink 2024-08-15 19:34:27 +02:00
Anton Khirnov a23d565ea7 lavfi: move AVFilterLink.frame_rate to FilterLink
Co-developed-by: James Almer <jamrial@gmail.com>
2024-08-15 19:34:27 +02:00
Anton Khirnov d6318a244d lavfi: move AVFilterLink.current_pts(_us) to FilterLink 2024-08-15 19:34:27 +02:00
Anton Khirnov 7f17e0e6dd lavfi: move AVFilterLink.hw_frames_ctx to FilterLink 2024-08-15 19:34:24 +02:00
Anton Khirnov ce24b5ba8f lavfi/vf_*_cuda: do not access hw contexts before checking they exist
The checks are performed in init_processing_chain().
2024-08-15 19:27:01 +02:00
Anton Khirnov 99ee7a948f lavfi: move AVFilterLink.m{ax,in}_samples to FilterLink
Also, document who sets these fields and when.
2024-08-15 19:27:01 +02:00
Anton Khirnov 54754eec1e lavfi: add a new struct for private link properties
Specifically those that should be visible to filters, but hidden from
API callers. Such properties are currently located at the end of the
public AVFilterLink struct, demarcated by a comment marking them as
private. However it is generally better to hide them explicitly, using
the same pattern already employed in avformat or avcodec.

The new struct is currently trivial, but will become more useful in
following commits.
2024-08-15 19:27:01 +02:00
Anton Khirnov 426e33c758 lavfi: set AVFilterLink.graph on link creation
There is no reason to delay this.
2024-08-15 19:27:01 +02:00
Wu Jianhua ca5c9e810a avcodec/vvc/dsp: prefix TxType and TxSize with VVC
See https://patchwork.ffmpeg.org/project/ffmpeg/patch/TYSPR06MB64337C4A9ADF5312E6648543AA62A@TYSPR06MB6433.apcprd06.prod.outlook.com/#81892

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-08-15 20:52:14 +08:00
Wu Jianhua ae1a9cfd52 avcodec/vvc_parser: move avctx->has_b_frames initialization to dec
From Jun Zhao <mypopydev@gmail.com>:
> Should we relocate this to the decoder? Other codecs typically set this
> parameter in the decoder.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-08-15 20:50:24 +08:00
Nuo Mi 80af195804 avcodec/vvcdec: move frame tab memset from the main thread to worker threads
memset tables in the main thread can become a bottleneck for the decoder.
For example, if it takes 1% of the processing time for one core, the maximum achievable FPS will be 100.
Move the memeset to worker threads will fix the issue.
2024-08-15 20:33:57 +08:00
Nuo Mi daf6fcd816 avcodec/vvcdec: do not zero frame qp table
For luma, qp can only change at the CU level, so the qp tab size is related to the CU.
For chroma, considering the joint CbCr, the QP tab size is related to the TU.
2024-08-15 20:33:57 +08:00
Nuo Mi ca2caeb21d avcodec/vvcdec: do not zero frame msf mmi table 2024-08-15 20:33:57 +08:00
Nuo Mi 0c7106f618 avcodec/vvcdec: do not zero frame cpm table 2024-08-15 20:33:57 +08:00
Nuo Mi 3e497249eb avcodec/vvcdec: check_available, use && instead of &= for shortcut evaluation 2024-08-15 20:33:57 +08:00
Nuo Mi 4f882c453e avcodec/vvcdec: do not zero frame mvf table 2024-08-15 20:33:57 +08:00
Nuo Mi 93b0d5f9ce avcodec/vvcdec: refact out is_available from is_a0_available 2024-08-15 20:33:57 +08:00
Nuo Mi e8ac761293 avcodec/vvcdec: split ctu table to zero init and no zero init parts
cus need to init to zero, other parts are not
2024-08-15 20:19:45 +08:00
Nuo Mi 4f60961498 avcodec/vvcdec: remove unnecessary perframe initializations
deblock, sao, alf
skip, imtf, ipm, cqt_depth, cb_pos_x, cb_pos_y, cb_height, cp_mv,
tb_pos_x0, tb_pos_y0, tb_width, tb_height
2024-08-15 20:19:45 +08:00
Nuo Mi 210bf1b154 avcodec/vvcdec: refact, combine bs tab with tu tab 2024-08-15 20:19:45 +08:00
Nuo Mi bdb79fe60a avcodec/vvcdec: thread, ensure the parse stage gets the highest priority
The parser stage is not parallelizable.
We need to schedule it as soon as possible to create later stages, which are more parallelizable

clips                                       | before | after | delta
--------------------------------------------|--------|-------|------
RitualDance_1920x1080_60_10_420_37_RA.266   | 342.7  | 365.3 |  6.59%
NovosobornayaSquare_1920x1080.bin           | 321.7  | 400   | 24.34%
Tango2_3840x2160_60_10_420_27_LD.266        |  82.3  |  91.7 | 11.42%
RitualDance_1920x1080_60_10_420_32_LD.266   | 323.7  | 319.3 | -1.36%
Chimera_8bit_1080P_1000_frames.vvc          | 364    | 411.3 | 12.99%
BQTerrace_1920x1080_60_10_420_22_RA.vvc     | 162.7  | 185.7 | 14.14%
2024-08-15 20:19:45 +08:00
Nuo Mi 7eb1df44ae checkasm: add tests for vvc dmvr
dmvr_8_12x20_c: 186.2
dmvr_8_12x20_avx2: 25.7
dmvr_8_20x12_c: 181.7
dmvr_8_20x12_avx2: 25.2
dmvr_8_20x20_c: 283.2
dmvr_8_20x20_avx2: 32.0
dmvr_10_12x20_c: 90.0
dmvr_10_12x20_avx2: 15.7
dmvr_10_20x12_c: 41.0
dmvr_10_20x12_avx2: 14.7
dmvr_10_20x20_c: 81.5
dmvr_10_20x20_avx2: 26.7
dmvr_12_12x20_c: 190.7
dmvr_12_12x20_avx2: 20.2
dmvr_12_20x12_c: 187.2
dmvr_12_20x12_avx2: 20.2
dmvr_12_20x20_c: 292.7
dmvr_12_20x20_avx2: 27.2
dmvr_h_8_12x20_c: 317.0
dmvr_h_8_12x20_avx2: 37.0
dmvr_h_8_20x12_c: 340.0
dmvr_h_8_20x12_avx2: 41.0
dmvr_h_8_20x20_c: 540.7
dmvr_h_8_20x20_avx2: 64.0
dmvr_h_10_12x20_c: 322.7
dmvr_h_10_12x20_avx2: 30.7
dmvr_h_10_20x12_c: 344.2
dmvr_h_10_20x12_avx2: 34.0
dmvr_h_10_20x20_c: 529.0
dmvr_h_10_20x20_avx2: 51.5
dmvr_h_12_12x20_c: 326.7
dmvr_h_12_12x20_avx2: 33.5
dmvr_h_12_20x12_c: 331.7
dmvr_h_12_20x12_avx2: 51.2
dmvr_h_12_20x20_c: 534.0
dmvr_h_12_20x20_avx2: 62.7
dmvr_hv_8_12x20_c: 650.0
dmvr_hv_8_12x20_avx2: 57.2
dmvr_hv_8_20x12_c: 676.2
dmvr_hv_8_20x12_avx2: 70.0
dmvr_hv_8_20x20_c: 1068.5
dmvr_hv_8_20x20_avx2: 103.2
dmvr_hv_10_12x20_c: 649.0
dmvr_hv_10_12x20_avx2: 48.2
dmvr_hv_10_20x12_c: 677.7
dmvr_hv_10_20x12_avx2: 59.7
dmvr_hv_10_20x20_c: 1093.5
dmvr_hv_10_20x20_avx2: 91.7
dmvr_hv_12_12x20_c: 660.0
dmvr_hv_12_12x20_avx2: 58.7
dmvr_hv_12_20x12_c: 682.7
dmvr_hv_12_20x12_avx2: 72.0
dmvr_hv_12_20x20_c: 1094.0
dmvr_hv_12_20x20_avx2: 113.2
dmvr_v_8_12x20_c: 325.7
dmvr_v_8_12x20_avx2: 31.2
dmvr_v_8_20x12_c: 326.2
dmvr_v_8_20x12_avx2: 38.5
dmvr_v_8_20x20_c: 538.5
dmvr_v_8_20x20_avx2: 54.2
dmvr_v_10_12x20_c: 318.5
dmvr_v_10_12x20_avx2: 23.7
dmvr_v_10_20x12_c: 330.7
dmvr_v_10_20x12_avx2: 40.5
dmvr_v_10_20x20_c: 567.5
dmvr_v_10_20x20_avx2: 48.0
dmvr_v_12_12x20_c: 335.2
dmvr_v_12_12x20_avx2: 30.0
dmvr_v_12_20x12_c: 330.2
dmvr_v_12_20x12_avx2: 39.5
dmvr_v_12_20x20_c: 535.2
dmvr_v_12_20x20_avx2: 60.0
2024-08-15 20:19:45 +08:00
Nuo Mi 6464c157d5 x86/vvcdec: add dmvr avx2 code
Decoder-Side Motion Vector Refinement is about 4~8% CPU usage for some clips

here is the test result for one time
clips                                     | before| after | delta
------------------------------------------|-------|-------|------
RitualDance_1920x1080_60_10_420_37_RA.266 | 338.7 | 354.3 |4.61%
NovosobornayaSquare_1920x1080.bin         | 320.3 | 329.3 |2.81%
Tango2_3840x2160_60_10_420_27_LD.266      | 83.3  | 83.7  |0.48%
RitualDance_1920x1080_60_10_420_32_LD.266 | 320.7 | 327.3 |2.06%
Chimera_8bit_1080P_1000_frames.vvc        | 360.7 | 381.0 |5.63%
BQTerrace_1920x1080_60_10_420_22_RA.vvc   | 161.7 | 163.0 |0.80%
2024-08-15 20:19:45 +08:00
Nuo Mi 1c17520e79 avcodec/vvcdec: Use av_image_copy_plane for DMVR 10-bit integer pixels
It's no need to shift and interpolate for 10-bit integer pixels,
av_image_copy_plane is enough
2024-08-15 20:19:45 +08:00
eaphone 7897b0beed libavdevice/gdigrab: change hwnd tail check fail logic to !=null
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-15 20:10:33 +08:00
gnattu a1976e963f avutil/hwcontext_videotoolbox: silence warning for RGB
Hardware frames with RGB colorspace will not have a YCbCrMatrixKey.
Currently, it will spam the console with warning if rgb frame is
uploaded.

Signed-off-by: Gnattu OC <gnattuoc@me.com>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-15 20:10:33 +08:00
Araz Iusubov 42a40538f3 avcodec/amfenc: new encoder features support
Implemented:
New usage modes for AV1 encoder.
Latency mode for H264, HEVC and AV1 encoders.
Adaptive Quantization (AQ) mode in AV1 encoder.
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-08-15 14:01:07 +02:00
Gyan Doshi 1f801dfdb5 lavc/libx265: unbreak build for X265_BUILD >= 210
x265 added support for alpha starting with build 210.
While doing so, x265_encoder_encode() changed its fifth arg to
an array of pointers to x265_picture. This broke building lavc/libx265.c

This patch simply unbreaks the build and maintains existing single-layer
non-alpha encoding support.

Fixes #11130
2024-08-15 15:17:14 +05:30
James Almer 66c05dc031 avformat/iamf_parse: ignore Audio Elements with an unsupported type
Better fix for the NULL pointer dereference from d7f83fc2f4.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-14 23:55:40 -03:00
James Almer 9880fea930 avcodec/snowenc: sign extend a variable before shifting
Fixes "libavcodec/snowenc.c:718:27: runtime error: left shift of 8509032 by 8 places cannot be represented in type 'int'"
as seen in fate-vsynth2-snow-hpel under ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-14 14:52:46 -03:00
Michael Niedermayer 7ad937f0c8 avformat/av1dec: Better fix for 70872/clusterfuzz-testcase-minimized-ffmpeg_dem_OBU_fuzzer-6005782487826432
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 19:05:17 +02:00
Michael Niedermayer 45ee6b1e3d avcodec/apac: Fix discards ‘const’ qualifier
Found-by: courmisch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:49:52 +02:00
vipyne fc07062a47 doc/mailing-list-faq: remove dead link
https://ffmpeg-archive.org/ is no longer "Nabble"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:25:37 +02:00
Michael Niedermayer db843c8910 avcodec/alsdec: clear last_acf_mantissa
Fixes: use-of-uninitialized-value
Fixes: 70869/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5476567461986304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:02 +02:00
Michael Niedermayer de3f6c8888 avcodec/aic: Clear slice_data
Fixes: use-of-uninitialized-value
Fixes: 70865/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AIC_fuzzer-4874102695854080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:01 +02:00
Michael Niedermayer 50471f96c4 avcodec/vc1dec: Clear mb_type_base and ttblk_base
Fixes: two use-of-uninitialized-value
Fixes: 70856/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5539349918187520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:01 +02:00
Michael Niedermayer e44349ee88 avcodec/shorten: clear padding
Fixes: use-of-uninitialized-value
Fixes: 70854/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5533480570650624

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:01 +02:00
Michael Niedermayer 66ee75d76c avformat/mpeg: Check an avio_read() for failure
Fixes: use-of-uninitialized-value
Fixes: 70849/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGPS_fuzzer-4684401009557504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:00 +02:00
Michael Niedermayer 8ca072a373 avcodec/apac: Clean padding space
Fixes: use-of-uninitialized-value
Fixes: 70842/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APAC_fuzzer-5758325067677696

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:00 +02:00
Michael Niedermayer cba4e2e40d avcodec/mvha: Clear remaining space after inflate()
Fixes: use-of-uninitialized-value
Fixes: 70838/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVHA_fuzzer-4878509466517504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:00 +02:00
Michael Niedermayer a0f22218f7 bsf/media100_to_mjpegb: Clear output buffer padding
Fixes: use-of-uninitialized-value
Fixes: 70855/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MEDIA100_fuzzer-5537446610141184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:59 +02:00
Michael Niedermayer d7f83fc2f4 avformat/iamfdec: Check nb_layers before dereferencing layer
Fixes: dereferencing pointers near NULL
Fixes: 70432/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5255672845893632
Fixes: 70877/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5348547432611840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:59 +02:00
Michael Niedermayer 6996e1238e avformat/av1dec: Check bits left before get_leb128()
Fixes: use of uninitialized value
Fixes: 70872/clusterfuzz-testcase-minimized-ffmpeg_dem_OBU_fuzzer-6005782487826432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:58 +02:00
Michael Niedermayer 4dc7dfe65a avformat/segafilm: Set keyframe
Fixes: use of uninitialized value
Fixes: 70871/clusterfuzz-testcase-minimized-ffmpeg_dem_SEGAFILM_fuzzer-5883617752973312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:58 +02:00
Michael Niedermayer 0f4524f07a avcodec/sga: av_assert1 check init_get_bits8()
Related: CID1473562 Unchecked return value
Related: CID1473592 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:58 +02:00
Michael Niedermayer e40b23c52a tools/target_dec_fuzzer: Check that FFv1 doesnt leave uninitialized memory in its buffers
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:57 +02:00
Jan Garcia via ffmpeg-devel 598f541ba4 fftools/ffmpeg: show video stats in progress output without filters
Since ffmpeg 6.1 video stats are accidentally hidden from streamcopy progress output.
This patch re-enables video stats (like frames=) in the progress output.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-08-14 15:17:58 +02:00
Josh Allmann 374824cbc7 avcodec/h264_mp4toannexb: Prepend SPS/PPS to buffering period SEI
Encoders may emit a buffering period SEI without a corresponding
SPS/PPS if the SPS/PPS is carried out-of-band, eg with avcc.

During Annex B conversion, this may result in the SPS/PPS being
inserted *after* the buffering period SEI but before the IDR NAL.

Since the buffering period SEI references the SPS, the SPS/PPS
needs to come first.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-08-14 13:20:56 +02:00
Ross Burton 654bd47716 libavcodec/arm/mlpdsp_armv5te: fix label format to work with binutils 2.43
binutils 2.43 has stricter validation for labels[1] and results in errors
when building ffmpeg for armv5:

src/libavcodec/arm/mlpdsp_armv5te.S:232: Error: junk at end of line, first unrecognized character is `0'

Remove the leading zero in the "01" label to resolve this error.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=226749d5a6ff0d5c607d6428d6c81e1e7e7a994b

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-13 23:24:13 +03:00
Stephen Hutchinson ea7375c9e9 avformat/avisynth: move avs_planes* consts into relevant function
These consts are only used in the switch(planar) case located in
avisynth_create_stream_video and nowhere else in the demuxer,
so move them into that function directly.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2024-08-13 15:09:53 -04:00
Stephen Hutchinson 48d6cd35a2 avformat/avisynth: remove library allocation from global state
As part of this, the mutexes are no longer necessary, and
avisynth_read_close needs to check that avs->avs_library.library
still exists before it attempts to call avisynth_context_destroy
and dlclose.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2024-08-13 15:09:53 -04:00
Stephen Hutchinson 8f01ce2898 avformat/avisynth: remove mutex lock from avisynth_read_close
Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2024-08-13 15:09:53 -04:00
Stephen Hutchinson c0fddbae79 avformat/avisynth: remove atexit() handler
The atexit() handler in the avisynth demuxer was added because
there was a conflict in AvxSynth that arose due to their use
of C++ global objects, particularly in relation to having
added a logging function relying on log4cpp.

This conflict was responsible for causing a segfault on exit.
It did not affect Windows with the (at the time) upstream
AviSynth 2.5 and 2.6, nor does it affect AviSynth+.

Unfortunately, none of this was actually shielded by ifdefs
indicating the fact it was only needed for AvxSynth, so four
years ago when AviSynth+ replaced AvxSynth as the handler
for AviSynth scripts on Unix-like OSes, the fact that the
atexit handler was no longer necessary was overlooked.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2024-08-13 15:09:53 -04:00
James Almer 66592e8b10 swscale/output: don't leave the alpha channel undefined in vuyx and xv36le
It's non-determistic, as shown by poisoning avfilter buffers instead of zeroing them.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-13 14:49:41 -03:00
James Almer ed618b288f avcodec/rpzaenc: don't use buffer data beyond the end of a row
Fixes use of uninitized data (masked by the default zeroing of image buffers).

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-13 14:49:41 -03:00
James Almer 2b349f2d73 avcodec/adpcm: adpcm_dtk is stereo only
Fixes ticket #11133

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-13 14:49:41 -03:00
Lynne d138d7a595 vulkan: make sure descriptor buffers are always DEVICE_LOCAL
Implementations are required to list memory heaps in the most optimal
order. But its better to be explicit for this particular allocation.
2024-08-13 19:05:20 +02:00
Anton Khirnov 9e3b5b8a26 fftools/ffmpeg: switch -map parsing to new stream specifier API
Makes optional map handling less hacky, fixes combining optional maps
with metadata matching on tags/values containing the '?' character/

Forward errors from stream specifier parsing, previously the code would
ignore them.
2024-08-13 10:28:54 +02:00
Anton Khirnov d1bdd89c2f fftools/ffmpeg: use new stream specifier API in opt_match_per_stream*()
Removes a lot of error checking code, as matching cannot fail.
2024-08-13 10:28:54 +02:00
Anton Khirnov 46cbe4ab5c fftools/cmdutils: split stream specifier parsing and matching
This approach has the major advantage that only parsing can fail (due to
a malformed specifier or memory allocation failure). Since parsing is
done generically, while matching is per-option, this will allow to
remove substantial amounts of error checking code in following commits.

The new code also explicitly allows stream specifiers to be followed by
additional characters, which should allow cleaner handling of optional
maps, i.e. -map <stream_specifier>?, which is currently implemented in a
hacky way that breaks when the stream specifier itself contains the '?'
character (this can happen when matching metadata). It will also allow
further extending the syntax, which will be useful in following commits.

This introduces some minor behaviour changes:
* Matching metadata tags now requires the ':' character in keys or
  values to be escaped. Previously it could not be present in keys, and
  would be used verbatim in values. The change is required in order to
  know where the value terminates.
* Multiple stream types in a single specifier are now rejected - such a
  specifier makes no sense.
* Non-existent stream group ID or index is now ignored with a warning
  rather than causing a failure. This is consistent with program
  handling and is required to make matching fail-free.
2024-08-13 10:28:54 +02:00
Anton Khirnov e1b38680b7 fftools/cmdutils: put stream specifier handling back into cmdutils
Stream specifiers were originally designed exclusively for CLI use and
were not intended to be public API. Handling them in avformat places
major restrictions on how they are used. E.g. if ffmpeg CLI wishes to
override some stream parameters, it has to change the demuxer fields
(since avformat_match_stream_specifier() does not have access to
anything else). However, such fields are supposed to be read-only for
the caller.

Furthermore having this code in avformat restricts extending the
specifier syntax. An example of such an extension will be added in
following commits.
2024-08-13 10:28:54 +02:00
Anton Khirnov 93227a68f1 fftools/ffmpeg: replace remaining uses of MATCH_PER_STREAM_OPT() 2024-08-13 10:28:54 +02:00
Anton Khirnov e218bde9f9 fftools/ffmpeg: replace MATCH_PER_STREAM_OPT(.., str, ..) with a function
This has multiple advantages:
* The macro has multiple parameters that often have similar or identical
  values, yet very different meanings (one is the name of the
  OptionsContext member where the parsed options are stored, the other
  the name of the variable into which the result is written); this
  change makes each of these explicit.

* The macro returns on failure, which may cause leaks - this was the
  reason for adding MATCH_PER_STREAM_OPT_CLEAN(), also ost_add()
  currently leaks encoder_opts. The new function returns failure to its
  caller, which decides how to deal with it. While that adds a lot of
  error checks/forwards for now, those will be reduced in following
  commits.

* new code is type- and const- correct

Invocations of MATCH_PER_STREAM_OPT() with other types will be converted
in following commits.
2024-08-13 10:28:54 +02:00
James Almer 82085a3e0a avcodec/avcodec_internal: fix type definition for the new functions
Fixes make checkheaders.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-12 23:10:48 -03:00
James Almer 472fbee812 avformat/movenc: don't look at previous track_id as it may not be set
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-12 11:41:38 -03:00
James Almer 41307ff3e9 avfilter/video: don't zero allocated buffers if memory poisoning is used
Same as in avcodec/get_buffer.c
Should help in debugging use of uninitialized memory.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-12 11:41:38 -03:00
James Almer 8d700eab85 tests/iamf: match stream group by id in some tests
Increases specifier parsing code coverage a little bit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-12 11:41:38 -03:00
Anton Khirnov deee00e2eb lavc/decode: reindent after previous commit 2024-08-12 14:42:20 +02:00
Anton Khirnov 5acbdd2264 lavc: convert frame threading to the receive_frame() pattern
Reorganize the code such that the frame threading code does not call the
decoders directly, but instead calls back into the generic decoding
code. This avoids duplicating the logic that wraps the decoder
invocation and allows receive_frame()-based decoders to use frame
threading.

Further work by Timo Rothenpieler <timo@rothenpieler.org>.
2024-08-12 14:42:20 +02:00
Anton Khirnov 4d209dada7 lavc/decode: reindent 2024-08-12 14:42:20 +02:00
Anton Khirnov 048e978e8e lavc/decode: wrap AV_FRAME_FLAG_DISCARD handling in a loop
Makes sure discarded frames do not cause EAGAIN to be returned during
flushing, which is forbidden.
2024-08-12 14:42:20 +02:00
Anton Khirnov 64743b45b5 lavc/internal: document the precise meaning of AVCodecInternal.draining
Also, set draining=1 in case a bitstream filter returns an
internally-triggered EOF. While no bitstream filters currently inserted
by decoders will do that, that may change in the future and it is better
to cover this case.
2024-08-12 14:42:20 +02:00
Anton Khirnov d94cfd4900 lavc/thread: move generic-layer API to avcodec_internal.h
thread.h currently contains both API for decoder use and functions
internal to lavc generic layer. Move the latter to avcodec_internal.h,
which is a more appropriate place for them.
2024-08-12 14:42:20 +02:00
Anton Khirnov 8d5efc2182 lavc/ffv1dec: fix races in accessing FFV1SliceContext.slice_damaged
That variable is shared between frame threads in the same defective way
described in the previous commit. Fix it by adding a RefStruct-managed
arrays of flags that is propagated across frame threads in the standard
manner.

Remove now-unused FFV1Context.fsrc
2024-08-12 14:42:20 +02:00
Anton Khirnov 15bdca054f lavc/ffv1dec: drop code handling AV_PIX_FMT_FLAG_PAL
No paletted pixel formats are supported by the decoder.
2024-08-12 14:42:20 +02:00
Michael Niedermayer 43cde54fc1 avdevice/dshow: Initialize 2 pointers
Coverity claims these are used uninitilaized in CID1598561 Uninitialized pointer write and CID1598565 Uninitialized pointer write

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:16 +02:00
Michael Niedermayer 189bc840b0 avcodec/dxva2_*: Initialize dxva_data_ptr
Related: CID1591888 Uninitialized scalar variable
Related: CID1591925 Uninitialized pointer read
Related: CID1591933 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:15 +02:00
Michael Niedermayer 1d6a2aebae avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame()
Related: CID1591924 Uninitialized scalar variable
Related: CID1591938 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:15 +02:00
Michael Niedermayer 2232c4cc8c avcodec/dxva2: initialize validate
Related: CID1591915 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:15 +02:00
Michael Niedermayer 489c05b9c3 avcodec/dxva2: Initialize ConfigBitstreamRaw
Related: CID1591894 Uninitialized scalar variable
Related: CID1591906 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:14 +02:00
Michael Niedermayer c8c59e9929 avcodec/dxva2: Initialize dxva_size and check it
Related: CID1591878 Uninitialized scalar variable
Related: CID1591928 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:14 +02:00
Michael Niedermayer b98125e5a5 avfilter/vf_xfade: Compute w2, h2 with float
Fixes: CID1458148 Result is not floating-point
Fixes: CID1458149 Result is not floating-point
Fixes: CID1458150 Result is not floating-point
Fixes: CID1458151 Result is not floating-point
Fixes: CID1458152 Result is not floating-point
Fixes: CID1458154 Result is not floating-point
Fixes: CID1458155 Result is not floating-point
Fixes: CID1458156 Result is not floating-point

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:14 +02:00
Michael Niedermayer f802d65de0 avfilter/vf_v360: Assert that vf was initialized
Maybe helps: CID1504571 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:13 +02:00
Michael Niedermayer 9229587c2d avfilter/vf_unsharp_opencl: Use AV_VIDEO_MAX_PLANES
Related: CID1423281 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:13 +02:00
Michael Niedermayer e5c0f56ca0 avfilter/vf_tonemap_opencl: Dereference after NULL check
Fixes: CID1437472 Dereference before null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:13 +02:00
Michael Niedermayer 22ee55a1da avfilter/af_surround: Check output format
Fixes: CID1516994 Out-of-bounds access
Fixes: CID1516996 Out-of-bounds access
Fixes: CID1516999 Out-of-bounds access

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:12 +02:00
Michael Niedermayer 43b62b7e0c avfilter/vf_xfade_opencl: Check ff_inlink_consume_frame() for failure
Fixes: CID1458127 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:12 +02:00
Michael Niedermayer 191a685010 avformat/lmlm4: Eliminate some AVERROR(EIO)
Found by code review related to CID732224 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:12 +02:00
Michael Niedermayer 239f7e6c71 avformat/lmlm4: Move subtraction after check
This is not a bugfix in code but coverity only, it does look a little nicer though

Fixes: CID732224

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:11 +02:00
Lynne e25667f9f1 hwcontext_vulkan: ignore false positive validation errors
Issue ref:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/6627
2024-08-11 05:13:18 +02:00
Lynne ef11a6456d hwcontext_vulkan: do not chain structs of unsupported extensions in vkCreateDevice
Fixes:

vkCreateDevice(): pCreateInfo->pNext<VkPhysicalDeviceOpticalFlowFeaturesNV> includes a
pointer to a VkPhysicalDeviceOpticalFlowFeaturesNV, but when creating VkDevice, the
parent extension (VK_NV_optical_flow) was not included in ppEnabledExtensionNames.
The Vulkan spec states: Each pNext member of any structure (including this one) in
the pNext chain must be either NULL or a pointer to a valid struct for extending
VkDeviceCreateInfo.
2024-08-11 05:13:17 +02:00
Lynne 12080ff040 nlmeans_vulkan: fix uninitialized reads 2024-08-11 05:13:17 +02:00
Lynne 680d969a30 vulkan_decode: port to the new queue family API 2024-08-11 05:13:16 +02:00
Lynne d6c08a41cb vulkan: load queue families upon loading properties
Avoids the need to call ff_vk_qf_init if manually filling in
a queue family structure.
2024-08-11 05:13:16 +02:00
Lynne 0b25f0bc1d hwcontext_vulkan: correct comment in header 2024-08-11 05:13:16 +02:00
Lynne 1c05661ec4 vulkan_decode: add \n to error message 2024-08-11 05:13:15 +02:00
Lynne 5f0f1f7b7a libavutil: deprecate the old Vulkan queue API, add doc/APIchanges entries 2024-08-11 05:13:15 +02:00
Lynne 83cd77563f vulkan: add support for encode feedback queries 2024-08-11 05:13:15 +02:00
Lynne 2ce0e51503 hwcontext_vulkan: add support for Vulkan encoding 2024-08-11 05:13:14 +02:00
Lynne ca591e6b50 vulkan_decode: force layered_dpb to 0 when dedicated_dpb is 0
layered_dpb only makes sense when dedicated_dpb is set to 1.
For some mysterious reason, some Nvidia drivers stopped indicating
SEPARATE_REFRENCES, but kept the COINCIDE flag, which broke
the code.
2024-08-11 05:13:14 +02:00
Lynne 8eac11105b vulkan: use allocator callback for buffer creation
This would've let to a segfault if custom allocators were used.
2024-08-11 05:13:13 +02:00
Lynne 55adcb4fc5 hwcontext_vulkan: add support for VK_EXT_shader_object
We'd like to use it eventually, and its already covered by
the minimum version of the headers we require.
2024-08-11 05:13:13 +02:00
Lynne 12f868cab5 vulkan_shaderc: add debug information to shaders 2024-08-11 05:13:13 +02:00
Lynne c19af16f8d hwcontext_vulkan: enable storageBuffer16BitAccess if available 2024-08-11 05:13:12 +02:00
Lynne 2f7dfb0d15 vulkan_shaderc: fix error reporting for certain errors
The issue is that shaderc_result_get_num_errors may sometime
return 0 even when shaderc_result_get_compilation_status returns
a non-zero error code.
Since we use the result from the former, override the status
if it returned 0.
2024-08-11 05:13:12 +02:00
Lynne 957d34784a hwcontext_vulkan: constify validation layer features table
The struct data seem to get corrupted otherwise.
Possibly a validation layer or libvulkan issue.
2024-08-11 05:13:11 +02:00
Lynne 9e606b33a8 hwcontext_vulkan: add HOST_CACHED flag to transfer buffer
Significantly speeds up downloads on devices without host mapping.
2024-08-11 05:13:11 +02:00
Lynne aea4d4b423 hwcontext_vulkan: rewrite upload/download
This commit was long overdue. The old transfer dubiously tried to
merge as much code as possible, and had very little in the way
of optimizations, apart from basic host-mapping.

The new code uses buffer pools for any temporary bufflers, and
handles falling back to buffer-based uploads if host-mapping fails.

Roundtrip performance difference:
ffmpeg -init_hw_device "vulkan=vk:0,debug=0,disable_multiplane=1" -f lavfi \
-i color=red:s=3840x2160 -vf hwupload,hwdownload,format=yuv420p -f null -

7900XTX:
Before: 224fps
After: 502fps

Ada, with proprietary drivers:
Before: 29fps
After: 54fps

Alder Lake:
Before: 85fps
After: 108fps

With the host-mapping codepath disabled:
Before: 32fps
After: 51fps
2024-08-11 05:13:11 +02:00
Lynne 81c5d4ea0e hwcontext_vulkan: remove unused struct 2024-08-11 05:13:10 +02:00
Lynne 6757cdb535 vulkan_video: remove NIH pooled buffer implementation
The code predates ff_vk_get_pooled_buffer().
2024-08-11 05:13:10 +02:00
Lynne a30b7c0158 hwcontext_vulkan: initialize optical flow queues if available
Lets us implement FPS conversion.
2024-08-11 05:13:10 +02:00
Lynne 8790a30882 hwcontext_vulkan: rewrite queue picking system for the new API
This allows us to support different video ops on different queues,
as well as any other arbitrary queues we need.
2024-08-11 05:13:09 +02:00
Lynne bedfabc437 vulkan: use the new queue family mechanism 2024-08-11 05:13:09 +02:00
Lynne 13489c8a21 hwcontext_vulkan: add a new mechanism to expose used queue families
The issue with the old mechanism is that we had to introduce new
API each time we needed a new queue family, and all the queue families
were functionally fixed to a given purpose.

Nvidia's GPUs are able to handle video encoding and compute on the
same queue, which results in a speedup when pre-processing is required.

Also, this enables us to expose optical flow queues for frame interpolation.
2024-08-11 05:13:03 +02:00
Osamu Watanabe d88a988d3d avcodec/jpeg2000dec: Fix HT decoding
Fixes incorrect handling of MAGB_P value in Ccap15.
Fixes bugs in HT block decoding.

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-08-10 09:22:51 -07:00
Osamu Watanabe 48b14732d8 avcodec/jpeg2000dec: Add support for placeholder passes
See Rec. ITU-T T.814 | ISO/IEC 15444-15, Annex B.

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-08-10 09:22:44 -07:00
Osamu Watanabe fe1b196499 avcodec/jpeg2000dec: Add support for CAP and CPF markers
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-08-10 09:20:15 -07:00
Michael Niedermayer 1b8d95da3a tools/target_dec_fuzzer: Use av_buffer_allocz() to avoid missing slices to have unpredictable content
This matches production code which also zeros these buffers

Fixes: use of uninitialized values
Fixes: 70885/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP6F_fuzzer-4610946029387776 (and likely others)

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-10 15:04:46 +02:00
Fei Wang cda5f5c5ed lavc/qsv: Use vendor id to create device
New kernel driver "xe" will be supported from Lunar Lake instead of
"i915".

"xe" kernel driver:
https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/xe

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-08-09 13:40:26 +08:00
Fei Wang eab4a9e9f8 lavu/hwcontext_qsv: Use vendor id to create device
New kernel driver "xe" will be supported from Lunar Lake instead of
"i915".

"xe" kernel driver:
https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/xe

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-08-09 13:40:26 +08:00
Fei Wang dbd74ba3c8 lavu/hwcontext_vaapi: Add option to allow to specify vendor id when init hw device
Vendor id will help to select desired device in case of kernel driver is
unknow or unsupported, for vendor may support different kernel driver on
different platforms.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-08-09 13:40:24 +08:00
Michael Niedermayer c390234da2 avformat/wtvdec: Check length of read mpeg2_descriptor
Fixes: Use of uninitialized value
Fixes: 70900/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6286909377150976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-08 19:10:05 +02:00
Michael Niedermayer c95ea03104 avformat/wtvdec: clear sectors
The code can leave uninitialized holes in the array.
Fixes: use of uninitialized values
Fixes: 70883/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6698694567591936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-08 18:24:31 +02:00
Kacper Michajłow b534e402d8 avformat/mov: ensure required number of bytes is read
Fixes: use-of-uninitialized-value

Found by OSS-Fuzz.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-08 18:23:39 +02:00
Michael Niedermayer d2a25dc2bf add tools/target_swr_fuzzer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-08 15:26:52 +02:00
James Almer 94165d1b79 avformat/iamf: use aligned intreadwrite macros where possible
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-07 00:16:21 -03:00
James Almer 49a6e448d7 avformat/movenc: use stream indexes when generating track ids
In some scenarios nb_tracks isn't the same as nb_streams, so a given id may end
up being used for two separate streams.

e.g. when muxing an IAMF track followed by a video track, if the IAMF track
consists of several streams, the video track would end up having an id of 2,
which may also be used by one of the IAMF streams.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-07 00:16:21 -03:00
James Almer 210740b4ed avutil/frame: use the maximum compile time supported alignment for strides
This puts lavu frame buffer allocator helpers in sync with lavc's decoder frame
buffer allocator's STRIDE_ALIGN define.

Remove the comment about av_cpu_max_align() while at it as using it is not
ideal when CPU flags can be changed mid process.

Should fix ticket #11116.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-07 00:16:21 -03:00
Kacper Michajłow 792a9979eb avformat/rtpproto: free ip filters on open error
Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-07 00:59:19 +02:00
Kacper Michajłow 8485f7a378 avformat/srtpproto: pass options to nested protocol
This fixes passing options dict.

Fixes some timeouts found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-07 00:59:19 +02:00
Kacper Michajłow 9876158ee2 avcodec/wmavoice: use av_clipd for double values
Fixes Clang warning.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-07 00:59:18 +02:00
Kacper Michajłow 1165c14444 avcodec/vp9mvs: fix misaligned access when clearing VP9mv
Fixes runtime error: member access within misaligned address
<addr> for type 'av_alias64', which requires 8 byte alignment.

VP9mv is aligned to 4 bytes, so instead doing 8 bytes clear, let's do
2 times 4 bytes.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-07 00:59:18 +02:00
Andreas Rheinhardt bfcee368e2 avcodec/cbs_sei: Always zero-initialize SEI payload
Fixes: Use-of-uninitialized value
Fixes: clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_METADATA_fuzzer-5458626041413632

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-08-06 20:25:23 +02:00
Kacper Michajłow 5dfc0cc841 avcodec/parser: ensure input padding is zeroed
Fixes use of uninitialized value, reported by MSAN.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>

Fixes: 70852/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5179190066872320
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-05 23:17:46 +02:00
Kacper Michajłow 2b5f000d3f avformat/jpegxl_anim_dec: ensure input padding is zeroed
Fixes use of uninitialized value, reported by MSAN.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>

Fixes: 70837/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5089407768526848
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-05 23:17:46 +02:00
Michael Niedermayer 3978e81809 avformat/img2dec: Clear padding data after EOF
Fixes: use-of-uninitialized-value
Fixes: 70852/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5179190066872320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-05 23:17:46 +02:00
Michael Niedermayer 79a1cf30d1 avformat/wavdec: Check if there are 16 bytes before testing them
Fixes: use-of-uninitialized-value
Fixes: 70839/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5212907590189056

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-05 23:17:45 +02:00
Rémi Denis-Courmont e0f9f4d491 lavu/cpu: deprecate RISC-V F, D and zba CPU flags 2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont d1326b6347 lavu/riscv: drop probing for zba CPU capability 2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont 210877c5fd sws/riscv: depend on RVB and simplify accordingly 2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont f30e5bf1f5 lavfi/riscv: depend on RVB and simplify accordingly 2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont 616fdeaea3 lavc/riscv: depend on RVB and simplify accordingly
There is no known (real) hardware with V and without the complete B
extension. B was indeed required in the RISC-V application profile from
2022, earlier than V. There should not be any relevant hardware in the
future either.

In practice, different R-V Vector optimisations in FFmpeg already depend on
every constituent of the B extension anyhow, so it would not work well.
2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont cb31f17ca8 lavu/riscv: depend on RVB and simplify accordingly 2024-08-05 21:16:26 +03:00
Nathan E. Egge ba88e8174a lavu: Set default FF_TIMER_UNITS to "ns"
Signed-off-by: Nathan E. Egge <unlord@xiph.org>
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont 4edfc11a28 lavc/h264dsp: R-V V idct4_add8 (all depths)
These are really just wrappers for idct4_add16intra functions, which are in
turn mostly wrappers for idct4_add and idct4_dc_add functions.

For benchmarks refer to the later two sets.
2024-08-05 21:16:26 +03:00
James Almer eb3cc508d8 fate/mov: add an IAMF+video muxing test
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-04 12:09:40 -03:00
James Almer 5b87869c09 avformat/mov: fix track handling when mixing IAMF and video tracks
Fixes crashes when muxing the two together.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-04 12:09:40 -03:00
Timo Rothenpieler 9a2171318d avcodec/nvenc: fix signedness of timing fields 2024-08-03 20:04:31 +02:00
James Almer 4a56b5f3d8 avcodec/cbs_h265: don't attempt to read 0 length elements in sei_3d_reference_displays_info
Fixes: 70458/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5259339779080192
Fixes: Assertion width > 0 && width <= 32 failed at libavcodec/cbs.c:608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-03 11:59:14 -03:00
Rémi Denis-Courmont de7f999481 lavc/videodsp: work-around LLVM-as
For some reason, it can't handle the normal syntax for an address operand
without an offset, so add a dummy zero offset.
2024-08-02 21:24:01 +03:00
Rémi Denis-Courmont 677f28b310 lavc/h264dsp: stick R-V V weight to 16-bit precision
T-Head C908 (ns):
h264_weight2_8_c:        1607.8
h264_weight2_8_rvv_i32:   515.0 (before)
h264_weight2_8_rvv_i32:   348.5 (after)
h264_weight4_8_c:        2255.8
h264_weight4_8_rvv_i32:  1015.0 (before)
h264_weight4_8_rvv_i32:   691.0 (after)
h264_weight8_8_c:        3857.5
h264_weight8_8_rvv_i32:  2218.8 (before)
h264_weight8_8_rvv_i32:  1561.3 (after)
h264_weight16_8_c:       7431.5
h264_weight16_8_rvv_i32: 2737.3 (before)
h264_weight16_8_rvv_i32: 1848.3 (after)

SpacemiT X60 (ns):
h264_weight2_8_c:        1624.1
h264_weight2_8_rvv_i32:   352.6 (before)
h264_weight2_8_rvv_i32:   259.3 (after)
h264_weight4_8_c:        2259.3
h264_weight4_8_rvv_i32:   685.8 (before)
h264_weight4_8_rvv_i32:   530.3 (after)
h264_weight8_8_c:        4103.3
h264_weight8_8_rvv_i32:  1581.8 (before)
h264_weight8_8_rvv_i32:  1238.6 (after)
h264_weight16_8_c:       7624.3
h264_weight16_8_rvv_i32: 2738.1 (before)
h264_weight16_8_rvv_i32: 1853.3 (after)
2024-08-02 21:24:01 +03:00
Rémi Denis-Courmont afd45c7ff7 lavc/h264dsp: stick R-V V biweight to 16-bit
T-Head C908 (ns):
h264_biweight2_8_c:        2414.5
h264_biweight2_8_rvv_i32:   701.8 (before)
h264_biweight2_8_rvv_i32:   468.5 (after)
h264_biweight4_8_c:        4655.3
h264_biweight4_8_rvv_i32:  1377.5 (before)
h264_biweight4_8_rvv_i32:   931.8 (after)
h264_biweight8_8_c:        9701.5
h264_biweight8_8_rvv_i32:  2896.0 (before)
h264_biweight8_8_rvv_i32:  2070.5 (after)
h264_biweight16_8_c:      18025.0
h264_biweight16_8_rvv_i32: 3460.8 (before)
h264_biweight16_8_rvv_i32: 1978.0 (after)

SpacemiT X60 (ns):
h264_biweight2_8_c:        2415.5
h264_biweight2_8_rvv_i32:   478.2 (before)
h264_biweight2_8_rvv_i32:   362.8 (after)
h264_biweight4_8_c:        4655.3
h264_biweight4_8_rvv_i32:   946.7 (before)
h264_biweight4_8_rvv_i32:   727.3 (after)
h264_biweight8_8_c:        9061.8
h264_biweight8_8_rvv_i32:  2071.7 (before)
h264_biweight8_8_rvv_i32:  1685.8 (after)
h264_biweight16_8_c:      18020.5
h264_biweight16_8_rvv_i32: 3457.2 (before)
h264_biweight16_8_rvv_i32: 1935.8 (after)
2024-08-02 21:24:01 +03:00
Zhao Zhili 670ff6c7ce avcodec/nvenc: rework on DTS generation
Before the patch, the method to generate DTS only works with
timebase equal to 1/fps. With timebase like 1/1000

./ffmpeg -i foo.mp4 -an -c:v h264_nvenc -enc_time_base 1/1000 bar.mp4

pts 0    dts -3
pts 160  dts 37
pts 80   dts 77
pts 40   dts 117 <-- invalid
pts 120  dts 157
pts 320  dts 197
pts 240  dts 237
pts 200  dts 277 <-- invalid
pts 280  dts 317 <-- invalid

The generated DTS can be larger than PTS, since it only reorder the
input PTS and minus the number of frame delay, which doesn't take
timebase into account. It should minus the "time" of frame delay.

9a245bd trying to fix the issue, but the implementation is incomplete,
which only use time_base.num. Then it got reverted by ac7c265b33.

After this patch:

pts 0    dts -120
pts 160  dts -80
pts 80   dts -40
pts 40   dts 0
pts 120  dts 40
pts 320  dts 80
pts 240  dts 120
pts 200  dts 160
pts 280  dts 200

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-08-02 17:57:19 +02:00
Roman Arzumanyan bcea693f75 avcodec/cuviddec: more accurately guess probed sw pixel format
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-08-02 17:38:46 +02:00
Gnattu OC d50f9701b6 avutil/hwcontext_videotoolbox: Correctly set trc
The color trc key was assigned a color primaries value which causes
the resulting colorspace is always SDR.

Fixes #10884.

Signed-off-by: Gnattu OC <gnattuoc@me.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-02 10:24:09 +08:00
Rémi Denis-Courmont 1b2a925e94 lavc/riscv: drop probing for F & D extensions
F and D extensions are included in all RISC-V application profiles ever
made (so starting from RV64GC a.k.a. RVA20). Realistically they need to be
selected at compilation time.

Currently, there are no consumers for these two flags. If there is ever a
need to reintroduce F- or D-specific optimisations, we can always use
__riscv_f or __riscv_d compiler predefined macros respectively.
2024-08-01 22:56:50 +03:00
Rémi Denis-Courmont 2f083fd581 lavc/audiodsp: drop R-V F vector_clipf
This is now firmly slower than C.

SiFive-U74 (cycles):
audiodsp.vector_clipf_c:   31.2
audiodsp.vector_clipf_rvf: 39.5
2024-08-01 19:29:40 +03:00
Rémi Denis-Courmont c48213b2dc lavc/audiodsp: drop opposite sign optimisation
This was added along side the original SSE(one) DSP function in
0a68cd876e without rationale. This was
presumably faster on x87, which is no longer relevant since we pretty
much assume SSE2 or later on x86.

Meanwhile this function is ~2.5x slower than the normal floating point
one on SiFive-U74.
2024-08-01 19:29:40 +03:00
Rémi Denis-Courmont d86b6767ce lavc/audiodsp: properly unroll vector_clipf
Given that source and destination can alias, the compiler was forced to
perform each read-modify-write sequentially. We cannot use the `restrict`
qualifier to avoid this here because the AC-3 encoder uses the function
in-place. Instead this commit provides an explicit guarantee to the
compiler that batches of 8 elements will not overlap, so that it can
interleave calculations.

In practice contemporary optimising compilers are able to unroll and keep
the temporary array in FPU registers (without spilling).

On SiFive-U74, this speeds the same signs branch by 4x, and the
opposite signs branch 1.5x.
2024-08-01 19:29:40 +03:00
Rémi Denis-Courmont d527d23872 lavc/pixblockdsp: specialise aligned 16-bit get_pixels
The current code assumes that we have unaligned rows, which hurts on
platforms with slower unaligned accesses. (Also, this lets the compiler
unroll manually, which it seems to do in practice.)
2024-08-01 18:44:01 +03:00
Rémi Denis-Courmont 656a9664bf checkasm/riscv: preserve T1 whilst calling...
This preserves T1 whilst calling the instrumented function. In a Sci-Fi
setting where type-based Control Flow Integrity (CFI) is supported, the
calling code (i.e., the `checkasm` test case) will set T1 to the expected
value of the landing pad label (LPL) of the instrumented function.

The call wrapper will always use LPL zero which is a wild card. We should
preserve the value of T1 at least until the indirect call to the
instrumented function. Of course this is Sci-Fi, because:
1) there is no hardware (or even QEMU) support yet,
2) all our assembler functions currently use LPL zero anyway.

This uses T3 rather than T2 because indirect branches with T2 is reserved
for notionally direct calls made with an indirect call instruction (e.g.
due to GOT indirection), and are exempted from forward-edge CFI checks.
2024-08-01 18:44:01 +03:00
Rémi Denis-Courmont 54b1970c60 lavu/riscv: fix return type 2024-08-01 18:44:01 +03:00
Rémi Denis-Courmont 54ae270213 lavc/rv34dsp: use saturating add/sub for R-V V DC add
T-Head C908 (cycles):
rv34_idct_dc_add_c:      113.2
rv34_idct_dc_add_rvv_i32: 48.5 (before)
rv34_idct_dc_add_rvv_i32: 39.5 (after)
2024-08-01 18:43:04 +03:00
Rémi Denis-Courmont 952b426f3b lavc/bswapdsp: add RV Zvbb bswap16 and bswap32 2024-08-01 18:43:04 +03:00
James Almer f4daf633b2 avcodec/aacps_tablegen_template: don't redefine CONFIG_HARDCODED_TABLES
Fixes relevant warnings when compiling with --enable-hardcoded-tables

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-01 12:13:53 -03:00
James Almer 6f8e365a2a avutil/hwcontext_vaapi: use the correct type for VASurfaceAttribExternalBuffers.buffers
Should fix ticket #11115.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-01 12:13:53 -03:00
Marvin Scholz ca7fcf5089 avutil/hwcontext_videotoolbox: Fix build with older SDKs
The previous fix was not sufficient.
To make things easier to reason about, split the function and
add the guards there instead of complicating the call site more.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-01 20:58:27 +08:00
Anton Khirnov bcf08c1171 lavc/ffv1: change FFV1SliceContext.plane into a RefStruct object
Frame threading in the FFV1 decoder works in a very unusual way - the
state that needs to be propagated from the previous frame is not decoded
pixels(¹), but each slice's entropy coder state after decoding the slice.

For that purpose, the decoder's update_thread_context() callback stores
a pointer to the previous frame thread's private data. Then, when
decoding each slice, the frame thread uses the standard progress
mechanism to wait for the corresponding slice in the previous frame to
be completed, then copies the entropy coder state from the
previously-stored pointer.

This approach is highly dubious, as update_thread_context() should be
the only point where frame-thread contexts come into direct contact.
There are no guarantees that the stored pointer will be valid at all, or
will contain any particular data after update_thread_context() finishes.

More specifically, this code can break due to the fact that keyframes
reset entropy coder state and thus do not need to wait for the previous
frame. As an example, consider a decoder process with 2 frame threads -
thread 0 with its context 0, and thread 1 with context 1 - decoding a
previous frame P, current frame F, followed by a keyframe K. Then
consider concurrent execution consistent with the following sequence of
events:
* thread 0 starts decoding P
* thread 0 reads P's slice header, then calls
  ff_thread_finish_setup() allowing next frame thread to start
* main thread calls update_thread_context() to transfer state from
  context 0 to context 1; context 1 stores a pointer to context 0's private
  data
* thread 1 starts decoding F
* thread 1 reads F's slice header, then calls
  ff_thread_finish_setup() allowing the next frame thread to start
  decoding
* thread 0 finishes decoding P
* thread 0 starts decoding K; since K is a keyframe, it does not
  wait for F and reallocates the arrays holding entropy coder state
* thread 0 finishes decoding K
* thread 1 reads entropy coder state from its stored pointer to context
  0, however it finds state from K rather than from P

This execution is currently prevented by special-casing FFV1 in the
generic frame threading code, however that is supremely ugly. It also
involves unnecessary copies of the state arrays, when in fact they can
only be used by one thread at a time.

This commit addresses these deficiencies by changing the array of
PlaneContext (each of which contains the allocated state arrays)
embedded in FFV1SliceContext into a RefStruct object. This object can
then be propagated across frame threads in standard manner. Since the
code structure guarantees only one thread accesses it at a time, no
copies are necessary. It is also re-created for keyframes, solving the
above issue cleanly.

Special-casing of FFV1 in the generic frame threading code will be
removed in a later commit.

(¹) except in the case of a damaged slice, when previous frame's pixels
    are used directly
2024-08-01 10:09:26 +02:00
Anton Khirnov c335218a81 lavc/ffv1dec: inline copy_fields() into update_thread_context()
It is now only called from a single place, so there is no point in it
being a separate function.
2024-08-01 10:09:26 +02:00
Anton Khirnov d44812f7cf lavc/ffv1dec: stop using per-slice FFV1Context
All remaining accesses to them are for fields that have the same value
in the main encoder context.

Drop now-unused FFV1Context.slice_contexts.
2024-08-01 10:09:26 +02:00
Anton Khirnov 2b21cdff6e lavc/ffv1dec: move slice_damaged to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov f2aeba56c4 lavc/ffv1dec: move slice_reset_contexts to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov 84dda32202 lavc/ffv1enc: stop using per-slice FFV1Context
All remaining accesses to them are for fields that have the same value
in the main encoder context.
2024-08-01 10:09:26 +02:00
Anton Khirnov 96e8af6c4d lavc/ffv1: move ac_byte_count to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov e7d0f44138 lavc/ffv1enc: store per-slice rc_stat(2?) in FFV1SliceContext
Instead of the per-slice FFV1Context, which will be removed in future
commits.
2024-08-01 10:09:26 +02:00
Anton Khirnov 7b2bfba55d lavc/ffv1: move RangeCoder to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov 28769f6bc1 lavc/ffv1: move FFV1Context.plane to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov 9b86ba5a92 lavc/ffv1: always use the main context values of ac
It cannot change between slices.
2024-08-01 10:09:26 +02:00
Anton Khirnov a57c88d67b lavc/ffv1: move FFV1Context.slice_{coding_mode,rct_.y_coef} to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov 39486a2b29 lavc/ffv1: always use the main context values of plane_count/transparency
They cannot change between slices.
2024-08-01 10:09:26 +02:00
Anton Khirnov 492df65201 lavc/ffv1: drop write-only PlaneContext.interlace_bit_state 2024-08-01 10:09:26 +02:00
Anton Khirnov a411fc5a84 lavc/ffv1: drop redundant PlaneContext.quant_table
It is a copy of FFV1Context.quant_tables[quant_table_index].
2024-08-01 10:09:26 +02:00
Anton Khirnov 4b9f7c7e3a lavc/ffv1: drop redundant FFV1Context.quant_table
In all cases except decoding version 1 it's either not used, or contains
a copy of a table from quant_tables, which we can just as well use
directly.

When decoding version 1, we can just as well decode into
quant_tables[0], which would otherwise be unused.
2024-08-01 10:09:26 +02:00
Anton Khirnov d2f507233a lavc/ffv1enc: move bit writer to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov 889faedd26 lavc/ffv1dec: move the bitreader to stack
There is no reason to place it in persistent state.
2024-08-01 10:09:25 +02:00
Anton Khirnov 19e9f3d5f2 lavc/ffv1: move run_index to the per-slice context 2024-08-01 10:09:25 +02:00
Anton Khirnov 91d3c1ac47 lavc/ffv1: move sample_buffer to the per-slice context 2024-08-01 10:09:25 +02:00
Anton Khirnov 54aa33f116 lavc/ffv1: add a per-slice context
FFV1 decoder and encoder currently use the same struct - FFV1Context -
both as codec private data and per-slice context. For this purpose
FFV1Context contains an array of pointers to per-slice FFV1Context
instances.

This pattern is highly confusing, as it is not clear which fields are
per-slice and which per-codec.

Address this by adding a new struct storing only per-slice data. Start
by moving slice_{x,y,width,height} to it.
2024-08-01 10:09:25 +02:00
Anton Khirnov d845ea49c5 lavc/ffv1dec: move copy_fields() under HAVE_THREADS
It is unused otherwise
2024-08-01 10:09:25 +02:00
Anton Khirnov 3a5c814b19 lavc/ffv1dec: drop a pointless variable in decode_slice()
fsdst is by construction always equal to fs, there is even an
av_assert1() checking that. Just use fs directly.
2024-08-01 10:09:25 +02:00
Anton Khirnov 4da146ba83 lavc/ffv1dec: drop FFV1Context.cur
It is merely a pointer to FFV1Context.picture.f, which can just as well
be used directly.
2024-08-01 10:09:25 +02:00
Anton Khirnov e1fa107fd1 lavc/ffv1dec: simplify slice index calculation 2024-08-01 10:09:25 +02:00
Anton Khirnov d776fa4e4d lavc/ffv1dec: declare loop variables in the loop where possible 2024-08-01 10:09:25 +02:00
Anton Khirnov 8e19c24634 tests/fate/vcodec: add vsynth tests for FFV1 version 2 2024-08-01 10:09:25 +02:00
Michael Niedermayer 06f5ed40f8 avcodec/snow: Fix off by 1 error in run_buffer
Fixes: out of array access
Fixes: 70741/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5703668010647552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-01 00:18:02 +02:00
Michael Niedermayer 58fbeb59e7 avcodec/utils: apply the same alignment to YUV410 as we do to YUV420 for snow
The snow encoder uses block based motion estimation which can read out of array if
insufficient alignment is used

It may be better to only apply this for the encoder, as it would safe a few bytes of memory
for the decoder. Until then, this fixes the issue in a simple way.

Fixes: out of array access
Fixes: 68963/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-4979988435632128
Fixes: 68969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6239933667803136.fuzz
Fixed: 70497/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5751882631413760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-01 00:18:02 +02:00
Michael Niedermayer ed96ac87a9 avformat/iamf_parse: Check for 0 samples
Fixes: division by zero
Fixes: 70561/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6199435013455872
Fixes: 70565/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5783790316748800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-01 00:18:02 +02:00
Nathan E. Egge 8280ec7a32 lavu/riscv: Revert d808070, removing AV_READ_TIME
The implementation of ff_read_time() for RISC-V uses rdtime which has
 precision on existing hardware too low (!) for benchmarking purposes.
Deleting this implementation falls back on clock_gettime() which was
 added as the default ff_read_time() implementation in 33e4cc9.
Below are metrics gathered on SpacemiT K1, before and after this commit:

Before:

$ tests/checkasm/checkasm --bench
benchmarking with native FFmpeg timers
nop: 0.0
checkasm: using random seed 3473665261
checkasm: bench runs 1024 (1 << 10)
RVI:
 - pixblockdsp.get_pixels                [OK]
 - vc1dsp.mspel_pixels                   [OK]
RVF:
 - audiodsp.audiodsp                     [OK]
checkasm: all 4 tests passed
audiodsp.vector_clipf_c: 1388.7
audiodsp.vector_clipf_rvf: 261.5
get_pixels_c: 2.0
get_pixels_rvi: 1.5
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_c: 8.0
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_rvi: 1.0
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_c: 2.0
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_rvi: 0.5

After:

$ tests/checkasm/checkasm --bench
benchmarking with native FFmpeg timers
nop: 56.4
checkasm: using random seed 1021411603
checkasm: bench runs 1024 (1 << 10)
RVI:
 - pixblockdsp.get_pixels                [OK]
 - vc1dsp.mspel_pixels                   [OK]
RVF:
 - audiodsp.audiodsp                     [OK]
checkasm: all 4 tests passed
audiodsp.vector_clipf_c: 23236.4
audiodsp.vector_clipf_rvf: 11038.4
get_pixels_c: 79.6
get_pixels_rvi: 48.4
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_c: 329.6
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_rvi: 38.1
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_c: 89.9
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_rvi: 17.1

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-07-31 17:48:50 +03:00
James Almer ab5c612137 avcodec/Makefile: use the correct path for aacdec_fixed.o when setting its dependencies
Fixes ticket #11112

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-31 11:32:56 -03:00
Anton Khirnov 43f702a253 lavfi/framesync: avoid forcing frame writability unnecessarily
Callers of ff_framesync_get_frame() generally do not expect the result
to be writable, those that do (e.g. ff_framesync_dualinput_get_writable())
ensure writability themselves.

Significantly reduces memory consumption in complex graphs with
framesync-based filters (e.g. scale, ssim).

Reported-By: Mark Shwartzman
2024-07-31 11:12:45 +02:00
Rémi Denis-Courmont 262168b04e lavc/videodsp: RISC-V zicbop prefetch
There are currently no ways to run-time detect the CPU capability, so we
take it for granted (in the worst case, it will execute NOPs).
2024-07-30 18:41:51 +03:00
Rémi Denis-Courmont 4570b9f3c4 configure: check if assembler supports RV zicbop
zicbop is the Cache Block Operation, Prefetch extension to RVI.
2024-07-30 18:41:51 +03:00
Rémi Denis-Courmont 324eba69f7 lavc/vc1dsp: use saturating arithmetic for RVV inv_trans_dc
T-Head C908 (cycles):
vc1dsp.vc1_inv_trans_4x4_dc_c:      113.7
vc1dsp.vc1_inv_trans_4x4_dc_rvv_i32: 46.5 (before)
vc1dsp.vc1_inv_trans_4x4_dc_rvv_i32: 45.5 (after)
vc1dsp.vc1_inv_trans_4x8_dc_c:      230.7
vc1dsp.vc1_inv_trans_4x8_dc_rvv_i32: 65.7 (before)
vc1dsp.vc1_inv_trans_4x8_dc_rvv_i32: 52.5 (after)
vc1dsp.vc1_inv_trans_8x4_dc_c:      246.7
vc1dsp.vc1_inv_trans_8x4_dc_rvv_i64: 56.7 (before)
vc1dsp.vc1_inv_trans_8x4_dc_rvv_i64: 45.5 (after)
vc1dsp.vc1_inv_trans_8x8_dc_c:      419.7
vc1dsp.vc1_inv_trans_8x8_dc_rvv_i64: 81.2 (before)
vc1dsp.vc1_inv_trans_8x8_dc_rvv_i64: 53.5 (after)
2024-07-30 18:41:51 +03:00
Rémi Denis-Courmont 784a72a116 lavc/vc1dsp: unify R-V V DC bypass functions 2024-07-30 18:41:51 +03:00
Rémi Denis-Courmont bd0c3edb13 lavu/riscv: count bytes rather than words for bswap32
This removes the dependency on Zba at essentially zero cost.
2024-07-30 18:41:51 +03:00
Rémi Denis-Courmont 5171baa228 lavc/ac3dsp: fix R-V CPU requirements
It probably will not matter on any real hardware, but the Zbb optimisations
do not require Zba. And then, we need HAVE_RVV to build the RVV stuff.
2024-07-30 18:41:51 +03:00
Peter Ross 0e09f6d690 avcodec/adpcm: only process right samples when decoding stereo
Fixes Coverity issue #1610760.
2024-07-30 19:55:31 +10:00
Leo Izen 7bb5626fa7 avcodec/pngenc: fix sBIT writing for indexed-color PNGs
We currently write invalid sBIT entries for indexed PNGs, which by PNG
specification[1] must be 3-bytes long. The values also are capped at 8
for indexed-color PNGs, not the palette depth. This patch fixes both of
these issues previously fixed in the decoder, but not the encoder.

[1]: https://www.w3.org/TR/png-3/#11sBIT

Regression since: c125860892.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla: <ramiro.polla@gmail.com>
2024-07-30 05:43:36 -04:00
Leo Izen 825606641b avcodec/pngdec: use 8-bit sBIT cap for indexed PNGs per spec
The PNG specification[1] says that sBIT entries must be at most the bit
depth specified in IHDR, unless the PNG is indexed-color, in which case
sBIT must be between 1 and 8. We should not reject valid sBITs on PNGs
with indexed color.

[1]: https://www.w3.org/TR/png-3/#11sBIT

Regression since 84b454935f.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
2024-07-30 05:43:31 -04:00
Marth64 e2105b2800 avcodec/aacenc: Correct option description for aac_coder fast
The description advertises fast as "Default fast search", but
this has not been the default for a long time (current default
is twoloop).

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-30 05:42:50 -04:00
Fei Wang 79b4869959 lavu/hwcontext_qsv: Derive bind flag from frame type if no valid surface
Fix cmd:
ffmpeg.exe -init_hw_device d3d11va=d3d -init_hw_device qsv=qsv@d3d \
-filter_hw_device d3d -hwaccel qsv -hwaccel_output_format qsv      \
-i in.h264 -vf "hwmap,format=d3d11,hwdownload,format=nv12" -y out.yuv

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Tested-by: Tong Wu <wutong1208@outlook.com>
2024-07-30 13:41:15 +08:00
Fei Wang d30a9fdc80 lavc/qsvdec: Add VVC decoder
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-30 13:40:21 +08:00
Fei Wang cf9c398fc1 configure: Alphabetical order for av1 codecs
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-30 13:32:44 +08:00
James Almer 9e7a93c6fd x86/intreadwrite: add SSE2 optimized AV_COPY128U
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 23:17:52 -03:00
James Almer 92b317245c avformat/mov: use AV_WL*A
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 21:33:31 -03:00
James Almer f1fcc3ca5f avformat/matroskadec: use AV_WL32A
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 21:33:31 -03:00
James Almer 09de979ff6 avcodec/amfenc_av1: use AV_WL32A
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 21:33:31 -03:00
James Almer 753f2aeed7 avutil/intreadwrite: add missing aligned read/write macros
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 21:33:31 -03:00
Rémi Denis-Courmont 7b24f96c87 lavc/vp9dsp: remove R-V I intra functions
At this point, they are identical to the C code, except for instruction
ordering. In fact, they are typically slower or no faster than the C code.
2024-07-29 21:16:41 +03:00
Rémi Denis-Courmont 7aa6510fe1 lavc/vp9dsp: copy 8 pixels at once
In the 8-bit case, we can actually read/write 8 aligned pixel values per
load/store, which unsurprisingly tends to be faster on 64-bit systems (and
makes no differences on 32-bit systems). This requires ifdef'ing though.
2024-07-29 21:16:41 +03:00
Rémi Denis-Courmont c98127c00e lavc/vp9dsp: use restrict qualifier for copy/avg MC
Same as previous commit.
2024-07-29 21:16:41 +03:00
Rémi Denis-Courmont 56fc5fc6ce lavc/vp9dsp: restrict vertical intra pointers
This lets the compiler unroll ever so slightly better (at least in the
16x16 case for RISC-V GCC).
2024-07-29 21:16:41 +03:00
James Almer afb06aef7e avcodec/decode: remove unused argument from ff_frame_new_side_data_from_buf()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 14:00:48 -03:00
James Almer e7d3ff8dcd avformat/mov: check that child boxes of trak are only present inside it
Based on the check done for the stco box.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-28 17:28:19 -03:00
James Almer 2aa63784b5 avformat/mov: check that sample and chunk count is 1 for HEIF
Fixes NULL pointer dereference in broken/fuzzed streams.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-28 17:28:19 -03:00
Rémi Denis-Courmont 39ced529b0 lavu/riscv: implement floating point clips
Unlike x86, fmin/fmax are single instructions, not function calls. They
are much much faster than doing a comparison, then branching based on its
results. With this, audiodsp.vector_clipf gets almost twice as fast, and
a properly unrollled version of it gets 4-5x faster, on SiFive-U74.
This is only the low-hanging fruit: FFMIN and FFMAX are presumably
affected as well.

This likely applies to other instruction sets with native IEEE floats,
especially those lacking a conditional select instruction.
2024-07-28 21:24:58 +03:00
Rémi Denis-Courmont b0b3bea10b lavc/h264dsp: use saturing add/sub for R-V V 8-bit DC add
T-Head C908 (cycles):
h264_idct4_dc_add_8bpp_c:      109.2
h264_idct4_dc_add_8bpp_rvv_i32: 34.5 (before)
h264_idct4_dc_add_8bpp_rvv_i32: 25.5 (after)
h264_idct8_dc_add_8bpp_c:      418.7
h264_idct8_dc_add_8bpp_rvv_i64: 69.5 (before)
h264_idct8_dc_add_8bpp_rvv_i64: 33.5 (after)
2024-07-28 21:24:12 +03:00
Shiyou Yin 4713a5cc24 swscale: [loongarch] Fix checkasm-sw_yuv2rgb failure.
Reviewed-by: 陈昊 <chenhao@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-28 19:02:16 +02:00
Michael Niedermayer 3b9c6c7fbb avcodec/adpcm: Remove setting min_channel to value it is already set to
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-28 19:02:15 +02:00
Tong Wu b1d410716b lavc/d3d12va_encode: trim header alignment at output
It is d3d12va's requirement that the FrameStartOffset must be aligned as
per hardware limitation. However, we could trim this alignment at output
to reduce coded size. A aligned_header_size is added to
D3D12VAEncodePicture.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2024-07-28 17:50:30 +02:00
Rémi Denis-Courmont 9b4655c3a1 lavc/vp8dsp: use saturating add/sub for R-V V DC add
T-Head C908 (cycles):
vp7_idct_dc_add_c:          108.5
vp7_idct_dc_add_rvv_i32:     56.2 (before)
vp7_idct_dc_add_rvv_i32:     47.2 (after)
vp8_idct_dc_add_c:           96.2
vp8_idct_dc_add_rvv_i32:     43.0 (before)
vp8_idct_dc_add_rvv_i32:     34.0 (after)
2024-07-28 17:37:21 +03:00
Rémi Denis-Courmont bbfc0ac9ca lavc/riscv: don't set vxrm if unnecessary
While narrowing clip is nominally a rounding operation, the rounding mode
has no arithmetic consequence if the right shift is by zero bits.
2024-07-28 17:37:21 +03:00
Niklas Haas e42a0763b7 avcodec/dovi_rpudec: clarify semantics
ff_dovi_rpu_parse() and ff_dovi_rpu_generate() are a bit inconsistent in
that they expect different levels of encapsulation, due to the nature of
how this is handled in the context of different APIs. Clarify the status
quo. (And fix an incorrect reference to the RPU payload bytes as 'RBSP')
2024-07-28 12:20:07 +02:00
Niklas Haas 6b66df74b8 avcodec/dovi_rpu: correctly copy num_ext_blocks 2024-07-28 12:20:07 +02:00
Niklas Haas b5aeafc00a fftools/ffprobe: implement dv_md_compression 2024-07-28 12:20:07 +02:00
Niklas Haas 3d5d60d041 avformat/dump: implement dv_md_compression 2024-07-28 12:20:07 +02:00
Niklas Haas ce8166a19c avformat/mpegts: implement dv_md_compression 2024-07-28 12:20:07 +02:00
Niklas Haas b3a9fab9da avformat/dovi_isom: implement dv_md_compression 2024-07-28 12:20:07 +02:00
Niklas Haas cbea92c84d avutil/dovi_meta: add dv_md_compression to cfg record
This field is used to signal the compression method in use.
2024-07-28 12:20:07 +02:00
Zhao Zhili 719e46f54c avcodec/videotoolboxenc: Fix variable type of AV_OPT_TYPE_BOOL
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-26 19:54:56 +08:00
Zhao Zhili f4e0f40230 avcodec/videotoolboxenc: Set default bitrate to zero
Zero is auto mode. From the doc of videotoolbox:

   The default bit rate is zero, which indicates that the video
   encoder should determine the size of compressed data.

Before the patch, the default bitrate is 200000 setting by
avcodec/options_table, which doesn't work for most of cases.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-26 19:54:20 +08:00
Zhao Zhili d07da7539d avcodec/videotoolboxenc: Fix bitrate doesn't work as expected
Commit 4ef5e7d472 add qmin/qmax support to videotoolbox encoder.
The default value of (qmin, qmax) is (2, 31), which makes bitrate
control doesn't work as users' expectations.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-26 19:54:20 +08:00
Rémi Denis-Courmont 8030876d1c checkasm/riscv: align the landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont 7dde8be29f checkasm/riscv: add forward-edge CFI landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont 4f2472909e sws/riscv: add forward-edge CFI landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont b5c111272b lavfi/riscv: add forward-edge CFI landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont f2c30fe15a lavc/riscv: add forward-edge CFI landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont a14d21a446 lavu/riscv: add forward-edge CFI landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont 6319601343 lavu/riscv: assembly for zicfilp LPAD
This instruction, if aligned on a 4-byte boundary, defines a valid target
("landing pad") for an indirect call or jump. Since this instruction is a
HINT, it is safe to assemble even if not included in the target
instruction set architecture.

The necessary alignment is already provided by the `func` macro. However
this still lacks the ELF attribute to indicate that the zicfilp is supported
in simple mode. This is left for future work as the ELF specification is not
ratified as of yet.

This will also nonobviously require the assembler to support zicfilp,
insofar as the `tail` pseudo-instruction shall clobber T2 (instead of T1) as
its temporary register.
2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont 982376660c lavu/riscv: align functions to 4 bytes
Currently the start of the byte range for each function is aligned to
4 bytes. But this can lead to situations whence the function is preceded
by a 2-byte C.NOP at the aligned 4-byte boundary. Then the first actual
instruction and the function symbol are only aligned on 2 bytes.

This forcefully disables compression for the alignment and the symbol,
thus ensuring that there is no padding before the function.
2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont b62586e310 lavc/h264dsp: use RISC-V B extension
This saves one register and one instruction per transform.
add16 and add16intra thus become stack-less.
2024-07-25 23:10:01 +03:00
Rémi Denis-Courmont 45d7078a21 lavu/riscv: add CPU flag for B bit manipulations
The B extension was finally ratified in May 2024, encompassing:
- Zba (addresses),
- Zbb (basics) and
- Zbs (single bits).
It does not include Zbc (base-2 polynomials).
2024-07-25 23:09:58 +03:00
Rémi Denis-Courmont 529d423012 lavu/riscv: remove bespoke SH{1,2,3}ADD assembler
configure checks that the assembler supports the B extension (or rather
its constituents) anyway. These macros were dodging sanity checks for
unsupported instructions and nothing else.
2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont 5f10173fa1 lavu/riscv: require B or zba explicitly 2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont e91a8cc4de sws/riscv: require B or zba explicitly 2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont 9108f3e5e1 lavfi/riscv: require B or zba explicitly 2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont 187d4d066a lavc/riscv: require B or zba explicitly 2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont 7f97344bfb lavu/riscv: grok B as an extension
The RISC-V B bit manipulation extension was ratified only two months ago.
But it is strictly equivalent to the union of the zba, zbb and zbs
extensions which were defined almost 3 years earlier. Rather than require
new assembler, we can just match the extension name manually and translate
it into its constituent parts.
2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont 1e7ab200ee lavu/riscv: allow any number of extensions
This reworks the func/endfunc macros to support any number of ISA extension
as parameters.
2024-07-25 18:55:48 +03:00
Araz Iusubov 2128c17739 avcodec/amf_enc: av1 cropping support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-25 10:22:02 -03:00
Rémi Denis-Courmont 896c22ef00 lavc/vp8dsp: fix RV32 stack alignment
SP must be a multiple of 16 bytes at all times on POSIX - even in leaf
functions - so that signal handlers have a properly aligned stack.
2024-07-24 22:08:54 +03:00
Jens Frederich 60b1750134 avdevice/dshow: Don't skip audio devices if no video device is present
The search of the current DirectShow device list has been customized so
that audio devices are always found even if no video device is connected.

Signed-off-by: Jens Frederich <jens.frederich@vector.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-24 14:45:20 +02:00
Martin Storsjö 97a708a507 checkasm: Increase the tolerance for ac3_sum_square_butterfly_float
Increase the tolerance from 10 ulp to 11 ulp. This fixes occasional
errors for some inputs; the errors could be reproduced on
aarch64/neon builds, with "checkasm --test=ac3dsp 3446175925".

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-24 12:10:33 +03:00
Anton Khirnov d1fa39d08d fftools/ffmpeg: prefer real errors over EOF in err_merge()
Fixes an issue in 6.1 when reading a corrupted file with -xerror would
exit with success. This specific issue is not present in master, but
this should generally be a more robust behaviour.

Reported-by: Andrej Peterka
2024-07-24 08:20:21 +02:00
Lynne b1b69ccbc0 aacdec: set ac->output_elements upon channel element free
The issue is that ac->output_elements is populated from
ac->che, which may be freed, leaving dangling pointers in this
list.

Should fix clusterfuzz.
2024-07-24 00:32:38 +02:00
Michael Niedermayer 204f7f8cc7 avcodec/hdrenc: Allocate more space
This needs to be double checked or a checking way of writing should be used

Fixes: out of array access
Fixes: 70007/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HDR_fuzzer-5478704150020096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:17 +02:00
Michael Niedermayer 5dde255abd avcodec/cfhdenc: Height of 16 is not supported
Fixes: out of array access
Fixes: 68941/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5990952685600768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:17 +02:00
Michael Niedermayer a308d79e4d avcodec/cfhdenc: Allocate more space
Fixes: Assertion failure
Fixes: 68979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5375874714107904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:16 +02:00
Michael Niedermayer 6420c1bf30 avcodec/osq: fix integer overflow when applying factor
Fixes: signed integer overflow: -35511773 * 256 cannot be represented in type 'int'
Fixes: 70406/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6545326804434944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:16 +02:00
Michael Niedermayer 56c334d732 avcodec/osq: avoid using too large numbers for shifts and integers in update_residue_parameter()
Fixes: 2.96539e+09 is outside the range of representable values of type 'int'
Fixes: Assertion n>=0 && n<=32 failed at libavcodec/get_bits.h:423
Fixes: 62241/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-4525761925873664
Fixes: 70406/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6545326804434944

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:16 +02:00
Michael Niedermayer 3cd077e282 avcodec/vaapi_encode: Check hwctx
Fixes: null pointer dereference
Fixes: 70376/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_VAAPI_fuzzer-4733551250046976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:15 +02:00
Michael Niedermayer 2f7aaa33e7 avcodec/aac/aacdec_lpd: Check kv indec
Fixes: index 9 out of bounds for type 'uint32_t [8][8]'
Fixes: 70363/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6723855293415424.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:15 +02:00
Michael Niedermayer ae20be8b5d avcodec/aac/aacdec_usac: Dont leave invalid max_sfb in the context
Fixes: out of array read
Fixes: 70363/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6723855293415424.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:15 +02:00
Michael Niedermayer d52fabaec0 avcodec/hevc/hevcdec: avoid signed shifts with lt_idx_sps
Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 70122/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5172200613675008

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:14 +02:00
Michael Niedermayer 419eee6356 avcodec/proresdec: Consider negative bits left
Fixes: 70036/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_fuzzer-6298797647396864
Fixes: shift exponent 40 is too large for 32-bit type 'uint32_t' (aka 'unsigned int')

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:14 +02:00
Michael Niedermayer 6194cb87cb avcodec/alsdec: Clear shift_value
(the exact issue is unreproducable but the use of uninitialized data is reproducable)

Should fix: signed integer overflow: -2147483648 - 127 cannot be represented in type 'int'
Should fix: 69881/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-4751301204836352

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:14 +02:00
Michael Niedermayer 5d9544cfb0 avcodec/hevc/hevcdec: Do not allow slices to depend on failed slices
An alternative would be to leave the context unchanged on failure of hls_slice_header()

Fixes: out of array access
Fixes: NULL pointer dereference
Fixes: 69584/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5931086299856896
Fixes: 69724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5104066422702080
Fixes: 70422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5908731129298944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:13 +02:00
Michael Niedermayer 586f6fda1d avformat/mov: add an EOF check in IPRP
Fixes: Timeout
Fixes: 69230/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6540512101203968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:13 +02:00
Michael Niedermayer 55af81b5a4 Revert "avformat/udp: Fix temporary buffer race"
This is not needed

This reverts commit 7b2f67ea77.
2024-07-23 23:21:13 +02:00
Martin Storsjö 4acb9b7d10 aarch64: vvc: Fix unnecessary extra spaces
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 16:04:28 +03:00
Martin Storsjö 99598629e8 aarch64: vvc: Consistently use # for immediate constants
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 15:24:37 +03:00
Martin Storsjö 400843151d aarch64: vvc: Fix compilation of alf.S with MSVC 2022 17.7 and older
Use the "ldur" instruction explicitly, instead of having the
assembler implicitly convert "ldr" instructions to "ldur".

This fixes build errors like these:

libavcodec\aarch64\vvc\alf.o.asm(1023) : error A2518: operand 2: Memory offset must be aligned
        ldr             q22, [x3, #24]
libavcodec\aarch64\vvc\alf.o.asm(1024) : error A2518: operand 2: Memory offset must be aligned
        ldr             q24, [x2, #24]
libavcodec\aarch64\vvc\alf.o.asm(1393) : error A2518: operand 2: Memory offset must be aligned
        ldr             q22, [x3, #24]
libavcodec\aarch64\vvc\alf.o.asm(1394) : error A2518: operand 2: Memory offset must be aligned
        ldr             q24, [x2, #24]

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 15:24:33 +03:00
aaron 53d0f9afb4 avcodec/electronicarts: decode framerate
Reviewed-by: Peter Ross <pross@xvid.org>
2024-07-23 06:40:30 +10:00
aaron f44353cfb6 avcodec/adpcm: Mono ADPCM for EA WVE Files
Reviewed-by: Peter Ross <pross@xvid.org>
2024-07-23 06:40:30 +10:00
Rémi Denis-Courmont 0e32192548 lavu/riscv: do not fallback to AT_HWCAP auxillary vector
If __riscv_hwprobe() fails, then the kernel version is presumably too
old. There is not much point falling back to the auxillary vector.

- The Linux kernel requires I, so the flag is always set on Linux, and
  run-time detection is unnecessary. Our RISC-V assembler does anyway not
  support targets without I.

- Linux can compile with or without F and D, but it cannot perform
  run-time detection for them (a kernel with F support will not boot a
  processor without F). The run-time detection is thus useless in that
  case. Besides F and D extensions are used throughout the C code, so
  their run-time detection would not be practical.

- Support for V was added in a later kernel version than riscv_hwprobe(),
  so the system call will always be available if the kernel supports V.
  The only exception would be vendor kernel forks, but those are known to
  haphasardly pretend to support V on systems without actual V support, or
  with only pre-ratification binary-incompatible version. Furthermore, a
  large chunk of our optimisations require Zba and/or Zbb which cannot be
  detected with HWCAP in those kernels.

For what it is worth, OpenJDK already took a similar action. Note that this
keeps AT_HWCAP usage for platforms with neither C run-time <sys/hwprobe.h>
nor kernel <asm/hwprobe.h>, notably kernels other than Linux.
2024-07-22 19:43:51 +03:00
Zhao Zhili 2d4ef304c9 avcodec/vvc: Add aarch64 neon optimization for ALF
vvc_alf_filter_chroma_4x4_8_c: 3.0
vvc_alf_filter_chroma_4x4_8_neon: 1.0
vvc_alf_filter_chroma_4x4_10_c: 2.7
vvc_alf_filter_chroma_4x4_10_neon: 1.0
vvc_alf_filter_chroma_4x4_12_c: 2.7
vvc_alf_filter_chroma_4x4_12_neon: 1.0
vvc_alf_filter_chroma_8x8_8_c: 10.2
vvc_alf_filter_chroma_8x8_8_neon: 3.0
vvc_alf_filter_chroma_8x8_10_c: 10.0
vvc_alf_filter_chroma_8x8_10_neon: 2.5
vvc_alf_filter_chroma_8x8_12_c: 10.0
vvc_alf_filter_chroma_8x8_12_neon: 2.5
vvc_alf_filter_chroma_16x16_8_c: 41.7
vvc_alf_filter_chroma_16x16_8_neon: 11.2
vvc_alf_filter_chroma_16x16_10_c: 39.0
vvc_alf_filter_chroma_16x16_10_neon: 10.0
vvc_alf_filter_chroma_16x16_12_c: 40.2
vvc_alf_filter_chroma_16x16_12_neon: 10.2
vvc_alf_filter_chroma_32x32_8_c: 162.0
vvc_alf_filter_chroma_32x32_8_neon: 45.0
vvc_alf_filter_chroma_32x32_10_c: 155.5
vvc_alf_filter_chroma_32x32_10_neon: 39.5
vvc_alf_filter_chroma_32x32_12_c: 155.5
vvc_alf_filter_chroma_32x32_12_neon: 40.0
vvc_alf_filter_chroma_64x64_8_c: 646.0
vvc_alf_filter_chroma_64x64_8_neon: 175.5
vvc_alf_filter_chroma_64x64_10_c: 708.2
vvc_alf_filter_chroma_64x64_10_neon: 166.7
vvc_alf_filter_chroma_64x64_12_c: 619.2
vvc_alf_filter_chroma_64x64_12_neon: 157.2
vvc_alf_filter_chroma_128x128_8_c: 2611.5
vvc_alf_filter_chroma_128x128_8_neon: 698.2
vvc_alf_filter_chroma_128x128_10_c: 2470.0
vvc_alf_filter_chroma_128x128_10_neon: 616.0
vvc_alf_filter_chroma_128x128_12_c: 2531.5
vvc_alf_filter_chroma_128x128_12_neon: 620.2
vvc_alf_filter_luma_8x8_8_c: 25.2
vvc_alf_filter_luma_8x8_8_neon: 4.2
vvc_alf_filter_luma_8x8_10_c: 18.5
vvc_alf_filter_luma_8x8_10_neon: 4.0
vvc_alf_filter_luma_8x8_12_c: 19.0
vvc_alf_filter_luma_8x8_12_neon: 4.0
vvc_alf_filter_luma_16x16_8_c: 106.5
vvc_alf_filter_luma_16x16_8_neon: 16.2
vvc_alf_filter_luma_16x16_10_c: 75.2
vvc_alf_filter_luma_16x16_10_neon: 14.7
vvc_alf_filter_luma_16x16_12_c: 79.7
vvc_alf_filter_luma_16x16_12_neon: 14.7
vvc_alf_filter_luma_32x32_8_c: 400.5
vvc_alf_filter_luma_32x32_8_neon: 63.2
vvc_alf_filter_luma_32x32_10_c: 299.2
vvc_alf_filter_luma_32x32_10_neon: 57.7
vvc_alf_filter_luma_32x32_12_c: 299.2
vvc_alf_filter_luma_32x32_12_neon: 57.7
vvc_alf_filter_luma_64x64_8_c: 1602.5
vvc_alf_filter_luma_64x64_8_neon: 251.7
vvc_alf_filter_luma_64x64_10_c: 1197.0
vvc_alf_filter_luma_64x64_10_neon: 235.5
vvc_alf_filter_luma_64x64_12_c: 1220.2
vvc_alf_filter_luma_64x64_12_neon: 235.7
vvc_alf_filter_luma_128x128_8_c: 6570.2
vvc_alf_filter_luma_128x128_8_neon: 1007.7
vvc_alf_filter_luma_128x128_10_c: 4822.7
vvc_alf_filter_luma_128x128_10_neon: 936.2
vvc_alf_filter_luma_128x128_12_c: 4791.2
vvc_alf_filter_luma_128x128_12_neon: 938.5

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-22 21:09:56 +08:00
ha7sh17 172da370e7 doc/filters: fix outpad labels in libvmaf_cuda example 2024-07-22 13:00:04 +05:30
Rémi Denis-Courmont 9135dffd17 lavc/h264dsp: reduce spills in R-V V idct_add16 2024-07-21 22:39:45 +03:00
Rémi Denis-Courmont 245f76ad74 lavc/h264dsp: reuse the R-V V IDCT DC add functions
This reuses the DC bypass functions from the multiple IDCT functions, to
leverage vector code.

As an added bonus, the caller functions can now rely on the callee functions
to preserve their parameters, thus cutting down on stack spills.
2024-07-21 22:39:45 +03:00
Rémi Denis-Courmont 0a5b5bae89 lavc/h264dsp: correct VL and LMUL in idct_dc_add
T-Head C908 (cycles):
h264_idct4_dc_add_8bpp_c:        94.7
h264_idct4_dc_add_8bpp_rvv_i32:  55.0 (before)
h264_idct4_dc_add_8bpp_rvv_i32:  34.5 (after)
h264_idct4_dc_add_9bpp_c:        94.7
h264_idct4_dc_add_9bpp_rvv_i32:  43.5 (before)
h264_idct4_dc_add_9bpp_rvv_i32:  38.2 (after)
h264_idct4_dc_add_10bpp_c:       94.7
h264_idct4_dc_add_10bpp_rvv_i32: 43.5 (before)
h264_idct4_dc_add_10bpp_rvv_i32: 38.2 (after)
h264_idct4_dc_add_12bpp_c:       94.7
h264_idct4_dc_add_12bpp_rvv_i32: 43.7 (before)
h264_idct4_dc_add_12bpp_rvv_i32: 38.5 (after)
h264_idct4_dc_add_14bpp_c:       94.7
h264_idct4_dc_add_14bpp_rvv_i32: 43.7 (before)
h264_idct4_dc_add_14bpp_rvv_i32: 38.5 (after)
2024-07-21 22:39:45 +03:00
J. Dekker c9dc2ad09b lavc/h264dsp: move R-V V idct_dc_add
No functional changes. This just moves the assembler so that it can be
referenced by other functions in h264idct_rvv.S with local jumps.

Edited-by: Rémi Denis-Courmont <remi@remlab.net>
2024-07-21 22:39:45 +03:00
Rémi Denis-Courmont d15169c51f lavc/h264dsp: factor some mostly identical R-V V code 2024-07-21 22:39:45 +03:00
Rémi Denis-Courmont c4c811b3d9 checkasm/h264dsp: test TX bypass 2024-07-21 22:36:48 +03:00
Michael Niedermayer 73ca4e75eb avfilter/vf_xfade: Check ff_inlink_consume_frame() for failure
Fixes: CID1458043 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:14 +02:00
Michael Niedermayer 23851c9ee0 avutil/slicethread: Check pthread_*_init() for failure
Fixes: CID1604383 Unchecked return value
Fixes: CID1604439 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:13 +02:00
Michael Niedermayer 15540b3d28 avutil/frame: Check log2_crop_align
Fixes: CID1604586 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:13 +02:00
Michael Niedermayer 82f5b20ff5 avutil/buffer: Check ff_mutex_init() for failure
Fixes: CID1604487 Unchecked return value
Fixes: CID1604494 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:13 +02:00
Michael Niedermayer 064bcda142 avutil/avsscanf: Remove dead code
Fixes: CID1604498 Structurally dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:12 +02:00
Michael Niedermayer 696685df0c avformat/xmv: Check this_packet_size
Fixes: CID1604489 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:12 +02:00
Michael Niedermayer 7734c583f7 avformat/webpenc: Check filesize in trailer
not sure this is possible

Fixes: CID1604446 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:12 +02:00
Michael Niedermayer be30913538 avformat/ty: rec_size seems to only need 32bit
May help CID1604560 Overflowed integer argument

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:11 +02:00
Michael Niedermayer 41745e550a avformat/tty: Check avio_size()
Fixes: CID1220824 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:11 +02:00
Michael Niedermayer 124a97dd8b avformat/siff: Basic pkt_size check
Fixes: half of CID1258461 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:11 +02:00
Michael Niedermayer 759aae590c avformat/sauce: Check avio_size() for failure
Fixes: CID1604592 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:10 +02:00
Michael Niedermayer 3e305a0e70 avformat/sapdec: Check ffurl_get_file_handle() for error
Fixes: CID1604506 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:51 +02:00
Michael Niedermayer e83e246504 avformat/nsvdec: Check asize for PCM
Fixes: CID1604527 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:43 +02:00
Michael Niedermayer cea4dbc903 avformat/mp3dec: Check header_filesize
Fixes: CID1608714 Division or modulo by float zero

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:41 +02:00
Michael Niedermayer bb936a1a72 avformat/mp3dec; Check for avio_size() failure
Fixes: CID1608710 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:37 +02:00
Michael Niedermayer 046d069552 avformat/mov: Use 64bit for str_size
We assign a 64bit variable to it before checking

Fixes: CID1604544 Overflowed integer argument

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:35 +02:00
Michael Niedermayer 139bf41246 avformat/mm: Check length
Fixes: CID1220824 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:32 +02:00
Michael Niedermayer 291356f58b avformat/hnm: Check *chunk_size
Fixes: CID1604419 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:23 +02:00
Michael Niedermayer 7e577165c1 avformat/hlsenc: Check ret
Fixes: CID1609624 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:11 +02:00
Michael Niedermayer bf61f811e7 avformat/bintext: Check avio_size() return
Fixes: CID1604503 Overflowed constant
Fixes: CID1604566 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:40:49 +02:00
Michael Niedermayer 891bc070f0 avformat/asfdec_o: Check size of index object
We subtract 24 so it must be at least 24

Fixes: CID1604482 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:40:48 +02:00
Michael Niedermayer 2a8fb3c2cc avfilter/vf_scale: Check ff_scale_adjust_dimensions() for failure
Helps: CID1513722 Operands don't affect result

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:31 +02:00
Michael Niedermayer ad9df8bcfe avfilter/scale_eval: Use 64bit, check values in ff_scale_adjust_dimensions()
Found by reviewing CID1513722 Operands don't affect result

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:30 +02:00
Michael Niedermayer 6db4e326c2 avfilter/vf_neighbor_opencl: Use AV_PIX_MAX_PLANES
Fix/Robustness/whatever: CID1439575 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:29 +02:00
Michael Niedermayer ace2e25720 avfilter/vf_lut3d: Check av_scanf()
Fixes: CID1604398 Unchecked return value
Fixes: CID1604542 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:28 +02:00
Michael Niedermayer 64aa233a88 avfilter/vf_fftfilt: Remove dead depth code
Fixes: CID1509373 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:27 +02:00
Michael Niedermayer 2af95b9214 avfilter/vf_elbg: Use unsigned for shifting into the top bit
Fixes: part of CID1355110 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:25 +02:00
Michael Niedermayer 05e21b8902 avfilter/vf_premultiply: Use AV_PIX_MAX_PLANES
Helps: CID1435164 Out-of-bounds read
Helps: CID1435165 Out-of-bounds read
Helps: CID1435167 Out-of-bounds read
Helps: CID1435169 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:57:43 +02:00
Michael Niedermayer 9385847af4 avfilter/vf_deshake_opencl: Ensure that the first iteration initializes the best variables
Fixes: CID1452759 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:52:09 +02:00
Michael Niedermayer c37dc63c7d avfilter/vf_deshake_opencl: Use AV_VIDEO_MAX_PLANES
Fixes: CID1452758 Out-of-bounds read (actual out of bounds access depends on a frame with more than 3 planes)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:52:08 +02:00
Michael Niedermayer 9b9e02f2ff avformat/iamf_parse: Check for negative sample sizes
Fixes: index -2 out of bounds for type 'const enum AVCodecID [3]'
Fixes: 69866/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4971166119821312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:35:08 +02:00
Michael Niedermayer bcab9789ef swscale/output: Fix integer overflows in yuv2rgba64_X_c_template
Fixes: signed integer overflow: -1082982400 + -1068681048 cannot be represented in type 'int'
Fixes: 69995/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6285740271534080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:35:08 +02:00
Michael Niedermayer d8d288479d avformat/mxfdec: Reorder elements of expression in bisect loop
Fixes: signed integer overflow: 9223372036854775807 - -1 cannot be represented in type 'long'
Fixes: 68578/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6032171648221184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:29:25 +02:00
Michael Niedermayer d5ca373d7e avutil/timecode: Use a 64bit framenum internally
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 68550/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6424065930756096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:29:25 +02:00
Mark Thompson 7110a36ba0 cbs_av1: Reject thirty-two zero bits in uvlc code
The spec allows at least thirty-two zero bits followed by a one to mean
2^32-1, with no constraint on the number of zeroes.  The libaom
reference decoder does not match this, instead reading thirty-two zeroes
but not the following one to mean 2^32-1.  These two interpretations are
incompatible and other implementations may follow one or the other.
Therefore reject thirty-two zeroes because the intended behaviour is not
clear.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:29:25 +02:00
Michael Niedermayer 3faadbe2a2 avcodec/pnmdec: Use 64bit for input size check
Fixes: out of array read
Fixes: poc3

Reported-by: VulDB CNA Team
Found-by: CookedMelon
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:29:24 +02:00
Michael Niedermayer 167bf8f61e avformat/mov: Check extradata in mov_read_iacb()
Fixes: MemLeak
Fixes: 69853/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4660448545275904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:29:24 +02:00
Tong Wu 5c8523cef1 lavc/hw_base_encode: correct the timestamp when input_order = decode_delay
Fixed the command line: ffmpeg -hwaccel vaapi -pix_fmt nv12 -s:v
widthxheight -i input.yuv -vf "hwupload" -c:v hevc_vaapi -bf 10 -b_depth 3
-vframes 3 -f null -

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2024-07-20 11:21:36 +02:00
James Almer 2aab4e4cc0 avformat/iamf_writer: disallow Opus extradata with mapping family other than 0
Clause 3.11.1 of IAMF[1] states the Opus ID Header should conform to  ChannelMappingFamily == 0.

[1]https://aomediacodec.github.io/iamf/#opus-specific

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-19 21:07:32 -03:00
James Almer 9ce065c90d avformat/iamf_parse: sanitize audio_roll_distance values
Ensure the values are spec complaint and that no integer overflow can happen.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-19 21:07:32 -03:00
Leo Izen e30bc8a963 fate/png: add mDCv and cLLi read and write test
This test confirms that we can write mDCv and cLLi chunks and read them
back via the png decoder. It uses an HEVC conformance sample with this
metadata as the base source for the side data in the frames.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Jan Ekström <jeebjp@gmail.com>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-19 11:30:19 -04:00
James Almer 97fd5d3363 checkasm/lls: increase epsilon value for the update_lls test
Should fix failures for some seeds on x86_32.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-19 09:24:59 -03:00
James Almer 7dabad079b avformat/iamf: byteswap values in OpusHeader
Clause 3.11.1 of IAMF[1] states the values are stored in big endian, in
contrast to the Ogg Encapsulation for Opus[2] where they are in little endian.

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#opus-specific
[2]https://datatracker.ietf.org/doc/html/rfc7845#section-5.1

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
James Almer 54b8d5e201 avformat/iamf: rename Codec Config seek_preroll to audio_roll_distance
The semantics for the field are different than the one in AVCodecParameters,
so use the name defined in the IAMF spec to prevent confusion.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
Felicia Lim 2094f40295 avformat/iamf_writer: fix coded audio_roll_distance values
'seek_preroll' corresponds to 'audio_roll_distance' in IAMF[1]

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#audio_roll_distance

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
Felicia Lim 709a5687ed avformat/iamf_writer: fix PCM endian-ness flag
The value was swapped from what's defined in clause 3.11.4 of IAMF[1]

[1]https://aomediacodec.github.io/iamf/#lpcm-specific

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
Felicia Lim 180c869faf avformat/movenc: fix channel count and samplerate fields for IAMF tracks
Clause 6.2.3 of IAMF[1] states both of these shall be set to 0.

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#iasampleentry-section

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
James Almer 3de65f47e0 avformat/mov: don't export frame cropping stream side data when the clap box is a no-op
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
James Almer 2ff7d10c30 fftools/ffmpeg_filter: use the correct specifier for crop arguments
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
Leo Izen 90e28331c7 avcodec/png: more informative error message for invalid sBIT size
If the sBIT chunk size is invalid, we should print a more informative
error message rather than return an error and print nothing.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2024-07-18 21:20:38 -04:00
Leo Izen 4225f51c62 avcodec/pngdec: avoid erroring with sBIT on indexed-color images
Indexed color images use three colors for sBIT, but the function
ff_png_get_nb_channels returns 1 in this case. We should avoid erroring
out on valid files in this scenario.

Regression since 84b454935f.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
2024-07-18 21:16:18 -04:00
Rémi Denis-Courmont 483fd732ab lavc/h264dsp: R-V V high-depth idct_add{,intra}16, idct8_add4
As with 8-bit, this tends to be faster, but results are all over the
place due to the variable distribution of non-zero coefficients.
2024-07-18 20:37:09 +03:00
James Almer 90672974bd fftools/ffmpeg_demux: don't insert the crop filter if frame cropping side data defines no cropping
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 09:50:36 -03:00
J. Dekker fa5a605542 avcodec/riscv: add h264 dc idct rvv
checkasm: bench runs 131072 (1 << 17)
h264_idct4_add_dc_8bpp_c: 1.5
h264_idct4_add_dc_8bpp_rvv_i64: 0.7
h264_idct4_add_dc_9bpp_c: 1.5
h264_idct4_add_dc_9bpp_rvv_i64: 0.7
h264_idct4_add_dc_10bpp_c: 1.5
h264_idct4_add_dc_10bpp_rvv_i64: 0.7
h264_idct4_add_dc_12bpp_c: 1.2
h264_idct4_add_dc_12bpp_rvv_i64: 0.7
h264_idct4_add_dc_14bpp_c: 1.2
h264_idct4_add_dc_14bpp_rvv_i64: 0.7
h264_idct8_add_dc_8bpp_c: 5.2
h264_idct8_add_dc_8bpp_rvv_i64: 1.5
h264_idct8_add_dc_9bpp_c: 5.5
h264_idct8_add_dc_9bpp_rvv_i64: 1.2
h264_idct8_add_dc_10bpp_c: 5.5
h264_idct8_add_dc_10bpp_rvv_i64: 1.2
h264_idct8_add_dc_12bpp_c: 4.2
h264_idct8_add_dc_12bpp_rvv_i64: 1.2
h264_idct8_add_dc_14bpp_c: 4.2
h264_idct8_add_dc_14bpp_rvv_i64: 1.2

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-07-18 02:47:30 +02:00
Zhao Zhili b3aeef3bf9 avcodec/vvc: Remove write-only assignments in alf_filter_chroma 2024-07-17 21:23:41 +08:00
Zhao Zhili 8bac9d4a21 avcodec/vvc: Remove NOP condition check in alf_filter_luma
If (y + i == vb_above) or (y + i == vb_below), the if body has no
operation.
2024-07-17 21:23:41 +08:00
Michael Niedermayer 0993ef675f avcodec/mpeg12enc: Use av_rescale() in vbv_buffer_size computation
Fixes: signed integer overflow: 20 * 2314885530818453759 cannot be represented in type 'long'
Fixes: 69098/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-6107989688778752

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 19:03:50 +02:00
Michael Niedermayer 69e90491f1 avcodec/utvideoenc: Use unsigned shift to build flags
Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 69083/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_fuzzer-5608202363273216

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 19:03:50 +02:00
Michael Niedermayer a84fbd7471 avcodec/j2kenc: Merge dwt_norm into lambda
This moves computations out of a loop

This may help with UB in vsynth*-jpeg2000-yuva444p16

Fixes: signed integer overflow: 31665934879948800 * 9998 cannot be represented in type 'long'
Fixes: 69024/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5949662967169024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 19:03:50 +02:00
Michael Niedermayer 8a4e5e0e15 tools/target_dec_fuzzer: Adjust threshold for RV30
Fixes: Timeout
Fixes: 69216/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV30_fuzzer-5808725188214784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 18:43:15 +02:00
Michael Niedermayer 664fbfb9ac avcodec/mscc: move frame allocates to later
Fixes: Timeout
Fixes: 66964/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SRGC_fuzzer-5413170363564032
Fixes: 69373/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSCC_fuzzer-5239787748392960

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 18:43:15 +02:00
James Almer b248dace92 avformat/iamf_parse: keep substream count consistent
Fixes: member access within null pointer of type 'IAMFSubStream' (aka 'struct IAMFSubStream')
Fixes: 69795/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6216287009701888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 18:43:14 +02:00
Michael Niedermayer 7147c3c911 avcodec/ratecontrol: Handle wanted bits overflow
Fixes: 5.92611e+20 is outside the range of representable values of type 'unsigned long'
Fixes: 68984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5155755073273856

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 18:43:14 +02:00
Michael Niedermayer af99358353 avcodec/vc2enc: Fix overflows with storing large values
Fixes: left shift of 1431634944 by 2 places cannot be represented in type 'int'
Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int'
Fixes: 69061/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC2_fuzzer-6325700826038272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 18:43:14 +02:00
Zhao Zhili 8ca60e14d2 configure: Fix Apple framework dependencies in .pc file
configure use "-Wl,-framework,foo" and "-framework foo" to specify
dependencies on Apple frameworks. These two styles essentially do
the same thing when build ffmpeg. However, they do make difference
when generate pkg-config files. Some tools interact with pkg-config
cannot handle "-Wl,-framework,foo" in Libs field, e.g., cmake with
pkg_check_modules.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 22:50:41 +08:00
Zhao Zhili cb9c98da16 avformat/file: guard fd_dup by FD_PROTOCOL or PIPE_PROTOCOL
fd_dup is unused when fd and pipe have been disabled. This also
fix build error with wasi since 'dup' isn't available.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 22:50:21 +08:00
Zhao Zhili e713a2d85d avutil/file_open: Fix build error with wasi
Don't assume tempnam is available when !HAVE_MKSTEMP. Check tempnam
explicitly in configure.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 22:50:21 +08:00
Rémi Denis-Courmont 3002310b70 lavc/h264dsp: R-V V high-depth add_pixels8
T-Head C908 (cycles);
h264_add_pixels8_9bpp_c:        270.5
h264_add_pixels8_9bpp_rvv_i32:  164.2
h264_add_pixels8_10bpp_c:       270.5
h264_add_pixels8_10bpp_rvv_i32: 164.2
h264_add_pixels8_12bpp_c:       270.5
h264_add_pixels8_12bpp_rvv_i32: 164.2
h264_add_pixels8_14bpp_c:       270.5
h264_add_pixels8_14bpp_rvv_i32: 164.2
2024-07-16 17:25:40 +03:00
Rémi Denis-Courmont 7744c08240 lavc/h264dsp: R-V V add_pixels4 and 8-bit add_pixels8
T-Head C908 (cycles):
h264_add_pixels4_8bpp_c:        93.5
h264_add_pixels4_8bpp_rvv_i32:  39.5
h264_add_pixels4_9bpp_c:        87.5
h264_add_pixels4_9bpp_rvv_i64:  50.5
h264_add_pixels4_10bpp_c:       87.5
h264_add_pixels4_10bpp_rvv_i64: 50.5
h264_add_pixels4_12bpp_c:       87.5
h264_add_pixels4_12bpp_rvv_i64: 50.5
h264_add_pixels4_14bpp_c:       87.5
h264_add_pixels4_14bpp_rvv_i64: 50.5
h264_add_pixels8_8bpp_c:       265.2
h264_add_pixels8_8bpp_rvv_i64:  84.5
2024-07-16 17:25:40 +03:00
Zhao Zhili 635f7c0f6c avcodec/videotoolboxenc: Put ExtraSEI inside BufNode directly
Reduce error path and simplify the code.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:53:53 +08:00
Zhao Zhili 2fca8e400e avcodec/videotoolboxenc: Fix concurrent access to CVPixelBufferRef
For a frame comes from AV_HWDEVICE_TYPE_VIDEOTOOLBOX, it's
CVPixelBufferRef is maintained by a pool. CVPixelBufferRef returned
to the pool when frame buffer reference reached to zero. However,
VTCompressionSessionEncodeFrame also hold a reference to the
CVPixelBufferRef. So a new frame get from av_hwframe_get_buffer
may access a CVPixelBufferRef which still used by the encoder.
It's only after vtenc_output_callback that we can make sure
CVPixelBufferRef has been released by the encoder.

The issue can be tested with sample from trac #10884.
ffmpeg -hwaccel videotoolbox \
	-hwaccel_output_format videotoolbox_vld \
        -i input.mp4 \
	-c:v hevc_videotoolbox \
	-profile:v main \
        -b:v 3M \
        -vf scale_vt=w=iw/2:h=ih/2:color_matrix=bt709:color_primaries=bt709:color_transfer=bt709 \
        -c:a copy \
	-tag:v hvc1 \
	output.mp4

Withtout the patch, there are some out of order images in output.mp4.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:53:53 +08:00
Zhao Zhili 0e338c4114 avcodec/videotoolboxenc: Use BufNode as sourceFrameRefcon
ExtraSEI is used as the sourceFrameRefcon of VTCompressionSessionEncodeFrame.
It cannot hold other information which is necessary to fix another issue
in the following patch.

This patch also fixed leak of ExtraSEI on the error path of
vtenc_output_callback.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:53:53 +08:00
Zhao Zhili 4a3625859b avcodec/videotoolboxenc: Remove unused variable
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:53:53 +08:00
Zhao Zhili 2eae57c862 avcodec/videotoolboxenc: Don't ignore ENOMEM
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:53:53 +08:00
Marvin Scholz 2fc37c4239 avutil/hwcontext_videotoolbox: Fix build with older SDKs
I've accidentally used API not available on the checked version.
Additionally check for the SDK to be new enough to even have the
CVImageBufferCreateColorSpaceFromAttachments API to not fail
the build.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:51:45 +08:00
James Almer 5d74dcf0e3 fate/lavf-container: add a test for L-HEVC remuxing
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 18:19:00 -03:00
James Almer 27eb55a9c9 avcodec/cbs_h265: add support for 3D Reference Displays Information SEI
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 16:39:44 -03:00
James Almer 64807ccc91 avcodec/cbs_h265: add support for PPS Multilayer extension fields
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 16:39:44 -03:00
James Almer 25138fa0f3 avcodec/cbs_h265: reindent after the previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 16:39:44 -03:00
James Almer 41211edc1b avcodec/cbs_h265: add support for SPS Multilayer extension fields
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 16:39:44 -03:00
James Almer 5fe13aeb65 avcodec/cbs_h265: fix range of sps_max_sub_layers_minus1
The VPS referenced by the SPS must always be present as the max value for
sps_max_sub_layers_minus1 is vps_max_sub_layers_minus1. This replaces a buggy
custom range check for the aforementioned field.
Also, add the missing conformance check for sps_temporal_id_nesting_flag while
at it.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 16:39:44 -03:00
Gyan Doshi 350146a1ea ffmpeg: don't truncate getmaxrss value
Can lead to printing of nonsensical negative memory usage
2024-07-15 15:15:55 +05:30
Fei Wang 246600974f lavc/vaapi_{decode, av1}: Fix memory leak in fail codepath
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-15 10:25:43 +08:00
Michael Niedermayer 9c8881cb35 avcodec/mpegvideo_enc: Do not duplicate pictures on shifting
Fixes: out of array access
Fixes: 69098/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-6107989688778752
Fixes: 69599/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-4848626296225792.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:41 +02:00
Michael Niedermayer a7f5845a6c avfilter: Free out on error
CID1197065 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:41 +02:00
Michael Niedermayer 348968e9f7 avdevice/dshow_capture: Fix error handling in ff_dshow_##prefix##_Create()
Untested, needs review

Fixes: CID1591856 Resource leak
Fixes: CID1591887 Resource leak
Fixes: CID1591874 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:40 +02:00
Michael Niedermayer 66d6b8033b avcodec/tiff: Check value on positive signed targets
Fixes: CID1604593 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:40 +02:00
Michael Niedermayer 19a5a8997c avfilter/vf_convolution_opencl: Assert that the filter name is one of the filters
Helps with: CID1439572 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:40 +02:00
Michael Niedermayer ec18ec9fc1 avfilter/vf_bm3d: Dont round MSE2SSE to an integer
Fixes: CID1439581 Result is not floating-point

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:39 +02:00
Michael Niedermayer ffba528bc6 avfilter/vf_avgblur_opencl: Use AV_VIDEO_MAX_PLANES
Fixes: CID1437470 Out-of-bounds read (out of bounds read would only occur with a pixel format of more than 4 planes)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:39 +02:00
Michael Niedermayer 989e11acb6 avdevice/dshow: Remove NULL check on pin
The pointer is used before the check

Fixes: CID1591884 Dereference before null check

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:39 +02:00
Michael Niedermayer 2c2e727088 avdevice/dshow: check ff_dshow_pin_ConnectionMediaType() for failure
Maybe Fixes: CID1598557 Explicit null dereferenced

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:38 +02:00
Michael Niedermayer 175c191668 avdevice/dshow: Check device_filter_unique_name before use
Fixes: CID1591931 Explicit null dereferenced

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:38 +02:00
Michael Niedermayer 25f9211bdd avdevice/dshow: Cleanup also on av_log case
Fixes: CID1598550 Resource leak

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:38 +02:00
Michael Niedermayer daf61dddc8 avdevice/dshow_filter: Use wcscpy_s()
Fixes: CID1591929 Copy into fixed size buffer

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:37 +02:00
Michael Niedermayer 8f74c313f1 avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode()
This simplification assumes that the code is correct

Fixes: CID1560036 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:37 +02:00
Tong Wu affeca005a mailmap: add entry for myself
Signed-off-by: Tong Wu <wutong1208@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:37 +02:00
Marvin Scholz 613c85a8f5 avfilter/af_channelsplit: fix mixed declaration and code
Fix a "mixing declarations and code is incompatible with standards
before C99" warning.
2024-07-14 15:43:01 -04:00
Rémi Denis-Courmont c654e37254 lavc/h264dsp: R-V V high-depth h264_idct8_add
Unlike the 8-bit version, we need two iterations to process this within
128-bit vectors. This adds some extra complexity for pointer arithmetic
and counting down which is unnecessary in the 8-bit variant.

Accordingly the gain relative to C are just slight better than half as
good with 128-bit vectors as with 256-bit ones.

T-Head C908 (2 iterations):
h264_idct8_add_9bpp_c:       17.5
h264_idct8_add_9bpp_rvv_i32: 10.0
h264_idct8_add_10bpp_c:      17.5
h264_idct8_add_10bpp_rvv_i32: 9.7
h264_idct8_add_12bpp_c:      17.7
h264_idct8_add_12bpp_rvv_i32: 9.7
h264_idct8_add_14bpp_c:      17.7
h264_idct8_add_14bpp_rvv_i32: 9.7

SpacemiT X60 (single iteration):
h264_idct8_add_9bpp_c:       15.2
h264_idct8_add_9bpp_rvv_i32:  5.0
h264_idct8_add_10bpp_c:      15.2
h264_idct8_add_10bpp_rvv_i32: 5.0
h264_idct8_add_12bpp_c:      14.7
h264_idct8_add_12bpp_rvv_i32: 5.0
h264_idct8_add_14bpp_c:      14.7
h264_idct8_add_14bpp_rvv_i32: 4.7
2024-07-14 21:06:50 +03:00
Lynne 80ddc72717 vulkan: rename read_only to singular
There's nothing stopping users from writing to such buffers.
Its more accurate to say they are singular, i.e. not duplicated
between multiple submissions.

This can be helpful for global statistics, or error propagation
purposes.
2024-07-14 18:33:56 +02:00
Lynne e11087b162 vulkan: set VkDescriptorAddressInfoEXT.sType
This was not done, resulting in validation issues, and potential
driver issues.
2024-07-14 18:31:44 +02:00
Niklas Haas 4ec45aca36 swscale/utils: fix leak on threaded ctx init failure
This count gets incremented after init succeeds, when it should be
incremented after *alloc* succeeds. Otherwise, we leak the context on
failure.

There are no negative consequences of incrementing for
allocated-but-not-initialized contexts, as the only functions that
reference it will, in the worst case, simply behave as if called on
allocated-but-not-initialized contexts, which is in line with expected
behavior when sws_init_context() fails.
2024-07-14 13:48:59 +02:00
Alexander Strasser 36aee69f0d libavdevice: Improve example in deprecation message for opengl and sdl
When piping ffmpeg into ffplay both programs write a status line in
the terminal. That causes flickering and invisibility of one or the
other status line.

As compromise set ffplay log level to warning, so it doesn't show
the status line.

The user is usually testing ffmpeg command lines and want's a
preview of the result. This way the user can see the ffmpeg output
and still see errors and warnings from ffplay, should they occur.

Additionally set PTS to zero in ffplay to lessen the delay until
the frames are displayed. Without it delay is quite observable
when e.g. live capturing with low frame rates.
2024-07-14 13:31:03 +02:00
Rémi Denis-Courmont 8b3d997bed lavc/h264dsp: remove MMI 8-bit 4:2:2 chroma DC dequant
The function is exactly identical to the C reference, only with the
constant propagated and the loop unrolled manually.
2024-07-14 11:39:35 +03:00
Rémi Denis-Courmont a194131cb6 lavc/h264dsp: remove MMI 8-bit chroma DC dequant
The function is exactly identical to the C reference, only with the
constant propagated manually. It does not optimise anything.
2024-07-14 11:39:35 +03:00
Rémi Denis-Courmont 4e0e872881 lavc/h264dsp: R-V V high-depth h264_idct_add
T-Head C908 (cycles):
h264_idct4_add_9bpp_c:        248.2
h264_idct4_add_9bpp_rvv_i32:  128.7
h264_idct4_add_10bpp_c:       256.7
h264_idct4_add_10bpp_rvv_i32: 128.7
h264_idct4_add_12bpp_c:       252.5
h264_idct4_add_12bpp_rvv_i32: 129.7
h264_idct4_add_14bpp_c:       258.0
h264_idct4_add_14bpp_rvv_i32: 129.7
2024-07-14 11:39:35 +03:00
James Almer d059ea5663 avcodec/bsf/showinfo: print packet data checksum
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-13 23:48:34 -03:00
Marth64 f1abb754aa avformat/dvdvideodec: Fix incorrect padding cell trim logic
When -trim option is used (by default), padding cells
at the beginning of the title are supposed to be ignored.
The current implementation does the ignoring after we
have locked on to the PGC navigation event stream,
but does not set the PGC/PG state properly.

This causes false positives and errors on some discs
due to a search for a program stream cell that
never succeeds. User would have to know to disable
the -trim option to work around the issue.

Simplify the logic and move it to the NAV packet
event handling, in turn implementing the behaviour
correctly and fixing the trim function for impacted discs.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-13 17:17:36 +02:00
Marth64 f37f86a774 avformat/dvdvideodec: Remove redundant ret initializations
Remove initializing ret = 0, in areas where ret is
only used to hold an error value, immediately returned,
and the function would otherwise return a literal 0.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-13 17:17:27 +02:00
Marth64 eb07a593d3 avformat/dvdvideodec: Don't add chapter markers for empty/dummy PTTs
Some discs (usually same ones with padding cells), also have empty
padding PTTs / chapters to accompany them. This results, for example,
in an extra chapter marker that starts and ends at 0 (no duration).

Don't add these empty chapter markers.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-13 17:17:22 +02:00
Michael Niedermayer 9af348bd1a avcodec/flac_parser: Assert that we do not overrun the link_penalty array
Helps: CID1454676 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:49:33 +02:00
Michael Niedermayer ed34b0c54e avcodec/osq: avoid signed overflow in downsample path
Fixes: signed integer overflow: 865309950 * 256 cannot be represented in type 'int'
Fixes: 69191/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6310214413385728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:45:58 +02:00
Michael Niedermayer 12dab3860c tools/target_enc_fuzzer: A64MULTI5 encoder is very slow, check and adjust threshold
Fixes: Timeout
Fixes: 68999/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_A64MULTI5_fuzzer-5078418784845824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:44:19 +02:00
Michael Niedermayer 032e831ab4 tools/target_enc_fuzzer: A64MULTI encoder is very slow, check and adjust threshold
Fixes: Timeout
Fixes: 69097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_A64MULTI_fuzzer-5062757287264256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:44:17 +02:00
Michael Niedermayer 0474614e6c avcodec/pixlet: Simplify pfx computation
Found by reviewing code related to CID1604365 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:46 +02:00
Michael Niedermayer f18b442370 avcodec/motion_est: Fix score squaring overflow
Fixes: CID1604552 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:44 +02:00
Michael Niedermayer 06f01d9fa0 avcodec/mlpenc: Use 64 for ml, mr
Fixes: CID1604429 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:42 +02:00
Michael Niedermayer 371265f0ec avcodec/me_cmp: Fix type check
Fixes: CID1604375 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:40 +02:00
Michael Niedermayer d553276843 avcodec/loco: Check loco_get_rice() for failure
Fixes: CID1604495 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:38 +02:00
Michael Niedermayer b989986641 avcodec/loco: check get_ur_golomb_jpegls() for failure
Fixes: CID1604400 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:35 +02:00
Michael Niedermayer 0e3e7e8aeb avcodec/leaddec: Check init_get_bits8() for failure
Fixes: CID1604416 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:33 +02:00
Michael Niedermayer 6e4c037833 avcodec/imm4: check cbphi for error
Fixes: CID1604356 Overflowed constant
Fixes: CID1604573 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:31 +02:00
Michael Niedermayer cfe66dfebb avcodec/iff: Use signed count
This is more a style fix than a bugfix (CID1604392 Overflowed constant)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:28 +02:00
Michael Niedermayer 1e888fb006 avcodec/hw_base_encode: Simplify EOF check
Found while reviewing CID1608712 Explicit null dereferenced

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:25 +02:00
Michael Niedermayer b2aaeb81f6 avcodec/golomb: Assert that k is in the supported range for get_ur/sr_golomb()
Found by code review related to CID1604563 Overflowed return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:23 +02:00
Michael Niedermayer 7cf5b83f6f avcodec/golomb: Document return for get_ur_golomb_jpegls() and get_sr_golomb_flac()
Found while reviewing code related to CID1604409 Overflowed return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:21 +02:00
Michael Niedermayer e5af1c6e91 avcodec/dxv: Fix type in get_opcodes()
Found by code review related to CID1604386 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:20 +02:00
Michael Niedermayer 69dcd123f1 avcodec/cri: Check length
Fixes: CID1604394 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:18 +02:00
Michael Niedermayer 96fd9417e2 avcodec/xsubdec: Check parse_timecode()
Fixes: CID1604490 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:14 +02:00
Michael Niedermayer ba63e32957 avutil/imgutils: av_image_check_size2() ensure width and height fit in 32bit
width and height > 32bit is not supported and its easier to check in a central place

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:16:05 +02:00
Michael Niedermayer 20e59af07e avfilter/vf_tiltandshift: Free dst on error
Fixes: CID1559901 Resource leak

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 21:58:50 +02:00
Michael Niedermayer e6c0c5731e doc/examples/mux: remove nop
Found through code review related to CID1604493 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:51 +02:00
Michael Niedermayer 93e0265e27 avcodec/proresenc_kostya: use unsigned alpha for rotation
Fixes: left shift of negative value -208
Fixes: 69073/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_KS_fuzzer-4745020002336768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:51 +02:00
Michael Niedermayer f13ae63259 avformat/rtpenc_rfc4175: Use 64bit in computation if copy_offset
Found while reviewing: CID1494441 Untrusted value as argument

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:51 +02:00
Michael Niedermayer 38c2e6a2c7 avformat/rtmpproto: Use AV_DICT_MATCH_CASE instead of litteral number
Found by reviewing: CID1530166 Free of array-typed value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:50 +02:00
Michael Niedermayer cedbef0394 avformat/rtmppkt: Simplify and deobfuscate amf_tag_skip() slightly
Found while reviewing: CID1530313 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:50 +02:00
Michael Niedermayer 665be4fa2f avformat/rmdec: use 64bit for audio_framesize checks
It is not entirely clear what would prevent such overflow so even if it is
not possible, it is better to use 64bit

Fixes: CID1491898 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:42 +02:00
Fei Wang 71f802cdc9 lavc/hevcdec: Update slice index before hwaccel decode slice
Otherwise, slice index will never update for hwaccel decode, and slice
RPL will be always overlap into first one which use slice index to construct.

Fixes hwaccel decoding after 47d34ba7fb

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-12 16:27:34 +08:00
Fei Wang e741cf665d lavc/hevcdec: Put slice address checking after hwaccel decode slice
Slice address tab only been updated in software decode slice data.

Fixes hwaccel decoding after d725c737fe.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-12 16:27:34 +08:00
James Almer 092ef4097c Changelog: mention cropping support in Matroska and MP4
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 21:35:40 -03:00
James Almer 70c6b904be x86/intreadwrite: add missing casts to pointer arguments
Should make strict compilers happy.

Also, make AV_COPY128 use integer operations while at it. Removing the
inclusion of immintrin.h ensures a lot less intrinsic related headers are
included as well, which fixes a clash of defines with some Clang versions.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 18:24:26 -03:00
Rémi Denis-Courmont d28a7e8eb7 lavc/h264dsp: avoid \+ expansion
This seems to be unsupported by LLVM-as.
2024-07-11 21:07:17 +03:00
James Almer 58cb0cab5e avformat/mov: ensure pasp box derived SAR is used if present
It's meant to override any codec specific (but still container level)
information, but its position is not guaranteed, so apply the values after the
entire trak structure has been parsed.
Also, replace the ugly roundabout int -> double -> int method to set SAR from
existing dimensions while at it.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
James Almer 32588a9394 avformat/movenc: support writing cropping values
Finishes implementing ticket #7437.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
James Almer 93be6b425e avformat/mov: export cropping values from clap boxes
Addresses part of ticket #7437.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
James Almer 0b6c5e9df4 avfilter/vf_crop: prevent integer overflows when calculating SAR
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
Zhao Zhili 0e5f8ddc1d avcodec/vvc: Use static const for function table 2024-07-11 20:26:47 +08:00
Zhao Zhili 906b883e7b avutil/executor: Fix stack overflow due to recursive call
av_executor_execute run the task directly when thread is disabled.
The task can schedule a new task by call av_executor_execute. This
forms an implicit recursive call. This patch removed the recursive
call.
2024-07-11 20:26:23 +08:00
Zhao Zhili 54f9469fa1 avutil/executor: Fix missing check before using mutex 2024-07-11 20:24:11 +08:00
James Almer 1a86a7a48d x86/intreadwrite: fix include of config.h
Should fix make checkheaders.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-10 13:52:52 -03:00
James Almer 15056dd650 x86/intreadwrite.h: add missing preprocessor checks
Removed by accident in the previous commits. This makes the code only run when
compiled with GCC and Clang like before. Support for other compilers like msvc
can be added later.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-10 13:49:21 -03:00
James Almer bd1bcb07e0 x86/intreadwrite: use intrinsics instead of inline asm for AV_COPY128
This has the benefit of removing any SSE -> AVX penalty that may happen when
the compiler emits VEX encoded instructions.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-10 13:25:44 -03:00
James Almer 4a04cca69a x86/intreadwrite: use intrinsics instead of inline asm for AV_ZERO128
When called inside a loop, the inline asm version results in one pxor
unnecessarely emitted per iteration, as the contents of the __asm__() block are
opaque to the compiler's instruction scheduler.
This is not the case with intrinsics, where pxor will be emitted once with any
half decent compiler.

This also has the benefit of removing any SSE -> AVX penalty that may happen
when the compiler emits VEX encoded instructions.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-10 13:25:44 -03:00
Sean McGovern 34b4ca8696 swscale: prevent undefined behaviour in the PUTRGBA macro
For even small values of 'asrc[x]', shifting them by 24 bits or more
will cause arithmetic overflow and be caught by
GCC's undefined behaviour sanitizer.

Ensure the values do not overflow by up-casting the bracketed
expressions involving 'asrc' to uint32_t.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:10 +02:00
Michael Niedermayer e9e8bea2e7 avutil/wchar_filename: Correct sizeof
Fixes: CID1591930 Wrong sizeof argument

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:10 +02:00
Michael Niedermayer 628ba061c8 avutil/hwcontext_d3d11va: correct sizeof IDirect3DSurface9
Fixes: CID1591944 Wrong sizeof argument

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:09 +02:00
Michael Niedermayer cf22f944d5 avutil/hwcontext_d3d11va: Free AVD3D11FrameDescriptor on error
Fixes: CID1598558 Resource leak

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:09 +02:00
Michael Niedermayer 698ed0d5a5 avutil/hwcontext_d3d11va: correct sizeof AVD3D11FrameDescriptor
Fixes: CID1591909 Wrong sizeof argument

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:09 +02:00
Michael Niedermayer eb552ecd54 avcodec/vvc/refs: Use unsigned mask
Not a bugfix, but might fix CID1604361 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:08 +02:00
Marvin Scholz 6d9c4bd69e lavfi/perlin: Fix out of bounds stack buffer write
An incorrect calculation in ff_perlin_init causes a write to the
stack array at index 256, which is out of bounds.

Fixes: CID1608711
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:08 +02:00
Tong Wu f2f2b27517 MAINTAINERS: add myself as d3d12va_encode maintainer
Signed-off-by: Tong Wu <wutong1208@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:08 +02:00
Michael Niedermayer 3e4bfff211 doc/examples/vaapi_encode: Try to check fwrite() for failure
Fixes: CID1604548 Unused value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:07 +02:00
Ramiro Polla ac6263945a swscale/x86/yuv2rgb: Detemplatize
Every function in yuv2rgb_template.c is only compiled exactly
once, so detemplatize it.
2024-07-10 12:25:32 +02:00
Ramiro Polla 4f7f9b1026 swscale: remove unconditional #define DITHER1XBPP
This seems to have had an use in the past, but it is now defined
unconditionally.
2024-07-10 12:25:03 +02:00
Ramiro Polla 7405f1ad53 configure: restore autodetection of v4l2 and fbdev
The detection logic for v4l2 and fbdev was accidentally modified to
depend on v4l2-m2m in 43b3412.
2024-07-10 12:24:33 +02:00
Niklas Haas 0deb301ba9 avfilter/vf_scale: test return code of scale_frame()
Instead of testing the returned frame against NULL, test the return code
itself, going more in line with the usual behavior of such functions.
2024-07-10 11:38:44 +02:00
Niklas Haas 084e0b364d avfilter/vf_scale: fix frame lifetimes
scale_frame() inconsistently handled the lifetime of `in`. Fixes a
possible double free and a possible memory leak.

The new code always has `scale_frame` take over ownership of the input
frame. I first tried writing this code in a way where the calling code
retains ownership, but this is nontrivial due to the presence of the
no-op short-circuit condition in which the input frame is directly
returned. (As an alternative, we could use av_frame_clone() instead, but
I wanted to avoid touching the original behavior in this commit)
2024-07-10 11:38:44 +02:00
Rémi Denis-Courmont f1ed351d3b lavc/h264dsp: R-V V 8-bit h264_biweight_pixels
T-Head C908:
h264_biweight2_8_c:        58.0
h264_biweight2_8_rvv_i32:  11.2
h264_biweight4_8_c:       106.0
h264_biweight4_8_rvv_i32:  22.7
h264_biweight8_8_c:       205.7
h264_biweight8_8_rvv_i32:  50.0
h264_biweight16_8_c:      403.5
h264_biweight16_8_rvv_i32: 83.2

SpacemiT X60:
h264_weight2_8_c:          48.2
h264_weight2_8_rvv_i32:     8.2
h264_weight4_8_c:          90.5
h264_weight4_8_rvv_i32:    16.5
h264_weight8_8_c:         175.2
h264_weight8_8_rvv_i32:    38.0
h264_weight16_8_c:        342.2
h264_weight16_8_rvv_i32:   66.0
2024-07-09 18:03:30 +03:00
Rémi Denis-Courmont 3606e592ea lavc/h264dsp: R-V V 8-bit h264_weight_pixels
There are two implementations here:
- a generic scalable one processing two columns at a time,
- a specialised processing one (fixed-size) row at a time.

Unsurprisingly, the generic one works out better with smaller widths.
With larger widths, the gains from filling vectors are outweighed by
the extra cost of strided loads and stores. In other words, memory
accesses become the bottleneck.

T-Head C908:
h264_weight2_8_c:        54.5
h264_weight2_8_rvv_i32:  13.7
h264_weight4_8_c:       101.7
h264_weight4_8_rvv_i32:  27.5
h264_weight8_8_c:       197.0
h264_weight8_8_rvv_i32:  75.5
h264_weight16_8_c:      385.0
h264_weight16_8_rvv_i32: 74.2

SpacemiT X60:
h264_weight2_8_c:        48.5
h264_weight2_8_rvv_i32:   8.2
h264_weight4_8_c:        90.7
h264_weight4_8_rvv_i32:  16.5
h264_weight8_8_c:       175.0
h264_weight8_8_rvv_i32:  37.7
h264_weight16_8_c:      342.2
h264_weight16_8_rvv_i32: 66.0
2024-07-09 18:03:29 +03:00
Zhao Zhili 85706f5136 avutil/hwcontext_videotoolbox: Fix version check
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-09 21:39:09 +08:00
Anton Khirnov 9fb8d13d56 lavf: deprecate avformat_transfer_internal_stream_timing_info()
And av_stream_get_codec_timebase().

They were both added for ffmpeg CLI, which no longer calls either of
them. Furthermore the notion of "internal stream timing info" that needs
to be transferred with a special magic API function is fundamentally
flawed and should be removed.
2024-07-09 11:14:47 +02:00
Anton Khirnov 10185e2d4c fftools/ffmpeg_mux_init: default to input timebase for streamcopy
Stop trying to invent some "framerate-based" timebase when there is no
reason to think the stream is CFR at all.
2024-07-09 11:14:08 +02:00
Anton Khirnov ff55d1cc20 fftools/ffmpeg_dec: improve detection of lavf-guessed durations
Will be useful in following commit.
2024-07-09 11:14:08 +02:00
Andreas Rheinhardt b6c43328ee avformat/matroskaenc: Avoid indirection via st->codecpar
Use the already available AVCodecParameters pointer instead.
Shortens lines.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-08 20:11:32 +02:00
Andreas Rheinhardt 0d1bc9666c avformat/matroskaenc: Only write useful cropping values
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-08 20:11:27 +02:00
Andreas Rheinhardt 9ffac78eba avformat/matroskaenc: Fix and simplify check for invalid crop values
The check "left >= INT_MAX - right" is supposed to check for
whether left + right does not overflow/wraparound, but given that
left and top are uint32_t INT_MAX - right can already wraparound
for big values of right (and ordinary 32-bit ints):
If right == UINT32_MAX, INT_MAX - right is INT_MAX + 1;
for left in 0..par->width both checks will be passed.

Fix this and simplify the check by using 64-bit types,
where the addition is guaranteed not to overflow.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-08 20:11:20 +02:00
Andreas Rheinhardt 8765b36a52 avformat/matroskaenc: Fix potential stack-buffer-overflow
Forgotten in f194f291d8

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-08 20:11:03 +02:00
James Almer bf87688a9f fftools/ffmpeg: support applying container level cropping
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:30:24 -03:00
James Almer f194f291d8 avformat/matroskaenc: support writing cropping values
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:30:24 -03:00
James Almer 79e8e980c2 avformat/matroskadec: export cropping values
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:30:24 -03:00
James Almer dc763efe70 avformat/matroskadec: don't infer display dimensions when DisplayUnit is not pixels
The spec doesn't define a default value for other values of DisplayUnit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:30:24 -03:00
James Almer d570457eb7 ffprobe: print Frame Cropping packet side data info
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:30:24 -03:00
James Almer 893c6802ac avformat/dump: print Frame Cropping packet side data info
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:29:49 -03:00
James Almer 1b58f3af30 avcodec/packet: add a decoded frame cropping side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:23:33 -03:00
Michael Niedermayer 0619138639 avformat/usmdec: Initialize value
Fixes: CID1551685 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:33 +02:00
Michael Niedermayer 7b2f67ea77 avformat/udp: Fix temporary buffer race
Fixes: CID1551679 Data race condition
Fixes: CID1551687 Data race condition

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:33 +02:00
Michael Niedermayer f022afea77 avformat/tls_schannel: Initialize ret
Fixes: CID1591881 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:32 +02:00
Michael Niedermayer 426d8c84c3 avformat/subfile: Assert that whence is a known case
This may help CID1452449 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:32 +02:00
Michael Niedermayer 2a0a7d964b avformat/subfile: Merge if into switch()
Found while reviewing CID1452449 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:32 +02:00
Michael Niedermayer c8200d3825 avformat/rtsp: Check that lower transport is handled in one of the if()
Fixes: CID1473554 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:31 +02:00
Michael Niedermayer 498ce4e8b8 avformat/rtsp: initialize reply1
It seems reply1 is initialized by ff_rtsp_send_cmd() in most cases but there
are code paths like "continue" which look like they could skip it but even if not
writing this so a complex loop after several layers of calls initialized a local
variable through a pointer is just bad design.
This patch simply initialized the variable.

Fixes: CID1473532 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:31 +02:00
Michael Niedermayer 9bb38ba2b7 avformat/rtsp: use < 0 for error check
Found while reviewing CID1473532 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:31 +02:00
Michael Niedermayer 7a9ddb7051 avformat/rtpenc_vc2hq: Check sizes
Fixes: CID1452585 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:30 +02:00
Michael Niedermayer 382e9e79f3 avfilter/af_aderivative: Free out on error
Fixes: CID1197065 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:30 +02:00
Michael Niedermayer 66b60bae68 swscale/swscale: Use ptrdiff_t for linesize computations
This is unlikely to make a difference

Fixes: CID1591896 Unintentional integer overflow
Fixes: CID1591901 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:30 +02:00
Michael Niedermayer 62d4414d54 avfilter/af_amerge: Cleanup on av_channel_layout_copy() failure
Fixes: CID1503088 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:29 +02:00
Michael Niedermayer a5c815f937 avfilter/af_afir: Assert format
Maybe helps: CID1516805 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:29 +02:00
Michael Niedermayer 8f9a6c4ea8 avfilter/af_afftdn: Assert format
Maybe helps: CID1515514 Uninitialized scalar variable
Maybe helps: CID1515517 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:29 +02:00
Michael Niedermayer 5fe8bf4aa5 avfilter/af_pan: check nb_output_channels before use
Fixes: CID1500281 Out-of-bounds write
Fixes: CID1500331 Out-of-bounds write

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:28 +02:00
Michael Niedermayer 2d0d502ff1 avfilter/af_mcompand: compute half frequency in double
Fixes: CID1422217 Result is not floating-point

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:28 +02:00
Michael Niedermayer cef720ab42 avfilter/af_channelsplit: Assert that av_channel_layout_channel_from_index() succeeds
Maybe Helps: CID1503077 Bad bit shift operation

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:28 +02:00
Michael Niedermayer 7a0ea15c7a avfilter/af_aresample: Cleanup on av_channel_layout_copy() failure
Fixes: CID1503078 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:27 +02:00
Michael Niedermayer 380a8213b1 tools/coverity: Phase 1 study of anti-halicogenic for coverity av_rescale()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:27 +02:00
Fei Wang 7ba8982181 MAINTAINERS: add myself to the general developers list
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:27 +02:00
James Almer 33d6e14d6f avformat/hevc: reindent after previous commits
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 13:54:07 -03:00
James Almer aa8230c7ba avformat/movenc: add support for writting hfov boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer 6a428876fc avformat/movenc: add support for writting vexu boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer d4e2af4144 avformat/movenc: add support for writing lhvC boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
Derek Buitenhuis c4ebdd8d2d avformat/mov: Mark streams with a layered HEVC box as multilayer
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-07 12:38:57 -03:00
James Almer c657c694e3 avformat/mov: add support for lhvC box parsing
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer cbfbacff20 avformat/hevc: add a function to write a lhvC box
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer cee43e512d avformat/hevc: store parameter set and layer IDs in HVCCNALUnit
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer 361b01329f avformat/hevc: use a single array for per-PS NALUs
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer ab7893a7b1 avformat/hevc: don't write the same array values per nal addition
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer a696b28886 avformat/hevc: don't write NALUs with nuh_layer_id > 0 in hvcC boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
Derek Buitenhuis 46f7ea4456 avformat: Add a new stream disposition for multilayer video
This lets us detect when a container has flagged a stream as multilayer.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-07 12:38:50 -03:00
Hao Guan cd2f8a22e9 avcodec/videotoolboxenc: fix vtctx reset condition
In vtenc_populate_extradata, the cleanup function vtenc_reset should not
be used when no error occurs, otherwise some color information is lost
(#11036).

This patch checks the status code and conducts the correct cleanup.

Signed-off-by: Hao Guan <hguandl@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-07 18:46:02 +08:00
Anton Khirnov 24b3bad811 tests/fate/mov: add a test for VFR muxing 2024-07-07 11:37:43 +02:00
Anton Khirnov ef521e7a57 lavf/movenc: mark mov/mp4 as supporting VFR 2024-07-07 11:37:43 +02:00
Anton Khirnov 6cde03739e tests/fate/filter-audio: convert atempo test to oneoff
Filter output is not bitexact.
2024-07-07 11:34:13 +02:00
Marth64 8b8ee799de avformat/dvdvideodec: Remove unused cell count variable
Signed-off-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-07 11:33:32 +02:00
Rémi Denis-Courmont f9d1230224 lavc/h264dsp: R-V V 8-bit h264_idct8_add
T-Head C908 (cycles):
h264_idct8_add_8bpp_c:      1072.0
h264_idct8_add_8bpp_rvv_i32: 318.5
2024-07-07 09:34:32 +03:00
James Almer ecd3a97834 fate/filter-video: add missing swscale flags to tiltandshift tests
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-06 17:41:24 -03:00
James Almer 3d5bad7501 fate/filter-video: tests more pixel formats with the tiltandshift filter
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-06 10:50:55 -03:00
James Almer a528a54ee1 avfilter/vf_tiltandshift: fix buffer offset for yuv422p input
Fixes ticket #10950.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-06 10:50:55 -03:00
Stefano Sabatini 9c357324f0 doc/filters/perlin: specify default values 2024-07-06 14:14:02 +02:00
Rémi Denis-Courmont f447189b0c lavc/h264dsp: R-V V 8-bit h264_idct_add
T-Head C908 (cycles):
h264_idct4_add_8bpp_c:      271.5
h264_idct4_add_8bpp_rvv_i32: 91.5
2024-07-05 20:06:22 +03:00
Rémi Denis-Courmont e0eff64ed1 lavc/h264dsp: R-V V 8-bit h264_idct8_add4 2024-07-05 18:56:03 +03:00
Rémi Denis-Courmont d1f0c1fbf8 lavc/h264dsp: R-V V 8-bit h264_idct_add16intra 2024-07-05 18:56:03 +03:00
Rémi Denis-Courmont 30475c95ba lavc/h264dsp: R-V V 8-bit h264_idct_add16
While this *tends* to be faster than plain C, the performance numbers
are all over the place, presuambly due to the conditional character of
the main loop.

Some additional micro-optimisations should be feasible after the
underlying h264_idct_add and h264_idct_dc_add functions are also
implemented. Then it will no longer be necesseray to stricly abide by
the C ABI.
2024-07-05 18:56:02 +03:00
Marvin Scholz cd9ceaef22 avutil/hwcontext_videotoolbox: Set CVBuffer CGColorSpace
In addition to the other properties, try to obtain the right
CGColorSpace and set it as well, else it could lead to a CVBuffer
tagged as BT.2020 but with a CGColorSpace indicating BT.709.

Therefore it is essential for consistency to set a colorspace
according to the other values, or if none can be obtained (for example
because the other values are all unspecified) unset it as well.

Fix #10884

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 19:13:43 +08:00
Marvin Scholz b4f9fcc63c avutil/hwcontext_videotoolbox: Update documentation
The documentation was not clear at all what specifically the
function does, so it was left unspecified if it will unset or
not touch attachments it could not map from the AVFrame.

The documentation of the return  value was wrong as well.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 19:13:43 +08:00
Marvin Scholz 1fa7554bd6 avutil/hwcontext_videotoolbox: Unset undefined values
When mapping AVFrame properties to the CVBuffer attachments, it is
necessary to properly delete undefined attachments, else we can
leave incorrect values in there guessed from VideoToolbox for
example, leading to inconsistent results where the AVFrame and
CVBuffer differ in metadata.

Ref #10884

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 19:13:43 +08:00
Jun Zhao 03c2e9d77e lavf/scdet: minor fix
Change dbl to i64 for bool type

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-07-05 18:06:14 +08:00
Jun Zhao 25a7dcf069 lavc/libx264: minor format fix
Remove redundant semicolons

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-07-05 18:05:10 +08:00
Zhao Zhili 4d90a76986 swscale/aarch64: Add argb/abgr to yuv
Test on Apple M1 with kperf:
				: -O3		: -O3 -fno-vectorize
abgr_to_uv_8_c			: 19.4		: 26.1
abgr_to_uv_8_neon		: 29.9		: 51.1
abgr_to_uv_128_c		: 146.4		: 558.9
abgr_to_uv_128_neon		: 85.1		: 83.4
abgr_to_uv_1080_c		: 1162.6	: 4786.4
abgr_to_uv_1080_neon		: 819.6		: 826.6
abgr_to_uv_1920_c		: 2063.6	: 8492.1
abgr_to_uv_1920_neon		: 1435.1	: 1447.1
abgr_to_uv_half_8_c		: 16.4		: 11.4
abgr_to_uv_half_8_neon		: 35.6		: 20.4
abgr_to_uv_half_128_c		: 108.6		: 359.4
abgr_to_uv_half_128_neon	: 75.4		: 42.6
abgr_to_uv_half_1080_c		: 883.4		: 2885.6
abgr_to_uv_half_1080_neon	: 460.6		: 481.1
abgr_to_uv_half_1920_c		: 1553.6	: 5106.9
abgr_to_uv_half_1920_neon	: 817.6		: 820.4
abgr_to_y_8_c			: 6.1		: 26.4
abgr_to_y_8_neon		: 40.6		: 6.4
abgr_to_y_128_c			: 99.9		: 390.1
abgr_to_y_128_neon		: 67.4		: 55.9
abgr_to_y_1080_c		: 735.9		: 3170.4
abgr_to_y_1080_neon		: 534.6		: 536.6
abgr_to_y_1920_c		: 1279.4	: 6016.4
abgr_to_y_1920_neon		: 932.6		: 927.6

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 16:32:31 +08:00
Zhao Zhili 52422133ae swscale/aarch64: Add bgra/rgba to yuv
Test on Apple M1 with kperf
				: -O3		: -O3 -fno-vectorize
bgra_to_uv_8_c			: 13.4		: 27.5
bgra_to_uv_8_neon		: 37.4		: 41.7
bgra_to_uv_128_c		: 155.9		: 550.2
bgra_to_uv_128_neon		: 91.7		: 92.7
bgra_to_uv_1080_c		: 1173.2	: 4558.2
bgra_to_uv_1080_neon		: 822.7		: 809.5
bgra_to_uv_1920_c		: 2078.2	: 8115.2
bgra_to_uv_1920_neon		: 1437.7	: 1438.7
bgra_to_uv_half_8_c		: 17.9		: 14.2
bgra_to_uv_half_8_neon		: 37.4		: 10.5
bgra_to_uv_half_128_c		: 103.9		: 326.0
bgra_to_uv_half_128_neon	: 73.9		: 68.7
bgra_to_uv_half_1080_c		: 850.2		: 3732.0
bgra_to_uv_half_1080_neon	: 484.2		: 490.0
bgra_to_uv_half_1920_c		: 1479.2	: 4942.7
bgra_to_uv_half_1920_neon	: 824.2		: 824.7
bgra_to_y_8_c			: 8.2		: 29.5
bgra_to_y_8_neon		: 18.2		: 32.7
bgra_to_y_128_c			: 101.4		: 361.5
bgra_to_y_128_neon		: 74.9		: 73.7
bgra_to_y_1080_c		: 739.4		: 3018.0
bgra_to_y_1080_neon		: 613.4		: 544.2
bgra_to_y_1920_c		: 1298.7	: 5326.0
bgra_to_y_1920_neon		: 918.7		: 934.2

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 16:32:31 +08:00
Zhao Zhili b8b71be07a swscale/aarch64: Add bgr24 to yuv
Test on Apple M1 with kperf
				: -O3		: -O3 -fno-vectorize
bgr24_to_uv_8_c			: 28.5		: 52.5
bgr24_to_uv_8_neon		: 54.5		: 59.7
bgr24_to_uv_128_c		: 294.0		: 830.7
bgr24_to_uv_128_neon		: 99.7		: 112.0
bgr24_to_uv_1080_c		: 965.0		: 6624.0
bgr24_to_uv_1080_neon		: 751.5		: 754.7
bgr24_to_uv_1920_c		: 1693.2	: 11554.5
bgr24_to_uv_1920_neon		: 1292.5	: 1307.5
bgr24_to_uv_half_8_c		: 54.2		: 37.0
bgr24_to_uv_half_8_neon		: 27.2		: 22.5
bgr24_to_uv_half_128_c		: 127.2		: 392.5
bgr24_to_uv_half_128_neon	: 63.0		: 52.0
bgr24_to_uv_half_1080_c		: 880.2		: 3329.0
bgr24_to_uv_half_1080_neon	: 401.5		: 390.7
bgr24_to_uv_half_1920_c		: 1585.7	: 6390.7
bgr24_to_uv_half_1920_neon	: 694.7		: 698.7
bgr24_to_y_8_c			: 21.7		: 22.5
bgr24_to_y_8_neon		: 797.2		: 25.5
bgr24_to_y_128_c		: 88.0		: 280.5
bgr24_to_y_128_neon		: 63.7		: 55.0
bgr24_to_y_1080_c		: 616.7		: 2208.7
bgr24_to_y_1080_neon		: 900.0		: 452.0
bgr24_to_y_1920_c		: 1093.2	: 3894.7
bgr24_to_y_1920_neon		: 777.2		: 767.5

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 16:32:31 +08:00
James Almer bef77c6c9c avformat/dump: only print yaw, pitch, and roll if set
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-04 23:35:08 -03:00
Martin Storsjö e14cdf9990 hlsenc: Calculate the average and actual maximum bitrate of segments
Previously, the bitrate advertised in the master playlist would only
be based on the nominal values in either AVCodecParameters bit_rate,
or via AVCPBProperties max_bitrate. On top of this, a
fudge factor of 10% is added, to account for container overhead.

Neither of these bitrates may be known, and if the encoder is
running in VBR mode, there is no such value to be known. And
the container overhead may be more or less than the given
constant factor of 10%.

Instead, calculate the maximum bitrate per segment based on
what actually gets output from the muxer, and average bitrate
across all segments.

When muxing of the file finishes, update the master playlist
with these values, exposing both the maximum (which previously
was a guesstimate based on the nominal values) via
EXT-X-STREAM-INF BANDWIDTH, and the average via
EXT-X-STREAM-INF AVERAGE-BANDWIDTH.

This makes it possible to use the hlsenc muxer with VBR
encodes, for VOD style muxing.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:33:27 +03:00
Martin Storsjö 9246cca7f7 hlsenc: When not using HLS_SINGLE_FILE, set vs->size to range_length
This matches what is done in the corresponding case for
HLS_SINGLE_FILE.

Normally, vs->size is already initialized correctly - but when
writing the initial segment, with mp4 files, vs->size has been set
to the size of the init segment, while range_length contains the
real size of the first segment.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:33:26 +03:00
Martin Storsjö a50b8bb7cd hlsenc: Remove bogus check for if (vs->start_pos) for appending segments
Previously, vs->start_pos was never 0 here, unless using the
-hls_segment_size option, which wasn't allowed for SEGMENT_TYPE_FMP4.
Therefore, this if statement was practically always taken anyway.

Remove this bogus if statement, to allow changing vs->start_pos
to reflect the right value when not using the -hls_segment_size
option.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:33:25 +03:00
Martin Storsjö 52f57568d5 hlsenc: Fix setting vs->start_pos when not using HLS_SINGLE_FILE or hls_segment_size
When not using HLS_SINGLE_FILE or hls_segment_size, we're writing
each segment into a separate file. In that case, the file start pos for
each segment will be zero.

This matches the case in (hls->max_seg_size > 0) above, where we
decide to switch to a new file.

This fixes the calculation of "vs->size = new_start_pos - vs->start_pos"
at the start of hls_write_packet; previously, start_pos would
refer to the byte size of the previous segment file, giving
vs->size entirely bogus values here.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:33:24 +03:00
Martin Storsjö 01312fdfcf hlsenc: Fix the return value accumulation in append_single_file
Both the read_byte variable (which is accumulated into
append_single_file) and the return value are int64_t;
give the ret variable the right corresponding type too.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:33:23 +03:00
Martin Storsjö affc1acde7 tests: Add a missing dependency for the filter-atempo test
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:03:20 +03:00
Andreas Rheinhardt b13291f37c avcodec/hw_base_encode: Add missing include
Fixes checkheaders.

Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Reviewed-by: Tong Wu <wutong1208@outlook.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-04 19:45:51 +02:00
Rémi Denis-Courmont e2af5904f0 lavc/h264dsp: R-V V 8-bit MBAFF loop filter
Performance is (unfortunately) the same as with non-MBAFF, since the
hardware under test does not short-circuit vector tail calculations.
(IMO, a generic solution or work-around should be agreed on, rather
than bespoke approaches all over the place.)
2024-07-04 19:57:42 +03:00
Rémi Denis-Courmont 5a6e333fc7 lavc/h264dsp: R-V V 8-bit luma loop filter
T-Head C908 (cycles):
h264_h_loop_filter_luma_8bpp_c:       297.5
h264_h_loop_filter_luma_8bpp_rvv_i32: 369.2
h264_v_loop_filter_luma_8bpp_c:       862.7
h264_v_loop_filter_luma_8bpp_rvv_i32: 199.7

Performance in the horizontal scenario seems worse than scalar. x86
SSE2 and AVX optimisations are similarly affected. This is presumably
caused by unlucky inputs from checkasm, such that the C code
short-circuits almost all filter calculations.
2024-07-04 19:57:42 +03:00
Gyan Doshi 03175b587c doc/filter: fix grammar in tiltandshift filter 2024-07-04 15:21:17 +05:30
Ramiro Polla 61e851381f swscale/yuv2rgb/x86: remove mmx/mmxext yuv2rgb functions
These functions are either slower or barely faster than the C LUT
yuv2rgb code.
2024-07-04 11:12:47 +02:00
Ramiro Polla 7eb37c142a avdevice/v4l2: add limited support for multiplanar API
This commit adds support for V4L2's multiplanar API, but only when the
number of planes is 1.

Adding full support for the multiplanar API would require a device that
actually uses more than 1 plane, which I have not found yet.
2024-07-04 11:09:53 +02:00
James Almer cf7e2c5e05 avformat/mov: add more checks for infe atom size
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-03 19:54:31 -03:00
James Almer 235ba14cc0 avformat/mov: check for EOF inside the infe list parsing loop
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-03 19:54:31 -03:00
James Almer a9a5d000aa avformat/mov: check extent_offset calculation for overflow
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-03 19:54:31 -03:00
James Almer c49898a6b1 avformat/mov: check that iloc offset values fit on an int64_t
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-03 19:54:31 -03:00
Rémi Denis-Courmont 4a2de380b7 lavc/vc1dsp: fuse multiply-adds in R-V V inv_trans_8
T-Head C908 (cycles)             before   after
vc1dsp.vc1_inv_trans_4x8_rvv_i32: 240.0   228.0
vc1dsp.vc1_inv_trans_8x4_rvv_i32: 235.2   224.2
vc1dsp.vc1_inv_trans_8x8_rvv_i32: 340.7   327.2
2024-07-03 18:16:36 +03:00
Rémi Denis-Courmont 78e1565f84 lavc/vc1dsp: fuse multiply-adds in R-V V inv_trans_4
T-Head C908 (cycles):            before   after
vc1dsp.vc1_inv_trans_4x4_rvv_i32: 128.0   120.0
vc1dsp.vc1_inv_trans_4x8_rvv_i32: 244.0   240.0
vc1dsp.vc1_inv_trans_8x4_rvv_i32: 239.2   235.2
2024-07-03 18:16:36 +03:00
Leo Izen d69e522523 avcodec/pngenc: fix mDCv typo
When mDCv support was added, there was a typo in both variable names
and also the MKTAG itself, incorrectly listing it as mDVc. The tag name
stands for Mastering Display Color Volume so mDCv is correct.

Typo originally introduced in 7894904141.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
2024-07-03 10:21:17 -04:00
Leo Izen c1af34c25b avcodec/pngdec: fix mDCv typo
When mDCv support was added, there was a typo in both variable names
and also the MKTAG itself, incorrectly listing it as mDVc. The tag name
stands for Mastering Display Color Volume so mDCv is correct. See other
files such as av1dec.c which uses mdcv.

Typo originally introduced in c7a57b0f70.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
2024-07-03 10:21:06 -04:00
James Almer d241edc2b4 fftools/ffmpeg_opt: add missing codec type to some options
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-03 08:26:44 -03:00
Anton Khirnov 901f7e3f72 fftools/ffmpeg_mux_init: make encoder_opts local to ost_add()
It is no longer needed after this function returns.
2024-07-03 11:38:52 +02:00
Anton Khirnov 9a7686e545 fftools/ffmpeg_mux_init: apply encoder options manually
Do not pass an options dictionary to the avcodec_open2() in enc_open().

This is cleaner and more robust, as previously various bits of code
would try to interpret the contents of the options dictionary, with
varying degrees of correctness. Now they can just access the encoder
AVCodecContext directly.

Cf. 372c78dd42 - analogous change for
decoding.

A non-progressive field order is now written on the container level in
interlaced ProRes encoding tests.
2024-07-03 11:38:52 +02:00
Anton Khirnov f1664aabb1 fftools/ffmpeg: rewrite checking whether codec AVOptions have been used
Share the code between encoding and decoding. Instead of checking every
stream's options dictionary (which is also used for other purposes),
track all used options in a dedicated dictionary.
2024-07-03 11:38:52 +02:00
Rajiv Harlalka fc446eea05 tests/fate/filter-audio.mak: add test for atempo audio filter
Signed-off-by: Rajiv Harlalka <rajivharlalka009@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-03 11:37:40 +02:00
Yotam Ofek a9c05eb657 avcodec/aaccoder_twoloop: remove unread max scaler 2024-07-03 02:51:37 +02:00
Yotam Ofek b5ad997e72 avcodec/aaccoder_twoloop: remove unused macro
seems the `sclip` macro was never used
2024-07-03 02:51:09 +02:00
Marvin Scholz ac60ad1872 avcodec/aacdec_usac: Fix array size
The array in ff_aac_usac_mdst_filt_cur that is passed to that has a size
of 7 elements, not 6 and the code in the function accesses the array at
index 6, which would be out of bounds if the size was actually 6.

Fixes: CID1603196
2024-07-03 02:48:27 +02:00
Michael Niedermayer c296d4fdec avfilter/vf_avgblur: Check plane instead of AVFrame
Fixes: CID1551694 Use after free (false positive based on assuming that out == in and one is freed and one used)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:25 +02:00
Michael Niedermayer 34f821e448 avfilter/drawutils: Fix depthb computation
Fixes: CID1496940 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:24 +02:00
Michael Niedermayer aab0c344c5 avfilter/avf_showcwt: Check av_parse_video_rate() for failure
Fixes: CID1539147 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:24 +02:00
Michael Niedermayer 0d0373de3b avformat/rdt: Check pkt_len
Fixes: CID1473553 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:24 +02:00
Michael Niedermayer ca237a841e avformat/mpeg: Check len in mpegps_probe()
Fixes: CID1473590 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:23 +02:00
Michael Niedermayer 64df7d4c1e avformat/mov: Check requested_sample before using it
I am not sure the case described by coverity is possible
but its more robust checking the argument first

Fixes: CID1598441 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:23 +02:00
Michael Niedermayer a469e48b6d avformat/mxfenc: resurrects the error print
Fixes: CID1524681 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:23 +02:00
Michael Niedermayer 4c285bb278 avdevice/dshow: Check ICaptureGraphBuilder2_SetFiltergraph() for failure
Fixes: CID1591939 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:22 +02:00
Michael Niedermayer 86cd7c68bc avcodec/mfenc: check IMFSample_ConvertToContiguousBuffer() for failure
Fixes: CID1591911 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:22 +02:00
Michael Niedermayer 63ecce9ba8 avcodec/vc1_loopfilter: Factor duplicate code in vc1_b_h_intfi_loop_filter()
Fixes: CID1435168

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:22 +02:00
Michael Niedermayer 97ae47f9e9 avcodec/vvc/ctu: Remove dead ret check
Fixes: CID1560040 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:21 +02:00
Michael Niedermayer d22a33710a avcodec/vvc/dec: Remove constant eos_at_start
Fixes: CID1560041 'Constant' variable guards dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:21 +02:00
Michael Niedermayer 4824156fa0 avformat/img2dec: assert no pipe on ts_from_file
Help coverity with CID1500302 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:21 +02:00
Michael Niedermayer 385784a148 avcodec/cbs_jpeg: Try to move the read entity to one side in a test
The checked entity should be alone on one side of the check, this avoids
complex considerations of overflows.
This fixes a issue of bad style in our code and a coverity issue.

Fixes: CID1439654 Untrusted pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:20 +02:00
Michael Niedermayer 4bca147415 fftools/ffplay: Check vulkan_params
Fixes: CID1550133 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:20 +02:00
Michael Niedermayer ed364444f1 fftools/ffmpeg_sched: Remove dead assignments in sch_dec_send()
Fixes: CID1592383 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:20 +02:00
Michael Niedermayer 68f6063e04 fftools/ffmpeg_mux_init: Cleanup on error return in set_dispositions()
Fixes: CID1539099 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:19 +02:00
Michael Niedermayer 7b48360907 fftools/ffmpeg_mux: Remove unneeded initialization
Not sure this change makes sense, the code is more robust with ret set

Fixes: CID1559178 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:19 +02:00
Michael Niedermayer 935d9a5712 fftools/ffmpeg_enc: Initialize Decoder
Fixes: CID1591439 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:19 +02:00
Michael Niedermayer 462bd44b03 fftools/ffmpeg_enc: Initialize fd
Fixes: CID1520677 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:18 +02:00
Michael Niedermayer 97b2ab15de fftools/ffmpeg_enc: simplify opaque_ref check
Found-while-revieweing: CID1520670 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:18 +02:00
Michael Niedermayer 2882d30e3a avformat/mov: Check edit list for overflow
Fixes: 67492/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5778297231310848
Fixes: signed integer overflow: 2314885530818453536 + 7782220156096217088 cannot be represented in type 'long'

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:18 +02:00
Mars Zuo 09a62a6413 swresample/swresample: Rectify invalid function in the documentation
The function av_opt_set_channel_layout has been removed since
version 7.0, and the replacement is av_opt_set_chlayout.
The documentation needs to be updated accordingly.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:17 +02:00
Michael Niedermayer 34fd247c3b fftools/ffmpeg: Check read() for failure
Fixes: CID1591932 Ignoring number of bytes read

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:17 +02:00
Michael Niedermayer 6398242bb2 avcodec/vvc/dec: Check ff_init_cabac_decoder() for failure
Fixes: signed integer overflow: 1107820800 + 1107820800 cannot be represented in type 'int'
Fixes: left shift of 1091059712 by 6 places cannot be represented in type 'int'
Fixes: 69910/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-5162839971528704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:17 +02:00
Michael Niedermayer ca4ff242d8 MAINTAINERS: Add Timo Rothenpieler to server admins
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:16 +02:00
Tong Wu e783e45e29 avcodec/hw_base_encode: avoid getting FFHWBaseEncodeContext from avctx
This patch is to make FFHWBaseEncodeContext a standalone component
and avoid getting FFHWBaseEncodeContext from avctx->priv_data.
This patch also removes some unnecessary AVCodecContext arguments.

For receive_packet call, a small wrapper is introduced.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu 0ba10f2d75 Changelog: add D3D12VA HEVC encoder changelog
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu ba0c14e6bf avcodec: add D3D12VA hardware HEVC encoder
This implementation is based on D3D12 Video Encoding Spec:
https://microsoft.github.io/DirectX-Specs/d3d/D3D12VideoEncoding.html

Sample command line for transcoding:
ffmpeg.exe -hwaccel d3d12va -hwaccel_output_format d3d12 -i input.mp4
-c:v hevc_d3d12va output.mp4

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu d822146f4f avutil/hwcontext_d3d12va: add Flags for resource creation
Flags field is added to support diffferent resource creation.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu fc25b7866a avcodec/vaapi_encode: extract a free funtion to base layer
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu 6403ad77e3 avcodec/vaapi_encode: extract a get_recon_format function to base layer
Surface size and block size parameters are also moved to base layer.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu 88b70b8883 avcodec/vaapi_encode: extract set_output_property to base layer
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu 3ca740f19c avcodec/vaapi_encode: extract gop configuration and two options to base layer
idr_interval and desired_b_depth are moved to HW_BASE_ENCODE_COMMON_OPTIONS.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu 1242abdcee avcodec/vaapi_encode: extract the init and close function to base layer
Related parameters such as device context, frame context are also moved
to base layer.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu aa82340b0c avcodec/vaapi_encode: move the dpb logic from VAAPI to base layer
Move receive_packet function to base. This requires adding *alloc,
*issue, *output, *free as hardware callbacks. HWBaseEncodePicture is
introduced as the base layer structure. The related parameters in
VAAPIEncodeContext are also extracted to HWBaseEncodeContext. Then DPB
management logic can be fully extracted to base layer as-is.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu f303c26292 avcodec/vaapi_encode: move pic->input_surface initialization to encode_alloc
When allocating the VAAPIEncodePicture, pic->input_surface can be
initialized right in the place. This movement simplifies the send_frame
logic and is the preparation for moving vaapi_encode_send_frame to the base layer.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu dea5204b41 avcodec/vaapi_encode: add picture type name to base
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu ff06343d7e avcodec/vaapi_encode: add async_depth to common options
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu ab944e06bc avcodec/hw_base_encode: add FF_HW_ prefix for two enums
PICTURE_TYPE_* and FLAG_* are added FF_HW_ prefix after being moved to
base layer.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu 3747bf0426 avcodec/vaapi_encode: introduce a base layer for vaapi encode
Since VAAPI and future D3D12VA implementation may share some common parameters,
a base layer encode context is introduced as vaapi context's base.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Anton Khirnov e939f02ce6 lavc/hevcdec: improve check for PPS changing between slices
Compare actual PPS objects rather than just PPS ID, as the former might
change while the latter stays the same.

Reported-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 09:55:39 +02:00
Anton Khirnov 5861576f39 lavc/hevcdec: move export_stream_params() from set_sps() to hevc_frame_start()
The only other caller of set_sps() --- hevc_update_thread_context() ---
does not need to call export_stream_params(), since it only updates
AVCodecContext fields that have already been updated by generic code.
2024-07-02 09:55:39 +02:00
Anton Khirnov 99b0c3dc7c lavc/hevcdec: do not pass a pixel format to set_sps()
It is merely copied to AVCodecContext.pix_fmt, which serves no useful
purpose. set_sps() is called from two places:
* when a new SPS becomes active - then the pixel format is
  overridden immediately after the set_sps() call by the result from
  ff_get_format();
* when a new SPS is propagated across frame threads - then the
  AVCodecContext value is already set to the same value by the generic
  code.
2024-07-02 09:55:39 +02:00
Anton Khirnov 5295650655 lavc/hevcdec: do not call export_stream_params_from_sei() in update_thread_context()
It is redundant, since it only sets AVCodecContext fields that are
already copied by the generic code.
2024-07-02 09:55:39 +02:00
Anton Khirnov fd69700e51 lavc/hevcdec: call export_stream_params_from_sei() before ff_get_buffer()
So that correct values of color_trc are set on the allocated frame.
2024-07-02 09:55:39 +02:00
Jiasheng Jiang 4065ff69a2 avcodec/mpegvideo_enc: Add check for av_packet_new_side_data()
Add check for av_packet_new_side_data() to avoid null pointer
dereference if allocation fails.

Fixes: bdc1220eeb ("h263enc: Add an option for outputting info about MBs as side data")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-02 09:55:24 +02:00
Andrew Sayers 5d54a25eea avfilter/af_afade: fix opt_type for nb_samples/ns
The actual value is an int64_t, and is accessed elsewhere as AV_OPT_TYPE_INT64.
2024-07-01 23:16:44 +02:00
Marth64 4dc204ea3e avformat/dvdvideodec: Fix duration logic with 1 chapter and validate chapter range
Chapters and duration are calculated together in dvdvideo demuxer.
Previous chapter calculation logic treated extraction of 1 chapter
using chapter_start and chapter_end switches incorrectly, returning
the duration of the entire title instead of just the segment.

Fix the logic so that it calculates and returns the duration of the
chapter segment instead. Additionally, validate that chapter_end
exceeds chapter_start (except in the special case of 0).

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-01 22:54:00 +02:00
Marth64 0c1c7688ea avformat/dvdvideodec: Do not EOF on WAIT events
A DVDNAV_WAIT event by itself should not warrant an
EOF when navigating the program stream. Some discs
have WAIT events in the middle of a title, causing
playback to end prematurely prior to this fix.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-01 22:53:54 +02:00
Stefano Sabatini 3764b8ecdb lavfi: add Perlin noise generator 2024-07-01 22:31:02 +02:00
Josh Allmann c9151ea507 avcodec/nvenc: fix segfault in intra-only mode
In intra-only mode, frameIntervalP is 0, which means the frame
data array is smaller than the number of surfaces.

Together with using the wrong size on deallocation of the
frame_data_array, this lead to a crash.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-07-01 19:59:01 +02:00
Ramiro Polla cc6fb1643d avdevice/v4l2: add NV16 and NV24 pixel formats 2024-07-01 13:43:07 +02:00
Rémi Denis-Courmont b818dff8d8 lavc/vc1dsp: fix potential overflow in R-V V inv_trans_4
Judging by the coefficients, the last round of add/sub can overflow
to 17 bits with a very small probability just as with the 8-point
transform. This is not observed under FATE, but better safe than sorry.
2024-06-30 19:02:32 +03:00
Rémi Denis-Courmont 349c49fd1b lavc/vc1dsp: fix overflow in R-V V inv_trans_8
The last set of additions/subtractions can break the 16-bit limit, and
require 17 bits of precision. This uses widening adds accordingly to fix
the MSS2 FATE tests.

The problem potentially also affects inv_trans_4 with a very low
probability, but this is not reproducible under FATE.
2024-06-30 19:02:32 +03:00
Rémi Denis-Courmont 2c900d4c11 lavc/vc1dsp: factor R-V V inv_trans_8 code 2024-06-30 19:02:32 +03:00
Andreas Rheinhardt 2902ed25b5 avcodec/iirfilter: Move ff_iir_filter() to lavc/tests/iirfilter.c
It is only used by the test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-30 11:37:25 +02:00
Andreas Rheinhardt 2330e77c97 avfilter/textutils: Constify ff_expand_text()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-30 11:37:06 +02:00
Andreas Rheinhardt ba457e9adb avfilter/textutils,vf_drawtext,qrencode: Constify function pointers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-30 11:37:04 +02:00
Andreas Rheinhardt 5a30b45c0f avcodec/mpeg12dec: Don't adapt (last|next)_pic.linesize for field pics
These values are not read anywhere. Furthermore, since commit
fe6037fd04 the linesize values
of the MPVWorkPictures were wrong for subsequent fields
in a chain of B-pictures (as they are always doubled and no longer
based upon the frame-linesizes) which can eventually lead to overflow.

Finally, it makes no real sense to ever double the linesize
of the reference pictures at all: Even when the current picture
is a field, it can still reference both fields of reference
pictures and therefore the linesize should allow to address
both fields (for the same reason, data is not offset for
reference pictures).

libavcodec/mpeg12dec.c:1304:41: runtime error: signed integer overflow: 4611686018427387904 * 2 cannot be represented in type 'long'

issue: 69732/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEGVIDEO_fuzzer-5123551179374592

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-30 11:34:36 +02:00
Andreas Rheinhardt f26255962c avcodec/aacsbr_template: Remove unused-but-set variable
Also fixes a -Wdeclaration-after-statement.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-30 11:32:27 +02:00
Marton Balint 0d5e3f5a40 avutil/timestamp: avoid possible FPE when 0 is passed to av_ts_make_time_string2()
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-30 09:11:44 +02:00
Rémi Denis-Courmont d5e603ddc0 lavu/lls: remove useless VSETVL
This changes neither VL nor VTYPE, so it can safely be removed.
2024-06-29 21:03:44 +03:00
James Almer 0b330d8642 avformat/mov: set Stereo3D type when parsing eyes box
If view is defined in the child stri box, then the type must be set to
unspecified, as these boxes don't carry packing information.
Also, don't attach a useless Stereo 3D side data if the stream is monoscopic.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer 8af0919cc6 avutil/stereo3d: add a Stereo3D view to signal that the view is unspecified
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer 1c8b32e19f avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified
Given that a video stream/frame may have only one view or both views coded with
the packing information being unavailable, this commit adds a new type value
AV_STEREO3D_UNSPEC for this purpose.
The most common case for this is container level signaling of Stereo3D video
where the specifics are defined at the bitstream level.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer e0b574c483 avcodec/cbs_h266: move decoded_picture_hash to CBS SEI
It's defined in H.274 as a common SEI message type and not in H.266

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer 826f55d5b3 avcodec/cbs_sei: add support for Frame Packing Arrangement SEI parsing
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer 0cb733d276 avfilter/vf_showinfo: don't use sizeof(AVSphericalMapping)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer beacdbf4b4 avfilter/vf_showinfo: only print yaw, pitch, and roll if set
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:51 -03:00
James Almer 778096757d avfilter/vf_showinfo: use av_spherical_projection_name()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 12:57:49 -03:00
James Almer 6da38e11f6 avfilter/vf_showinfo: don't use sizeof(AVStereo3D)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 12:57:49 -03:00
James Almer 3478cf2c2d avfilter/vf_showinfo: print more Stereo 3D fields
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 12:57:49 -03:00
Dawid Kozinski 3e6c794862 avcodec/evc: Alterations following changes in libxeve
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 12:20:15 -03:00
Frank Plowman 83b77990c6 lavc/vvc: Always set flags for the current picture
ff_vvc_frame_rpl uses the flags to detect whether a frame is in use.
Therefore, in the case of a CVSS AU (RASL/GDR with
NoOutputBeforeRecoveryFlag) with ph_non_ref_pic_flag = 1, the frame
would be freed before it is used.  Fix this by always marking the
current frame with VVC_FRAME_FLAG_SHORT_REF, as is done by the HEVC
decoder.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-28 21:37:40 +08:00
Ramiro Polla 1fb77347c8 checkasm: add tests for yuv2rgb 2024-06-28 14:49:49 +02:00
Ramiro Polla a8e2714d82 libavcodec/mjpeg: preserve unclipped last_dc value
Perform av_clip_int16(val) _after_ copying the value to last_dc.

This change ensures that clipping is applied only within the context of
the current block, preventing the propagation of clipped values to
subsequent DC components.

Related commits: c28f648b19 and dffae122d0
Related ticket: 4683
2024-06-28 14:48:23 +02:00
Leo Izen 539d2e989d avcodec/aacdec_lpd: remove unused local variables
int idx, and int first_tcx_flag are set but not used, so this commit
removes their declarations and assignments.
2024-06-28 01:43:52 -04:00
Kacper Michajłow 02b3fc5826 avformat/nuv: return early if header id fails to read
Fixes use of uninitialized value in memcmp below, reported by MSAN.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-27 23:28:46 +02:00
Zhao Zhili 6aeb084c39 avcodec/vvc: Don't create new thread when thread_count is 1
Make its behavior consistent with other decoders, e.g., H.264/H.265.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-27 20:54:42 +08:00
Zhao Zhili baf3123c1c avutil/executor: Allowing thread_count be zero
Before the patch, disable threads support at configure/build time
was the only method to force zero thread in executor. However,
it's common practice for libavcodec to run on caller's thread when
user specify thread number to one. And for WASM environment, whether
threads are supported needs to be detected at runtime. So executor
should support zero thread at runtime.

A single thread executor can be useful, e.g., to handle network
protocol. So we can't take thread_count one as zero thread, which
disabled a valid usercase.

Other libraries take -threads 0 to mean auto. Executor as a low
level utils doesn't do cpu detect. So take thread_count zero as
zero thread, literally.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-27 20:54:42 +08:00
Frank Plowman d79c926ab6 lavc/vvc: Validate IBC block vector
From H.266 (V3) (09/2023) p. 321:

It is a requirement of bitstream conformance that the luma block
vector bvL shall obey the following constraints:
- CtbSizeY is greater than or equal to
((yCb + (bvL[ 1 ] >> 4)) & (CtbSizeY − 1)) + cbHeight

This patch checks this is true, which fixes crashes on fuzzed
bitstreams.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-27 20:38:34 +08:00
Frank Plowman c917c423e0 lavc/vvc: Don't discard return codes
Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-27 20:36:13 +08:00
Gyan Doshi 9a3bc59a38 configure: fix alignment of conditional lib dependencies 2024-06-27 15:12:35 +05:30
Gyan Doshi 27284b7800 configure: fix assignment of dep libs for QR-code filters 2024-06-27 15:12:06 +05:30
Martin Storsjö 75e3b81f75 avcodec/vvcdec: Fix compiling with MSVC 2022 17.8 and older
Versions of MSVC older than 17.9 error out here with the following
error:

    src/libavcodec/vvc/filter.c(815): error C2059: syntax error: '}'
    src/libavcodec/vvc/filter.c(832): error C2065: 'all_zero_bs': undeclared identifier
    src/libavcodec/vvc/filter.c(836): error C2065: 'all_zero_bs': undeclared identifier

This was a regression from 5b9320b209.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-27 11:06:23 +03:00
Michael Niedermayer 1080116658 avcodec/aac/aacdec_usac: Test ac in usac
ff_aac_usac_config_decode() needs AACDecContext to be set but some callers
pass NULL.

Happens only when the LATM decoder is used, and USAC is not supported in
LATM

Fixes: member access within null pointer of type 'AACDecContext' (aka 'struct AACDecContext')
Fixes: 69435/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5733527483121664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:55:11 +02:00
Michael Niedermayer c221c7422f swscale/output: Avoid undefined overflow in yuv2rgb_write_full()
Fixes: signed integer overflow: -140140 * 16525 cannot be represented in type 'int'
Fixes: 68859/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4516387130245120

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:36 +02:00
Michael Niedermayer 9e6c5b6e86 swscale/output: alpha can become negative after scaling, use multiply
Fixes: left shift of negative value -3245
Fixes: 69047/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6571511551950848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:36 +02:00
Paul B Mahol c22488f718 avcodec/smcenc: make sure ny/nx are >= 0
(cherry picked from commit 5ad38785e7ad4067a288e9d5e8ce2c4ed2bf584a)

Fixes: out of array read
Fixes: 68939/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMC_fuzzer-587804104884224

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:35 +02:00
Michael Niedermayer 4a7220bd5c avcodec/targaenc: Allocate space for the palette
Fixes: out of array access
Fixes: 68927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TARGA_fuzzer-5105665067515904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:35 +02:00
Michael Niedermayer d34d4b6a7c avcodec/r210enc: Use av_rescale for bitrate
Fixes: signed integer overflow: 281612954574848 * 65344 cannot be represented in type 'long'
Fixes: 68956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_R210_fuzzer-6459074458746880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:35 +02:00
Michael Niedermayer 228f255b5d avcodec/jfdctint_template: Fewer integer anomalies
Fixes: signed integer overflow: 105788 * -20995 cannot be represented in type 'int'
Fixes: signed integer overflow: 923211729 + 2073948236 cannot be represented in type 'int'
Fixes: signed integer overflow: 1281179284 + 2073948236 cannot be represented in type 'int'
Fixes: 68975/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_fuzzer-6266769177116672
Fixes: 68997/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_KS_fuzzer-6284237161431040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:34 +02:00
Michael Niedermayer 3a9292aff3 avcodec/snowenc: MV limits due to mv_penalty table size
Fixes: out of array read
Fixes: 69673/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5476592894148608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:34 +02:00
Michael Niedermayer eb9c96a82f avcodec/ratecontrol: Try to keep fps as a rational
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:34 +02:00
Michael Niedermayer f81602fb3a tools/target_dec_fuzzer: Adjust threshold for MV30
Fixes: 60867/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-6381933108527104
Fixes: Timeout

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:33 +02:00
Michael Niedermayer 749994194c tools/target_dec_fuzzer: Adjust threshold for jpeg2000
Fixes: Timeout
Fixes: 57385/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5394334324490240

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:25 +02:00
J. Dekker e61fed8280 avutil/riscv/cpu: fix __riscv_v_min_vlen typo
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-06-26 12:50:02 +02:00
Brad Smith 41190da9e1 aarch64: Add OpenBSD runtime detection of dotprod and i8mm using sysctl
Signed-off-by: Brad Smith <brad@comstyle.com>
2024-06-26 02:06:53 -04:00
Nuo Mi 23531c9776 avcodec/vvcdec: alf, support virtual boundaries
see https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9503377

passed files:
    GDR_A_ERICSSON_2.bit
    GDR_B_NOKIA_2.bit
    GDR_C_NOKIA_2.bit
    VIRTUAL_A_MediaTek_3.bit
    VIRTUAL_B_MediaTek_3.bit
2024-06-25 19:32:17 +08:00
Nuo Mi 3bac5ba861 avcodec/vvcdec: sao, support virtual boundaries 2024-06-25 19:32:17 +08:00
Nuo Mi 17c8b63781 avcodec/vvcdec: deblock, support virtual boundaries 2024-06-25 19:32:17 +08:00
Nuo Mi 80ded9cfe7 avcodec/vvcdec: ps, derive virtual boundaries 2024-06-25 19:32:17 +08:00
Nuo Mi 8b3d1f1fb3 cbs_h266: add VVC_MAX_VBS for max num of virtual boundaries 2024-06-25 19:32:17 +08:00
Nuo Mi fc731d8b39 avcodec/vvcdec: misc, constify ALFParams 2024-06-25 19:32:17 +08:00
Nuo Mi 9b532ace02 avcodec/vvcdec: misc, remove unused ALFParams.applied 2024-06-25 19:32:17 +08:00
Nuo Mi 98b6b90601 avcodec/vvcdec: refact out alf_get_edges 2024-06-25 19:32:17 +08:00
Nuo Mi 45d0ba8313 avcodec/vvcdec: misc, reformat ff_vvc_sao_filter 2024-06-25 19:32:17 +08:00
Nuo Mi a69b07dc79 avcodec/vvcdec: refact, fix naming convention of x0, y0 for sao
it's mismatched with the ff_vvc_sao_filter function declaration
2024-06-25 19:32:17 +08:00
Nuo Mi ccf1d4172c avcodec/vvcdec: refact out sao_extends_edges 2024-06-25 19:32:17 +08:00
Nuo Mi 200862b144 avcodec/vvcdec: refact out sao_get_edges 2024-06-25 19:32:17 +08:00
Nuo Mi 5b9320b209 avcodec/vvcdec: refact, unify ff_vvc_deblock_{horizontal, vertical} 2024-06-25 19:32:17 +08:00
Nuo Mi 16e410aaac avcodec/vvcdec: misc, use POS to simplify filter code 2024-06-25 19:32:17 +08:00
Nuo Mi a6ea542a34 avcodec/vvcdec: refact, unify {horizontal, vertical}_bs, {horizontal, vertical}_p, {horizontal, vertical}_q 2024-06-25 19:32:17 +08:00
Nuo Mi cc89832d56 avcodec/vvcdec: refact, unify vvc_deblock_bs_chroma_{horizontal, vertical} 2024-06-25 19:32:17 +08:00
Nuo Mi 0a5bbcf0f3 avcodec/vvcdec: refact, unify vvc_deblock_bs_luma_{horizontal, vertical} 2024-06-25 19:32:17 +08:00
Nuo Mi cb6538e9a1 avcodec/vvcdec: refact, unify vvc_deblock_subblock_bs_{horizontal, vertical} 2024-06-25 19:32:17 +08:00
Nuo Mi 0333b97414 checkasm/vvc_alf: ensure right and bottom boundaries are not overwritten by asm 2024-06-25 19:32:17 +08:00
Nuo Mi 6b0e6a98b5 x86/vvc_alf: avoid overwriting for non-16 aligned widths
Previously, the code allowed overwriting on 16-aligned blocks, which was suitable when there were
no picture's virtual boundaries because both CTU sizes and strides were 16-aligned. However, with
picture's virtual boundaries, each CTU is divided into four ALF blocks, leading to potential issues
with overwriting later CTUs.

In cases involving picture virtual boundaries, each ALF block is 8-pixel aligned.
For luma, we consistently ensure an 8-aligned width. For chroma in 4:2:0 format,
we need to account for a 4-aligned width.
2024-06-25 19:32:17 +08:00
Nuo Mi 1fa9f5b17f checkasm/vvc_alf: random select alf virtual boundaries position
A picture's virtual boundaries will split a CTU into 4 ALF blocks.
The ALF virtual boundary may cross or not cross a ALF block.
2024-06-25 19:32:17 +08:00
Nuo Mi b82ef7c0ba checkasm/vvc_alf: only check the valid filter and classify sizes 2024-06-25 19:32:17 +08:00
James Almer 74035aaed7 avformat/matroskadec: don't use sizeof(AVStereo3D)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-25 00:01:11 -03:00
James Almer f6b29c8773 avformat/mov: don't use sizeof(AVStereo3D)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-25 00:01:11 -03:00
James Almer 7c0ebb095d avcodec/mpeg12dec: don't use sizeof(AVStereo3D)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-25 00:01:10 -03:00
James Almer e6baf4f384 avutil/stereo3d: add a new allocator function that returns a size
av_stereo3d_alloc() is not useful in scenarios where you need to know the
runtime size of AVStereo3D.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-25 00:01:05 -03:00
James Almer 1034296eac avformat/dump: print Stereo3D AVRationals as float
Same as every other rational printed in this file.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-24 20:00:14 -03:00
Timo Rothenpieler 6d4eba51f2 fftools/ffplay_renderer: use correct NULL value for Vulkan type 2024-06-25 00:19:03 +02:00
Lynne dae12ddb2e lavu/stereo3d: change the horizontal FOV field to a rational
This avoids hardcoding any implementation-specific limitiations as
part of the API, and allows for future expandability.

This also allows API users to more conveniently convert the
values into floats without hardcoding specific conversion constants.

The API was committed a few days ago, so changing this field now
is within the realms of acceptable.
2024-06-24 23:53:25 +02:00
Rémi Denis-Courmont 0d748eec8d configure: detect 64-bit generic platforms
Currently, any unrecognised platform is treated as 32-bit. This should
detect *most* 64-bit platforms, namely LP64 and LLP64 ones.
Unfortunately this will not work for ILP32 ABIs on 64-bit ISAs, but
still better than nothing.
2024-06-24 20:23:32 +03:00
Cosmin Stejerean c3814d5409 avcodec/dovi_rpudec: fix reading el_bit_depth_minus8
now that we are reading ext_mapping_idc as the upper 8 bits of
el_bit_depth_minus8 we need to use get_ue_golomb_long rather than
get_ue_golomb_31 for reading it
2024-06-24 18:05:20 +02:00
Pierre-Anthony Lemieux 77ab1c773c fate/jpeg2000dec: add support for p0_10.j2k
p0_10.j2k is one of the reference codestreams included in Rec. ITU-T T.803 | ISO/IEC 15444-4.
Adding this test was made possible by commit 6f4a95cfb8.
2024-06-24 08:50:59 -07:00
Timo Rothenpieler 76317e22a6 avformat/tls_schannel: forward AVIO_FLAG_NONBLOCK to tcp stream
Fixes for example rtmps streaming over schannel.
2024-06-24 15:00:27 +02:00
Ramiro Polla e37a93031e swscale/yuv2rgb: reindent after previous commit 2024-06-24 13:35:22 +02:00
Ramiro Polla 0a08c64588 swscale/yuv2rgb: fix yuv422p input in C code
The C code was silently ignoring the second chroma line on yuv422p
input.
2024-06-24 13:34:53 +02:00
Ramiro Polla fb8fae864f swscale/yuv2rgb: add macros to simplify code generation 2024-06-24 13:34:28 +02:00
Ramiro Polla 88a402df74 swscale/yuv2rgb: fix conversion for widths not aligned to 8
The C code for some pixel formats (rgb555, rgb565, rgb444, and monob)
was not converting the last pixels on widths not aligned to 8.

NOTE: the last pixel for odd widths is still not converted for any of
      the pixel formats in the C code for yuv2rgb except for monob.
2024-06-24 13:33:53 +02:00
Martin Storsjö 6ec22731ae movenc: Add an option for resilient, hybrid fragmented/non-fragmented muxing
This allows ending up with a normal, non-fragmented file when
the file is finished, while keeping the file readable if writing
is aborted abruptly at any point. (Normally when writing a
mov/mp4 file, the unfinished file is completely useless unless it
is finished properly.)

This results in a file where the mdat atom contains (and hides)
all the moof atoms that were part of the fragmented file structure
initially.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-24 11:24:04 +03:00
Martin Storsjö 4b8ddf71dc movenc: Factorize a function for finishing a written fragment
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-24 11:23:55 +03:00
Lynne 0b67c83b2e aacdec_usac, aacsbr: implement SBR support for USAC
Currently, no eSBR features are supported.
Thankfully, no encoders exist for it yet.
2024-06-23 09:10:15 +02:00
Cosmin Stejerean 0c0e7ec81e avcodec/dovi_rpu: correctly read el_bit_depth_minus8 and ext_mapping_idc
These two fields are coded together into a single 16 bit integer with upper 8
bits for ext_mapping_idc and lower 8 bits for el_bit_depth_minus8.

Furthermore ext_mapping_idc has two components, upper 3 bits and lower 5 bits.

Co-authored-by: Niklas Haas <git@haasn.dev>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-06-22 15:48:25 +02:00
Cosmin Stejerean cc587e69c6 avutil/dovi_meta: add fields for ext_mapping_idc
Co-authored-by: Niklas Haas <git@haasn.dev>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-06-22 15:48:23 +02:00
James Almer 127545350f avformat/mov: use the updated default value for horizontal_disparity_adjustment in the eyes box
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-21 14:09:25 -03:00
Lynne d45e20c37b aacdec_usac: remove custom rate_idx and use standard variable for it
m4ac.sampling_index is what aacdec.c uses.
2024-06-21 10:50:22 +02:00
Lynne a381cbc7c7 aacdec_usac: rename noise_scale to noise_bands
This was a typo.
2024-06-21 10:50:21 +02:00
Lynne 89de2f0de1 aacdec_ac: fix an overread
Fixes reading state->last[i + 1] in ff_aac_ac_get_context for the
last array member.
2024-06-21 10:50:21 +02:00
Lynne 50e5b78b79 aac: expose ff_aac_sample_rate_idx() in aac.h
The rate index is a value important to both encoders and decoders.
USAC needs it as well, so put it into the shared main header.
2024-06-21 10:50:20 +02:00
Lynne 1c3545f053 aacdec_usac: apply specification fix M55715 2024-06-21 10:50:13 +02:00
James Almer 35df214a72 avformat/mxfdec: don't use sizeof(AVMasteringDisplayMetadata)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:04:03 -03:00
James Almer a91f34aad8 avformat/mov: don't use sizeof(AVMasteringDisplayMetadata)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:04:03 -03:00
James Almer 8a85d3fd39 avformat/matroskadec: don't use sizeof(AVMasteringDisplayMetadata)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:04:03 -03:00
James Almer c3606cad9c avutil/stereo3d: set a sane default value for AVRational fields
Prevent potential divisions by 0 when using them immediately after allocation.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:03:55 -03:00
James Almer 1044c09eca avutil/mastering_display_metadata: set a sane default value for AVRational fields
Prevent potential divisions by 0 when using them immediately after allocation.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:02:50 -03:00
James Almer 7f1b590480 avutil/ambient_viewing_environment: set a sane default value for AVRational fields
Prevent potential divisions by 0 when using them immediately after allocation.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:02:50 -03:00
James Almer 5140d8334e ffprobe: always print all Stereo3D fields
ffprobe is meant to generate parseable output, and if a field is present, it
should be printed even if it has a default value.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:02:44 -03:00
Andreas Rheinhardt 3a5202d026 avcodec/h261enc: Fix ac_vlc_length tables
These tables are supposed to contain the number of bits needed
to encode a given (run, level) pair. Yet the number of bits
for pairs needing the escape code was wrong (it only contained
the escape code and not the bits needed for run and level).

Furthermore, H.261 (a format with explicit end-of-block codes)
does not work well together with the RLTable API from rl.c:
The EOB code is the first one in ff_h261_rl_tcoeff's VLC table
and has a run value of zero. Therefore the result of get_rl_index()
is off by one for run == 0 and level values with explicit
(run, level) pair.

Fixing this necessitated changing the ref files of the
vsynth*-h261-trellis tests. Both filesizes as well as PSNR
decreased. If one used a qscale value of 11 for this test,
one would have received files with about the same size as
before this patch (with qscale 12), but with better PSNR.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt f3829cc72d avcodec/h261enc: Avoid RLTable when writing macroblock
The RLTable API in rl.c is not well designed for codecs with
an explicit end-of-block code. ff_h261_rl_tcoeff's vlc has
the EOB code as first element (presumably so that the decoder
can check for it via "if (level == 0)") and this implies
that the indices returned by get_rl_index() are off by one
for run == 0 which is therefore explicitly checked.

This commit changes this by adding a simple LUT for the
values not requiring escaping. It is easy to directly
include the sign bit into this, so this has also been done.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 3874442db2 avcodec/h261data: Make some tables non-static
This will allow to avoid the indirection via ff_h261_rl_tcoeff
in future commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 390dbcb8b8 avcodec/mpegvideo_enc: Constify pointers to static storage
These must not be modified (even when they are initialized at runtime
and therefore modifiable).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt b28bf830cd avcodec/motion_est: Optimize dead code away
H.261 does not have B-frames.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt bbb10f1d83 avcodec/h261enc: Inline constants
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 48cdb7d579 avcodec/mpegvideo_dec: Move setting dct_unquant funcs to h263dec.c
It is a better place for it; no non-h263-based decoder needs
these functions any more (both H.261 and the error resilience
code recently stopped doing so).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 64d2bca452 avcodec/rv10: Avoid indirection
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 594723ec38 avcodec/mpegvideo: Move quant_precision to Mpeg4DecContext
It is an MPEG-4-only value; it is always five for the MPEG-4
encoder, so just hardcode this value and move the MpegEncContext
field to Mpeg4DecContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt c735552b0b avcodec/rv10: Use ff_h263_decode_init()
The RV10 and RV20 decoders use ff_h263_decode_mb() and also the
H.263 DSP and VLCs. Despite not calling ff_h263_decode_frame(),
it is nevertheless beneficial to call ff_h263_decode_init()
to reduce code duplication.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 7b539ca3e6 avcodec/mpeg_er: Simplify disabling IDCT
The error resilience code does not make up block coefficients
and therefore zeroes them in order to disable the IDCT.
But this can be done in a simpler manner, namely by setting
block_last_index to a negative value. Doing so also has
the advantage that the dct_unquantize functions are never even
called for those codecs that do not use ff_mpv_reconstruct_mb()
for ordinary decoding (namely RV-30/40 and the VC-1 family).

This approach would not work for intra macroblocks (there is always
at least one coefficient for them and therefore there is no check
for block_last_index for them), but this does not happen at all.
Add an assert for this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt fee9520716 avcodec/rv10: Remove write-only assignments
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt eb0beffcb3 avcodec/h261dec: Don't set framerate multiple times
Just do it once during init.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 9933dfe103 avcodec/h261dec: Simplify decoding motion vectors
Don't use a LUT to negate followed by a conditional ordinary
negation immediately thereafter. Instead fold the two.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt f793074784 avcodec/h261dec: Unquantize coefficients while parsing them
This is beneficial for performance: When concatenating
the file from the vsynth1-h261 fate-test 100 times,
performance (measured by timing the codec's decode callback)
improved by 9.6%.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 1745d12d67 avcodec/h261enc, msmpeg4: Avoid setting dc_scale_tables unnecessarily
It is unnecessary because ff_mpeg1_dc_scale_table is the default
for both dc_scale_tables.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 65d5ccb808 avcodec/mpeg_er: Don't set block_index unnecessarily
ff_init_block_index() sets MpegEncContext.dest and
MpegEncContext.block_index. The latter is unused by
ff_mpv_reconstruct_mb() (which is what this code is
preparatory for) and dest is overwritten a few lines below.
So don't initialize block_index at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt c41818dc5d avcodec/mpeg4videodec: Don't initialize unused inter_scantable
inter_scantable is only used by the dct_unquantize_h263_inter
functions, yet this is not used by the MPEG-4 decoder at all
(in case H.263 quantization is used, the unquantization already
happens in mpeg4_decode_block()).

Also move the common initialization of ff_permute_scantable()
out of the if.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 0f92fecebb avcodec/mpv_reconstruct_mb_template: Optimize WMV2 code away if possible
The WMV2 decoder does not support lowres, so one can optimize
the WMV2 specific code away in the lowres version of this function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt f694db87ca avcodec/mpegvideo: Join loops when initializing ScanTable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 66709df403 avcodec/mpegvideo_dec: Remove unnecessary FFMIN
No mpegvideo-based decoder supports lowres > 3,
so the FFMIN here are unnecessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 2e5287e519 avcodec/mpv_reconstruct_mb_template: Optimize always-true branch away
There are only two mpegvideo decoders that use another
(software) pixel format than YUV420: MPEG-1/2 and
the MPEG-4 studio profile. Neither of these use this part
of the code, so one can optimize the 422 code away when
this code is compiled for the decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt c1097556c7 avcodec/h261dec: Simplify decoding GOB header
h261_resync() can be completely removed, because
h261_decode_gob_header() checks for a GOB header itself if
gob_start_code_skipped is zero.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt 18b059f208 avcodec/h261dec: Fix UB NULL + 0, remove broken resync code
last_resync_gb is never initialized, causing NULL + 0
in align_get_bits(). In addition to that, the loop is never
entered.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt fb1acbc941 avcodec/h261dec: Don't reset gob_start_code_skipped in h261_decode_init()
It always gets reset at the start of h261_decode_frame().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 89a0cec790 avcodec/msmpeg4enc: Combine writing bits
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt a1a8a03373 avcodec/mpeg12enc: Pass AVCodecContext* directly
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 0c88303c0c avcodec/mpeg12enc: Use AVCodecContext, not priv ctx as logctx
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 1d270e99f9 avcodec/mpeg4videodec: Remove always-false check
All valid values of dc_lum and dc_chrom are in the range 0..9,
because they are initialized via tables with 10 elements.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 963bdac226 avcodec/vc1_block: Simplify resetting coded_block
Everything that init_block_index() sets will be overwritten
a few lines below again, so don't call it and simply calculate
the only thing that is used (namely block_index[0]) manually.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 6e1ca92206 avcodec/vc1_block: Remove unnecessary assignments
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 7bccf63de5 avcodec/mpeg4videodec: Don't initialize unused stuff
Only the intra scantable is used for studio profile.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt d197a8d6b6 avcodec/mpeg4videodec: Inline constants
Partitioned macroblocks are always 8bit and not studio profile.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 646ace34cd avcodec/h263enc: Remove no-output code
The no-output mode (guarded by AV_CODEC_FLAG2_NO_OUTPUT)
does not provide a noteworthy speedup; in fact, it even
turned out to be slower than the code with the no-output
code removed (ordinary encode: 153259721 decicycles,
noout encode: 153259721; encode with this patch applied:
152451581 decicycles; timings are for encode_frame callbacks
when encoding a 1080p sample to MPEG-4).

(Furthermore, this code was broken for most of its existence
(since 9207dc3b0d) and no one
noticed, so the no-output mode is probably not used at all.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt d40b46f47c avcodec/ituh263enc: Inline constants
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 0b0a4a7e69 avcodec/svq1enc: Stop copying PutBitContext unnecessarily
Possible since 404fe63e23.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 952a32e9a0 avcodec/mpegutils: Don't output wrong mb skip values
The earlier code had two problems:
1. For reference frames that are not directly output (happens unless
low_delay is set), the mb skip values referred to the next reference
frame to be decoded.
2. For non-reference frames, every macroblock was always considered
skipped.
This makes the output (worse than) useless; that no one ever
complained about this shows that this feature is not really used.
It is therefore removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt b2195a238c avcodec/mpegvideo_dec: Don't keep droppable in sync in update_thread_ctx
It is not a stream property, but a property of an individual picture
(in fact, it is only set by the FLV decoder that does not even support
frame threading).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 39660bf964 avcodec/mpegvideo_dec: Don't alloc framesize-bufs in update_thread_ctx
It is always allocated in ff_mpv_frame_start(), so the only
reason to put it into ff_mpeg_update_thread_context()
would be for the case that a frame-threaded decoder
that supports coded fields implements frame-threading.

The only mpegvideo-decoders supporting coded fields
are MPEG-1/2 and VC-1. The latter's bitstream requires
both coded fields to be part of the same access unit/packet,
so that every frame thread will always call ff_mpv_frame_start()
itself. The former only "need" the framesize buffers when
using lowres. If MPEG-1/2 gains frame-threading, one could either
perform framesize allocation in its update_thread_context
or when starting a field.

(Given that the next packet may trigger a reinitialization
due to a frame size change, it was possible for the buffers
that were allocated here to be thrown away unused.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt ba341be095 avcodec/mpeg12dec: Disable allocating scratchpad buffers when possible
They are no longer used by the MPEG-1/2 decoders except when
using lowres.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 3acf351e77 avcodec/mpv_reconstruct_mb_template: Don't unnecessarily copy data
There is no reason to use a temporary buffer as destination
for the new macroblock before copying it into its proper place.
(Originally, this has been added in commit
b68ab2609c due to concerns about
copying from GPU memory.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt c28e553cbf avcodec/mpegutils: Fix ff_draw_horiz_band()
Broken in 5ecf5b93dd.

More precisely, 3994623df2 changed
the precursor of ff_mpv_reconstruct_mb() to always decode
to the first row of macroblocks for B pictures when
a draw_horiz_band callback is set and to (they are exported to
the caller via said callback and each row overwrites the previously
decoded row; this was probably intended as a cache-optimization).
This first macroblock row was used as source for the draw_horiz_band
callback.

This of course means that the ordinary output B-frame was not
decoded correctly at all. Therefore the first aforementioned commit
removed this special handling of draw_horiz_band; yet it did not
remove the special handling for B-frames in ff_draw_horiz_band(),
which broke draw_horiz_band for B-frames. This commit fixes this.

(Actually, draw_horiz_band was already broken before
5ecf5b93dd when using slice-threading:
All slice-threads would write to the first row of macroblocks
for B-frames, leading to data races. It seems no one has ever complained
about this, just as no one has ever complained about the breakage
caused by 5ecf5b93dd. Probably no one
uses draw_horiz_band.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt f8b8f16163 avcodec/mpegvideo_enc: Don't update qscale unnecessarily
The new value will be overwritten in ff_set_qscale() below.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 85cc6478b6 avcodec/mpegvideo_enc: Initialize qscale tab for all codecs
Calling it is the first thing ff_clean_h263_qscales() and
ff_clean_mpeg4_qscales() do anyway.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 3b67ab85ee avcodec/mpegvideo_enc: Only keep what is used from MECmpContext
A MECmpContext is quite big (792B here) and given
how ff_update_duplicate_context() works, it is (unfortunately)
copied quite frequently when using slice threading.
Therefore keep only what is needed from MECmpContext
and remove MECmpContext from MpegEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt eb3415912b avcodec/mpegvideo_enc: Avoid branch for sse vs nsse cmp
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 8b4f7c0663 avcodec/me_cmp: Zero MECmpContext in ff_me_cmp_init()
Not every function will be set, so zero the context
to initialize everything.

This also allows to remove an initialization in dvenc.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 10e7633cd7 avcodec/motion_est: Store remaining required me_cmp_funcs
This avoids using MpegEncContext.mecc; it already allows
to avoid touching the latter for snowenc and svq1enc.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt d163eefd47 avcodec/me_cmp, motion_est: Sanitize permissible cmp_funcs
Several of the potential choices of comparison functions
need an initialized MpegEncContext (initialized for encoding,
not only ff_mpv_common_init()) or they crash when called.
Modify ff_set_cmp() to check for this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt b1a31b32ab avcodec/me_cmp,dvenc,mpegvideo: Move ildct_cmp to its users
MECmpContext.ildct_cmp is an array of function pointers that
are not set by ff_me_cmp_init(), but that are set by users
to one of the other arrays via ff_set_cmp().

Remove these pointers from MECmpContext and add pointers
for the actually used functions to its users. (The DV encoder
already did so.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt cd2e46a350 avcodec/me_cmp, mpegvideo: Move frame_skip_cmp to MpegEncContext
MECmpContext has several arrays of function pointers that
are not set by ff_me_cmp_init(), but that are set by users
to one of the other arrays via ff_set_cmp().

One of these other users is mpegvideo_enc; it is the only user
of MECmpContext.frame_skip_cmp and it only uses one of these
function pointers at all.

This commit therefore moves this function pointer to MpegEncContext;
and removes the array from MECmpContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 182e647a64 avcodec/me_cmp, motion_est: Move me_(pre_)?_cmp etc. to MotionEstContext
MECmpContext has several arrays of function pointers that
are not set by ff_me_cmp_init(), but that are set by users
to one of the other arrays via ff_set_cmp().

One of these other users is the motion estimation API.
It uses MECmpContext.(me_pre|me|me_sub|mb)_cmp. It is
basically the only user of these arrays.

This commit therefore moves these arrays to MotionEstContext;
this has the additional advantage of making motion_est.c
more independent from MpegEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 1367ef198a avcodec/me_cmp: Constify ff_set_cmp()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt bbd355355d avcodec/motion_est: Factor one-time initialization out of ff_init_me
The majority of the stuff performed in it needs to be done only
once; so factor it out into a function of its own to be called
in the user's init function.
Also avoid using MpegEncContext in it, to separate the two
a bit more.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 422711d1a5 avcodec/dvenc: Check for availability of interlaced dct cmp func
Not every type of comparison function implements every function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt c46711d44f avcodec/mpegvideo_enc: Check for existence of ildct cmp functions
Not all compare functions are implemented for all compare function
types. Therefore check for the existence of the used functions.
Fixes issue #10245.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 415a3c32c9 avcodec/mpegvideo_enc: Avoid excessive inlining
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 0ef8f0f965 avcodec/ituh263dec: Use VLC symbol table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 010951239c avcodec/mpeg12dec: Use VLC symbol table
Possible by using MB_TYPE_CODEC_SPECIFIC for MB_TYPE_ZERO_MV
and due to the MB_TYPE_*_MV flags fitting into an int16_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt e7d6300c10 avcodec/mpeg4videodec: Use VLC symbol table
Possible now that MB_TYPE_L1 (which does not fit into
an int16_t) is no longer used).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt f161d9449a avcodec/mpegutils: Move H.264-only macros to h264dec.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt f5d5b80f3c avcodec/mpegutils: Don't use MB_TYPE_L[01] for mpegvideo
MB_TYPE_L[01] is based upon H.264 terminology (it stands for
list); yet the mpegvideo based decoders don't have lists
of reference frames, they have at most one forward and one
backward reference. So use terminology based upon this.

This also has a second advantage: MB_TYPE_L[01] is actually
an OR of two flags (which are set independently for H.264,
but aren't for mpegvideo). Switching to different flags
makes the flags fit into an int16_t, which will be useful
in future commits.

The only downside to this is a very small amount of code
in error_resilience.c and mpegutils.c (the only code shared
between the H.264 decoder and mpegvideo).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 07ae09bdf1 avcodec/mpegutils: Remove always-false check
SVQ3 does not call ff_print_debug_info2().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt c94d81ce00 avcodec/h261dec: Remove nonsense information from error message
The "invalid mtype index" here is always -1, because that is
the value the VLC api uses for not existent leafs in an incomplete tree.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 0876b160d6 avcodec/h261dec: Use VLC symbol table
This is possible now that MB_TYPE_CBP and MB_TYPE_QUANT
fit into an int16_t; only MB_TYPE_H261_FIL needs to
be remapped to MB_TYPE_CODEC_SPECIFIC.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 4cdd684e86 avcodec/mpegutils: Remap MB_TYPE_{GMC,SKIP,CBP,QUANT}
Do this to make MB_TYPE_{CBP,QUANT} fit into an int16_t,
so that can be used in a VLC symbol table.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt dd1e804a98 avcodec/mpegutils: Remap MB_TYPE_ACPRED, add codec-specific MB_TYPE
MB_TYPE_ACPRED is currently reused for MB_TYPE_REF0 by H.264,
so that the value fits into an uint16_t. Given that MB_TYPE_ACPRED
is not subject to any such restriction (apart from fitting into
32bits), it can be remapped to a hithereto unused bit.
The then available bit will be declared to be codec-specific
(i.e. unused by generic code), so that H.264 can use it
for MB_TYPE_REF0 and so that it can be reused later for
e.g. MB_TYPE_H261_FIL.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 5805b860fe configure: Remove obsolete mpeg4_decoder->mpeg4video_parser dependency
Obsolete since 3ceffe7839.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 18f1aca3e8 avcodec/mpegvideo_dec: Set dct_unquantize ptrs only once when possible
Everything except dct_unquantize_intra for MPEG-4 need only
be set once.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 091d006637 avcodec/mpegvideo: Set dct_unquantize earlier
Set them in ff_mpv_idct_init() so that they are already set
in ff_mpv_decode_init(). This is in preparation for avoiding
to set dct_unquantize in every ff_mpv_frame_start().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 4339d2c11c avcodec/mpegvideo: Don't pretend dct_init can fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 80c2d7c890 avcodec/mpegvideo_enc: Avoid branches for flipping no_rounding
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt 91fce67691 avcodec/vc1: Combine identical checks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Theo Fabi d6d14b3a15 avdevice/avfoundation: add external video devices
Video devices categorized by AVFoundation as
'AVCaptureDeviceTypeExternal(Unknown)' (like USB video streams) were not
recognized by libavdevice.

Signed-off-by: Theo Fabi <fabi.theo@gmail.com>
2024-06-20 18:52:06 +02:00
Frank Plowman 8d6014dbc6 lavc/vvc: Invalidate PPSs which refer to a changed SPS
When the SPS associated with a particular SPS ID changes, invalidate all
the PPSs which use that SPS ID.  Fixes crashes with illegal bitstreams.
This is done in the CBS, rather than in libavcodec/vvc/ps.c like the SPS
ID reuse validation, as parts of the CBS parsing process for PPSs
depend on the SPS being referred to.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-20 20:33:23 +08:00
Araz Iusubov 02430680b0 libavcodec/amfenc: Update AMF encoder options
Encoder options have been updated to the current version of the AMF.

Signed-off-by: Araz Iusubov <Primeadvice@gmail.com>
2024-06-20 09:12:24 -03:00
Araz Iusubov 696bd64d01 libavcodec/amfenc: Update AMF release version 2024-06-20 09:12:24 -03:00
James Almer 53c8d417ed avformat: split off generic NAL function helpers into their own file
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 08:57:45 -03:00
Frank Plowman 0eacad6921 fate/vvc: add vvc-conformance-RPR_A_4
Before    After
-------------------------------------------------
make fate-vvc CPU Time (No ASM)  131.52s  134.83s
libavcodec/vvc/* Line Coverage     95.3%    96.9%
inter_template.c Line Coverage     74.3%    88.2%
inter.c Line Coverage              85.3%    99.2%

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-20 08:57:45 -03:00
James Almer 0ae157b360 avformat/iamf_parse: add missing padding to AAC extradata
Fixes: out of array access
Fixes: 68863/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4833546039525376

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-19 10:12:57 -03:00
James Almer 4e608e90eb avformat/evc: fix writing reserved bits
They are all zeroes, not ones.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-19 10:12:50 -03:00
James Almer 5191339f74 avformat/evc: remove useless struct field
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-19 10:03:04 -03:00
Michael Niedermayer 4cab028bd0 avformat/mxfdec: Check container_ul->desc before use
Fixes: CID1592939 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 13:24:31 +02:00
Michael Niedermayer 0da6865ce2 avfilter/qsvvpp: Remove unreachable code
Fixes: CID1598548 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 13:23:07 +02:00
Michael Niedermayer 2b2ced61eb avcodec/libvpxenc: Cleanup on error
This or fifo needs to be freed on errors explicitly

Fixes: memleak
Fixes: 68937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVPX_VP8_fuzzer-4830831016214528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 12:58:22 +02:00
Michael Niedermayer 7fab9b9761 avformat/iamf_parse: 0 layers are not allowed
Fixes: out of array access
Fixes: 68302/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4665793796177920

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 12:54:46 +02:00
Michael Niedermayer c69e6cccd7 avformat/iamf_parse: consider nb_substreams when accessing substreams array
Fixes: out of array access
Fixes: 68584/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6256656668229632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 12:52:20 +02:00
Michael Niedermayer 97ecfb5a19 MAINTAINERS: Update the entries for the release maintainer for FFmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 12:36:02 +02:00
Ramiro Polla 75f1a8e071 swscale/aarch64: add neon {lum,chr}ConvertRange
chrRangeFromJpeg_8_c: 29.2
chrRangeFromJpeg_8_neon: 19.5
chrRangeFromJpeg_24_c: 80.5
chrRangeFromJpeg_24_neon: 34.0
chrRangeFromJpeg_128_c: 413.7
chrRangeFromJpeg_128_neon: 156.0
chrRangeFromJpeg_144_c: 471.0
chrRangeFromJpeg_144_neon: 174.2
chrRangeFromJpeg_256_c: 842.0
chrRangeFromJpeg_256_neon: 305.5
chrRangeFromJpeg_512_c: 1699.0
chrRangeFromJpeg_512_neon: 608.0
chrRangeToJpeg_8_c: 51.7
chrRangeToJpeg_8_neon: 22.7
chrRangeToJpeg_24_c: 149.7
chrRangeToJpeg_24_neon: 38.0
chrRangeToJpeg_128_c: 761.7
chrRangeToJpeg_128_neon: 176.7
chrRangeToJpeg_144_c: 866.2
chrRangeToJpeg_144_neon: 198.7
chrRangeToJpeg_256_c: 1516.5
chrRangeToJpeg_256_neon: 348.7
chrRangeToJpeg_512_c: 3067.2
chrRangeToJpeg_512_neon: 692.7
lumRangeFromJpeg_8_c: 24.0
lumRangeFromJpeg_8_neon: 17.0
lumRangeFromJpeg_24_c: 56.7
lumRangeFromJpeg_24_neon: 21.0
lumRangeFromJpeg_128_c: 294.5
lumRangeFromJpeg_128_neon: 76.7
lumRangeFromJpeg_144_c: 332.5
lumRangeFromJpeg_144_neon: 86.7
lumRangeFromJpeg_256_c: 586.0
lumRangeFromJpeg_256_neon: 152.2
lumRangeFromJpeg_512_c: 1190.0
lumRangeFromJpeg_512_neon: 298.0
lumRangeToJpeg_8_c: 31.7
lumRangeToJpeg_8_neon: 19.5
lumRangeToJpeg_24_c: 83.5
lumRangeToJpeg_24_neon: 24.2
lumRangeToJpeg_128_c: 440.5
lumRangeToJpeg_128_neon: 91.0
lumRangeToJpeg_144_c: 504.2
lumRangeToJpeg_144_neon: 101.0
lumRangeToJpeg_256_c: 879.7
lumRangeToJpeg_256_neon: 177.2
lumRangeToJpeg_512_c: 1794.2
lumRangeToJpeg_512_neon: 354.0
2024-06-18 23:12:41 +02:00
Niklas Haas 90579fbb90 avcodec/dovi_rpudec: handle errors consistently
Only flush state when we started parsing data, otherwise just error out.
Remove the 'fail' label to make this a bit less confusing to read.
2024-06-18 21:18:30 +02:00
Niklas Haas 0a5ed91e5e avcodec/dovi_rpudec: reject reserved_zero_3bits != 0
This is used by future versions of the spec to implement metadata
compression. Given that we don't yet implement that spec, validate that
this is equal to 0 for now.
2024-06-18 21:18:30 +02:00
Niklas Haas d9f902d3a4 avcodec/dovi_rpu: guard ext blocks by dm_metadata_present
In the spec, dm_metadata_present also toggles all extension blocks, so
we need to move them inside the branch.
2024-06-18 21:18:30 +02:00
Niklas Haas 5e778cbfd5 avcodec/dovi_rpu: move ff_dovi_rpu_generate to correct section
This is not an internal use function.
2024-06-18 21:18:30 +02:00
Niklas Haas 7bf08a5b2d avcodec/dovi_rpu: simplify vdr type
Storing the color metadata alongside the data mapping is no longer
needed, so we can simplify this array's type.
2024-06-18 21:18:30 +02:00
Niklas Haas ae7bff55df avcodec/dovi_rpudec: simplify vdr handling (cosmetic)
Move `vdr` into local scope and point only to the field we actually care
about.
2024-06-18 21:18:30 +02:00
Niklas Haas 7ee64631f6 avcodec/dovi_rpu: fix dm_metadata_id handling
Despite the suggestive size limits, this metadata ID has nothing to do
with the VDR metadata ID used for the data mappings. Actually, the
specification leaves them wholly unexplained, other than acknowleding
their existence. Must be some secret dolby sauce. They're not even
involved in DM metadata compression, which is handled using an entirely
separate ID.

That leaves us with a lack of anything sensible to do with these IDs.
Since we unfortunately only expose one `dm_metadata_id` field to the
user, just ensure that they match; which appears to always be the case
in practice. If somebody ever hits this error, I would really much
rather like to see the triggering file.
2024-06-18 21:18:30 +02:00
Niklas Haas 68a22ac936 avcodec/dovi_rpu: properly handle vdr_dm_metadata_present
When this is 0, the metadata is explicitly inferred to stated default
values from the spec, rather than inferred from the previous frame's
values.

Likewise, when encoding, instead of checking if the value changed since
the last frame, we need to check if it differs from the default.
2024-06-18 21:18:30 +02:00
Niklas Haas e1b91eb195 avdovi/dovi_rpudec: handle prev_vdr_rpu_id failures
According to the spec, missing previous VDR RPU IDs do not constitute an
error, but we should instead fallback first to VDR RPU with ID 0, and
failing that, synthesize "neutral" metadata.

That's nontrivial though as the resulting metadata will be dependent on
other properties of the RPU, and this case is not hit in practice so
I'll defer it to a rainy day.
2024-06-18 21:18:30 +02:00
Niklas Haas 954f890f95 avcodec/dovi_rpudec: validate L2.ms_weight
This is specified to be in the range -1 to 4095, apparently the only
extension level with such a restriction.
2024-06-18 21:17:36 +02:00
Niklas Haas e07b735a99 avcodec/dovi_rpudec: add return code to parse_ext_v* 2024-06-18 21:17:30 +02:00
Derek Buitenhuis 620f6f7d5b avformat/dump: Print all possible Stereo3D info
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 19:54:35 +01:00
James Almer 0c0be4b99e fate/lavf-container: add extract_extradata BSF dependency to lavf-fate-hevc.mp4
Otherwise a bunch of SEI units that should not be in hvcC will be included,
and generate different output with builds where extract_extradata_bsf is not
present.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-18 15:47:59 -03:00
James Almer 89779a3cbe fate/lavf-container: add a hevc in ISOBMFF remux test
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-18 12:47:44 -03:00
Derek Buitenhuis 8e7ca22b36 avformat/mov: Add support for reading and exporting horizontal field of view
These boxes are created by the Apple Vision Pro and the iPhone 15+ when
capture for the Vision Pro is enabled.

Based off of the swift API:
  * https://developer.apple.com/documentation/coremedia/kcmformatdescriptionextension_horizontalfieldofview

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Derek Buitenhuis 5c17376321 avformat/mov: Add support for exporting Video Extension Usage info
This box is provided by files created by the Apple Vision Pro, as well
as the iPhone 15+ when capture for Vision Pro is enabled.

The boxes are a mix of things documented by Apple in some PDFs, their
API docs, and reverse engineering. Ideally we will have a real spec
one day.

Links:
  * https://developer.apple.com/av-foundation/Stereo-Video-ISOBMFF-Extensions.pdf
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_horizontaldisparityadjustment
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_stereocamerabaseline
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_heroeye

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Derek Buitenhuis 049dfe3f65 fftools/ffprobe: Print more Stereo 3D info from side data
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Derek Buitenhuis cf2436a0b4 avutil/stereo3d: Fill out stereo info provided by Vision Pro files
Based on what is in the files themselves, and what the API provides
to users.

URLs:
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_heroeye
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_stereocamerabaseline
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_horizontaldisparityadjustment
  * https://developer.apple.com/documentation/coremedia/kcmformatdescriptionextension_horizontalfieldofview

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Derek Buitenhuis 57bfba35d6 avutil/spherical: Add more spherical types
These originate from the Apple Vision Pro, and are documented here:

    https://developer.apple.com/documentation/coremedia/cmprojectiontype

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Andreas Rheinhardt b515088576 avcodec/loongarch/Makefile: Fix vc1dsp_lasx.o build criterion
Fixes ticket #11057.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-18 11:49:27 +02:00
Zhao Zhili e598a323dc avutil/macos_kperf: Fix assert which makes kperf failed to run
On m1, kpc_get_counter_count(KPC_MASK) return 8 in my test. The
exact value doesn't matter in our case, as long as we have a
sufficiently large array

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-18 15:24:12 +08:00
Zhao Zhili ec1daa39e0 avutil/timer: Fix missing header for mach_absolute_time
mach/mach_time.h was included only when CONFIG_MACOS_KPERF wasn't
been defined.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-18 15:24:02 +08:00
Zhao Zhili 74b4e550cb tests/checkasm: Remove check on linux perf fd in uninit
The check should be >= 0, not > 0. The check itself is redundant
since uninit only being called after init is success.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-18 15:23:46 +08:00
sfan5 c28e5b597e lavf/tls_mbedtls: add workaround for TLSv1.3 vs. verify=0
As of mbedTLS 3.6.0 TLSv1.3 is enabled by default and certificate verification
is now mandatory. Our default configuration does not do verification, so
downgrade to 1.2 in these situations to avoid breaking it.

ref: https://github.com/Mbed-TLS/mbedtls/issues/7075

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-18 07:23:44 +02:00
Martin Storsjö ab8f7030bc aarch64: Use cntvct_el0 as timer register on Android and macOS
The default timer register pmccntr_el0 usually requires enabling
access with e.g. a kernel module (while it is accessible by
default on Windows). On Linux, the default for checkasm benchmarks
is to use perf (if suitable headers are available) though.

On macOS, using cntvct_el0 gives measurements with the same
magnitude as mach_absolute_time (which is used currently), but
possibly with a little less overhead/noise.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-17 14:00:34 +03:00
James Almer fcf72966a5 swscale/x86/range_convert: add missing AVX2 preprocessor wrapper
Fixes compilation with old yasm.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-16 10:09:38 -03:00
Andreas Rheinhardt 7c95c7de4a avcodec/libx265: Don't copy A53 closed captions by default
The SEI handling of libx265 is buggy and can easily lead
to memory corruption: It reuses certain buffers, but when
reusing them it presumes that it is enough for these buffers
to exist and does not check whether they are actually large
enough to hold what is intended to be stored in them.*

Our users are exposed to this because forwarding A53 CC data
is enabled by default. Change this to make it disabled
by default.

"Fixes" tickets #10411, #11052 and (presumably) #10906.

*: See https://trac.ffmpeg.org/ticket/9666#comment:1

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-16 12:30:59 +02:00
James Almer fa325379c9 fate/checkasm: run the sw_range_convert test
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-15 21:02:06 -03:00
James Almer 8a4c9d6bd3 swscale/x86/range_convert: reduce amount of xmm regs clobbered in luma functions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-15 21:02:06 -03:00
Ramiro Polla f6859cade3 swscale/x86: add sse2 and avx2 {lum,chr}ConvertRange
chrRangeFromJpeg_8_c: 22.3
chrRangeFromJpeg_8_sse2: 13.3
chrRangeFromJpeg_8_avx2: 13.3
chrRangeFromJpeg_24_c: 72.8
chrRangeFromJpeg_24_sse2: 22.3
chrRangeFromJpeg_24_avx2: 17.5
chrRangeFromJpeg_128_c: 345.5
chrRangeFromJpeg_128_sse2: 106.0
chrRangeFromJpeg_128_avx2: 57.8
chrRangeFromJpeg_144_c: 380.5
chrRangeFromJpeg_144_sse2: 118.5
chrRangeFromJpeg_144_avx2: 62.3
chrRangeFromJpeg_256_c: 646.3
chrRangeFromJpeg_256_sse2: 218.8
chrRangeFromJpeg_256_avx2: 109.0
chrRangeFromJpeg_512_c: 1461.5
chrRangeFromJpeg_512_sse2: 426.5
chrRangeFromJpeg_512_avx2: 211.5
chrRangeToJpeg_8_c: 37.8
chrRangeToJpeg_8_sse2: 10.5
chrRangeToJpeg_8_avx2: 14.0
chrRangeToJpeg_24_c: 114.3
chrRangeToJpeg_24_sse2: 23.5
chrRangeToJpeg_24_avx2: 16.3
chrRangeToJpeg_128_c: 633.5
chrRangeToJpeg_128_sse2: 107.5
chrRangeToJpeg_128_avx2: 55.0
chrRangeToJpeg_144_c: 758.3
chrRangeToJpeg_144_sse2: 132.0
chrRangeToJpeg_144_avx2: 64.5
chrRangeToJpeg_256_c: 1345.0
chrRangeToJpeg_256_sse2: 218.0
chrRangeToJpeg_256_avx2: 105.3
chrRangeToJpeg_512_c: 2524.0
chrRangeToJpeg_512_sse2: 417.0
chrRangeToJpeg_512_avx2: 218.8
lumRangeFromJpeg_8_c: 11.8
lumRangeFromJpeg_8_sse2: 11.0
lumRangeFromJpeg_8_avx2: 10.3
lumRangeFromJpeg_24_c: 38.5
lumRangeFromJpeg_24_sse2: 15.5
lumRangeFromJpeg_24_avx2: 12.5
lumRangeFromJpeg_128_c: 232.3
lumRangeFromJpeg_128_sse2: 60.0
lumRangeFromJpeg_128_avx2: 26.8
lumRangeFromJpeg_144_c: 259.5
lumRangeFromJpeg_144_sse2: 65.3
lumRangeFromJpeg_144_avx2: 29.0
lumRangeFromJpeg_256_c: 464.5
lumRangeFromJpeg_256_sse2: 107.5
lumRangeFromJpeg_256_avx2: 54.0
lumRangeFromJpeg_512_c: 897.5
lumRangeFromJpeg_512_sse2: 224.5
lumRangeFromJpeg_512_avx2: 109.8
lumRangeToJpeg_8_c: 17.8
lumRangeToJpeg_8_sse2: 11.0
lumRangeToJpeg_8_avx2: 11.8
lumRangeToJpeg_24_c: 56.3
lumRangeToJpeg_24_sse2: 11.0
lumRangeToJpeg_24_avx2: 12.5
lumRangeToJpeg_128_c: 333.8
lumRangeToJpeg_128_sse2: 53.3
lumRangeToJpeg_128_avx2: 26.5
lumRangeToJpeg_144_c: 375.5
lumRangeToJpeg_144_sse2: 60.8
lumRangeToJpeg_144_avx2: 29.0
lumRangeToJpeg_256_c: 652.0
lumRangeToJpeg_256_sse2: 109.5
lumRangeToJpeg_256_avx2: 53.5
lumRangeToJpeg_512_c: 1284.3
lumRangeToJpeg_512_sse2: 218.0
lumRangeToJpeg_512_avx2: 108.3
2024-06-16 00:35:51 +02:00
Ramiro Polla 874152033d checkasm: add tests for {lum,chr}ConvertRange 2024-06-16 00:34:24 +02:00
Osamu Watanabe 6f4a95cfb8 avcodec/jpeg2000dec: fix tilepart processing
Fix http://trac.ffmpeg.org/ticket/10121

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-06-15 10:25:17 -07:00
Thomas Siedel c75940db29 avcodec: add external enc libvvenc for H266/VVC
Add external encoder VVenC for H266/VVC encoding.
Register new encoder libvvenc.
Add libvvenc to wrap the vvenc interface.
libvvenc implements encoder option: preset,qp,qpa,period,
passlogfile,stats,vvenc-params,level,tier.
Enable encoder by adding --enable-libvvenc in configure step.

Co-authored-by: Christian Bartnik chris10317h5@gmail.com
Signed-off-by: Thomas Siedel <thomas.ff@spin-digital.com>
2024-06-15 21:00:05 +08:00
Rémi Denis-Courmont 4e4444f97c configure: remove stray bfin architecture
This seems to have been omitted in
880e2aa236.
2024-06-14 21:28:11 +03:00
Rémi Denis-Courmont 4819aeebf4 avr32: remove explicit support
The vendor has long since switched to Arm, with the last product
reaching their official end-of-life over 11 years ago. Linux support for
the ISA was dropped 7 years ago. More importantly, this architecture was
never supported by upstream GCC, and the vendor fork is stuck at version
4.2, which FFmpeg no longer supports (as per C11 requirement).

Presumably, this is still the case given the lack of vendor support.
Indeed all of the code being removed here consisted of inline assembler
scalar optimisations. A sane C compiler should be able to perform those
automatically nowadays (with the sole exception of fast CLZ detection),
but this is moot as this architecture is evidently dead.
2024-06-14 21:28:10 +03:00
Tomas Härdin be2cabce32 lavu/intmath.h: Fix UB in ff_ctz_c() and ff_ctzll_c()
Found by value analysis
2024-06-14 14:28:25 +02:00
Tomas Härdin 3b9e457647 lavu/common.h: Fix UB in av_clip_uintp2_c()
Found by value analysis
2024-06-14 14:28:25 +02:00
Tomas Härdin 60ab40be70 lavu/common.h: Fix UB in av_clip_intp2_c()
Found by value analysis
2024-06-14 14:28:25 +02:00
Tomas Härdin 818a487849 lavu/common.h: Fix UB in av_clipl_int32_c()
Found by value analysis
2024-06-14 14:28:24 +02:00
Niklas Haas 6225ad5c19 avcodec/dovi_rpu{enc,dec}: fix ms_weight handling
The code as written was wrong. In the spec, these fields are treated
merely as plain integers in the range 0 to 4095. The only difference
between L2 and L8 is that L2.ms_weight also accepts an additional value
of -1, hence the extra sign bit. While it's likely that these are still
shifted integers in disguise, since all real-world samples seem to use
a value of 2048 here, the offset used in the code was wrong.

In addition, because the l8.ms_weight struct member is unsigned, these
wrong shifting semantics ended up overflowing the field, leading to
undefined behavior when transcoding. Fortunately, the damage was
relatively contained in practice, because it just corrupts the coding of
this field, which is ignored in practice in all implementations I have
seen.
2024-06-14 13:43:55 +02:00
James Almer 08383443ff avcodec/vorbisdec: don't use double intermediate in vorbisfloat2float
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:36:09 -03:00
James Almer 1b9af306da avcodec: use the renamed av_zero_extend
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:36:09 -03:00
James Almer 4b57ea8fc7 avutil/common: assert that bit position in av_zero_extend is valid
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:36:09 -03:00
James Almer 39c90d6466 avutil: rename av_mod_uintp2 to av_zero_extend
It's more descriptive of what it does.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:35:57 -03:00
Sean McGovern cdd139d760 libavcodec/alpha: remove DSP & support code
Introduced in 1992, the Alpha was a 64-bit RISC processor designed
to replace the VAX CISC machines sold by Digital Equipment Corporation.

After Digital was acquired by Compaq in 1998 -- who themselves would be
later purchased by Hewlett-Packard, the architecture was phased out over
the following decade. It became effectively defunct in 2007, the last
publicly available processor being the Alpha 21364.

FFmpeg has not added any DSP code for this architecture since lowres2
was introduced in 2012, and it is more than unlikely someone still wishes
to maintain it.

Remove the DSP and support code.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2024-06-13 23:14:26 +02:00
Rémi Denis-Courmont a5d2d26742 sh4: remove architecture
Support for SuperH was dropped over a decade ago. There no longer is any
architecture-specific code to be found, so just remove the corresponding
test. Technically it is still possible to compile FFmpeg as the
"generic" (pure C) architecture.
2024-06-13 21:16:16 +03:00
Rémi Denis-Courmont c5f69719bc lavu/bswap: remove some inline assembler
C code or compiler built-ins are preferable over inline assembler for
byte-swaps as it allows for better optimisations (e.g. instruction
scheduling) which would otherwise be impossible.

As with f64c2e710f for x86 and Arm,
this removes the inline assembler on GCC (and Clang) since we now
require recent enough compiler versions. This indeed seems to work on
AArch64, SuperH and, if Zbb is enabled, RISC-V. (AVR32 was not tested
since it has no known working compilers at this time.)
2024-06-13 21:16:16 +03:00
Rémi Denis-Courmont 0231097d1b lavu/x86: remove GCC 4.4- stuff
Since the C11 support is required, those GCC versions can no longer be
supported anyhow. (Clang pretends to be GCC 4.4, but it looks like the
code was intended for old GCC specifically.)
2024-06-13 21:16:16 +03:00
Rémi Denis-Courmont 424ac84839 lavu/arm: remove GCC 4.6- stuff
Since the C11 support is required, those GCC versions can no longer be
supported anyhow. (Clang pretends to be GCC 4.4, but the removed code
does not seem to have been intended for Clang.)
2024-06-13 21:16:16 +03:00
James Almer a7e9f1c1e7 checkasm/lls: add missing random values to the test buffers
Fixes valgrind warnings after 18adaf9fe5.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 14:21:18 -03:00
Anton Khirnov 0060a368b1 lavc/hevcdec: always call hevc_frame_end() after successfully decoding an AU
Currently it is only done if the final CTB address is at the end of the
frame, however that address is not known with hwaccel decoding. As we
only support exactly one AU per packet, and not partial/multiple AUs, we
can just as well call hevc_frame_end() unconditionally.

Fixes hwaccel decoding after d725c737fe.

Reported-by: llyyr <llyyr.public@gmail.com>
2024-06-13 11:44:05 +02:00
Michael Niedermayer 959cb2e2e3 doc/developer: Provide information about git send-email and gmail
The 2 links are the clearest i found.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-13 00:39:57 +02:00
Marton Balint 9fb6f024c3 avformat/mxfdec: use the newly added channel ids for more exact mapping
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-12 19:37:01 +02:00
Marton Balint d9a0a6a2b5 avformat/mov_chan: make iso_channel_position table more compact
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-12 19:37:01 +02:00
Marton Balint e405afdd0a avformat/mov_chan: use the newly added channel ids for more exact mapping
Also make the iso_channel_position table consistent with what the AAC decoder
uses in avcodec/aac/aacdec_usac.c.

Fate changes are caused by the change of how 7.1 layout is mapped, previously
it included Side Surround channels, now it includes the Surround channels.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-12 19:37:01 +02:00
sunyuechi a4901a56c6 lavc/vp8dsp: R-V V bilin_load to bilin_load_h
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-06-12 18:38:41 +03:00
sunyuechi 8d9fb7b5cf lavc/vp8dsp: R-V V put_bilin_h v unroll
Since len < 64, the registers are sufficient, so it can be
directly unrolled (a4 is even).

Another benefit of unrolling is that it reduces one load operation
vertically compared to horizontally.

                                 old                 new
                             C908   X60          C908   X60
vp8_put_bilin4_h_c         :    6.2    5.5     :    6.2    5.5
vp8_put_bilin4_h_rvv_i32   :    2.2    2.0     :    1.5    1.5
vp8_put_bilin4_v_c         :    6.5    5.7     :    6.2    5.7
vp8_put_bilin4_v_rvv_i32   :    2.2    2.0     :    1.2    1.5
vp8_put_bilin8_h_c         :   24.2   21.5     :   24.2   21.5
vp8_put_bilin8_h_rvv_i32   :    5.2    4.7     :    3.5    3.5
vp8_put_bilin8_v_c         :   24.5   21.7     :   24.5   21.7
vp8_put_bilin8_v_rvv_i32   :    5.2    4.7     :    3.5    3.2
vp8_put_bilin16_h_c        :   48.0   42.7     :   48.0   42.7
vp8_put_bilin16_h_rvv_i32  :    5.7    5.0     :    5.2    4.5
vp8_put_bilin16_v_c        :   48.2   43.0     :   48.2   42.7
vp8_put_bilin16_v_rvv_i32  :    5.7    5.2     :    4.5    4.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-06-12 18:38:41 +03:00
Frank Plowman d72a5fe719 lavc/vvc: Prevent overflow in chroma QP derivation
On the top of p. 112 in VVC (09/2023):

It is a requirement of bitstream conformance that the values of
qpInVal[ i ][ j ] and qpOutVal[ i ][ j ] shall be in the range
of −QpBdOffset to 63, inclusive for i in the range of 0 to
numQpTables − 1, inclusive, and j in the range of 0 to
sps_num_points_in_qp_table_minus1[ i ] + 1, inclusive.

Additionally, don't discard the return code from sps_chroma_qp_table.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-12 20:48:08 +08:00
Andreas Rheinhardt edcfa846cf api/api-band-test: Query codec capabilities to decide admissibility
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt b8cc5cf233 api/api-band-test: Perform codec admissibility check earlier
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt 4c22b00780 api/api-band-test: Remove write-only variable
Besides being write only it had the wrong type:
An uint8_t is definitely not enough to store the size
of these buffers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt 89742b88c6 avcodec/mpegvideo_enc: Don't pretend ff_dct_encode_init() can fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:25:10 +02:00
Andreas Rheinhardt 1dc1b6c5af avcodec/mpegvideo: Remove fast_dct_quantize
It has been added in 3a87ac948f,
but there was never an implementation different from the ordinary
dct_quantize of it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:24:20 +02:00
Andreas Rheinhardt e80bd068c5 avcodec/mpegvideo_enc: Always set c funcs in ff_dct_encode_init()
Use the common approach whereby the _c versions are set first
and then (potentially) overwritten by the arch-specific ones
instead of calling the arch-specific code first, followed by
setting the function pointers that have not already been set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:24:09 +02:00
Andreas Rheinhardt 8327828205 avcodec/mips/mpegvideo: Set denoise_dct only for encoder
The C version is set in ff_dct_encode_init(), yet the MIPS version
is set in dct_init() (in ff_mpv_common_init() and therefore also
for decoders). This commit fixes this inconsistency.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:23:30 +02:00
Andreas Rheinhardt adb1521385 avcodec/mpegvideo_enc: Move initializing H263DSP to ituh263enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:23:29 +02:00
Andreas Rheinhardt bf8208d0cd avcodec/mpegvideo_enc: Make ff_dct_quantize_c() static
Only used here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:20:47 +02:00
Andreas Rheinhardt f0c021b6ff avcodec/dnxhdenc: Remove always-false check
Always false since 49331f7ba3.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:20:41 +02:00
Andreas Rheinhardt 1fe2a97b61 avcodec/vc1_pred: Fix indentation
Forgotten after 41f9742053.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:07:49 +02:00
Andreas Rheinhardt bf087a7e26 avcodec/mpegvideo_enc: Binarize reference
The H.264 decoder used reference to store its picture_structure
into it; yet it does not use mpegvideo any more since commit
2c54155407. Afterwards commit
629259bdb5 removed the last remnants.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:07:31 +02:00
Andreas Rheinhardt 34ed9d1954 avcodec/ituh263enc: Remove redundant check
It is redundant due to the identical check in ff_mpv_encode_init().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:07:20 +02:00
Andreas Rheinhardt b2ac792367 avcodec/mpegvideo: Use enum for msmpeg4_version
Improves readability.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:03:00 +02:00
Andreas Rheinhardt 2f6768c761 avcodec/mpegvideo: Remove pblocks
It has been added in a579db0c4f
due to XvMC, but today it is only used to swap U and V
for VCR2, a MPEG-2 variant with U and V swapped.
This can be done in a simpler fashion, namely by simply
swapping the U and V pointers of the corresponding
MPVWorkPictures.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:02:31 +02:00
Andreas Rheinhardt 1f5c64cbdc avcodec/mpeg12dec: Don't initialize inter_scantable
MPEG-1/2 only needs one scantable and therefore all code
already uses the intra one. So stop initializing
the inter one altogether.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:02:14 +02:00
Andreas Rheinhardt 9bb35cfa4d avcodec/mpeg12dec: Pass Mpeg1Context* in mpeg_field_start()
Avoids a cast.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:02:03 +02:00
Andreas Rheinhardt c703a519a5 avcodec/mpegvideo_dec: Don't sync encoder-only coded_picture_number
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:01:42 +02:00
Andreas Rheinhardt a13ca893cf avcodec/mpegvideo_dec, rv34: Simplify check for "does pic exist?"
The days in which an MPVPicture* is set with the corresponding frame
being blank are over; this allows to simplify some checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:01:27 +02:00
Andreas Rheinhardt 7e61e77c4e avcodec/mpeg12enc: Simplify writing startcodes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:56:06 +02:00
Andreas Rheinhardt 4f2719a239 avcodec/mpegvideo_enc: Unify initializing PutBitContexts
This also rids us of the requirement to preserve the PutBitContext
in ff_update_duplicate_context().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:55:44 +02:00
Andreas Rheinhardt a05eebee99 avcodec/mpegpicture: Avoid MotionEstContext in ff_mpeg_framesize_alloc()
Only set the ScratchpadContext and let the users that need it
(i.e. encoders) set the MotionEstContext stuff themselves.
Also add an explicit pointer to ScratchpadContext to point
to the allocated buffer so that none of the other scratchpad
pointers is singled out as being used for the allocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:54:57 +02:00
Andreas Rheinhardt d0f76e6a11 avcodec/mpegpicture: Use union for b_scratchpad and rd_scratchpad
These pointers point to the same buffers, so one can just
use a union for them and avoid synchronising one of them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:54:47 +02:00
Andreas Rheinhardt 12fcbff446 avcodec/mpegpicture: Avoid loop and branch when setting motion_val
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:54:08 +02:00
Andreas Rheinhardt 45cf0541cf avcodec/mpegpicture: Use ThreadProgress instead of ThreadFrame API
Given that MPVPictures are already directly shared between threads
in case of frame-threaded decoding, one can simply use it to
pass decoding progress information between threads. This allows
to avoid one level of indirection; it also means avoids allocations
(of the ThreadFrameProgress structure) in case of frame-threading
and indeed makes ff_thread_release_ext_buffer() decoder-only
(actually, H.264-decoder-only).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:53:49 +02:00
Andreas Rheinhardt 5475000942 avcodec/mpeg4videoenc: Simplify writing startcodes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:53:20 +02:00
Andreas Rheinhardt 4ef98a43ee avcodec/mpeg4videoenc: Avoid branch for writing stuffing
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:52:32 +02:00
Andreas Rheinhardt 9ce56f91c0 avcodec/mpegpicture: Make MPVPicture refcounted
Up until now, an initialized MpegEncContext had an array of
MPVPictures (way more than were ever needed) and the MPVPicture*
contained in the MPVWorkPictures as well as the input_picture
and reordered_input_picture arrays (for the encoder) pointed
into this array. Several of the pointers could point to the
same slot and because there was no reference counting involved,
one had to check for aliasing before unreferencing.
Furthermore, given that these pointers were not ownership pointers
the pointers were often simply reset without unreferencing
the slot (happened e.g. for the RV30 and RV40 decoders) or
there were moved without resetting the src pointer (happened
for the encoders where the entries in the input_picture
and reordered_input_picture arrays were not reset).
Instead actually releasing these pictures was performed by looping
over the whole array and checking which one of the entries needed
to be kept. Given that the array had way too many slots (36),
this meant that more than 30 MPVPictures have been unnecessarily
unreferenced in every ff_mpv_frame_start(); something similar
happened for the encoder.

This commit changes this by making the MPVPictures refcounted
via the RefStruct API. The MPVPictures itself are part of a pool
so that this does not entail constant allocations; instead,
the amount of allocations actually goes down, because the
earlier code used such a large array of MPVPictures (36 entries) and
allocated an AVFrame for every one of these on every
ff_mpv_common_init(). In fact, the pool is only freed when closing
the codec, so that reinitializations don't lead to new allocations
(this avoids having to sync the pool in update_thread_context).

Making MPVPictures refcounted also has another key benefit:
It makes it possible to directly share them across threads
(when using frame-threaded decoding), eliminating ugly code
with underlying av_frame_ref()'s; sharing these pictures
can't fail any more.

The pool is allocated in ff_mpv_decode_init() for decoders,
which therefore can fail now. This and the fact that the pool
is not unreferenced in ff_mpv_common_end() also necessitated
to mark several mpegvideo-decoders with the FF_CODEC_CAP_INIT_CLEANUP
flag.

*: This also means that there is no good reason any more for
ff_mpv_common_frame_size_change() to exist.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:47:49 +02:00
Andreas Rheinhardt 99d26939af avcodec/mpegvideo_dec: Add close function for mpegvideo-decoders
Currently identical to the H.261 and H.263 close functions
(which it replaces). It will be extended in future commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:44:13 +02:00
Andreas Rheinhardt b90b676409 avformat/riff: Declare VCR2 to be MPEG-2
This brings it in line with mpeg12dec.c.
(This entry has been added before the MPEG2VIDEO codec id
existed.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:44:10 +02:00
Andreas Rheinhardt 5ea7c0e323 avcodec/mpeg12dec: Set out_format only once
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:44:03 +02:00
Andreas Rheinhardt bbe10bcae8 avcodec/mpeg12dec: Remove write-only assignment
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:43:59 +02:00
Andreas Rheinhardt 2f22fd7ec1 avcodec/mpeg12dec: Only initialize IDCT for IPU
This is all that is used. This is in preparation for further
commits that will extend ff_mpv_decode_init() in a way
that will make it possible to fail and require cleanup.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:43:48 +02:00
Andreas Rheinhardt 183a67580b avcodec/mpeg12dec: Don't initialize inter tables for IPU
IPU is intra-only.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:43:30 +02:00
Andreas Rheinhardt dceb73a22d avcodec/mpegvideo_enc: Reindentation
Also try to use loop-scope for iterators.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:43:22 +02:00
Andreas Rheinhardt b64dfe2bd1 avcodec/mpegvideo_enc: Return early when getting length of B frame chain
Possible now that this is a function of its own.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:43:14 +02:00
Andreas Rheinhardt 17b5fc2e51 avcodec/mpegvideo_enc: Factor setting length of B frame chain out
It already avoids a goto and will be useful in the future
to be able to specify each functions tasks and obligations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:42:59 +02:00
Andreas Rheinhardt 17501b2267 avcodec/error_resilience: Deduplicate cleanup code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:42:24 +02:00
Andreas Rheinhardt fe6037fd04 avcodec/mpegpicture: Split MPVPicture into WorkPicture and ordinary Pic
There are two types of MPVPictures: Three (cur_pic, last_pic, next_pic)
that are directly part of MpegEncContext and an array of MPVPictures
that are separately allocated and are mostly accessed via pointers
(cur|last|next)_pic_ptr; they are also used to store AVFrames in the
encoder (necessary due to B-frames). As the name implies, each of the
former is directly associated with one of the _ptr pointers:
They actually share the same underlying buffers, but the ones
that are part of the context can have their data pointers offset
and their linesize doubled for field pictures.

Up until now, each of these had their own references; in particular,
there was an underlying av_frame_ref() to sync cur_pic and cur_pic_ptr
etc. This is wasteful.

This commit changes this relationship: cur_pic, last_pic and next_pic
now become MPVWorkPictures; this structure does not have an AVFrame
at all any more, but only the cached values of data and linesize.
It also contains a pointer to the corresponding MPVPicture, establishing
a more natural relationsship between the two.
This already means that creating the context-pictures from the pointers
can no longer fail.

What has not been changed is the fact that the MPVPicture* pointers
are not ownership pointers and that the MPVPictures are part of an
array of MPVPictures that is owned by a single AVCodecContext.
Doing so will be done in a latter commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:38:13 +02:00
Andreas Rheinhardt dac15a5b6e avcodec/vc1_mc: Don't check AVFrame INTERLACE flags
Instead cache these values in VC1Context to avoid the indirection
and AND.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:37:33 +02:00
Andreas Rheinhardt 59422955cf avcodec/mpegpicture: Rename Picture->MPVPicture
Picture is just too generic.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:36:09 +02:00
Andreas Rheinhardt 2dfe7c1e40 avcodec/mpegvideo_enc: Move copying properties to alloc_picture()
This way said function sets everything (except for the actual
contents of the frame's data). Also rename it to prepare_picture()
given its new role.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:32:35 +02:00
Andreas Rheinhardt 8225d2da73 avcodec/mpegvideo_enc: Pass AVFrame*, not Picture* to alloc_picture()
It now only deals with the AVFrame and no longer with the accessories.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:32:25 +02:00
Andreas Rheinhardt 89ca63cc9c avcodec/mpegpicture: Split ff_alloc_picture() into check and alloc part
ff_alloc_picture() currently does two things: It checks the
consistency of the linesize (which should not be necessary, but is)
and it allocates certain buffers. (It does not actually allocate
the picture buffers, so its name is misleading.)
This commit splits it into two separate functions. The rationale
for this is that for the encoders, every picture needs its linesizes
checked, but not every picture needs these extra buffers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:27:25 +02:00
Andreas Rheinhardt 042117da75 avcodec/mpegpicture: Improve error messages and code
Make it clear that this is not a failure of get_buffer/the user,
but a deficit of mpegvideo.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:27:15 +02:00
Andreas Rheinhardt 8c59b5aa6b avcodec/vc1_pred: Remove unused function parameter
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:27:04 +02:00
Andreas Rheinhardt dda009b97d avcodec/mpegvideo: Add const where appropriate
Specifically, add const to the pointed-to-type of pointers
that point to something static or that belong to last_pic
or next_pic (because modifying these might lead to data races).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:26:51 +02:00
Andreas Rheinhardt f1c4e8950e avcodec/rv30, rv34, rv40: Avoid indirection
Use the cached values from MpegEncContext.(cur|last|next)_pic
instead of the corresponding *_pic_ptr.
Also do the same in wmv2dec.c and mpegvideo_enc.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:22:41 +02:00
Andreas Rheinhardt 7814dd77aa avcodec/mpegpicture: Cache AVFrame.data and linesize values
This avoids an indirection and is in preparation for removing
the AVFrame from MpegEncContext.(cur|last|next)_pic altogether.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:20:56 +02:00
Andreas Rheinhardt 1c40a17922 avcodec/mpegpicture: Reduce value of MAX_PLANES define
No mpegvideo based codec supports alpha.
While just at it, also make the define shorter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:20:27 +02:00
Andreas Rheinhardt ec1eba792a avcodec/mpegvideo: Shorten variable names
current_picture->cur_pic, last_picture->last_pic, similarly
for new_picture and next_picture.
Also rename the corresponding *_ptr fields.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:19:44 +02:00
Andreas Rheinhardt 3a4e7694a1 avcodec/mpegvideo: Restrict resetting mbskip_table to MPEG-4 decoder
This is done due to invalid input and therefore the encoder is not
affected by it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:19:39 +02:00
Andreas Rheinhardt 47e43c19cb avcodec/h263: Move setting mbskip_table to decoder/encoders
This removes a branch from H.263 based decoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:19:17 +02:00
Andreas Rheinhardt 9645eeb485 avcodec/mpegvideo: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:19:15 +02:00
Andreas Rheinhardt 101ed72c2f avcodec/h263, mpeg(picture|video): Only allocate mbskip_table for MPEG-4
It is the only user of said table and doing so is especially
important given that this buffer is zeroed every time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:14:32 +02:00
Andreas Rheinhardt 2cbca73975 avcodec/h263: Move encoder-only part out of ff_h263_update_motion_val()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:14:13 +02:00
Andreas Rheinhardt bed17eba47 avcodec/mpegpicture: Use RefStruct-pool API
It involves less allocations and therefore has less
potential errors to be checked. One consequence thereof
is that updating the picture tables can no longer fail.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:13:03 +02:00
Andreas Rheinhardt 6450cfcd10 avcodec/mpegpicture: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:12:59 +02:00
Andreas Rheinhardt 788892d647 avcodec/mpegvideo, mpegpicture: Add buffer pool
This avoids constant allocations+frees and will also allow
to simply switch to the RefStruct API, thereby avoiding
the overhead of the AVBuffer API.
It also simplifies the code, because it removes the "needs_realloc"
field: It was added in 435c0b87d2,
before the introduction of the AVBuffer API: given that these buffers
may be used by different threads, they were not freed immediately
and instead were marked as being freed later by setting needs_realloc.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:08:19 +02:00
Andreas Rheinhardt a95591dbfd avcodec/mpegvideo: Redo aligning mb_height for VC-1
VC-1 can switch from between being progressive and interlaced
on a per-frame basis. In the latter case, the number of macroblocks
is aligned to two (or equivalently, the height to 32); therefore
certain buffers are allocated for the bigger mb_height
(see 950fb8acb4 and
017e234c20).

This commit changes how this is done: Aligning these buffers is
restricted to VC-1 and it is done directly by aligning
mb_height (but not MpegEncContext.mb_height) instead of
adding something in an ad-hoc manner.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:05:12 +02:00
Andreas Rheinhardt 7ad13e173b avcodec/mpegpicture: Always reset mbskip_table
Codecs call ff_find_unused_picture() to get the index of
an unused picture; said picture may have buffers left
from using it previously (these buffers are intentionally
not unreferenced so that it might be possible to reuse them;
they are only reused when they are writable, otherwise
they are replaced by new, zeroed buffers). They should
not make any assumptions about which picture they get.

Yet this is not true for mbskip_table and damaged bitstreams.
When one returns old unused slots randomly, the output
becomes nondeterministic. This can't happen now (see below),
but it will be possible once mpegpicture uses proper pools
for the picture tables.

The following discussion uses the sample created via
ffmpeg -bitexact -i fate-suite/svq3/Vertical400kbit.sorenson3.mov -ps 50 -bf 2 -bitexact -an -qscale 5 -ss 40 -error_rate 4 -threads 1 out.avi

When decoding this with one thread, the slots are as follows:
Cur 0 (type I), last -1, Next -1; cur refcount -1, not reusing buffers
Cur 1 (type P), last -1, Next 0; cur refcount -1, not reusing buffers
Cur 2 (type B), last 0, Next 1; cur refcount -1, not reusing buffers
Cur 2 (type B), last 0, Next 1; cur refcount 2, not reusing buffers
Cur 0 (type P), last 0, Next 1; cur refcount 2, not reusing buffers
Cur 2 (type B), last 1, Next 0; cur refcount 1, reusing buffers
Cur 2 (type B), last 1, Next 0; cur refcount 2, not reusing buffers
Cur 1 (type P), last 1, Next 0; cur refcount 2, not reusing buffers
Cur 2 (type B), last 0, Next 1; cur refcount 1, reusing buffers
Cur 2 (type B), last 0, Next 1; cur refcount 2, not reusing buffers
Cur 0 (type I), last 0, Next 1; cur refcount 2, not reusing buffers
Cur 2 (type B), last 1, Next 0; cur refcount 1, reusing buffers
Cur 2 (type B), last 1, Next 0; cur refcount 2, not reusing buffers
Cur 1 (type P), last 1, Next 0; cur refcount 2, not reusing buffers

After the slots have been filled initially, the buffers are only
reused for the first B-frame in a B-frame chain:
a) When the new picture is an I or a P frame, the slot of the backward
reference is cleared and reused for the new frame (as has been said,
"cleared" does not mean that the auxiliary buffers have been
unreferenced). Given that not only the slot in the picture array,
but also MpegEncContext.last_picture contain references to these
auxiliary buffers, they are not writable and are therefore not reused,
but replaced by new, zero-allocated buffers.
b) When the new picture is the first B-frame in a B-frame chain,
the two reference slots are kept as-is and one gets a slot that
does not share its auxiliary buffers with any of MpegEncContext.
current_picture, last_picture, next_picture. The buffers are
therefore writable and are reused.
c) When the new picture is a B-frame that is not the first frame
in a B-frame chain, ff_mpv_frame_start() reuses the slot occupied
by the preceding B-frame. Said slot shares its auxilary buffers
with MpegEncContext.current_picture, so that they are not considered
writable and are therefore not reused.

When using frame-threading, the slots are made to match the one
from the last thread, so that the above analysis is mostly the same
with one exception: Other threads may also have references to these
buffers, so that initial B-frames of a B-frame chain need no longer
have writable/reusable buffers. In particular, all I and P-frames
always use new, zeroed buffers. Because only the mbskip_tables of
I- and P-frames are ever used, it follows that there is currently
no problem with using stale values for them at all.

Yet as the analysis shows this is very fragile:
1. MpegEncContext.(current|last|next)_picture need not have
references of their own, but they have them and this influences
the writability decision.
2. It would not work if the slots were returned in a truely random
fashion or if there were a proper pool used.

Therefore this commit always resets said buffer. This is in preparation
for actually adding such a pool (where the checksums for said sample
would otherwise be depending on the number of threads used for
decoding).

Future commits will restrict this to only the codecs for which
it is necessary (namely the MPEG-4 decoder).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:01:24 +02:00
Andreas Rheinhardt 71ff9217f7 avcodec/mpegpicture: Always reset motion val buffer
Codecs call ff_find_unused_picture() to get the index of
an unused picture; said picture may have buffers left
from using it previously (these buffers are intentionally
not unreferenced so that it might be possible to reuse them;
this is mpegvideo's version of a bufferpool). They should
not make any assumptions about which picture they get.
Yet somehow this is not true when decoding OBMC: Returning
random empty pictures (instead of the first one) leads
to nondeterministic results; similarly, explicitly
rezeroing the buffer before handing it over to the codec
changes the outcome of the h263-obmc tests, but it makes it
independent of the returned pictures. Therefore this commit
does so.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:01:07 +02:00
Andreas Rheinhardt caac9740f8 avcodec/mpegvideo: Only allocate cbp_table, pred_dir_table when needed
Namely for the MPEG-4 decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:00:57 +02:00
Andreas Rheinhardt 582d828f75 avcodec/mpegvideo: Don't reset coded_block unnecessarily
coded_block is only used for I-frames, so it is unnecessary
to reset it in ff_clean_intra_table_entries() (which
cleans certain tables for a non-intra MB).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:54:27 +02:00
Andreas Rheinhardt ba033acb56 avcodec/mpegvideo: Only allocate coded_block when needed
It is only needed for msmpeg4v3, wmv1, wmv2 and VC-1.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:54:08 +02:00
Andreas Rheinhardt 1a5c21daee avcodec/msmpeg4enc: Only calculate coded_cbp when used
With this patch, msmpeg4v1 and msmpeg4v2 no longer use
MpegEncContext.coded_block.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:53:23 +02:00
Andreas Rheinhardt 60d4c8a137 avcodec/mpegvideo_motion: Avoid constant function argument
Always 8.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:53:13 +02:00
Andreas Rheinhardt 55e81306bf avcodec/mpegvideo_motion: Optimize check away
When !CONFIG_SMALL, we create separate functions for FMT_MPEG1
(i.e. for MPEG-1/2); given that there are only three possibilities
for out_format (FMT_MPEG1, FMT_H263 and FMT_H261 -- MJPEG and SpeedHQ
are both intra-only and do not have motion vectors at all, ergo
they don't call this function), one can optimize MPEG-1/2-only code
away in mpeg_motion_internal().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:51:16 +02:00
Andreas Rheinhardt 5f505995db avcodec/mpegvideo_motion: Optimize check away
Only MPEG-2 can have field motion vectors with coded fields.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:50:57 +02:00
Andreas Rheinhardt f44d212e0e avcodec/mpegvideo_motion: Remove dead checks for existence of reference
These references now always exist due to dummy frames.
Also remove the corresponding checks in the lowres code
in mpegvideo_dec.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:50:39 +02:00
Andreas Rheinhardt c85508f5a9 avcodec/mpeg12dec: Allocate dummy frames for non-I fields
MPEG-2 allows to pair an intra field (as first field) together
with a P-field. In this case a conformant bitstream has to satisfy
certain restrictions in order to ensure that only the I field
is used for prediction. See section 7.6.3.5 of the MPEG-2
specifications.

We do not check these restrictions; normally we simply allocate
dummy frames for reference in order to avoid checks lateron.
This happens in ff_mpv_frame_start() and therefore does not happen
for a second field. This is inconsistent. Fix this by allocating
these dummy frames for the second field, too.

This already fixes two bugs:
1. Undefined pointer arithmetic in prefetch_motion() in
mpegvideo_motion.c where it is simply presumed that the reference
frame exists.
2. Several MPEG-2 hardware accelerations rely on last_picture
being allocated for P pictures and next picture for B pictures;
e.g. VDPAU returns VDP_STATUS_INVALID_HANDLE when decoding
an I-P fields pair because the forward_reference was set incorrectly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:50:12 +02:00
Andreas Rheinhardt 73676dd47a avcodec/mpegpicture: Mark dummy frames as such
This will allow to avoid outputting them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:49:57 +02:00
Andreas Rheinhardt 99543c93ec avcodec/mpegvideo_dec: Factor allocating dummy frames out
This will allow to reuse it to allocate dummy frames for
the second field (which can be a P-field even if the first
field was an intra field).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:49:24 +02:00
Andreas Rheinhardt a30c95ed8a avcodec/mpegvideo_dec: Sync linesize and uvlinesize between threads
linesize and uvlinesize are supposed to be the common linesize of all
the Y/UV-planes of all the currently cached pictures.
ff_mpeg_update_thread_context() syncs the pictures, yet it did not sync
linesize and uvlinesize. This mostly works, because ff_alloc_picture()
only accepts new pictures if they coincide with the linesize of the
already provided pictures (if any).  Yet there is a catch: Linesize
changes are accepted when the dimensions change (in which case the
cached frames are discarded).

So imagine a scenario where all frame threads use the same dimension A
until a frame with a different dimension B is encountered in the
bitstream, only to be instantly reverted to A in the next picture. If
the user changes the linesize of the frames upon the change to dimension
B and keeps the linesize thereafter (possible if B > A),
ff_alloc_picture() will report an error when frame-threading is in use:
The thread decoding B will perform a frame size change and so will the
next thread in ff_mpeg_update_thread_context() as well as when decoding
its picture. But the next thread will (presuming it is not the same
thread that decoded B, i.e. presuming >= 3 threads) not perform a frame
size change, because the new frame size coincides with its old frame
size, yet the linesize it expects from ff_alloc_picture() is outdated,
so that it errors out.

It is also possible for the user to use the original linesizes for
the frame after the frame that reverted back to A; this will be
accepted, yet the assumption that of all pictures are the same
will be broken, leading to segfaults.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:49:03 +02:00
Andreas Rheinhardt d4b63885a6 avcodec/mpegpicture: Store linesize in ScratchpadContext
The mpegvideo-based codecs currently require the linesize to be
constant (except when the frame dimensions change); one reason
for this is that certain scratch buffers whose size depend on
linesize are only allocated once and are presumed to be correctly
sized if the pointers are != NULL.

This commit changes this by storing the actual linesize these
buffers belong to and reallocating the buffers if it does not
suffice. This is not enough to actually support changing linesizes,
but it is a start. And it is a prerequisite for the next patch.

Also don't emit an error message in case the source ctx's
edge_emu_buffer is unset in ff_mpeg_update_thread_context().
It need not be an error at all; e.g. it is a perfectly normal
state in case a hardware acceleration is used as the scratch
buffers are not allocated in this case (it is easy to run into
this issue with MPEG-4) or if the src context was not initialized
at all (e.g. because the first packet contained garbage).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:47:44 +02:00
Andreas Rheinhardt 0aaabe1fd7 avcodec/get_buffer: Remove redundant check
It is unnecessary to check for whether the number of planes
of an already existing audio pool coincides with the number
of planes to use for the frame: If the common format of both
is planar, then the number of planes coincides with the number
of channels for which there is already a check*; if not,
then both the existing pool as well as the frame use one pool.

*: In fact, one could reuse the pool in this case even if the
number of channels changes.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:37:16 +02:00
Andreas Rheinhardt 2786d34712 avcodec/ratecontrol: Avoid padding in RateControlEntry
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:37:11 +02:00
Andreas Rheinhardt 685cda26aa avcodec/mpegvideo, ratecontrol: Remove write-only skip_count
Write-only since 6cf0cb8935.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:36:37 +02:00
Andreas Rheinhardt 68a06640b1 avcodec/ratecontrol: Don't call ff_rate_control_uninit() ourselves
It is currently done inconsistently: Only one error path
(namely the one from init_pass2()) made ff_rate_control_init()
call ff_rate_control_uninit(); in other error paths
cleanup was left to the caller.

Given that the only caller of this function already performs
the necessary cleanup this commit changes this to always
rely on the caller to perform cleanup on error.

Also return the error code from init_pass2().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:36:30 +02:00
Andreas Rheinhardt 0c9e04b0e2 avcodec/ratecontrol: Pass RCContext directly in ff_rate_control_uninit()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:36:16 +02:00
Andreas Rheinhardt ba28222a14 avcodec/ratecontrol: Fix double free on error
Happens on init_pass2() failure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:36:01 +02:00
Lynne bdd3c6ca50 aacdec_usac: always zero out alpha_q values for stereo streams
The issue is that if a frame has no complex stereo prediction,
the alpha values must all be assumed to be zero if the next frame
has complex prediction and uses delta coding.
2024-06-12 03:33:45 +02:00
Lynne d79fbad366 aacdec_usac: rename spectrum decode function and remove unused arg
The LC part of the decoder combines scalefactor application with
spectrum decoding, and this was the plan here, but that's not possible,
so change the function name.
2024-06-12 03:33:45 +02:00
Lynne 11a8e0a4e5 aacdec_usac: dequantize scalefactors after noise synthesis
The issue here is that the spec implied that the offset is done
on the dequantized scalefactor, but in fact, it is done on the
scalefactor offset. Delay dequantizing the scalefactors until
after noise synthesis is performed, and change to apply the
offset onto the offset.
2024-06-12 03:33:38 +02:00
Haihao Xiang a4630d479a lavu/hwcontext_vulkan: Support write on drm frame
Otherwise nothing is written into the destination when a write mapping
is requested.

For example, a vulkan frame mapped from a drm frame (which is wrapped as
a vaapi frame in the example) is used as the output of scale_vulkan
filter, it always gets a green screen without this patch.

ffmpeg -init_hw_device vaapi=va -init_hw_device vulkan=vulkan@va
-filter_hw_device vulkan -f lavfi -i testsrc=size=352x288,format=nv12
-vf
"hwupload,scale_vulkan,hwmap=derive_device=vaapi:reverse=1,format=vaapi,hwdownload,format=nv12"
-f nut - | ffplay -

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-06-12 01:53:18 +02:00
Michael Niedermayer 9c9f095e30 avfilter/vf_rotate: Check ff_draw_init2() return value
Fixes: NULL pointer dereference
Fixes: 3_343

Found-by: De3mond
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:14 +02:00
Michael Niedermayer 034054b370 avformat/mov: Use int64_t in intermediate for corrected_dts
Fixes: CID1500312 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:13 +02:00
Michael Niedermayer 0c977d37aa avformat/mov: Use 64bit in intermediate for current_dts
Fixes: CID1500304 Unintentional integer overflow
Fixes: CID1500318 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:13 +02:00
Michael Niedermayer 019fce18bb avformat/matroskadec: Assert that num_levels is non negative
Maybe Closes: CID1452496 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:13 +02:00
Michael Niedermayer 0263b6a48c avformat/libzmq: Check av_strstart()
Fixes: CID1453457 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:12 +02:00
Michael Niedermayer 5712f36dd0 avformat/img2dec: Little JFIF / Exif cleanup
This changes the behavior and makes it behave how it probably was intended.
Either way this is unlikely to result in any user visible change

Fixes: CID1494637 Missing break in switch

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:12 +02:00
Michael Niedermayer 7d04c6016b avformat/img2dec: Move DQT after unrelated if()
Fixes: CID1494636 Missing break in switch

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:12 +02:00
Michael Niedermayer f10493f6fc avformat/imfdec: Simplify get_next_track_with_minimum_timestamp()
This also makes the code more robust

Fixes: CID1512414 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:11 +02:00
Michael Niedermayer c21fb3624b avformat/iamf_parse: Remove dead case
Fixes: CID1559546 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:11 +02:00
Michael Niedermayer 78d6d13bab avdevice/xcbgrab: Check sscanf() return
Alot more input checking can be performed, this is only checking the obvious missing case

Fixes: CID1598562 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:11 +02:00
Rémi Denis-Courmont f6d0a41c8c lavu/riscv: use Zbb CLZ/CTZ/CLZW/CTZW at run-time
Zbb static    Zbb dynamic   I baseline
clz       0.668032642   1.336072283   19.552376803
clzl      0.668092643   1.336181786   26.110855571
ctz       1.336208533   3.340209702   26.054869008
ctzl      1.336247784   3.340362457   26.055266290
(seconds for 1 billion iterations on a SiFive-U74 core)
2024-06-11 20:12:37 +03:00
Rémi Denis-Courmont 98db140910 lavu/riscv: use Zbb CPOP/CPOPW at run-time
Zbb static    Zbb dynamic   I baseline
popcount  1.336129286   3.469067758   20.146362909
popcountl 1.336322291   3.340292968   20.224829821
(seconds for 1 billion iterations on a SiFive-U74 core)
2024-06-11 20:12:37 +03:00
Rémi Denis-Courmont 324899b748 lavu/riscv: use Zbb REV8 at run-time
This adds runtime support to use Zbb REV8 for 32- and 64-bit byte-wise
swaps. The result is about five times slower than if targetting Zbb
statically, but still a lot faster than the default bespoke C code or a
call to GCC run-time functions.

For 16-bit swap, this is however unsurprisingly a lot worse, and so this
sticks to the baseline. In fact, even using REV8 statically does not
seem to be beneficial in that case.

         Zbb static    Zbb dynamic   I baseline
bswap16:  0.668184765   3.340764069   0.668029012
bswap32:  0.668174014   3.340763319   9.353855435
bswap64:  0.668221765   3.340496313  14.698672283
(seconds for 1 billion iterations on a SiFive-U74 core)
2024-06-11 20:12:37 +03:00
Rémi Denis-Courmont 378d1b06c3 riscv: probe for Zbb extension at load time
Due to hysterical raisins, most RISC-V Linux distributions target a
RV64GC baseline excluding the Bit-manipulation ISA extensions, most
notably:
- Zba: address generation extension and
- Zbb: basic bit manipulation extension.
Most CPUs that would make sense to run FFmpeg on support Zba and Zbb
(including the current FATE runner), so it makes sense to optimise for
them. In fact a large chunk of existing assembler optimisations relies
on Zba and/or Zbb.

Since we cannot patch shared library code, the next best thing is to
carry a flag initialised at load-time and check it on need basis.
This results in 3 instructions overhead on isolated use, e.g.:
1:  AUIPC rd, %pcrel_hi(ff_rv_zbb_supported)
    LBU   rd, %pcrel_lo(1b)(rd)
    BEQZ  rd, non_Zbb_fallback_code
    // Zbb code here

The C compiler will typically load the flag ahead of time to reducing
latency, and can also keep it around if Zbb is used multiple times in a
single optimisation scope. For this to work, the flag symbol must be
hidden; otherwise the optimisation degrades with a GOT look-up to
support interposition:
1:  AUIPC rd, GOT_OFFSET_HI
    LD    rd, GOT_OFFSET_LO(rd)
    LBU   rd, (rd)
    BEQZ  rd, non_Zbb_fallback_code
    // Zbb code here

This patch adds code to provision the flag in libraries using bit
manipulation functions from libavutil: byte-swap, bit-weight and
counting leading or trailing zeroes.
2024-06-11 20:12:37 +03:00
Rémi Denis-Courmont 18adaf9fe5 checkasm/lls: adjust buffer sizes and alignments
var must be padded.
param has `order + 1`, not `order` elements and is *not* over-aligned.
2024-06-11 20:07:55 +03:00
Anton Khirnov 08ea7d6b8e lavc/hevcdec: constify source frame in hevc_ref_frame() 2024-06-11 17:39:35 +02:00
Anton Khirnov ccd391d6a3 lavc/hevcdec: do not unref current frame on frame_end() failure
It's a race with frame threading.
2024-06-11 17:39:35 +02:00
Anton Khirnov d725c737fe lavc/hevcdec: move some frame-end code to hevc_frame_end()
Specifically, calling hwaccel end_frame, verifying frame checksum,
and printing the frame-was-decoded message.
2024-06-11 17:39:35 +02:00
Anton Khirnov edb6a471c4 lavc/hevcdec: factor decoding a slice NALU out of decode_nal_unit() 2024-06-11 17:39:35 +02:00
Anton Khirnov 90e75c4ec9 lavc/hevcdec: drop a redundant multiple-frame-per-packet check 2024-06-11 17:39:35 +02:00
Anton Khirnov 3cd6492fb5 lavc/hevcdec: move the check for multiple frames in a packet
Do not do it in hls_slice_header(), which is the wrong place for it.
Avoids special magic return value of 1 in that function. The comment
mentioning potential corrupted state is no longer relevant, as
hls_slice_header() modifies no state beyond SliceHeader, which will only
get used for a valid frame.
2024-06-11 17:39:35 +02:00
Anton Khirnov a8f9d52c22 lavc/hevcdec: move setting slice_initialized out of hls_slice_header()
hls_slice_header() no longer modifies anything in HEVCContext besides
SliceHeader.
2024-06-11 17:39:35 +02:00
Anton Khirnov 82ded1ad3a lavc/hevcdec: move sequence increment/IDR handling to hevc_frame_start()
From hls_slice_header(). It is only done once per frame, so that is a
more appropriate place for this code.
2024-06-11 17:39:35 +02:00
Anton Khirnov a2e77caf37 lavc/hevcdec: set active PPS/SPS in hevc_frame_start()
Not in hls_slice_header(), as it should only be done once per frame.
2024-06-11 17:39:35 +02:00
Anton Khirnov 47d34ba7fb lavc/hevcdec: move constructing slice RPL to decode_slice_data() 2024-06-11 17:39:35 +02:00
Anton Khirnov fe171a3b51 lavc/hevcdec: move calling hwaccel decode_slice to decode_slice_data()
From decode_nal_unit(), as that is a more appropriate place for it.
2024-06-11 17:39:35 +02:00
Anton Khirnov 6ee550d83d lavc/hevcdec: move calling hwaccel start_frame to hevc_frame_start()
From decode_nal_unit(), as that is a more appropriate place for it.
2024-06-11 17:39:35 +02:00
Anton Khirnov 3bbb5d78c7 lavc/hevcdec: move per-slice local_ctx setup out of hls_slice_header()
Into decode_slice_data(). This is a step towards constifying
HEVCContext in hls_slice_header().
2024-06-11 17:39:35 +02:00
Anton Khirnov efc827bf6f lavc/hevcdec: move slice decoding dispatch to its own function
Also move there a sanity check from hls_decode_entry() that should also
be performed when WPP is active (note that the check is not moved to
hls_slice_header() because it requires the HEVCContext.tab_slice_address
to be set up).
2024-06-11 17:39:35 +02:00
Anton Khirnov 7cce612a26 lavc/hevcdec: move a slice segment sanity check to hls_slice_header()
Combine it with an existing similar check.
2024-06-11 17:39:35 +02:00
Anton Khirnov d43527a1a0 lavc/hevcdec: store slice header POC in SliceHeader
Rather than decoding directly into HEVCContext.poc.

This is a step towards constifying HEVCContext in hls_slice_header().
2024-06-11 17:39:35 +02:00
Anton Khirnov e4e9e1da15 lavc/hevcdec: drop redundant HEVCContext.threads_{type,number}
They are useless duplicates of corresponding AVCodecContext fields.
2024-06-11 17:39:35 +02:00
Anton Khirnov b0c29a45dc lavc/hevc/cabac: do not infer WPP use based on HEVCContext.threads_number
Pass this information explicitly instead.
2024-06-11 17:39:35 +02:00
Anton Khirnov d86ac94df2 lavc/hevcdec: output RASL frames based on the value of no_rasl_output_flag
Instead of an ad-hoc scheme. Also, combine skipping RASL frames with
skip_frame handling - current code seems flawed as it only executes for
the first slice of a RASL frame and unnecessarily unsets is_decoded,
which should not be set at this point anyway..

Some RASL frames in fate-hevc-afd-tc-sei that were previously discarded
are now output.
2024-06-11 17:39:35 +02:00
Anton Khirnov 3115c84015 lavc/hevcdec: only set no_rasl_output_flag for IRAP frames
Its meaning is only specified for IRAP frames.

As it's currently never used otherwise, this should not change decoder
behaviour, but will be useful in future commits.
2024-06-11 17:39:35 +02:00
Anton Khirnov 381b70e173 lavc/hevcdec: do not pass HEVCContext to ff_hevc_frame_nb_refs()
Pass the only things required from it - slice header and PPS -
explicitly.

Will be useful in the following commits to avoid mofiying HEVCContext in
hls_slice_header().
2024-06-11 17:39:35 +02:00
Anton Khirnov 07eb60c0da lavc/hevcdec: only call export_stream_params_from_sei() once per frame
Not once per each slice header, as it makes no sense and may cause races
with frame threading.
2024-06-11 17:39:35 +02:00
Anton Khirnov 01b379a93e lavc/hevcdec: move pocTid0 computation to hevc_frame_start()
It is only done once per frame. Also, rename the variable to poc_tid0 to
be consistent with our naming conventions.
2024-06-11 17:39:35 +02:00
Anton Khirnov 5e438511ab lavc/hevcdec: do not pass HEVCContext to decode_lt_rps()
Pass the two numbers needed from it explicitly.

Makes it clear that HEVCContext is not modified by this function.
2024-06-11 17:39:35 +02:00
Anton Khirnov 0892ec947c lavc/hevcdec: pass SliceHeader explicitly to pred_weight_table()
And replace the HEVCContext* parameter by void *logctx.

Makes it clear that only SliceHeader is modified by this function.
2024-06-11 17:39:35 +02:00
Anton Khirnov 90fc331b0f lavc/hevcdec: only ignore INVALIDDATA in decode_nal_unit()
All other errors should cause a failure, regardless of the value of
err_recognition. Also, print a warning message when skipping invalid NAL
units.
2024-06-11 17:39:35 +02:00
Anton Khirnov 8eb134f4f9 lavc/hevcdec: drop an always-zero variable 2024-06-11 17:39:35 +02:00
Anton Khirnov 8c8072c29c lavc/hevcdec: move active PPS from HEVCParamSets to HEVCContext
"Currently active PPS" is a property of the decoding process, not of the
list of available parameter sets.
2024-06-11 17:39:34 +02:00
Anton Khirnov 0f47342c12 lavc/hevcdec: stop accessing parameter sets through HEVCParamSets
Instead, accept PPS/SPS as function arguments.

Makes the code shorter and significantly reduces diff in future commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov 38b8ae4112 lavc/hevc/pred: stop accessing parameter sets through HEVCParamSets
Instead, accept PPS/SPS as function arguments.

Makes the code shorter and significantly reduces diff in future commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov d0868d70ea lavc/hevc/cabac: stop accessing parameter sets through HEVCParamSets
Instead, accept PPS/SPS as function arguments.

Makes the code shorter and significantly reduces diff in future commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov b38aecffec lavc/hevc/filter: stop accessing parameter sets through HEVCParamSets
Instead, accept PPS as a function argument and retrieve SPS through it.

Makes the code shorter and significantly reduces diff in future commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov fb873a05b3 lavc/hevc/mvs: stop accessing parameter sets through HEVCParamSets
Instead, accept PPS as a function argument and retrieve SPS through it.

Makes the code shorter and significantly reduces diff in future commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov 6ddba110eb lavc/hevc/parser: stop using HEVCParamSets.[psv]ps
The parser does not need to preserve these between frames.
2024-06-11 17:39:34 +02:00
Anton Khirnov 2e46d68f55 lavc/hevc_ps: make SPS hold a reference to its VPS
SPS and its dependent PPSes depend on, and are parsed for, specific VPS data.

This will be useful in following commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov c879165b39 lavc/hevc_ps: make PPS hold a reference to its SPS
PPS depends on, and is parsed for, specific SPS data.

This will be useful in following commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov e12fd62d1d lavc/hevcdec: drop a redundant assignment in hevc_decode_frame()
The exact same code is executed at the beginning of decode_nal_units()
2024-06-11 17:39:34 +02:00
Anton Khirnov a82f2b0924 lavc/hevcdec: simplify condition 2024-06-11 17:39:34 +02:00
Anton Khirnov 0407556716 lavc/hevcdec: do not free SliceHeader arrays in pic_arrays_free()
SliceHeader.{entry_point_offset,size,offset} are not derived from frame
size and do not need to be freed here.
2024-06-11 17:39:34 +02:00
sfan5 0455a62d84 lavf/tls_mbedtls: handle session ticket error code as no-op
When TLSv1.3 and session tickets are enabled mbedtls_ssl_read()
will return an error code to inform about a received session ticket.
This can simply be handled like EAGAIN instead of errornously
aborting the connection.

ref: https://github.com/Mbed-TLS/mbedtls/issues/8749
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-11 17:00:35 +02:00
sfan5 1b1e9cadc5 lavf/tls_mbedtls: fix handling of certification validation failures
We manually check the verification status after the handshake has completed
using mbedtls_ssl_get_verify_result(). However with VERIFY_REQUIRED
mbedtls_ssl_handshake() already returns an error, so this code is never reached.
Fix that by using VERIFY_OPTIONAL, which performs the verification but
does not abort the handshake.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-11 16:58:22 +02:00
sfan5 827578ca76 lavf/tls_mbedtls: hook up debug message callback
Unfortunately this won't work out-of-the-box because mbedTLS
only provides a global (not per-context) debug toggle.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-11 16:58:15 +02:00
sfan5 807d1505bf lavf/tls_mbedtls: add missing call to psa_crypto_init
This is mandatory depending on configuration or at least with mbedTLS 3.6.0.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-11 16:35:46 +02:00
sfan5 63b6620ad3 lavf/tls_mbedtls: handle more error codes for human-readable messages
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-11 16:35:31 +02:00
Rémi Denis-Courmont b6f37ffba7 lavc/vc1dsp: match C block layout in inv_trans_4x8_rvv
Although checkasm does not verify this, the decoder requires that the
transform updates the input block exactly like the C code does.

This fixes vc1-ism, vc1_ilaced_twomv, vc1_sa00040, vc1_sa10091,
vc1_sa10143, vc1_sa20021, vc1test_smm0005 and wmv3-drm-dec tests.
2024-06-11 17:15:09 +03:00
Rémi Denis-Courmont 6c05069e68 lavc/vc1dsp: match C block layout in inv_trans_4x4_rvv
Although checkasm does not verify this, the decoder requires that the
transform updates the input block exactly like the C code does.

This fixes vc1-ism, vc1_ilaced_twomv, vc1_sa00040, vc1_sa10091,
vc1_sa10143, vc1_sa20021, vc1test_smm0005 and wmv3-drm-dec tests.
2024-06-11 17:15:09 +03:00
Andreas Rheinhardt 6ae1a337f2 fftools/ffmpeg_mux_init: Fix leak when using non-encoding option
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-11 14:32:25 +02:00
Andreas Rheinhardt 8754c9bd82 configure: Disable DNN without backend
The DNN filters are useless without a backend.
This will also "fix" Coverity issues #1598288 and #1601718.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-11 19:36:54 +08:00
Andreas Rheinhardt c84e40d9e6 fftools/ffmpeg_mux_init: Return error upon error
Currently it may return an uninitialized value.
Introduced in 840f2bc18e.
Fixes Coverity issue #1603565.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-11 08:16:42 +02:00
Andreas Rheinhardt a0ff31e740 avcodec/vvc/inter: Don't return void
Returning a void is not allowed by the spec. Just return instead.

Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-11 02:43:14 +02:00
Rémi Denis-Courmont 417957ec5e sws/range_convert: R-V V to/from JPEG
C908   X60
chrRangeFromJpeg_8_c:          2.7    2.5
chrRangeFromJpeg_8_rvv_i32:    1.7    1.5
chrRangeFromJpeg_24_c:         7.5    6.7
chrRangeFromJpeg_24_rvv_i32:   1.7    1.5
chrRangeFromJpeg_128_c:       55.2   34.7
chrRangeFromJpeg_128_rvv_i32:  6.5    3.0
chrRangeFromJpeg_144_c:       44.0   39.2
chrRangeFromJpeg_144_rvv_i32:  7.7    4.5
chrRangeFromJpeg_256_c:       78.2   69.5
chrRangeFromJpeg_256_rvv_i32: 12.2    6.0
chrRangeFromJpeg_512_c:      172.2  138.5
chrRangeFromJpeg_512_rvv_i32: 24.5   11.7
chrRangeToJpeg_8_c:            4.7    4.2
chrRangeToJpeg_8_rvv_i32:      2.0    1.7
chrRangeToJpeg_24_c:          13.7   12.2
chrRangeToJpeg_24_rvv_i32:     2.0    1.5
chrRangeToJpeg_128_c:         72.0   63.7
chrRangeToJpeg_128_rvv_i32:    6.7    3.2
chrRangeToJpeg_144_c:         80.7   71.7
chrRangeToJpeg_144_rvv_i32:    8.5    4.7
chrRangeToJpeg_256_c:        143.2  127.2
chrRangeToJpeg_256_rvv_i32:   13.5    6.5
chrRangeToJpeg_512_c:        285.7  253.7
chrRangeToJpeg_512_rvv_i32:   27.0   13.0
lumRangeFromJpeg_8_c:          1.7    1.5
lumRangeFromJpeg_8_rvv_i32:    1.2    1.0
lumRangeFromJpeg_24_c:         4.2    3.7
lumRangeFromJpeg_24_rvv_i32:   1.2    1.0
lumRangeFromJpeg_128_c:       21.7   19.2
lumRangeFromJpeg_128_rvv_i32:  3.7    1.7
lumRangeFromJpeg_144_c:       24.7   22.0
lumRangeFromJpeg_144_rvv_i32:  4.7    2.7
lumRangeFromJpeg_256_c:       43.7   39.0
lumRangeFromJpeg_256_rvv_i32:  7.5    3.2
lumRangeFromJpeg_512_c:       87.0   77.2
lumRangeFromJpeg_512_rvv_i32: 14.5    6.7
lumRangeToJpeg_8_c:            2.7    2.2
lumRangeToJpeg_8_rvv_i32:      1.0    1.0
lumRangeToJpeg_24_c:           7.2    6.5
lumRangeToJpeg_24_rvv_i32:     1.2    1.0
lumRangeToJpeg_128_c:         37.7   33.7
lumRangeToJpeg_128_rvv_i32:    3.7    2.0
lumRangeToJpeg_144_c:         42.5   37.7
lumRangeToJpeg_144_rvv_i32:    4.7    2.7
lumRangeToJpeg_256_c:         75.0   66.7
lumRangeToJpeg_256_rvv_i32:    7.5    3.5
lumRangeToJpeg_512_c:        149.5  133.0
lumRangeToJpeg_512_rvv_i32:   14.7    7.0
2024-06-10 22:48:52 +03:00
Zhao Zhili 9dac8495b0 swscale/aarch64: Add rgb24 to yuv implementation
Test on Apple M1:

rgb24_to_uv_8_c: 0.0
rgb24_to_uv_8_neon: 0.2
rgb24_to_uv_128_c: 1.0
rgb24_to_uv_128_neon: 0.5
rgb24_to_uv_1080_c: 7.0
rgb24_to_uv_1080_neon: 5.7
rgb24_to_uv_1920_c: 12.5
rgb24_to_uv_1920_neon: 9.5
rgb24_to_uv_half_8_c: 0.2
rgb24_to_uv_half_8_neon: 0.2
rgb24_to_uv_half_128_c: 1.0
rgb24_to_uv_half_128_neon: 0.5
rgb24_to_uv_half_1080_c: 6.2
rgb24_to_uv_half_1080_neon: 3.0
rgb24_to_uv_half_1920_c: 11.2
rgb24_to_uv_half_1920_neon: 5.2
rgb24_to_y_8_c: 0.2
rgb24_to_y_8_neon: 0.0
rgb24_to_y_128_c: 0.5
rgb24_to_y_128_neon: 0.5
rgb24_to_y_1080_c: 4.7
rgb24_to_y_1080_neon: 3.2
rgb24_to_y_1920_c: 8.0
rgb24_to_y_1920_neon: 5.7

On Pixel 6:

rgb24_to_uv_8_c: 30.7
rgb24_to_uv_8_neon: 56.9
rgb24_to_uv_128_c: 213.9
rgb24_to_uv_128_neon: 173.2
rgb24_to_uv_1080_c: 1649.9
rgb24_to_uv_1080_neon: 1424.4
rgb24_to_uv_1920_c: 2907.9
rgb24_to_uv_1920_neon: 2480.7
rgb24_to_uv_half_8_c: 36.2
rgb24_to_uv_half_8_neon: 33.4
rgb24_to_uv_half_128_c: 167.9
rgb24_to_uv_half_128_neon: 99.4
rgb24_to_uv_half_1080_c: 1293.9
rgb24_to_uv_half_1080_neon: 778.7
rgb24_to_uv_half_1920_c: 2292.7
rgb24_to_uv_half_1920_neon: 1328.7
rgb24_to_y_8_c: 19.7
rgb24_to_y_8_neon: 27.7
rgb24_to_y_128_c: 129.9
rgb24_to_y_128_neon: 96.7
rgb24_to_y_1080_c: 995.4
rgb24_to_y_1080_neon: 767.7
rgb24_to_y_1920_c: 1747.4
rgb24_to_y_1920_neon: 1337.2

Note both tests use clang as compiler, which has vectorization
enabled by default with -O3.

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-11 01:12:09 +08:00
Zhao Zhili b1240c983f tests/checkasm: Fix build error when enable linux perf on Android
B0 is defined by system header, see f0f596dbc6 for ref.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-11 01:11:46 +08:00
Zhao Zhili 33e4cc963d avutil/timer: Add clock_gettime as a fallback of AV_READ_TIME
Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-11 01:11:36 +08:00
Zhao Zhili 6a18c0bc87 avutil/aarch64: Skip define AV_READ_TIME for apple
It will fallback to mach_absolute_time inside libavutil/timer.h

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-11 01:10:42 +08:00
James Almer 94f2274a8b x86/aacencdsp: fix ff_aac_quantize_bands_avx on unix64 ABI
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 17:16:02 -03:00
James Almer 17c3cc5bb6 swscale/x86/rgb_2_rgb: add missing wrap to ff_uyvytoyuv422_avx2
Fixes old yasm.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 16:04:36 -03:00
James Almer 03546f49a3 swscale/x86/rgb2rgb: add missing wrap for ff_uyvytoyuv422_avx2
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 15:56:52 -03:00
James Almer 287d139b77 checkasm/sw_rgb: fix alignment of buffers for rgb_to_yuv tests
src is apparently not guaranteed to be >8 byte aligned, but align to 16
nonetheless as the x86 asm will do unaligned loads anyway.
dst is guaranteed to be 32 byte aligned for the Y plane, but 16 byte for UV.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 14:12:51 -03:00
James Almer e8cef5e152 swscale/x86/rgb2rgb: remove mmxext version of shuffle_bytes_2103
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 13:43:11 -03:00
James Almer c578bb9864 swscale/x86/input: add AVX2 optimized uyvytoyuv422
uyvytoyuv422_c: 23991.8
uyvytoyuv422_sse2: 2817.8
uyvytoyuv422_avx: 2819.3
uyvytoyuv422_avx2: 1972.3

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 13:43:11 -03:00
James Almer e9cfd53257 swscale/x86/input: add AVX2 optimized RGB32 to YUV functions
abgr_to_uv_8_c: 43.3
abgr_to_uv_8_sse2: 14.3
abgr_to_uv_8_avx: 15.3
abgr_to_uv_8_avx2: 18.8
abgr_to_uv_128_c: 650.3
abgr_to_uv_128_sse2: 110.8
abgr_to_uv_128_avx: 112.3
abgr_to_uv_128_avx2: 64.8
abgr_to_uv_1080_c: 5456.3
abgr_to_uv_1080_sse2: 888.8
abgr_to_uv_1080_avx: 900.8
abgr_to_uv_1080_avx2: 518.3
abgr_to_uv_1920_c: 9692.3
abgr_to_uv_1920_sse2: 1593.8
abgr_to_uv_1920_avx: 1613.3
abgr_to_uv_1920_avx2: 864.8
abgr_to_y_8_c: 23.3
abgr_to_y_8_sse2: 12.8
abgr_to_y_8_avx: 13.3
abgr_to_y_8_avx2: 17.3
abgr_to_y_128_c: 308.3
abgr_to_y_128_sse2: 67.3
abgr_to_y_128_avx: 66.8
abgr_to_y_128_avx2: 44.8
abgr_to_y_1080_c: 2371.3
abgr_to_y_1080_sse2: 512.8
abgr_to_y_1080_avx: 505.8
abgr_to_y_1080_avx2: 314.3
abgr_to_y_1920_c: 4177.3
abgr_to_y_1920_sse2: 915.8
abgr_to_y_1920_avx: 926.8
abgr_to_y_1920_avx2: 519.3
bgra_to_uv_8_c: 37.3
bgra_to_uv_8_sse2: 13.3
bgra_to_uv_8_avx: 14.8
bgra_to_uv_8_avx2: 19.8
bgra_to_uv_128_c: 563.8
bgra_to_uv_128_sse2: 111.3
bgra_to_uv_128_avx: 112.3
bgra_to_uv_128_avx2: 64.8
bgra_to_uv_1080_c: 4691.8
bgra_to_uv_1080_sse2: 893.8
bgra_to_uv_1080_avx: 899.8
bgra_to_uv_1080_avx2: 517.8
bgra_to_uv_1920_c: 8332.8
bgra_to_uv_1920_sse2: 1590.8
bgra_to_uv_1920_avx: 1605.8
bgra_to_uv_1920_avx2: 867.3
bgra_to_y_8_c: 22.3
bgra_to_y_8_sse2: 12.8
bgra_to_y_8_avx: 12.8
bgra_to_y_8_avx2: 17.3
bgra_to_y_128_c: 291.3
bgra_to_y_128_sse2: 67.8
bgra_to_y_128_avx: 69.3
bgra_to_y_128_avx2: 45.3
bgra_to_y_1080_c: 2357.3
bgra_to_y_1080_sse2: 508.3
bgra_to_y_1080_avx: 518.3
bgra_to_y_1080_avx2: 399.8
bgra_to_y_1920_c: 4202.8
bgra_to_y_1920_sse2: 906.8
bgra_to_y_1920_avx: 907.3
bgra_to_y_1920_avx2: 526.3

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 13:43:11 -03:00
James Almer d5fe99dc5f swscale/x86/input: add AVX2 optimized RGB24 to YUV functions
rgb24_to_uv_8_c: 39.3
rgb24_to_uv_8_sse2: 14.3
rgb24_to_uv_8_ssse3: 13.3
rgb24_to_uv_8_avx: 12.8
rgb24_to_uv_8_avx2: 14.3
rgb24_to_uv_128_c: 582.8
rgb24_to_uv_128_sse2: 127.3
rgb24_to_uv_128_ssse3: 107.3
rgb24_to_uv_128_avx: 111.3
rgb24_to_uv_128_avx2: 62.3
rgb24_to_uv_1080_c: 4981.3
rgb24_to_uv_1080_sse2: 1048.3
rgb24_to_uv_1080_ssse3: 876.8
rgb24_to_uv_1080_avx: 887.8
rgb24_to_uv_1080_avx2: 492.3
rgb24_to_uv_1280_c: 5906.8
rgb24_to_uv_1280_sse2: 1263.3
rgb24_to_uv_1280_ssse3: 1048.3
rgb24_to_uv_1280_avx: 1045.8
rgb24_to_uv_1280_avx2: 579.8
rgb24_to_uv_1920_c: 8665.3
rgb24_to_uv_1920_sse2: 1888.8
rgb24_to_uv_1920_ssse3: 1571.8
rgb24_to_uv_1920_avx: 1558.8
rgb24_to_uv_1920_avx2: 869.3
rgb24_to_y_8_c: 20.3
rgb24_to_y_8_sse2: 11.8
rgb24_to_y_8_ssse3: 10.3
rgb24_to_y_8_avx: 10.3
rgb24_to_y_8_avx2: 10.8
rgb24_to_y_128_c: 284.8
rgb24_to_y_128_sse2: 83.3
rgb24_to_y_128_ssse3: 66.8
rgb24_to_y_128_avx: 64.8
rgb24_to_y_128_avx2: 39.3
rgb24_to_y_1080_c: 2451.3
rgb24_to_y_1080_sse2: 696.3
rgb24_to_y_1080_ssse3: 516.8
rgb24_to_y_1080_avx: 518.8
rgb24_to_y_1080_avx2: 301.8
rgb24_to_y_1280_c: 2892.8
rgb24_to_y_1280_sse2: 816.8
rgb24_to_y_1280_ssse3: 623.3
rgb24_to_y_1280_avx: 616.3
rgb24_to_y_1280_avx2: 350.8
rgb24_to_y_1920_c: 4338.8
rgb24_to_y_1920_sse2: 1210.8
rgb24_to_y_1920_ssse3: 928.3
rgb24_to_y_1920_avx: 920.3
rgb24_to_y_1920_avx2: 534.8

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 13:42:09 -03:00
James Almer 6743c2fc6a checkasm/sw_rgb: test rgb32/rgb32_1 to yuv
Test all four pixel formats, but only bench the two native endian ones for a
given target.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 12:29:49 -03:00
James Almer 91b9af0058 x86/aacencdsp: add AVX version of quantize_bands
quant_bands_signed_c: 1928.0
quant_bands_signed_sse2: 406.0
quant_bands_signed_avx: 207.0
quant_bands_unsigned_c: 1702.0
quant_bands_unsigned_sse2: 404.0
quant_bands_unsigned_avx: 209.0

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 12:29:49 -03:00
Rémi Denis-Courmont 7a3369398f sws/input: R-V V 32-bit RGB to halved UV
T-Head C908:
abgr_to_uv_half_8_c:            2.2
abgr_to_uv_half_8_rvv_i32:      3.5
abgr_to_uv_half_128_c:         44.0
abgr_to_uv_half_128_rvv_i32:   13.0
abgr_to_uv_half_1080_c:       245.0
abgr_to_uv_half_1080_rvv_i32: 107.2
abgr_to_uv_half_1920_c:       406.2
abgr_to_uv_half_1920_rvv_i32: 188.7
bgra_to_uv_half_8_c:            2.2
bgra_to_uv_half_8_rvv_i32:      3.5
bgra_to_uv_half_128_c:         26.5
bgra_to_uv_half_128_rvv_i32:   13.0
bgra_to_uv_half_1080_c:       219.7
bgra_to_uv_half_1080_rvv_i32: 107.0
bgra_to_uv_half_1920_c:       406.7
bgra_to_uv_half_1920_rvv_i32: 188.7

SpacemiT X60:
abgr_to_uv_half_8_c:           2.2
abgr_to_uv_half_8_rvv_i32:     3.0
abgr_to_uv_half_128_c:        28.2
abgr_to_uv_half_128_rvv_i32:   5.7
abgr_to_uv_half_1080_c:      235.5
abgr_to_uv_half_1080_rvv_i32: 47.7
abgr_to_uv_half_1920_c:      418.2
abgr_to_uv_half_1920_rvv_i32: 84.0
bgra_to_uv_half_8_c:           2.0
bgra_to_uv_half_8_rvv_i32:     3.0
bgra_to_uv_half_128_c:        23.7
bgra_to_uv_half_128_rvv_i32:   5.7
bgra_to_uv_half_1080_c:      195.5
bgra_to_uv_half_1080_rvv_i32: 47.7
bgra_to_uv_half_1920_c:      346.5
bgra_to_uv_half_1920_rvv_i32: 84.0
2024-06-09 14:33:04 +03:00
Rémi Denis-Courmont e2f069905e sws/input: R-V V 32-bit RGB to UV 2024-06-09 14:33:04 +03:00
Rémi Denis-Courmont f5555cb106 sws/input: R-V V 32-bit RGB to Y
T-Head C908:
abgr_to_y_8_c:            2.5
abgr_to_y_8_rvv_i32:      2.2
abgr_to_y_128_c:         37.0
abgr_to_y_128_rvv_i32:    8.5
abgr_to_y_1080_c:       327.0
abgr_to_y_1080_rvv_i32:  69.5
abgr_to_y_1920_c:       552.0
abgr_to_y_1920_rvv_i32: 122.2
bgra_to_y_8_c:            2.5
bgra_to_y_8_rvv_i32:      2.2
bgra_to_y_128_c:         37.2
bgra_to_y_128_rvv_i32:    8.5
bgra_to_y_1080_c:       310.2
bgra_to_y_1080_rvv_i32:  69.5
bgra_to_y_1920_c:       568.2
bgra_to_y_1920_rvv_i32: 122.5

SpacemiT X60:
abgr_to_y_8_c:            2.5
abgr_to_y_8_rvv_i32:      2.0
abgr_to_y_128_c:         33.0
abgr_to_y_128_rvv_i32:    3.7
abgr_to_y_1080_c:       276.0
abgr_to_y_1080_rvv_i32:  31.5
abgr_to_y_1920_c:       493.7
abgr_to_y_1920_rvv_i32:  55.5
bgra_to_y_8_c:            2.2
bgra_to_y_8_rvv_i32:      2.0
bgra_to_y_128_c:         33.0
bgra_to_y_128_rvv_i32:    3.7
bgra_to_y_1080_c:       276.0
bgra_to_y_1080_rvv_i32:  31.5
bgra_to_y_1920_c:       490.7
bgra_to_y_1920_rvv_i32:  55.5
2024-06-09 14:33:04 +03:00
Andreas Rheinhardt 8b62fb231a swscale/x86/rgb2rgb: Detemplatize
Every function in rgb2rgb_template.c is only compiled exactly
once; there is no overlap at all between the MMXEXT and the
SSE2 functions, so detemplatize it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 12:03:47 +02:00
Andreas Rheinhardt 5421dee0e7 swscale/x86/rgb2rgb_template: Remove unused uyvytoyv12
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 12:03:47 +02:00
Andreas Rheinhardt c1c35380a7 swscale/x86/rgb2rgb: Don't unnecessarily check for inline ASM
The SSE2 and AVX versions of deinterleaveBytes are external ASM.
Move them out of the inline ASM template.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 12:03:47 +02:00
Andreas Rheinhardt f7305eb3b3 swscale/x86/rgb2rgb_template: Remove unnecessary SFENCE
The ff_nv12ToUV_* functions don't use non-temporal stores
at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 12:03:47 +02:00
Andreas Rheinhardt fca796ac3b tests/checkasm/sw_rgb: Be more strict about clobbering MMX state
The MMXEXT versions of the rgb2rgb functions tested here
always emit emms on their own. Therefore one can use
a stricter test to ensure that it stays that way.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 12:03:47 +02:00
Andreas Rheinhardt 3af6136669 avcodec/dnxhdenc: Simplify padding
It is unnecessary to first pad to 32bits; the memset later
will pad everything will with zeroes anyway.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt b0e0b3c58a avcodec/dnxhdenc: Move PutBitContext from ctx to stack
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt 542abee213 avcodec/cbs_h266_syntax_template: Use correct format specifier
H266RawSliceHeader.num_entry_points is an uint32_t.
Fixes -Wformat warnings:
https://fate.ffmpeg.org/log.cgi?slot=aarch64-osx-clang-1200.0.32.29&time=20240604151047&log=compile

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt 8f199cfb5b avformat/evc: Fix format specifiers
Fixes -Wformat warnings; see e.g.
https://fate.ffmpeg.org/log.cgi?slot=aarch64-osx-clang-1200.0.32.29&time=20240604151047&log=compile

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt 5f31a4fd16 avformat/vvc: Don't use uint8_t iterators, fix shadowing
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt 1c4362cce9 avformat/vvc: Fix comment
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt fa77dc8c44 avformat/vvc: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt 8b6c7e7cda avformat/vvc: Fix crash on allocation failure, avoid allocations
This is the VVC version of 8b5d155301.

(Hint: This ensures that the order of NALU arrays is OPI-VPS-SPS-PPS-
Prefix-SEI-Suffix-SEI, regardless of the order in the original
extradata. I hope this is right.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt 4482b3353d avformat/vvc: Don't use ff_copy_bits()
There is no benefit in using it: The fast path of copying
is not taken because of misalignment; furthermore we are
only dealing with a few byte here anyway, so simply copy
the bytes manually, avoiding the dependency on bitstream.c
in lavf (which also contains a function that is completely
unused in lavf).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt 52fb49a8a3 avformat/vvc: Use put_bytes_output()
The PutBitContext has just been flushed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt dd8fb0aaae avcodec/hevc/Makefile: Move rules for lavc/* files to lavc/Makefile
If any of these files (say A) would be changed in such a way
that A acquires a new dependency on another file B, building B
would need to be added to all the rules that lead to A being built.
Yet currently the rules for several files are spread over
the lavc Makefile and the Makefile of the lavc/hevc subdir, making
it more likely to be forgotten. So move the rules for these files
to the lavc/Makefile.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Rémi Denis-Courmont daac101e61 lavc/aacencdsp: fix rounding in R-V V quantize_bands
We need to round toward zero here.
2024-06-08 18:30:43 +03:00
Rémi Denis-Courmont 658439934b lavc/vp8dsp: R-V V vp8_idct_add
T-Head C908 (cycles):
vp8_idct_add_c:       312.2
vp8_idct_add_rvv_i32: 117.0
2024-06-08 18:30:43 +03:00
Rémi Denis-Courmont e0f4d185f1 sws/input: R-V V rgb24ToUV_half and bgr24ToUV_half
T-Head C908:
rgb24_to_uv_half_4_c:           2.0
rgb24_to_uv_half_4_rvv_i32:     3.5
rgb24_to_uv_half_64_c:         27.0
rgb24_to_uv_half_64_rvv_i32:   12.5
rgb24_to_uv_half_540_c:       223.7
rgb24_to_uv_half_540_rvv_i32: 105.2
rgb24_to_uv_half_640_c:       265.5
rgb24_to_uv_half_640_rvv_i32: 123.7
rgb24_to_uv_half_960_c:       414.5
rgb24_to_uv_half_960_rvv_i32: 249.5

SpacemiT X60:
rgb24_to_uv_half_4_c:           1.7
rgb24_to_uv_half_4_rvv_i32:     4.2
rgb24_to_uv_half_64_c:         24.0
rgb24_to_uv_half_64_rvv_i32:    8.7
rgb24_to_uv_half_540_c:       199.2
rgb24_to_uv_half_540_rvv_i32:  72.5
rgb24_to_uv_half_640_c:       235.7
rgb24_to_uv_half_640_rvv_i32:  85.2
rgb24_to_uv_half_960_c:       353.5
rgb24_to_uv_half_960_rvv_i32: 127.5
2024-06-08 18:30:43 +03:00
Rémi Denis-Courmont 3ef5867e4b sws/input: R-V V rgb24ToUV and bgr24ToUV
T-Head C908:
rgb24_to_uv_8_c:            2.7
rgb24_to_uv_8_rvv_i32:      3.2
rgb24_to_uv_128_c:         41.0
rgb24_to_uv_128_rvv_i32:   12.7
rgb24_to_uv_1080_c:       342.5
rgb24_to_uv_1080_rvv_i32: 105.7
rgb24_to_uv_1280_c:       406.0
rgb24_to_uv_1280_rvv_i32: 124.2
rgb24_to_uv_1920_c:       626.0
rgb24_to_uv_1920_rvv_i32: 186.0

SpacemiT X60:
rgb24_to_uv_8_c:            2.5
rgb24_to_uv_8_rvv_i32:      3.0
rgb24_to_uv_128_c:         36.5
rgb24_to_uv_128_rvv_i32:    5.7
rgb24_to_uv_1080_c:       304.2
rgb24_to_uv_1080_rvv_i32:  49.0
rgb24_to_uv_1280_c:       360.5
rgb24_to_uv_1280_rvv_i32:  57.5
rgb24_to_uv_1920_c:       540.7
rgb24_to_uv_1920_rvv_i32:  86.2
2024-06-08 18:30:43 +03:00
Rémi Denis-Courmont 79dfdac4db sws/input: R-V V rgb24ToY & bgr24ToY
T-Head C908:
rgb24_to_y_8_c:            2.0
rgb24_to_y_8_rvv_i32:      2.7
rgb24_to_y_128_c:         26.2
rgb24_to_y_128_rvv_i32:    9.2
rgb24_to_y_1080_c:       219.5
rgb24_to_y_1080_rvv_i32:  76.2
rgb24_to_y_1280_c:       276.2
rgb24_to_y_1280_rvv_i32:  89.7
rgb24_to_y_1920_c:       389.7
rgb24_to_y_1920_rvv_i32: 134.2

SpacemiT X60:
rgb24_to_y_8_c:            1.7
rgb24_to_y_8_rvv_i32:      2.2
rgb24_to_y_128_c:         23.2
rgb24_to_y_128_rvv_i32:    4.2
rgb24_to_y_1080_c:       195.0
rgb24_to_y_1080_rvv_i32:  33.7
rgb24_to_y_1280_c:       231.0
rgb24_to_y_1280_rvv_i32:  40.0
rgb24_to_y_1920_c:       346.2
rgb24_to_y_1920_rvv_i32:  59.7
2024-06-08 18:30:43 +03:00
Wenbin Chen 7560db937d libavfi/dnn: enable LibTorch xpu device option support
Add xpu device support to libtorch backend.
To enable xpu support you need to add
 "-Wl,--no-as-needed -lintel-ext-pt-gpu -Wl,--as-needed" to
"--extra-libs" when configure ffmpeg.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2024-06-08 19:45:21 +08:00
Nuo Mi f68f40736f avcodec/vvcdec: support mv wraparound
A 360 video specific tool
see https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9503377

passed files:
    DMVR_A_Huawei_3.bit
    WRAP_D_InterDigital_4.bit
    WRAP_A_InterDigital_4.bit
    WRAP_B_InterDigital_4.bit
    WRAP_C_InterDigital_4.bit
    ERP_A_MediaTek_3.bit
2024-06-08 17:45:55 +08:00
Nuo Mi 685174069f avcodec/vvcdec: misc, reindent inter.c 2024-06-08 17:45:55 +08:00
Nuo Mi a4013e748a avcodec/vvcdec: refact out emulated_edge_no_wrap
prepare for refrence wraparound
2024-06-08 17:45:55 +08:00
Nuo Mi 8abdf0a28e avcodec/vvcdec: misc, move src offset inside emulated_edge 2024-06-08 17:45:55 +08:00
Nuo Mi 2d98786fee avcodec/vvcdec: refact, remove emulated_edge_dmvr and emulated_edge_bilinear to simplify code 2024-06-08 17:45:55 +08:00
Lynne 714596bcbf aacdec_usac: zero out alpha values for the current frame 2024-06-08 00:22:41 +02:00
Lynne c2d459cb51 aacdec_usac: fix stereo alpha values for transients
Typo.
Also added comments and fixed the branch underneath.
2024-06-08 00:22:40 +02:00
Lynne 7223523335 aacdec_usac: use correct TNS values
The standard slightly modified the maximum TNS bands allowed.
2024-06-08 00:22:40 +02:00
Lynne 9b41cc0430 aacdec_usac: do not round noise amplitude values
Use floating point division instead of integer division.
2024-06-08 00:22:40 +02:00
Lynne a18d0659f4 aacdec_usac: skip coeff decoding if the number to be decoded is 0
Yet another thing not mentioned in the spec.
2024-06-08 00:22:39 +02:00
Lynne 1ad9a4008b aacdec_usac: decouple TNS active from TNS data present flag
The issue was that in case of common TNS parameters, TNS was
entirely skipped, as tns.present was set to 0.
2024-06-08 00:22:39 +02:00
Lynne c0fdb0cdfd aacdec_usac: do not continue parsing bitstream on core_mode == 1
Although LPD is not functional yet, the bitstream ends at that point.
2024-06-08 00:22:38 +02:00
Lynne 8ecaa64b9b aacdec_usac: respect tns_on_lr flag
This was left out, and due to av_unused, forgotten about.
2024-06-08 00:22:38 +02:00
Lynne 25b848a0bd aacdec_usac: correctly set and use the layout map 2024-06-08 00:22:38 +02:00
Lynne ae495b56ff aacdec_usac: remove fallback for custom maps with invalid position
Not needed as every possible index is mapped.
2024-06-08 00:22:37 +02:00
Lynne 91ab17e2fe aacdec_usac: tag LFE channels as such in the channel map
Missed.
2024-06-08 00:22:37 +02:00
Lynne 62cd6d9e59 aacdec_usac: clean up nb_elems on error
Require that there is a valid layout with a valid number of channels
before accepting nb_elems.
The value is required when flushing.

Thanks to kasper93 for figuring it out.
2024-06-08 00:22:37 +02:00
Lynne 5c328e6c1e aacdec: increase MAX_ELEM_ID to 64
In USAC, we set the max to 64.
2024-06-08 00:22:36 +02:00
Lynne 91fd6ca000 lavc: bump minor and add APIchanges entry for new USAC profile 2024-06-08 00:22:36 +02:00
Lynne 1c066867df aac: define a new profile for USAC
This allows users to determine whether a stream is USAC or not.
2024-06-08 00:22:35 +02:00
Lynne ee419804da mpeg4audio: explicitly define each AOT
This makes it far easier to figure out which AOT belongs to which
profile.
Also, explicitly highlight the holes.
2024-06-08 00:22:35 +02:00
Lynne 8a2fe8a5b9 mpeg4audio: rename AOT_USAC_NOSBR to AOT_USAC
The issue is that AOT 45 isn't defined anywhere, and looking at the git
blame, it seems to have sprung up through a reordering of the enum,
and adding a hole.

The spec does not define an explicit AOT for SBR and no SBR, and only
uses AOT 42 (previously AOT_USAC_NOSBR), so just rename AOT_USAC to
it and replace its use everywhere.
2024-06-08 00:22:31 +02:00
Michael Niedermayer 840f2bc18e fftools/ffmpeg_mux_init: Free pts on error
Fixes: CID1538863 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:26 +02:00
Michael Niedermayer d9b9fc4be2 fftools/cmdutils: Add protective () to FLAGS
issue found while reviewing CID1452612 Free of array-typed value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:26 +02:00
Michael Niedermayer 5b82852519 avformat/sdp: Check before appending ","
Found by reviewing code related to CID1500301 String not null terminated

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:25 +02:00
Kacper Michajłow a3d3a58026 avformat/rpl: reject invalid sample rate
Fixes overflow check for bit_rate multiplication few lines below.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:25 +02:00
Michael Niedermayer dce69ba89e avcodec/libx264: Check init_get_bits8() return code
Fixes: CID1594529 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:25 +02:00
Michael Niedermayer 8a64a003b5 avcodec/ilbcdec: Remove dead code
Yes the same dead code is in "iLBC Speech Coder ANSI-C Source Code"

Fixes: CID1509370 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:24 +02:00
Michael Niedermayer 9b76e49061 avcodec/vp8: Check cond init
Fixes: CID1598563 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:24 +02:00
Michael Niedermayer 4ac7405aaf avcodec/vp8: Check mutex init
Fixes: CID1598556 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:24 +02:00
Gerion Entrup 300df41c30 libavfilter/signature_lookup: fix jaccard distance
Actually, the jaccard distance is defined as D = 1 - intersect / union.
Additionally, the distance value is compared against a constant that
must be between 0 and 1, which is not the case here. Both facts together
has led to the fact, that the function always returned a matching course
signature. To leave the constant intact and to avoid floating point
computation, this commit multiplies with 1 << 16 making the constant
effectively 9000 / (1<<16) =~ 0.14.

Reported-by: Sachin Tilloo <sachin.tilloo@gmail.com>
Reviewed-by: Sachin Tilloo <sachin.tilloo@gmail.com>
Tested-by: Sachin Tilloo <sachin.tilloo@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:23 +02:00
Rémi Denis-Courmont 3152c684cb lavc/vc1dsp: R-V V vc1_inv_trans_4x4
T-Head C908 (cycles):
vc1dsp.vc1_inv_trans_4x4_c: 310.7
vc1dsp.vc1_inv_trans_4x4_rvv_i32: 120.0

We could use 1 `vlseg4e64.v` instead of 4 `vle16.v`, but that seems to
be about 7% slower.
2024-06-07 17:53:05 +03:00
Rémi Denis-Courmont 6ffa639c8a lavc/vc1dsp: R-V V vc1_inv_trans_4x8
T-Head C908 (cycles):
vc1dsp.vc1_inv_trans_4x8_c: 653.2
vc1dsp.vc1_inv_trans_4x8_rvv_i32: 234.0
2024-06-07 17:53:05 +03:00
Rémi Denis-Courmont a169f3bca5 lavc/vc1dsp: R-V V vc1_inv_trans_8x4
T-Head C908 (cycles):
vc1dsp.vc1_inv_trans_8x4_c:       626.2
vc1dsp.vc1_inv_trans_8x4_rvv_i32: 215.2
2024-06-07 17:53:05 +03:00
Rémi Denis-Courmont 04397a29de lavc/vc1dsp: R-V V vc1_inv_trans_8x8
T-Head C908 (cycles):
vc1dsp.vc1_inv_trans_8x8_c:       871.7
vc1dsp.vc1_inv_trans_8x8_rvv_i32: 286.7
2024-06-07 17:53:05 +03:00
Rémi Denis-Courmont 8d117024fe checkasm: disable unaligned access emulation
The OS may silently fix (emulate) unaligned hardware access exceptions.
This is extremely slow and code should be fixed not to rely on unaligned
access on affected hardware. Accordingly this requests that the OS
disable emulation and instead throw Bus error, which will be caught by
checkasm's signal handler.

This has no effects if the hardware supports unaligned access in
hardware, since no exceptions are generated. prctl() will fail safe in
that case.
2024-06-07 17:53:05 +03:00
Rémi Denis-Courmont c3dbbb316e lavc/flacdsp: fix sign extension in R-V V wasted33
We need to use either VWCVT.X.X.V or VSEXT.VF2. The later is preferable
to avoid changing VTYPE.
2024-06-07 17:53:05 +03:00
Ramiro Polla 5939f7228a libswscale/x86/yuv_2_rgb: fix some comments 2024-06-07 15:24:06 +02:00
Zhao Zhili 7d46ab9e12 avcodec/mediacodecenc: workaround the alignment requirement for H.265
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-07 13:14:46 +08:00
Zhao Zhili 2a68b2d643 avcodec/mediacodecenc: workaround the alignment requirement only for H.264
There is no bsf for other codecs to modify crop info except H.265.
For H.265, the assumption that FFALIGN(width, 16)xFFALIGN(height, 16)
is the video resolution can be wrong, since the encoder can use CTU
larger than 16x16. In that case, use FFALIGN(width, 16) - width
as crop_right is incorrect. So disable the workaround for H.265 now.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-07 13:14:46 +08:00
Zhao Zhili 680b3cee1f avcodec/h265_metadata: Add options to set width/height after crop
It's a common usecase to request a video size after crop. Before
this patch, user must know the video size before crop, then set
crop_right/crop_bottom accordingly. Since HEVC can have different
CTU size, it's not easy to get/deduce the video size before crop.
With the new width/height options, there is no such requirement.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-07 13:14:46 +08:00
Gyan Doshi d55f5cba7b avfilter/trim: flag trim filter as metadata only
Similar to select filter for video - it can only pass through or drop frames
2024-06-06 15:09:45 +05:30
Zhao Zhili 47ba87551c checkasm/sw_rgb: test rgb24/bgr24 to yuv
The line width 8 is supposed to test corner case, while the
performance doesn't matter. Width 1080 is also a case of
unaligned to 16.

Width 1920 meant for benchmark (together with --runs options).

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-05 15:22:49 -03:00
Ramiro Polla 2d24a80e5e avcodec/mpegvideo_enc: give magic number a name 2024-06-05 19:39:36 +02:00
Ramiro Polla 01b1f4c9a5 libavcodec/libxvid: code cleanup (replace magic numbers) 2024-06-05 19:39:35 +02:00
Rémi Denis-Courmont 0415bb74c8 lavc/vp8dsp: remove no longer used macros 2024-06-04 17:42:07 +03:00
Rémi Denis-Courmont 121fb846b9 lavc/vp7dsp: add R-V V vp7_idct_dc_add4uv
This is almost the same story as vp7_idct_add4y. We just have to use
strided loads of 2 64-bit elements to account for the different data
layout in memory.

T-Head C908:
vp7_idct_dc_add4uv_c:       7.5
vp7_idct_dc_add4uv_rvv_i64: 2.0
vp8_idct_dc_add4uv_c:       6.2
vp8_idct_dc_add4uv_rvv_i32: 2.2 (before)
vp8_idct_dc_add4uv_rvv_i64: 2.0

SpacemiT X60:
vp7_idct_dc_add4uv_c:       6.7
vp7_idct_dc_add4uv_rvv_i64: 2.2
vp8_idct_dc_add4uv_c:       5.7
vp8_idct_dc_add4uv_rvv_i32: 2.5 (before)
vp8_idct_dc_add4uv_rvv_i64: 2.0
2024-06-04 17:42:07 +03:00
Rémi Denis-Courmont 225de53c9d lavc/vp8dsp: rework R-V V idct_dc_add4y
DCT-related FFmpeg functions often add an unsigned 8-bit sample to a
signed 16-bit coefficient, then clip the result back to an unsigned
8-bit value. RISC-V has no signed 16-bit to unsigned 8-bit clip, so
instead our most common sequence is:
    VWADDU.WV
    set SEW to 16 bits
    VMAX.VV zero     # clip negative values to 0
    set SEW to 8 bits
    VNCLIPU.WI       # clip values over 255 to 255 and narrow

Here we use a different sequence which does not require toggling the
vector type. This assumes that the wide addend vector is biased by
-128:
    VWADDU.WV
    VNCLIP.WI    # clip values to signed 8-bit and narrow
    VXOR.VX 0x80 # flip sign bit (convert signed to unsigned)

Also the VMAX is effectively replaced by a VXOR of half-width. In this
function, this comes for free as we anyway add a constant to the wide
vector in the prologue.

On C908, this has no observable effects. On X60, this improves
microbenchmarks by about 20%.
2024-06-04 17:42:07 +03:00
Rémi Denis-Courmont 4e120fbbbd lavc/vp8dsp: add R-V V vp7_idct_dc_add4y
As with idct_dc_add, most of the code is shared with, and replaces, the
previous VP8 function. To improve performance, we break down the 16x4
matrix into 4 rows, rather than 4 squares. Thus strided loads and
stores are avoided, and the 4 DC calculations are vectored.
Unfortunately this requires a vector gather to splat the DC values, but
overall this is still a win for performance:

T-Head C908:
vp7_idct_dc_add4y_c:       7.2
vp7_idct_dc_add4y_rvv_i32: 2.2
vp8_idct_dc_add4y_c:       6.2
vp8_idct_dc_add4y_rvv_i32: 2.2 (before)
vp8_idct_dc_add4y_rvv_i32: 1.7

SpacemiT X60:
vp7_idct_dc_add4y_c:       6.2
vp7_idct_dc_add4y_rvv_i32: 2.0
vp8_idct_dc_add4y_c:       5.5
vp8_idct_dc_add4y_rvv_i32: 2.5 (before)
vp8_idct_dc_add4y_rvv_i32: 1.7

I also tried to provision the DC values using indexed loads. It ends up
slower overall, especially for VP7, as we then have to compute 16 DC's
instead of just 4.
2024-06-04 17:40:41 +03:00
Rémi Denis-Courmont 30797e4ff6 lavc/vp8dsp: add R-V V vp7_idct_dc_add
This just computes the direct coefficient and hands over to code shared
with VP8. Accordingly the bulk of changes are just rewriting the VP8
code to share.

Nothing to write home about:
vp7_idct_dc_add_c:       1.7
vp7_idct_dc_add_rvv_i32: 1.2
2024-06-04 17:40:36 +03:00
Frank Plowman d866f49791 lavc/vvc: Reallocate pixel buffers if pixel shift changes
Allocations in the following lines depend on the pixel shift, and so
these buffers must be reallocated if the pixel shift changes.  Patch
fixes segmentation faults in fuzzed bitstreams.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-04 20:13:47 +08:00
Anton Khirnov 9576a00527 lavc/hevcdec: drop unused HEVCContext.width/height 2024-06-04 11:46:27 +02:00
Anton Khirnov a13b892080 lavc/hevcdec: deduplicate calling hwaccel decode_params() 2024-06-04 11:46:27 +02:00
Anton Khirnov e4601cc339 lavc/hevc*: move to hevc/ subdir 2024-06-04 11:46:27 +02:00
Anton Khirnov ba56a300a9 lavc/hevcdec: drop HEVCContext.frame
It is merely a redundant pointer to cur_frame->f
2024-06-04 11:46:27 +02:00
Anton Khirnov db84c1c6ef lavc/hevcdec: rename HEVCFrame.frame to just f
This is shorter, loses no information, and is consistent with other
similar structs.
2024-06-04 11:46:23 +02:00
Anton Khirnov 9226514ced lavc/hevcdec: rename HEVCContext.ref to cur_frame
Since it stores a pointer to the current frame.
2024-06-04 11:44:37 +02:00
Anton Khirnov 7ad9400952 lavc/hevcdec: drop HEVCContext.HEVClc
It is merely a pointer to local_ctx[0], which we can just as well use
directly.
2024-06-04 11:36:51 +02:00
Anton Khirnov 67ca18dd56 lavc/hevcdec: drop HEVCLocalContext.gb
In all HEVCLocalContext instances except the first one, the bitreader is
never used for actually reading bits, but merely for passing the buffer
to ff_init_cabac_decoder(), which is better done directly.

The instance that actually is used for bitreading gets moved to stack in
decode_nal_unit(), which makes its lifetime clearer.
2024-06-04 11:36:51 +02:00
Anton Khirnov ac69e6caf6 lavc/hevcdec: include first row in SliceHeader.offset/size
Will be useful in the following commit.
2024-06-04 11:36:51 +02:00
Anton Khirnov 79c0310aca lavc/hevcdec: drop a useless condition
hls_slice_data_wpp() is only called when num_entry_point_offsets>0
2024-06-04 11:36:51 +02:00
Anton Khirnov 74159cbfc3 lavc/hevcdec: move handling of byte alignment at the end of slice header
Do it in hls_slice_header() rather than cabac_init_decoder() - the
former is a more logical place as according the spec the byte alignment
is a part of the slice header, not slice data. Avoids a second instance
of alignment handling in vaapi_hevc.

Also, check that alignment_bit_equal_to_one is, in fact, equal to one.
2024-06-04 11:36:51 +02:00
James Almer a14440867c x86/float_dsp: add SSE2 and AVX versions of scalarproduct_double
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-03 22:14:55 -03:00
Lynne 7413b81e50 aacdec_usac: fix typo in debug message 2024-06-04 03:08:46 +02:00
Lynne f4371029f8 aacdec_usac: fix off by one error check on channel numbers 2024-06-04 03:08:45 +02:00
Lynne 0d93e04bc6 aacdec_usac: error out on receiving too many channels for the current layout
Verify that we have a correct number of channels.
2024-06-04 03:08:45 +02:00
Lynne 39826eacff aacdec_usac: error out on too many elements
USAC supports up to 64 audio channels, but puts no limit on the total
number of extensions that may be present. Which may mean that there's
a single audio channel, with 65 thousand extension elements.

We assume that 64 elements is the maximum for now. So check the value.
2024-06-04 03:08:44 +02:00
Lynne b70fdbde9c aacdec_usac: prevent get_bits(0) in get_escaped_value
Some calls to get_escaped_value() specify 0 bits as the third value.
This would result in get_bits(0), which is not a correct usage of the
get_bits API.
2024-06-04 03:08:39 +02:00
Rémi Denis-Courmont fd4977c876 lavc/aacencdsp: R-V V quant_bands
T-Head C908:
quant_bands_signed_c:        576.0
quant_bands_signed_rvv_f32:   48.7
quant_bands_unsigned_c:      414.2
quant_bands_unsigned_rvv_f32: 31.7

SpacemiT X60:
quant_bands_signed_c:        497.7
quant_bands_signed_rvv_f32:   23.0
quant_bands_unsigned_c:      353.5
quant_bands_unsigned_rvv_f32: 16.2
2024-06-03 22:43:37 +03:00
Rémi Denis-Courmont be6f8c439a checkasm: add aacencdsp.quant_bands test 2024-06-03 22:43:37 +03:00
Andreas Rheinhardt bb3c50b46d avcodec/tiff: Suppress unused variable warnings
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-03 16:38:32 +02:00
Andreas Rheinhardt 87a13986bc avformat/nutdec: Don't create inconsistent side data
Forgotten in 65ddc74988.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-03 16:38:15 +02:00
Tomas Härdin 4037d5e103 lavc/speedhqenc: Require width to be a multiple of 16 2024-06-03 14:13:56 +02:00
Tomas Härdin 017a18b026 lavc/speedhqdec: Reindent 2024-06-03 14:13:34 +02:00
Tomas Härdin 42d5ddb2de lavc/speedhqdec: Add AV_CODEC_CAP_SLICE_THREADS
Each field slice is assigned to one thread.
Serial performance is unaffected.
2024-06-03 14:13:30 +02:00
Stefano Sabatini 77ad449911 doc/filters/curves: fix typos 2024-06-03 11:24:33 +02:00
Stefano Sabatini 17a759cce1 doc/filters/tiltandshift: apply typo fixes, add introductory description 2024-06-03 11:07:27 +02:00
Marcus B Spencer 26084887b0 doc/developer: update outdated information
Codec IDs have split from `avcodec.h` into `codec_id.h` after commit
c6978418b8.

General documentation contents (which are now in
`general_contents.texi`) have split from the header in `general.texi`
after commit 6accb7718a.

Update the developer documentation to match these changes.

Signed-off-by: Marcus B Spencer <marcus@marcusspencer.xyz>
2024-06-03 10:58:31 +02:00
James Almer 4d59d58ea6 avcodec/aac/aacdec_usac: remove unnecessary cast
Fixes "libavcodec/aac/aacdec_usac.c(543): error C2440: 'type cast': cannot convert from 'GetBitContext' to 'GetBitContext'"
from msvc.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-02 20:14:20 -03:00
Michael Niedermayer 6106177ad6 avcodec/proresenc_anatoliy: Assert that AV_PROFILE_UNKNOWN is replaced
If its not replaced we would have a negative index used in an array potentially

Helps: CID1440385 Negative array index read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:42 +02:00
Michael Niedermayer 160b81ce2a avcodec/pcm-dvdenc: 64bit pkt-size
It seems nothing prevents such overflow even though odd

Fixes: CID1441934 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:42 +02:00
Michael Niedermayer 19db9636c5 avcodec/notchlc: Check init_get_bits8() for failure
Fixes: CID1500300 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:41 +02:00
Michael Niedermayer 161d0aa2a8 avcodec/tests/dct: Use 64bit in intermediate for error computation
Fixes: CID1500284 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:41 +02:00
Michael Niedermayer d741638042 avcodec/scpr3: Check add_dec() for failure
Fixes: CID1441459 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:41 +02:00
Michael Niedermayer e5098589b0 avcodec/rv34: assert that size is not 0 in rv34_gen_vlc_ext()
Helps: CID1548380 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:23 +02:00
Michael Niedermayer 6f976db251 avcodec/wavpackenc: Use unsigned for potential 31bit shift
Fixes: CID1465481 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:23 +02:00
Michael Niedermayer 30f2bac9f7 avcodec/wavpack: Remove dead assignments
Fixes: CID1442018 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:23 +02:00
Michael Niedermayer 2e5433dc12 avcodec/vvc/mvs: Initialize mvf
This might not be needed for correctness but it could
help general reproducability of issues

Related to: CID1560037 Uninitialized scalar variable
Related to: CID1560044 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:22 +02:00
Michael Niedermayer 12391b732f avcodec/tests/jpeg2000dwt: Use 64bit in comparission
Found while reviewing: CID1500309 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:22 +02:00
Michael Niedermayer 847a53f264 avcodec/tests/jpeg2000dwt: Use 64bit in err2 computation
This issue cannot happen with the current function parameters

Fixes: CID1500309 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:22 +02:00
Michael Niedermayer 348c3a7ffe avformat/fwse: Remove always false expression
Fixes: CID1460758 Operands don't affect result

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:21 +02:00
Lynne 18757b26bd aacdec_usac: fix typo in fac_length
The spec says:
fac_length = (window_sequence==EIGHT_SHORT_SEQUENCE) ? ccfl/16 : ccfl/8;

The length used was flipped for short vs long.
2024-06-02 21:12:31 +02:00
James Almer d8ffd65bfd avcodec/aac/aacdec_usac: remove call to realloc
Must be one of the lavu wrappers instead.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-02 15:32:04 -03:00
Lynne 63e166d802 lavu: bump minor and add APIchanges entries for the new channel positions 2024-06-02 19:19:25 +02:00
Lynne 24d3291f7c changelog: add entry for xHE-AAC 2024-06-02 18:34:46 +02:00
Lynne 7852d9e604 libavcodec: bump minor version for xHE-AAC 2024-06-02 18:34:46 +02:00
Lynne b3212797ae fate: add tests for xHE-AAC
Starting off small with a few features.
Samples and reference decoded files copied from the official ISO
reference suite.
2024-06-02 18:34:46 +02:00
Lynne eee5fa0808 aacdec: add a decoder for AAC USAC (xHE-AAC)
This commit adds a decoder for the frequency-domain part of USAC.

What works:
 - Mono
 - Stereo (no prediction)
 - Stereo (mid/side coding)
 - Stereo (complex prediction)

What's left:
 - SBR
 - Speech coding

Known issues:
 - Desync with certain sequences
 - Preroll crossover missing (shouldn't matter, bitrate adaptation only)
2024-06-02 18:34:45 +02:00
Lynne 23b45d7e20 aactab: add new scalefactor offset tables for 96/768pt windows 2024-06-02 18:34:45 +02:00
Lynne a300ec3569 aactab: add tables for the new USAC arithmetic coder 2024-06-02 18:34:45 +02:00
Lynne 7cd8a3f509 aactab: add deemphasis tables for USAC 2024-06-02 18:34:44 +02:00
Lynne 0513c5cd25 aacdec_dsp: implement 768-point transform and windowing
Required for USAC
2024-06-02 18:34:44 +02:00
Lynne f8543f3763 aacdec: expose decode_tns
USAC has the same syntax, with one minor change we can check for.
2024-06-02 18:34:43 +02:00
Lynne 0f2303f629 aacdec: expose channel layout related functions 2024-06-02 18:34:43 +02:00
Lynne 39b8d84b53 aacdec: move from scalefactor ranged arrays to flat arrays
AAC uses an unconventional system to send scalefactors
(the volume+quantization value for each band).
Each window is split into either 1 or 8 blocks (long vs short),
and transformed separately from one another, with the coefficients
for each being also completely independent. The scalefactors
slightly increase from 64 (long) to 128 (short) to accomodate
better per-block-per-band volume for each window.

To reduce overhead, the codec signals scalefactor sizes in an obtuse way,
where each group's scalefactor types are sent via a variable length decoding,
with a range.
But our decoder was written in a way where those ranges were carried through
the entire decoder, and to actually read them you had to use the range.

Instead of having a dedicated array with a range for each scalefactor,
just let the decoder directly index each scalefactor.

This also switches the form of quantized scalefactors to the format
the spec uses, where for intensity stereo and regular, scalefactors
are stored in a scalefactor - 100 form, rather than as-is.

USAC gets rid of the complex scalefactor handling. This commit permits
for code sharing between both.
2024-06-02 18:34:43 +02:00
Lynne caeb275092 channel_layout: add new channel positions supported by xHE-AAC
apichanges will be updated upon merging, as well as a version bump.
2024-06-02 18:34:38 +02:00
Rémi Denis-Courmont 6c6bec04f3 lavc/vc1dsp: fix R-V V avg_mspel_pixels
The 8x8 pixel arrays are not necessarily aligned to 64 bits, so the
current code leads to Bus error on real hardware. This reproducible
with FATE's vc1_ilaced_twomv test case.

The new "pessimist" code can trivially be shared for 16x16 pixel
arrays so we also do that. FWIW, this also nominally reduces the
hardware requirement from Zve64x to Zve32x.

T-Head C908:
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_c:      14.7
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_rvv_i32: 3.5
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_c:       3.7
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_rvv_i32: 1.5

SpacemiT X60:
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_c:      13.0
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_rvv_i32: 3.0
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_c:       3.2
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_rvv_i32: 1.2
2024-06-02 10:37:09 +03:00
Andreas Rheinhardt 2c38ca3d37 avcodec/hevc_ps: Fix UB 1 << 31
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-02 05:15:00 +02:00
Michael Niedermayer 00d029d5c0 avcodec/sga: Make it clear that the return is intentionally not checked
Related: CID1473496 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:29 +02:00
Michael Niedermayer 70b4994762 avformat/asfdec_f: Use 64bit for preroll computation
Fixes: CID1500342 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:28 +02:00
Michael Niedermayer d9d1f65308 avformat/argo_asf: Use 64bit in offset intermediate
Fixes: CID1467435 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:28 +02:00
Michael Niedermayer a2b8d03347 avformat/ape: Use 64bit for final frame size
Fixes: CID1505963 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:28 +02:00
Michael Niedermayer 2f04cb673c avformat/ac4dec: Check remaining space in ac4_probe()
Fixes: CID1538298 Untrusted loop bound
Fixes: undefined behavior

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:27 +02:00
Michael Niedermayer 6f52b64bcc avdevice/pulse_audio_enc: Use av_rescale() to avoid integer overflow
Fixes: CID1503075 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:05 +02:00
Rémi Denis-Courmont eed0a1d3d4 lavu/lls: R-V V update_lls
update_lls_8_c:        7.5
update_lls_8_rvv_f64:  4.2
update_lls_12_c:      14.5
update_lls_12_rvv_f64: 5.7
2024-06-01 18:05:58 +03:00
Rémi Denis-Courmont fc85aff72f checkasm: add linear least square tests 2024-06-01 18:05:58 +03:00
James Almer 7087da303f avutil/float_dsp.h: fix doxy for scalarproduct_double
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-01 11:15:30 -03:00
James Almer 7736ca1d7b avutil/float_dsp: revert accidental doxy removal
done by accident in 6a7c4d60a1.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-01 11:14:42 -03:00
James Almer 7e182a8d92 avcodec/videotoolbox: use the correct HEVCSPS field name
Fixes compilation that was broken in 6fed1841a1.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-01 10:56:19 -03:00
James Almer 0a949aacae checkasm/lpc: use fixed length to bench apply_welch_window
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 17:06:08 -03:00
Rémi Denis-Courmont 16132a810d checkasm/lpc: test compute_autocorr
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 16:36:43 -03:00
Rémi Denis-Courmont 9238f6cb41 lavu/float_dsp: R-V V scalarproduct_double
C908:
scalarproduct_double_c:       39.2
scalarproduct_double_rvv_f64: 10.5

X60:
scalarproduct_double_c:       35.0
scalarproduct_double_rvv_f64:  5.2
2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont b114952030 lavfi: get rid of bespoke double scalar products 2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont 73c278d270 lavu/lls: use ff_scalarproduct_double_c() 2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont 98405d28fa checkasm/float_dsp: add double-precision scalar product 2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont 6a7c4d60a1 lavu/float_dsp: add double-precision scalar product
The function pointer is appended to the structure for backward binary
compatibility. Fortunately, this is allocated by libavutil, not by the
user, so increasing the structure size is safe.
2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont 06fc919aad lavc/sbrdsp: add support for 256-bit vectors
hf_apply_noise_0_c: 35.7
hf_apply_noise_0_rvv_f32: 9.5
hf_apply_noise_1_c: 38.5
hf_apply_noise_1_rvv_f32: 10.0
hf_apply_noise_2_c: 35.5
hf_apply_noise_2_rvv_f32: 9.7
hf_apply_noise_3_c: 38.5
hf_apply_noise_3_rvv_f32: 10.0

Maybe extending the noise table manually is not such great idea, but I
not quite sure how to deal with that otherwise? Allocating the table
dynamically is possible but would require an ELF destructor to clean up.
2024-05-31 22:22:43 +03:00
Anton Khirnov 63a96dbcce lavc/hevc_ps: compactify ShortTermRPS
Do not use larger fields than needed, use size-1 bitfields for flags.

Reduces sizeof(HEVCSPS) by 1280 bytes.
2024-05-31 19:26:06 +02:00
Anton Khirnov 9127819d51 lavc/hevc_ps: reduce the size of ShortTermRPS.used
It is currently an array of 32 uint8_t, each storing a single flag. A
single uint32_t is sufficient.

Reduces sizeof(HEVCSPS) by 1792 bytes.
2024-05-31 19:26:06 +02:00
Anton Khirnov d893667867 lavc/hevc_ps: do not store delta_poc_s[01] in ShortTermRPS
They are only used in vulkan_hevc and are not actually needed, as they
can be computed from delta_poc.

Reduces sizeof(HEVCSPS) by 16kB.

Also, fix a typo (s0->s1) in the code being touched.
2024-05-31 19:26:06 +02:00
Anton Khirnov 4264e4056c lavc/hevc_ps: fix variable signedness in ff_hevc_decode_short_term_rps()
It is actually supposed to go negative in the loop over num_negative
pics, but underflow does not break anything as the result is then
assigned to a signed int.
2024-05-31 19:26:06 +02:00
Anton Khirnov 6fed1841a1 lavc/hevc_ps/HEVCSPS: change flags into uint8_t
Reduces sizeof(HEVCSPS) by 64 bytes.

Also improve flag names: drop redundant suffixes and prefixes, and
consistently use disabled/enabled.
2024-05-31 19:26:06 +02:00
Anton Khirnov bd1a06dc43 lavc/hevc_ps: reduce the size of used_by_curr_pic_lt_sps_flag
It is currently an array of 32 uint8_t, each storing a single flag. A
single uint32_t is sufficient.
2024-05-31 19:26:06 +02:00
Anton Khirnov 72bdbce00d lavc/hevcdec: drop a useless execute() call with 1 job 2024-05-31 19:26:06 +02:00
Anton Khirnov f0aece90d9 lavc/hevcdec: allocate local_ctx as array of structs rather than pointers
It is more efficient and easier to manage.
2024-05-31 19:26:06 +02:00
Anton Khirnov 25ce44efa5 lavc/hevcdec: track local context count separately from WPP thread count
The latter can be lowered while decoding, which would lead to memleaks.
2024-05-31 19:26:06 +02:00
Anton Khirnov a1471ec8ad lavc/hevcdec: rename HEVCContext.HEVClcList to local_ctx
It is more consistent with our naming conventions.
2024-05-31 19:26:06 +02:00
James Almer e0db1f51d6 avcodec/lpc: account for odd len values
Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 13:36:02 -03:00
Gyan Doshi 2f184aa89b configure: correct libopenjpeg description
Decoding is no longer possible as the decoder wrapper was removed
in 60ccb3fe78
2024-05-31 21:20:28 +05:30
James Almer 8a1c491354 avcodec/packet: remove reference to old AV_SIDE_DATA_PARAM_CHANGE_ values
They were forgotten in 65ddc74988.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 11:24:37 -03:00
Andreas Rheinhardt 8cbf7e8408 avcodec/diracdec: Mark flush as av_cold
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 0f3090cbd1 avcodec/diracdec: Use FF_CODEC_CAP_INIT_CLEANUP
This was one of the few decoders incompatible with the flag.
Also only call free_sequence_buffers() instead of dirac_decode_flush()
in dirac_decode_end().

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt d9bd5baf9d avcodec/vc2enc: Use already available AVPixFmtDescriptor
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt d1d40a7c9b avcodec/vc2enc: Move transient PutBitContext from ctx to stack
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt c309285666 avcodec/vc2enc: Avoid relocations for short strings
These strings are so short that they can be put directly
into the containing structure, avoiding the pointer
and putting it into .rodata.
Also use chars for interlaced and level while at it, as
these are so small.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 02ecf8d7f3 avcodec/vc2enc: Fix slice length
args->bytes here already includes prefix_bytes (see
SSIZE_ROUND macro), so including it here again and
forgetting it when offsetting skip seems wrong.
This only works because prefix_bytes is currently
always zero in this encoder.
(This has been added in b88be742fa
without any reason.)

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt eac8dcb187 avcodec/vc2enc: Remove superfluous error message
ff_get_encode_buffer() already emits an error message of its own.
While just at it, also check for ret < 0 instead of just ret != 0.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt b1702afdfd avcodec/vc2enc: Constify slices->main context pointers
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 6d86146fce avcodec/vc2enc: Avoid void* where possible
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 2d818644a3 avfilter/af_afir: Merge header into af_afir.c
Done in 0df18f29ae,
accidentally undone in 163e737c17.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 21bfc62642 avfilter/af_aiir: Avoid unchecked allocation
W has not been checked at all; allocate it jointly with M
to fix this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 37cc648fbd avfilter/af_aiir: Remove dead code
Fixes Coverity issue #1468252.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt 996e0a57ca avformat/matroskadec: Add assert to silence Coverity false positive
Helps with Coverity issue #1452453.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt dfd0320e23 avfilter/vf_signalstats: Use 64bit for processing histogram
The result might not fit into 32bit if an image has gigantic
dimensions and one of the planes has a dominant value
(particularly so if said value is big).

Fixes Coverity issues #1598399, #1598401, #1598402, #1598403, #1598404.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
James Almer 4008a80c1b tests/checkasm/vvc_mc: don't zero the SAD buffers
They will be filled immediately after.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 20:05:21 +08:00
James Almer b70289f354 tests/checkasm/vvc_mc: fix indentation
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 20:05:21 +08:00
Wu Jianhua 442e94e5e4 tests/checkasm/vvc_alf: change alf step size to 8
From Benjamin Bross:
> for ALF where functions are in increments of 4 while 8 should be sufficient according to the spec.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-31 19:57:31 +08:00
Wu Jianhua 9950f14864 avcodec/x86/vvc/vvc_alf: use xq to match ptrdiff_t
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-31 19:57:31 +08:00
Wu Jianhua 09d3370c28 avcodec/x86/vvc/vvc_alf: fix integer overflow
Some tests fails with certain seeds

tests/checkasm/checkasm 2325607578 --test=vvc_alf
checkasm: using random seed 2325607578
AVX2:
    vvc_alf_filter_luma_120x20_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x24_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x28_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x32_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x36_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x40_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x44_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x48_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x52_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x56_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x60_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x64_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x68_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x72_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x76_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x80_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x84_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x88_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x92_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x96_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x100_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x104_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x108_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x112_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x116_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x120_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x124_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x128_12_avx2 (vvc_alf.c:104)
  - vvc_alf.alf_filter   [FAILED]
  - vvc_alf.alf_classify [OK]
checkasm: 28 of 9216 tests have failed

Reported-by: James Almer <jamrial@gmail.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-31 19:57:31 +08:00
Pierre-Anthony Lemieux 249c66bb22 avcodec/jpeg2000dec: fix HT block decoder
Addresses https://trac.ffmpeg.org/ticket/10905

Co-authored-by: Osamu Watanabe <owatanab@es.takushoku-u.ac.jp>
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-05-30 21:30:52 -07:00
Shiyou Yin 6b35fcacdb swscale: [loongarch] Fix undeclared functions prob.
Compile with '--disable-lasx', ‘lumRangeFromJpeg_lasx’ undeclared.

Reviewed-by: 金波 <jinbo@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-31 02:20:23 +02:00
sunyuechi 544acfa2c0 lavc/vp9dsp: R-V V rename ff_avg to ff_vp9_avg
Avoid potential naming conflicts

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont 8a96495fef checkasm/vp8dsp: add VP7 tests 2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont a3d4c73b4e checkasm/vp8dsp: share DSP context across tests
This will simplify later changes.
2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont 4fe8f2cc43 riscv: allow passing addend to vtype_vli macro
A constant (-1) is added to the length value, so we can have an added
for free, and optimise the addition away if the addend is exactly 1.
2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont add8c46215 Revert "avformat/file: seek back to initial position for fd protocol"
The generally expected behaviour is for software to append from the
current position, not to keep resetting. See also how shell works:
 # (foo && bar) > file
...would normally concatenate the output of both commands to file.

If foo seeks like lavf, bar would instead overwrite the output of
foo (possibly not completely).

This reverts commit 5c3d2177e7.
2024-05-30 18:30:21 +03:00
Zhao Zhili 6de951923b avfilter/dnn: Remove a level of dereference
For code such as 'model->model = ov_model' is confusing. We can
just drop the member variable and use cast to get the subclass.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:31 +08:00
Zhao Zhili a1fea7e11b avfilter/dnn_backend_torch: Simplify memory allocation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:27 +08:00
Zhao Zhili abfefbb33b avfilter/dnn_backend_tf: Simplify memory allocation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:21 +08:00
Zhao Zhili a40df366c4 avfilter/dnn_backend_tf: Fix free context at random place
It will be freed again by ff_dnn_uninit.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:17 +08:00
Zhao Zhili d3db7bbc03 avfilter/dnn_backend_tf: Remove one level of indentation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:10 +08:00
Zhao Zhili 57a3c2cd40 avfilter/dnn_backend_openvino: simplify memory allocation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:07 +08:00
Zhao Zhili ac52cee72e avfilter/dnn_backend_openvino: Fix free context at random place
It will be freed again by ff_dnn_uninit.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:00 +08:00
Zhao Zhili 093f5da534 avfilter/dnn: Don't show backends which are not supported by a filter 2024-05-30 18:13:46 +08:00
Zhao Zhili 4f051c746b avfilter/dnn: Use dnn_backend_info_list to search for dnn module
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:13:29 +08:00
Rémi Denis-Courmont fa3b153cb1 lavc/vp7dsp: R-V V vp7_idct_add
Most of the code is shared with DC, thanks to minor earlier changes.

vp7_idct_add_c:       5.2
vp7_idct_add_rvv_i32: 2.5
2024-05-29 16:57:02 +03:00
Rémi Denis-Courmont 4a0e629b6f lavc/vp7dsp: revector ff_vp7_dc_wht_rvv
This prepares for some code reuse.
2024-05-29 16:57:02 +03:00
Rémi Denis-Courmont fd39997f72 lavc/vp7dsp: add R-V V vp7_luma_dc_wht
This works out a bit more favourably than VP8's due to:
- additional multiplications that can be vectored,
- hardware-supported fixed-point rounding mode.

vp7_luma_dc_wht_c:       3.2
vp7_luma_dc_wht_rvv_i64: 2.0
2024-05-29 16:57:02 +03:00
Rémi Denis-Courmont 91b5ea7bb9 lavc/vp8dsp: R-V V vp8_luma_dc_wht
This is not great as transposition is poorly supported, but it works:
vp8_luma_dc_wht_c:       2.5
vp8_luma_dc_wht_rvv_i32: 1.7
2024-05-29 16:57:02 +03:00
Rémi Denis-Courmont c53d42380d lavc/lpc: optimise RVV vector type for compute_autocorr
On SpacemiT X60 (with len == 4000):
autocorr_10_c:       2303.7
autocorr_10_rvv_f64: 1411.5 (before)
autocorr_10_rvv_f64:  842.2 (after)
2024-05-29 16:57:02 +03:00
Stone Chen d82c503555 tests/checkasm/vvc_mc: for SAD, only test valid subblock sizes
According to the VVC specification (section 8.5.1), the maximum width/height of a subblock passed for DMVR SAD is 16. This along with previous constraint requiring width * height >= 128 means that  8x16, 16x8, and 16x16 are the only allowed sizes.

This changes check_vvc_sad() to only test and benchmark those sizes.
2024-05-29 21:35:34 +08:00
Stone Chen 55e9c758f0 libavcode/x86/vvc: change label to vvc_sad_16 to reflect block sizes
According to the VVC specification (section 8.5.1), the maximum width/height of a subblock passed for DMVR SAD is 16. This along with previous constraint requiring width * height >= 128 means that  8x16, 16x8, and 16x16 are the only allowed sizes. This re-labels vvc_sad_16_128 to vvc_sad_16 to reflect this and adds a comment about the block size constraints. There's no functionality change.
2024-05-29 21:35:34 +08:00
David Rosca 510494760c lavc/vaapi_h264: Fix merging fields in DPB with missing references
If there are missing references, h264 decode does error concealment
by copying previous refs which means there will be duplicated surfaces.
Check long_ref and frame_idx in addition to surface when looking for
the other field to avoid trying to merge with wrong picture.
Also allow to merge with multiple pictures in case there are duplicates
of the other field.

Signed-off-by: David Rosca <nowrep@gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-29 10:52:10 +08:00
David Rosca d2d911eb9a lavc/vaapi_av1: Avoid sending the same slice buffer multiple times
When there are multiple tiles in one slice buffer, use multiple slice
params to avoid sending the same slice buffer multiple times and thus
increasing the bitstream size the driver will need to upload to hw.

Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: David Rosca <nowrep@gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-29 10:49:35 +08:00
David Rosca fe9d889dcd lavc/vaapi_decode: Make it possible to send multiple slice params buffers
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: David Rosca <nowrep@gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-29 10:47:43 +08:00
Haihao Xiang c872ba5899 lavc/qsvenc: respect user's setting for keyframes
For example:
./ffmpeg -hwaccel qsv -i input.mp4 -force_key_frames:v source -c:v
hevc_qsv -f null -

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-29 10:46:54 +08:00
Haihao Xiang dbdd9ccded lavc/qsvdec: fix keyframes
MFX_FRAMETYPE_IDR is ORed to the frame type for AVC and HEVC keyframes,
and MFX_FRAMETYPE_I is taken as keyframe flag for other codecs when
getting the output surface from the SDK, hence we may mark the output
frame as keyframe accordingly.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-29 10:46:54 +08:00
Rémi Denis-Courmont a11122f9c6 lavc/vp8dsp: save one R-V GPR
This saves one instruction and frees up A5, which will be repurposed in
later changes. Unfortunately, we need to add quite a lot of alternative
code for this.
2024-05-28 19:44:11 +03:00
Rémi Denis-Courmont 4e56455d36 lavc/vp8dsp: avoid one multiplication on RISC-V
Use shifts rather than multiply, and save one instruction.
2024-05-28 19:44:11 +03:00
Rémi Denis-Courmont 0aad5b9bf5 lavc/vp8dsp: factor R-V V bilin functions
For a given type, only the first VSETVLI instruction varies depending
on the size.
2024-05-28 19:44:11 +03:00
Rémi Denis-Courmont b248d7c319 lavc/sbrdsp: fold immediate offset into relocation
This results in AUIPC; ADDI instead of AUIPC; ADDI; ... ADDI.
2024-05-28 19:44:11 +03:00
Rémi Denis-Courmont 8444115262 lavc/startcode: fix RVV return value on no match
If there are no zero bytes, t2 equals -1. The code cannot simply fall
through to the match case.
2024-05-28 19:43:40 +03:00
Rémi Denis-Courmont af20fb9c4e lavc/lpc: fix off-by-one in R-V V compute_autocorr 2024-05-28 19:43:40 +03:00
Niklas Haas 9fd88bd092 avcodec/h2645_sei: loosen up min luminance requirements
The H.265 specification is quite clear on this case:

> When min_display_mastering_luminance is not in the range of 1 to
> 50000, the nominal maximum display luminance of the mastering display
> is unknown or unspecified or specified by other means not specified in
> this Specification.

And so the current code is correct in marking luminance data as invalid
if min luminance is set to 0. However, this breaks playback of at least
several real-world Blu-ray releases, for example La La Land, Planet of
the Apes, and quite possibly a lot more. These come with ostensibly
valid max_luminance tags (1000 nits), but min_luminance set to 0.

Loosen up this requirement by guarding it behind FF_COMPLIANCE_STRICT.
We still reject blatantly invalid metadata (wrong value range on
luminance, max set to 0, max below min, min above 50 nits etc.), so this
shouldn't cause any unintended regressions.

Fixes: https://github.com/mpv-player/mpv/issues/14177
2024-05-28 18:11:57 +02:00
Kacper Michajłow b2b23f353a avformat/hls: update current segment reference before use
It may be invalidated by the time it is used.

Fixes use after free when accessing current segment.

Fixes: #10825
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-05-28 15:02:02 +02:00
Michael Niedermayer 62d7106c36 avcodec/vlc: Cleanup on multi table alloc failure in ff_vlc_init_multi_from_lengths()
Fixes: CID1544630 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:08 +02:00
Michael Niedermayer d5cc21741b avcodec/vc1_block: remove unneeded store to off in vc1_decode_p_mb_intfi()
Found while reviewing code related to coverity

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:08 +02:00
Michael Niedermayer 992b28f572 avcodec/vc1_block: remove unused off from vc1_decode_p_mb_intfr()
Fixes: CID1435166 Unused value
Fixes: CID1529221 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:08 +02:00
Michael Niedermayer a287f17db2 avcodec/tiff: Assert init_get_bits8() success in unpack_gray()
Helps: CID1441939 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:07 +02:00
Michael Niedermayer 8814cedb07 avcodec/tiff: Assert init_get_bits8() success in horizontal_fill()
Helps: CID1441167 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:07 +02:00
Michael Niedermayer 6df8bd64ff tools/decode_simple: Check avcodec_send_packet() for errors on flushing
This will not error but the API allows errors so we should check it
Fixes: CID1489999 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:06 +02:00
Michael Niedermayer bfc22f364d swscale/yuv2rgb: Use 64bit for brightness computation
This will not overflow for normal values
Fixes: CID1500280 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:06 +02:00
Michael Niedermayer 3f9daf1c18 swscale/x86/swscale: use a clearer name for INPUT_PLANER_RGB_A_FUNC_CASE
related: CID1497114 Missing break in switch

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:06 +02:00
Michael Niedermayer e3481730ed avutil/tests/opt: Check av_set_options_string() for failure
This is test code after all so it should test things

Fixes: CID1518990 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:05 +02:00
Michael Niedermayer e8a1e1899d avutil/tests/dict: Check av_dict_set() before get for failure
Failure is possible due to strdup()

Fixes: CID1516764 Dereference null return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:05 +02:00
Michael Niedermayer 87846f64b5 avutil/random_seed: Avoid dead returns
Fixes: CID1538296 Structurally dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:05 +02:00
Michael Niedermayer c4004605b2 avdevice/dshow: fix badly indented line
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:04 +02:00
Michael Niedermayer c841cb45e8 qsv: Initialize impl_value
Fixes: The warnings from CID1598553 Uninitialized scalar variable

Passing partly initialized structs is ugly and asking for hard to rieproduce bugs,
The uninitialized fields where not used

Reviewed-by: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org>
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:04 +02:00
Michael Niedermayer 3c1915d776 avformat/hlsenc: Remove dead ret stores
Fixes: CID1529222 Unused value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:04 +02:00
Michael Niedermayer 33da5f4e27 avformat/demux: resurrect dead stores
Fixes: CID1473512 Unused value
Fixes: CID1529228 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:03 +02:00
Michael Niedermayer e7775973f0 avcodec/tests/bitstream_template: Assert bits_init8() return
Helps: CID1518967 Unchecked return value
Helps: CID1518968 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:03 +02:00
Michael Niedermayer b6fa2ed77e tools/enc_recon_frame_test: Assert that av_image_get_linesize() succeeds
Helps: CID1524598 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:03 +02:00
Marton Balint ed927f2f0c fftools/ffplay: allow unused format options which are also codec options
Same as it is handled in ffmpeg, allows using -ch_layout codec option.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-27 21:46:47 +02:00
Marton Balint 4d97557137 fftools/ffplay: use cmdutils code for checking remaining avoptions
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-27 21:46:47 +02:00
Marton Balint f9810be5d3 fftools: move check_avoptions and remove_avoptions to cmdutils
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-27 21:46:47 +02:00
Marton Balint 169b6ee732 doc/ffmpeg: document -channel_layout/ch_layout options
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-27 21:46:47 +02:00
Marton Balint 4bfecde9b9 fftools/ffmpeg_demux: honor -ch_layout options for overriding input stream channel layout
The code only set the channel layout of the AVFormatContext, so the user could
not override the channel layout if the demuxer did not have such parameter.

This used to work via the respective AVCodecContext option, but since
639c2f0049 it no longer gets passed to the
decoders. It is actually better if we set it manually, instead of using the
codec option because that way we can also override it on the stream level, so
it will also work for stream copy or bitstream filtering.

We don't allow changing the number of channels, because that can cause
unexpected results. We disable layout guessing, if a channel layout is
specified.

Fixes ticket #11016.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-27 21:46:47 +02:00
Rémi Denis-Courmont 44f7f6e010 checkasm: add h263dsp.{h,v}_loop_filter 2024-05-27 22:42:07 +03:00
Rémi Denis-Courmont a535ce2ac0 lavc/flacdsp: R-V Zvl256b lpc33
flac_lpc_33_13_c: 499.7
flac_lpc_33_13_rvv_i64: 197.7
flac_lpc_33_16_c: 601.5
flac_lpc_33_16_rvv_i64: 195.2
flac_lpc_33_29_c: 1011.5
flac_lpc_33_29_rvv_i64: 300.7
flac_lpc_33_32_c: 1099.0
flac_lpc_33_32_rvv_i64: 296.7
2024-05-27 22:07:29 +03:00
Rémi Denis-Courmont 5ebb071d79 lavc/vp8dsp: disable EPEL HV on RV128
RV128 is mostly scifi at this point, so we can just disable it here
(the EPEL HV prologue/epilogue do not save 128-bit registers).
2024-05-27 22:07:29 +03:00
Diego Felix de Souza aead61451c avcodec/nvenc_av1: Correct CQ range for AV1
The Constant Quality (CQ) range for the AV1 codec is actually 0 to
63, contrary to what is stated in the header and documentation.

Signed-off-by: Diego Felix de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-05-27 19:20:18 +02:00
Andreas Rheinhardt 41e1322845 tests/fate/source-check: Relax BSD licence check
Several files already had standard license header (namely
2-clause BSD files), yet due to the 80 char line length limit,
they were not treated as such by source-check.sh (which
fate-source uses). Therefore relax the BSD check.

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-27 19:04:09 +02:00
Andreas Rheinhardt f1337e5dd9 doc/mips: Update list of files with MIPS copyright notice
E.g. the AAC stuff has been removed in
03cf101645.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-27 19:04:08 +02:00
Frank Plowman 49c3918c1a lavc/vvc: Validate temporal MVP references
Per VVCv3 p. 157, the collocated reference picture used in temporal
motion vector prediction must have RprConstraintsActiveFlag equal to
zero and the same CTU size as the current picture.  Add these checks,
fixing crashes decoding some fuzzed bitstreams.

Additionally, only set up the collocated reference picture if it is
actually going to be used (i.e. if ph_temporal_mvp_enabled_flag is 1),
else legal RPR bitstreams will fail the new checks.

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-05-27 20:24:21 +08:00
llyyr 2b11a8b95b lavc/vp9: reset segmentation fields when segmentation isn't enabled
Fields under the segmentation switch are never reset on a new frame, and
retain the value from the previous frame. This bugs out a bunch of
hwaccel drivers when segmentation is disabled but update_map isn't
reset because they don't ignore values behind switches. This commit also
resets the temporal field, though it may not be required.

We also do this for vp8 [1] so this commit is just mirroring the vp8
logic.

This fixes an issue with certain samples [2] that causes blocky
artifacts with vaapi, d3d11va and cuda (and possibly others).
Mesa worked around [3] this by ignoring these fields if
segmentation.enabled is 0, but d3d11va still displays blocky artifacts.

[1] https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/2e877090f958131accb8c7e5ac10e5b9865d1735:/libavcodec/vp8.c#l797
[2] https://github.com/mpv-player/mpv/issues/13533
[3] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27816

Signed-off-by: llyyr <llyyr.public@gmail.com>
2024-05-27 12:23:40 +02:00
Fei Wang 01c7f68f7a lavc/qsvdec: Use coded_w/h for frame resolution when use system memory
Fix output mismatch when decode clip with crop(conf_win_*offset in
syntax) info by using system memory:

$ ffmpeg -c:v hevc_qsv -i conf_win_offet.bit -y out.yuv

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-05-27 09:38:46 +08:00
Fei Wang 1c56263704 lavc/qsvdec: Allow decoders to export crop information
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-05-27 09:38:46 +08:00
Haihao Xiang a72e9aeabc lavc/qsvenc_av1: accept HDR metadata if have
The sdk av1 encoder can accept HDR metadata via mfxEncodeCtrl::ExtParam.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-27 09:38:46 +08:00
Haihao Xiang 473e84ad62 lavc/qsvdec: update HDR side data on output AVFrame for AV1 decoding
The SDK may provide HDR metadata for HDR streams via mfxExtBuffer
attached on output mfxFrameSurface1

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-27 09:38:46 +08:00
Brad Smith 43b1a95678 configure: enable ffnvcodec, nvenc, nvdec for FreeBSD
Signed-off-by: Brad Smith <brad@comstyle.com>
2024-05-26 19:25:51 -04:00
Rémi Denis-Courmont 25a33665a0 lavc/vp8dsp: remove unused macro parameter 2024-05-26 19:20:48 +03:00
Rémi Denis-Courmont 728a1dd3b6 lavc/rv34dsp: remove stray load immediate 2024-05-26 19:20:45 +03:00
sunyuechi 63697d3350 lavc/vp8dsp: R-V V put_epel hv
C908:
vp8_put_epel4_h4v4_c: 20.0
vp8_put_epel4_h4v4_rvv_i32: 11.0
vp8_put_epel4_h4v6_c: 25.2
vp8_put_epel4_h4v6_rvv_i32: 13.5
vp8_put_epel4_h6v4_c: 22.2
vp8_put_epel4_h6v4_rvv_i32: 14.5
vp8_put_epel4_h6v6_c: 29.0
vp8_put_epel4_h6v6_rvv_i32: 15.7
vp8_put_epel8_h4v4_c: 73.0
vp8_put_epel8_h4v4_rvv_i32: 22.2
vp8_put_epel8_h4v6_c: 90.5
vp8_put_epel8_h4v6_rvv_i32: 26.7
vp8_put_epel8_h6v4_c: 85.0
vp8_put_epel8_h6v4_rvv_i32: 27.2
vp8_put_epel8_h6v6_c: 104.7
vp8_put_epel8_h6v6_rvv_i32: 29.5
vp8_put_epel16_h4v4_c: 145.5
vp8_put_epel16_h4v4_rvv_i32: 26.5
vp8_put_epel16_h4v6_c: 190.7
vp8_put_epel16_h4v6_rvv_i32: 47.5
vp8_put_epel16_h6v4_c: 173.7
vp8_put_epel16_h6v4_rvv_i32: 33.2
vp8_put_epel16_h6v6_c: 222.2
vp8_put_epel16_h6v6_rvv_i32: 35.5

Amended to disable unsupported RV128.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-26 15:15:28 +03:00
Rémi Denis-Courmont 0b2316e37f lavc/sbrdsp: fix inverted boundary check
128-bit is the maximum, not the minimum here. Larger vector sizes can
result in reads past the end of the noise value table.

This partially reverts commit cdcb4b98b7.
2024-05-25 22:03:37 +03:00
Rémi Denis-Courmont e6b38c944f lavc/sbrdsp: fix potential overflow in noise table
Since the SBR noise application optimisations are currently restricted
to hardware with 128-bit vectors, and use a quadruple multipler, they
can load up to 16 32-bit elements. But the "loads" are of 2 segments,
or 16 pairs of single precision float.

Thus we need to expand the dupiclated section of the noise table from
2x8 to 2x16 to avoid overflows.
2024-05-25 22:00:18 +03:00
Andreas Rheinhardt e9197db4f7 tests/checkasm/vvc_alf: Don't use declare_func_emms
VVC does not have MMX code at all, so one can use the stricter
declare_func to also check that the MMX state has not been clobbered
with (which would be an ABI violation).

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 14:21:54 +02:00
Andreas Rheinhardt 8e27bd025f avformat/async,cache: Use more unique context names
Otherwise Doxygen thinks any text like "Context for foo"
is a link to the async protocol's struct called "Context".

Reported-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:52:19 +02:00
Andreas Rheinhardt edc235e076 avformat/riffenc: Fix outdated comment
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:52:05 +02:00
Andreas Rheinhardt 50c25d1f0a avformat/matroskaenc: Check ff_put_wav_header() failure
Fixes Coverity issue #1506706.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:58 +02:00
Andreas Rheinhardt 65763bffb6 avformat/mpegts: Don't use uninitialized value in av_log()
It is undefined behaviour in (at least) C11 (see C11 6.3.2.1 (2)).
Fixes Coverity issue #1500314.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt d8cad01805 avformat/dhav: Check amount read
Prevents potential use of uninitialized data in the following
memcmp().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt cf6d07522a avformat/dhav: Check ffio_ensure_seekback()
Fixes Coverity issue #1492324.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt 95faf45af1 avformat/qoadec: Check ffio_ensure_seekback()
Fixes Coverity issue #1598406.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt 6dc8d4eea8 avformat/westwood_vqa: Check ffio_ensure_seekback()
Fixes Coverity issue #1598405.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt 590fffe6ad avformat/gifdec: Check ffio_ensure_seekback()
Fixes Coverity issue #1598400.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt b47116be45 avformat/oggdec: Check ffio_ensure_seekback()
Fixes Coverity issue #1492327.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Rémi Denis-Courmont f883746587 lavc/flacdsp: do not assume maximum R-V VL
This loop correctly assumes that VLMAX=16 (4x128-bit vectors
with 32-bit elements) and 32 >= pred_order > 16. We need to alternate
between VL=16 and VL=t2=pred_order-16 elements to add up to pred_order.

The current code requests AVL=a2=pred_order elements. In QEMU and on
thte K230 hardware, this sets VL=16 as we need. But the specification
merely guarantees that we get: ceil(AVL / 2) <= VL <= VLMAX. For
instance, if pred_order equals 27, we could end up with VL=14 or VL=15
instead of VL=16. So instead, request literally VLMAX=16.
2024-05-25 10:31:50 +03:00
Andreas Rheinhardt aff24c1658 avcodec/flacdec: Remove unused variable
Forgotten in 0380a03f1f.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-24 19:05:57 +02:00
Rémi Denis-Courmont ba38d0e328 lavc/pixblockdsp: add scalar get_pixels_unaligned
The code is already there, we just need to use it.

get_pixels_unaligned_c: 2.2
get_pixels_unaligned_misaligned: 1.7
2024-05-24 17:53:43 +03:00
Rémi Denis-Courmont d03cdfa2b6 checkasm/riscv: test misaligned before V
Otherwise V functions mask scalar misaligned ones.
2024-05-24 17:53:43 +03:00
James Almer 0920f506a7 checkasm/flacdsp: add a test for lpc33
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-24 09:23:00 -03:00
James Almer 0380a03f1f avcodec/flacdsp: split off lpc33 into a dsp function
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-24 09:23:00 -03:00
James Almer 62397bcf6a avformat/movenc: add support for writing SA3D boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-23 19:06:46 -03:00
James Almer 8c97449482 avutil/channel_layout: add a helper function to get the ambisonic order of a layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-23 12:07:19 -03:00
Haihao Xiang 8155808ce6 libavcodec/x86/vvc/vvc_sad: fix assembler error
X86ASM    libavcodec/x86/vvc/vvc_sad.o
libavcodec/x86/vvc/vvc_sad.asm:85: error: invalid number of operands
libavcodec/x86/vvc/vvc_sad.asm:87: error: invalid number of operands

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-23 09:12:50 -03:00
Andreas Rheinhardt ece95dc3dc avfilter/af_atempo: Fix indentation
Forgotten after b8f74ee57a.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-23 10:45:55 +02:00
Andreas Rheinhardt 42e0e05834 avfilter/af_atempo: Simplify resetting
The earlier code distinguished between a partial reset
(yae_clear()) and a complete reset (yae_release_buffers()
which also releases the buffers); this separation existed
to avoid allocations, as buffers were reallocated on reconfigs.

Yet it is pointless since a5704659e3,
so simply use yae_release_buffers() everywhere.

Reviewed-by: Pavel Koshevoy <pkoshevoy@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-23 10:45:25 +02:00
Andreas Rheinhardt 35e7fa0a2e avfilter/af_atempo: Properly check av_tx_init()
Fixes Coverity issue #1516804.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-23 10:45:16 +02:00
Stone Chen 2e877090f9 tests/checkasm: Add check_vvc_sad to vvc_mc.c
Adds checkasm for DMVR SAD AVX2 implementation.

Benchmarks ( AMD 7940HS )
vvc_sad_8x8_c: 50.3
vvc_sad_8x8_avx2: 0.3
vvc_sad_16x16_c: 250.3
vvc_sad_16x16_avx2: 10.3
vvc_sad_32x32_c: 1020.3
vvc_sad_32x32_avx2: 60.3
vvc_sad_64x64_c: 3850.3
vvc_sad_64x64_avx2: 220.3
vvc_sad_128x128_c: 14100.3
vvc_sad_128x128_avx2: 840.3

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 20:36:46 -03:00
Stone Chen 0e52a4e434 libavcodec/x86/vvc: Add AVX2 DMVR SAD functions for VVC
Implements AVX2 DMVR (decoder-side motion vector refinement) SAD functions. DMVR SAD is only calculated if w >= 8, h >= 8, and w * h > 128. To reduce complexity, SAD is only calculated on even rows. This is calculated for all video bitdepths, but the values passed to the function are always 16bit (even if the original video bitdepth is 8). The AVX2 implementation uses min/max/sub.

Additionally this changes parameters dx and dy from int to intptr_t. This allows dx & dy to be used as pointer offsets without needing to use movsxd.

Benchmarks ( AMD 7940HS )
Before:
BQTerrace_1920x1080_60_10_420_22_RA.vvc | 106.0 |
Chimera_8bit_1080P_1000_frames.vvc | 204.3 |
NovosobornayaSquare_1920x1080.bin | 197.3 |
RitualDance_1920x1080_60_10_420_37_RA.266 | 174.0 |

After:
BQTerrace_1920x1080_60_10_420_22_RA.vvc | 109.3 |
Chimera_8bit_1080P_1000_frames.vvc | 216.0 |
NovosobornayaSquare_1920x1080.bin | 204.0|
RitualDance_1920x1080_60_10_420_37_RA.266 | 181.7 |

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 20:36:21 -03:00
James Almer 3146b77a7d avformat/mov: store sample_sizes as unsigned ints
As defined in Section 8.7.3.2.1 of ISO 14496-12.
Any unsupported value will be rejected in mov_build_index() without outright
aborting demuxing.

Fixes ticket #11005.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 17:46:49 -03:00
James Almer 2d84ee3745 avformat/vvc: fix parsing sps_subpic_id
The length of the sps_subpic_id[i] syntax element is sps_subpic_id_len_minus1 + 1 bits.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 17:46:49 -03:00
James Almer 3bd7e3a336 avformat/vvc: initialize some ptl flags
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 17:46:49 -03:00
Rémi Denis-Courmont 910d281b21 lavc/h263dsp: R-V V {h,v}_loop_filter
Since the horizontal and vertical filters are identical except for a
transposition, this uses a common subprocedure with an ad-hoc ABI.
To preserve return-address stack prediction, a link register has to be
used (c.f. the "Control Transfer Instructions" from the
RISC-V ISA Manual). The alternate/temporary link register T0 is used
here, so that the normal RA is preserved (something Arm cannot do!).

To load the strength value based on `qscale`, the shortest possible
and PIC-compatible sequence is used: AUIPC; ADD; LBU. The classic
LLA; ADD; LBU sequence would add one more instruction since LLA is a
convenience alias for AUIPC; ADDI. To ensure that this trick works,
relocation relaxation is disabled.

To implement the two signed divisions by a power of two toward zero:
 (x / (1 << SHIFT))
the code relies on the small range of integers involved, computing:
 (x + (x >> (16 - SHIFT))) >> SHIFT
rather than the more general:
 (x + ((x >> (16 - 1)) & ((1 << SHIFT) - 1))) >> SHIFT
Thus one ANDI instruction is avoided.

T-Head C908:
h263dsp.h_loop_filter_c:       228.2
h263dsp.h_loop_filter_rvv_i32: 144.0
h263dsp.v_loop_filter_c:       242.7
h263dsp.v_loop_filter_rvv_i32: 114.0
(C is probably worse in real use due to less predictible branches.)
2024-05-22 19:15:39 +03:00
James Almer 3d1597d3e2 x86/vvc_alf: use the x86inc instruction macros
Let its magic figure out the correct mnemonic based on target instruction set.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 20:51:30 +08:00
llyyr d1b96c3808 avformat/mov: avoid seeking back to 0 on HEVC open GOP files
ab77b878f1 attempted to fix the issue of broken packets being sent to
the decoder by implementing logic that kept attempting to PTS-step
backwards until it reached a valid point, however applying this
heuristic meant that in files that had no valid points (such as HEVC
videos shot on iPhones), we'd seek back to sample 0 on every seek
attempt. This meant that files that were previously seekable, albeit
with some skipped frames, were not seekable at all now.

Relax this heuristic a bit by giving up on seeking to a valid point if
we've tried a different sample and we still don't have a valid point to
seek to. This may some frames to be skipped on seeking but it's better
than not being able to seek at all in such files.

Fixes: ab77b878f1 ("avformat/mov: fix seeking with HEVC open GOP files")
Fixes: #10585
Signed-off-by: Philip Langdale <philipl@overt.org>
2024-05-21 18:57:44 -07:00
sunyuechi 0c1304ae11 lavc/vp9dsp: R-V V mc avg
C908:
vp9_avg4_8bpp_c: 1.2
vp9_avg4_8bpp_rvv_i64: 1.0
vp9_avg8_8bpp_c: 3.7
vp9_avg8_8bpp_rvv_i64: 1.5
vp9_avg16_8bpp_c: 14.7
vp9_avg16_8bpp_rvv_i64: 3.5
vp9_avg32_8bpp_c: 57.7
vp9_avg32_8bpp_rvv_i64: 10.0
vp9_avg64_8bpp_c: 229.0
vp9_avg64_8bpp_rvv_i64: 31.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-21 21:28:14 +03:00
Rémi Denis-Courmont 7591eb4055 Revert "lavc/sbrdsp: R-V V neg_odd_64"
While this function can easily be written with vectors, it just fails to
get any performance improvement.

For reference, this is a simpler loop-free implementation that does get
better performance than the current one depending on hardware, but still
more or less the same metrics as the C code:

 func ff_sbr_neg_odd_64_rvv, zve64x
         li      a1, 32
         addi    a0, a0, 7
         li      t0, 8
         vsetvli zero, a1, e8, m2, ta, ma
         li      t1, 0x80
         vlse8.v v8, (a0), t0
         vxor.vx v8, v8, t1
         vsse8.v v8, (a0), t0
         ret
 endfunc

This reverts commit d06fd18f8f.
2024-05-21 21:26:39 +03:00
Rémi Denis-Courmont d452db8410 lavc/vc1dsp: R-V V vc1_unescape_buffer
Notes:
- The loop is biased toward no unescaped bytes as that should be most common.
- The input byte array is slid rather than the (8 times smaller) bit-mask,
  as RISC-V V does not provide a bit-mask (or bit-wise) slide instruction.
- There are two comparisons with 0 per iteration, for the same reason.
- In case of match, bytes are copied until the first match, and the loop is
  restarted after the escape byte. Vector compression (vcompress.vm) could
  discard all escape bytes but that is slower if escape bytes are rare.

Further optimisations should be possible, e.g.:
- processing 2 bytes fewer per iteration to get rid of a 2 slides,
- taking a short cut if the input vector contains less than 2 zeroes.
But this is a good starting point:

T-Head C908:
vc1dsp.vc1_unescape_buffer_c:      12749.5
vc1dsp.vc1_unescape_buffer_rvv_i32: 6009.0

SpacemiT X60:
vc1dsp.vc1_unescape_buffer_c:      11038.0
vc1dsp.vc1_unescape_buffer_rvv_i32: 2061.0
2024-05-21 21:16:30 +03:00
Martin Storsjö 6093367147 checkasm: h264dsp: Avoid out of buffer writes when benchmarking
The loop filters can write before the pointer given to them;
the actual test invocations correctly used an offset, while
the benchmark calls were lacking an offset. Therefore, when
running with benchmarking, these tests could have spurious
failures.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-05-21 19:20:06 +03:00
Lynne d43e123837 checkasm: print bench runs when benchmarking
Helps make sense of the possible noise in the results.
2024-05-21 17:48:48 +02:00
J. Dekker b1adf6d1d0 checkasm: add runs argument to adjust during bench
Some timers on certain device and test combinations can produce noisy
results, affecting the reliability of performance measurements. One
notable example of this is the Canaan K230 RISC-V development board.

An option to adjust the number of samples by an exponent (--runs) has
been added, allowing developers to increase the sample count for more
reliable results.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-05-21 16:47:45 +02:00
Martin Storsjö a9dc7dd7fd checkasm: vvc_alf: Limit benchmarking to a reasonable subset of functions
Don't benchmark every single combination of widths and heights;
only benchmark cases which are squares (like in vvc_mc.c).

Contrary to vvc_mc, which increases sizes by doubling dimensions,
vvc_alf tests all sizes in increments of 4. Limit benchmarking to
the cases which are powers of two.

This reduces the number of benchmarked cases from 3072 down to 18.
2024-05-21 20:20:50 +08:00
Nuo Mi b8eb8b4f19 Changelog: add DVB compatible information for VVC decoder
see https://dvb.org/specifications/verification-validation/vvc-test-content/
2024-05-21 20:20:25 +08:00
Nuo Mi 1b33c9a50a avcodec/vvcdec: support Reference Picture Resampling
passed clips:
    RPR_A_Alibaba_4.bit
    RPR_B_Alibaba_3.bit
    RPR_C_Alibaba_3.bit
    RPR_D_Qualcomm_1.bit
    VVC_HDR_UHDTV1_OpenGOP_Max3840x2160_50fps_HLG10_res_change_with_RPR.ts
2024-05-21 20:20:25 +08:00
Nuo Mi cae0b01282 avcodec/vvcdec: increase edge_emu_buffer for RPR 2024-05-21 20:20:25 +08:00
Nuo Mi 7904ec2d34 avcodec/vvcdec: refact, remove hf_idx and vf_idx from mc_xxx's param list 2024-05-21 20:20:25 +08:00
Nuo Mi 77d971c348 avcodec/vvcdec: refact out luma_prof from luma_prof_bi 2024-05-21 20:20:25 +08:00
Nuo Mi ac4575594f avcodec/vvcdec: fix dmvr, bdof, cb_prof for RPR 2024-05-21 20:20:25 +08:00
Nuo Mi 77acd0a0dd avcodec/vvcdec: inter, wait reference with a different resolution
For RPR, the current frame may reference a frame with a different resolution.
Therefore, we need to consider frame scaling when we wait for reference pixels.
2024-05-21 20:20:25 +08:00
Nuo Mi deda59a996 avcodec/vvcdec: add RPR dsp 2024-05-21 20:20:25 +08:00
Nuo Mi e70225e0a8 avcodec/vvcdec: emulated_edge, use reference frame's sps and pps
a preparation for Reference Picture Resampling
2024-05-21 20:20:25 +08:00
Nuo Mi aa8d5c6e7e avcodec/vvcdec: add vvc inter filters for RPR 2024-05-21 20:20:25 +08:00
Nuo Mi 08ad51ece6 avcodec/vvcdec: refact, pred_get_refs return VVCRefPic instead of VVCFrame 2024-05-21 20:20:25 +08:00
Nuo Mi 66c6bee061 avcodec/vvcdec: refact out VVCRefPic from RefPicList 2024-05-21 20:20:25 +08:00
Nuo Mi 44bbafb69f avcodec/vvcdec: refact, unify pred_regular_{luma, chroma} to pred_regular 2024-05-21 20:20:25 +08:00
Nuo Mi 875fa9692c avcodec/vvcdec: misc, remove unused EMULATED_EDGE_{LUMA, CHROMA}, EMULATED_EDGE_DMVR_{LUAM, CHROMA} 2024-05-21 20:20:25 +08:00
Nuo Mi 84a93d91d1 avcodec/vvcdec: refact, unify {luma, chroma}_mc_bi to mc_bi 2024-05-21 20:20:25 +08:00
Nuo Mi 6769fe1614 avcodec/vvcdec: refact, unify {luma, chroma}_mc_uni to mc_uni 2024-05-21 20:20:25 +08:00
Nuo Mi bc099afc8d avcodec/vvcdec: refact, unify {luma, chroma}_mc to mc 2024-05-21 20:20:25 +08:00
Nuo Mi 1289da9244 avcodec/vvcdec: misc, inter, use is_chroma instead of is_luma 2024-05-21 20:20:25 +08:00
Zhao Zhili 553c572204 avfilter/vf_dnn_detect: Fix null pointer dereference
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-05-21 18:17:07 +08:00
David Rosca f7a1453f27 lavc/vaapi_decode: Reject decoding of frames with no slices
Matches other hwaccels.
2024-05-21 16:57:46 +08:00
oltolm 45d31614bc avutil/hwcontext_qsv: fix GCC 14.1 warnings
Tested-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: oltolm <oleg.tolmatcev@gmail.com>
2024-05-21 16:57:46 +08:00
Andreas Rheinhardt 9a74581234 avfilter/vf_signalstats: Reindent after the previous commit
Also use loop scope for iterators while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-21 08:56:52 +02:00
Andreas Rheinhardt 48c0cce83d avfilter/vf_signalstats: Deduplicate <= 8 and > 8 bit code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-21 08:56:52 +02:00
Andreas Rheinhardt f2dac83628 avfilter/vf_signalstats: Use av_dict_set_int() where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-21 08:56:52 +02:00
Marton Balint 49e018d6fe avformat/mp3dec: change bogus error message if read_header encounters EOF
Because of ffio_ensure_seekback() a seek error normally should only happen if
the end of file is reached during checking for the junk run-in. Also use proper
error code.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-21 08:28:09 +02:00
Marton Balint b75e604fe5 avformat/mp3dec: simplify inner frame size check in mp3_read_header
We are protecting the checked buffer with ffio_ensure_seekback(), so if the
inner check fails with a seek error, that likely means the end of file was
reached when checking for the next frame. This could also be the result of a
wrongly guessed (larger than normal) frame size, so let's continue the loop
instead of breaking out early. It will end sooner or later anyway.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-21 08:28:09 +02:00
Marton Balint b005317219 avformat/mp3dec: only call ffio_ensure_seekback once
Otherwise the subsequent ffio_ensure_seekback calls destroy the buffer of the
earlier. The worst case ~66kB seekback is so small it is easier to request it
entirely.

Fixes ticket #10837, a regression since
0d17f5228f.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-21 08:28:09 +02:00
LuMingYin 3f691c0c6a libavfilter/vf_curves: fix a memory leak on error path
Signed-off-by: LuMingYin <lumingyindetect@163.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-05-20 23:57:45 +08:00
LuMingYin 14f9e47314 libavformat/rtsp: fix a memory leak on error path
Signed-off-by: LuMingYin <lumingyindetect@163.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-05-20 23:57:05 +08:00
LuMingYin 9481b7d932 libavformat/hlsenc: fix a memory leak on error path
Signed-off-by: LuMingYin <lumingyindetect@163.com>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-05-20 23:56:58 +08:00
James Almer b113050d96 avcodec/cbs_h266: read vps_ptl_max_tid before using it
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-20 10:29:30 -03:00
Andreas Rheinhardt 0d7430d3ab avfilter/vf_v360: Add assert to suppress Coverity false positives
Should fix many Coverity false positives, namely #1457947-#1457994
as well as #1461195-#146210.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:16:39 +02:00
Andreas Rheinhardt 2c94b1bbf1 avcodec/tiff: Fix leak on error
Fixes Coverity issue #1516957.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:15:48 +02:00
Andreas Rheinhardt 62929f40ee fftools/ffmpeg_filter: Fix leak on error
Do this by attaching the FilterGraph directly to more permanent
storage from which it will be automatically freed.
Fixes Coverity issue #1596533.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:15:23 +02:00
Andreas Rheinhardt b50c5d0290 avformat/flacdec: Reorder allocations to avoid leak on error
Fixes Coverity issue #1591795.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:15:18 +02:00
Andreas Rheinhardt 59b1838e09 avcodec/ac3enc: Move transient PutBitContext to stack
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:11:25 +02:00
Andreas Rheinhardt e863cbceae avcodec/ac3enc_template: Avoid always-true check
This might also help Coverity with issue #1596532.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:11:03 +02:00
Andreas Rheinhardt f3d206d25f fftools, avfilter, avformat: Simplify check for "is dictionary empty?"
Reviewed-by: epirat07@gmail.com
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 13:52:41 +02:00
Andreas Rheinhardt 482afe8f3f avcodec/lib*, avformat/tee: Simplify iterating over AVDictionary
Reviewed-by: epirat07@gmail.com
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 13:51:55 +02:00
Andreas Rheinhardt ce22e7ab28 avformat/tee: Use smaller scope for variables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 13:49:58 +02:00
Andreas Rheinhardt 26f3e79114 avformat/tee: Constify AVDictionaryEntry* pointee where possible
This is in preparation for using av_dict_iterate().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 13:33:38 +02:00
Andreas Rheinhardt 583c3d45fa avformat/tls_openssl: #if ff_openssl_init/deinit() away if possible
These functions do nothing useful when used with a non-ancient
version of openssl (namely 1.1.0 or above).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 12:37:42 +02:00
Andreas Rheinhardt 8b48b0adab avformat/utils: Use static mutexes instead of ff_lock_avformat()
Its existence is a remnant of (libavcodec's) lock-manager API
which has been removed in a04c2c707d.
There is no need to use the same lock for avisynth, chromaprint
or tls, so switch to ordinary static mutexes instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 12:28:28 +02:00
Andreas Rheinhardt a2874c5721 avcodec/aac_ac3_parser: Use ff_adts_header_parse_buf()
instead of avpriv_adts_header_parse(). Using the former avoids
an indirection.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 12:06:50 +02:00
Andreas Rheinhardt 12ded9cd85 avcodec/adts_header: Add ff_adts_header_parse_buf()
Most users of ff_adts_header_parse() don't already have
an opened GetBitContext for the header, so add a convenience
function for them.
Also use a forward declaration of GetBitContext in adts_header.h
as this avoids (implicit) inclusion of get_bits.h in some of
the users that now no longer use a GetBitContext of their own.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 12:06:31 +02:00
Andreas Rheinhardt ae937c4902 avcodec/aac_ac3_parser: Untangle AAC and AC3 parsing error codes
Also remove the (unused) AAC_AC3_PARSE_ERROR_CHANNEL_CFG while at it;
furthermore, fix the documentation of ff_ac3_parse_header()
and (ff|avpriv)_adts_header_parse().

Reviewed-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 11:58:07 +02:00
Andreas Rheinhardt 6c812a80dd avcodec/adts_parser: Don't presume buffer to be padded
The documentation of av_adts_header_parse() does not require
the buffer to be padded at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 11:48:03 +02:00
Haihao Xiang 127ded5078 lavfi/qsvvpp: require a dynamic frame pool for output if possible
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang 5646285f76 lavfi/qsvvpp: use the right mfxFrameInfo when dynamic frame pool is used
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang a00cfc6c24 lavc/qsvdec: require a dynamic frame pool if possible
This allows a downstream element stores more frames from qsv decoders
and fixes error in get_buffer().

$ ffmpeg -hwaccel qsv -hwaccel_output_format qsv -i input.mp4 -vf
reverse -f null -

[vist#0:0/h264 @ 0x562248f12c50] Decoding error: Cannot allocate memory
[h264_qsv @ 0x562248f66b10] get_buffer() failed

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang 75015f9b0e lavc/qsvenc: use the right info for encoding
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang cda721e01d lavc/qsv: fix the mfx allocator to support dynamic frame pool
When the external allocator is used for dynamic frame allocation, only
video memory is supported, the SDK doesn't lock/unlock the memory block
via Lock()/Unlock() calls.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang d3cc5ead42 lavu/hwcontext_qsv: add support for dynamic frame pool in qsv_map_to
Make it work with the source which has a dynamic frame pool.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang 932f78c4e5 lavu/hwcontext_qsv: add support for dynamic frame pool in qsv_frames_derive_to
Make it work with the source which has a dynamic frame pool.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang 96db4a62e0 lavu/hwcontext_qsv: create dynamic frame pool if required
When AVHWFramesContext.initial_pool_size is 0, a dynamic frame pool is
required. We may support this under certain conditions, e.g. oneVPL 2.9+
support dynamic frame allocation, we needn't provide a fixed frame pool
in the mfxFrameAllocator.Alloc callback.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang 4c0bb7d4a9 lavu/hwcontext_qsv: update AVQSVFramesContext to support dynamic frame pool
Add AVQSVFramesContext.info and update the description.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:48 +08:00
Haihao Xiang 3178c99fa9 lavu/version: fix minor version
The latest version should be 59.18.100 since commit 01c5f4ad

$ git diff 01c5f4ad~1..HEAD doc/APIchanges
...
+2024-05-10 - xxxxxxxxx - lavu 59.18.100 - cpu.h
+  Add AV_CPU_FLAG_RV_ZVBB.
+

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:24:44 +08:00
Andreas Rheinhardt d7fdd502d6 tests/ref/fate/source: Add exceptions for riscv startcode files
Fixes fate-source.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 00:08:51 +02:00
Michael Niedermayer e35fe3d8b9 avcodec/mscc & mwsc: Check loop counts before use
This could cause timeouts

Fixes: CID1439568 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:14:39 +02:00
Michael Niedermayer b6b2b01025 avcodec/mpegvideo_enc: Fix potential overflow in RD
Fixes: CID1500285 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:14:38 +02:00
Michael Niedermayer 8fc649b931 avcodec/mpeg4videodec: assert impossible wrap points
Helps: CID1473517 Uninitialized scalar variable
Helps: CID1473497 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:14:37 +02:00
Michael Niedermayer 4c725df059 avcodec/mpeg12dec: Use 64bit in bit computation
I dont think this can actually overflow but 64bit seems reasonable to use

Fixes: CID1521983 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:14:37 +02:00
Michael Niedermayer 6a9302739f avcodec/vqcdec: Check init_get_bits8() for failure
Fixes: CID1516090 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:55 +02:00
Michael Niedermayer 4a8506c794 avcodec/vvc/dec: Check init_get_bits8() for failure
Fixes: CID1560042 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:55 +02:00
Michael Niedermayer dd5379db5d avcodec/vble: Check av_image_get_buffer_size() for failure
Fixes: CID1461482 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Reviewed-.by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:54 +02:00
Michael Niedermayer 1b991e77b9 avcodec/vp3: Replace check by assert
Fixes: CID1452425 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:54 +02:00
Michael Niedermayer 63feed1519 avcodec/vp8: Forward return of ff_vpx_init_range_decoder()
Fixes: CID1507483 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:54 +02:00
Andrea Mastroberti 90ce54804a avfilter/smartblur: Added alpha layer support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:53 +02:00
Rémi Denis-Courmont 463c573e6b lavc/huffyuvdsp: optimise RVV vtype for add_hfyu_left_pred_bgr32
T-Head C908:
add_hfyu_left_pred_bgr32_c:       237.5
add_hfyu_left_pred_bgr32_rvv_i32: 173.5 (before)
add_hfyu_left_pred_bgr32_rvv_i32: 110.0 (after)
2024-05-19 18:37:33 +03:00
Rémi Denis-Courmont 233066e85a lavc/flacdsp: optimise RVV vector type for lpc32
This is pretty much the same as for lpc16, though it only improves half
as large prediction orders. With 128-bit vectors, this gives:

   C      V old  V new
1   69.2  181.5   95.5
2  107.7  180.7   95.2
3  145.5  180.0  103.5
4  183.0  179.2  102.7
5  220.7  178.5  128.0
6  257.7  194.0  127.5
7  294.5  193.7  126.7
8  331.0  193.0  126.5

Larger prediction orders see no significant changes at that size.
2024-05-19 18:37:33 +03:00
Rémi Denis-Courmont 6ab4b92e82 lavc/flacdsp: optimise RVV vector type for lpc16
This calculates the optimal vector type value at run-time based on the
hardware vector length and the FLAC LPC prediction order. In this
particular case, the additional computation is easily amortised over
the loop iterations:

T-Head C908:
    C     V before  V after
 1   48.0    214.7     95.2
 2   64.7    214.2     94.7
 3   79.7    213.5     94.5
 4   96.2    196.5     94.2 #
 5  111.0    195.7    118.5
 6  127.0    211.2    102.0
 7  143.7    194.2    101.5
 8  175.7    193.2    101.2 #
 9  176.2    224.2    126.0
10  191.5    192.0    125.5
11  224.5    191.2    124.7
12  223.0    190.2    124.2
13  239.2    189.5    123.7
14  253.7    188.7    139.5
15  286.2    188.0    122.7
16  284.0    187.0    122.5 #
17  300.2    186.5    186.5
18  314.0    185.5    185.7
19  329.7    184.7    185.0
20  343.0    184.2    184.2
21  358.7    199.2    183.7
22  371.7    182.7    182.7
23  387.5    181.7    182.0
24  400.7    181.0    181.2
25  431.5    180.2    196.5
26  443.7    195.5    196.0
27  459.0    178.7    196.2
28  470.7    177.7    194.2
29  470.0    177.0    193.5
30  481.2    176.2    176.5
31  496.2    175.5    175.7
32  507.2    174.7    191.0 #

 # Power of two boundary.

With 128-bit vectors, improvements are expected for the first two
test cases only. For the other two, there is overhead but below noise.
Improvements should be better observable with prediction order of 8
and less, or on hardware with larger vector sizes.
2024-05-19 18:37:33 +03:00
Rémi Denis-Courmont ee1526c05f lavu/riscv: add assembler macros for adjusting vector LMUL
vtype_vli computes the VTYPE value with the optimal LMUL for a given
element width, tail and mask policies and a run-time vector length.

vtype_ivli does the same, but with the compile-time constant vector
length.

vwtypei and vntypei can be used to widen or narrow a VTYPE value for
use in mixed-width vector-optimised functions.
2024-05-19 18:37:33 +03:00
Andreas Rheinhardt a7e506fcd8 avcodec/vc1_parser: Check init_get_bits8()
Addresses Coverity issue #1441935.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:49:33 +02:00
Andreas Rheinhardt 95937d6316 avcodec/codec_desc: Mark AVRN, TGQ, PhotoCD, VBN as intra-only
Also remove the then redundant assignments of AV_FRAME_FLAG_KEY,
AV_PICTURE_TYPE_I.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:40:55 +02:00
Andreas Rheinhardt 2a00d68c09 avcodec/yop: Add missing AV_CODEC_CAP_DR1
This decoder does not do anything fancy any more since
c6303f8d70 (before that,
it overwrote the frame's linesize) so that it supports
direct rendering. This effectively reverts
d3de3a16d1.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:40:43 +02:00
Andreas Rheinhardt df3cdf4c75 avcodec: Remove redundant setting of AV_FRAME_FLAG_KEY, AV_PICTURE_TYPE_I
This is done generically now.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:40:07 +02:00
Andreas Rheinhardt eee88ba0dc avcodec/decode: Set KEY flag+pict_type generically for intra-only codecs
This commit is the analog of 3f11eac757
for decoding: It sets the AV_FRAME_FLAG_KEY and (for video decoders)
also pict_type to AV_PICTURE_TYPE_I. It furthermore stops setting
audio frames as always being key frames -- it is wrong for e.g.
TrueHD/MLP. The latter also affects TAK and DFPWM.

The change already improves output for several decoders where
it has been forgotten to set e.g. pict_type like speedhq, wnv1
or tiff. The latter is the reason for the change to the exif-image-tiff
FATE test reference file.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:39:45 +02:00
Andreas Rheinhardt 41fc62f2e8 avcodec/codec_desc, jvdec: JV is not intra-only
It reuses the previous frame and does not code unchanged blocks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:39:35 +02:00
Andreas Rheinhardt 876a25027c avcodec/mlpdec: Set AV_FRAME_FLAG_KEY explicitly
It is currently always set for all audio frames, but this is
wrong (namely for MLP/TrueHD) and will be changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:39:18 +02:00
Rémi Denis-Courmont 259c639137 lavc/vp9_intra: fix another .irp use with LLVM as 2024-05-19 10:22:46 +03:00
Rémi Denis-Courmont 8cea66a73c lavc/vp9_intra: fix .irp use with LLVM as 2024-05-19 10:03:49 +03:00
Rémi Denis-Courmont cbe51ebf93 lavc/vp8dsp: fix .irp use with LLVM as 2024-05-19 10:03:49 +03:00
Rémi Denis-Courmont fa47299516 lavc/startcode: add R-V V startcode_find_candidate 2024-05-19 10:03:49 +03:00
Rémi Denis-Courmont 4ad5b9c8db lavc/startcode: add R-V Zbb startcode_find_candidate
The main loop processes 8 bytes in 5 instructions.
For comparison, the optimal plain strnlen() requires 4 instructions per
byte (6.4x worse): LBU; ADDI; BEQZ; BNE. The current libavcodec C code
involves 5 instructions per byte (8x worse). Actual benchmarks may be
slightly less favourable due to latency from ORC.B to BNE.
2024-05-19 10:03:49 +03:00
Marcus B Spencer 8b8b555de0 avformat/aacdec: strictly conform to K&R style
In the K&R style, a single-statement block does not have braces.
Edit the code to conform to this rule.

It is FFmpeg's code formatting convention to use K&R style.

Signed-off-by: Marcus B Spencer <marcus@marcusspencer.xyz>
2024-05-19 01:26:40 +02:00
James Almer 7e59f02c14 fate/lavf-container: add a test for VVC in mp4 muxing
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:30:32 -03:00
James Almer 3765305928 configure: split ISOBMFF writer helpers into a separate component
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:21:35 -03:00
James Almer 9ab8dddf1f avformat/vvc: use align_get_bits() where useful
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:21:35 -03:00
James Almer f00b23453c avformat/vvc: reduce the scope of some variables
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:21:24 -03:00
James Almer a48203d51a avformat/vvc: fix parsing some early VPS bitstream values
vps_default_ptl_dpb_hrd_max_tid_flag needs to always be set, and
vps_direct_ref_layer_flag needs to be read even when
vps_max_tid_ref_present_flag is false.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:35:27 -03:00
James Almer f121d52b35 avformat/vvc: remove duplicate struct
VVCCProfileTierLevel is the same as VVCPTLRecord since the previous commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:33:46 -03:00
James Almer cba15ca0ec avformat/vvc: generalize calculating num_bytes_constraint_info
Will be useful for when the aditional bits are supported, as well as for the
next commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:33:46 -03:00
James Almer 415dfa89e2 avformat/vvc: fix writing general_constraint_info bytes
The existing implementation was completely broken.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:33:46 -03:00
Zhao Zhili 8c21f1e3b7 avfilter/dnn: Refactor DNN parameter configuration system
This patch trying to resolve mulitiple issues related to parameter
configuration:

Firstly, each DNN filters duplicate DNN_COMMON_OPTIONS, which should
be the common options of backend.

Secondly, backend options are hidden behind the scene. It's a
AV_OPT_TYPE_STRING backend_configs for user, and parsed by each
backend. We don't know each backend support what kind of options
from the help message.

Third, DNN backends duplicate DNN_BACKEND_COMMON_OPTIONS.

Last but not the least, pass backend options via AV_OPT_TYPE_STRING
makes it hard to pass AV_OPT_TYPE_BINARY to backend, if not impossible.

This patch puts backend common options and each backend options inside
DnnContext to reduce code duplication, make options user friendly, and
easy to extend for future usecase.

For example,

./ffmpeg -h filter=dnn_processing

dnn_processing AVOptions:
   dnn_backend       <int>        ..FV....... DNN backend (from INT_MIN to INT_MAX) (default tensorflow)
     tensorflow      1            ..FV....... tensorflow backend flag
     openvino        2            ..FV....... openvino backend flag
     torch           3            ..FV....... torch backend flag

dnn_base AVOptions:
   model             <string>     ..F........ path to model file
   input             <string>     ..F........ input name of the model
   output            <string>     ..F........ output name of the model
   backend_configs   <string>     ..F.......P backend configs (deprecated)
   options           <string>     ..F.......P backend configs (deprecated)
   nireq             <int>        ..F........ number of request (from 0 to INT_MAX) (default 0)
   async             <boolean>    ..F........ use DNN async inference (default true)
   device            <string>     ..F........ device to run model

dnn_tensorflow AVOptions:
   sess_config       <string>     ..F........ config for SessionOptions

dnn_openvino AVOptions:
   batch_size        <int>        ..F........ batch size per request (from 1 to 1000) (default 1)
   input_resizable   <boolean>    ..F........ can input be resizable or not (default false)
   layout            <int>        ..F........ input layout of model (from 0 to 2) (default none)
     none            0            ..F........ none
     nchw            1            ..F........ nchw
     nhwc            2            ..F........ nhwc
   scale             <float>      ..F........ Add scale preprocess operation. Divide each element of input by specified value. (from INT_MIN to INT_MAX) (default 0)
   mean              <float>      ..F........ Add mean preprocess operation. Subtract specified value from each element of input. (from INT_MIN to INT_MAX) (default 0)

dnn_th AVOptions:
   optimize          <int>        ..F........ turn on graph executor optimization (from 0 to 1) (default 0)

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-18 19:44:50 +08:00
Brad Smith 115c96b9bd avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD
Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-05-18 07:38:40 -04:00
Aaron Thompson be3404bbac lavc/libvpxenc: Fix parsing of ts_layering_mode parameter
The value was being parsed as base 4, so the value "4" was invalid and
would result in ts_layering_mode being set to 0.

Signed-off-by: Aaron Thompson <dev@aaront.org>
Signed-off-by: James Zern <jzern@google.com>
2024-05-17 15:40:31 -07:00
James Almer 727a603158 checkasm/h264dsp: use int64_t scale values
Fixes "signed integer overflow: [varies] * 104858 cannot be represented in type 'int'" errors
under ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-17 17:04:08 -03:00
sunyuechi d521b7280c lavc/vp9dsp: R-V V ipred tm
C908:
vp9_tm_4x4_8bpp_c: 116.5
vp9_tm_4x4_8bpp_rvv_i32: 43.5
vp9_tm_8x8_8bpp_c: 416.2
vp9_tm_8x8_8bpp_rvv_i32: 86.0
vp9_tm_16x16_8bpp_c: 1665.5
vp9_tm_16x16_8bpp_rvv_i32: 187.2
vp9_tm_32x32_8bpp_c: 6974.2
vp9_tm_32x32_8bpp_rvv_i32: 625.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-17 18:12:11 +03:00
Rémi Denis-Courmont 88d973a5d6 lavc/flacdsp: R-V V flac_wasted33
T-Head C908:
flac_wasted_33_c:       786.2
flac_wasted_33_rvv_i64: 486.5
2024-05-17 18:08:04 +03:00
Andreas Rheinhardt 784672b833 tests/checkasm/sw_gbrp: Use correct function types for calls
E.g. f2de911818 forgot to
add the unused void* here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:36:03 +02:00
Andreas Rheinhardt 9126705e6e tests/checkasm/vf_blend: Update function type
Forgotten in 5b8faaad6c,
a69a0b689c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:35:33 +02:00
Andreas Rheinhardt caec57eb3a tests/checkasm/vf_bwdif: Use correct function pointer type
Forgotten in fa06f48371.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:31:37 +02:00
Andreas Rheinhardt 4c57cbda67 tests/checkasm/vf_colorspace: Use correct function pointer type
Forgotten in 9b26a8077f.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:31:23 +02:00
Andreas Rheinhardt e3de22e307 tests/checkasm/vvc_mc: Use correct function pointer type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:31:09 +02:00
Andreas Rheinhardt 6c0994864e tests/checkasm/vp8dsp: Use correct function pointer type
Forgotten in a54e53a1c4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:30:17 +02:00
Andreas Rheinhardt dcbdcc3bf5 tests/checkasm/motion: Use correct function pointer type
Forgotten in abb85429f3.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:30:06 +02:00
Andreas Rheinhardt 99135a2f8b tests/checkasm/llviddsp: Use correct function pointer type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:29:51 +02:00
Andreas Rheinhardt 631636e582 tests/checkasm/huffyuvdsp: Use correct function pointer type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:29:34 +02:00
Andreas Rheinhardt 895dd370a2 tests/checkasm/hevc_*: Fix funtion pointer types
Forgotten in b3bbbb14d0.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:28:20 +02:00
Andreas Rheinhardt dff0a1557e tests/checkasm/llauddsp: Avoid UB integer overflow
The only multiplicators used in scalarproduct_and_madd_*
are -1, 0 and +1. Yet it is of type int and the checkasm
test uses the complete range of int for it, leading to overflows
that don't happen for actual users.

Fix this by using a more reasonable range for mul: Given
that it is used in v1[i] += v3[i] * mul with v1 being
a 16bit integer, it makes no sense to use values for mul
that don't fit into 16bit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:16:58 +02:00
sunyuechi d4083ecb7c lavc/vc1dsp: R-V V mspel_pixels
C908 X60
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_c            :  14.7 13.2
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_rvv_i32      :   2.5  2.2
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_c            :   3.7  3.5
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_rvv_i64      :   1.0  1.2
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_c            :   9.0  8.0
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_rvi          :   1.0  1.0
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_c            :   2.5  2.2
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_rvi          :   0.5  0.5

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-16 17:08:18 +03:00
Rémi Denis-Courmont 7b47099bc0 lavc/flacdsp: R-V V flac_wasted32
T-Head C908:
flac_wasted_32_c:       949.0
flac_wasted_32_rvv_i32: 278.7
2024-05-15 20:04:08 +03:00
Rémi Denis-Courmont 83e5fdd3f4 lavu/riscv: fix parsing the unaligned access capability
Pointed-out-by: Stefan O'Rear <sorear@fastmail.com>
2024-05-15 20:04:08 +03:00
sunyuechi 0cc8661499 lavc/vp9dsp: R-V V ipred hor
C908:
vp9_hor_8x8_8bpp_c: 74.7
vp9_hor_8x8_8bpp_rvv_i32: 35.7
vp9_hor_16x16_8bpp_c: 175.5
vp9_hor_16x16_8bpp_rvv_i32: 80.2
vp9_hor_32x32_8bpp_c: 510.2
vp9_hor_32x32_8bpp_rvv_i32: 264.0

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-15 19:56:06 +03:00
sunyuechi b82d9f55d1 lavc/vp9dsp: R-V mc copy
C908:
vp9_put4_8bpp_c: 0.7
vp9_put4_8bpp_rvi: 0.5
vp9_put8_8bpp_c: 2.5
vp9_put8_8bpp_rvi: 0.5
vp9_put16_8bpp_c: 16.7
vp9_put16_8bpp_rvi: 1.5
vp9_put32_8bpp_c: 37.2
vp9_put32_8bpp_rvi: 5.7
vp9_put64_8bpp_c: 107.5
vp9_put64_8bpp_rvi: 21.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-15 19:52:28 +03:00
sunyuechi aa9dbd91cf lavc/vp9dsp: R-V ipred vert
C908:
vp9_vert_8x8_8bpp_c: 22.0
vp9_vert_8x8_8bpp_rvi: 15.7
vp9_vert_16x16_8bpp_c: 71.2
vp9_vert_16x16_8bpp_rvi: 39.0
vp9_vert_32x32_8bpp_c: 300.2
vp9_vert_32x32_8bpp_rvi: 135.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-15 19:52:25 +03:00
Rémi Denis-Courmont a3e45063c0 lavc/flacdsp: fix CPU requirement for 32-bit LPC 2024-05-15 19:45:07 +03:00
James Almer 8670615743 checkasm/h264dsp: add missing pixel_mask values
Fixes "runtime error: index 4 out of bounds for type 'uint32_t [3]'" errors
after commit 4ced36744e.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-14 23:17:30 -03:00
James Almer e9741f1a6b fate/checkasm: test vvc_alf
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-14 22:58:21 -03:00
Michael Niedermayer 4ed4f9a6c0 avcodec/jpeg2000dec: remove ST=3 case
Fixes: CID1460979 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-15 03:53:25 +02:00
Michael Niedermayer 8789c550fa avcodec/qsvdec: Check av_image_get_buffer_size() for failure
Fixes: CID1477406 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-15 03:53:24 +02:00
Marton Balint b0093ab8a3 avfilter/vf_geq: fix interpolation with 1 pixel width/height
Fixes ticket #9740.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-14 21:07:37 +02:00
Marton Balint 64330e365b avfilter/blend: use a per-thread AVExpr
Otherwise expression state is accessed and changed from multiple threads.

Fixes ticket #10987.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-14 21:07:37 +02:00
Marton Balint a69a0b689c avfilter/blend: put slice parameters to a single struct
This should make future extensibility easier.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-14 21:07:37 +02:00
Marton Balint 77fc047bd9 avfilter/vsrc_testsrc: do not round down width and height for color src
ff_draw_rectangle handles subsampling since 2013.

Fixes ticket #10989.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-14 21:07:37 +02:00
Rémi Denis-Courmont 20fbc07af1 lavu/riscv: remove bogus B extension
The B Bit manipulation extension was not defined to this day, and
probably never will. Instead it was broken down into Zba, Zbb, Zbc and
Zbs with no particular blessed set to make up B.

This removes the bogus field test. Linux never set this bit, nor
(AFAICT) did FreeBSD or any other OS. We can always add it back in the
unlikely event that it gets taken into use.
2024-05-14 19:50:00 +03:00
Rémi Denis-Courmont 9d3f561721 lavc/vp8dsp: restrict RVI optimisations
They are actually awfully slow if the CPU does not support misaligned
accesses natively, so only use them if misaligned accesses are fast.
2024-05-14 19:50:00 +03:00
Rémi Denis-Courmont b410439263 lavu/riscv: CPU flag for fast misaligned accesses 2024-05-14 19:50:00 +03:00
Rémi Denis-Courmont 61ec7450ff lavu/riscv: fallback to raw hwprobe() system call
Not all C run-times support this, and even then, it will be a while
before distributions provide recent enough versions thereof.

Since this is a trivial system call wrapper, we might just as well call
the corresponding kernel system call directly where the C run-time lacks
support but the kernel headers are new enough (as is the case on Debian
Unstable at the time of writing). In doing so, we need to add a few more
guards as the first suitable kernel (headers) release did not expose the
V, Zba and Zbb extensions.
2024-05-14 19:50:00 +03:00
J. Dekker 4ced36744e checkasm/h264dsp: support checking more idct depths
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-05-14 17:46:55 +02:00
J. Dekker ca583b22e4 avfilter/riscv: build afir only if required
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-05-14 17:46:19 +02:00
James Almer 14aff7e45e x86/vvc/vvcdsp_init: coalesce function initializers
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-14 11:17:54 -03:00
Wu Jianhua 3fa98f274a tests/checkasm/vvc_alf: add check_alf_classify
Perforamnce Test (fps):
clip                                      before  after delta
Tango2_3840x2160_60_10_420_27_LD.266      56      115   105.36%
RitualDance_1920x1080_60_10_420_32_LD.266 272     481   76.83%
RitualDance_1920x1080_60_10_420_37_RA.266 303     426   40.59%

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-14 19:21:35 +08:00
Wu Jianhua abf69a39b5 avcodec/x86/vvc/vvc_alf: add alf classify avx2 optimizations
vvc_alf_classify_4x4_8_c: 480.5
vvc_alf_classify_4x4_8_avx2: 203.0
vvc_alf_classify_4x4_10_c: 439.0
vvc_alf_classify_4x4_10_avx2: 171.7
vvc_alf_classify_4x8_8_c: 690.0
vvc_alf_classify_4x8_8_avx2: 267.0
vvc_alf_classify_4x8_10_c: 706.5
vvc_alf_classify_4x8_10_avx2: 215.7
vvc_alf_classify_4x12_8_c: 935.7
vvc_alf_classify_4x12_8_avx2: 377.2
vvc_alf_classify_4x12_10_c: 937.2
vvc_alf_classify_4x12_10_avx2: 330.0
vvc_alf_classify_4x16_8_c: 1216.5
vvc_alf_classify_4x16_8_avx2: 439.7
vvc_alf_classify_4x16_10_c: 1197.5
vvc_alf_classify_4x16_10_avx2: 387.0
vvc_alf_classify_4x20_8_c: 1431.0
vvc_alf_classify_4x20_8_avx2: 556.7
vvc_alf_classify_4x20_10_c: 1401.2
vvc_alf_classify_4x20_10_avx2: 472.5
vvc_alf_classify_4x24_8_c: 1650.5
vvc_alf_classify_4x24_8_avx2: 615.5
vvc_alf_classify_4x24_10_c: 1737.7
vvc_alf_classify_4x24_10_avx2: 534.7
vvc_alf_classify_4x28_8_c: 1879.2
vvc_alf_classify_4x28_8_avx2: 743.5
vvc_alf_classify_4x28_10_c: 1942.5
vvc_alf_classify_4x28_10_avx2: 622.2
vvc_alf_classify_4x32_8_c: 2119.0
vvc_alf_classify_4x32_8_avx2: 890.5
vvc_alf_classify_4x32_10_c: 2139.7
vvc_alf_classify_4x32_10_avx2: 671.2
vvc_alf_classify_4x36_8_c: 2359.5
vvc_alf_classify_4x36_8_avx2: 915.7
vvc_alf_classify_4x36_10_c: 2388.5
vvc_alf_classify_4x36_10_avx2: 774.2
vvc_alf_classify_4x40_8_c: 2601.5
vvc_alf_classify_4x40_8_avx2: 973.7
vvc_alf_classify_4x40_10_c: 2623.2
vvc_alf_classify_4x40_10_avx2: 827.0
vvc_alf_classify_4x44_8_c: 2915.5
vvc_alf_classify_4x44_8_avx2: 1092.2
vvc_alf_classify_4x44_10_c: 2859.2
vvc_alf_classify_4x44_10_avx2: 924.0
vvc_alf_classify_4x48_8_c: 3260.7
vvc_alf_classify_4x48_8_avx2: 1157.5
vvc_alf_classify_4x48_10_c: 3225.2
vvc_alf_classify_4x48_10_avx2: 1326.7
vvc_alf_classify_4x52_8_c: 3332.2
vvc_alf_classify_4x52_8_avx2: 1267.2
vvc_alf_classify_4x52_10_c: 3385.7
vvc_alf_classify_4x52_10_avx2: 1075.0
vvc_alf_classify_4x56_8_c: 3591.2
vvc_alf_classify_4x56_8_avx2: 1330.5
vvc_alf_classify_4x56_10_c: 3636.0
vvc_alf_classify_4x56_10_avx2: 1198.2
vvc_alf_classify_4x60_8_c: 3944.2
vvc_alf_classify_4x60_8_avx2: 1453.2
vvc_alf_classify_4x60_10_c: 3858.5
vvc_alf_classify_4x60_10_avx2: 1276.0
vvc_alf_classify_4x64_8_c: 4062.0
vvc_alf_classify_4x64_8_avx2: 1509.2
vvc_alf_classify_4x64_10_c: 4095.5
vvc_alf_classify_4x64_10_avx2: 1321.5
vvc_alf_classify_4x68_8_c: 4323.2
vvc_alf_classify_4x68_8_avx2: 1624.0
vvc_alf_classify_4x68_10_c: 4357.7
vvc_alf_classify_4x68_10_avx2: 1422.0
vvc_alf_classify_4x72_8_c: 4555.0
vvc_alf_classify_4x72_8_avx2: 1693.0
vvc_alf_classify_4x72_10_c: 8527.7
vvc_alf_classify_4x72_10_avx2: 1465.2
vvc_alf_classify_4x76_8_c: 13716.2
vvc_alf_classify_4x76_8_avx2: 1858.7
vvc_alf_classify_4x76_10_c: 4832.0
vvc_alf_classify_4x76_10_avx2: 1575.5
vvc_alf_classify_4x80_8_c: 5030.0
vvc_alf_classify_4x80_8_avx2: 1869.0
vvc_alf_classify_4x80_10_c: 5097.7
vvc_alf_classify_4x80_10_avx2: 1620.0
vvc_alf_classify_4x84_8_c: 5273.5
vvc_alf_classify_4x84_8_avx2: 2048.2
vvc_alf_classify_4x84_10_c: 5301.7
vvc_alf_classify_4x84_10_avx2: 1787.7
vvc_alf_classify_4x88_8_c: 5522.2
vvc_alf_classify_4x88_8_avx2: 2118.2
vvc_alf_classify_4x88_10_c: 5568.5
vvc_alf_classify_4x88_10_avx2: 1822.7
vvc_alf_classify_4x92_8_c: 5768.7
vvc_alf_classify_4x92_8_avx2: 2230.0
vvc_alf_classify_4x92_10_c: 5964.2
vvc_alf_classify_4x92_10_avx2: 1929.7
vvc_alf_classify_4x96_8_c: 6020.5
vvc_alf_classify_4x96_8_avx2: 2291.0
vvc_alf_classify_4x96_10_c: 6758.5
vvc_alf_classify_4x96_10_avx2: 1979.7
vvc_alf_classify_4x100_8_c: 6269.2
vvc_alf_classify_4x100_8_avx2: 2470.2
vvc_alf_classify_4x100_10_c: 6335.5
vvc_alf_classify_4x100_10_avx2: 2081.0
vvc_alf_classify_4x104_8_c: 6509.7
vvc_alf_classify_4x104_8_avx2: 2468.5
vvc_alf_classify_4x104_10_c: 6553.0
vvc_alf_classify_4x104_10_avx2: 2134.5
vvc_alf_classify_4x108_8_c: 6760.7
vvc_alf_classify_4x108_8_avx2: 2661.2
vvc_alf_classify_4x108_10_c: 6983.2
vvc_alf_classify_4x108_10_avx2: 2229.2
vvc_alf_classify_4x112_8_c: 6998.2
vvc_alf_classify_4x112_8_avx2: 2650.7
vvc_alf_classify_4x112_10_c: 7041.5
vvc_alf_classify_4x112_10_avx2: 2285.7
vvc_alf_classify_4x116_8_c: 7236.5
vvc_alf_classify_4x116_8_avx2: 2833.2
vvc_alf_classify_4x116_10_c: 7470.0
vvc_alf_classify_4x116_10_avx2: 2381.2
vvc_alf_classify_4x120_8_c: 7477.7
vvc_alf_classify_4x120_8_avx2: 2827.2
vvc_alf_classify_4x120_10_c: 7524.0
vvc_alf_classify_4x120_10_avx2: 2418.5
vvc_alf_classify_4x124_8_c: 7708.7
vvc_alf_classify_4x124_8_avx2: 2947.2
vvc_alf_classify_4x124_10_c: 7818.7
vvc_alf_classify_4x124_10_avx2: 2525.7
vvc_alf_classify_4x128_8_c: 7938.7
vvc_alf_classify_4x128_8_avx2: 3009.7
vvc_alf_classify_4x128_10_c: 8016.2
vvc_alf_classify_4x128_10_avx2: 2580.7
vvc_alf_classify_8x4_8_c: 722.5
vvc_alf_classify_8x4_8_avx2: 211.7
vvc_alf_classify_8x4_10_c: 638.0
vvc_alf_classify_8x4_10_avx2: 174.7
vvc_alf_classify_8x8_8_c: 1029.5
vvc_alf_classify_8x8_8_avx2: 267.7
vvc_alf_classify_8x8_10_c: 1011.7
vvc_alf_classify_8x8_10_avx2: 221.5
vvc_alf_classify_8x12_8_c: 1435.5
vvc_alf_classify_8x12_8_avx2: 377.2
vvc_alf_classify_8x12_10_c: 1539.5
vvc_alf_classify_8x12_10_avx2: 336.2
vvc_alf_classify_8x16_8_c: 3085.0
vvc_alf_classify_8x16_8_avx2: 436.2
vvc_alf_classify_8x16_10_c: 1800.0
vvc_alf_classify_8x16_10_avx2: 8534.5
vvc_alf_classify_8x20_8_c: 2208.0
vvc_alf_classify_8x20_8_avx2: 560.5
vvc_alf_classify_8x20_10_c: 2137.5
vvc_alf_classify_8x20_10_avx2: 480.7
vvc_alf_classify_8x24_8_c: 2542.0
vvc_alf_classify_8x24_8_avx2: 620.7
vvc_alf_classify_8x24_10_c: 2485.5
vvc_alf_classify_8x24_10_avx2: 542.2
vvc_alf_classify_8x28_8_c: 2895.0
vvc_alf_classify_8x28_8_avx2: 751.7
vvc_alf_classify_8x28_10_c: 2887.5
vvc_alf_classify_8x28_10_avx2: 634.2
vvc_alf_classify_8x32_8_c: 3297.0
vvc_alf_classify_8x32_8_avx2: 903.5
vvc_alf_classify_8x32_10_c: 3277.0
vvc_alf_classify_8x32_10_avx2: 702.2
vvc_alf_classify_8x36_8_c: 3656.7
vvc_alf_classify_8x36_8_avx2: 919.5
vvc_alf_classify_8x36_10_c: 3621.7
vvc_alf_classify_8x36_10_avx2: 789.0
vvc_alf_classify_8x40_8_c: 4050.0
vvc_alf_classify_8x40_8_avx2: 985.0
vvc_alf_classify_8x40_10_c: 4025.5
vvc_alf_classify_8x40_10_avx2: 833.7
vvc_alf_classify_8x44_8_c: 4403.0
vvc_alf_classify_8x44_8_avx2: 1138.2
vvc_alf_classify_8x44_10_c: 4495.7
vvc_alf_classify_8x44_10_avx2: 931.2
vvc_alf_classify_8x48_8_c: 4960.7
vvc_alf_classify_8x48_8_avx2: 1199.7
vvc_alf_classify_8x48_10_c: 4784.2
vvc_alf_classify_8x48_10_avx2: 1431.0
vvc_alf_classify_8x52_8_c: 11901.7
vvc_alf_classify_8x52_8_avx2: 1286.5
vvc_alf_classify_8x52_10_c: 5744.5
vvc_alf_classify_8x52_10_avx2: 1087.7
vvc_alf_classify_8x56_8_c: 5563.2
vvc_alf_classify_8x56_8_avx2: 1356.5
vvc_alf_classify_8x56_10_c: 5486.5
vvc_alf_classify_8x56_10_avx2: 1216.5
vvc_alf_classify_8x60_8_c: 6120.2
vvc_alf_classify_8x60_8_avx2: 1477.0
vvc_alf_classify_8x60_10_c: 5869.2
vvc_alf_classify_8x60_10_avx2: 1289.5
vvc_alf_classify_8x64_8_c: 6300.5
vvc_alf_classify_8x64_8_avx2: 1533.7
vvc_alf_classify_8x64_10_c: 6255.7
vvc_alf_classify_8x64_10_avx2: 1334.2
vvc_alf_classify_8x68_8_c: 6711.5
vvc_alf_classify_8x68_8_avx2: 1658.7
vvc_alf_classify_8x68_10_c: 6625.0
vvc_alf_classify_8x68_10_avx2: 1451.7
vvc_alf_classify_8x72_8_c: 7091.2
vvc_alf_classify_8x72_8_avx2: 2300.0
vvc_alf_classify_8x72_10_c: 7002.7
vvc_alf_classify_8x72_10_avx2: 1496.5
vvc_alf_classify_8x76_8_c: 7445.0
vvc_alf_classify_8x76_8_avx2: 1883.0
vvc_alf_classify_8x76_10_c: 7394.5
vvc_alf_classify_8x76_10_avx2: 1679.7
vvc_alf_classify_8x80_8_c: 8050.0
vvc_alf_classify_8x80_8_avx2: 1889.7
vvc_alf_classify_8x80_10_c: 7767.5
vvc_alf_classify_8x80_10_avx2: 1644.0
vvc_alf_classify_8x84_8_c: 8206.0
vvc_alf_classify_8x84_8_avx2: 2147.0
vvc_alf_classify_8x84_10_c: 8361.0
vvc_alf_classify_8x84_10_avx2: 1812.2
vvc_alf_classify_8x88_8_c: 8594.0
vvc_alf_classify_8x88_8_avx2: 2140.0
vvc_alf_classify_8x88_10_c: 8497.2
vvc_alf_classify_8x88_10_avx2: 1853.2
vvc_alf_classify_8x92_8_c: 8939.5
vvc_alf_classify_8x92_8_avx2: 2265.7
vvc_alf_classify_8x92_10_c: 9144.7
vvc_alf_classify_8x92_10_avx2: 2015.2
vvc_alf_classify_8x96_8_c: 9303.0
vvc_alf_classify_8x96_8_avx2: 2329.0
vvc_alf_classify_8x96_10_c: 9262.0
vvc_alf_classify_8x96_10_avx2: 2011.0
vvc_alf_classify_8x100_8_c: 9737.2
vvc_alf_classify_8x100_8_avx2: 2511.5
vvc_alf_classify_8x100_10_c: 9603.0
vvc_alf_classify_8x100_10_avx2: 2115.5
vvc_alf_classify_8x104_8_c: 10089.5
vvc_alf_classify_8x104_8_avx2: 2506.2
vvc_alf_classify_8x104_10_c: 9994.7
vvc_alf_classify_8x104_10_avx2: 2161.5
vvc_alf_classify_8x108_8_c: 10464.0
vvc_alf_classify_8x108_8_avx2: 2700.2
vvc_alf_classify_8x108_10_c: 10395.5
vvc_alf_classify_8x108_10_avx2: 2269.5
vvc_alf_classify_8x112_8_c: 10849.0
vvc_alf_classify_8x112_8_avx2: 2691.0
vvc_alf_classify_8x112_10_c: 11047.7
vvc_alf_classify_8x112_10_avx2: 2580.5
vvc_alf_classify_8x116_8_c: 11248.2
vvc_alf_classify_8x116_8_avx2: 2876.7
vvc_alf_classify_8x116_10_c: 11139.5
vvc_alf_classify_8x116_10_avx2: 2425.0
vvc_alf_classify_8x120_8_c: 25271.2
vvc_alf_classify_8x120_8_avx2: 2874.2
vvc_alf_classify_8x120_10_c: 11568.2
vvc_alf_classify_8x120_10_avx2: 2475.7
vvc_alf_classify_8x124_8_c: 12008.5
vvc_alf_classify_8x124_8_avx2: 2991.0
vvc_alf_classify_8x124_10_c: 13275.5
vvc_alf_classify_8x124_10_avx2: 2584.5
vvc_alf_classify_8x128_8_c: 12311.5
vvc_alf_classify_8x128_8_avx2: 3048.5
vvc_alf_classify_8x128_10_c: 20640.0
vvc_alf_classify_8x128_10_avx2: 2629.7
vvc_alf_classify_12x4_8_c: 962.5
vvc_alf_classify_12x4_8_avx2: 208.2
vvc_alf_classify_12x4_10_c: 845.0
vvc_alf_classify_12x4_10_avx2: 177.0
vvc_alf_classify_12x8_8_c: 1410.5
vvc_alf_classify_12x8_8_avx2: 273.0
vvc_alf_classify_12x8_10_c: 1349.7
vvc_alf_classify_12x8_10_avx2: 218.7
vvc_alf_classify_12x12_8_c: 1933.2
vvc_alf_classify_12x12_8_avx2: 388.5
vvc_alf_classify_12x12_10_c: 1851.7
vvc_alf_classify_12x12_10_avx2: 344.5
vvc_alf_classify_12x16_8_c: 2472.7
vvc_alf_classify_12x16_8_avx2: 451.0
vvc_alf_classify_12x16_10_c: 2350.5
vvc_alf_classify_12x16_10_avx2: 390.0
vvc_alf_classify_12x20_8_c: 2976.5
vvc_alf_classify_12x20_8_avx2: 576.7
vvc_alf_classify_12x20_10_c: 2851.7
vvc_alf_classify_12x20_10_avx2: 486.7
vvc_alf_classify_12x24_8_c: 3426.0
vvc_alf_classify_12x24_8_avx2: 640.0
vvc_alf_classify_12x24_10_c: 3420.0
vvc_alf_classify_12x24_10_avx2: 553.7
vvc_alf_classify_12x28_8_c: 3935.5
vvc_alf_classify_12x28_8_avx2: 761.5
vvc_alf_classify_12x28_10_c: 3874.2
vvc_alf_classify_12x28_10_avx2: 642.5
vvc_alf_classify_12x32_8_c: 4446.2
vvc_alf_classify_12x32_8_avx2: 915.5
vvc_alf_classify_12x32_10_c: 4394.0
vvc_alf_classify_12x32_10_avx2: 703.2
vvc_alf_classify_12x36_8_c: 4938.5
vvc_alf_classify_12x36_8_avx2: 952.0
vvc_alf_classify_12x36_10_c: 4890.7
vvc_alf_classify_12x36_10_avx2: 807.7
vvc_alf_classify_12x40_8_c: 5444.7
vvc_alf_classify_12x40_8_avx2: 1011.0
vvc_alf_classify_12x40_10_c: 5397.7
vvc_alf_classify_12x40_10_avx2: 851.7
vvc_alf_classify_12x44_8_c: 6510.2
vvc_alf_classify_12x44_8_avx2: 1136.0
vvc_alf_classify_12x44_10_c: 6214.7
vvc_alf_classify_12x44_10_avx2: 1040.0
vvc_alf_classify_12x48_8_c: 6486.7
vvc_alf_classify_12x48_8_avx2: 1192.0
vvc_alf_classify_12x48_10_c: 6395.7
vvc_alf_classify_12x48_10_avx2: 1422.7
vvc_alf_classify_12x52_8_c: 7058.5
vvc_alf_classify_12x52_8_avx2: 1329.5
vvc_alf_classify_12x52_10_c: 6882.0
vvc_alf_classify_12x52_10_avx2: 1116.7
vvc_alf_classify_12x56_8_c: 7498.5
vvc_alf_classify_12x56_8_avx2: 1380.2
vvc_alf_classify_12x56_10_c: 7394.5
vvc_alf_classify_12x56_10_avx2: 1237.7
vvc_alf_classify_12x60_8_c: 8016.2
vvc_alf_classify_12x60_8_avx2: 1505.5
vvc_alf_classify_12x60_10_c: 7909.0
vvc_alf_classify_12x60_10_avx2: 1320.0
vvc_alf_classify_12x64_8_c: 8546.2
vvc_alf_classify_12x64_8_avx2: 1568.7
vvc_alf_classify_12x64_10_c: 8384.7
vvc_alf_classify_12x64_10_avx2: 1377.2
vvc_alf_classify_12x68_8_c: 9087.0
vvc_alf_classify_12x68_8_avx2: 1692.2
vvc_alf_classify_12x68_10_c: 9163.0
vvc_alf_classify_12x68_10_avx2: 1482.2
vvc_alf_classify_12x72_8_c: 9597.7
vvc_alf_classify_12x72_8_avx2: 2436.2
vvc_alf_classify_12x72_10_c: 9434.0
vvc_alf_classify_12x72_10_avx2: 1527.7
vvc_alf_classify_12x76_8_c: 10122.2
vvc_alf_classify_12x76_8_avx2: 1927.0
vvc_alf_classify_12x76_10_c: 10229.7
vvc_alf_classify_12x76_10_avx2: 1629.2
vvc_alf_classify_12x80_8_c: 10843.7
vvc_alf_classify_12x80_8_avx2: 1936.5
vvc_alf_classify_12x80_10_c: 10515.2
vvc_alf_classify_12x80_10_avx2: 1678.2
vvc_alf_classify_12x84_8_c: 11108.7
vvc_alf_classify_12x84_8_avx2: 2182.7
vvc_alf_classify_12x84_10_c: 10957.0
vvc_alf_classify_12x84_10_avx2: 1856.7
vvc_alf_classify_12x88_8_c: 11638.5
vvc_alf_classify_12x88_8_avx2: 2246.0
vvc_alf_classify_12x88_10_c: 11459.5
vvc_alf_classify_12x88_10_avx2: 1908.2
vvc_alf_classify_12x92_8_c: 12129.0
vvc_alf_classify_12x92_8_avx2: 2309.7
vvc_alf_classify_12x92_10_c: 12249.0
vvc_alf_classify_12x92_10_avx2: 2016.2
vvc_alf_classify_12x96_8_c: 12650.2
vvc_alf_classify_12x96_8_avx2: 2376.7
vvc_alf_classify_12x96_10_c: 12436.5
vvc_alf_classify_12x96_10_avx2: 2061.0
vvc_alf_classify_12x100_8_c: 13152.2
vvc_alf_classify_12x100_8_avx2: 2567.7
vvc_alf_classify_12x100_10_c: 12950.5
vvc_alf_classify_12x100_10_avx2: 2181.5
vvc_alf_classify_12x104_8_c: 13716.0
vvc_alf_classify_12x104_8_avx2: 2567.2
vvc_alf_classify_12x104_10_c: 13463.5
vvc_alf_classify_12x104_10_avx2: 2221.2
vvc_alf_classify_12x108_8_c: 14194.0
vvc_alf_classify_12x108_8_avx2: 2828.0
vvc_alf_classify_12x108_10_c: 14055.5
vvc_alf_classify_12x108_10_avx2: 2337.2
vvc_alf_classify_12x112_8_c: 15696.7
vvc_alf_classify_12x112_8_avx2: 2820.5
vvc_alf_classify_12x112_10_c: 14607.2
vvc_alf_classify_12x112_10_avx2: 2384.0
vvc_alf_classify_12x116_8_c: 16497.0
vvc_alf_classify_12x116_8_avx2: 3002.2
vvc_alf_classify_12x116_10_c: 15063.7
vvc_alf_classify_12x116_10_avx2: 2551.0
vvc_alf_classify_12x120_8_c: 15702.7
vvc_alf_classify_12x120_8_avx2: 3017.5
vvc_alf_classify_12x120_10_c: 15618.5
vvc_alf_classify_12x120_10_avx2: 2541.2
vvc_alf_classify_12x124_8_c: 16210.0
vvc_alf_classify_12x124_8_avx2: 3064.7
vvc_alf_classify_12x124_10_c: 18047.5
vvc_alf_classify_12x124_10_avx2: 2644.0
vvc_alf_classify_12x128_8_c: 16710.2
vvc_alf_classify_12x128_8_avx2: 3134.7
vvc_alf_classify_12x128_10_c: 16721.5
vvc_alf_classify_12x128_10_avx2: 2700.0
vvc_alf_classify_16x4_8_c: 1204.5
vvc_alf_classify_16x4_8_avx2: 321.5
vvc_alf_classify_16x4_10_c: 1050.5
vvc_alf_classify_16x4_10_avx2: 299.7
vvc_alf_classify_16x8_8_c: 1731.7
vvc_alf_classify_16x8_8_avx2: 451.0
vvc_alf_classify_16x8_10_c: 1725.7
vvc_alf_classify_16x8_10_avx2: 389.2
vvc_alf_classify_16x12_8_c: 2427.0
vvc_alf_classify_16x12_8_avx2: 621.5
vvc_alf_classify_16x12_10_c: 2338.7
vvc_alf_classify_16x12_10_avx2: 553.0
vvc_alf_classify_16x16_8_c: 3179.5
vvc_alf_classify_16x16_8_avx2: 739.2
vvc_alf_classify_16x16_10_c: 3307.5
vvc_alf_classify_16x16_10_avx2: 644.2
vvc_alf_classify_16x20_8_c: 3763.0
vvc_alf_classify_16x20_8_avx2: 943.2
vvc_alf_classify_16x20_10_c: 3604.0
vvc_alf_classify_16x20_10_avx2: 774.2
vvc_alf_classify_16x24_8_c: 4304.0
vvc_alf_classify_16x24_8_avx2: 1041.5
vvc_alf_classify_16x24_10_c: 4265.2
vvc_alf_classify_16x24_10_avx2: 866.5
vvc_alf_classify_16x28_8_c: 4966.0
vvc_alf_classify_16x28_8_avx2: 1224.7
vvc_alf_classify_16x28_10_c: 4861.7
vvc_alf_classify_16x28_10_avx2: 1016.2
vvc_alf_classify_16x32_8_c: 5595.2
vvc_alf_classify_16x32_8_avx2: 1496.5
vvc_alf_classify_16x32_10_c: 5515.5
vvc_alf_classify_16x32_10_avx2: 1113.7
vvc_alf_classify_16x36_8_c: 6278.7
vvc_alf_classify_16x36_8_avx2: 1526.2
vvc_alf_classify_16x36_10_c: 6150.0
vvc_alf_classify_16x36_10_avx2: 1256.0
vvc_alf_classify_16x40_8_c: 6906.5
vvc_alf_classify_16x40_8_avx2: 1644.0
vvc_alf_classify_16x40_10_c: 6783.0
vvc_alf_classify_16x40_10_avx2: 1346.2
vvc_alf_classify_16x44_8_c: 7524.0
vvc_alf_classify_16x44_8_avx2: 1830.0
vvc_alf_classify_16x44_10_c: 7604.0
vvc_alf_classify_16x44_10_avx2: 1537.5
vvc_alf_classify_16x48_8_c: 8212.0
vvc_alf_classify_16x48_8_avx2: 1948.5
vvc_alf_classify_16x48_10_c: 8035.5
vvc_alf_classify_16x48_10_avx2: 1674.5
vvc_alf_classify_16x52_8_c: 8819.0
vvc_alf_classify_16x52_8_avx2: 2127.2
vvc_alf_classify_16x52_10_c: 9160.0
vvc_alf_classify_16x52_10_avx2: 1748.2
vvc_alf_classify_16x56_8_c: 9491.5
vvc_alf_classify_16x56_8_avx2: 2246.5
vvc_alf_classify_16x56_10_c: 9312.0
vvc_alf_classify_16x56_10_avx2: 1967.0
vvc_alf_classify_16x60_8_c: 10170.5
vvc_alf_classify_16x60_8_avx2: 2431.7
vvc_alf_classify_16x60_10_c: 9949.5
vvc_alf_classify_16x60_10_avx2: 2040.0
vvc_alf_classify_16x64_8_c: 10769.2
vvc_alf_classify_16x64_8_avx2: 2551.0
vvc_alf_classify_16x64_10_c: 10593.5
vvc_alf_classify_16x64_10_avx2: 2119.0
vvc_alf_classify_16x68_8_c: 11420.0
vvc_alf_classify_16x68_8_avx2: 2729.0
vvc_alf_classify_16x68_10_c: 11266.0
vvc_alf_classify_16x68_10_avx2: 2262.7
vvc_alf_classify_16x72_8_c: 12090.2
vvc_alf_classify_16x72_8_avx2: 3826.7
vvc_alf_classify_16x72_10_c: 11893.0
vvc_alf_classify_16x72_10_avx2: 2354.2
vvc_alf_classify_16x76_8_c: 12741.2
vvc_alf_classify_16x76_8_avx2: 3121.0
vvc_alf_classify_16x76_10_c: 12523.0
vvc_alf_classify_16x76_10_avx2: 2502.0
vvc_alf_classify_16x80_8_c: 13354.0
vvc_alf_classify_16x80_8_avx2: 3150.5
vvc_alf_classify_16x80_10_c: 13220.7
vvc_alf_classify_16x80_10_avx2: 2664.5
vvc_alf_classify_16x84_8_c: 14040.5
vvc_alf_classify_16x84_8_avx2: 3428.2
vvc_alf_classify_16x84_10_c: 13776.2
vvc_alf_classify_16x84_10_avx2: 2737.2
vvc_alf_classify_16x88_8_c: 15866.2
vvc_alf_classify_16x88_8_avx2: 3458.0
vvc_alf_classify_16x88_10_c: 14792.7
vvc_alf_classify_16x88_10_avx2: 2834.0
vvc_alf_classify_16x92_8_c: 15316.2
vvc_alf_classify_16x92_8_avx2: 3641.2
vvc_alf_classify_16x92_10_c: 15020.0
vvc_alf_classify_16x92_10_avx2: 2982.2
vvc_alf_classify_16x96_8_c: 15976.7
vvc_alf_classify_16x96_8_avx2: 3743.2
vvc_alf_classify_16x96_10_c: 16119.7
vvc_alf_classify_16x96_10_avx2: 3075.2
vvc_alf_classify_16x100_8_c: 16591.7
vvc_alf_classify_16x100_8_avx2: 3945.7
vvc_alf_classify_16x100_10_c: 16393.7
vvc_alf_classify_16x100_10_avx2: 4552.7
vvc_alf_classify_16x104_8_c: 17254.5
vvc_alf_classify_16x104_8_avx2: 4063.5
vvc_alf_classify_16x104_10_c: 16997.7
vvc_alf_classify_16x104_10_avx2: 3310.5
vvc_alf_classify_16x108_8_c: 17893.5
vvc_alf_classify_16x108_8_avx2: 4472.2
vvc_alf_classify_16x108_10_c: 17676.0
vvc_alf_classify_16x108_10_avx2: 3453.5
vvc_alf_classify_16x112_8_c: 18530.2
vvc_alf_classify_16x112_8_avx2: 4479.7
vvc_alf_classify_16x112_10_c: 20518.5
vvc_alf_classify_16x112_10_avx2: 3548.2
vvc_alf_classify_16x116_8_c: 19234.0
vvc_alf_classify_16x116_8_avx2: 4740.7
vvc_alf_classify_16x116_10_c: 19553.5
vvc_alf_classify_16x116_10_avx2: 3803.5
vvc_alf_classify_16x120_8_c: 19873.7
vvc_alf_classify_16x120_8_avx2: 4833.0
vvc_alf_classify_16x120_10_c: 19662.2
vvc_alf_classify_16x120_10_avx2: 3785.0
vvc_alf_classify_16x124_8_c: 20402.5
vvc_alf_classify_16x124_8_avx2: 5014.7
vvc_alf_classify_16x124_10_c: 20388.2
vvc_alf_classify_16x124_10_avx2: 3945.7
vvc_alf_classify_16x128_8_c: 21121.7
vvc_alf_classify_16x128_8_avx2: 4991.2
vvc_alf_classify_16x128_10_c: 20953.5
vvc_alf_classify_16x128_10_avx2: 4071.7
vvc_alf_classify_20x4_8_c: 2303.5
vvc_alf_classify_20x4_8_avx2: 379.5
vvc_alf_classify_20x4_10_c: 1270.7
vvc_alf_classify_20x4_10_avx2: 357.7
vvc_alf_classify_20x8_8_c: 2081.0
vvc_alf_classify_20x8_8_avx2: 512.7
vvc_alf_classify_20x8_10_c: 2029.7
vvc_alf_classify_20x8_10_avx2: 450.2
vvc_alf_classify_20x12_8_c: 2923.2
vvc_alf_classify_20x12_8_avx2: 757.0
vvc_alf_classify_20x12_10_c: 2798.2
vvc_alf_classify_20x12_10_avx2: 665.5
vvc_alf_classify_20x16_8_c: 3747.0
vvc_alf_classify_20x16_8_avx2: 856.0
vvc_alf_classify_20x16_10_c: 3588.2
vvc_alf_classify_20x16_10_avx2: 757.7
vvc_alf_classify_20x20_8_c: 4584.2
vvc_alf_classify_20x20_8_avx2: 1210.5
vvc_alf_classify_20x20_10_c: 4334.5
vvc_alf_classify_20x20_10_avx2: 941.7
vvc_alf_classify_20x24_8_c: 5207.2
vvc_alf_classify_20x24_8_avx2: 1212.0
vvc_alf_classify_20x24_10_c: 5119.2
vvc_alf_classify_20x24_10_avx2: 1039.2
vvc_alf_classify_20x28_8_c: 5985.2
vvc_alf_classify_20x28_8_avx2: 1524.7
vvc_alf_classify_20x28_10_c: 5864.0
vvc_alf_classify_20x28_10_avx2: 1244.0
vvc_alf_classify_20x32_8_c: 6794.0
vvc_alf_classify_20x32_8_avx2: 1748.5
vvc_alf_classify_20x32_10_c: 6626.0
vvc_alf_classify_20x32_10_avx2: 1338.7
vvc_alf_classify_20x36_8_c: 7551.5
vvc_alf_classify_20x36_8_avx2: 1878.5
vvc_alf_classify_20x36_10_c: 7401.7
vvc_alf_classify_20x36_10_avx2: 1570.2
vvc_alf_classify_20x40_8_c: 8537.0
vvc_alf_classify_20x40_8_avx2: 1953.7
vvc_alf_classify_20x40_10_c: 8165.7
vvc_alf_classify_20x40_10_avx2: 1662.5
vvc_alf_classify_20x44_8_c: 9092.2
vvc_alf_classify_20x44_8_avx2: 2210.7
vvc_alf_classify_20x44_10_c: 8920.2
vvc_alf_classify_20x44_10_avx2: 1905.2
vvc_alf_classify_20x48_8_c: 9863.0
vvc_alf_classify_20x48_8_avx2: 2335.7
vvc_alf_classify_20x48_10_c: 9667.2
vvc_alf_classify_20x48_10_avx2: 2215.5
vvc_alf_classify_20x52_8_c: 10678.2
vvc_alf_classify_20x52_8_avx2: 2580.0
vvc_alf_classify_20x52_10_c: 10486.2
vvc_alf_classify_20x52_10_avx2: 2196.5
vvc_alf_classify_20x56_8_c: 11472.2
vvc_alf_classify_20x56_8_avx2: 2705.0
vvc_alf_classify_20x56_10_c: 11825.2
vvc_alf_classify_20x56_10_avx2: 2319.5
vvc_alf_classify_20x60_8_c: 12260.7
vvc_alf_classify_20x60_8_avx2: 2943.2
vvc_alf_classify_20x60_10_c: 11970.5
vvc_alf_classify_20x60_10_avx2: 68760.2
vvc_alf_classify_20x64_8_c: 13000.2
vvc_alf_classify_20x64_8_avx2: 3070.0
vvc_alf_classify_20x64_10_c: 27692.5
vvc_alf_classify_20x64_10_avx2: 2627.0
vvc_alf_classify_20x68_8_c: 13793.5
vvc_alf_classify_20x68_8_avx2: 3290.5
vvc_alf_classify_20x68_10_c: 13531.2
vvc_alf_classify_20x68_10_avx2: 2829.5
vvc_alf_classify_20x72_8_c: 14586.5
vvc_alf_classify_20x72_8_avx2: 4231.0
vvc_alf_classify_20x72_10_c: 15078.0
vvc_alf_classify_20x72_10_avx2: 2921.0
vvc_alf_classify_20x76_8_c: 15346.7
vvc_alf_classify_20x76_8_avx2: 3761.0
vvc_alf_classify_20x76_10_c: 15429.5
vvc_alf_classify_20x76_10_avx2: 3128.0
vvc_alf_classify_20x80_8_c: 16605.2
vvc_alf_classify_20x80_8_avx2: 3785.5
vvc_alf_classify_20x80_10_c: 15812.2
vvc_alf_classify_20x80_10_avx2: 3219.0
vvc_alf_classify_20x84_8_c: 16956.0
vvc_alf_classify_20x84_8_avx2: 4115.5
vvc_alf_classify_20x84_10_c: 16612.0
vvc_alf_classify_20x84_10_avx2: 3420.7
vvc_alf_classify_20x88_8_c: 17691.7
vvc_alf_classify_20x88_8_avx2: 4129.7
vvc_alf_classify_20x88_10_c: 18300.2
vvc_alf_classify_20x88_10_avx2: 3516.7
vvc_alf_classify_20x92_8_c: 18534.7
vvc_alf_classify_20x92_8_avx2: 4375.5
vvc_alf_classify_20x92_10_c: 18152.0
vvc_alf_classify_20x92_10_avx2: 3730.5
vvc_alf_classify_20x96_8_c: 19260.0
vvc_alf_classify_20x96_8_avx2: 4496.0
vvc_alf_classify_20x96_10_c: 18926.5
vvc_alf_classify_20x96_10_avx2: 3823.7
vvc_alf_classify_20x100_8_c: 20001.0
vvc_alf_classify_20x100_8_avx2: 4727.7
vvc_alf_classify_20x100_10_c: 19691.2
vvc_alf_classify_20x100_10_avx2: 4021.0
vvc_alf_classify_20x104_8_c: 21388.5
vvc_alf_classify_20x104_8_avx2: 4853.5
vvc_alf_classify_20x104_10_c: 20421.7
vvc_alf_classify_20x104_10_avx2: 4124.5
vvc_alf_classify_20x108_8_c: 21618.5
vvc_alf_classify_20x108_8_avx2: 5084.5
vvc_alf_classify_20x108_10_c: 21230.5
vvc_alf_classify_20x108_10_avx2: 4326.2
vvc_alf_classify_20x112_8_c: 22346.0
vvc_alf_classify_20x112_8_avx2: 5341.2
vvc_alf_classify_20x112_10_c: 22014.7
vvc_alf_classify_20x112_10_avx2: 4400.7
vvc_alf_classify_20x116_8_c: 23122.0
vvc_alf_classify_20x116_8_avx2: 5622.0
vvc_alf_classify_20x116_10_c: 23385.2
vvc_alf_classify_20x116_10_avx2: 4616.7
vvc_alf_classify_20x120_8_c: 23936.0
vvc_alf_classify_20x120_8_avx2: 5596.0
vvc_alf_classify_20x120_10_c: 23615.7
vvc_alf_classify_20x120_10_avx2: 4709.2
vvc_alf_classify_20x124_8_c: 24638.2
vvc_alf_classify_20x124_8_avx2: 6028.2
vvc_alf_classify_20x124_10_c: 24440.2
vvc_alf_classify_20x124_10_avx2: 4924.2
vvc_alf_classify_20x128_8_c: 25533.2
vvc_alf_classify_20x128_8_avx2: 5952.7
vvc_alf_classify_20x128_10_c: 25189.2
vvc_alf_classify_20x128_10_avx2: 5058.2
vvc_alf_classify_24x4_8_c: 1684.5
vvc_alf_classify_24x4_8_avx2: 378.7
vvc_alf_classify_24x4_10_c: 1472.7
vvc_alf_classify_24x4_10_avx2: 359.2
vvc_alf_classify_24x8_8_c: 2423.7
vvc_alf_classify_24x8_8_avx2: 512.7
vvc_alf_classify_24x8_10_c: 2370.0
vvc_alf_classify_24x8_10_avx2: 464.0
vvc_alf_classify_24x12_8_c: 3369.2
vvc_alf_classify_24x12_8_avx2: 734.0
vvc_alf_classify_24x12_10_c: 3285.2
vvc_alf_classify_24x12_10_avx2: 667.2
vvc_alf_classify_24x16_8_c: 4503.5
vvc_alf_classify_24x16_8_avx2: 862.7
vvc_alf_classify_24x16_10_c: 4180.2
vvc_alf_classify_24x16_10_avx2: 763.0
vvc_alf_classify_24x20_8_c: 5344.2
vvc_alf_classify_24x20_8_avx2: 1089.2
vvc_alf_classify_24x20_10_c: 5079.2
vvc_alf_classify_24x20_10_avx2: 975.2
vvc_alf_classify_24x24_8_c: 6094.7
vvc_alf_classify_24x24_8_avx2: 1218.7
vvc_alf_classify_24x24_10_c: 5966.0
vvc_alf_classify_24x24_10_avx2: 1046.0
vvc_alf_classify_24x28_8_c: 7034.7
vvc_alf_classify_24x28_8_avx2: 1454.7
vvc_alf_classify_24x28_10_c: 6845.5
vvc_alf_classify_24x28_10_avx2: 1253.0
vvc_alf_classify_24x32_8_c: 7949.2
vvc_alf_classify_24x32_8_avx2: 1756.5
vvc_alf_classify_24x32_10_c: 7941.7
vvc_alf_classify_24x32_10_avx2: 1343.2
vvc_alf_classify_24x36_8_c: 8846.5
vvc_alf_classify_24x36_8_avx2: 1846.5
vvc_alf_classify_24x36_10_c: 8630.5
vvc_alf_classify_24x36_10_avx2: 1578.5
vvc_alf_classify_24x40_8_c: 9820.5
vvc_alf_classify_24x40_8_avx2: 1965.0
vvc_alf_classify_24x40_10_c: 9551.0
vvc_alf_classify_24x40_10_avx2: 1675.2
vvc_alf_classify_24x44_8_c: 10639.0
vvc_alf_classify_24x44_8_avx2: 2233.0
vvc_alf_classify_24x44_10_c: 10417.0
vvc_alf_classify_24x44_10_avx2: 1959.2
vvc_alf_classify_24x48_8_c: 11574.2
vvc_alf_classify_24x48_8_avx2: 2348.5
vvc_alf_classify_24x48_10_c: 11366.5
vvc_alf_classify_24x48_10_avx2: 2229.5
vvc_alf_classify_24x52_8_c: 12551.2
vvc_alf_classify_24x52_8_avx2: 2592.7
vvc_alf_classify_24x52_10_c: 12260.7
vvc_alf_classify_24x52_10_avx2: 2334.2
vvc_alf_classify_24x56_8_c: 13440.5
vvc_alf_classify_24x56_8_avx2: 2719.2
vvc_alf_classify_24x56_10_c: 13476.5
vvc_alf_classify_24x56_10_avx2: 2329.0
vvc_alf_classify_24x60_8_c: 14334.7
vvc_alf_classify_24x60_8_avx2: 2955.5
vvc_alf_classify_24x60_10_c: 14063.0
vvc_alf_classify_24x60_10_avx2: 2620.2
vvc_alf_classify_24x64_8_c: 15261.2
vvc_alf_classify_24x64_8_avx2: 3079.7
vvc_alf_classify_24x64_10_c: 14927.7
vvc_alf_classify_24x64_10_avx2: 2645.5
vvc_alf_classify_24x68_8_c: 16150.5
vvc_alf_classify_24x68_8_avx2: 3318.0
vvc_alf_classify_24x68_10_c: 15804.7
vvc_alf_classify_24x68_10_avx2: 2854.7
vvc_alf_classify_24x72_8_c: 17098.2
vvc_alf_classify_24x72_8_avx2: 4557.0
vvc_alf_classify_24x72_10_c: 17138.5
vvc_alf_classify_24x72_10_avx2: 2950.7
vvc_alf_classify_24x76_8_c: 18070.2
vvc_alf_classify_24x76_8_avx2: 3680.5
vvc_alf_classify_24x76_10_c: 18125.2
vvc_alf_classify_24x76_10_avx2: 3144.5
vvc_alf_classify_24x80_8_c: 18916.0
vvc_alf_classify_24x80_8_avx2: 3808.0
vvc_alf_classify_24x80_10_c: 18548.2
vvc_alf_classify_24x80_10_avx2: 3236.0
vvc_alf_classify_24x84_8_c: 55244.0
vvc_alf_classify_24x84_8_avx2: 4039.5
vvc_alf_classify_24x84_10_c: 33735.2
vvc_alf_classify_24x84_10_avx2: 3452.7
vvc_alf_classify_24x88_8_c: 20739.0
vvc_alf_classify_24x88_8_avx2: 4172.0
vvc_alf_classify_24x88_10_c: 30171.2
vvc_alf_classify_24x88_10_avx2: 3534.0
vvc_alf_classify_24x92_8_c: 21650.5
vvc_alf_classify_24x92_8_avx2: 4388.2
vvc_alf_classify_24x92_10_c: 21769.7
vvc_alf_classify_24x92_10_avx2: 3764.7
vvc_alf_classify_24x96_8_c: 22539.0
vvc_alf_classify_24x96_8_avx2: 4520.0
vvc_alf_classify_24x96_10_c: 22151.0
vvc_alf_classify_24x96_10_avx2: 3952.5
vvc_alf_classify_24x100_8_c: 23469.0
vvc_alf_classify_24x100_8_avx2: 4764.2
vvc_alf_classify_24x100_10_c: 23026.7
vvc_alf_classify_24x100_10_avx2: 4053.0
vvc_alf_classify_24x104_8_c: 24381.2
vvc_alf_classify_24x104_8_avx2: 5019.5
vvc_alf_classify_24x104_10_c: 23956.7
vvc_alf_classify_24x104_10_avx2: 4158.7
vvc_alf_classify_24x108_8_c: 25321.7
vvc_alf_classify_24x108_8_avx2: 5124.5
vvc_alf_classify_24x108_10_c: 45315.0
vvc_alf_classify_24x108_10_avx2: 4353.2
vvc_alf_classify_24x112_8_c: 26200.5
vvc_alf_classify_24x112_8_avx2: 6552.2
vvc_alf_classify_24x112_10_c: 25795.5
vvc_alf_classify_24x112_10_avx2: 4445.5
vvc_alf_classify_24x116_8_c: 27166.2
vvc_alf_classify_24x116_8_avx2: 5660.7
vvc_alf_classify_24x116_10_c: 26805.2
vvc_alf_classify_24x116_10_avx2: 4668.0
vvc_alf_classify_24x120_8_c: 28112.2
vvc_alf_classify_24x120_8_avx2: 7519.5
vvc_alf_classify_24x120_10_c: 27617.0
vvc_alf_classify_24x120_10_avx2: 4751.5
vvc_alf_classify_24x124_8_c: 28968.5
vvc_alf_classify_24x124_8_avx2: 6042.7
vvc_alf_classify_24x124_10_c: 28515.7
vvc_alf_classify_24x124_10_avx2: 4961.5
vvc_alf_classify_24x128_8_c: 29832.2
vvc_alf_classify_24x128_8_avx2: 5998.7
vvc_alf_classify_24x128_10_c: 32860.5
vvc_alf_classify_24x128_10_avx2: 5109.0
vvc_alf_classify_28x4_8_c: 1933.5
vvc_alf_classify_28x4_8_avx2: 382.5
vvc_alf_classify_28x4_10_c: 1699.7
vvc_alf_classify_28x4_10_avx2: 370.2
vvc_alf_classify_28x8_8_c: 2773.0
vvc_alf_classify_28x8_8_avx2: 518.0
vvc_alf_classify_28x8_10_c: 2774.0
vvc_alf_classify_28x8_10_avx2: 451.7
vvc_alf_classify_28x12_8_c: 7068.2
vvc_alf_classify_28x12_8_avx2: 744.5
vvc_alf_classify_28x12_10_c: 3779.7
vvc_alf_classify_28x12_10_avx2: 674.7
vvc_alf_classify_28x16_8_c: 9153.5
vvc_alf_classify_28x16_8_avx2: 868.7
vvc_alf_classify_28x16_10_c: 4787.2
vvc_alf_classify_28x16_10_avx2: 773.7
vvc_alf_classify_28x20_8_c: 6086.0
vvc_alf_classify_28x20_8_avx2: 1101.2
vvc_alf_classify_28x20_10_c: 5834.2
vvc_alf_classify_28x20_10_avx2: 964.7
vvc_alf_classify_28x24_8_c: 6961.0
vvc_alf_classify_28x24_8_avx2: 1225.5
vvc_alf_classify_28x24_10_c: 6852.2
vvc_alf_classify_28x24_10_avx2: 1052.0
vvc_alf_classify_28x28_8_c: 8025.7
vvc_alf_classify_28x28_8_avx2: 1469.0
vvc_alf_classify_28x28_10_c: 7865.0
vvc_alf_classify_28x28_10_avx2: 1260.5
vvc_alf_classify_28x32_8_c: 9313.0
vvc_alf_classify_28x32_8_avx2: 1773.5
vvc_alf_classify_28x32_10_c: 8909.7
vvc_alf_classify_28x32_10_avx2: 1427.2
vvc_alf_classify_28x36_8_c: 11260.5
vvc_alf_classify_28x36_8_avx2: 1869.5
vvc_alf_classify_28x36_10_c: 9922.5
vvc_alf_classify_28x36_10_avx2: 1604.5
vvc_alf_classify_28x40_8_c: 11209.2
vvc_alf_classify_28x40_8_avx2: 1987.2
vvc_alf_classify_28x40_10_c: 10948.7
vvc_alf_classify_28x40_10_avx2: 1694.5
vvc_alf_classify_28x44_8_c: 12237.7
vvc_alf_classify_28x44_8_avx2: 2263.5
vvc_alf_classify_28x44_10_c: 11968.2
vvc_alf_classify_28x44_10_avx2: 1927.7
vvc_alf_classify_28x48_8_c: 13301.2
vvc_alf_classify_28x48_8_avx2: 6656.5
vvc_alf_classify_28x48_10_c: 13011.5
vvc_alf_classify_28x48_10_avx2: 2074.0
vvc_alf_classify_28x52_8_c: 14360.0
vvc_alf_classify_28x52_8_avx2: 2616.5
vvc_alf_classify_28x52_10_c: 14040.5
vvc_alf_classify_28x52_10_avx2: 2304.5
vvc_alf_classify_28x56_8_c: 15431.0
vvc_alf_classify_28x56_8_avx2: 2746.0
vvc_alf_classify_28x56_10_c: 15093.7
vvc_alf_classify_28x56_10_avx2: 2367.0
vvc_alf_classify_28x60_8_c: 16449.0
vvc_alf_classify_28x60_8_avx2: 2977.7
vvc_alf_classify_28x60_10_c: 16139.0
vvc_alf_classify_28x60_10_avx2: 2647.7
vvc_alf_classify_28x64_8_c: 17493.0
vvc_alf_classify_28x64_8_avx2: 3110.2
vvc_alf_classify_28x64_10_c: 17088.0
vvc_alf_classify_28x64_10_avx2: 2815.2
vvc_alf_classify_28x68_8_c: 18554.7
vvc_alf_classify_28x68_8_avx2: 3348.5
vvc_alf_classify_28x68_10_c: 18119.2
vvc_alf_classify_28x68_10_avx2: 2891.2
vvc_alf_classify_28x72_8_c: 19574.2
vvc_alf_classify_28x72_8_avx2: 3470.7
vvc_alf_classify_28x72_10_c: 19206.5
vvc_alf_classify_28x72_10_avx2: 2971.7
vvc_alf_classify_28x76_8_c: 46253.7
vvc_alf_classify_28x76_8_avx2: 3709.0
vvc_alf_classify_28x76_10_c: 20747.2
vvc_alf_classify_28x76_10_avx2: 3190.0
vvc_alf_classify_28x80_8_c: 29286.5
vvc_alf_classify_28x80_8_avx2: 3876.5
vvc_alf_classify_28x80_10_c: 21226.0
vvc_alf_classify_28x80_10_avx2: 3277.7
vvc_alf_classify_28x84_8_c: 22761.5
vvc_alf_classify_28x84_8_avx2: 4076.0
vvc_alf_classify_28x84_10_c: 22905.0
vvc_alf_classify_28x84_10_avx2: 3495.2
vvc_alf_classify_28x88_8_c: 33349.5
vvc_alf_classify_28x88_8_avx2: 4195.2
vvc_alf_classify_28x88_10_c: 23983.2
vvc_alf_classify_28x88_10_avx2: 3576.5
vvc_alf_classify_28x92_8_c: 24845.2
vvc_alf_classify_28x92_8_avx2: 4450.7
vvc_alf_classify_28x92_10_c: 24362.7
vvc_alf_classify_28x92_10_avx2: 3812.5
vvc_alf_classify_28x96_8_c: 25837.7
vvc_alf_classify_28x96_8_avx2: 4562.5
vvc_alf_classify_28x96_10_c: 25472.2
vvc_alf_classify_28x96_10_avx2: 3890.7
vvc_alf_classify_28x100_8_c: 26931.0
vvc_alf_classify_28x100_8_avx2: 4819.2
vvc_alf_classify_28x100_10_c: 27242.7
vvc_alf_classify_28x100_10_avx2: 4109.5
vvc_alf_classify_28x104_8_c: 28027.2
vvc_alf_classify_28x104_8_avx2: 5160.7
vvc_alf_classify_28x104_10_c: 28308.7
vvc_alf_classify_28x104_10_avx2: 4199.7
vvc_alf_classify_28x108_8_c: 29042.2
vvc_alf_classify_28x108_8_avx2: 5175.2
vvc_alf_classify_28x108_10_c: 28589.5
vvc_alf_classify_28x108_10_avx2: 4410.5
vvc_alf_classify_28x112_8_c: 30102.0
vvc_alf_classify_28x112_8_avx2: 5437.7
vvc_alf_classify_28x112_10_c: 29659.5
vvc_alf_classify_28x112_10_avx2: 4493.2
vvc_alf_classify_28x116_8_c: 31242.0
vvc_alf_classify_28x116_8_avx2: 5874.5
vvc_alf_classify_28x116_10_c: 30746.7
vvc_alf_classify_28x116_10_avx2: 4715.0
vvc_alf_classify_28x120_8_c: 41923.5
vvc_alf_classify_28x120_8_avx2: 5698.0
vvc_alf_classify_28x120_10_c: 31763.2
vvc_alf_classify_28x120_10_avx2: 4803.0
vvc_alf_classify_28x124_8_c: 51929.2
vvc_alf_classify_28x124_8_avx2: 6393.5
vvc_alf_classify_28x124_10_c: 57978.2
vvc_alf_classify_28x124_10_avx2: 5017.2
vvc_alf_classify_28x128_8_c: 34202.2
vvc_alf_classify_28x128_8_avx2: 6063.5
vvc_alf_classify_28x128_10_c: 34803.5
vvc_alf_classify_28x128_10_avx2: 5146.2
vvc_alf_classify_32x4_8_c: 2185.5
vvc_alf_classify_32x4_8_avx2: 494.2
vvc_alf_classify_32x4_10_c: 1903.0
vvc_alf_classify_32x4_10_avx2: 456.5
vvc_alf_classify_32x8_8_c: 3311.2
vvc_alf_classify_32x8_8_avx2: 719.0
vvc_alf_classify_32x8_10_c: 3055.7
vvc_alf_classify_32x8_10_avx2: 582.0
vvc_alf_classify_32x12_8_c: 7939.5
vvc_alf_classify_32x12_8_avx2: 975.2
vvc_alf_classify_32x12_10_c: 4237.7
vvc_alf_classify_32x12_10_avx2: 853.5
vvc_alf_classify_32x16_8_c: 5815.0
vvc_alf_classify_32x16_8_avx2: 1152.5
vvc_alf_classify_32x16_10_c: 5389.0
vvc_alf_classify_32x16_10_avx2: 966.2
vvc_alf_classify_32x20_8_c: 6895.7
vvc_alf_classify_32x20_8_avx2: 1454.0
vvc_alf_classify_32x20_10_c: 6536.5
vvc_alf_classify_32x20_10_avx2: 1216.5
vvc_alf_classify_32x24_8_c: 7877.5
vvc_alf_classify_32x24_8_avx2: 1635.0
vvc_alf_classify_32x24_10_c: 7709.5
vvc_alf_classify_32x24_10_avx2: 1355.7
vvc_alf_classify_32x28_8_c: 9064.7
vvc_alf_classify_32x28_8_avx2: 1997.5
vvc_alf_classify_32x28_10_c: 8852.5
vvc_alf_classify_32x28_10_avx2: 1769.7
vvc_alf_classify_32x32_8_c: 10232.2
vvc_alf_classify_32x32_8_avx2: 2428.5
vvc_alf_classify_32x32_10_c: 32419.0
vvc_alf_classify_32x32_10_avx2: 2635.5
vvc_alf_classify_32x36_8_c: 11432.7
vvc_alf_classify_32x36_8_avx2: 2478.7
vvc_alf_classify_32x36_10_c: 11172.0
vvc_alf_classify_32x36_10_avx2: 2058.0
vvc_alf_classify_32x40_8_c: 12648.7
vvc_alf_classify_32x40_8_avx2: 2654.5
vvc_alf_classify_32x40_10_c: 12323.5
vvc_alf_classify_32x40_10_avx2: 2198.7
vvc_alf_classify_32x44_8_c: 13783.7
vvc_alf_classify_32x44_8_avx2: 2953.0
vvc_alf_classify_32x44_10_c: 13500.0
vvc_alf_classify_32x44_10_avx2: 3119.7
vvc_alf_classify_32x48_8_c: 14968.5
vvc_alf_classify_32x48_8_avx2: 8776.5
vvc_alf_classify_32x48_10_c: 14637.0
vvc_alf_classify_32x48_10_avx2: 2597.7
vvc_alf_classify_32x52_8_c: 16166.7
vvc_alf_classify_32x52_8_avx2: 3424.5
vvc_alf_classify_32x52_10_c: 15778.0
vvc_alf_classify_32x52_10_avx2: 2917.7
vvc_alf_classify_32x56_8_c: 17326.2
vvc_alf_classify_32x56_8_avx2: 3624.7
vvc_alf_classify_32x56_10_c: 16924.2
vvc_alf_classify_32x56_10_avx2: 3017.7
vvc_alf_classify_32x60_8_c: 18505.7
vvc_alf_classify_32x60_8_avx2: 3924.2
vvc_alf_classify_32x60_10_c: 18068.0
vvc_alf_classify_32x60_10_avx2: 3444.5
vvc_alf_classify_32x64_8_c: 19720.2
vvc_alf_classify_32x64_8_avx2: 4596.5
vvc_alf_classify_32x64_10_c: 19266.7
vvc_alf_classify_32x64_10_avx2: 3401.5
vvc_alf_classify_32x68_8_c: 20907.5
vvc_alf_classify_32x68_8_avx2: 4420.7
vvc_alf_classify_32x68_10_c: 20431.5
vvc_alf_classify_32x68_10_avx2: 3666.5
vvc_alf_classify_32x72_8_c: 24578.5
vvc_alf_classify_32x72_8_avx2: 4602.5
vvc_alf_classify_32x72_10_c: 21547.0
vvc_alf_classify_32x72_10_avx2: 3819.7
vvc_alf_classify_32x76_8_c: 23236.0
vvc_alf_classify_32x76_8_avx2: 4911.5
vvc_alf_classify_32x76_10_c: 23336.5
vvc_alf_classify_32x76_10_avx2: 4073.0
vvc_alf_classify_32x80_8_c: 24448.2
vvc_alf_classify_32x80_8_avx2: 5082.7
vvc_alf_classify_32x80_10_c: 23937.5
vvc_alf_classify_32x80_10_avx2: 4198.2
vvc_alf_classify_32x84_8_c: 25680.0
vvc_alf_classify_32x84_8_avx2: 5354.7
vvc_alf_classify_32x84_10_c: 34406.5
vvc_alf_classify_32x84_10_avx2: 4455.0
vvc_alf_classify_32x88_8_c: 26850.0
vvc_alf_classify_32x88_8_avx2: 5558.7
vvc_alf_classify_32x88_10_c: 34482.2
vvc_alf_classify_32x88_10_avx2: 4597.5
vvc_alf_classify_32x92_8_c: 28070.2
vvc_alf_classify_32x92_8_avx2: 5849.2
vvc_alf_classify_32x92_10_c: 27514.2
vvc_alf_classify_32x92_10_avx2: 4841.7
vvc_alf_classify_32x96_8_c: 29203.7
vvc_alf_classify_32x96_8_avx2: 6033.0
vvc_alf_classify_32x96_10_c: 28716.7
vvc_alf_classify_32x96_10_avx2: 5008.5
vvc_alf_classify_32x100_8_c: 30348.5
vvc_alf_classify_32x100_8_avx2: 6331.0
vvc_alf_classify_32x100_10_c: 29793.5
vvc_alf_classify_32x100_10_avx2: 5240.7
vvc_alf_classify_32x104_8_c: 31537.7
vvc_alf_classify_32x104_8_avx2: 7049.2
vvc_alf_classify_32x104_10_c: 31032.7
vvc_alf_classify_32x104_10_avx2: 5539.7
vvc_alf_classify_32x108_8_c: 32654.7
vvc_alf_classify_32x108_8_avx2: 7017.5
vvc_alf_classify_32x108_10_c: 33944.5
vvc_alf_classify_32x108_10_avx2: 5695.7
vvc_alf_classify_32x112_8_c: 33961.7
vvc_alf_classify_32x112_8_avx2: 7023.5
vvc_alf_classify_32x112_10_c: 33351.7
vvc_alf_classify_32x112_10_avx2: 5880.5
vvc_alf_classify_32x116_8_c: 35124.0
vvc_alf_classify_32x116_8_avx2: 7574.2
vvc_alf_classify_32x116_10_c: 34633.2
vvc_alf_classify_32x116_10_avx2: 6179.0
vvc_alf_classify_32x120_8_c: 36341.7
vvc_alf_classify_32x120_8_avx2: 7746.2
vvc_alf_classify_32x120_10_c: 35714.0
vvc_alf_classify_32x120_10_avx2: 6318.2
vvc_alf_classify_32x124_8_c: 38506.0
vvc_alf_classify_32x124_8_avx2: 7850.7
vvc_alf_classify_32x124_10_c: 36915.0
vvc_alf_classify_32x124_10_avx2: 6644.5
vvc_alf_classify_32x128_8_c: 67019.2
vvc_alf_classify_32x128_8_avx2: 8028.2
vvc_alf_classify_32x128_10_c: 38049.0
vvc_alf_classify_32x128_10_avx2: 6859.7
vvc_alf_classify_36x4_8_c: 2410.5
vvc_alf_classify_36x4_8_avx2: 543.5
vvc_alf_classify_36x4_10_c: 2116.0
vvc_alf_classify_36x4_10_avx2: 501.5
vvc_alf_classify_36x8_8_c: 3724.5
vvc_alf_classify_36x8_8_avx2: 772.7
vvc_alf_classify_36x8_10_c: 3506.7
vvc_alf_classify_36x8_10_avx2: 633.5
vvc_alf_classify_36x12_8_c: 4817.7
vvc_alf_classify_36x12_8_avx2: 1081.7
vvc_alf_classify_36x12_10_c: 4725.2
vvc_alf_classify_36x12_10_avx2: 964.0
vvc_alf_classify_36x16_8_c: 6283.7
vvc_alf_classify_36x16_8_avx2: 1264.2
vvc_alf_classify_36x16_10_c: 5963.2
vvc_alf_classify_36x16_10_avx2: 1076.5
vvc_alf_classify_36x20_8_c: 7663.2
vvc_alf_classify_36x20_8_avx2: 1609.0
vvc_alf_classify_36x20_10_c: 7244.0
vvc_alf_classify_36x20_10_avx2: 1383.2
vvc_alf_classify_36x24_8_c: 8761.7
vvc_alf_classify_36x24_8_avx2: 1790.7
vvc_alf_classify_36x24_10_c: 8529.2
vvc_alf_classify_36x24_10_avx2: 1521.0
vvc_alf_classify_36x28_8_c: 10089.2
vvc_alf_classify_36x28_8_avx2: 2214.2
vvc_alf_classify_36x28_10_c: 9837.7
vvc_alf_classify_36x28_10_avx2: 1937.7
vvc_alf_classify_36x32_8_c: 11397.7
vvc_alf_classify_36x32_8_avx2: 2668.5
vvc_alf_classify_36x32_10_c: 14978.5
vvc_alf_classify_36x32_10_avx2: 2916.2
vvc_alf_classify_36x36_8_c: 12735.2
vvc_alf_classify_36x36_8_avx2: 2749.0
vvc_alf_classify_36x36_10_c: 12434.2
vvc_alf_classify_36x36_10_avx2: 2336.5
vvc_alf_classify_36x40_8_c: 14084.5
vvc_alf_classify_36x40_8_avx2: 2933.0
vvc_alf_classify_36x40_10_c: 13740.0
vvc_alf_classify_36x40_10_avx2: 2475.7
vvc_alf_classify_36x44_8_c: 15419.0
vvc_alf_classify_36x44_8_avx2: 3363.0
vvc_alf_classify_36x44_10_c: 15023.5
vvc_alf_classify_36x44_10_avx2: 2781.7
vvc_alf_classify_36x48_8_c: 16695.5
vvc_alf_classify_36x48_8_avx2: 9654.0
vvc_alf_classify_36x48_10_c: 16299.2
vvc_alf_classify_36x48_10_avx2: 2927.7
vvc_alf_classify_36x52_8_c: 18018.0
vvc_alf_classify_36x52_8_avx2: 3806.5
vvc_alf_classify_36x52_10_c: 17572.0
vvc_alf_classify_36x52_10_avx2: 3301.2
vvc_alf_classify_36x56_8_c: 19315.2
vvc_alf_classify_36x56_8_avx2: 4000.7
vvc_alf_classify_36x56_10_c: 18855.7
vvc_alf_classify_36x56_10_avx2: 3398.5
vvc_alf_classify_36x60_8_c: 20690.0
vvc_alf_classify_36x60_8_avx2: 4368.7
vvc_alf_classify_36x60_10_c: 20216.2
vvc_alf_classify_36x60_10_avx2: 3792.7
vvc_alf_classify_36x64_8_c: 22015.5
vvc_alf_classify_36x64_8_avx2: 4555.0
vvc_alf_classify_36x64_10_c: 21487.5
vvc_alf_classify_36x64_10_avx2: 3849.7
vvc_alf_classify_36x68_8_c: 23267.2
vvc_alf_classify_36x68_8_avx2: 4905.0
vvc_alf_classify_36x68_10_c: 22714.0
vvc_alf_classify_36x68_10_avx2: 4169.7
vvc_alf_classify_36x72_8_c: 24612.0
vvc_alf_classify_36x72_8_avx2: 5092.5
vvc_alf_classify_36x72_10_c: 24062.5
vvc_alf_classify_36x72_10_avx2: 4315.0
vvc_alf_classify_36x76_8_c: 26001.7
vvc_alf_classify_36x76_8_avx2: 7126.2
vvc_alf_classify_36x76_10_c: 25349.2
vvc_alf_classify_36x76_10_avx2: 4625.0
vvc_alf_classify_36x80_8_c: 27225.2
vvc_alf_classify_36x80_8_avx2: 5617.5
vvc_alf_classify_36x80_10_c: 26705.5
vvc_alf_classify_36x80_10_avx2: 4766.5
vvc_alf_classify_36x84_8_c: 28567.0
vvc_alf_classify_36x84_8_avx2: 5972.7
vvc_alf_classify_36x84_10_c: 28726.5
vvc_alf_classify_36x84_10_avx2: 5063.5
vvc_alf_classify_36x88_8_c: 29915.7
vvc_alf_classify_36x88_8_avx2: 6155.2
vvc_alf_classify_36x88_10_c: 30048.7
vvc_alf_classify_36x88_10_avx2: 5210.2
vvc_alf_classify_36x92_8_c: 31168.2
vvc_alf_classify_36x92_8_avx2: 6854.5
vvc_alf_classify_36x92_10_c: 30626.2
vvc_alf_classify_36x92_10_avx2: 5526.7
vvc_alf_classify_36x96_8_c: 32525.0
vvc_alf_classify_36x96_8_avx2: 6683.2
vvc_alf_classify_36x96_10_c: 31923.2
vvc_alf_classify_36x96_10_avx2: 5685.2
vvc_alf_classify_36x100_8_c: 34694.0
vvc_alf_classify_36x100_8_avx2: 9107.7
vvc_alf_classify_36x100_10_c: 33254.0
vvc_alf_classify_36x100_10_avx2: 6504.5
vvc_alf_classify_36x104_8_c: 35172.5
vvc_alf_classify_36x104_8_avx2: 9890.5
vvc_alf_classify_36x104_10_c: 64638.0
vvc_alf_classify_36x104_10_avx2: 6124.7
vvc_alf_classify_36x108_8_c: 36582.0
vvc_alf_classify_36x108_8_avx2: 7629.7
vvc_alf_classify_36x108_10_c: 36721.0
vvc_alf_classify_36x108_10_avx2: 6473.2
vvc_alf_classify_36x112_8_c: 37802.0
vvc_alf_classify_36x112_8_avx2: 7798.7
vvc_alf_classify_36x112_10_c: 71670.5
vvc_alf_classify_36x112_10_avx2: 6648.2
vvc_alf_classify_36x116_8_c: 39173.0
vvc_alf_classify_36x116_8_avx2: 8202.2
vvc_alf_classify_36x116_10_c: 39524.7
vvc_alf_classify_36x116_10_avx2: 7047.2
vvc_alf_classify_36x120_8_c: 41516.0
vvc_alf_classify_36x120_8_avx2: 8604.5
vvc_alf_classify_36x120_10_c: 39835.0
vvc_alf_classify_36x120_10_avx2: 7417.0
vvc_alf_classify_36x124_8_c: 42846.7
vvc_alf_classify_36x124_8_avx2: 10122.2
vvc_alf_classify_36x124_10_c: 41129.2
vvc_alf_classify_36x124_10_avx2: 7602.0
vvc_alf_classify_36x128_8_c: 43040.7
vvc_alf_classify_36x128_8_avx2: 8924.0
vvc_alf_classify_36x128_10_c: 42391.5
vvc_alf_classify_36x128_10_avx2: 7787.7
vvc_alf_classify_40x4_8_c: 2649.5
vvc_alf_classify_40x4_8_avx2: 552.2
vvc_alf_classify_40x4_10_c: 2318.5
vvc_alf_classify_40x4_10_avx2: 502.2
vvc_alf_classify_40x8_8_c: 3960.2
vvc_alf_classify_40x8_8_avx2: 733.2
vvc_alf_classify_40x8_10_c: 3741.7
vvc_alf_classify_40x8_10_avx2: 637.7
vvc_alf_classify_40x12_8_c: 5294.2
vvc_alf_classify_40x12_8_avx2: 1085.5
vvc_alf_classify_40x12_10_c: 5158.7
vvc_alf_classify_40x12_10_avx2: 967.7
vvc_alf_classify_40x16_8_c: 6916.0
vvc_alf_classify_40x16_8_avx2: 1268.0
vvc_alf_classify_40x16_10_c: 6594.5
vvc_alf_classify_40x16_10_avx2: 1087.5
vvc_alf_classify_40x20_8_c: 8402.7
vvc_alf_classify_40x20_8_avx2: 1629.0
vvc_alf_classify_40x20_10_c: 8017.7
vvc_alf_classify_40x20_10_avx2: 1392.2
vvc_alf_classify_40x24_8_c: 9651.5
vvc_alf_classify_40x24_8_avx2: 1800.2
vvc_alf_classify_40x24_10_c: 9426.0
vvc_alf_classify_40x24_10_avx2: 1531.5
vvc_alf_classify_40x28_8_c: 11395.2
vvc_alf_classify_40x28_8_avx2: 2224.7
vvc_alf_classify_40x28_10_c: 10799.0
vvc_alf_classify_40x28_10_avx2: 1953.7
vvc_alf_classify_40x32_8_c: 12789.5
vvc_alf_classify_40x32_8_avx2: 2678.5
vvc_alf_classify_40x32_10_c: 16857.5
vvc_alf_classify_40x32_10_avx2: 2157.0
vvc_alf_classify_40x36_8_c: 14054.7
vvc_alf_classify_40x36_8_avx2: 2760.2
vvc_alf_classify_40x36_10_c: 13709.2
vvc_alf_classify_40x36_10_avx2: 2347.0
vvc_alf_classify_40x40_8_c: 15489.0
vvc_alf_classify_40x40_8_avx2: 2942.5
vvc_alf_classify_40x40_10_c: 15090.7
vvc_alf_classify_40x40_10_avx2: 2612.0
vvc_alf_classify_40x44_8_c: 16967.2
vvc_alf_classify_40x44_8_avx2: 3302.2
vvc_alf_classify_40x44_10_c: 16514.5
vvc_alf_classify_40x44_10_avx2: 2794.5
vvc_alf_classify_40x48_8_c: 26976.5
vvc_alf_classify_40x48_8_avx2: 9696.5
vvc_alf_classify_40x48_10_c: 17966.7
vvc_alf_classify_40x48_10_avx2: 3013.0
vvc_alf_classify_40x52_8_c: 19828.2
vvc_alf_classify_40x52_8_avx2: 3834.0
vvc_alf_classify_40x52_10_c: 19325.7
vvc_alf_classify_40x52_10_avx2: 3338.5
vvc_alf_classify_40x56_8_c: 21271.5
vvc_alf_classify_40x56_8_avx2: 4021.7
vvc_alf_classify_40x56_10_c: 21445.0
vvc_alf_classify_40x56_10_avx2: 3406.7
vvc_alf_classify_40x60_8_c: 22737.7
vvc_alf_classify_40x60_8_avx2: 4376.2
vvc_alf_classify_40x60_10_c: 22215.7
vvc_alf_classify_40x60_10_avx2: 4047.0
vvc_alf_classify_40x64_8_c: 24652.5
vvc_alf_classify_40x64_8_avx2: 4566.2
vvc_alf_classify_40x64_10_c: 23704.2
vvc_alf_classify_40x64_10_avx2: 3869.0
vvc_alf_classify_40x68_8_c: 26322.2
vvc_alf_classify_40x68_8_avx2: 4939.0
vvc_alf_classify_40x68_10_c: 25080.5
vvc_alf_classify_40x68_10_avx2: 4190.7
vvc_alf_classify_40x72_8_c: 27159.7
vvc_alf_classify_40x72_8_avx2: 5121.5
vvc_alf_classify_40x72_10_c: 26473.7
vvc_alf_classify_40x72_10_avx2: 4589.0
vvc_alf_classify_40x76_8_c: 28565.5
vvc_alf_classify_40x76_8_avx2: 6863.5
vvc_alf_classify_40x76_10_c: 27863.5
vvc_alf_classify_40x76_10_avx2: 4644.2
vvc_alf_classify_40x80_8_c: 30042.5
vvc_alf_classify_40x80_8_avx2: 5689.0
vvc_alf_classify_40x80_10_c: 29329.7
vvc_alf_classify_40x80_10_avx2: 4794.0
vvc_alf_classify_40x84_8_c: 31592.0
vvc_alf_classify_40x84_8_avx2: 5999.0
vvc_alf_classify_40x84_10_c: 32422.5
vvc_alf_classify_40x84_10_avx2: 5090.5
vvc_alf_classify_40x88_8_c: 32943.7
vvc_alf_classify_40x88_8_avx2: 6529.7
vvc_alf_classify_40x88_10_c: 33863.0
vvc_alf_classify_40x88_10_avx2: 5238.5
vvc_alf_classify_40x92_8_c: 34382.5
vvc_alf_classify_40x92_8_avx2: 6716.7
vvc_alf_classify_40x92_10_c: 33669.7
vvc_alf_classify_40x92_10_avx2: 5557.2
vvc_alf_classify_40x96_8_c: 35925.2
vvc_alf_classify_40x96_8_avx2: 6719.0
vvc_alf_classify_40x96_10_c: 36098.0
vvc_alf_classify_40x96_10_avx2: 5710.7
vvc_alf_classify_40x100_8_c: 37341.0
vvc_alf_classify_40x100_8_avx2: 7070.5
vvc_alf_classify_40x100_10_c: 37602.0
vvc_alf_classify_40x100_10_avx2: 6039.0
vvc_alf_classify_40x104_8_c: 38805.7
vvc_alf_classify_40x104_8_avx2: 7258.7
vvc_alf_classify_40x104_10_c: 39000.5
vvc_alf_classify_40x104_10_avx2: 6165.7
vvc_alf_classify_40x108_8_c: 40170.7
vvc_alf_classify_40x108_8_avx2: 7649.0
vvc_alf_classify_40x108_10_c: 39418.0
vvc_alf_classify_40x108_10_avx2: 6523.0
vvc_alf_classify_40x112_8_c: 41707.0
vvc_alf_classify_40x112_8_avx2: 7844.7
vvc_alf_classify_40x112_10_c: 92090.5
vvc_alf_classify_40x112_10_avx2: 6701.2
vvc_alf_classify_40x116_8_c: 48145.5
vvc_alf_classify_40x116_8_avx2: 8430.5
vvc_alf_classify_40x116_10_c: 43498.7
vvc_alf_classify_40x116_10_avx2: 7109.0
vvc_alf_classify_40x120_8_c: 44681.2
vvc_alf_classify_40x120_8_avx2: 8687.5
vvc_alf_classify_40x120_10_c: 69010.7
vvc_alf_classify_40x120_10_avx2: 7246.2
vvc_alf_classify_40x124_8_c: 95709.0
vvc_alf_classify_40x124_8_avx2: 8795.7
vvc_alf_classify_40x124_10_c: 46376.5
vvc_alf_classify_40x124_10_avx2: 7640.7
vvc_alf_classify_40x128_8_c: 47594.5
vvc_alf_classify_40x128_8_avx2: 9196.5
vvc_alf_classify_40x128_10_c: 46446.2
vvc_alf_classify_40x128_10_avx2: 7808.5
vvc_alf_classify_44x4_8_c: 4501.5
vvc_alf_classify_44x4_8_avx2: 556.0
vvc_alf_classify_44x4_10_c: 2544.2
vvc_alf_classify_44x4_10_avx2: 497.2
vvc_alf_classify_44x8_8_c: 4198.2
vvc_alf_classify_44x8_8_avx2: 758.5
vvc_alf_classify_44x8_10_c: 4091.0
vvc_alf_classify_44x8_10_avx2: 637.2
vvc_alf_classify_44x12_8_c: 6121.0
vvc_alf_classify_44x12_8_avx2: 1093.0
vvc_alf_classify_44x12_10_c: 5634.0
vvc_alf_classify_44x12_10_avx2: 976.7
vvc_alf_classify_44x16_8_c: 7561.2
vvc_alf_classify_44x16_8_avx2: 1278.2
vvc_alf_classify_44x16_10_c: 7175.5
vvc_alf_classify_44x16_10_avx2: 1084.0
vvc_alf_classify_44x20_8_c: 17157.0
vvc_alf_classify_44x20_8_avx2: 1632.0
vvc_alf_classify_44x20_10_c: 8728.0
vvc_alf_classify_44x20_10_avx2: 9631.2
vvc_alf_classify_44x24_8_c: 10555.5
vvc_alf_classify_44x24_8_avx2: 1807.0
vvc_alf_classify_44x24_10_c: 10261.2
vvc_alf_classify_44x24_10_avx2: 1533.0
vvc_alf_classify_44x28_8_c: 12429.5
vvc_alf_classify_44x28_8_avx2: 2239.0
vvc_alf_classify_44x28_10_c: 12145.0
vvc_alf_classify_44x28_10_avx2: 1972.7
vvc_alf_classify_44x32_8_c: 13739.7
vvc_alf_classify_44x32_8_avx2: 2425.7
vvc_alf_classify_44x32_10_c: 13375.7
vvc_alf_classify_44x32_10_avx2: 2103.0
vvc_alf_classify_44x36_8_c: 15328.2
vvc_alf_classify_44x36_8_avx2: 2781.2
vvc_alf_classify_44x36_10_c: 14929.7
vvc_alf_classify_44x36_10_avx2: 2368.5
vvc_alf_classify_44x40_8_c: 16936.0
vvc_alf_classify_44x40_8_avx2: 3030.5
vvc_alf_classify_44x40_10_c: 16478.0
vvc_alf_classify_44x40_10_avx2: 2508.5
vvc_alf_classify_44x44_8_c: 18484.2
vvc_alf_classify_44x44_8_avx2: 3407.7
vvc_alf_classify_44x44_10_c: 18053.7
vvc_alf_classify_44x44_10_avx2: 2819.0
vvc_alf_classify_44x48_8_c: 20096.5
vvc_alf_classify_44x48_8_avx2: 5928.0
vvc_alf_classify_44x48_10_c: 19579.0
vvc_alf_classify_44x48_10_avx2: 2964.2
vvc_alf_classify_44x52_8_c: 21637.2
vvc_alf_classify_44x52_8_avx2: 3855.5
vvc_alf_classify_44x52_10_c: 21147.0
vvc_alf_classify_44x52_10_avx2: 3356.7
vvc_alf_classify_44x56_8_c: 23266.5
vvc_alf_classify_44x56_8_avx2: 4053.7
vvc_alf_classify_44x56_10_c: 22671.5
vvc_alf_classify_44x56_10_avx2: 3439.5
vvc_alf_classify_44x60_8_c: 24811.0
vvc_alf_classify_44x60_8_avx2: 4527.0
vvc_alf_classify_44x60_10_c: 24184.7
vvc_alf_classify_44x60_10_avx2: 3758.0
vvc_alf_classify_44x64_8_c: 26430.0
vvc_alf_classify_44x64_8_avx2: 4610.7
vvc_alf_classify_44x64_10_c: 25782.0
vvc_alf_classify_44x64_10_avx2: 3912.2
vvc_alf_classify_44x68_8_c: 29482.5
vvc_alf_classify_44x68_8_avx2: 4960.7
vvc_alf_classify_44x68_10_c: 27418.7
vvc_alf_classify_44x68_10_avx2: 4224.2
vvc_alf_classify_44x72_8_c: 29607.5
vvc_alf_classify_44x72_8_avx2: 5144.0
vvc_alf_classify_44x72_10_c: 28970.7
vvc_alf_classify_44x72_10_avx2: 4363.5
vvc_alf_classify_44x76_8_c: 31137.7
vvc_alf_classify_44x76_8_avx2: 7238.0
vvc_alf_classify_44x76_10_c: 31328.7
vvc_alf_classify_44x76_10_avx2: 4695.0
vvc_alf_classify_44x80_8_c: 32779.7
vvc_alf_classify_44x80_8_avx2: 5692.7
vvc_alf_classify_44x80_10_c: 32152.7
vvc_alf_classify_44x80_10_avx2: 4960.0
vvc_alf_classify_44x84_8_c: 34326.5
vvc_alf_classify_44x84_8_avx2: 6049.5
vvc_alf_classify_44x84_10_c: 35506.7
vvc_alf_classify_44x84_10_avx2: 5138.7
vvc_alf_classify_44x88_8_c: 35976.7
vvc_alf_classify_44x88_8_avx2: 6567.7
vvc_alf_classify_44x88_10_c: 35217.2
vvc_alf_classify_44x88_10_avx2: 5289.2
vvc_alf_classify_44x92_8_c: 38601.0
vvc_alf_classify_44x92_8_avx2: 6751.0
vvc_alf_classify_44x92_10_c: 36839.7
vvc_alf_classify_44x92_10_avx2: 5606.5
vvc_alf_classify_44x96_8_c: 52745.5
vvc_alf_classify_44x96_8_avx2: 6772.5
vvc_alf_classify_44x96_10_c: 71567.2
vvc_alf_classify_44x96_10_avx2: 5907.2
vvc_alf_classify_44x100_8_c: 41777.5
vvc_alf_classify_44x100_8_avx2: 7133.0
vvc_alf_classify_44x100_10_c: 41089.0
vvc_alf_classify_44x100_10_avx2: 6064.5
vvc_alf_classify_44x104_8_c: 42395.0
vvc_alf_classify_44x104_8_avx2: 7311.7
vvc_alf_classify_44x104_10_c: 77076.5
vvc_alf_classify_44x104_10_avx2: 6368.2
vvc_alf_classify_44x108_8_c: 43981.2
vvc_alf_classify_44x108_8_avx2: 7697.5
vvc_alf_classify_44x108_10_c: 43128.0
vvc_alf_classify_44x108_10_avx2: 6578.2
vvc_alf_classify_44x112_8_c: 45534.5
vvc_alf_classify_44x112_8_avx2: 7888.0
vvc_alf_classify_44x112_10_c: 45932.7
vvc_alf_classify_44x112_10_avx2: 6765.2
vvc_alf_classify_44x116_8_c: 47275.0
vvc_alf_classify_44x116_8_avx2: 8303.5
vvc_alf_classify_44x116_10_c: 47532.2
vvc_alf_classify_44x116_10_avx2: 7132.2
vvc_alf_classify_44x120_8_c: 48868.7
vvc_alf_classify_44x120_8_avx2: 8948.5
vvc_alf_classify_44x120_10_c: 47850.0
vvc_alf_classify_44x120_10_avx2: 7306.5
vvc_alf_classify_44x124_8_c: 53115.5
vvc_alf_classify_44x124_8_avx2: 8924.0
vvc_alf_classify_44x124_10_c: 49986.2
vvc_alf_classify_44x124_10_avx2: 7671.5
vvc_alf_classify_44x128_8_c: 52051.5
vvc_alf_classify_44x128_8_avx2: 9042.2
vvc_alf_classify_44x128_10_c: 51696.0
vvc_alf_classify_44x128_10_avx2: 17807.2
vvc_alf_classify_48x4_8_c: 3143.5
vvc_alf_classify_48x4_8_avx2: 703.2
vvc_alf_classify_48x4_10_c: 2737.7
vvc_alf_classify_48x4_10_avx2: 586.5
vvc_alf_classify_48x8_8_c: 4549.0
vvc_alf_classify_48x8_8_avx2: 937.2
vvc_alf_classify_48x8_10_c: 4553.7
vvc_alf_classify_48x8_10_avx2: 769.0
vvc_alf_classify_48x12_8_c: 6429.2
vvc_alf_classify_48x12_8_avx2: 1349.0
vvc_alf_classify_48x12_10_c: 6273.2
vvc_alf_classify_48x12_10_avx2: 1172.5
vvc_alf_classify_48x16_8_c: 8193.0
vvc_alf_classify_48x16_8_avx2: 1585.2
vvc_alf_classify_48x16_10_c: 7807.0
vvc_alf_classify_48x16_10_avx2: 1331.2
vvc_alf_classify_48x20_8_c: 10251.0
vvc_alf_classify_48x20_8_avx2: 2003.5
vvc_alf_classify_48x20_10_c: 9447.5
vvc_alf_classify_48x20_10_avx2: 9912.5
vvc_alf_classify_48x24_8_c: 11419.5
vvc_alf_classify_48x24_8_avx2: 2235.2
vvc_alf_classify_48x24_10_c: 11424.2
vvc_alf_classify_48x24_10_avx2: 1866.5
vvc_alf_classify_48x28_8_c: 13205.7
vvc_alf_classify_48x28_8_avx2: 2642.7
vvc_alf_classify_48x28_10_c: 12837.2
vvc_alf_classify_48x28_10_avx2: 2232.2
vvc_alf_classify_48x32_8_c: 26485.7
vvc_alf_classify_48x32_8_avx2: 2895.0
vvc_alf_classify_48x32_10_c: 14525.2
vvc_alf_classify_48x32_10_avx2: 2473.5
vvc_alf_classify_48x36_8_c: 16583.0
vvc_alf_classify_48x36_8_avx2: 3313.5
vvc_alf_classify_48x36_10_c: 23623.7
vvc_alf_classify_48x36_10_avx2: 3972.5
vvc_alf_classify_48x40_8_c: 18331.5
vvc_alf_classify_48x40_8_avx2: 3554.2
vvc_alf_classify_48x40_10_c: 17877.2
vvc_alf_classify_48x40_10_avx2: 3018.2
vvc_alf_classify_48x44_8_c: 20040.5
vvc_alf_classify_48x44_8_avx2: 3972.5
vvc_alf_classify_48x44_10_c: 19598.2
vvc_alf_classify_48x44_10_avx2: 3299.5
vvc_alf_classify_48x48_8_c: 21781.0
vvc_alf_classify_48x48_8_avx2: 7116.0
vvc_alf_classify_48x48_10_c: 21293.2
vvc_alf_classify_48x48_10_avx2: 3556.2
vvc_alf_classify_48x52_8_c: 23545.7
vvc_alf_classify_48x52_8_avx2: 4627.2
vvc_alf_classify_48x52_10_c: 22884.5
vvc_alf_classify_48x52_10_avx2: 3838.5
vvc_alf_classify_48x56_8_c: 25240.7
vvc_alf_classify_48x56_8_avx2: 4890.7
vvc_alf_classify_48x56_10_c: 24615.2
vvc_alf_classify_48x56_10_avx2: 4055.2
vvc_alf_classify_48x60_8_c: 26960.2
vvc_alf_classify_48x60_8_avx2: 5295.0
vvc_alf_classify_48x60_10_c: 26313.7
vvc_alf_classify_48x60_10_avx2: 4404.5
vvc_alf_classify_48x64_8_c: 28666.0
vvc_alf_classify_48x64_8_avx2: 5558.7
vvc_alf_classify_48x64_10_c: 27977.2
vvc_alf_classify_48x64_10_avx2: 4566.7
vvc_alf_classify_48x68_8_c: 30411.0
vvc_alf_classify_48x68_8_avx2: 5934.7
vvc_alf_classify_48x68_10_c: 29682.7
vvc_alf_classify_48x68_10_avx2: 4932.5
vvc_alf_classify_48x72_8_c: 40354.7
vvc_alf_classify_48x72_8_avx2: 6214.7
vvc_alf_classify_48x72_10_c: 31432.7
vvc_alf_classify_48x72_10_avx2: 5120.7
vvc_alf_classify_48x76_8_c: 33815.5
vvc_alf_classify_48x76_8_avx2: 6785.2
vvc_alf_classify_48x76_10_c: 33106.7
vvc_alf_classify_48x76_10_avx2: 5484.2
vvc_alf_classify_48x80_8_c: 35575.2
vvc_alf_classify_48x80_8_avx2: 6821.0
vvc_alf_classify_48x80_10_c: 34751.0
vvc_alf_classify_48x80_10_avx2: 5822.0
vvc_alf_classify_48x84_8_c: 37262.0
vvc_alf_classify_48x84_8_avx2: 7482.2
vvc_alf_classify_48x84_10_c: 52635.5
vvc_alf_classify_48x84_10_avx2: 6094.0
vvc_alf_classify_48x88_8_c: 39039.5
vvc_alf_classify_48x88_8_avx2: 7874.7
vvc_alf_classify_48x88_10_c: 39220.5
vvc_alf_classify_48x88_10_avx2: 6298.2
vvc_alf_classify_48x92_8_c: 40761.2
vvc_alf_classify_48x92_8_avx2: 7922.5
vvc_alf_classify_48x92_10_c: 41033.7
vvc_alf_classify_48x92_10_avx2: 6712.2
vvc_alf_classify_48x96_8_c: 42540.2
vvc_alf_classify_48x96_8_avx2: 8176.2
vvc_alf_classify_48x96_10_c: 52250.7
vvc_alf_classify_48x96_10_avx2: 14817.2
vvc_alf_classify_48x100_8_c: 44212.7
vvc_alf_classify_48x100_8_avx2: 9316.2
vvc_alf_classify_48x100_10_c: 44433.7
vvc_alf_classify_48x100_10_avx2: 7335.5
vvc_alf_classify_48x104_8_c: 45995.7
vvc_alf_classify_48x104_8_avx2: 9066.5
vvc_alf_classify_48x104_10_c: 44958.2
vvc_alf_classify_48x104_10_avx2: 7500.7
vvc_alf_classify_48x108_8_c: 47680.0
vvc_alf_classify_48x108_8_avx2: 9231.5
vvc_alf_classify_48x108_10_c: 47952.0
vvc_alf_classify_48x108_10_avx2: 7934.2
vvc_alf_classify_48x112_8_c: 49484.5
vvc_alf_classify_48x112_8_avx2: 9456.2
vvc_alf_classify_48x112_10_c: 49713.5
vvc_alf_classify_48x112_10_avx2: 8127.2
vvc_alf_classify_48x116_8_c: 51270.2
vvc_alf_classify_48x116_8_avx2: 9944.2
vvc_alf_classify_48x116_10_c: 51405.7
vvc_alf_classify_48x116_10_avx2: 8536.0
vvc_alf_classify_48x120_8_c: 52977.7
vvc_alf_classify_48x120_8_avx2: 10223.2
vvc_alf_classify_48x120_10_c: 51797.5
vvc_alf_classify_48x120_10_avx2: 8768.2
vvc_alf_classify_48x124_8_c: 56032.0
vvc_alf_classify_48x124_8_avx2: 10860.5
vvc_alf_classify_48x124_10_c: 53594.5
vvc_alf_classify_48x124_10_avx2: 9158.5
vvc_alf_classify_48x128_8_c: 56197.7
vvc_alf_classify_48x128_8_avx2: 10849.7
vvc_alf_classify_48x128_10_c: 55097.7
vvc_alf_classify_48x128_10_avx2: 9347.0
vvc_alf_classify_52x4_8_c: 4955.5
vvc_alf_classify_52x4_8_avx2: 742.2
vvc_alf_classify_52x4_10_c: 2937.5
vvc_alf_classify_52x4_10_avx2: 640.2
vvc_alf_classify_52x8_8_c: 5191.5
vvc_alf_classify_52x8_8_avx2: 989.5
vvc_alf_classify_52x8_10_c: 4778.2
vvc_alf_classify_52x8_10_avx2: 830.7
vvc_alf_classify_52x12_8_c: 6754.0
vvc_alf_classify_52x12_8_avx2: 1461.5
vvc_alf_classify_52x12_10_c: 6577.5
vvc_alf_classify_52x12_10_avx2: 1283.5
vvc_alf_classify_52x16_8_c: 19243.7
vvc_alf_classify_52x16_8_avx2: 1700.5
vvc_alf_classify_52x16_10_c: 8391.5
vvc_alf_classify_52x16_10_avx2: 1446.5
vvc_alf_classify_52x20_8_c: 10467.0
vvc_alf_classify_52x20_8_avx2: 2224.2
vvc_alf_classify_52x20_10_c: 10221.2
vvc_alf_classify_52x20_10_avx2: 1905.5
vvc_alf_classify_52x24_8_c: 12339.0
vvc_alf_classify_52x24_8_avx2: 2491.2
vvc_alf_classify_52x24_10_c: 12622.7
vvc_alf_classify_52x24_10_avx2: 2095.2
vvc_alf_classify_52x28_8_c: 14197.0
vvc_alf_classify_52x28_8_avx2: 2936.0
vvc_alf_classify_52x28_10_c: 13860.5
vvc_alf_classify_52x28_10_avx2: 2513.0
vvc_alf_classify_52x32_8_c: 31290.5
vvc_alf_classify_52x32_8_avx2: 3186.7
vvc_alf_classify_52x32_10_c: 23000.0
vvc_alf_classify_52x32_10_avx2: 2685.0
vvc_alf_classify_52x36_8_c: 17915.2
vvc_alf_classify_52x36_8_avx2: 3651.0
vvc_alf_classify_52x36_10_c: 17448.2
vvc_alf_classify_52x36_10_avx2: 4415.5
vvc_alf_classify_52x40_8_c: 19768.0
vvc_alf_classify_52x40_8_avx2: 3899.7
vvc_alf_classify_52x40_10_c: 19243.0
vvc_alf_classify_52x40_10_avx2: 3287.5
vvc_alf_classify_52x44_8_c: 21639.5
vvc_alf_classify_52x44_8_avx2: 4371.0
vvc_alf_classify_52x44_10_c: 21100.2
vvc_alf_classify_52x44_10_avx2: 3687.5
vvc_alf_classify_52x48_8_c: 23510.7
vvc_alf_classify_52x48_8_avx2: 4614.5
vvc_alf_classify_52x48_10_c: 22895.5
vvc_alf_classify_52x48_10_avx2: 3876.5
vvc_alf_classify_52x52_8_c: 25365.7
vvc_alf_classify_52x52_8_avx2: 13366.7
vvc_alf_classify_52x52_10_c: 24681.5
vvc_alf_classify_52x52_10_avx2: 4296.5
vvc_alf_classify_52x56_8_c: 27864.5
vvc_alf_classify_52x56_8_avx2: 5337.5
vvc_alf_classify_52x56_10_c: 26472.5
vvc_alf_classify_52x56_10_avx2: 4518.5
vvc_alf_classify_52x60_8_c: 29038.5
vvc_alf_classify_52x60_8_avx2: 5818.7
vvc_alf_classify_52x60_10_c: 28356.2
vvc_alf_classify_52x60_10_avx2: 4917.5
vvc_alf_classify_52x64_8_c: 30848.7
vvc_alf_classify_52x64_8_avx2: 6059.7
vvc_alf_classify_52x64_10_c: 30126.5
vvc_alf_classify_52x64_10_avx2: 5084.5
vvc_alf_classify_52x68_8_c: 32760.5
vvc_alf_classify_52x68_8_avx2: 6517.0
vvc_alf_classify_52x68_10_c: 32049.2
vvc_alf_classify_52x68_10_avx2: 5516.2
vvc_alf_classify_52x72_8_c: 34608.0
vvc_alf_classify_52x72_8_avx2: 14938.0
vvc_alf_classify_52x72_10_c: 33837.2
vvc_alf_classify_52x72_10_avx2: 5722.5
vvc_alf_classify_52x76_8_c: 36504.7
vvc_alf_classify_52x76_8_avx2: 7409.2
vvc_alf_classify_52x76_10_c: 35682.5
vvc_alf_classify_52x76_10_avx2: 6141.0
vvc_alf_classify_52x80_8_c: 39394.0
vvc_alf_classify_52x80_8_avx2: 7482.2
vvc_alf_classify_52x80_10_c: 37561.5
vvc_alf_classify_52x80_10_avx2: 6672.7
vvc_alf_classify_52x84_8_c: 40214.0
vvc_alf_classify_52x84_8_avx2: 8228.7
vvc_alf_classify_52x84_10_c: 39395.5
vvc_alf_classify_52x84_10_avx2: 6864.2
vvc_alf_classify_52x88_8_c: 43282.7
vvc_alf_classify_52x88_8_avx2: 8458.5
vvc_alf_classify_52x88_10_c: 41324.2
vvc_alf_classify_52x88_10_avx2: 7058.5
vvc_alf_classify_52x92_8_c: 43975.2
vvc_alf_classify_52x92_8_avx2: 8942.5
vvc_alf_classify_52x92_10_c: 43035.5
vvc_alf_classify_52x92_10_avx2: 7503.7
vvc_alf_classify_52x96_8_c: 95769.7
vvc_alf_classify_52x96_8_avx2: 8966.5
vvc_alf_classify_52x96_10_c: 46109.2
vvc_alf_classify_52x96_10_avx2: 7730.2
vvc_alf_classify_52x100_8_c: 47693.5
vvc_alf_classify_52x100_8_avx2: 9698.7
vvc_alf_classify_52x100_10_c: 46808.7
vvc_alf_classify_52x100_10_avx2: 8168.2
vvc_alf_classify_52x104_8_c: 49524.0
vvc_alf_classify_52x104_8_avx2: 9676.0
vvc_alf_classify_52x104_10_c: 48575.2
vvc_alf_classify_52x104_10_avx2: 8846.5
vvc_alf_classify_52x108_8_c: 51498.7
vvc_alf_classify_52x108_8_avx2: 10391.7
vvc_alf_classify_52x108_10_c: 51799.0
vvc_alf_classify_52x108_10_avx2: 8842.0
vvc_alf_classify_52x112_8_c: 53450.7
vvc_alf_classify_52x112_8_avx2: 10373.7
vvc_alf_classify_52x112_10_c: 55156.7
vvc_alf_classify_52x112_10_avx2: 9064.5
vvc_alf_classify_52x116_8_c: 55332.5
vvc_alf_classify_52x116_8_avx2: 10907.7
vvc_alf_classify_52x116_10_c: 55580.0
vvc_alf_classify_52x116_10_avx2: 9549.5
vvc_alf_classify_52x120_8_c: 57152.5
vvc_alf_classify_52x120_8_avx2: 11123.0
vvc_alf_classify_52x120_10_c: 55924.5
vvc_alf_classify_52x120_10_avx2: 9758.0
vvc_alf_classify_52x124_8_c: 60613.7
vvc_alf_classify_52x124_8_avx2: 11901.5
vvc_alf_classify_52x124_10_c: 57656.5
vvc_alf_classify_52x124_10_avx2: 10189.7
vvc_alf_classify_52x128_8_c: 60976.5
vvc_alf_classify_52x128_8_avx2: 11867.7
vvc_alf_classify_52x128_10_c: 59470.0
vvc_alf_classify_52x128_10_avx2: 10417.7
vvc_alf_classify_56x4_8_c: 6350.0
vvc_alf_classify_56x4_8_avx2: 751.7
vvc_alf_classify_56x4_10_c: 3149.7
vvc_alf_classify_56x4_10_avx2: 641.0
vvc_alf_classify_56x8_8_c: 5411.2
vvc_alf_classify_56x8_8_avx2: 994.5
vvc_alf_classify_56x8_10_c: 5112.7
vvc_alf_classify_56x8_10_avx2: 859.7
vvc_alf_classify_56x12_8_c: 7241.7
vvc_alf_classify_56x12_8_avx2: 1464.5
vvc_alf_classify_56x12_10_c: 7075.7
vvc_alf_classify_56x12_10_avx2: 1288.7
vvc_alf_classify_56x16_8_c: 9484.0
vvc_alf_classify_56x16_8_avx2: 1701.2
vvc_alf_classify_56x16_10_c: 8985.0
vvc_alf_classify_56x16_10_avx2: 1440.0
vvc_alf_classify_56x20_8_c: 11515.5
vvc_alf_classify_56x20_8_avx2: 2222.7
vvc_alf_classify_56x20_10_c: 11241.0
vvc_alf_classify_56x20_10_avx2: 1915.7
vvc_alf_classify_56x24_8_c: 13215.5
vvc_alf_classify_56x24_8_avx2: 2481.0
vvc_alf_classify_56x24_10_c: 13210.2
vvc_alf_classify_56x24_10_avx2: 2099.7
vvc_alf_classify_56x28_8_c: 15271.0
vvc_alf_classify_56x28_8_avx2: 2942.0
vvc_alf_classify_56x28_10_c: 14850.7
vvc_alf_classify_56x28_10_avx2: 2531.5
vvc_alf_classify_56x32_8_c: 17194.2
vvc_alf_classify_56x32_8_avx2: 3181.7
vvc_alf_classify_56x32_10_c: 16787.0
vvc_alf_classify_56x32_10_avx2: 2696.2
vvc_alf_classify_56x36_8_c: 19196.2
vvc_alf_classify_56x36_8_avx2: 3665.0
vvc_alf_classify_56x36_10_c: 18702.2
vvc_alf_classify_56x36_10_avx2: 3124.5
vvc_alf_classify_56x40_8_c: 21149.5
vvc_alf_classify_56x40_8_avx2: 3906.2
vvc_alf_classify_56x40_10_c: 20653.5
vvc_alf_classify_56x40_10_avx2: 3295.0
vvc_alf_classify_56x44_8_c: 23154.0
vvc_alf_classify_56x44_8_avx2: 4381.5
vvc_alf_classify_56x44_10_c: 22548.5
vvc_alf_classify_56x44_10_avx2: 3709.7
vvc_alf_classify_56x48_8_c: 25235.5
vvc_alf_classify_56x48_8_avx2: 4627.2
vvc_alf_classify_56x48_10_c: 24548.7
vvc_alf_classify_56x48_10_avx2: 3898.0
vvc_alf_classify_56x52_8_c: 27202.7
vvc_alf_classify_56x52_8_avx2: 5094.0
vvc_alf_classify_56x52_10_c: 36011.7
vvc_alf_classify_56x52_10_avx2: 4326.2
vvc_alf_classify_56x56_8_c: 29131.7
vvc_alf_classify_56x56_8_avx2: 5365.0
vvc_alf_classify_56x56_10_c: 28410.7
vvc_alf_classify_56x56_10_avx2: 4520.0
vvc_alf_classify_56x60_8_c: 31166.7
vvc_alf_classify_56x60_8_avx2: 5828.2
vvc_alf_classify_56x60_10_c: 30405.7
vvc_alf_classify_56x60_10_avx2: 4928.0
vvc_alf_classify_56x64_8_c: 33207.2
vvc_alf_classify_56x64_8_avx2: 6102.2
vvc_alf_classify_56x64_10_c: 32368.0
vvc_alf_classify_56x64_10_avx2: 5235.2
vvc_alf_classify_56x68_8_c: 35095.0
vvc_alf_classify_56x68_8_avx2: 6556.5
vvc_alf_classify_56x68_10_c: 34307.7
vvc_alf_classify_56x68_10_avx2: 5536.5
vvc_alf_classify_56x72_8_c: 37044.0
vvc_alf_classify_56x72_8_avx2: 6794.7
vvc_alf_classify_56x72_10_c: 36262.7
vvc_alf_classify_56x72_10_avx2: 5735.2
vvc_alf_classify_56x76_8_c: 39156.5
vvc_alf_classify_56x76_8_avx2: 7480.0
vvc_alf_classify_56x76_10_c: 64912.7
vvc_alf_classify_56x76_10_avx2: 6179.0
vvc_alf_classify_56x80_8_c: 41115.7
vvc_alf_classify_56x80_8_avx2: 7537.5
vvc_alf_classify_56x80_10_c: 40226.5
vvc_alf_classify_56x80_10_avx2: 6361.5
vvc_alf_classify_56x84_8_c: 43101.7
vvc_alf_classify_56x84_8_avx2: 8252.2
vvc_alf_classify_56x84_10_c: 44485.2
vvc_alf_classify_56x84_10_avx2: 6888.7
vvc_alf_classify_56x88_8_c: 45161.7
vvc_alf_classify_56x88_8_avx2: 8501.7
vvc_alf_classify_56x88_10_c: 45322.7
vvc_alf_classify_56x88_10_avx2: 7070.5
vvc_alf_classify_56x92_8_c: 47111.2
vvc_alf_classify_56x92_8_avx2: 8978.7
vvc_alf_classify_56x92_10_c: 46129.0
vvc_alf_classify_56x92_10_avx2: 7551.5
vvc_alf_classify_56x96_8_c: 49168.0
vvc_alf_classify_56x96_8_avx2: 9066.2
vvc_alf_classify_56x96_10_c: 61295.7
vvc_alf_classify_56x96_10_avx2: 7757.7
vvc_alf_classify_56x100_8_c: 51162.2
vvc_alf_classify_56x100_8_avx2: 9601.0
vvc_alf_classify_56x100_10_c: 50049.0
vvc_alf_classify_56x100_10_avx2: 8227.7
vvc_alf_classify_56x104_8_c: 53067.0
vvc_alf_classify_56x104_8_avx2: 10090.5
vvc_alf_classify_56x104_10_c: 51965.7
vvc_alf_classify_56x104_10_avx2: 8437.7
vvc_alf_classify_56x108_8_c: 93589.0
vvc_alf_classify_56x108_8_avx2: 10726.7
vvc_alf_classify_56x108_10_c: 55358.5
vvc_alf_classify_56x108_10_avx2: 8900.2
vvc_alf_classify_56x112_8_c: 57206.7
vvc_alf_classify_56x112_8_avx2: 10511.5
vvc_alf_classify_56x112_10_c: 55839.0
vvc_alf_classify_56x112_10_avx2: 9109.2
vvc_alf_classify_56x116_8_c: 59168.2
vvc_alf_classify_56x116_8_avx2: 10926.5
vvc_alf_classify_56x116_10_c: 59343.7
vvc_alf_classify_56x116_10_avx2: 9588.2
vvc_alf_classify_56x120_8_c: 61240.0
vvc_alf_classify_56x120_8_avx2: 11207.2
vvc_alf_classify_56x120_10_c: 59814.7
vvc_alf_classify_56x120_10_avx2: 9802.0
vvc_alf_classify_56x124_8_c: 66683.7
vvc_alf_classify_56x124_8_avx2: 11974.5
vvc_alf_classify_56x124_10_c: 61689.7
vvc_alf_classify_56x124_10_avx2: 10218.2
vvc_alf_classify_56x128_8_c: 65126.5
vvc_alf_classify_56x128_8_avx2: 11909.5
vvc_alf_classify_56x128_10_c: 63622.2
vvc_alf_classify_56x128_10_avx2: 10463.2
vvc_alf_classify_60x4_8_c: 11662.5
vvc_alf_classify_60x4_8_avx2: 755.5
vvc_alf_classify_60x4_10_c: 3397.0
vvc_alf_classify_60x4_10_avx2: 651.2
vvc_alf_classify_60x8_8_c: 5912.5
vvc_alf_classify_60x8_8_avx2: 996.7
vvc_alf_classify_60x8_10_c: 5475.2
vvc_alf_classify_60x8_10_avx2: 829.2
vvc_alf_classify_60x12_8_c: 7911.2
vvc_alf_classify_60x12_8_avx2: 1472.7
vvc_alf_classify_60x12_10_c: 7515.0
vvc_alf_classify_60x12_10_avx2: 1304.0
vvc_alf_classify_60x16_8_c: 10115.7
vvc_alf_classify_60x16_8_avx2: 1706.5
vvc_alf_classify_60x16_10_c: 9589.7
vvc_alf_classify_60x16_10_avx2: 1454.7
vvc_alf_classify_60x20_8_c: 12611.7
vvc_alf_classify_60x20_8_avx2: 2243.5
vvc_alf_classify_60x20_10_c: 11694.2
vvc_alf_classify_60x20_10_avx2: 1927.7
vvc_alf_classify_60x24_8_c: 14107.7
vvc_alf_classify_60x24_8_avx2: 2498.0
vvc_alf_classify_60x24_10_c: 13725.0
vvc_alf_classify_60x24_10_avx2: 2112.2
vvc_alf_classify_60x28_8_c: 16247.0
vvc_alf_classify_60x28_8_avx2: 2959.7
vvc_alf_classify_60x28_10_c: 15802.5
vvc_alf_classify_60x28_10_avx2: 2539.0
vvc_alf_classify_60x32_8_c: 18336.7
vvc_alf_classify_60x32_8_avx2: 3204.0
vvc_alf_classify_60x32_10_c: 17889.7
vvc_alf_classify_60x32_10_avx2: 2715.5
vvc_alf_classify_60x36_8_c: 20486.5
vvc_alf_classify_60x36_8_avx2: 3688.0
vvc_alf_classify_60x36_10_c: 19951.0
vvc_alf_classify_60x36_10_avx2: 4284.7
vvc_alf_classify_60x40_8_c: 22606.7
vvc_alf_classify_60x40_8_avx2: 3930.2
vvc_alf_classify_60x40_10_c: 22034.7
vvc_alf_classify_60x40_10_avx2: 3334.2
vvc_alf_classify_60x44_8_c: 25381.7
vvc_alf_classify_60x44_8_avx2: 4401.5
vvc_alf_classify_60x44_10_c: 24098.2
vvc_alf_classify_60x44_10_avx2: 3827.0
vvc_alf_classify_60x48_8_c: 26876.7
vvc_alf_classify_60x48_8_avx2: 4776.0
vvc_alf_classify_60x48_10_c: 26170.0
vvc_alf_classify_60x48_10_avx2: 3914.5
vvc_alf_classify_60x52_8_c: 28988.5
vvc_alf_classify_60x52_8_avx2: 5129.7
vvc_alf_classify_60x52_10_c: 28241.0
vvc_alf_classify_60x52_10_avx2: 4352.2
vvc_alf_classify_60x56_8_c: 31052.7
vvc_alf_classify_60x56_8_avx2: 5381.5
vvc_alf_classify_60x56_10_c: 30352.7
vvc_alf_classify_60x56_10_avx2: 4549.7
vvc_alf_classify_60x60_8_c: 33250.5
vvc_alf_classify_60x60_8_avx2: 5883.2
vvc_alf_classify_60x60_10_c: 32453.5
vvc_alf_classify_60x60_10_avx2: 4949.0
vvc_alf_classify_60x64_8_c: 35382.5
vvc_alf_classify_60x64_8_avx2: 6120.2
vvc_alf_classify_60x64_10_c: 34573.7
vvc_alf_classify_60x64_10_avx2: 5267.2
vvc_alf_classify_60x68_8_c: 37432.5
vvc_alf_classify_60x68_8_avx2: 6585.7
vvc_alf_classify_60x68_10_c: 36710.2
vvc_alf_classify_60x68_10_avx2: 5587.0
vvc_alf_classify_60x72_8_c: 39538.5
vvc_alf_classify_60x72_8_avx2: 7002.0
vvc_alf_classify_60x72_10_c: 38736.5
vvc_alf_classify_60x72_10_avx2: 5773.2
vvc_alf_classify_60x76_8_c: 41805.2
vvc_alf_classify_60x76_8_avx2: 7503.5
vvc_alf_classify_60x76_10_c: 41977.7
vvc_alf_classify_60x76_10_avx2: 6191.0
vvc_alf_classify_60x80_8_c: 43911.2
vvc_alf_classify_60x80_8_avx2: 7530.5
vvc_alf_classify_60x80_10_c: 42902.2
vvc_alf_classify_60x80_10_avx2: 6397.2
vvc_alf_classify_60x84_8_c: 46103.7
vvc_alf_classify_60x84_8_avx2: 8303.2
vvc_alf_classify_60x84_10_c: 46241.0
vvc_alf_classify_60x84_10_avx2: 6914.7
vvc_alf_classify_60x88_8_c: 48194.0
vvc_alf_classify_60x88_8_avx2: 8536.7
vvc_alf_classify_60x88_10_c: 47123.7
vvc_alf_classify_60x88_10_avx2: 7135.2
vvc_alf_classify_60x92_8_c: 50299.2
vvc_alf_classify_60x92_8_avx2: 9026.2
vvc_alf_classify_60x92_10_c: 49260.2
vvc_alf_classify_60x92_10_avx2: 7627.5
vvc_alf_classify_60x96_8_c: 52484.7
vvc_alf_classify_60x96_8_avx2: 9049.7
vvc_alf_classify_60x96_10_c: 51410.2
vvc_alf_classify_60x96_10_avx2: 7785.5
vvc_alf_classify_60x100_8_c: 54701.7
vvc_alf_classify_60x100_8_avx2: 9515.2
vvc_alf_classify_60x100_10_c: 61687.5
vvc_alf_classify_60x100_10_avx2: 8264.2
vvc_alf_classify_60x104_8_c: 56808.5
vvc_alf_classify_60x104_8_avx2: 9735.0
vvc_alf_classify_60x104_10_c: 58579.2
vvc_alf_classify_60x104_10_avx2: 8493.5
vvc_alf_classify_60x108_8_c: 59031.2
vvc_alf_classify_60x108_8_avx2: 10243.5
vvc_alf_classify_60x108_10_c: 57776.5
vvc_alf_classify_60x108_10_avx2: 8988.0
vvc_alf_classify_60x112_8_c: 61161.0
vvc_alf_classify_60x112_8_avx2: 19378.7
vvc_alf_classify_60x112_10_c: 59857.2
vvc_alf_classify_60x112_10_avx2: 9403.5
vvc_alf_classify_60x116_8_c: 63339.2
vvc_alf_classify_60x116_8_avx2: 11263.0
vvc_alf_classify_60x116_10_c: 108271.7
vvc_alf_classify_60x116_10_avx2: 9629.2
vvc_alf_classify_60x120_8_c: 65533.7
vvc_alf_classify_60x120_8_avx2: 11261.5
vvc_alf_classify_60x120_10_c: 63974.5
vvc_alf_classify_60x120_10_avx2: 9869.7
vvc_alf_classify_60x124_8_c: 128422.0
vvc_alf_classify_60x124_8_avx2: 12019.2
vvc_alf_classify_60x124_10_c: 65994.0
vvc_alf_classify_60x124_10_avx2: 10267.2
vvc_alf_classify_60x128_8_c: 90041.5
vvc_alf_classify_60x128_8_avx2: 12029.2
vvc_alf_classify_60x128_10_c: 68045.7
vvc_alf_classify_60x128_10_avx2: 12642.0
vvc_alf_classify_64x4_8_c: 3723.0
vvc_alf_classify_64x4_8_avx2: 871.0
vvc_alf_classify_64x4_10_c: 3592.7
vvc_alf_classify_64x4_10_avx2: 756.2
vvc_alf_classify_64x8_8_c: 5952.0
vvc_alf_classify_64x8_8_avx2: 1179.2
vvc_alf_classify_64x8_10_c: 5804.5
vvc_alf_classify_64x8_10_avx2: 967.0
vvc_alf_classify_64x12_8_c: 8222.5
vvc_alf_classify_64x12_8_avx2: 1734.0
vvc_alf_classify_64x12_10_c: 7983.5
vvc_alf_classify_64x12_10_avx2: 1499.5
vvc_alf_classify_64x16_8_c: 18657.7
vvc_alf_classify_64x16_8_avx2: 2030.5
vvc_alf_classify_64x16_10_c: 19251.0
vvc_alf_classify_64x16_10_avx2: 1699.0
vvc_alf_classify_64x20_8_c: 22643.2
vvc_alf_classify_64x20_8_avx2: 2597.0
vvc_alf_classify_64x20_10_c: 12420.2
vvc_alf_classify_64x20_10_avx2: 2186.0
vvc_alf_classify_64x24_8_c: 14990.2
vvc_alf_classify_64x24_8_avx2: 2894.2
vvc_alf_classify_64x24_10_c: 14601.5
vvc_alf_classify_64x24_10_avx2: 2477.2
vvc_alf_classify_64x28_8_c: 17265.0
vvc_alf_classify_64x28_8_avx2: 3422.2
vvc_alf_classify_64x28_10_c: 16790.7
vvc_alf_classify_64x28_10_avx2: 2880.7
vvc_alf_classify_64x32_8_c: 19616.0
vvc_alf_classify_64x32_8_avx2: 3724.5
vvc_alf_classify_64x32_10_c: 19511.7
vvc_alf_classify_64x32_10_avx2: 3105.7
vvc_alf_classify_64x36_8_c: 21791.2
vvc_alf_classify_64x36_8_avx2: 4250.5
vvc_alf_classify_64x36_10_c: 21212.7
vvc_alf_classify_64x36_10_avx2: 4861.7
vvc_alf_classify_64x40_8_c: 24067.0
vvc_alf_classify_64x40_8_avx2: 4558.5
vvc_alf_classify_64x40_10_c: 23391.5
vvc_alf_classify_64x40_10_avx2: 3793.0
vvc_alf_classify_64x44_8_c: 26300.2
vvc_alf_classify_64x44_8_avx2: 5098.5
vvc_alf_classify_64x44_10_c: 25601.7
vvc_alf_classify_64x44_10_avx2: 4381.0
vvc_alf_classify_64x48_8_c: 28551.5
vvc_alf_classify_64x48_8_avx2: 16879.5
vvc_alf_classify_64x48_10_c: 27861.2
vvc_alf_classify_64x48_10_avx2: 4515.2
vvc_alf_classify_64x52_8_c: 30856.2
vvc_alf_classify_64x52_8_avx2: 5891.5
vvc_alf_classify_64x52_10_c: 30032.0
vvc_alf_classify_64x52_10_avx2: 4925.7
vvc_alf_classify_64x56_8_c: 33136.5
vvc_alf_classify_64x56_8_avx2: 6249.7
vvc_alf_classify_64x56_10_c: 32272.7
vvc_alf_classify_64x56_10_avx2: 5179.0
vvc_alf_classify_64x60_8_c: 35354.0
vvc_alf_classify_64x60_8_avx2: 6783.7
vvc_alf_classify_64x60_10_c: 34487.2
vvc_alf_classify_64x60_10_avx2: 5625.0
vvc_alf_classify_64x64_8_c: 37661.2
vvc_alf_classify_64x64_8_avx2: 7085.2
vvc_alf_classify_64x64_10_c: 36687.7
vvc_alf_classify_64x64_10_avx2: 6024.5
vvc_alf_classify_64x68_8_c: 39874.5
vvc_alf_classify_64x68_8_avx2: 7678.7
vvc_alf_classify_64x68_10_c: 39001.0
vvc_alf_classify_64x68_10_avx2: 7132.5
vvc_alf_classify_64x72_8_c: 42170.2
vvc_alf_classify_64x72_8_avx2: 8176.2
vvc_alf_classify_64x72_10_c: 41205.2
vvc_alf_classify_64x72_10_avx2: 6690.0
vvc_alf_classify_64x76_8_c: 44412.5
vvc_alf_classify_64x76_8_avx2: 8500.2
vvc_alf_classify_64x76_10_c: 44564.0
vvc_alf_classify_64x76_10_avx2: 7182.0
vvc_alf_classify_64x80_8_c: 46690.2
vvc_alf_classify_64x80_8_avx2: 11504.2
vvc_alf_classify_64x80_10_c: 45674.0
vvc_alf_classify_64x80_10_avx2: 7404.7
vvc_alf_classify_64x84_8_c: 48897.7
vvc_alf_classify_64x84_8_avx2: 9564.7
vvc_alf_classify_64x84_10_c: 49035.0
vvc_alf_classify_64x84_10_avx2: 7923.7
vvc_alf_classify_64x88_8_c: 51226.2
vvc_alf_classify_64x88_8_avx2: 9865.2
vvc_alf_classify_64x88_10_c: 50101.2
vvc_alf_classify_64x88_10_avx2: 8192.0
vvc_alf_classify_64x92_8_c: 53611.5
vvc_alf_classify_64x92_8_avx2: 10117.0
vvc_alf_classify_64x92_10_c: 52247.2
vvc_alf_classify_64x92_10_avx2: 8652.7
vvc_alf_classify_64x96_8_c: 55821.0
vvc_alf_classify_64x96_8_avx2: 19153.0
vvc_alf_classify_64x96_10_c: 54491.7
vvc_alf_classify_64x96_10_avx2: 8941.2
vvc_alf_classify_64x100_8_c: 58148.2
vvc_alf_classify_64x100_8_avx2: 10996.2
vvc_alf_classify_64x100_10_c: 58252.5
vvc_alf_classify_64x100_10_avx2: 9427.5
vvc_alf_classify_64x104_8_c: 60409.0
vvc_alf_classify_64x104_8_avx2: 11382.7
vvc_alf_classify_64x104_10_c: 60470.7
vvc_alf_classify_64x104_10_avx2: 9708.7
vvc_alf_classify_64x108_8_c: 62720.5
vvc_alf_classify_64x108_8_avx2: 11765.0
vvc_alf_classify_64x108_10_c: 73424.5
vvc_alf_classify_64x108_10_avx2: 10192.2
vvc_alf_classify_64x112_8_c: 64955.2
vvc_alf_classify_64x112_8_avx2: 12140.2
vvc_alf_classify_64x112_10_c: 64983.5
vvc_alf_classify_64x112_10_avx2: 10426.7
vvc_alf_classify_64x116_8_c: 67216.7
vvc_alf_classify_64x116_8_avx2: 13101.2
vvc_alf_classify_64x116_10_c: 69119.5
vvc_alf_classify_64x116_10_avx2: 10902.5
vvc_alf_classify_64x120_8_c: 69503.7
vvc_alf_classify_64x120_8_avx2: 13039.0
vvc_alf_classify_64x120_10_c: 67813.2
vvc_alf_classify_64x120_10_avx2: 11182.0
vvc_alf_classify_64x124_8_c: 71656.7
vvc_alf_classify_64x124_8_avx2: 13608.0
vvc_alf_classify_64x124_10_c: 70031.0
vvc_alf_classify_64x124_10_avx2: 11697.0
vvc_alf_classify_64x128_8_c: 73895.0
vvc_alf_classify_64x128_8_avx2: 23036.5
vvc_alf_classify_64x128_10_c: 72049.0
vvc_alf_classify_64x128_10_avx2: 11957.7
vvc_alf_classify_68x4_8_c: 6104.5
vvc_alf_classify_68x4_8_avx2: 929.0
vvc_alf_classify_68x4_10_c: 3801.2
vvc_alf_classify_68x4_10_avx2: 787.0
vvc_alf_classify_68x8_8_c: 6298.2
vvc_alf_classify_68x8_8_avx2: 1232.7
vvc_alf_classify_68x8_10_c: 6138.0
vvc_alf_classify_68x8_10_avx2: 1017.0
vvc_alf_classify_68x12_8_c: 8929.5
vvc_alf_classify_68x12_8_avx2: 1834.0
vvc_alf_classify_68x12_10_c: 9148.2
vvc_alf_classify_68x12_10_avx2: 1610.0
vvc_alf_classify_68x16_8_c: 19903.5
vvc_alf_classify_68x16_8_avx2: 2142.0
vvc_alf_classify_68x16_10_c: 10808.0
vvc_alf_classify_68x16_10_avx2: 1802.7
vvc_alf_classify_68x20_8_c: 13827.2
vvc_alf_classify_68x20_8_avx2: 2750.5
vvc_alf_classify_68x20_10_c: 13162.7
vvc_alf_classify_68x20_10_avx2: 2342.5
vvc_alf_classify_68x24_8_c: 15862.7
vvc_alf_classify_68x24_8_avx2: 3061.7
vvc_alf_classify_68x24_10_c: 15506.0
vvc_alf_classify_68x24_10_avx2: 2576.2
vvc_alf_classify_68x28_8_c: 18326.2
vvc_alf_classify_68x28_8_avx2: 3641.7
vvc_alf_classify_68x28_10_c: 17756.0
vvc_alf_classify_68x28_10_avx2: 3089.2
vvc_alf_classify_68x32_8_c: 20681.0
vvc_alf_classify_68x32_8_avx2: 3935.2
vvc_alf_classify_68x32_10_c: 20153.0
vvc_alf_classify_68x32_10_avx2: 3324.0
vvc_alf_classify_68x36_8_c: 23079.5
vvc_alf_classify_68x36_8_avx2: 5052.5
vvc_alf_classify_68x36_10_c: 22453.2
vvc_alf_classify_68x36_10_avx2: 3839.2
vvc_alf_classify_68x40_8_c: 25528.0
vvc_alf_classify_68x40_8_avx2: 5375.5
vvc_alf_classify_68x40_10_c: 25439.5
vvc_alf_classify_68x40_10_avx2: 4083.5
vvc_alf_classify_68x44_8_c: 27835.7
vvc_alf_classify_68x44_8_avx2: 5425.5
vvc_alf_classify_68x44_10_c: 27156.7
vvc_alf_classify_68x44_10_avx2: 4715.0
vvc_alf_classify_68x48_8_c: 30252.5
vvc_alf_classify_68x48_8_avx2: 5725.5
vvc_alf_classify_68x48_10_c: 29457.7
vvc_alf_classify_68x48_10_avx2: 4934.2
vvc_alf_classify_68x52_8_c: 32636.7
vvc_alf_classify_68x52_8_avx2: 6303.5
vvc_alf_classify_68x52_10_c: 31844.5
vvc_alf_classify_68x52_10_avx2: 5314.5
vvc_alf_classify_68x56_8_c: 35039.2
vvc_alf_classify_68x56_8_avx2: 6623.5
vvc_alf_classify_68x56_10_c: 34209.0
vvc_alf_classify_68x56_10_avx2: 5575.7
vvc_alf_classify_68x60_8_c: 37513.0
vvc_alf_classify_68x60_8_avx2: 7210.5
vvc_alf_classify_68x60_10_c: 36603.7
vvc_alf_classify_68x60_10_avx2: 6089.7
vvc_alf_classify_68x64_8_c: 39852.7
vvc_alf_classify_68x64_8_avx2: 7506.0
vvc_alf_classify_68x64_10_c: 38954.0
vvc_alf_classify_68x64_10_avx2: 6312.2
vvc_alf_classify_68x68_8_c: 42225.2
vvc_alf_classify_68x68_8_avx2: 8175.5
vvc_alf_classify_68x68_10_c: 41316.2
vvc_alf_classify_68x68_10_avx2: 6930.5
vvc_alf_classify_68x72_8_c: 45843.7
vvc_alf_classify_68x72_8_avx2: 8676.7
vvc_alf_classify_68x72_10_c: 43700.5
vvc_alf_classify_68x72_10_avx2: 7206.7
vvc_alf_classify_68x76_8_c: 47006.2
vvc_alf_classify_68x76_8_avx2: 12198.0
vvc_alf_classify_68x76_10_c: 46000.2
vvc_alf_classify_68x76_10_avx2: 7708.7
vvc_alf_classify_68x80_8_c: 49479.2
vvc_alf_classify_68x80_8_avx2: 9338.0
vvc_alf_classify_68x80_10_c: 48364.5
vvc_alf_classify_68x80_10_avx2: 7955.2
vvc_alf_classify_68x84_8_c: 51963.5
vvc_alf_classify_68x84_8_avx2: 10207.0
vvc_alf_classify_68x84_10_c: 50718.5
vvc_alf_classify_68x84_10_avx2: 8750.5
vvc_alf_classify_68x88_8_c: 54344.2
vvc_alf_classify_68x88_8_avx2: 10493.7
vvc_alf_classify_68x88_10_c: 70013.2
vvc_alf_classify_68x88_10_avx2: 8810.7
vvc_alf_classify_68x92_8_c: 56737.5
vvc_alf_classify_68x92_8_avx2: 10814.5
vvc_alf_classify_68x92_10_c: 56925.7
vvc_alf_classify_68x92_10_avx2: 9342.5
vvc_alf_classify_68x96_8_c: 59233.0
vvc_alf_classify_68x96_8_avx2: 11322.5
vvc_alf_classify_68x96_10_c: 59301.2
vvc_alf_classify_68x96_10_avx2: 9627.0
vvc_alf_classify_68x100_8_c: 61642.2
vvc_alf_classify_68x100_8_avx2: 12001.2
vvc_alf_classify_68x100_10_c: 60201.2
vvc_alf_classify_68x100_10_avx2: 10178.7
vvc_alf_classify_68x104_8_c: 64171.0
vvc_alf_classify_68x104_8_avx2: 15589.5
vvc_alf_classify_68x104_10_c: 66096.0
vvc_alf_classify_68x104_10_avx2: 10442.5
vvc_alf_classify_68x108_8_c: 76781.2
vvc_alf_classify_68x108_8_avx2: 12918.5
vvc_alf_classify_68x108_10_c: 64967.2
vvc_alf_classify_68x108_10_avx2: 11000.0
vvc_alf_classify_68x112_8_c: 68881.7
vvc_alf_classify_68x112_8_avx2: 12894.0
vvc_alf_classify_68x112_10_c: 67330.7
vvc_alf_classify_68x112_10_avx2: 11222.7
vvc_alf_classify_68x116_8_c: 71385.0
vvc_alf_classify_68x116_8_avx2: 13935.2
vvc_alf_classify_68x116_10_c: 124259.7
vvc_alf_classify_68x116_10_avx2: 11805.7
vvc_alf_classify_68x120_8_c: 73800.5
vvc_alf_classify_68x120_8_avx2: 13922.2
vvc_alf_classify_68x120_10_c: 71991.0
vvc_alf_classify_68x120_10_avx2: 12118.5
vvc_alf_classify_68x124_8_c: 76190.2
vvc_alf_classify_68x124_8_avx2: 23092.7
vvc_alf_classify_68x124_10_c: 74383.0
vvc_alf_classify_68x124_10_avx2: 12677.2
vvc_alf_classify_68x128_8_c: 78439.2
vvc_alf_classify_68x128_8_avx2: 15155.0
vvc_alf_classify_68x128_10_c: 76557.2
vvc_alf_classify_68x128_10_avx2: 12919.2
vvc_alf_classify_72x4_8_c: 4247.0
vvc_alf_classify_72x4_8_avx2: 927.5
vvc_alf_classify_72x4_10_c: 4021.7
vvc_alf_classify_72x4_10_avx2: 783.2
vvc_alf_classify_72x8_8_c: 6662.2
vvc_alf_classify_72x8_8_avx2: 1225.5
vvc_alf_classify_72x8_10_c: 6474.7
vvc_alf_classify_72x8_10_avx2: 1017.7
vvc_alf_classify_72x12_8_c: 9500.0
vvc_alf_classify_72x12_8_avx2: 1848.0
vvc_alf_classify_72x12_10_c: 8972.2
vvc_alf_classify_72x12_10_avx2: 1618.2
vvc_alf_classify_72x16_8_c: 12019.2
vvc_alf_classify_72x16_8_avx2: 2142.2
vvc_alf_classify_72x16_10_c: 11353.7
vvc_alf_classify_72x16_10_avx2: 1810.7
vvc_alf_classify_72x20_8_c: 14567.5
vvc_alf_classify_72x20_8_avx2: 2832.5
vvc_alf_classify_72x20_10_c: 13850.0
vvc_alf_classify_72x20_10_avx2: 2358.7
vvc_alf_classify_72x24_8_c: 16775.0
vvc_alf_classify_72x24_8_avx2: 3065.5
vvc_alf_classify_72x24_10_c: 16326.7
vvc_alf_classify_72x24_10_avx2: 2586.7
vvc_alf_classify_72x28_8_c: 19343.5
vvc_alf_classify_72x28_8_avx2: 3648.7
vvc_alf_classify_72x28_10_c: 18861.0
vvc_alf_classify_72x28_10_avx2: 3092.5
vvc_alf_classify_72x32_8_c: 21832.2
vvc_alf_classify_72x32_8_avx2: 3946.5
vvc_alf_classify_72x32_10_c: 21221.5
vvc_alf_classify_72x32_10_avx2: 3330.7
vvc_alf_classify_72x36_8_c: 24411.0
vvc_alf_classify_72x36_8_avx2: 4537.7
vvc_alf_classify_72x36_10_c: 23720.7
vvc_alf_classify_72x36_10_avx2: 3865.2
vvc_alf_classify_72x40_8_c: 26833.5
vvc_alf_classify_72x40_8_avx2: 4968.2
vvc_alf_classify_72x40_10_c: 26146.2
vvc_alf_classify_72x40_10_avx2: 4085.7
vvc_alf_classify_72x44_8_c: 29480.0
vvc_alf_classify_72x44_8_avx2: 5421.7
vvc_alf_classify_72x44_10_c: 28680.2
vvc_alf_classify_72x44_10_avx2: 4718.7
vvc_alf_classify_72x48_8_c: 31904.0
vvc_alf_classify_72x48_8_avx2: 5724.0
vvc_alf_classify_72x48_10_c: 31156.2
vvc_alf_classify_72x48_10_avx2: 4823.7
vvc_alf_classify_72x52_8_c: 34512.7
vvc_alf_classify_72x52_8_avx2: 6324.2
vvc_alf_classify_72x52_10_c: 33691.2
vvc_alf_classify_72x52_10_avx2: 5478.0
vvc_alf_classify_72x56_8_c: 37046.0
vvc_alf_classify_72x56_8_avx2: 6809.7
vvc_alf_classify_72x56_10_c: 36104.0
vvc_alf_classify_72x56_10_avx2: 5590.0
vvc_alf_classify_72x60_8_c: 39525.7
vvc_alf_classify_72x60_8_avx2: 7420.7
vvc_alf_classify_72x60_10_c: 39589.5
vvc_alf_classify_72x60_10_avx2: 6112.0
vvc_alf_classify_72x64_8_c: 42244.7
vvc_alf_classify_72x64_8_avx2: 7524.0
vvc_alf_classify_72x64_10_c: 41351.7
vvc_alf_classify_72x64_10_avx2: 6337.0
vvc_alf_classify_72x68_8_c: 53394.0
vvc_alf_classify_72x68_8_avx2: 8198.5
vvc_alf_classify_72x68_10_c: 67545.2
vvc_alf_classify_72x68_10_avx2: 6959.5
vvc_alf_classify_72x72_8_c: 47175.2
vvc_alf_classify_72x72_8_avx2: 11214.5
vvc_alf_classify_72x72_10_c: 48550.5
vvc_alf_classify_72x72_10_avx2: 7231.2
vvc_alf_classify_72x76_8_c: 49661.0
vvc_alf_classify_72x76_8_avx2: 11986.2
vvc_alf_classify_72x76_10_c: 48558.0
vvc_alf_classify_72x76_10_avx2: 7751.7
vvc_alf_classify_72x80_8_c: 52309.0
vvc_alf_classify_72x80_8_avx2: 9370.0
vvc_alf_classify_72x80_10_c: 51034.2
vvc_alf_classify_72x80_10_avx2: 7999.7
vvc_alf_classify_72x84_8_c: 54803.0
vvc_alf_classify_72x84_8_avx2: 9965.0
vvc_alf_classify_72x84_10_c: 53464.7
vvc_alf_classify_72x84_10_avx2: 8562.0
vvc_alf_classify_72x88_8_c: 57452.5
vvc_alf_classify_72x88_8_avx2: 10627.0
vvc_alf_classify_72x88_10_c: 55965.5
vvc_alf_classify_72x88_10_avx2: 8858.5
vvc_alf_classify_72x92_8_c: 59940.5
vvc_alf_classify_72x92_8_avx2: 10843.0
vvc_alf_classify_72x92_10_c: 105877.7
vvc_alf_classify_72x92_10_avx2: 9358.2
vvc_alf_classify_72x96_8_c: 62520.0
vvc_alf_classify_72x96_8_avx2: 11135.0
vvc_alf_classify_72x96_10_c: 114266.5
vvc_alf_classify_72x96_10_avx2: 9707.2
vvc_alf_classify_72x100_8_c: 65064.7
vvc_alf_classify_72x100_8_avx2: 12045.2
vvc_alf_classify_72x100_10_c: 65117.5
vvc_alf_classify_72x100_10_avx2: 10242.0
vvc_alf_classify_72x104_8_c: 67648.0
vvc_alf_classify_72x104_8_avx2: 12035.2
vvc_alf_classify_72x104_10_c: 66391.7
vvc_alf_classify_72x104_10_avx2: 10490.7
vvc_alf_classify_72x108_8_c: 70124.0
vvc_alf_classify_72x108_8_avx2: 12973.5
vvc_alf_classify_72x108_10_c: 68434.5
vvc_alf_classify_72x108_10_avx2: 11000.7
vvc_alf_classify_72x112_8_c: 72658.2
vvc_alf_classify_72x112_8_avx2: 12922.0
vvc_alf_classify_72x112_10_c: 72752.7
vvc_alf_classify_72x112_10_avx2: 11295.7
vvc_alf_classify_72x116_8_c: 75252.0
vvc_alf_classify_72x116_8_avx2: 14020.5
vvc_alf_classify_72x116_10_c: 75308.5
vvc_alf_classify_72x116_10_avx2: 11900.5
vvc_alf_classify_72x120_8_c: 77831.5
vvc_alf_classify_72x120_8_avx2: 13933.5
vvc_alf_classify_72x120_10_c: 75910.2
vvc_alf_classify_72x120_10_avx2: 12162.5
vvc_alf_classify_72x124_8_c: 80310.5
vvc_alf_classify_72x124_8_avx2: 14529.2
vvc_alf_classify_72x124_10_c: 79012.5
vvc_alf_classify_72x124_10_avx2: 12677.7
vvc_alf_classify_72x128_8_c: 84960.0
vvc_alf_classify_72x128_8_avx2: 14841.0
vvc_alf_classify_72x128_10_c: 107239.0
vvc_alf_classify_72x128_10_avx2: 12968.2
vvc_alf_classify_76x4_8_c: 4633.7
vvc_alf_classify_76x4_8_avx2: 932.7
vvc_alf_classify_76x4_10_c: 4272.0
vvc_alf_classify_76x4_10_avx2: 795.0
vvc_alf_classify_76x8_8_c: 7905.5
vvc_alf_classify_76x8_8_avx2: 1234.2
vvc_alf_classify_76x8_10_c: 19211.5
vvc_alf_classify_76x8_10_avx2: 1025.2
vvc_alf_classify_76x12_8_c: 10295.7
vvc_alf_classify_76x12_8_avx2: 1849.5
vvc_alf_classify_76x12_10_c: 9518.2
vvc_alf_classify_76x12_10_avx2: 1619.0
vvc_alf_classify_76x16_8_c: 13146.2
vvc_alf_classify_76x16_8_avx2: 2151.7
vvc_alf_classify_76x16_10_c: 12145.5
vvc_alf_classify_76x16_10_avx2: 1819.0
vvc_alf_classify_76x20_8_c: 25675.5
vvc_alf_classify_76x20_8_avx2: 2772.7
vvc_alf_classify_76x20_10_c: 14780.2
vvc_alf_classify_76x20_10_avx2: 2359.7
vvc_alf_classify_76x24_8_c: 17877.2
vvc_alf_classify_76x24_8_avx2: 3150.0
vvc_alf_classify_76x24_10_c: 17904.0
vvc_alf_classify_76x24_10_avx2: 2592.0
vvc_alf_classify_76x28_8_c: 20605.0
vvc_alf_classify_76x28_8_avx2: 3665.7
vvc_alf_classify_76x28_10_c: 20071.0
vvc_alf_classify_76x28_10_avx2: 3193.2
vvc_alf_classify_76x32_8_c: 23248.5
vvc_alf_classify_76x32_8_avx2: 3963.5
vvc_alf_classify_76x32_10_c: 22641.0
vvc_alf_classify_76x32_10_avx2: 3528.0
vvc_alf_classify_76x36_8_c: 25997.2
vvc_alf_classify_76x36_8_avx2: 4553.5
vvc_alf_classify_76x36_10_c: 25317.5
vvc_alf_classify_76x36_10_avx2: 3878.0
vvc_alf_classify_76x40_8_c: 28701.2
vvc_alf_classify_76x40_8_avx2: 4852.7
vvc_alf_classify_76x40_10_c: 27898.5
vvc_alf_classify_76x40_10_avx2: 5867.7
vvc_alf_classify_76x44_8_c: 31374.5
vvc_alf_classify_76x44_8_avx2: 5759.0
vvc_alf_classify_76x44_10_c: 30566.0
vvc_alf_classify_76x44_10_avx2: 4744.0
vvc_alf_classify_76x48_8_c: 34060.0
vvc_alf_classify_76x48_8_avx2: 5745.7
vvc_alf_classify_76x48_10_c: 34274.7
vvc_alf_classify_76x48_10_avx2: 4833.5
vvc_alf_classify_76x52_8_c: 36723.0
vvc_alf_classify_76x52_8_avx2: 6358.5
vvc_alf_classify_76x52_10_c: 35839.0
vvc_alf_classify_76x52_10_avx2: 5552.7
vvc_alf_classify_76x56_8_c: 39423.7
vvc_alf_classify_76x56_8_avx2: 6663.0
vvc_alf_classify_76x56_10_c: 38493.0
vvc_alf_classify_76x56_10_avx2: 5619.7
vvc_alf_classify_76x60_8_c: 42163.5
vvc_alf_classify_76x60_8_avx2: 7260.5
vvc_alf_classify_76x60_10_c: 41103.7
vvc_alf_classify_76x60_10_avx2: 6841.5
vvc_alf_classify_76x64_8_c: 44916.7
vvc_alf_classify_76x64_8_avx2: 7550.0
vvc_alf_classify_76x64_10_c: 43823.5
vvc_alf_classify_76x64_10_avx2: 6363.7
vvc_alf_classify_76x68_8_c: 47678.0
vvc_alf_classify_76x68_8_avx2: 8216.5
vvc_alf_classify_76x68_10_c: 46482.0
vvc_alf_classify_76x68_10_avx2: 7003.2
vvc_alf_classify_76x72_8_c: 50366.7
vvc_alf_classify_76x72_8_avx2: 11094.2
vvc_alf_classify_76x72_10_c: 49293.7
vvc_alf_classify_76x72_10_avx2: 7271.5
vvc_alf_classify_76x76_8_c: 53078.2
vvc_alf_classify_76x76_8_avx2: 9342.7
vvc_alf_classify_76x76_10_c: 63219.5
vvc_alf_classify_76x76_10_avx2: 7792.7
vvc_alf_classify_76x80_8_c: 55789.7
vvc_alf_classify_76x80_8_avx2: 9410.2
vvc_alf_classify_76x80_10_c: 54511.0
vvc_alf_classify_76x80_10_avx2: 8037.7
vvc_alf_classify_76x84_8_c: 58525.7
vvc_alf_classify_76x84_8_avx2: 10252.0
vvc_alf_classify_76x84_10_c: 57079.5
vvc_alf_classify_76x84_10_avx2: 8603.0
vvc_alf_classify_76x88_8_c: 61157.2
vvc_alf_classify_76x88_8_avx2: 14401.7
vvc_alf_classify_76x88_10_c: 59927.7
vvc_alf_classify_76x88_10_avx2: 8881.5
vvc_alf_classify_76x92_8_c: 72620.2
vvc_alf_classify_76x92_8_avx2: 11391.0
vvc_alf_classify_76x92_10_c: 62475.2
vvc_alf_classify_76x92_10_avx2: 9436.2
vvc_alf_classify_76x96_8_c: 66747.0
vvc_alf_classify_76x96_8_avx2: 11188.5
vvc_alf_classify_76x96_10_c: 65167.5
vvc_alf_classify_76x96_10_avx2: 9749.0
vvc_alf_classify_76x100_8_c: 69424.7
vvc_alf_classify_76x100_8_avx2: 12085.5
vvc_alf_classify_76x100_10_c: 67832.7
vvc_alf_classify_76x100_10_avx2: 10952.5
vvc_alf_classify_76x104_8_c: 72164.5
vvc_alf_classify_76x104_8_avx2: 12072.5
vvc_alf_classify_76x104_10_c: 72270.2
vvc_alf_classify_76x104_10_avx2: 10550.2
vvc_alf_classify_76x108_8_c: 74791.7
vvc_alf_classify_76x108_8_avx2: 12994.0
vvc_alf_classify_76x108_10_c: 130213.7
vvc_alf_classify_76x108_10_avx2: 11073.7
vvc_alf_classify_76x112_8_c: 77550.7
vvc_alf_classify_76x112_8_avx2: 17381.2
vvc_alf_classify_76x112_10_c: 77789.5
vvc_alf_classify_76x112_10_avx2: 11333.0
vvc_alf_classify_76x116_8_c: 80354.5
vvc_alf_classify_76x116_8_avx2: 14416.7
vvc_alf_classify_76x116_10_c: 79035.5
vvc_alf_classify_76x116_10_avx2: 11961.5
vvc_alf_classify_76x120_8_c: 83188.7
vvc_alf_classify_76x120_8_avx2: 13960.2
vvc_alf_classify_76x120_10_c: 81126.7
vvc_alf_classify_76x120_10_avx2: 12201.2
vvc_alf_classify_76x124_8_c: 88152.0
vvc_alf_classify_76x124_8_avx2: 14623.0
vvc_alf_classify_76x124_10_c: 83762.7
vvc_alf_classify_76x124_10_avx2: 12730.0
vvc_alf_classify_76x128_8_c: 88425.2
vvc_alf_classify_76x128_8_avx2: 15309.5
vvc_alf_classify_76x128_10_c: 86329.0
vvc_alf_classify_76x128_10_avx2: 13013.0
vvc_alf_classify_80x4_8_c: 4608.5
vvc_alf_classify_80x4_8_avx2: 1048.2
vvc_alf_classify_80x4_10_c: 4467.0
vvc_alf_classify_80x4_10_avx2: 883.5
vvc_alf_classify_80x8_8_c: 16560.7
vvc_alf_classify_80x8_8_avx2: 1413.0
vvc_alf_classify_80x8_10_c: 7221.7
vvc_alf_classify_80x8_10_avx2: 1156.0
vvc_alf_classify_80x12_8_c: 10551.0
vvc_alf_classify_80x12_8_avx2: 2114.0
vvc_alf_classify_80x12_10_c: 9973.2
vvc_alf_classify_80x12_10_avx2: 1852.5
vvc_alf_classify_80x16_8_c: 13102.2
vvc_alf_classify_80x16_8_avx2: 2544.2
vvc_alf_classify_80x16_10_c: 12781.2
vvc_alf_classify_80x16_10_avx2: 2323.5
vvc_alf_classify_80x20_8_c: 34616.7
vvc_alf_classify_80x20_8_avx2: 3118.2
vvc_alf_classify_80x20_10_c: 15529.2
vvc_alf_classify_80x20_10_avx2: 2718.5
vvc_alf_classify_80x24_8_c: 18748.5
vvc_alf_classify_80x24_8_avx2: 3575.2
vvc_alf_classify_80x24_10_c: 18301.7
vvc_alf_classify_80x24_10_avx2: 2994.0
vvc_alf_classify_80x28_8_c: 21601.5
vvc_alf_classify_80x28_8_avx2: 4112.7
vvc_alf_classify_80x28_10_c: 68371.0
vvc_alf_classify_80x28_10_avx2: 3586.5
vvc_alf_classify_80x32_8_c: 24438.0
vvc_alf_classify_80x32_8_avx2: 4495.2
vvc_alf_classify_80x32_10_c: 23808.5
vvc_alf_classify_80x32_10_avx2: 3755.2
vvc_alf_classify_80x36_8_c: 27255.0
vvc_alf_classify_80x36_8_avx2: 5147.7
vvc_alf_classify_80x36_10_c: 26578.0
vvc_alf_classify_80x36_10_avx2: 12649.5
vvc_alf_classify_80x40_8_c: 30087.7
vvc_alf_classify_80x40_8_avx2: 5485.7
vvc_alf_classify_80x40_10_c: 29355.7
vvc_alf_classify_80x40_10_avx2: 4587.0
vvc_alf_classify_80x44_8_c: 32937.7
vvc_alf_classify_80x44_8_avx2: 6145.5
vvc_alf_classify_80x44_10_c: 32119.2
vvc_alf_classify_80x44_10_avx2: 5275.0
vvc_alf_classify_80x48_8_c: 35763.0
vvc_alf_classify_80x48_8_avx2: 6468.0
vvc_alf_classify_80x48_10_c: 34904.5
vvc_alf_classify_80x48_10_avx2: 5418.7
vvc_alf_classify_80x52_8_c: 39599.2
vvc_alf_classify_80x52_8_avx2: 7174.7
vvc_alf_classify_80x52_10_c: 37653.7
vvc_alf_classify_80x52_10_avx2: 6012.2
vvc_alf_classify_80x56_8_c: 41508.2
vvc_alf_classify_80x56_8_avx2: 7511.2
vvc_alf_classify_80x56_10_c: 40429.2
vvc_alf_classify_80x56_10_avx2: 6298.2
vvc_alf_classify_80x60_8_c: 44284.5
vvc_alf_classify_80x60_8_avx2: 8252.2
vvc_alf_classify_80x60_10_c: 43316.2
vvc_alf_classify_80x60_10_avx2: 6887.2
vvc_alf_classify_80x64_8_c: 47146.2
vvc_alf_classify_80x64_8_avx2: 8620.0
vvc_alf_classify_80x64_10_c: 47253.0
vvc_alf_classify_80x64_10_avx2: 7166.5
vvc_alf_classify_80x68_8_c: 49968.5
vvc_alf_classify_80x68_8_avx2: 9267.2
vvc_alf_classify_80x68_10_c: 48771.7
vvc_alf_classify_80x68_10_avx2: 7760.7
vvc_alf_classify_80x72_8_c: 52813.2
vvc_alf_classify_80x72_8_avx2: 9574.0
vvc_alf_classify_80x72_10_c: 51611.2
vvc_alf_classify_80x72_10_avx2: 8078.7
vvc_alf_classify_80x76_8_c: 55685.5
vvc_alf_classify_80x76_8_avx2: 10497.7
vvc_alf_classify_80x76_10_c: 54412.7
vvc_alf_classify_80x76_10_avx2: 8646.2
vvc_alf_classify_80x80_8_c: 58621.7
vvc_alf_classify_80x80_8_avx2: 13887.2
vvc_alf_classify_80x80_10_c: 124217.0
vvc_alf_classify_80x80_10_avx2: 8955.2
vvc_alf_classify_80x84_8_c: 61433.5
vvc_alf_classify_80x84_8_avx2: 11576.5
vvc_alf_classify_80x84_10_c: 59853.5
vvc_alf_classify_80x84_10_avx2: 9578.5
vvc_alf_classify_80x88_8_c: 71694.5
vvc_alf_classify_80x88_8_avx2: 15040.7
vvc_alf_classify_80x88_10_c: 62628.2
vvc_alf_classify_80x88_10_avx2: 9930.0
vvc_alf_classify_80x92_8_c: 67087.2
vvc_alf_classify_80x92_8_avx2: 12269.7
vvc_alf_classify_80x92_10_c: 116943.5
vvc_alf_classify_80x92_10_avx2: 10532.5
vvc_alf_classify_80x96_8_c: 70031.7
vvc_alf_classify_80x96_8_avx2: 21980.0
vvc_alf_classify_80x96_10_c: 126884.5
vvc_alf_classify_80x96_10_avx2: 10834.7
vvc_alf_classify_80x100_8_c: 72805.7
vvc_alf_classify_80x100_8_avx2: 13629.2
vvc_alf_classify_80x100_10_c: 71001.2
vvc_alf_classify_80x100_10_avx2: 11377.0
vvc_alf_classify_80x104_8_c: 75675.7
vvc_alf_classify_80x104_8_avx2: 13704.7
vvc_alf_classify_80x104_10_c: 73803.5
vvc_alf_classify_80x104_10_avx2: 20744.2
vvc_alf_classify_80x108_8_c: 90007.2
vvc_alf_classify_80x108_8_avx2: 14325.0
vvc_alf_classify_80x108_10_c: 78656.2
vvc_alf_classify_80x108_10_avx2: 12289.2
vvc_alf_classify_80x112_8_c: 81427.5
vvc_alf_classify_80x112_8_avx2: 14605.7
vvc_alf_classify_80x112_10_c: 79553.7
vvc_alf_classify_80x112_10_avx2: 12597.5
vvc_alf_classify_80x116_8_c: 86491.0
vvc_alf_classify_80x116_8_avx2: 16225.5
vvc_alf_classify_80x116_10_c: 84457.0
vvc_alf_classify_80x116_10_avx2: 13196.7
vvc_alf_classify_80x120_8_c: 87295.0
vvc_alf_classify_80x120_8_avx2: 16167.5
vvc_alf_classify_80x120_10_c: 85213.5
vvc_alf_classify_80x120_10_avx2: 13461.2
vvc_alf_classify_80x124_8_c: 90062.7
vvc_alf_classify_80x124_8_avx2: 21437.5
vvc_alf_classify_80x124_10_c: 87712.7
vvc_alf_classify_80x124_10_avx2: 14429.0
vvc_alf_classify_80x128_8_c: 92741.5
vvc_alf_classify_80x128_8_avx2: 16798.0
vvc_alf_classify_80x128_10_c: 90529.0
vvc_alf_classify_80x128_10_avx2: 14266.2
vvc_alf_classify_84x4_8_c: 4834.2
vvc_alf_classify_84x4_8_avx2: 1100.2
vvc_alf_classify_84x4_10_c: 4691.2
vvc_alf_classify_84x4_10_avx2: 936.5
vvc_alf_classify_84x8_8_c: 7791.2
vvc_alf_classify_84x8_8_avx2: 1462.2
vvc_alf_classify_84x8_10_c: 7579.7
vvc_alf_classify_84x8_10_avx2: 1210.5
vvc_alf_classify_84x12_8_c: 10728.2
vvc_alf_classify_84x12_8_avx2: 2217.5
vvc_alf_classify_84x12_10_c: 10465.5
vvc_alf_classify_84x12_10_avx2: 1966.0
vvc_alf_classify_84x16_8_c: 13719.5
vvc_alf_classify_84x16_8_avx2: 2582.2
vvc_alf_classify_84x16_10_c: 13361.5
vvc_alf_classify_84x16_10_avx2: 2304.5
vvc_alf_classify_84x20_8_c: 16677.5
vvc_alf_classify_84x20_8_avx2: 3280.7
vvc_alf_classify_84x20_10_c: 16289.0
vvc_alf_classify_84x20_10_avx2: 2882.0
vvc_alf_classify_84x24_8_c: 19647.5
vvc_alf_classify_84x24_8_avx2: 3735.7
vvc_alf_classify_84x24_10_c: 19155.2
vvc_alf_classify_84x24_10_avx2: 12106.0
vvc_alf_classify_84x28_8_c: 22662.5
vvc_alf_classify_84x28_8_avx2: 4336.0
vvc_alf_classify_84x28_10_c: 22105.5
vvc_alf_classify_84x28_10_avx2: 3726.0
vvc_alf_classify_84x32_8_c: 25594.5
vvc_alf_classify_84x32_8_avx2: 4711.2
vvc_alf_classify_84x32_10_c: 24930.7
vvc_alf_classify_84x32_10_avx2: 3992.0
vvc_alf_classify_84x36_8_c: 28565.7
vvc_alf_classify_84x36_8_avx2: 5409.7
vvc_alf_classify_84x36_10_c: 27801.5
vvc_alf_classify_84x36_10_avx2: 4628.5
vvc_alf_classify_84x40_8_c: 31522.7
vvc_alf_classify_84x40_8_avx2: 5768.0
vvc_alf_classify_84x40_10_c: 30761.7
vvc_alf_classify_84x40_10_avx2: 4866.2
vvc_alf_classify_84x44_8_c: 34457.0
vvc_alf_classify_84x44_8_avx2: 6462.7
vvc_alf_classify_84x44_10_c: 33620.5
vvc_alf_classify_84x44_10_avx2: 5499.0
vvc_alf_classify_84x48_8_c: 37439.2
vvc_alf_classify_84x48_8_avx2: 15042.0
vvc_alf_classify_84x48_10_c: 36518.7
vvc_alf_classify_84x48_10_avx2: 5921.7
vvc_alf_classify_84x52_8_c: 111397.0
vvc_alf_classify_84x52_8_avx2: 7554.5
vvc_alf_classify_84x52_10_c: 39506.5
vvc_alf_classify_84x52_10_avx2: 6420.2
vvc_alf_classify_84x56_8_c: 43379.5
vvc_alf_classify_84x56_8_avx2: 8114.5
vvc_alf_classify_84x56_10_c: 42356.5
vvc_alf_classify_84x56_10_avx2: 6730.7
vvc_alf_classify_84x60_8_c: 46418.5
vvc_alf_classify_84x60_8_avx2: 8665.5
vvc_alf_classify_84x60_10_c: 45283.7
vvc_alf_classify_84x60_10_avx2: 7362.2
vvc_alf_classify_84x64_8_c: 49449.5
vvc_alf_classify_84x64_8_avx2: 9032.0
vvc_alf_classify_84x64_10_c: 57727.5
vvc_alf_classify_84x64_10_avx2: 7647.5
vvc_alf_classify_84x68_8_c: 52378.2
vvc_alf_classify_84x68_8_avx2: 10001.5
vvc_alf_classify_84x68_10_c: 68782.0
vvc_alf_classify_84x68_10_avx2: 8287.2
vvc_alf_classify_84x72_8_c: 55418.0
vvc_alf_classify_84x72_8_avx2: 10108.0
vvc_alf_classify_84x72_10_c: 62207.0
vvc_alf_classify_84x72_10_avx2: 8625.5
vvc_alf_classify_84x76_8_c: 58325.5
vvc_alf_classify_84x76_8_avx2: 11101.0
vvc_alf_classify_84x76_10_c: 103525.0
vvc_alf_classify_84x76_10_avx2: 9262.7
vvc_alf_classify_84x80_8_c: 61449.2
vvc_alf_classify_84x80_8_avx2: 11453.2
vvc_alf_classify_84x80_10_c: 63180.7
vvc_alf_classify_84x80_10_avx2: 9516.0
vvc_alf_classify_84x84_8_c: 64427.2
vvc_alf_classify_84x84_8_avx2: 11870.5
vvc_alf_classify_84x84_10_c: 62809.0
vvc_alf_classify_84x84_10_avx2: 10213.0
vvc_alf_classify_84x88_8_c: 67366.5
vvc_alf_classify_84x88_8_avx2: 12553.5
vvc_alf_classify_84x88_10_c: 65873.5
vvc_alf_classify_84x88_10_avx2: 10563.0
vvc_alf_classify_84x92_8_c: 70472.5
vvc_alf_classify_84x92_8_avx2: 12955.7
vvc_alf_classify_84x92_10_c: 68788.0
vvc_alf_classify_84x92_10_avx2: 11257.0
vvc_alf_classify_84x96_8_c: 73445.2
vvc_alf_classify_84x96_8_avx2: 13321.2
vvc_alf_classify_84x96_10_c: 71600.7
vvc_alf_classify_84x96_10_avx2: 21085.0
vvc_alf_classify_84x100_8_c: 76393.5
vvc_alf_classify_84x100_8_avx2: 14417.7
vvc_alf_classify_84x100_10_c: 74482.7
vvc_alf_classify_84x100_10_avx2: 12231.7
vvc_alf_classify_84x104_8_c: 81407.5
vvc_alf_classify_84x104_8_avx2: 14440.5
vvc_alf_classify_84x104_10_c: 79468.7
vvc_alf_classify_84x104_10_avx2: 12558.7
vvc_alf_classify_84x108_8_c: 82476.0
vvc_alf_classify_84x108_8_avx2: 15129.2
vvc_alf_classify_84x108_10_c: 80524.2
vvc_alf_classify_84x108_10_avx2: 13179.0
vvc_alf_classify_84x112_8_c: 85463.0
vvc_alf_classify_84x112_8_avx2: 15539.5
vvc_alf_classify_84x112_10_c: 85670.7
vvc_alf_classify_84x112_10_avx2: 13443.5
vvc_alf_classify_84x116_8_c: 88564.5
vvc_alf_classify_84x116_8_avx2: 16685.7
vvc_alf_classify_84x116_10_c: 98094.2
vvc_alf_classify_84x116_10_avx2: 14146.2
vvc_alf_classify_84x120_8_c: 91551.5
vvc_alf_classify_84x120_8_avx2: 17045.0
vvc_alf_classify_84x120_10_c: 89213.2
vvc_alf_classify_84x120_10_avx2: 14412.2
vvc_alf_classify_84x124_8_c: 102796.7
vvc_alf_classify_84x124_8_avx2: 17343.2
vvc_alf_classify_84x124_10_c: 92093.0
vvc_alf_classify_84x124_10_avx2: 15010.2
vvc_alf_classify_84x128_8_c: 108483.2
vvc_alf_classify_84x128_8_avx2: 18180.2
vvc_alf_classify_84x128_10_c: 94806.5
vvc_alf_classify_84x128_10_avx2: 42804.0
vvc_alf_classify_88x4_8_c: 13215.2
vvc_alf_classify_88x4_8_avx2: 1100.5
vvc_alf_classify_88x4_10_c: 4861.7
vvc_alf_classify_88x4_10_avx2: 939.5
vvc_alf_classify_88x8_8_c: 8276.0
vvc_alf_classify_88x8_8_avx2: 1464.5
vvc_alf_classify_88x8_10_c: 7813.0
vvc_alf_classify_88x8_10_avx2: 1244.0
vvc_alf_classify_88x12_8_c: 12432.5
vvc_alf_classify_88x12_8_avx2: 2230.0
vvc_alf_classify_88x12_10_c: 10823.5
vvc_alf_classify_88x12_10_avx2: 1966.7
vvc_alf_classify_88x16_8_c: 14203.0
vvc_alf_classify_88x16_8_avx2: 2584.5
vvc_alf_classify_88x16_10_c: 13792.7
vvc_alf_classify_88x16_10_avx2: 2198.7
vvc_alf_classify_88x20_8_c: 17277.0
vvc_alf_classify_88x20_8_avx2: 3374.2
vvc_alf_classify_88x20_10_c: 16822.7
vvc_alf_classify_88x20_10_avx2: 2897.2
vvc_alf_classify_88x24_8_c: 20336.2
vvc_alf_classify_88x24_8_avx2: 3748.7
vvc_alf_classify_88x24_10_c: 19776.7
vvc_alf_classify_88x24_10_avx2: 3083.5
vvc_alf_classify_88x28_8_c: 23446.7
vvc_alf_classify_88x28_8_avx2: 4339.7
vvc_alf_classify_88x28_10_c: 22776.5
vvc_alf_classify_88x28_10_avx2: 3743.0
vvc_alf_classify_88x32_8_c: 26488.7
vvc_alf_classify_88x32_8_avx2: 4715.0
vvc_alf_classify_88x32_10_c: 25773.7
vvc_alf_classify_88x32_10_avx2: 4008.2
vvc_alf_classify_88x36_8_c: 29528.5
vvc_alf_classify_88x36_8_avx2: 5425.5
vvc_alf_classify_88x36_10_c: 28789.0
vvc_alf_classify_88x36_10_avx2: 6275.7
vvc_alf_classify_88x40_8_c: 32608.5
vvc_alf_classify_88x40_8_avx2: 5785.7
vvc_alf_classify_88x40_10_c: 31775.2
vvc_alf_classify_88x40_10_avx2: 4895.2
vvc_alf_classify_88x44_8_c: 35677.2
vvc_alf_classify_88x44_8_avx2: 14706.2
vvc_alf_classify_88x44_10_c: 34771.7
vvc_alf_classify_88x44_10_avx2: 5509.5
vvc_alf_classify_88x48_8_c: 38745.5
vvc_alf_classify_88x48_8_avx2: 6828.5
vvc_alf_classify_88x48_10_c: 37738.7
vvc_alf_classify_88x48_10_avx2: 5938.5
vvc_alf_classify_88x52_8_c: 41818.7
vvc_alf_classify_88x52_8_avx2: 7577.5
vvc_alf_classify_88x52_10_c: 40823.0
vvc_alf_classify_88x52_10_avx2: 6436.7
vvc_alf_classify_88x56_8_c: 50052.5
vvc_alf_classify_88x56_8_avx2: 7957.5
vvc_alf_classify_88x56_10_c: 43728.2
vvc_alf_classify_88x56_10_avx2: 6752.5
vvc_alf_classify_88x60_8_c: 48024.0
vvc_alf_classify_88x60_8_avx2: 8704.2
vvc_alf_classify_88x60_10_c: 46803.0
vvc_alf_classify_88x60_10_avx2: 7386.0
vvc_alf_classify_88x64_8_c: 51067.0
vvc_alf_classify_88x64_8_avx2: 9070.7
vvc_alf_classify_88x64_10_c: 49814.2
vvc_alf_classify_88x64_10_avx2: 7675.0
vvc_alf_classify_88x68_8_c: 54122.5
vvc_alf_classify_88x68_8_avx2: 12731.5
vvc_alf_classify_88x68_10_c: 52772.2
vvc_alf_classify_88x68_10_avx2: 8286.5
vvc_alf_classify_88x72_8_c: 57197.7
vvc_alf_classify_88x72_8_avx2: 10128.2
vvc_alf_classify_88x72_10_c: 55801.7
vvc_alf_classify_88x72_10_avx2: 8611.2
vvc_alf_classify_88x76_8_c: 60319.5
vvc_alf_classify_88x76_8_avx2: 10832.5
vvc_alf_classify_88x76_10_c: 58812.2
vvc_alf_classify_88x76_10_avx2: 9539.0
vvc_alf_classify_88x80_8_c: 63412.2
vvc_alf_classify_88x80_8_avx2: 11550.7
vvc_alf_classify_88x80_10_c: 63446.5
vvc_alf_classify_88x80_10_avx2: 9591.0
vvc_alf_classify_88x84_8_c: 66528.7
vvc_alf_classify_88x84_8_avx2: 12204.2
vvc_alf_classify_88x84_10_c: 64810.0
vvc_alf_classify_88x84_10_avx2: 10278.5
vvc_alf_classify_88x88_8_c: 69608.7
vvc_alf_classify_88x88_8_avx2: 12243.0
vvc_alf_classify_88x88_10_c: 67680.0
vvc_alf_classify_88x88_10_avx2: 10605.5
vvc_alf_classify_88x92_8_c: 72568.0
vvc_alf_classify_88x92_8_avx2: 12984.7
vvc_alf_classify_88x92_10_c: 74913.7
vvc_alf_classify_88x92_10_avx2: 11603.0
vvc_alf_classify_88x96_8_c: 75651.2
vvc_alf_classify_88x96_8_avx2: 13700.7
vvc_alf_classify_88x96_10_c: 75659.2
vvc_alf_classify_88x96_10_avx2: 11612.2
vvc_alf_classify_88x100_8_c: 78813.7
vvc_alf_classify_88x100_8_avx2: 14469.2
vvc_alf_classify_88x100_10_c: 143178.7
vvc_alf_classify_88x100_10_avx2: 12281.0
vvc_alf_classify_88x104_8_c: 82081.5
vvc_alf_classify_88x104_8_avx2: 14475.0
vvc_alf_classify_88x104_10_c: 81947.7
vvc_alf_classify_88x104_10_avx2: 12591.5
vvc_alf_classify_88x108_8_c: 85257.5
vvc_alf_classify_88x108_8_avx2: 19292.7
vvc_alf_classify_88x108_10_c: 85139.0
vvc_alf_classify_88x108_10_avx2: 13218.5
vvc_alf_classify_88x112_8_c: 88309.7
vvc_alf_classify_88x112_8_avx2: 15553.7
vvc_alf_classify_88x112_10_c: 85993.2
vvc_alf_classify_88x112_10_avx2: 13527.5
vvc_alf_classify_88x116_8_c: 91353.5
vvc_alf_classify_88x116_8_avx2: 17198.7
vvc_alf_classify_88x116_10_c: 88953.5
vvc_alf_classify_88x116_10_avx2: 14163.5
vvc_alf_classify_88x120_8_c: 94418.5
vvc_alf_classify_88x120_8_avx2: 17117.2
vvc_alf_classify_88x120_10_c: 91824.7
vvc_alf_classify_88x120_10_avx2: 14419.7
vvc_alf_classify_88x124_8_c: 97452.2
vvc_alf_classify_88x124_8_avx2: 22101.0
vvc_alf_classify_88x124_10_c: 94837.0
vvc_alf_classify_88x124_10_avx2: 15052.5
vvc_alf_classify_88x128_8_c: 100288.0
vvc_alf_classify_88x128_8_avx2: 18212.0
vvc_alf_classify_88x128_10_c: 97639.2
vvc_alf_classify_88x128_10_avx2: 42889.0
vvc_alf_classify_92x4_8_c: 5243.0
vvc_alf_classify_92x4_8_avx2: 1099.0
vvc_alf_classify_92x4_10_c: 5071.7
vvc_alf_classify_92x4_10_avx2: 938.0
vvc_alf_classify_92x8_8_c: 8431.0
vvc_alf_classify_92x8_8_avx2: 1466.7
vvc_alf_classify_92x8_10_c: 8157.5
vvc_alf_classify_92x8_10_avx2: 1214.2
vvc_alf_classify_92x12_8_c: 11618.2
vvc_alf_classify_92x12_8_avx2: 2232.2
vvc_alf_classify_92x12_10_c: 11278.7
vvc_alf_classify_92x12_10_avx2: 1976.5
vvc_alf_classify_92x16_8_c: 15229.2
vvc_alf_classify_92x16_8_avx2: 2593.5
vvc_alf_classify_92x16_10_c: 14390.5
vvc_alf_classify_92x16_10_avx2: 2207.0
vvc_alf_classify_92x20_8_c: 19547.0
vvc_alf_classify_92x20_8_avx2: 3486.2
vvc_alf_classify_92x20_10_c: 19520.5
vvc_alf_classify_92x20_10_avx2: 2902.5
vvc_alf_classify_92x24_8_c: 21806.5
vvc_alf_classify_92x24_8_avx2: 3663.5
vvc_alf_classify_92x24_10_c: 20660.7
vvc_alf_classify_92x24_10_avx2: 3104.2
vvc_alf_classify_92x28_8_c: 24413.5
vvc_alf_classify_92x28_8_avx2: 4364.2
vvc_alf_classify_92x28_10_c: 23760.2
vvc_alf_classify_92x28_10_avx2: 3757.2
vvc_alf_classify_92x32_8_c: 27656.2
vvc_alf_classify_92x32_8_avx2: 4859.5
vvc_alf_classify_92x32_10_c: 26897.5
vvc_alf_classify_92x32_10_avx2: 4017.2
vvc_alf_classify_92x36_8_c: 30896.5
vvc_alf_classify_92x36_8_avx2: 5446.2
vvc_alf_classify_92x36_10_c: 30010.2
vvc_alf_classify_92x36_10_avx2: 4664.5
vvc_alf_classify_92x40_8_c: 43649.2
vvc_alf_classify_92x40_8_avx2: 5799.2
vvc_alf_classify_92x40_10_c: 33145.5
vvc_alf_classify_92x40_10_avx2: 4916.7
vvc_alf_classify_92x44_8_c: 38165.0
vvc_alf_classify_92x44_8_avx2: 6510.2
vvc_alf_classify_92x44_10_c: 36346.7
vvc_alf_classify_92x44_10_avx2: 5533.2
vvc_alf_classify_92x48_8_c: 40482.0
vvc_alf_classify_92x48_8_avx2: 6865.7
vvc_alf_classify_92x48_10_c: 39475.2
vvc_alf_classify_92x48_10_avx2: 5972.0
vvc_alf_classify_92x52_8_c: 43660.5
vvc_alf_classify_92x52_8_avx2: 7607.2
vvc_alf_classify_92x52_10_c: 42521.0
vvc_alf_classify_92x52_10_avx2: 6464.2
vvc_alf_classify_92x56_8_c: 46978.0
vvc_alf_classify_92x56_8_avx2: 7969.2
vvc_alf_classify_92x56_10_c: 45694.7
vvc_alf_classify_92x56_10_avx2: 6747.2
vvc_alf_classify_92x60_8_c: 50130.2
vvc_alf_classify_92x60_8_avx2: 8728.7
vvc_alf_classify_92x60_10_c: 48865.7
vvc_alf_classify_92x60_10_avx2: 7433.7
vvc_alf_classify_92x64_8_c: 53323.2
vvc_alf_classify_92x64_8_avx2: 9094.5
vvc_alf_classify_92x64_10_c: 57975.5
vvc_alf_classify_92x64_10_avx2: 7695.2
vvc_alf_classify_92x68_8_c: 58109.0
vvc_alf_classify_92x68_8_avx2: 9796.7
vvc_alf_classify_92x68_10_c: 55161.2
vvc_alf_classify_92x68_10_avx2: 8335.0
vvc_alf_classify_92x72_8_c: 59800.5
vvc_alf_classify_92x72_8_avx2: 13325.7
vvc_alf_classify_92x72_10_c: 59940.2
vvc_alf_classify_92x72_10_avx2: 8674.5
vvc_alf_classify_92x76_8_c: 63032.5
vvc_alf_classify_92x76_8_avx2: 11160.2
vvc_alf_classify_92x76_10_c: 61517.0
vvc_alf_classify_92x76_10_avx2: 9577.7
vvc_alf_classify_92x80_8_c: 66250.2
vvc_alf_classify_92x80_8_avx2: 11543.0
vvc_alf_classify_92x80_10_c: 64581.2
vvc_alf_classify_92x80_10_avx2: 9616.5
vvc_alf_classify_92x84_8_c: 69468.0
vvc_alf_classify_92x84_8_avx2: 12253.0
vvc_alf_classify_92x84_10_c: 103687.2
vvc_alf_classify_92x84_10_avx2: 10341.7
vvc_alf_classify_92x88_8_c: 72778.2
vvc_alf_classify_92x88_8_avx2: 12306.2
vvc_alf_classify_92x88_10_c: 70857.7
vvc_alf_classify_92x88_10_avx2: 10655.2
vvc_alf_classify_92x92_8_c: 76069.0
vvc_alf_classify_92x92_8_avx2: 13025.0
vvc_alf_classify_92x92_10_c: 75981.7
vvc_alf_classify_92x92_10_avx2: 11340.5
vvc_alf_classify_92x96_8_c: 158890.5
vvc_alf_classify_92x96_8_avx2: 13406.7
vvc_alf_classify_92x96_10_c: 77145.7
vvc_alf_classify_92x96_10_avx2: 11642.7
vvc_alf_classify_92x100_8_c: 82550.5
vvc_alf_classify_92x100_8_avx2: 14139.7
vvc_alf_classify_92x100_10_c: 90021.0
vvc_alf_classify_92x100_10_avx2: 12346.5
vvc_alf_classify_92x104_8_c: 85850.2
vvc_alf_classify_92x104_8_avx2: 14525.5
vvc_alf_classify_92x104_10_c: 93039.7
vvc_alf_classify_92x104_10_avx2: 23445.5
vvc_alf_classify_92x108_8_c: 89110.5
vvc_alf_classify_92x108_8_avx2: 15645.5
vvc_alf_classify_92x108_10_c: 86758.7
vvc_alf_classify_92x108_10_avx2: 13314.5
vvc_alf_classify_92x112_8_c: 92352.0
vvc_alf_classify_92x112_8_avx2: 20589.0
vvc_alf_classify_92x112_10_c: 89840.2
vvc_alf_classify_92x112_10_avx2: 13574.5
vvc_alf_classify_92x116_8_c: 95486.5
vvc_alf_classify_92x116_8_avx2: 16347.0
vvc_alf_classify_92x116_10_c: 95514.2
vvc_alf_classify_92x116_10_avx2: 14225.2
vvc_alf_classify_92x120_8_c: 98601.2
vvc_alf_classify_92x120_8_avx2: 29220.2
vvc_alf_classify_92x120_10_c: 101389.5
vvc_alf_classify_92x120_10_avx2: 14509.7
vvc_alf_classify_92x124_8_c: 101845.2
vvc_alf_classify_92x124_8_avx2: 17927.5
vvc_alf_classify_92x124_10_c: 99274.5
vvc_alf_classify_92x124_10_avx2: 15142.0
vvc_alf_classify_92x128_8_c: 104868.7
vvc_alf_classify_92x128_8_avx2: 18263.0
vvc_alf_classify_92x128_10_c: 102287.5
vvc_alf_classify_92x128_10_avx2: 15463.0
vvc_alf_classify_96x4_8_c: 5453.0
vvc_alf_classify_96x4_8_avx2: 1303.5
vvc_alf_classify_96x4_10_c: 5283.2
vvc_alf_classify_96x4_10_avx2: 1029.5
vvc_alf_classify_96x8_8_c: 8743.0
vvc_alf_classify_96x8_8_avx2: 1646.2
vvc_alf_classify_96x8_10_c: 8506.2
vvc_alf_classify_96x8_10_avx2: 1353.5
vvc_alf_classify_96x12_8_c: 12085.0
vvc_alf_classify_96x12_8_avx2: 2475.7
vvc_alf_classify_96x12_10_c: 11786.5
vvc_alf_classify_96x12_10_avx2: 2141.7
vvc_alf_classify_96x16_8_c: 15816.0
vvc_alf_classify_96x16_8_avx2: 3128.5
vvc_alf_classify_96x16_10_c: 15036.2
vvc_alf_classify_96x16_10_avx2: 2423.5
vvc_alf_classify_96x20_8_c: 18781.2
vvc_alf_classify_96x20_8_avx2: 3749.5
vvc_alf_classify_96x20_10_c: 18261.5
vvc_alf_classify_96x20_10_avx2: 3152.2
vvc_alf_classify_96x24_8_c: 22105.5
vvc_alf_classify_96x24_8_avx2: 4077.5
vvc_alf_classify_96x24_10_c: 21500.2
vvc_alf_classify_96x24_10_avx2: 3388.7
vvc_alf_classify_96x28_8_c: 25427.5
vvc_alf_classify_96x28_8_avx2: 4846.7
vvc_alf_classify_96x28_10_c: 24749.0
vvc_alf_classify_96x28_10_avx2: 4083.5
vvc_alf_classify_96x32_8_c: 28734.7
vvc_alf_classify_96x32_8_avx2: 5399.0
vvc_alf_classify_96x32_10_c: 27983.2
vvc_alf_classify_96x32_10_avx2: 4392.5
vvc_alf_classify_96x36_8_c: 32075.2
vvc_alf_classify_96x36_8_avx2: 5987.7
vvc_alf_classify_96x36_10_c: 31270.2
vvc_alf_classify_96x36_10_avx2: 5046.5
vvc_alf_classify_96x40_8_c: 35479.2
vvc_alf_classify_96x40_8_avx2: 6442.0
vvc_alf_classify_96x40_10_c: 34538.7
vvc_alf_classify_96x40_10_avx2: 14154.7
vvc_alf_classify_96x44_8_c: 38812.5
vvc_alf_classify_96x44_8_avx2: 7200.0
vvc_alf_classify_96x44_10_c: 37813.0
vvc_alf_classify_96x44_10_avx2: 6208.0
vvc_alf_classify_96x48_8_c: 42127.0
vvc_alf_classify_96x48_8_avx2: 7647.7
vvc_alf_classify_96x48_10_c: 40984.7
vvc_alf_classify_96x48_10_avx2: 6546.2
vvc_alf_classify_96x52_8_c: 58726.0
vvc_alf_classify_96x52_8_avx2: 8396.0
vvc_alf_classify_96x52_10_c: 44367.0
vvc_alf_classify_96x52_10_avx2: 7067.5
vvc_alf_classify_96x56_8_c: 48805.2
vvc_alf_classify_96x56_8_avx2: 8835.2
vvc_alf_classify_96x56_10_c: 47509.5
vvc_alf_classify_96x56_10_avx2: 7408.5
vvc_alf_classify_96x60_8_c: 52232.2
vvc_alf_classify_96x60_8_avx2: 9597.0
vvc_alf_classify_96x60_10_c: 50848.0
vvc_alf_classify_96x60_10_avx2: 8078.7
vvc_alf_classify_96x64_8_c: 55567.7
vvc_alf_classify_96x64_8_avx2: 10019.5
vvc_alf_classify_96x64_10_c: 54121.0
vvc_alf_classify_96x64_10_avx2: 8420.5
vvc_alf_classify_96x68_8_c: 65621.5
vvc_alf_classify_96x68_8_avx2: 10833.5
vvc_alf_classify_96x68_10_c: 57358.0
vvc_alf_classify_96x68_10_avx2: 9099.7
vvc_alf_classify_96x72_8_c: 62258.0
vvc_alf_classify_96x72_8_avx2: 14643.0
vvc_alf_classify_96x72_10_c: 60623.5
vvc_alf_classify_96x72_10_avx2: 9430.2
vvc_alf_classify_96x76_8_c: 65628.5
vvc_alf_classify_96x76_8_avx2: 14946.7
vvc_alf_classify_96x76_10_c: 63920.7
vvc_alf_classify_96x76_10_avx2: 28269.0
vvc_alf_classify_96x80_8_c: 69054.0
vvc_alf_classify_96x80_8_avx2: 12765.7
vvc_alf_classify_96x80_10_c: 67322.7
vvc_alf_classify_96x80_10_avx2: 10529.5
vvc_alf_classify_96x84_8_c: 72347.0
vvc_alf_classify_96x84_8_avx2: 14025.7
vvc_alf_classify_96x84_10_c: 73767.7
vvc_alf_classify_96x84_10_avx2: 11271.2
vvc_alf_classify_96x88_8_c: 88992.7
vvc_alf_classify_96x88_8_avx2: 13678.7
vvc_alf_classify_96x88_10_c: 75902.0
vvc_alf_classify_96x88_10_avx2: 11632.5
vvc_alf_classify_96x92_8_c: 79048.2
vvc_alf_classify_96x92_8_avx2: 14504.5
vvc_alf_classify_96x92_10_c: 142249.5
vvc_alf_classify_96x92_10_avx2: 12319.0
vvc_alf_classify_96x96_8_c: 82587.0
vvc_alf_classify_96x96_8_avx2: 14953.7
vvc_alf_classify_96x96_10_c: 80332.2
vvc_alf_classify_96x96_10_avx2: 12700.2
vvc_alf_classify_96x100_8_c: 88264.5
vvc_alf_classify_96x100_8_avx2: 15832.2
vvc_alf_classify_96x100_10_c: 83848.5
vvc_alf_classify_96x100_10_avx2: 13413.0
vvc_alf_classify_96x104_8_c: 89402.2
vvc_alf_classify_96x104_8_avx2: 16661.5
vvc_alf_classify_96x104_10_c: 87071.5
vvc_alf_classify_96x104_10_avx2: 13777.0
vvc_alf_classify_96x108_8_c: 92672.2
vvc_alf_classify_96x108_8_avx2: 17332.5
vvc_alf_classify_96x108_10_c: 92729.2
vvc_alf_classify_96x108_10_avx2: 14482.2
vvc_alf_classify_96x112_8_c: 96115.7
vvc_alf_classify_96x112_8_avx2: 17833.7
vvc_alf_classify_96x112_10_c: 93598.7
vvc_alf_classify_96x112_10_avx2: 14825.5
vvc_alf_classify_96x116_8_c: 99384.7
vvc_alf_classify_96x116_8_avx2: 18223.5
vvc_alf_classify_96x116_10_c: 96829.7
vvc_alf_classify_96x116_10_avx2: 15505.5
vvc_alf_classify_96x120_8_c: 102737.2
vvc_alf_classify_96x120_8_avx2: 19030.7
vvc_alf_classify_96x120_10_c: 100096.7
vvc_alf_classify_96x120_10_avx2: 15860.7
vvc_alf_classify_96x124_8_c: 105888.0
vvc_alf_classify_96x124_8_avx2: 19426.2
vvc_alf_classify_96x124_10_c: 103313.7
vvc_alf_classify_96x124_10_avx2: 16611.2
vvc_alf_classify_96x128_8_c: 109085.0
vvc_alf_classify_96x128_8_avx2: 19815.0
vvc_alf_classify_96x128_10_c: 106370.0
vvc_alf_classify_96x128_10_avx2: 16900.2
vvc_alf_classify_100x4_8_c: 5643.5
vvc_alf_classify_100x4_8_avx2: 1314.0
vvc_alf_classify_100x4_10_c: 5479.0
vvc_alf_classify_100x4_10_avx2: 1080.2
vvc_alf_classify_100x8_8_c: 9123.5
vvc_alf_classify_100x8_8_avx2: 1700.5
vvc_alf_classify_100x8_10_c: 17203.7
vvc_alf_classify_100x8_10_avx2: 1407.7
vvc_alf_classify_100x12_8_c: 12573.5
vvc_alf_classify_100x12_8_avx2: 2578.5
vvc_alf_classify_100x12_10_c: 12243.0
vvc_alf_classify_100x12_10_avx2: 2241.5
vvc_alf_classify_100x16_8_c: 16971.0
vvc_alf_classify_100x16_8_avx2: 2997.7
vvc_alf_classify_100x16_10_c: 15608.2
vvc_alf_classify_100x16_10_avx2: 2524.0
vvc_alf_classify_100x20_8_c: 19523.7
vvc_alf_classify_100x20_8_avx2: 3908.5
vvc_alf_classify_100x20_10_c: 19027.0
vvc_alf_classify_100x20_10_avx2: 3321.0
vvc_alf_classify_100x24_8_c: 23018.5
vvc_alf_classify_100x24_8_avx2: 4229.5
vvc_alf_classify_100x24_10_c: 22349.0
vvc_alf_classify_100x24_10_avx2: 3550.2
vvc_alf_classify_100x28_8_c: 26479.0
vvc_alf_classify_100x28_8_avx2: 5043.5
vvc_alf_classify_100x28_10_c: 25746.2
vvc_alf_classify_100x28_10_avx2: 4403.0
vvc_alf_classify_100x32_8_c: 29932.2
vvc_alf_classify_100x32_8_avx2: 5473.7
vvc_alf_classify_100x32_10_c: 29130.0
vvc_alf_classify_100x32_10_avx2: 4611.5
vvc_alf_classify_100x36_8_c: 33411.2
vvc_alf_classify_100x36_8_avx2: 6267.7
vvc_alf_classify_100x36_10_c: 32506.5
vvc_alf_classify_100x36_10_avx2: 19257.0
vvc_alf_classify_100x40_8_c: 36901.5
vvc_alf_classify_100x40_8_avx2: 6697.2
vvc_alf_classify_100x40_10_c: 35930.5
vvc_alf_classify_100x40_10_avx2: 5645.7
vvc_alf_classify_100x44_8_c: 40395.7
vvc_alf_classify_100x44_8_avx2: 7750.0
vvc_alf_classify_100x44_10_c: 39253.2
vvc_alf_classify_100x44_10_avx2: 6401.0
vvc_alf_classify_100x48_8_c: 43784.7
vvc_alf_classify_100x48_8_avx2: 7964.7
vvc_alf_classify_100x48_10_c: 42643.2
vvc_alf_classify_100x48_10_avx2: 6911.5
vvc_alf_classify_100x52_8_c: 47267.5
vvc_alf_classify_100x52_8_avx2: 112640.7
vvc_alf_classify_100x52_10_c: 46106.7
vvc_alf_classify_100x52_10_avx2: 7476.2
vvc_alf_classify_100x56_8_c: 50880.7
vvc_alf_classify_100x56_8_avx2: 25744.0
vvc_alf_classify_100x56_10_c: 49506.0
vvc_alf_classify_100x56_10_avx2: 7820.2
vvc_alf_classify_100x60_8_c: 54407.5
vvc_alf_classify_100x60_8_avx2: 10054.2
vvc_alf_classify_100x60_10_c: 52928.5
vvc_alf_classify_100x60_10_avx2: 8543.5
vvc_alf_classify_100x64_8_c: 58028.2
vvc_alf_classify_100x64_8_avx2: 10477.2
vvc_alf_classify_100x64_10_c: 57819.0
vvc_alf_classify_100x64_10_avx2: 9617.2
vvc_alf_classify_100x68_8_c: 61341.2
vvc_alf_classify_100x68_8_avx2: 11291.2
vvc_alf_classify_100x68_10_c: 59854.2
vvc_alf_classify_100x68_10_avx2: 9617.2
vvc_alf_classify_100x72_8_c: 64870.2
vvc_alf_classify_100x72_8_avx2: 11699.5
vvc_alf_classify_100x72_10_c: 63279.7
vvc_alf_classify_100x72_10_avx2: 9987.2
vvc_alf_classify_100x76_8_c: 68441.7
vvc_alf_classify_100x76_8_avx2: 12857.7
vvc_alf_classify_100x76_10_c: 66703.0
vvc_alf_classify_100x76_10_avx2: 15491.5
vvc_alf_classify_100x80_8_c: 90362.5
vvc_alf_classify_100x80_8_avx2: 13655.0
vvc_alf_classify_100x80_10_c: 70098.7
vvc_alf_classify_100x80_10_avx2: 11057.5
vvc_alf_classify_100x84_8_c: 75404.7
vvc_alf_classify_100x84_8_avx2: 14219.7
vvc_alf_classify_100x84_10_c: 73414.7
vvc_alf_classify_100x84_10_avx2: 11927.2
vvc_alf_classify_100x88_8_c: 79004.5
vvc_alf_classify_100x88_8_avx2: 14704.5
vvc_alf_classify_100x88_10_c: 76871.7
vvc_alf_classify_100x88_10_avx2: 12275.0
vvc_alf_classify_100x92_8_c: 82500.7
vvc_alf_classify_100x92_8_avx2: 15152.5
vvc_alf_classify_100x92_10_c: 80242.7
vvc_alf_classify_100x92_10_avx2: 13023.5
vvc_alf_classify_100x96_8_c: 86157.7
vvc_alf_classify_100x96_8_avx2: 15536.7
vvc_alf_classify_100x96_10_c: 83840.2
vvc_alf_classify_100x96_10_avx2: 13402.5
vvc_alf_classify_100x100_8_c: 114762.7
vvc_alf_classify_100x100_8_avx2: 16834.0
vvc_alf_classify_100x100_10_c: 89558.0
vvc_alf_classify_100x100_10_avx2: 14150.2
vvc_alf_classify_100x104_8_c: 93097.5
vvc_alf_classify_100x104_8_avx2: 23405.0
vvc_alf_classify_100x104_10_c: 95517.7
vvc_alf_classify_100x104_10_avx2: 14494.2
vvc_alf_classify_100x108_8_c: 96584.0
vvc_alf_classify_100x108_8_avx2: 18149.7
vvc_alf_classify_100x108_10_c: 172316.2
vvc_alf_classify_100x108_10_avx2: 15267.7
vvc_alf_classify_100x112_8_c: 99926.2
vvc_alf_classify_100x112_8_avx2: 18562.7
vvc_alf_classify_100x112_10_c: 97512.0
vvc_alf_classify_100x112_10_avx2: 15601.5
vvc_alf_classify_100x116_8_c: 175468.0
vvc_alf_classify_100x116_8_avx2: 25182.5
vvc_alf_classify_100x116_10_c: 103579.2
vvc_alf_classify_100x116_10_avx2: 16351.5
vvc_alf_classify_100x120_8_c: 106971.5
vvc_alf_classify_100x120_8_avx2: 19926.2
vvc_alf_classify_100x120_10_c: 104397.2
vvc_alf_classify_100x120_10_avx2: 16689.5
vvc_alf_classify_100x124_8_c: 110449.2
vvc_alf_classify_100x124_8_avx2: 21430.0
vvc_alf_classify_100x124_10_c: 107455.7
vvc_alf_classify_100x124_10_avx2: 17519.0
vvc_alf_classify_100x128_8_c: 113703.5
vvc_alf_classify_100x128_8_avx2: 20763.0
vvc_alf_classify_100x128_10_c: 110851.2
vvc_alf_classify_100x128_10_avx2: 17832.5
vvc_alf_classify_104x4_8_c: 6035.7
vvc_alf_classify_104x4_8_avx2: 1307.0
vvc_alf_classify_104x4_10_c: 5701.7
vvc_alf_classify_104x4_10_avx2: 1082.5
vvc_alf_classify_104x8_8_c: 9968.7
vvc_alf_classify_104x8_8_avx2: 1694.7
vvc_alf_classify_104x8_10_c: 9204.0
vvc_alf_classify_104x8_10_avx2: 1408.5
vvc_alf_classify_104x12_8_c: 13048.0
vvc_alf_classify_104x12_8_avx2: 2582.2
vvc_alf_classify_104x12_10_c: 12710.5
vvc_alf_classify_104x12_10_avx2: 2254.5
vvc_alf_classify_104x16_8_c: 22530.0
vvc_alf_classify_104x16_8_avx2: 3000.0
vvc_alf_classify_104x16_10_c: 16173.5
vvc_alf_classify_104x16_10_avx2: 2522.0
vvc_alf_classify_104x20_8_c: 20302.5
vvc_alf_classify_104x20_8_avx2: 3919.7
vvc_alf_classify_104x20_10_c: 19725.5
vvc_alf_classify_104x20_10_avx2: 3330.2
vvc_alf_classify_104x24_8_c: 23918.7
vvc_alf_classify_104x24_8_avx2: 4238.5
vvc_alf_classify_104x24_10_c: 23197.2
vvc_alf_classify_104x24_10_avx2: 3570.5
vvc_alf_classify_104x28_8_c: 27436.7
vvc_alf_classify_104x28_8_avx2: 5069.5
vvc_alf_classify_104x28_10_c: 26707.7
vvc_alf_classify_104x28_10_avx2: 4418.2
vvc_alf_classify_104x32_8_c: 31067.7
vvc_alf_classify_104x32_8_avx2: 5472.2
vvc_alf_classify_104x32_10_c: 38667.0
vvc_alf_classify_104x32_10_avx2: 4632.5
vvc_alf_classify_104x36_8_c: 34710.0
vvc_alf_classify_104x36_8_avx2: 6300.5
vvc_alf_classify_104x36_10_c: 33822.2
vvc_alf_classify_104x36_10_avx2: 7360.2
vvc_alf_classify_104x40_8_c: 38283.7
vvc_alf_classify_104x40_8_avx2: 6888.0
vvc_alf_classify_104x40_10_c: 37259.7
vvc_alf_classify_104x40_10_avx2: 7778.0
vvc_alf_classify_104x44_8_c: 41889.5
vvc_alf_classify_104x44_8_avx2: 7566.5
vvc_alf_classify_104x44_10_c: 75633.2
vvc_alf_classify_104x44_10_avx2: 6760.0
vvc_alf_classify_104x48_8_c: 45516.0
vvc_alf_classify_104x48_8_avx2: 7982.7
vvc_alf_classify_104x48_10_c: 44370.7
vvc_alf_classify_104x48_10_avx2: 6937.5
vvc_alf_classify_104x52_8_c: 49152.2
vvc_alf_classify_104x52_8_avx2: 8816.7
vvc_alf_classify_104x52_10_c: 47882.7
vvc_alf_classify_104x52_10_avx2: 7890.2
vvc_alf_classify_104x56_8_c: 52855.5
vvc_alf_classify_104x56_8_avx2: 14825.5
vvc_alf_classify_104x56_10_c: 51417.0
vvc_alf_classify_104x56_10_avx2: 7844.7
vvc_alf_classify_104x60_8_c: 59516.7
vvc_alf_classify_104x60_8_avx2: 10099.0
vvc_alf_classify_104x60_10_c: 69411.0
vvc_alf_classify_104x60_10_avx2: 8580.0
vvc_alf_classify_104x64_8_c: 60078.2
vvc_alf_classify_104x64_8_avx2: 10519.0
vvc_alf_classify_104x64_10_c: 58476.5
vvc_alf_classify_104x64_10_avx2: 8899.5
vvc_alf_classify_104x68_8_c: 63734.7
vvc_alf_classify_104x68_8_avx2: 11629.7
vvc_alf_classify_104x68_10_c: 62048.0
vvc_alf_classify_104x68_10_avx2: 9668.0
vvc_alf_classify_104x72_8_c: 75167.5
vvc_alf_classify_104x72_8_avx2: 11753.7
vvc_alf_classify_104x72_10_c: 65595.7
vvc_alf_classify_104x72_10_avx2: 9985.7
vvc_alf_classify_104x76_8_c: 70918.7
vvc_alf_classify_104x76_8_avx2: 12894.2
vvc_alf_classify_104x76_10_c: 69032.2
vvc_alf_classify_104x76_10_avx2: 15554.0
vvc_alf_classify_104x80_8_c: 74547.5
vvc_alf_classify_104x80_8_avx2: 13684.0
vvc_alf_classify_104x80_10_c: 72640.2
vvc_alf_classify_104x80_10_avx2: 11110.5
vvc_alf_classify_104x84_8_c: 78148.7
vvc_alf_classify_104x84_8_avx2: 13886.5
vvc_alf_classify_104x84_10_c: 76163.5
vvc_alf_classify_104x84_10_avx2: 11965.2
vvc_alf_classify_104x88_8_c: 82029.2
vvc_alf_classify_104x88_8_avx2: 19774.0
vvc_alf_classify_104x88_10_c: 79810.0
vvc_alf_classify_104x88_10_avx2: 12324.2
vvc_alf_classify_104x92_8_c: 85605.2
vvc_alf_classify_104x92_8_avx2: 15206.7
vvc_alf_classify_104x92_10_c: 83404.5
vvc_alf_classify_104x92_10_avx2: 13092.7
vvc_alf_classify_104x96_8_c: 89178.2
vvc_alf_classify_104x96_8_avx2: 16046.0
vvc_alf_classify_104x96_10_c: 86913.0
vvc_alf_classify_104x96_10_avx2: 13445.7
vvc_alf_classify_104x100_8_c: 93119.7
vvc_alf_classify_104x100_8_avx2: 16455.0
vvc_alf_classify_104x100_10_c: 92797.7
vvc_alf_classify_104x100_10_avx2: 14236.5
vvc_alf_classify_104x104_8_c: 96437.2
vvc_alf_classify_104x104_8_avx2: 25136.2
vvc_alf_classify_104x104_10_c: 93994.7
vvc_alf_classify_104x104_10_avx2: 14530.0
vvc_alf_classify_104x108_8_c: 100045.5
vvc_alf_classify_104x108_8_avx2: 17745.5
vvc_alf_classify_104x108_10_c: 105085.2
vvc_alf_classify_104x108_10_avx2: 15305.2
vvc_alf_classify_104x112_8_c: 103752.5
vvc_alf_classify_104x112_8_avx2: 18142.2
vvc_alf_classify_104x112_10_c: 100910.7
vvc_alf_classify_104x112_10_avx2: 35559.2
vvc_alf_classify_104x116_8_c: 107519.7
vvc_alf_classify_104x116_8_avx2: 19032.2
vvc_alf_classify_104x116_10_c: 110130.5
vvc_alf_classify_104x116_10_avx2: 16429.5
vvc_alf_classify_104x120_8_c: 110979.5
vvc_alf_classify_104x120_8_avx2: 19985.5
vvc_alf_classify_104x120_10_c: 118477.2
vvc_alf_classify_104x120_10_avx2: 16764.0
vvc_alf_classify_104x124_8_c: 114415.5
vvc_alf_classify_104x124_8_avx2: 21518.7
vvc_alf_classify_104x124_10_c: 111520.0
vvc_alf_classify_104x124_10_avx2: 17534.0
vvc_alf_classify_104x128_8_c: 117941.5
vvc_alf_classify_104x128_8_avx2: 20791.0
vvc_alf_classify_104x128_10_c: 114727.5
vvc_alf_classify_104x128_10_avx2: 17905.5
vvc_alf_classify_108x4_8_c: 6084.5
vvc_alf_classify_108x4_8_avx2: 1314.5
vvc_alf_classify_108x4_10_c: 5905.7
vvc_alf_classify_108x4_10_avx2: 1121.5
vvc_alf_classify_108x8_8_c: 10081.5
vvc_alf_classify_108x8_8_avx2: 1700.5
vvc_alf_classify_108x8_10_c: 9546.5
vvc_alf_classify_108x8_10_avx2: 1433.2
vvc_alf_classify_108x12_8_c: 13558.7
vvc_alf_classify_108x12_8_avx2: 2582.2
vvc_alf_classify_108x12_10_c: 13206.0
vvc_alf_classify_108x12_10_avx2: 2262.7
vvc_alf_classify_108x16_8_c: 17286.0
vvc_alf_classify_108x16_8_avx2: 3006.7
vvc_alf_classify_108x16_10_c: 16825.0
vvc_alf_classify_108x16_10_avx2: 2532.2
vvc_alf_classify_108x20_8_c: 21014.5
vvc_alf_classify_108x20_8_avx2: 3819.2
vvc_alf_classify_108x20_10_c: 20471.0
vvc_alf_classify_108x20_10_avx2: 3334.7
vvc_alf_classify_108x24_8_c: 26118.5
vvc_alf_classify_108x24_8_avx2: 4242.0
vvc_alf_classify_108x24_10_c: 24092.2
vvc_alf_classify_108x24_10_avx2: 3665.7
vvc_alf_classify_108x28_8_c: 28569.5
vvc_alf_classify_108x28_8_avx2: 5086.5
vvc_alf_classify_108x28_10_c: 27755.5
vvc_alf_classify_108x28_10_avx2: 4438.7
vvc_alf_classify_108x32_8_c: 32257.0
vvc_alf_classify_108x32_8_avx2: 5483.5
vvc_alf_classify_108x32_10_c: 31412.5
vvc_alf_classify_108x32_10_avx2: 6330.2
vvc_alf_classify_108x36_8_c: 36032.5
vvc_alf_classify_108x36_8_avx2: 6318.2
vvc_alf_classify_108x36_10_c: 35038.5
vvc_alf_classify_108x36_10_avx2: 5364.5
vvc_alf_classify_108x40_8_c: 39797.0
vvc_alf_classify_108x40_8_avx2: 6737.7
vvc_alf_classify_108x40_10_c: 39716.5
vvc_alf_classify_108x40_10_avx2: 5689.0
vvc_alf_classify_108x44_8_c: 43489.7
vvc_alf_classify_108x44_8_avx2: 15886.7
vvc_alf_classify_108x44_10_c: 42430.0
vvc_alf_classify_108x44_10_avx2: 6780.0
vvc_alf_classify_108x48_8_c: 47211.7
vvc_alf_classify_108x48_8_avx2: 8011.0
vvc_alf_classify_108x48_10_c: 46019.5
vvc_alf_classify_108x48_10_avx2: 6947.5
vvc_alf_classify_108x52_8_c: 51052.0
vvc_alf_classify_108x52_8_avx2: 9871.5
vvc_alf_classify_108x52_10_c: 67485.2
vvc_alf_classify_108x52_10_avx2: 7714.2
vvc_alf_classify_108x56_8_c: 54701.0
vvc_alf_classify_108x56_8_avx2: 9289.5
vvc_alf_classify_108x56_10_c: 53323.5
vvc_alf_classify_108x56_10_avx2: 7865.7
vvc_alf_classify_108x60_8_c: 58589.0
vvc_alf_classify_108x60_8_avx2: 10122.0
vvc_alf_classify_108x60_10_c: 57030.2
vvc_alf_classify_108x60_10_avx2: 8614.2
vvc_alf_classify_108x64_8_c: 65679.7
vvc_alf_classify_108x64_8_avx2: 10561.5
vvc_alf_classify_108x64_10_c: 60706.0
vvc_alf_classify_108x64_10_avx2: 8939.5
vvc_alf_classify_108x68_8_c: 84568.7
vvc_alf_classify_108x68_8_avx2: 11365.7
vvc_alf_classify_108x68_10_c: 64393.0
vvc_alf_classify_108x68_10_avx2: 9697.0
vvc_alf_classify_108x72_8_c: 69908.7
vvc_alf_classify_108x72_8_avx2: 11774.7
vvc_alf_classify_108x72_10_c: 68045.7
vvc_alf_classify_108x72_10_avx2: 10037.2
vvc_alf_classify_108x76_8_c: 73698.5
vvc_alf_classify_108x76_8_avx2: 12924.7
vvc_alf_classify_108x76_10_c: 71717.7
vvc_alf_classify_108x76_10_avx2: 10759.7
vvc_alf_classify_108x80_8_c: 83899.5
vvc_alf_classify_108x80_8_avx2: 13797.7
vvc_alf_classify_108x80_10_c: 75383.0
vvc_alf_classify_108x80_10_avx2: 12395.5
vvc_alf_classify_108x84_8_c: 90998.2
vvc_alf_classify_108x84_8_avx2: 13936.5
vvc_alf_classify_108x84_10_c: 97572.2
vvc_alf_classify_108x84_10_avx2: 11994.2
vvc_alf_classify_108x88_8_c: 85230.7
vvc_alf_classify_108x88_8_avx2: 14369.2
vvc_alf_classify_108x88_10_c: 85163.2
vvc_alf_classify_108x88_10_avx2: 15998.5
vvc_alf_classify_108x92_8_c: 97140.2
vvc_alf_classify_108x92_8_avx2: 15220.2
vvc_alf_classify_108x92_10_c: 86602.2
vvc_alf_classify_108x92_10_avx2: 13105.2
vvc_alf_classify_108x96_8_c: 92775.7
vvc_alf_classify_108x96_8_avx2: 16055.7
vvc_alf_classify_108x96_10_c: 90149.2
vvc_alf_classify_108x96_10_avx2: 13448.0
vvc_alf_classify_108x100_8_c: 96467.2
vvc_alf_classify_108x100_8_avx2: 16461.7
vvc_alf_classify_108x100_10_c: 96402.0
vvc_alf_classify_108x100_10_avx2: 14256.7
vvc_alf_classify_108x104_8_c: 100318.7
vvc_alf_classify_108x104_8_avx2: 81441.7
vvc_alf_classify_108x104_10_c: 100149.2
vvc_alf_classify_108x104_10_avx2: 14596.2
vvc_alf_classify_108x108_8_c: 112731.5
vvc_alf_classify_108x108_8_avx2: 17834.0
vvc_alf_classify_108x108_10_c: 101330.7
vvc_alf_classify_108x108_10_avx2: 15355.7
vvc_alf_classify_108x112_8_c: 113469.0
vvc_alf_classify_108x112_8_avx2: 18202.0
vvc_alf_classify_108x112_10_c: 107540.5
vvc_alf_classify_108x112_10_avx2: 15714.7
vvc_alf_classify_108x116_8_c: 111402.5
vvc_alf_classify_108x116_8_avx2: 19077.0
vvc_alf_classify_108x116_10_c: 111403.2
vvc_alf_classify_108x116_10_avx2: 16920.7
vvc_alf_classify_108x120_8_c: 122865.5
vvc_alf_classify_108x120_8_avx2: 24927.5
vvc_alf_classify_108x120_10_c: 112153.7
vvc_alf_classify_108x120_10_avx2: 16790.7
vvc_alf_classify_108x124_8_c: 118863.5
vvc_alf_classify_108x124_8_avx2: 20392.7
vvc_alf_classify_108x124_10_c: 115644.0
vvc_alf_classify_108x124_10_avx2: 17575.7
vvc_alf_classify_108x128_8_c: 122349.2
vvc_alf_classify_108x128_8_avx2: 20815.7
vvc_alf_classify_108x128_10_c: 119170.2
vvc_alf_classify_108x128_10_avx2: 17907.0
vvc_alf_classify_112x4_8_c: 6302.0
vvc_alf_classify_112x4_8_avx2: 1473.7
vvc_alf_classify_112x4_10_c: 6103.7
vvc_alf_classify_112x4_10_avx2: 1208.2
vvc_alf_classify_112x8_8_c: 13832.0
vvc_alf_classify_112x8_8_avx2: 1908.2
vvc_alf_classify_112x8_10_c: 10121.7
vvc_alf_classify_112x8_10_avx2: 1606.0
vvc_alf_classify_112x12_8_c: 14034.7
vvc_alf_classify_112x12_8_avx2: 2820.5
vvc_alf_classify_112x12_10_c: 13666.0
vvc_alf_classify_112x12_10_avx2: 2446.0
vvc_alf_classify_112x16_8_c: 17904.7
vvc_alf_classify_112x16_8_avx2: 3300.7
vvc_alf_classify_112x16_10_c: 17409.5
vvc_alf_classify_112x16_10_avx2: 2752.7
vvc_alf_classify_112x20_8_c: 21811.2
vvc_alf_classify_112x20_8_avx2: 4180.2
vvc_alf_classify_112x20_10_c: 21239.5
vvc_alf_classify_112x20_10_avx2: 3602.5
vvc_alf_classify_112x24_8_c: 25672.0
vvc_alf_classify_112x24_8_avx2: 4651.7
vvc_alf_classify_112x24_10_c: 24965.7
vvc_alf_classify_112x24_10_avx2: 3965.5
vvc_alf_classify_112x28_8_c: 29536.0
vvc_alf_classify_112x28_8_avx2: 5566.2
vvc_alf_classify_112x28_10_c: 29466.0
vvc_alf_classify_112x28_10_avx2: 4774.5
vvc_alf_classify_112x32_8_c: 33377.7
vvc_alf_classify_112x32_8_avx2: 6045.7
vvc_alf_classify_112x32_10_c: 32520.0
vvc_alf_classify_112x32_10_avx2: 6700.5
vvc_alf_classify_112x36_8_c: 37265.7
vvc_alf_classify_112x36_8_avx2: 6924.5
vvc_alf_classify_112x36_10_c: 36291.0
vvc_alf_classify_112x36_10_avx2: 5810.5
vvc_alf_classify_112x40_8_c: 41181.2
vvc_alf_classify_112x40_8_avx2: 7433.0
vvc_alf_classify_112x40_10_c: 40068.0
vvc_alf_classify_112x40_10_avx2: 6186.5
vvc_alf_classify_112x44_8_c: 45026.0
vvc_alf_classify_112x44_8_avx2: 8335.0
vvc_alf_classify_112x44_10_c: 44967.2
vvc_alf_classify_112x44_10_avx2: 7184.0
vvc_alf_classify_112x48_8_c: 53005.5
vvc_alf_classify_112x48_8_avx2: 8812.2
vvc_alf_classify_112x48_10_c: 47786.7
vvc_alf_classify_112x48_10_avx2: 7537.0
vvc_alf_classify_112x52_8_c: 52891.2
vvc_alf_classify_112x52_8_avx2: 9648.5
vvc_alf_classify_112x52_10_c: 51462.2
vvc_alf_classify_112x52_10_avx2: 8347.5
vvc_alf_classify_112x56_8_c: 56795.7
vvc_alf_classify_112x56_8_avx2: 10132.5
vvc_alf_classify_112x56_10_c: 55257.2
vvc_alf_classify_112x56_10_avx2: 8514.2
vvc_alf_classify_112x60_8_c: 62325.7
vvc_alf_classify_112x60_8_avx2: 11087.2
vvc_alf_classify_112x60_10_c: 59023.7
vvc_alf_classify_112x60_10_avx2: 9311.0
vvc_alf_classify_112x64_8_c: 64577.7
vvc_alf_classify_112x64_8_avx2: 11572.0
vvc_alf_classify_112x64_10_c: 62830.0
vvc_alf_classify_112x64_10_avx2: 9645.5
vvc_alf_classify_112x68_8_c: 68422.5
vvc_alf_classify_112x68_8_avx2: 12485.7
vvc_alf_classify_112x68_10_c: 66671.7
vvc_alf_classify_112x68_10_avx2: 10498.2
vvc_alf_classify_112x72_8_c: 72298.5
vvc_alf_classify_112x72_8_avx2: 22113.7
vvc_alf_classify_112x72_10_c: 72233.0
vvc_alf_classify_112x72_10_avx2: 10923.5
vvc_alf_classify_112x76_8_c: 78264.5
vvc_alf_classify_112x76_8_avx2: 14219.0
vvc_alf_classify_112x76_10_c: 100623.2
vvc_alf_classify_112x76_10_avx2: 11746.2
vvc_alf_classify_112x80_8_c: 103612.5
vvc_alf_classify_112x80_8_avx2: 14421.2
vvc_alf_classify_112x80_10_c: 78130.2
vvc_alf_classify_112x80_10_avx2: 12386.0
vvc_alf_classify_112x84_8_c: 97624.5
vvc_alf_classify_112x84_8_avx2: 15230.5
vvc_alf_classify_112x84_10_c: 84079.7
vvc_alf_classify_112x84_10_avx2: 12917.0
vvc_alf_classify_112x88_8_c: 88193.7
vvc_alf_classify_112x88_8_avx2: 20079.2
vvc_alf_classify_112x88_10_c: 88078.0
vvc_alf_classify_112x88_10_avx2: 13321.2
vvc_alf_classify_112x92_8_c: 206002.7
vvc_alf_classify_112x92_8_avx2: 16703.5
vvc_alf_classify_112x92_10_c: 89479.7
vvc_alf_classify_112x92_10_avx2: 14136.7
vvc_alf_classify_112x96_8_c: 95951.7
vvc_alf_classify_112x96_8_avx2: 17611.7
vvc_alf_classify_112x96_10_c: 95780.5
vvc_alf_classify_112x96_10_avx2: 14528.5
vvc_alf_classify_112x100_8_c: 99635.7
vvc_alf_classify_112x100_8_avx2: 23523.5
vvc_alf_classify_112x100_10_c: 99715.0
vvc_alf_classify_112x100_10_avx2: 15350.5
vvc_alf_classify_112x104_8_c: 103612.2
vvc_alf_classify_112x104_8_avx2: 19520.7
vvc_alf_classify_112x104_10_c: 103491.0
vvc_alf_classify_112x104_10_avx2: 15777.2
vvc_alf_classify_112x108_8_c: 107624.7
vvc_alf_classify_112x108_8_avx2: 19958.2
vvc_alf_classify_112x108_10_c: 104685.5
vvc_alf_classify_112x108_10_avx2: 16545.7
vvc_alf_classify_112x112_8_c: 111381.7
vvc_alf_classify_112x112_8_avx2: 19957.7
vvc_alf_classify_112x112_10_c: 202160.7
vvc_alf_classify_112x112_10_avx2: 16956.7
vvc_alf_classify_112x116_8_c: 115317.2
vvc_alf_classify_112x116_8_avx2: 20836.0
vvc_alf_classify_112x116_10_c: 112206.0
vvc_alf_classify_112x116_10_avx2: 17649.5
vvc_alf_classify_112x120_8_c: 119227.5
vvc_alf_classify_112x120_8_avx2: 21946.5
vvc_alf_classify_112x120_10_c: 119078.2
vvc_alf_classify_112x120_10_avx2: 18071.5
vvc_alf_classify_112x124_8_c: 136884.5
vvc_alf_classify_112x124_8_avx2: 22225.2
vvc_alf_classify_112x124_10_c: 119720.0
vvc_alf_classify_112x124_10_avx2: 18841.0
vvc_alf_classify_112x128_8_c: 126549.2
vvc_alf_classify_112x128_8_avx2: 22646.7
vvc_alf_classify_112x128_10_c: 123245.2
vvc_alf_classify_112x128_10_avx2: 19300.5
vvc_alf_classify_116x4_8_c: 6859.7
vvc_alf_classify_116x4_8_avx2: 1528.5
vvc_alf_classify_116x4_10_c: 6331.7
vvc_alf_classify_116x4_10_avx2: 1258.2
vvc_alf_classify_116x8_8_c: 10507.2
vvc_alf_classify_116x8_8_avx2: 1964.2
vvc_alf_classify_116x8_10_c: 10211.5
vvc_alf_classify_116x8_10_avx2: 1660.0
vvc_alf_classify_116x12_8_c: 14535.0
vvc_alf_classify_116x12_8_avx2: 2930.7
vvc_alf_classify_116x12_10_c: 14098.7
vvc_alf_classify_116x12_10_avx2: 2548.0
vvc_alf_classify_116x16_8_c: 18534.7
vvc_alf_classify_116x16_8_avx2: 3404.5
vvc_alf_classify_116x16_10_c: 18038.7
vvc_alf_classify_116x16_10_avx2: 2860.0
vvc_alf_classify_116x20_8_c: 22565.7
vvc_alf_classify_116x20_8_avx2: 4333.7
vvc_alf_classify_116x20_10_c: 21910.5
vvc_alf_classify_116x20_10_avx2: 3764.0
vvc_alf_classify_116x24_8_c: 26544.5
vvc_alf_classify_116x24_8_avx2: 4823.0
vvc_alf_classify_116x24_10_c: 25850.5
vvc_alf_classify_116x24_10_avx2: 4039.5
vvc_alf_classify_116x28_8_c: 30534.7
vvc_alf_classify_116x28_8_avx2: 16124.0
vvc_alf_classify_116x28_10_c: 29772.7
vvc_alf_classify_116x28_10_avx2: 5014.0
vvc_alf_classify_116x32_8_c: 34546.2
vvc_alf_classify_116x32_8_avx2: 6259.5
vvc_alf_classify_116x32_10_c: 33593.0
vvc_alf_classify_116x32_10_avx2: 5264.5
vvc_alf_classify_116x36_8_c: 38610.5
vvc_alf_classify_116x36_8_avx2: 7211.2
vvc_alf_classify_116x36_10_c: 37584.5
vvc_alf_classify_116x36_10_avx2: 6099.5
vvc_alf_classify_116x40_8_c: 42648.2
vvc_alf_classify_116x40_8_avx2: 7693.0
vvc_alf_classify_116x40_10_c: 41491.0
vvc_alf_classify_116x40_10_avx2: 6478.2
vvc_alf_classify_116x44_8_c: 47878.2
vvc_alf_classify_116x44_8_avx2: 8665.5
vvc_alf_classify_116x44_10_c: 45396.2
vvc_alf_classify_116x44_10_avx2: 7569.0
vvc_alf_classify_116x48_8_c: 50606.0
vvc_alf_classify_116x48_8_avx2: 25446.5
vvc_alf_classify_116x48_10_c: 49336.2
vvc_alf_classify_116x48_10_avx2: 7917.5
vvc_alf_classify_116x52_8_c: 54651.0
vvc_alf_classify_116x52_8_avx2: 10093.0
vvc_alf_classify_116x52_10_c: 53221.2
vvc_alf_classify_116x52_10_avx2: 8782.0
vvc_alf_classify_116x56_8_c: 58734.2
vvc_alf_classify_116x56_8_avx2: 10561.5
vvc_alf_classify_116x56_10_c: 57269.5
vvc_alf_classify_116x56_10_avx2: 8929.0
vvc_alf_classify_116x60_8_c: 62804.5
vvc_alf_classify_116x60_8_avx2: 24801.2
vvc_alf_classify_116x60_10_c: 61104.5
vvc_alf_classify_116x60_10_avx2: 9755.7
vvc_alf_classify_116x64_8_c: 66826.7
vvc_alf_classify_116x64_8_avx2: 11996.5
vvc_alf_classify_116x64_10_c: 66785.2
vvc_alf_classify_116x64_10_avx2: 10128.7
vvc_alf_classify_116x68_8_c: 70815.2
vvc_alf_classify_116x68_8_avx2: 12937.7
vvc_alf_classify_116x68_10_c: 69030.2
vvc_alf_classify_116x68_10_avx2: 11034.5
vvc_alf_classify_116x72_8_c: 74941.5
vvc_alf_classify_116x72_8_avx2: 13783.7
vvc_alf_classify_116x72_10_c: 72939.7
vvc_alf_classify_116x72_10_avx2: 11426.0
vvc_alf_classify_116x76_8_c: 78980.5
vvc_alf_classify_116x76_8_avx2: 49974.5
vvc_alf_classify_116x76_10_c: 131868.5
vvc_alf_classify_116x76_10_avx2: 12337.5
vvc_alf_classify_116x80_8_c: 83044.2
vvc_alf_classify_116x80_8_avx2: 19745.2
vvc_alf_classify_116x80_10_c: 80892.7
vvc_alf_classify_116x80_10_avx2: 12723.2
vvc_alf_classify_116x84_8_c: 87306.7
vvc_alf_classify_116x84_8_avx2: 16213.2
vvc_alf_classify_116x84_10_c: 89580.2
vvc_alf_classify_116x84_10_avx2: 13573.0
vvc_alf_classify_116x88_8_c: 91257.2
vvc_alf_classify_116x88_8_avx2: 16341.0
vvc_alf_classify_116x88_10_c: 93727.5
vvc_alf_classify_116x88_10_avx2: 13952.0
vvc_alf_classify_116x92_8_c: 95304.0
vvc_alf_classify_116x92_8_avx2: 17272.5
vvc_alf_classify_116x92_10_c: 92690.7
vvc_alf_classify_116x92_10_avx2: 14832.2
vvc_alf_classify_116x96_8_c: 99386.2
vvc_alf_classify_116x96_8_avx2: 18243.2
vvc_alf_classify_116x96_10_c: 96681.5
vvc_alf_classify_116x96_10_avx2: 15214.2
vvc_alf_classify_116x100_8_c: 103386.0
vvc_alf_classify_116x100_8_avx2: 18738.0
vvc_alf_classify_116x100_10_c: 105932.0
vvc_alf_classify_116x100_10_avx2: 16131.0
vvc_alf_classify_116x104_8_c: 107264.2
vvc_alf_classify_116x104_8_avx2: 20291.5
vvc_alf_classify_116x104_10_c: 104482.7
vvc_alf_classify_116x104_10_avx2: 16496.7
vvc_alf_classify_116x108_8_c: 111518.0
vvc_alf_classify_116x108_8_avx2: 30071.7
vvc_alf_classify_116x108_10_c: 108513.7
vvc_alf_classify_116x108_10_avx2: 17384.2
vvc_alf_classify_116x112_8_c: 115431.2
vvc_alf_classify_116x112_8_avx2: 20659.5
vvc_alf_classify_116x112_10_c: 176058.5
vvc_alf_classify_116x112_10_avx2: 17773.7
vvc_alf_classify_116x116_8_c: 119516.5
vvc_alf_classify_116x116_8_avx2: 21691.5
vvc_alf_classify_116x116_10_c: 119247.2
vvc_alf_classify_116x116_10_avx2: 18585.5
vvc_alf_classify_116x120_8_c: 131159.0
vvc_alf_classify_116x120_8_avx2: 22717.0
vvc_alf_classify_116x120_10_c: 120167.2
vvc_alf_classify_116x120_10_avx2: 18993.5
vvc_alf_classify_116x124_8_c: 127283.5
vvc_alf_classify_116x124_8_avx2: 23078.2
vvc_alf_classify_116x124_10_c: 123905.7
vvc_alf_classify_116x124_10_avx2: 19831.2
vvc_alf_classify_116x128_8_c: 130967.5
vvc_alf_classify_116x128_8_avx2: 31874.2
vvc_alf_classify_116x128_10_c: 134527.7
vvc_alf_classify_116x128_10_avx2: 20225.2
vvc_alf_classify_120x4_8_c: 6913.2
vvc_alf_classify_120x4_8_avx2: 1530.7
vvc_alf_classify_120x4_10_c: 6530.5
vvc_alf_classify_120x4_10_avx2: 1265.0
vvc_alf_classify_120x8_8_c: 10879.5
vvc_alf_classify_120x8_8_avx2: 1973.7
vvc_alf_classify_120x8_10_c: 10543.5
vvc_alf_classify_120x8_10_avx2: 1667.7
vvc_alf_classify_120x12_8_c: 15460.0
vvc_alf_classify_120x12_8_avx2: 3020.5
vvc_alf_classify_120x12_10_c: 14604.2
vvc_alf_classify_120x12_10_avx2: 2552.5
vvc_alf_classify_120x16_8_c: 20219.2
vvc_alf_classify_120x16_8_avx2: 3413.2
vvc_alf_classify_120x16_10_c: 18635.2
vvc_alf_classify_120x16_10_avx2: 2849.0
vvc_alf_classify_120x20_8_c: 23300.0
vvc_alf_classify_120x20_8_avx2: 4340.5
vvc_alf_classify_120x20_10_c: 22682.0
vvc_alf_classify_120x20_10_avx2: 3764.0
vvc_alf_classify_120x24_8_c: 27480.5
vvc_alf_classify_120x24_8_avx2: 4828.2
vvc_alf_classify_120x24_10_c: 26670.5
vvc_alf_classify_120x24_10_avx2: 4148.2
vvc_alf_classify_120x28_8_c: 31597.2
vvc_alf_classify_120x28_8_avx2: 16091.5
vvc_alf_classify_120x28_10_c: 30721.5
vvc_alf_classify_120x28_10_avx2: 5017.0
vvc_alf_classify_120x32_8_c: 35781.0
vvc_alf_classify_120x32_8_avx2: 6253.5
vvc_alf_classify_120x32_10_c: 34746.5
vvc_alf_classify_120x32_10_avx2: 6975.5
vvc_alf_classify_120x36_8_c: 39964.5
vvc_alf_classify_120x36_8_avx2: 7233.5
vvc_alf_classify_120x36_10_c: 38774.5
vvc_alf_classify_120x36_10_avx2: 6095.0
vvc_alf_classify_120x40_8_c: 44089.2
vvc_alf_classify_120x40_8_avx2: 7703.2
vvc_alf_classify_120x40_10_c: 43995.7
vvc_alf_classify_120x40_10_avx2: 6479.7
vvc_alf_classify_120x44_8_c: 48290.0
vvc_alf_classify_120x44_8_avx2: 8676.7
vvc_alf_classify_120x44_10_c: 46908.0
vvc_alf_classify_120x44_10_avx2: 7774.2
vvc_alf_classify_120x48_8_c: 52322.5
vvc_alf_classify_120x48_8_avx2: 9151.7
vvc_alf_classify_120x48_10_c: 51897.2
vvc_alf_classify_120x48_10_avx2: 7753.2
vvc_alf_classify_120x52_8_c: 56534.2
vvc_alf_classify_120x52_8_avx2: 10084.2
vvc_alf_classify_120x52_10_c: 61056.7
vvc_alf_classify_120x52_10_avx2: 8574.0
vvc_alf_classify_120x56_8_c: 60697.2
vvc_alf_classify_120x56_8_avx2: 10584.5
vvc_alf_classify_120x56_10_c: 59073.7
vvc_alf_classify_120x56_10_avx2: 8936.7
vvc_alf_classify_120x60_8_c: 64942.5
vvc_alf_classify_120x60_8_avx2: 12135.0
vvc_alf_classify_120x60_10_c: 63094.2
vvc_alf_classify_120x60_10_avx2: 9764.0
vvc_alf_classify_120x64_8_c: 69053.0
vvc_alf_classify_120x64_8_avx2: 11995.0
vvc_alf_classify_120x64_10_c: 67191.5
vvc_alf_classify_120x64_10_avx2: 10152.0
vvc_alf_classify_120x68_8_c: 73237.5
vvc_alf_classify_120x68_8_avx2: 13660.2
vvc_alf_classify_120x68_10_c: 75027.7
vvc_alf_classify_120x68_10_avx2: 11061.7
vvc_alf_classify_120x72_8_c: 77311.0
vvc_alf_classify_120x72_8_avx2: 13804.2
vvc_alf_classify_120x72_10_c: 75311.5
vvc_alf_classify_120x72_10_avx2: 11453.7
vvc_alf_classify_120x76_8_c: 81621.2
vvc_alf_classify_120x76_8_avx2: 14845.2
vvc_alf_classify_120x76_10_c: 79453.5
vvc_alf_classify_120x76_10_avx2: 12335.2
vvc_alf_classify_120x80_8_c: 85961.2
vvc_alf_classify_120x80_8_avx2: 19395.0
vvc_alf_classify_120x80_10_c: 93155.5
vvc_alf_classify_120x80_10_avx2: 12724.7
vvc_alf_classify_120x84_8_c: 90095.5
vvc_alf_classify_120x84_8_avx2: 16287.0
vvc_alf_classify_120x84_10_c: 89870.7
vvc_alf_classify_120x84_10_avx2: 13624.2
vvc_alf_classify_120x88_8_c: 94162.2
vvc_alf_classify_120x88_8_avx2: 16347.7
vvc_alf_classify_120x88_10_c: 94100.5
vvc_alf_classify_120x88_10_avx2: 38904.0
vvc_alf_classify_120x92_8_c: 98367.5
vvc_alf_classify_120x92_8_avx2: 17400.5
vvc_alf_classify_120x92_10_c: 98248.0
vvc_alf_classify_120x92_10_avx2: 14891.0
vvc_alf_classify_120x96_8_c: 102452.2
vvc_alf_classify_120x96_8_avx2: 17810.2
vvc_alf_classify_120x96_10_c: 102388.5
vvc_alf_classify_120x96_10_avx2: 15228.2
vvc_alf_classify_120x100_8_c: 106574.0
vvc_alf_classify_120x100_8_avx2: 27557.0
vvc_alf_classify_120x100_10_c: 109351.7
vvc_alf_classify_120x100_10_avx2: 16172.5
vvc_alf_classify_120x104_8_c: 110733.0
vvc_alf_classify_120x104_8_avx2: 20340.0
vvc_alf_classify_120x104_10_c: 110646.2
vvc_alf_classify_120x104_10_avx2: 16537.5
vvc_alf_classify_120x108_8_c: 114998.5
vvc_alf_classify_120x108_8_avx2: 20255.7
vvc_alf_classify_120x108_10_c: 111836.7
vvc_alf_classify_120x108_10_avx2: 17387.2
vvc_alf_classify_120x112_8_c: 119066.7
vvc_alf_classify_120x112_8_avx2: 21274.5
vvc_alf_classify_120x112_10_c: 115989.0
vvc_alf_classify_120x112_10_avx2: 17775.2
vvc_alf_classify_120x116_8_c: 123326.2
vvc_alf_classify_120x116_8_avx2: 21669.7
vvc_alf_classify_120x116_10_c: 123140.5
vvc_alf_classify_120x116_10_avx2: 18621.2
vvc_alf_classify_120x120_8_c: 127428.7
vvc_alf_classify_120x120_8_avx2: 22750.7
vvc_alf_classify_120x120_10_c: 123980.0
vvc_alf_classify_120x120_10_avx2: 18990.5
vvc_alf_classify_120x124_8_c: 131400.7
vvc_alf_classify_120x124_8_avx2: 23083.2
vvc_alf_classify_120x124_10_c: 128029.7
vvc_alf_classify_120x124_10_avx2: 20354.7
vvc_alf_classify_120x128_8_c: 142786.2
vvc_alf_classify_120x128_8_avx2: 31621.5
vvc_alf_classify_120x128_10_c: 198348.0
vvc_alf_classify_120x128_10_avx2: 20239.2
vvc_alf_classify_124x4_8_c: 7142.2
vvc_alf_classify_124x4_8_avx2: 1529.2
vvc_alf_classify_124x4_10_c: 6747.2
vvc_alf_classify_124x4_10_avx2: 1267.7
vvc_alf_classify_124x8_8_c: 11227.2
vvc_alf_classify_124x8_8_avx2: 1979.7
vvc_alf_classify_124x8_10_c: 10878.7
vvc_alf_classify_124x8_10_avx2: 1672.2
vvc_alf_classify_124x12_8_c: 15934.7
vvc_alf_classify_124x12_8_avx2: 2935.2
vvc_alf_classify_124x12_10_c: 15041.5
vvc_alf_classify_124x12_10_avx2: 2557.2
vvc_alf_classify_124x16_8_c: 28888.7
vvc_alf_classify_124x16_8_avx2: 3416.2
vvc_alf_classify_124x16_10_c: 19231.7
vvc_alf_classify_124x16_10_avx2: 2870.5
vvc_alf_classify_124x20_8_c: 24719.0
vvc_alf_classify_124x20_8_avx2: 4354.5
vvc_alf_classify_124x20_10_c: 23422.7
vvc_alf_classify_124x20_10_avx2: 3792.7
vvc_alf_classify_124x24_8_c: 28342.2
vvc_alf_classify_124x24_8_avx2: 4846.7
vvc_alf_classify_124x24_10_c: 27510.5
vvc_alf_classify_124x24_10_avx2: 4056.7
vvc_alf_classify_124x28_8_c: 32610.7
vvc_alf_classify_124x28_8_avx2: 6459.5
vvc_alf_classify_124x28_10_c: 31765.5
vvc_alf_classify_124x28_10_avx2: 4918.2
vvc_alf_classify_124x32_8_c: 36881.5
vvc_alf_classify_124x32_8_avx2: 6443.7
vvc_alf_classify_124x32_10_c: 39921.5
vvc_alf_classify_124x32_10_avx2: 5268.2
vvc_alf_classify_124x36_8_c: 42321.7
vvc_alf_classify_124x36_8_avx2: 7252.7
vvc_alf_classify_124x36_10_c: 40074.0
vvc_alf_classify_124x36_10_avx2: 6118.7
vvc_alf_classify_124x40_8_c: 45440.2
vvc_alf_classify_124x40_8_avx2: 7725.7
vvc_alf_classify_124x40_10_c: 44233.7
vvc_alf_classify_124x40_10_avx2: 6500.7
vvc_alf_classify_124x44_8_c: 49769.0
vvc_alf_classify_124x44_8_avx2: 8690.2
vvc_alf_classify_124x44_10_c: 54004.5
vvc_alf_classify_124x44_10_avx2: 7796.5
vvc_alf_classify_124x48_8_c: 54049.5
vvc_alf_classify_124x48_8_avx2: 9178.0
vvc_alf_classify_124x48_10_c: 52695.5
vvc_alf_classify_124x48_10_avx2: 7772.7
vvc_alf_classify_124x52_8_c: 58455.5
vvc_alf_classify_124x52_8_avx2: 10117.0
vvc_alf_classify_124x52_10_c: 56912.0
vvc_alf_classify_124x52_10_avx2: 8786.2
vvc_alf_classify_124x56_8_c: 63079.2
vvc_alf_classify_124x56_8_avx2: 10609.2
vvc_alf_classify_124x56_10_c: 61059.0
vvc_alf_classify_124x56_10_avx2: 8973.7
vvc_alf_classify_124x60_8_c: 67066.5
vvc_alf_classify_124x60_8_avx2: 11539.2
vvc_alf_classify_124x60_10_c: 65277.7
vvc_alf_classify_124x60_10_avx2: 9827.2
vvc_alf_classify_124x64_8_c: 71373.0
vvc_alf_classify_124x64_8_avx2: 12048.5
vvc_alf_classify_124x64_10_c: 69513.5
vvc_alf_classify_124x64_10_avx2: 10168.2
vvc_alf_classify_124x68_8_c: 75641.5
vvc_alf_classify_124x68_8_avx2: 13328.7
vvc_alf_classify_124x68_10_c: 75718.5
vvc_alf_classify_124x68_10_avx2: 11106.7
vvc_alf_classify_124x72_8_c: 80025.2
vvc_alf_classify_124x72_8_avx2: 13834.0
vvc_alf_classify_124x72_10_c: 77995.2
vvc_alf_classify_124x72_10_avx2: 11473.7
vvc_alf_classify_124x76_8_c: 84430.7
vvc_alf_classify_124x76_8_avx2: 19030.0
vvc_alf_classify_124x76_10_c: 82220.7
vvc_alf_classify_124x76_10_avx2: 12381.5
vvc_alf_classify_124x80_8_c: 88765.7
vvc_alf_classify_124x80_8_avx2: 15341.2
vvc_alf_classify_124x80_10_c: 86383.2
vvc_alf_classify_124x80_10_avx2: 13093.7
vvc_alf_classify_124x84_8_c: 93136.2
vvc_alf_classify_124x84_8_avx2: 16297.7
vvc_alf_classify_124x84_10_c: 123184.7
vvc_alf_classify_124x84_10_avx2: 13675.0
vvc_alf_classify_124x88_8_c: 108571.5
vvc_alf_classify_124x88_8_avx2: 16410.2
vvc_alf_classify_124x88_10_c: 97350.7
vvc_alf_classify_124x88_10_avx2: 14035.5
vvc_alf_classify_124x92_8_c: 101640.5
vvc_alf_classify_124x92_8_avx2: 17320.2
vvc_alf_classify_124x92_10_c: 101666.5
vvc_alf_classify_124x92_10_avx2: 14882.2
vvc_alf_classify_124x96_8_c: 113688.5
vvc_alf_classify_124x96_8_avx2: 17838.5
vvc_alf_classify_124x96_10_c: 114840.0
vvc_alf_classify_124x96_10_avx2: 15285.0
vvc_alf_classify_124x100_8_c: 110383.7
vvc_alf_classify_124x100_8_avx2: 18800.7
vvc_alf_classify_124x100_10_c: 107472.7
vvc_alf_classify_124x100_10_avx2: 33382.2
vvc_alf_classify_124x104_8_c: 114539.7
vvc_alf_classify_124x104_8_avx2: 20340.0
vvc_alf_classify_124x104_10_c: 114496.2
vvc_alf_classify_124x104_10_avx2: 16597.7
vvc_alf_classify_124x108_8_c: 118830.7
vvc_alf_classify_124x108_8_avx2: 20297.5
vvc_alf_classify_124x108_10_c: 115634.5
vvc_alf_classify_124x108_10_avx2: 17492.2
vvc_alf_classify_124x112_8_c: 133032.7
vvc_alf_classify_124x112_8_avx2: 20783.0
vvc_alf_classify_124x112_10_c: 119909.0
vvc_alf_classify_124x112_10_avx2: 17866.7
vvc_alf_classify_124x116_8_c: 148887.5
vvc_alf_classify_124x116_8_avx2: 21810.7
vvc_alf_classify_124x116_10_c: 130743.2
vvc_alf_classify_124x116_10_avx2: 18714.2
vvc_alf_classify_124x120_8_c: 131714.2
vvc_alf_classify_124x120_8_avx2: 22241.0
vvc_alf_classify_124x120_10_c: 128238.2
vvc_alf_classify_124x120_10_avx2: 19086.5
vvc_alf_classify_124x124_8_c: 145988.5
vvc_alf_classify_124x124_8_avx2: 23233.0
vvc_alf_classify_124x124_10_c: 132326.5
vvc_alf_classify_124x124_10_avx2: 19906.5
vvc_alf_classify_124x128_8_c: 140001.2
vvc_alf_classify_124x128_8_avx2: 23662.0
vvc_alf_classify_124x128_10_c: 136284.5
vvc_alf_classify_124x128_10_avx2: 20333.2
vvc_alf_classify_128x4_8_c: 7170.2
vvc_alf_classify_128x4_8_avx2: 1646.2
vvc_alf_classify_128x4_10_c: 6952.0
vvc_alf_classify_128x4_10_avx2: 1358.7
vvc_alf_classify_128x8_8_c: 11856.5
vvc_alf_classify_128x8_8_avx2: 2149.5
vvc_alf_classify_128x8_10_c: 11207.0
vvc_alf_classify_128x8_10_avx2: 1812.2
vvc_alf_classify_128x12_8_c: 15988.7
vvc_alf_classify_128x12_8_avx2: 3188.5
vvc_alf_classify_128x12_10_c: 15937.0
vvc_alf_classify_128x12_10_avx2: 2738.2
vvc_alf_classify_128x16_8_c: 28577.5
vvc_alf_classify_128x16_8_avx2: 3718.5
vvc_alf_classify_128x16_10_c: 19881.2
vvc_alf_classify_128x16_10_avx2: 3080.5
vvc_alf_classify_128x20_8_c: 24904.0
vvc_alf_classify_128x20_8_avx2: 4712.0
vvc_alf_classify_128x20_10_c: 24195.0
vvc_alf_classify_128x20_10_avx2: 4045.2
vvc_alf_classify_128x24_8_c: 29276.0
vvc_alf_classify_128x24_8_avx2: 5251.2
vvc_alf_classify_128x24_10_c: 28468.7
vvc_alf_classify_128x24_10_avx2: 4353.7
vvc_alf_classify_128x28_8_c: 33712.2
vvc_alf_classify_128x28_8_avx2: 6930.5
vvc_alf_classify_128x28_10_c: 32883.2
vvc_alf_classify_128x28_10_avx2: 5255.0
vvc_alf_classify_128x32_8_c: 38144.5
vvc_alf_classify_128x32_8_avx2: 6994.5
vvc_alf_classify_128x32_10_c: 37062.5
vvc_alf_classify_128x32_10_avx2: 5645.0
vvc_alf_classify_128x36_8_c: 42580.5
vvc_alf_classify_128x36_8_avx2: 7862.0
vvc_alf_classify_128x36_10_c: 41482.0
vvc_alf_classify_128x36_10_avx2: 6572.2
vvc_alf_classify_128x40_8_c: 65219.0
vvc_alf_classify_128x40_8_avx2: 8412.5
vvc_alf_classify_128x40_10_c: 47065.7
vvc_alf_classify_128x40_10_avx2: 6978.0
vvc_alf_classify_128x44_8_c: 51480.2
vvc_alf_classify_128x44_8_avx2: 9351.5
vvc_alf_classify_128x44_10_c: 50187.5
vvc_alf_classify_128x44_10_avx2: 10803.5
vvc_alf_classify_128x48_8_c: 70445.7
vvc_alf_classify_128x48_8_avx2: 9950.0
vvc_alf_classify_128x48_10_c: 54430.7
vvc_alf_classify_128x48_10_avx2: 8285.7
vvc_alf_classify_128x52_8_c: 61941.5
vvc_alf_classify_128x52_8_avx2: 10928.0
vvc_alf_classify_128x52_10_c: 58756.5
vvc_alf_classify_128x52_10_avx2: 9348.0
vvc_alf_classify_128x56_8_c: 64813.7
vvc_alf_classify_128x56_8_avx2: 11485.0
vvc_alf_classify_128x56_10_c: 63235.0
vvc_alf_classify_128x56_10_avx2: 9583.0
vvc_alf_classify_128x60_8_c: 69262.5
vvc_alf_classify_128x60_8_avx2: 12526.7
vvc_alf_classify_128x60_10_c: 67531.0
vvc_alf_classify_128x60_10_avx2: 10468.5
vvc_alf_classify_128x64_8_c: 73696.2
vvc_alf_classify_128x64_8_avx2: 13000.2
vvc_alf_classify_128x64_10_c: 71710.2
vvc_alf_classify_128x64_10_avx2: 10893.7
vvc_alf_classify_128x68_8_c: 86714.7
vvc_alf_classify_128x68_8_avx2: 14089.7
vvc_alf_classify_128x68_10_c: 136306.0
vvc_alf_classify_128x68_10_avx2: 11850.5
vvc_alf_classify_128x72_8_c: 82803.7
vvc_alf_classify_128x72_8_avx2: 15011.7
vvc_alf_classify_128x72_10_c: 80592.0
vvc_alf_classify_128x72_10_avx2: 12270.5
vvc_alf_classify_128x76_8_c: 87332.0
vvc_alf_classify_128x76_8_avx2: 15638.0
vvc_alf_classify_128x76_10_c: 85011.0
vvc_alf_classify_128x76_10_avx2: 13226.0
vvc_alf_classify_128x80_8_c: 91826.2
vvc_alf_classify_128x80_8_avx2: 16120.5
vvc_alf_classify_128x80_10_c: 89285.5
vvc_alf_classify_128x80_10_avx2: 13608.7
vvc_alf_classify_128x84_8_c: 143179.7
vvc_alf_classify_128x84_8_avx2: 17245.0
vvc_alf_classify_128x84_10_c: 101502.7
vvc_alf_classify_128x84_10_avx2: 14548.5
vvc_alf_classify_128x88_8_c: 100696.2
vvc_alf_classify_128x88_8_avx2: 17640.5
vvc_alf_classify_128x88_10_c: 100436.2
vvc_alf_classify_128x88_10_avx2: 15349.7
vvc_alf_classify_128x92_8_c: 105006.2
vvc_alf_classify_128x92_8_avx2: 19319.0
vvc_alf_classify_128x92_10_c: 102174.5
vvc_alf_classify_128x92_10_avx2: 15913.5
vvc_alf_classify_128x96_8_c: 109382.7
vvc_alf_classify_128x96_8_avx2: 19886.0
vvc_alf_classify_128x96_10_c: 109492.7
vvc_alf_classify_128x96_10_avx2: 16310.5
vvc_alf_classify_128x100_8_c: 113894.7
vvc_alf_classify_128x100_8_avx2: 20232.0
vvc_alf_classify_128x100_10_c: 110981.7
vvc_alf_classify_128x100_10_avx2: 17228.5
vvc_alf_classify_128x104_8_c: 118252.0
vvc_alf_classify_128x104_8_avx2: 21472.2
vvc_alf_classify_128x104_10_c: 118206.2
vvc_alf_classify_128x104_10_avx2: 17741.0
vvc_alf_classify_128x108_8_c: 122676.2
vvc_alf_classify_128x108_8_avx2: 31258.5
vvc_alf_classify_128x108_10_c: 119589.5
vvc_alf_classify_128x108_10_avx2: 18629.5
vvc_alf_classify_128x112_8_c: 127215.0
vvc_alf_classify_128x112_8_avx2: 22934.7
vvc_alf_classify_128x112_10_c: 127325.2
vvc_alf_classify_128x112_10_avx2: 19077.0
vvc_alf_classify_128x116_8_c: 131676.2
vvc_alf_classify_128x116_8_avx2: 23950.7
vvc_alf_classify_128x116_10_c: 128281.5
vvc_alf_classify_128x116_10_avx2: 19991.2
vvc_alf_classify_128x120_8_c: 136028.2
vvc_alf_classify_128x120_8_avx2: 24012.5
vvc_alf_classify_128x120_10_c: 132437.5
vvc_alf_classify_128x120_10_avx2: 20376.5
vvc_alf_classify_128x124_8_c: 140269.2
vvc_alf_classify_128x124_8_avx2: 25045.5
vvc_alf_classify_128x124_10_c: 136694.7
vvc_alf_classify_128x124_10_avx2: 21252.7
vvc_alf_classify_128x128_8_c: 144558.0
vvc_alf_classify_128x128_8_avx2: 25650.2
vvc_alf_classify_128x128_10_c: 140670.0
vvc_alf_classify_128x128_10_avx2: 21729.5

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-14 19:21:35 +08:00
Wu Jianhua 9ef6e15b04 tests/checkasm: add checkasm_check_vvc_alf and check_alf_filter
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-14 19:21:35 +08:00
Wu Jianhua ec2a7ef867 avcodec/x86/vvc: add alf filter luma and chroma avx2 optimizations
ff_vvc_alf_filter_luma_4x4_10_c: 135
ff_vvc_alf_filter_luma_4x4_10_avx2: 54
ff_vvc_alf_filter_luma_4x8_10_c: 268
ff_vvc_alf_filter_luma_4x8_10_avx2: 106
ff_vvc_alf_filter_luma_4x12_10_c: 400
ff_vvc_alf_filter_luma_4x12_10_avx2: 160
ff_vvc_alf_filter_luma_4x16_10_c: 535
ff_vvc_alf_filter_luma_4x16_10_avx2: 213
ff_vvc_alf_filter_luma_4x20_10_c: 646
ff_vvc_alf_filter_luma_4x20_10_avx2: 262
ff_vvc_alf_filter_luma_4x24_10_c: 783
ff_vvc_alf_filter_luma_4x24_10_avx2: 309
ff_vvc_alf_filter_luma_4x28_10_c: 908
ff_vvc_alf_filter_luma_4x28_10_avx2: 361
ff_vvc_alf_filter_luma_4x32_10_c: 1039
ff_vvc_alf_filter_luma_4x32_10_avx2: 412
ff_vvc_alf_filter_luma_8x4_10_c: 260
ff_vvc_alf_filter_luma_8x4_10_avx2: 53
ff_vvc_alf_filter_luma_8x8_10_c: 516
ff_vvc_alf_filter_luma_8x8_10_avx2: 105
ff_vvc_alf_filter_luma_8x12_10_c: 779
ff_vvc_alf_filter_luma_8x12_10_avx2: 157
ff_vvc_alf_filter_luma_8x16_10_c: 1038
ff_vvc_alf_filter_luma_8x16_10_avx2: 210
ff_vvc_alf_filter_luma_8x20_10_c: 1293
ff_vvc_alf_filter_luma_8x20_10_avx2: 259
ff_vvc_alf_filter_luma_8x24_10_c: 1553
ff_vvc_alf_filter_luma_8x24_10_avx2: 309
ff_vvc_alf_filter_luma_8x28_10_c: 1815
ff_vvc_alf_filter_luma_8x28_10_avx2: 361
ff_vvc_alf_filter_luma_8x32_10_c: 2067
ff_vvc_alf_filter_luma_8x32_10_avx2: 419
ff_vvc_alf_filter_luma_12x4_10_c: 390
ff_vvc_alf_filter_luma_12x4_10_avx2: 54
ff_vvc_alf_filter_luma_12x8_10_c: 773
ff_vvc_alf_filter_luma_12x8_10_avx2: 107
ff_vvc_alf_filter_luma_12x12_10_c: 1159
ff_vvc_alf_filter_luma_12x12_10_avx2: 155
ff_vvc_alf_filter_luma_12x16_10_c: 1550
ff_vvc_alf_filter_luma_12x16_10_avx2: 207
ff_vvc_alf_filter_luma_12x20_10_c: 1970
ff_vvc_alf_filter_luma_12x20_10_avx2: 260
ff_vvc_alf_filter_luma_12x24_10_c: 2379
ff_vvc_alf_filter_luma_12x24_10_avx2: 309
ff_vvc_alf_filter_luma_12x28_10_c: 2763
ff_vvc_alf_filter_luma_12x28_10_avx2: 362
ff_vvc_alf_filter_luma_12x32_10_c: 3158
ff_vvc_alf_filter_luma_12x32_10_avx2: 419
ff_vvc_alf_filter_luma_16x4_10_c: 523
ff_vvc_alf_filter_luma_16x4_10_avx2: 53
ff_vvc_alf_filter_luma_16x8_10_c: 1049
ff_vvc_alf_filter_luma_16x8_10_avx2: 103
ff_vvc_alf_filter_luma_16x12_10_c: 1566
ff_vvc_alf_filter_luma_16x12_10_avx2: 159
ff_vvc_alf_filter_luma_16x16_10_c: 2078
ff_vvc_alf_filter_luma_16x16_10_avx2: 211
ff_vvc_alf_filter_luma_16x20_10_c: 2631
ff_vvc_alf_filter_luma_16x20_10_avx2: 259
ff_vvc_alf_filter_luma_16x24_10_c: 3149
ff_vvc_alf_filter_luma_16x24_10_avx2: 316
ff_vvc_alf_filter_luma_16x28_10_c: 3631
ff_vvc_alf_filter_luma_16x28_10_avx2: 359
ff_vvc_alf_filter_luma_16x32_10_c: 4233
ff_vvc_alf_filter_luma_16x32_10_avx2: 428
ff_vvc_alf_filter_luma_20x4_10_c: 649
ff_vvc_alf_filter_luma_20x4_10_avx2: 106
ff_vvc_alf_filter_luma_20x8_10_c: 1294
ff_vvc_alf_filter_luma_20x8_10_avx2: 206
ff_vvc_alf_filter_luma_20x12_10_c: 1936
ff_vvc_alf_filter_luma_20x12_10_avx2: 310
ff_vvc_alf_filter_luma_20x16_10_c: 2594
ff_vvc_alf_filter_luma_20x16_10_avx2: 411
ff_vvc_alf_filter_luma_20x20_10_c: 3234
ff_vvc_alf_filter_luma_20x20_10_avx2: 517
ff_vvc_alf_filter_luma_20x24_10_c: 3894
ff_vvc_alf_filter_luma_20x24_10_avx2: 621
ff_vvc_alf_filter_luma_20x28_10_c: 4542
ff_vvc_alf_filter_luma_20x28_10_avx2: 722
ff_vvc_alf_filter_luma_20x32_10_c: 5205
ff_vvc_alf_filter_luma_20x32_10_avx2: 832
ff_vvc_alf_filter_luma_24x4_10_c: 774
ff_vvc_alf_filter_luma_24x4_10_avx2: 104
ff_vvc_alf_filter_luma_24x8_10_c: 1546
ff_vvc_alf_filter_luma_24x8_10_avx2: 206
ff_vvc_alf_filter_luma_24x12_10_c: 2318
ff_vvc_alf_filter_luma_24x12_10_avx2: 312
ff_vvc_alf_filter_luma_24x16_10_c: 3104
ff_vvc_alf_filter_luma_24x16_10_avx2: 411
ff_vvc_alf_filter_luma_24x20_10_c: 3893
ff_vvc_alf_filter_luma_24x20_10_avx2: 513
ff_vvc_alf_filter_luma_24x24_10_c: 4681
ff_vvc_alf_filter_luma_24x24_10_avx2: 616
ff_vvc_alf_filter_luma_24x28_10_c: 5474
ff_vvc_alf_filter_luma_24x28_10_avx2: 721
ff_vvc_alf_filter_luma_24x32_10_c: 6271
ff_vvc_alf_filter_luma_24x32_10_avx2: 832
ff_vvc_alf_filter_luma_28x4_10_c: 907
ff_vvc_alf_filter_luma_28x4_10_avx2: 103
ff_vvc_alf_filter_luma_28x8_10_c: 1797
ff_vvc_alf_filter_luma_28x8_10_avx2: 206
ff_vvc_alf_filter_luma_28x12_10_c: 2708
ff_vvc_alf_filter_luma_28x12_10_avx2: 309
ff_vvc_alf_filter_luma_28x16_10_c: 3632
ff_vvc_alf_filter_luma_28x16_10_avx2: 413
ff_vvc_alf_filter_luma_28x20_10_c: 4537
ff_vvc_alf_filter_luma_28x20_10_avx2: 519
ff_vvc_alf_filter_luma_28x24_10_c: 5463
ff_vvc_alf_filter_luma_28x24_10_avx2: 616
ff_vvc_alf_filter_luma_28x28_10_c: 6372
ff_vvc_alf_filter_luma_28x28_10_avx2: 719
ff_vvc_alf_filter_luma_28x32_10_c: 7274
ff_vvc_alf_filter_luma_28x32_10_avx2: 823
ff_vvc_alf_filter_luma_32x4_10_c: 1029
ff_vvc_alf_filter_luma_32x4_10_avx2: 104
ff_vvc_alf_filter_luma_32x8_10_c: 2060
ff_vvc_alf_filter_luma_32x8_10_avx2: 206
ff_vvc_alf_filter_luma_32x12_10_c: 3112
ff_vvc_alf_filter_luma_32x12_10_avx2: 307
ff_vvc_alf_filter_luma_32x16_10_c: 4161
ff_vvc_alf_filter_luma_32x16_10_avx2: 413
ff_vvc_alf_filter_luma_32x20_10_c: 5211
ff_vvc_alf_filter_luma_32x20_10_avx2: 514
ff_vvc_alf_filter_luma_32x24_10_c: 6238
ff_vvc_alf_filter_luma_32x24_10_avx2: 614
ff_vvc_alf_filter_luma_32x28_10_c: 7261
ff_vvc_alf_filter_luma_32x28_10_avx2: 720
ff_vvc_alf_filter_luma_32x32_10_c: 8312
ff_vvc_alf_filter_luma_32x32_10_avx2: 819
ff_vvc_alf_filter_chroma_4x4_10_c: 70
ff_vvc_alf_filter_chroma_4x4_10_avx2: 53
ff_vvc_alf_filter_chroma_4x8_10_c: 139
ff_vvc_alf_filter_chroma_4x8_10_avx2: 104
ff_vvc_alf_filter_chroma_4x12_10_c: 208
ff_vvc_alf_filter_chroma_4x12_10_avx2: 155
ff_vvc_alf_filter_chroma_4x16_10_c: 275
ff_vvc_alf_filter_chroma_4x16_10_avx2: 218
ff_vvc_alf_filter_chroma_4x20_10_c: 344
ff_vvc_alf_filter_chroma_4x20_10_avx2: 257
ff_vvc_alf_filter_chroma_4x24_10_c: 411
ff_vvc_alf_filter_chroma_4x24_10_avx2: 309
ff_vvc_alf_filter_chroma_4x28_10_c: 481
ff_vvc_alf_filter_chroma_4x28_10_avx2: 361
ff_vvc_alf_filter_chroma_4x32_10_c: 545
ff_vvc_alf_filter_chroma_4x32_10_avx2: 411
ff_vvc_alf_filter_chroma_8x4_10_c: 138
ff_vvc_alf_filter_chroma_8x4_10_avx2: 53
ff_vvc_alf_filter_chroma_8x8_10_c: 274
ff_vvc_alf_filter_chroma_8x8_10_avx2: 106
ff_vvc_alf_filter_chroma_8x12_10_c: 422
ff_vvc_alf_filter_chroma_8x12_10_avx2: 158
ff_vvc_alf_filter_chroma_8x16_10_c: 545
ff_vvc_alf_filter_chroma_8x16_10_avx2: 206
ff_vvc_alf_filter_chroma_8x20_10_c: 683
ff_vvc_alf_filter_chroma_8x20_10_avx2: 257
ff_vvc_alf_filter_chroma_8x24_10_c: 816
ff_vvc_alf_filter_chroma_8x24_10_avx2: 312
ff_vvc_alf_filter_chroma_8x28_10_c: 951
ff_vvc_alf_filter_chroma_8x28_10_avx2: 359
ff_vvc_alf_filter_chroma_8x32_10_c: 1098
ff_vvc_alf_filter_chroma_8x32_10_avx2: 409
ff_vvc_alf_filter_chroma_12x4_10_c: 204
ff_vvc_alf_filter_chroma_12x4_10_avx2: 53
ff_vvc_alf_filter_chroma_12x8_10_c: 410
ff_vvc_alf_filter_chroma_12x8_10_avx2: 104
ff_vvc_alf_filter_chroma_12x12_10_c: 614
ff_vvc_alf_filter_chroma_12x12_10_avx2: 155
ff_vvc_alf_filter_chroma_12x16_10_c: 814
ff_vvc_alf_filter_chroma_12x16_10_avx2: 210
ff_vvc_alf_filter_chroma_12x20_10_c: 1017
ff_vvc_alf_filter_chroma_12x20_10_avx2: 258
ff_vvc_alf_filter_chroma_12x24_10_c: 1221
ff_vvc_alf_filter_chroma_12x24_10_avx2: 308
ff_vvc_alf_filter_chroma_12x28_10_c: 1423
ff_vvc_alf_filter_chroma_12x28_10_avx2: 366
ff_vvc_alf_filter_chroma_12x32_10_c: 1624
ff_vvc_alf_filter_chroma_12x32_10_avx2: 410
ff_vvc_alf_filter_chroma_16x4_10_c: 272
ff_vvc_alf_filter_chroma_16x4_10_avx2: 52
ff_vvc_alf_filter_chroma_16x8_10_c: 541
ff_vvc_alf_filter_chroma_16x8_10_avx2: 105
ff_vvc_alf_filter_chroma_16x12_10_c: 812
ff_vvc_alf_filter_chroma_16x12_10_avx2: 155
ff_vvc_alf_filter_chroma_16x16_10_c: 1091
ff_vvc_alf_filter_chroma_16x16_10_avx2: 206
ff_vvc_alf_filter_chroma_16x20_10_c: 1354
ff_vvc_alf_filter_chroma_16x20_10_avx2: 257
ff_vvc_alf_filter_chroma_16x24_10_c: 1637
ff_vvc_alf_filter_chroma_16x24_10_avx2: 313
ff_vvc_alf_filter_chroma_16x28_10_c: 1899
ff_vvc_alf_filter_chroma_16x28_10_avx2: 359
ff_vvc_alf_filter_chroma_16x32_10_c: 2161
ff_vvc_alf_filter_chroma_16x32_10_avx2: 410
ff_vvc_alf_filter_chroma_20x4_10_c: 339
ff_vvc_alf_filter_chroma_20x4_10_avx2: 103
ff_vvc_alf_filter_chroma_20x8_10_c: 681
ff_vvc_alf_filter_chroma_20x8_10_avx2: 207
ff_vvc_alf_filter_chroma_20x12_10_c: 1013
ff_vvc_alf_filter_chroma_20x12_10_avx2: 307
ff_vvc_alf_filter_chroma_20x16_10_c: 1349
ff_vvc_alf_filter_chroma_20x16_10_avx2: 415
ff_vvc_alf_filter_chroma_20x20_10_c: 1685
ff_vvc_alf_filter_chroma_20x20_10_avx2: 522
ff_vvc_alf_filter_chroma_20x24_10_c: 2037
ff_vvc_alf_filter_chroma_20x24_10_avx2: 622
ff_vvc_alf_filter_chroma_20x28_10_c: 2380
ff_vvc_alf_filter_chroma_20x28_10_avx2: 733
ff_vvc_alf_filter_chroma_20x32_10_c: 2712
ff_vvc_alf_filter_chroma_20x32_10_avx2: 838
ff_vvc_alf_filter_chroma_24x4_10_c: 408
ff_vvc_alf_filter_chroma_24x4_10_avx2: 104
ff_vvc_alf_filter_chroma_24x8_10_c: 818
ff_vvc_alf_filter_chroma_24x8_10_avx2: 207
ff_vvc_alf_filter_chroma_24x12_10_c: 1219
ff_vvc_alf_filter_chroma_24x12_10_avx2: 308
ff_vvc_alf_filter_chroma_24x16_10_c: 1648
ff_vvc_alf_filter_chroma_24x16_10_avx2: 420
ff_vvc_alf_filter_chroma_24x20_10_c: 2061
ff_vvc_alf_filter_chroma_24x20_10_avx2: 525
ff_vvc_alf_filter_chroma_24x24_10_c: 2437
ff_vvc_alf_filter_chroma_24x24_10_avx2: 617
ff_vvc_alf_filter_chroma_24x28_10_c: 2832
ff_vvc_alf_filter_chroma_24x28_10_avx2: 722
ff_vvc_alf_filter_chroma_24x32_10_c: 3271
ff_vvc_alf_filter_chroma_24x32_10_avx2: 830
ff_vvc_alf_filter_chroma_28x4_10_c: 476
ff_vvc_alf_filter_chroma_28x4_10_avx2: 104
ff_vvc_alf_filter_chroma_28x8_10_c: 948
ff_vvc_alf_filter_chroma_28x8_10_avx2: 205
ff_vvc_alf_filter_chroma_28x12_10_c: 1420
ff_vvc_alf_filter_chroma_28x12_10_avx2: 310
ff_vvc_alf_filter_chroma_28x16_10_c: 1889
ff_vvc_alf_filter_chroma_28x16_10_avx2: 423
ff_vvc_alf_filter_chroma_28x20_10_c: 2372
ff_vvc_alf_filter_chroma_28x20_10_avx2: 513
ff_vvc_alf_filter_chroma_28x24_10_c: 2843
ff_vvc_alf_filter_chroma_28x24_10_avx2: 618
ff_vvc_alf_filter_chroma_28x28_10_c: 3307
ff_vvc_alf_filter_chroma_28x28_10_avx2: 724
ff_vvc_alf_filter_chroma_28x32_10_c: 3801
ff_vvc_alf_filter_chroma_28x32_10_avx2: 827
ff_vvc_alf_filter_chroma_32x4_10_c: 543
ff_vvc_alf_filter_chroma_32x4_10_avx2: 105
ff_vvc_alf_filter_chroma_32x8_10_c: 1084
ff_vvc_alf_filter_chroma_32x8_10_avx2: 206
ff_vvc_alf_filter_chroma_32x12_10_c: 1621
ff_vvc_alf_filter_chroma_32x12_10_avx2: 309
ff_vvc_alf_filter_chroma_32x16_10_c: 2173
ff_vvc_alf_filter_chroma_32x16_10_avx2: 408
ff_vvc_alf_filter_chroma_32x20_10_c: 2703
ff_vvc_alf_filter_chroma_32x20_10_avx2: 513
ff_vvc_alf_filter_chroma_32x24_10_c: 3245
ff_vvc_alf_filter_chroma_32x24_10_avx2: 612
ff_vvc_alf_filter_chroma_32x28_10_c: 3795
ff_vvc_alf_filter_chroma_32x28_10_avx2: 722
ff_vvc_alf_filter_chroma_32x32_10_c: 4339
ff_vvc_alf_filter_chroma_32x32_10_avx2: 820

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-14 19:21:35 +08:00
Rémi Denis-Courmont cdcb4b98b7 lavc/riscv: use ff_rv_vlen_least() 2024-05-13 18:36:07 +03:00
Rémi Denis-Courmont 247c5b2b97 lavu/riscv: add ff_rv_vlen_least()
This inline function checks that the vector length is at least a given
value. With this, most run-time VLEN checks can be optimised away.
2024-05-13 18:36:07 +03:00
Rémi Denis-Courmont 38e7b0ecf8 lavc/vp9dsp: fix indentation 2024-05-13 18:36:07 +03:00
James Almer b450c44630 x86/flacdsp: remove unused parameters to pmacsdql macro
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-13 12:18:38 -03:00
James Almer eb5733f38f x86/flacdsp: add an SSE4 version of wasted33
flac_wasted_33_c: 214.1
flac_wasted_33_sse4: 103.2

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-13 12:18:10 -03:00
James Almer 5ba6f4e63e checkasm/flacdsp: add a test for wasted33
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-13 12:18:10 -03:00
Ramiro Polla d4d09c8e42 lavc/aarch64/fdct: add neon-optimized fdct for aarch64
The code is imported from libjpeg-turbo-3.0.1. The neon registers used
have been changed to avoid modifying v8-v15.

Reviewed-by: Martin Storsjö <martin@martin.st>
2024-05-13 14:54:10 +02:00
Ramiro Polla 27f6211c74 lavc/aarch64: fix include for cpu.h 2024-05-13 14:50:38 +02:00
Andreas Rheinhardt b7b1a4e6c3 configure: Add missing ftr_parser->adts_header,mpeg4audio dependencies
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-13 14:32:21 +02:00
Andreas Rheinhardt 06d1840b56 configure, avcodec/Makefile: Add h264parse->h264data,golomb dependencies
Fixes standalone compilation of the dts2pts BSF.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-13 14:32:21 +02:00
Andreas Rheinhardt 4df43df6e1 avcodec/bsf/dts2pts: Fix shadowing
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-13 14:32:21 +02:00
Lynne baf8651d56 aacdec: restore arm32 dequantization optimizations
Unintentionally removed as part of 03cf101645.
Untested, but its assumed that unlike most of the old ARM code,
this one was still working.
2024-05-13 13:02:02 +02:00
Tomas Härdin 37db0454e4 lavc/speedhqdec: Obey AVDISCARD_ALL 2024-05-13 08:35:09 +02:00
Tomas Härdin 5b32685d77 lavc/speedhqdec: Add AV_CODEC_CAP_FRAME_THREADS 2024-05-13 08:35:09 +02:00
Michael Niedermayer 36126e4c14 avcodec/exr: Fix preview overflow
Fixes: CID1515456 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:19 +02:00
Michael Niedermayer 73d6d9f129 avcodec/dovi_rpuenc: fix compaatibility
Fixes: a frequency
Found while reviewing: CID1596607

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:18 +02:00
Michael Niedermayer 46ad68084e avcodec/dovi_rpuenc: initialize profile
Code is taken from dovi_rpudec

Fixes: CID1596604 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:18 +02:00
Michael Niedermayer e9bb586543 avcodec/decode: decode_simple_internal() only implements audio and video
Fixes: CID1538861 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:18 +02:00
Michael Niedermayer 96c1162545 avcodec/fmvc: remove dead assignment
Fixes: CID1529220 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:17 +02:00
Michael Niedermayer fdaa6ae2b6 avcodec/h2645_sei: Remove dead checks
Fixes: CID1596534 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:17 +02:00
Michael Niedermayer a68aa951b2 avcodec/h264_slice: Remove dead sps check
Fixes: CID1439574 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:17 +02:00
Brad Smith 950a7891a9 MAINTAINERS: add myself as *BSD maintainer
I try to help out with *BSD patches or build related issues where I can.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:16 +02:00
Michael Niedermayer c2d897f356 avcodec/lpc: copy levenson coeffs only when they have been computed
Fixes: CID1473514 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:16 +02:00
Michael Niedermayer c304784a86 avutil/tests/base64: Check with too short output array
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:26:57 +02:00
Michael Niedermayer 2d216566f2 libavutil/base64: Try not to write over the array end
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:26:57 +02:00
James Almer 0664cbd732 x86/flacdsp: add a SSE2 version of wasted32
flac_wasted_32_c: 851.3
flac_wasted_32_sse2: 41.3

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 17:24:08 -03:00
James Almer 5acec189af checkasm/flacdsp: add a test for wasted32
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 17:24:08 -03:00
James Almer 1ba5287697 avcodec/flacdsp: split off wasted bit handling into dsp functions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 17:23:58 -03:00
James Almer c00c8679ed x86/flacdsp: add a SSE4 version of lpc16
flac_lpc_16_13_c: 2841.3
flac_lpc_16_13_sse4: 2151.8
flac_lpc_16_16_c: 3382.8
flac_lpc_16_16_sse4: 2228.3
flac_lpc_16_29_c: 5800.3
flac_lpc_16_29_sse4: 3727.3
flac_lpc_16_32_c: 5972.8
flac_lpc_16_32_sse4: 4052.3

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 12:54:19 -03:00
James Almer 479d26cea2 checkasm/flacdsp: sanitize lpc arguments
Fixes signed integer overflows as reported by ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 12:36:46 -03:00
James Almer 467d84a06d checkasm/flacdsp: run lpc benchmarks with an unmodified buffer
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 12:36:46 -03:00
Yotam Ofek 02c032abcd avcodec/aacenc_tns: remove unreachable code branch
the condition being tested was the same as the stop condition for the containing loop,
so inside the loop it would always test positive
2024-05-12 16:01:44 +02:00
Rémi Denis-Courmont 0d9591841b lavc/ac3dsp: add R-V Zvbb extract_exponents 2024-05-11 11:38:49 +03:00
Rémi Denis-Courmont 5d8f62feb5 lavu/riscv: add Zvbb CPU capability detection
This requires Linux kernel version 6.8 or later.
2024-05-11 11:38:49 +03:00
Rémi Denis-Courmont 01c5f4ad9f riscv: add Zvbb vector bit manipulation extension 2024-05-11 11:38:49 +03:00
sunyuechi 11f689317d checkasm: Fix h264chroma test name
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-11 11:36:20 +03:00
Ramiro Polla 250c0defa2 checkasm: add test for fdct
Reviewed-by: Martin Storsjö <martin@martin.st>
Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-11 10:28:59 +02:00
Ramiro Polla b8af0809fb libavcodec/mpegvideo_enc: fix multi-threaded motion estimation rounding for mpeg4
ff_init_me() was being called after ff_update_duplicate_context(),
which caused the propagation of the initialization to other thread
contexts to be delayed by one frame.

In the case of mpeg4 (or flipflop_rounding), this would make the
hpel_put functions differ between the first thread (which would be
correctly initialized) and the other threads (which would be stale
from the previous frame).
2024-05-11 10:13:58 +02:00
Ramiro Polla 713c6eba8d libavcodec/motion_est: fix penalty_factor for b frames
In direct_search() and ff_estimate_b_frame_motion(), penalty_factor
would be used before being initialized in estimate_motion_b(). Also,
the initialization would happen more than once unnecessarily.
2024-05-11 09:38:34 +02:00
Haihao Xiang ceace488ff lavc/vaapi_encode_av1: insert HDR_CLL metadata if have
Only look for HDR_CLL on key frame on the output.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-11 15:21:57 +08:00
Haihao Xiang 0bdf71ada7 lavc/vaapi_encode_av1: Insert HDR_MDCV metadata if have
Only look for HDR_MDVC on key frame on the output.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-11 15:21:57 +08:00
Haihao Xiang 7f3ba6bbfa lavc/vaapi_encode_av1: implement write_extra_header callback
This can be used to insert a metadata OBU to the stream later.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-11 15:21:57 +08:00
Niklas Haas 9c6c4f3d47 avcodec/libaomenc: properly clean up image metadata
This does not get consumed by aom_codec_encode().
2024-05-11 01:25:15 +02:00
Rémi Denis-Courmont 5afe734b6d lavu/riscv: remove bespoke assembler for MIN
This is no longer necessary as Zbb is now always explicitly required.
2024-05-10 18:59:06 +03:00
Rémi Denis-Courmont 6c6313f1b5 swscale/riscv: explicitly require Zbb for MIN 2024-05-10 18:59:06 +03:00
Rémi Denis-Courmont c07af340ae lavc/riscv: explicitly require Zbb for MIN 2024-05-10 18:59:06 +03:00
Rémi Denis-Courmont 89029baebd lavu/riscv: allow requesting a second extension 2024-05-10 18:59:06 +03:00
sunyuechi 6e77af1c22 lavc/vp8dsp: R-V V put_epel v
C908:
vp8_put_epel4_v4_c: 11.0
vp8_put_epel4_v4_rvv_i32: 5.0
vp8_put_epel4_v6_c: 16.5
vp8_put_epel4_v6_rvv_i32: 6.2
vp8_put_epel8_v4_c: 43.7
vp8_put_epel8_v4_rvv_i32: 11.2
vp8_put_epel8_v6_c: 68.7
vp8_put_epel8_v6_rvv_i32: 13.2
vp8_put_epel16_v4_c: 92.5
vp8_put_epel16_v4_rvv_i32: 13.7
vp8_put_epel16_v6_c: 135.7
vp8_put_epel16_v6_rvv_i32: 16.5

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-10 18:41:13 +03:00
sunyuechi 109daea619 lavc/vp8dsp: R-V V put_epel h
C908:
vp8_put_epel4_h4_c: 10.7
vp8_put_epel4_h4_rvv_i32: 5.0
vp8_put_epel4_h6_c: 15.0
vp8_put_epel4_h6_rvv_i32: 6.2
vp8_put_epel8_h4_c: 43.2
vp8_put_epel8_h4_rvv_i32: 11.2
vp8_put_epel8_h6_c: 57.5
vp8_put_epel8_h6_rvv_i32: 13.5
vp8_put_epel16_h4_c: 92.5
vp8_put_epel16_h4_rvv_i32: 13.7
vp8_put_epel16_h6_c: 139.0
vp8_put_epel16_h6_rvv_i32: 16.5

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-10 18:41:13 +03:00
sunyuechi 538f217bbb lavc/vp8dsp: R-V V put_bilin_hv
C908:
vp8_put_bilin4_hv_c: 561.0
vp8_put_bilin4_hv_rvv_i32: 232.7
vp8_put_bilin8_hv_c: 2162.7
vp8_put_bilin8_hv_rvv_i32: 506.7
vp8_put_bilin16_hv_c: 4769.7
vp8_put_bilin16_hv_rvv_i32: 556.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-10 18:41:13 +03:00
sunyuechi bb5039b3cb lavc/vp8dsp: R-V V put_bilin_h v
C908:
vp8_put_bilin4_h_c: 367.0
vp8_put_bilin4_h_rvv_i32: 137.7
vp8_put_bilin4_v_c: 377.0
vp8_put_bilin4_v_rvv_i32: 137.7
vp8_put_bilin8_h_c: 1431.0
vp8_put_bilin8_h_rvv_i32: 297.5
vp8_put_bilin8_v_c: 1449.0
vp8_put_bilin8_v_rvv_i32: 297.5
vp8_put_bilin16_h_c: 2839.0
vp8_put_bilin16_h_rvv_i32: 344.7
vp8_put_bilin16_v_c: 2857.0
vp8_put_bilin16_v_rvv_i32: 344.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-10 18:41:13 +03:00
sunyuechi 0b8e5e5a00 lavc/vp8dsp: R-V put_vp8_pixels
C908:
vp8_put_pixels4_c: 78.0
vp8_put_pixels4_rvi: 33.7
vp8_put_pixels8_c: 278.0
vp8_put_pixels8_rvi: 55.0
vp8_put_pixels16_c: 999.0
vp8_put_pixels16_rvi: 86.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-10 18:41:13 +03:00
Michael Niedermayer d7924a4f60 avcodec/cbs_av1: Avoid shift overflow
Fixes: CID1465488 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:40 +02:00
Michael Niedermayer f44f441555 fftools/ffplay: Check return of swr_alloc_set_opts2()
This probably makes no difference but its more correct

Fixes: CID1503080 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:40 +02:00
Michael Niedermayer ba7038043a tools/opt_common: Check for malloc failure
Fixes: CID1539100 Negative loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:40 +02:00
Michael Niedermayer 91d27f7e02 doc/examples/demux_decode: Simplify loop
Fixes: CID1463550 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:39 +02:00
Michael Niedermayer a5d1497f33 avformat/concatdec: Check file
Fixes: null pointer dereference
Fixes: -stream_loop 1 -ss 00:00:05 -i zgclab/ffmpeg_crash/poc2 -codec:v copy -codec:a aac -y output.mp4

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:39 +02:00
Michael Niedermayer 24bd01ea65 tools/target_enc_fuzzer: Only read pix_fmts if its set
Fixes: null pointer dereference
Fixes: rawvideo encoder

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:39 +02:00
Michael Niedermayer c2918eb88e tools/target_enc_fuzzer: replace assert by clean exit
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:38 +02:00
Dawid Kozinski e4da96c6b2 avformat/evc: Small fixes in documentation
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2024-05-09 10:06:38 -03:00
Andreas Rheinhardt 6fa967810d tests/checkasm/svq1enc: Use proper range for input
ssd_int8_vs_int16 is only called from encode_block()
in svq1enc.c; it calls it in stages: At stage 0,
the int16_t array contains the difference of two
uint16_t. At each of the following stages, the
int16_t array is filled by subtracting an int8_t from
the current stage's int16_t array. The maximum stage
is five, so the int16_t are in the range
(-255 - 5 * 127)..(255 + 5 * 128).

This commit modifies the checkasm test to only use
values from this range, fixing (undefined) integer overflow
in the test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-09 13:40:18 +02:00
Andreas Rheinhardt ebe78e3ef0 avfilter/af_volume: Don't free options manually
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-09 13:18:32 +02:00
Dawid Kozinski e8e84dc325 avcodec/evc: Reference to ISO_IEC_23094-1-2020 document section for EVC_MAX_APS_COUNT enum has been fixed
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2024-05-08 21:15:05 -03:00
Dawid Kozinski 73d338d47c avformat/avi: Added EVC codec tag to the list of supported codec_id-codec_tag pairs for AVI muxer
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2024-05-08 21:15:05 -03:00
Dawid Kozinski cf45526a0d avcodec/bitstream_filters: Declaration of the ff_evc_frame_merge_bsf variable has been moved to the appropriate following the alphabetical order
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2024-05-08 21:15:05 -03:00
Dawid Kozinski 0797651c12 avcodec/evc: Set the AV_FRAME_FLAG_KEY flag for a decoded frame when the decoded packet contains a keyframe
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2024-05-08 21:14:56 -03:00
James Almer 214cbe29dc x86/blockdsp: add sse2 and avx2 versions of fill_block_tab
blockdsp.fill_block_tab[0]_c: 34.1
blockdsp.fill_block_tab[0]_sse2: 11.1
blockdsp.fill_block_tab[0]_avx2: 10.1
blockdsp.fill_block_tab[1]_c: 10.1
blockdsp.fill_block_tab[1]_sse2: 6.1
blockdsp.fill_block_tab[1]_avx2: 5.6

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-08 21:13:23 -03:00
James Almer b6054e57cb checkasm/blockdsp: use smallest allowed aligned buffers for fill_block_tab tests
The requirement is either 8 or 16 bytes alignment, not 32.
This should help finding bugs in asm implementations.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-08 21:13:23 -03:00
James Almer febd9271fc checkasm/blockdsp: don't randomize the buffers for fill_block_tab
It ignores and overwrites the previous values.
Fixes running the test under ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-08 21:13:23 -03:00
PoorvaGaikar 8b6e66d0f0 avfilter/f_select.c: add support for iw and ih variables
Fixes ticket #10509.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-08 21:33:32 +02:00
Brad Smith 9e674b3160 lavd/v4l2: Use proper field type for second parameter of ioctl() with BSD's
The proper type was used until 73251678c8.

This covers all of the OS's that currently have V4L2 support, permutations
of Linux glibc/musl, Android bionic, FreeBSD, NetBSD, OpenBSD, Solaris.

Copied from FreeBSD ports patch.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-08 21:33:32 +02:00
Rémi Denis-Courmont f8715d0300 lavc/vp9dsp: fix compilation with llvm-as 2024-05-08 18:26:32 +03:00
Rémi Denis-Courmont 1f150a68ac lavu/riscv: fix build without <sys/hwprobe.h> 2024-05-08 18:26:32 +03:00
James Almer 4e069ba80a avutil/opt: free the temporary layout in av_opt_is_set_to_default()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-07 20:11:42 -03:00
James Almer ae0293ee41 avutil/opt: propagate av_dict_copy() errors in av_opt_{get,set}_dict_val()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-07 20:11:42 -03:00
James Almer 9614efc258 avutil/opt: don't set a channel layout if the option is flagged as read only
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-07 20:11:42 -03:00
James Almer 2987c65caa avutil/opt: add a note about the av_opt_{get,set}_chlayout() behavior
Based on the one for av_opt_set_dict_val().

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-07 20:11:42 -03:00
Andreas Rheinhardt 894879a1df avfilter/Makefile: Add missing morpho->framesync dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 1739dba536 configure: Add missing identity filter->scene_sad dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt b5cf359c97 avfilter/Makefile: Add missing identity->framesync dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 9ec928e627 avfilter/x86/Makefile: Fix standalone build of haldclut filter
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 0d80348748 avfilter/vf_lut3d: Fix standalone build of lut1d
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt afda5ee7b9 avfilter/Makefile: Add missing multiply->framesync dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt c11d7ca2f0 avfilter/x86/Makefile: Add missing dependencies for sobel filter
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 3c7dc9ea59 avfilter/vf_convolution: Fix compilation with sobel disabled
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt dd246bdc0f avfilter/Makefile: Add missing guided->framesync dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 7e582d8b3e avfilter/vsrc_testsrc: Fix compilation of colorchart filter
Move set_color() out of the CONFIG_TESTSRC2_FILTER block.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 03618ee8a8 avfilter/Makefile: Add scale(2ref)->framesync dependency
Forgotten in e82a3997cd.

Reviewed-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 2e1b95283e avfilter/vf_xmedian: Define OFFSET, FLAGS macros unconditionally
They are currently defined inside the #if CONFIG_XMEDIAN_FILTER
block. Fixes standalone compilation of the tmedian filter.
Broken in f58939affe.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt db53ee915d avfilter/Makefile: Add missing colormap->framesync dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 609d2c01ea avfilter/Makefile: Add missing tiltshelf entry
Forgotten in 525f83becd.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 5de78958e4 avformat/Makefile: Add asf_muxer->asf_tags.o dependency
Forgotten in 493356cc0b.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 07c1bd5feb avcodec/Makefile: Fix intrax8 objects
Forgotten in d1d30edf42.
This fixes standalone compilation of the VC-1 based
decoders when using shared builds (for static builds,
nothing pulls in msmpeg4data.o, yet for shared builds
the default behaviour of linkers is different, leading
to undefined references because msmpeg4data.o relies
on stuff from mpeg4video.o).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 2e7bd08c4c configure: Add wmv2dsp->qpeldsp dependency
It reuses e.g. ff_put_pixels8_l2_8() directly even though
it never initializes a QpelDSPContext.
Fixes standalone compilation of the wmv2 encoder (the decoder
already has a qpeldsp dependency via the h263 decoder).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 8b7f089e4b avcodec/Makefile: Correct name of cbd2_dpcm decoder
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt df2416ca97 Remove remnants of prores_lgpl decoder
Forgotten in 5c6a3604f0.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt db2cd9cabf avcodec/Makefile, v408(dec|enc): Remove remnants of AYUV codecs
Forgotten in 9ee59b63f5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt b2003d6dcc configure: Add missing ftr decoder->adts_header dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 3c7c5e42f2 configure: Add missing atrac3p(al) decoder->sinewin dependency
atrac3plusdsp.o needs it.
Broken in 34330adb29.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt 1261ca2c85 configure: Add missing pdv decoder->inflate_wrapper dependency
A dependency on zlib is not enough.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt aebddfd4d6 configure: Add missing dirac_decoder->qpeldsp dependency
Forgotten in fd0e37f126.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Marton Balint 8d92f59d11 avformat/file: fail for non-numerical arguments to pipe:
Before this patch, the implementation of pipe: inputs/outputs would
silently fall back to stdin/stdout for any argument not successfully
parsed by strtol().

This patch introduces an explicit error for any non-numerical arguments,
which should avoid user confusion as in #10977.

New behavior:

$ cat /tmp/video.mkv | ./ffmpeg -i pipe:aa -acodec copy -vcodec copy -f matroska pipe:1 | cat >/tmp/out.mkv

[pipe @ 0x5618c7bcf740] Non-numerical argument "aa" to pipe:
[in#0 @ 0x5618c7bced00] Error opening input: Invalid argument
Error opening input file pipe:aa.
Error opening input files: Invalid argument

Based on the patch of Nils Goroll <nils.goroll@uplex.de>.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-07 23:38:05 +02:00
Andreas Rheinhardt 39ce8a9695 avcodec/diracdec: Don't use EDGE_WIDTH from mpegpicture.h
There is nothing that forces us to use the same value
as mpegvideo_enc.c, so define our own constant.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 13:24:32 +02:00
Andreas Rheinhardt 2eab5a1f54 avcodec/aac/aacdec: Fix linking errors with only one decoder enabled
This is achieved by using function pointers for AAC SBR functions.
This unfortunately necessitated to use void* in
ff_aac_sbr_apply(_fixed).
Fixes ticket #10999.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 12:33:50 +02:00
Mandava, Mounika b1037d4ebe lavc/qsvenc: add support for oneVPL string API
A new option -qsv_params <str> is added, where <str> is a :-separated
list of key=value parameters.

Example:
$ ffmpeg -y -f lavfi -i testsrc -vf "format=nv12" -c:v h264_qsv -qsv_params
"TargetUsage=1:GopPicSize=30:GopRefDist=2:TargetKbps=5000" -f null -

Signed-off-by: Mounika Mandava <mounika.mandava@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-07 11:06:37 +08:00
Haihao Xiang df76c3756d lavc/qsvenc: always allocate the array to store mfxExtBuffer points
This allows us to append mfxExtBuffer per user's settings

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-07 11:06:37 +08:00
Andreas Rheinhardt f5d2dc7b4b avcodec/aac/aacdec_(fixed|float): Set AACDecDSP, AACDecProc directly
This is more in line with how we initialize DSP functions
and avoids tables of function pointers as well as relocations
for these.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 00:02:57 +02:00
Andreas Rheinhardt 8762aa4d62 avcodec/aac/aacdec: Move init functions to aacdec_fixed/float
This allows to merge it with AACDecDSP.init and remove the latter
(it is called only once anyway); it also allows to make
the fixed/float AACDecDSP and AACDecProc implementations internal
to aacdec_fixed/float.c (which also fixes a violation of our
naming conventions). And it some linker errors when either decoder
is disabled.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 00:01:39 +02:00
Andreas Rheinhardt 0fc3d8e4d6 avcodec/aac/aacdec: Avoid compiling latm decoder if disabled
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 00:00:04 +02:00
Andreas Rheinhardt d4fb110f5c avcodec/aac/aacdec: Mark flush as cold
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:59:43 +02:00
Andreas Rheinhardt 41922bef7a avcodec/aac/aacdec_(fixed|float): Avoid AAC_RENAME, INTFLOAT
Unnecessary now that this has been detemplatized.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:59:27 +02:00
Andreas Rheinhardt c13b5d96c8 avcodec/aac/aacdec_float: Call ff_aac_float_common_init() only once
That's enough.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:59:10 +02:00
Andreas Rheinhardt 41ea317ced avcodec/aac/aacdec: Avoid branch to set sample_fmt
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:58:58 +02:00
Andreas Rheinhardt ef16882e8f avcodec/aac/aacdec: Move channel number check out of init_dsp()
Also move initializing random_state.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:58:31 +02:00
Andreas Rheinhardt e4e9144a5c avcodec/aac/aacdec: Remove unnecessary ff_thread_once()
ff_aacdec_common_init_once() already uses its own AVOnce.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:58:08 +02:00
Andreas Rheinhardt 44474dd7b9 avcodec/aacsbr: Fix type mismatch
ff_aac_sbr_apply() and ff_aac_sbr_apply_fixed() still used
pointers to INTFLOAT which is float or int depending upon
whether USE_FIXED is set or not; in particular, according
to these declarations both functions have the same type.
But that is wrong and given that aacdec.c sets USE_FIXED,
it sees the wrong type for ff_aac_sbr_apply().
This leads to a -Wlto-type-mismatch warning when using lto [1].
Fix this by avoiding INTFLOAT in aacsbr.h (which also means
that aac_defines.h need not be included there any more).

[1]: https://fate.ffmpeg.org/log.cgi?slot=x86_64-archlinux-gcc-lto&time=20240506022217&log=compile

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:57:41 +02:00
Andreas Rheinhardt e6bf540048 avcodec/aactab: Provide ff_ltp_coef, ff_tns_tmp2_map unconditionally
The fixed point decoder needs it since
905fdb0601.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:56:40 +02:00
Mark Thompson 7b482815a0 vulkan_av1: Fix force_integer_mv value 2024-05-06 20:17:50 +01:00
Mark Thompson b73e6af337 vaapi_av1: Fix force_integer_mv value 2024-05-06 20:17:50 +01:00
Mark Thompson b62d385ecf nvdec_av1: Use av1dec force_integer_mv value 2024-05-06 20:17:50 +01:00
Mark Thompson e5a5125bbe vdpau_av1: Use av1dec force_integer_mv value 2024-05-06 20:17:50 +01:00
Mark Thompson 5162247092 dxva2_av1: Use av1dec force_integer_mv value 2024-05-06 20:17:50 +01:00
Mark Thompson 6f56e0e7e5 av1dec: Add force_integer_mv derived field for decoder use
This is not the same as the syntax element value in the frame header
because the specification parsing tables override the value on intra
frames.
2024-05-06 20:17:50 +01:00
Rémi Denis-Courmont 9e77188cba lavc/ac3dsp: R-V Zbb ac3_exponent_min
SiFive U74:
ac3_exponent_min_reuse0_c:       10.0
ac3_exponent_min_reuse0_rvb_b:    8.0
ac3_exponent_min_reuse1_c:     2924.7
ac3_exponent_min_reuse1_rvb_b: 1803.0
ac3_exponent_min_reuse2_c:     5043.0
ac3_exponent_min_reuse2_rvb_b: 2827.5
ac3_exponent_min_reuse3_c:     7028.7
ac3_exponent_min_reuse3_rvb_b: 3872.0
ac3_exponent_min_reuse4_c:     8824.2
ac3_exponent_min_reuse4_rvb_b: 5122.2
ac3_exponent_min_reuse5_c:    10487.5
ac3_exponent_min_reuse5_rvb_b: 6412.2
2024-05-06 22:10:16 +03:00
Rémi Denis-Courmont 95d1052fba lavu/riscv: add hwprobe() for CPU detection
This adds the Linux-specific function call to detect CPU features. Unlike
the more portable auxillary vector, this supports extensions other than
single lettered ones. At this point, FFmpeg already needs this to detect
Zba and Zbb at run-time, and probably will need it for Zvbb in the near
future.

Support will be available in glibc 2.40 onward.
2024-05-06 22:09:41 +03:00
Rémi Denis-Courmont d7333ba6f2 lavu/riscv: indent code
This reindents code to prepare for the next changeset.
No functional changes.
2024-05-06 22:09:41 +03:00
Andreas Rheinhardt 2f8bf90054 avcodec/allcodecs: Remove LIBX264_CONST
Possible since 71669f2ad5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 14:51:56 +02:00
Nuo Mi a9586a00df avcodec/vvcdec: ff_vvc_frame_submit, avoid initializing task twice.
For some error bitstreams, a CTU belongs to two slices/entry points.
If the decoder initializes and submmits the CTU task twice, it may crash the program
or cause it to enter an infinite loop.

Reported-by: Frank Plowman <post@frankplowman.com>
2024-05-06 20:22:42 +08:00
Michael Niedermayer 96449cfeae avcodec/mpegvideo_enc: Fix 1 line and one column images
Fixes: Ticket10952
Fixes: poc21ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:41 +02:00
Michael Niedermayer a3bb269db9 avcodec/amrwbdec: assert mode to be valid in decode_fixed_vector()
Inspired-by: CID1473499 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:41 +02:00
Michael Niedermayer a2ec2bd493 avcodec/wavarc: fix integer overflow in decode_5elp() block type 2
Fixes: signed integer overflow: 2097152000 + 107142979 cannot be represented in type 'int'
Fixes: 67919/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-5955101769400320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:41 +02:00
Michael Niedermayer 1330a73cca swscale/output: Fix integer overflow in yuv2rgba64_full_1_c_template()
Fixes: signed integer overflow: -1082982400 + -1079364728 cannot be represented in type 'int'
Fixes: 67910/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5329011971522560
The input is 9bit in 16bit, the fuzzer fills all 16bit thus generating "invalid" input
No overflow should happen with valid input.

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:40 +02:00
Michael Niedermayer a56559e688 swscale/output: Fix integer overflow in yuv2rgba64_1_c_template
Fixes: signed integer overflow: -831176 * 9539 cannot be represented in type 'int'
Fixes: 67869/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5117342091640832

The input is 9bit in 16bit, the fuzzer fills all 16bit thus generating "invalid" input
No overflow should happen with valid input.

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:40 +02:00
Michael Niedermayer c7075cdb67 avcodec/dovi_rpuenc: Initialize bl_compat_id
Fixes: CID1596607 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:40 +02:00
James Almer 2e16285fe8 avformat/iamf_reader: split "if ((ret = ...) < 0)" line
Cosmetic change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-05 21:37:07 -03:00
James Almer 0ec8f3c55a avformat/mov: don't use stream duration to calculate bitrate with fragmented input
sc->data_size may contain the size of a single fragment after probing, and
using it alongside the duration of the entire stream to calculate bitrate
will result in a bogus small value.

Before:
  Duration: 00:00:05.00, start: 0.000000, bitrate: 586 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], 112 kb/s, 60 fps, 60 tbr, 15360 tbn (default)

After:
  Duration: 00:00:05.00, start: 0.000000, bitrate: 586 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], 561 kb/s, 60 fps, 60 tbr, 15360 tbn (default)

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-05 21:37:07 -03:00
James Almer 82397084a9 avfilter/vf_scale: properly reinitialize framesync
Fixes leaks as reported by ASAN and Valgrind.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-05 21:37:07 -03:00
James Almer ccf395e8bd avfilter/framesync: reset nb_in on allocation failure
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-05 21:37:07 -03:00
James Almer eb392e4100 avfilter/vf_scale: don't expose framesync options in vf_scale2ref
It doesn't use them.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-05 21:37:07 -03:00
Derek Buitenhuis f8a613d6a8 fftools/ffprobe: Avoid overflow when calculating DAR
Both the codecpar's width and height, and the SAR num and den are
ints, which can overflow. Cast to int64_t, which is what av_reduce
takes.

Without this, occasionally, display_aspect_ratio can be negative in
ffprobe's -show_stream output.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-05-05 11:56:29 +01:00
James Almer 088bf6e8c1 avutil/iamf: use AV_OPT_TYPE_UINT
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-04 21:31:33 -03:00
James Almer d6e877bbcd avutil/iamf: fix offsets for mix_gain options
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-04 21:20:35 -03:00
James Almer d053290d8d avutil/opt: add an unsigned option type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-04 21:17:40 -03:00
James Almer 9902fc550a avutil/tests/opt: test values > INT_MAX for INT64 type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-04 21:11:47 -03:00
James Almer 72ac495960 avutil/tests/opt: test negative values for INT and INT64 types
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-04 21:11:47 -03:00
Andreas Rheinhardt 2c77dc5aad avformat/movenc: Avoid loop for writing array
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-04 16:30:22 +02:00
Andreas Rheinhardt 601873263e avformat/movenc: Check av_malloc()
Fixes Coverity issue #1596735.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-04 16:29:58 +02:00
Niklas Haas df868bae23 doc/filters: mention scale2ref in replacement example
So ctrl+f "scale2ref" finds it.
2024-05-04 13:15:15 +02:00
Niklas Haas 8bf0a9c2ca doc/filters: move scale=ref_* to correct sectton
This was accidentally filed under scale_npp, instead of scale. (Why is
this entire section basically duplicated anyway?)
2024-05-04 13:15:11 +02:00
Niklas Haas 6a5b021e35 avfilter/vf_scale: fix input declaration
This filter needs to be marked as having only one input by default, with
AVFILTER_FLAG_DYNAMIC_INPUTS allowing the extra input to be added at
init() time.

Fixes: bb80445813
2024-05-04 13:07:27 +02:00
Rémi Denis-Courmont 38f67a32b3 lavc/ac3dsp: R-V V min_exponents
T-Head C908:
ac3_exponent_min_reuse0_c:         7.5
ac3_exponent_min_reuse0_rvv_i32:   7.5
ac3_exponent_min_reuse1_c:      1820.7
ac3_exponent_min_reuse1_rvv_i32: 102.5
ac3_exponent_min_reuse2_c:      3088.5
ac3_exponent_min_reuse2_rvv_i32: 138.7
ac3_exponent_min_reuse3_c:      5073.7
ac3_exponent_min_reuse3_rvv_i32: 174.7
ac3_exponent_min_reuse4_c:      4624.2
ac3_exponent_min_reuse4_rvv_i32: 204.2
ac3_exponent_min_reuse5_c:      5138.7
ac3_exponent_min_reuse5_rvv_i32: 238.0
2024-05-04 10:17:11 +03:00
Marcus B Spencer 5e7180864f avutil/opt: Clarify type of integers
Clarify comment regarding type of integers regarding AV_OPT_TYPE_IMAGE_SIZE.

Signed-off-by: Marcus B Spencer <marcus@marcusspencer.xyz>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-04 01:15:05 +02:00
sunyuechi 5bc3b7f513 lavc/rv40dsp: R-V V chroma_mc
This is similar to h264, but here we use manual_avg instead of vaaddu
because rv40's OP differs from h264. If we use vaaddu,
rv40 would need to repeatedly switch between vxrm=0 and vxrm=2,
and switching vxrm is very slow.

C908:
avg_chroma_mc4_c: 2330.0
avg_chroma_mc4_rvv_i32: 602.7
avg_chroma_mc8_c: 1211.0
avg_chroma_mc8_rvv_i32: 602.7
put_chroma_mc4_c: 1825.0
put_chroma_mc4_rvv_i32: 414.7
put_chroma_mc8_c: 932.0
put_chroma_mc8_rvv_i32: 414.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-03 18:00:53 +03:00
sunyuechi cfa8d2488d checkasm/rv40dsp: add chroma_mc test
This is similar to h264.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-03 18:00:53 +03:00
sunyuechi 7d0673db7e lavc/blockdsp: R-V V fill_block
C908:
blockdsp.fill_block_tab[0]_c: 549.7
blockdsp.fill_block_tab[0]_rvv_i64: 48.2
blockdsp.fill_block_tab[1]_c: 77.0
blockdsp.fill_block_tab[1]_rvv_i64: 19.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-03 17:49:23 +03:00
sunyuechi b369c4d569 checkasm/blockdsp: add fill_block test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-03 17:49:23 +03:00
Rémi Denis-Courmont 6cd97cd797 lavc/ac3dsp: R-V V sum_square_butterfly_float
As we do not need to widen accumulators to 64 bits, we effectively get
double capacity for unrolling compared to the integer function. This
explains the slightly better performance gains.

ac3_sum_square_bufferfly_float_c:       65.2
ac3_sum_square_bufferfly_float_rvv_f32: 12.2
2024-05-03 17:48:46 +03:00
Rémi Denis-Courmont 6459966beb lavc/ac3dsp: R-V V sum_square_butterfly_int32
ac3_sum_square_bufferfly_int32_c:       61.0
ac3_sum_square_bufferfly_int32_rvv_i64: 14.7
2024-05-03 17:48:46 +03:00
Niklas Haas 95568c4e31 avfilter/scale2ref: deprecate in favor of scale=rw:rh
And remove it from the documentation.
2024-05-03 14:23:23 +02:00
Niklas Haas 5b5e692da6 fate/scale2ref_keep_aspect: switch to vf_scale ref_* 2024-05-03 14:23:23 +02:00
Niklas Haas bb80445813 avfilter/vf_scale: add optional "ref" input
This is automatically enabled if the width/height expressions reference
any ref_* variable. This will ultimately serve as a more principled
replacement for the fundamentally broken scale2ref.

See-Also: https://trac.ffmpeg.org/ticket/10795
2024-05-03 14:23:23 +02:00
Niklas Haas e82a3997cd avfilter/vf_scale: switch to FFFrameSync
Preliminary commit, in anticipation of adding support for multiple
inputs (with proper synchronization and activate() callback).
2024-05-03 14:23:23 +02:00
Niklas Haas a5032dc12a avfilter/framesync: make framesync_class un-static
And rename to ff_framesync_class. More convenient for downstream users.
2024-05-03 14:23:22 +02:00
Michael Niedermayer 69b4d9736b avcodec/av1dec: Change bit_depth to int
Suggested-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-03 02:35:50 +02:00
Michael Niedermayer fd7d24fa3f avcodec/av1dec: bit_depth cannot be another values than 8,10,12
Fixes: CID1544265 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-03 02:35:50 +02:00
Michael Niedermayer f9218e4d52 avcodec/avs3_parser: assert the return value of init_get_bits()
Fixes: CID1492867 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-03 02:35:50 +02:00
Michael Niedermayer a7c4f119c9 avcodec/avs2_parser: Assert init_get_bits8() success with const size 15
Fixes: CID1506708 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-03 02:35:49 +02:00
Andreas Rheinhardt c3ca90a92e avcodec/x86/vp3dsp_init: Set correct function pointer, fix crash
Regression since fd172185580c1ccdcfb90bbfdb59fa806fad3117;
triggered by vp4/KTkvw8dg1J8.avi in the FATE suite, but not
when running fate as this code is not used when the bitexact
flag is set.

Bisecting done by ami_stuff, patch from user Mika Fischer
in ticket #10027 (which this commit fixes).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-02 23:38:15 +02:00
Andreas Rheinhardt 9fb3d640fb avcodec/av1dec: Always set ret before goto end
Before 0f8763fbea, av1_frame_ref()
and update_reference_list() could fail and therefore needed to
be checked, which incidentally set ret. This is no longer happening,
leading to a potential use of an uninitialized value which is
also the subject of Coverity ticket #1596605.

Fix this by always setting ret before goto end; do not return
some random ancient value.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-02 23:37:16 +02:00
James Almer 86e418ffd7 avcodec/avcodec: free decoded_side_data in ff_codec_close()
It's set by the library when decoding, so it should be freed when closing the
context.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-02 10:39:56 -03:00
Niklas Haas 71669f2ad5 avcodec/libx264: bump minimum required version to 155
This version is seven years old, and present in Debian oldoldstable,
Ubuntu 20.04 and Leap 15.0.

Allows cleaning up the file substantially. In particular, this is
motivated by the desire to stop relying on init_static_data.
2024-05-02 12:12:49 +02:00
Timo Rothenpieler 476688095f configure: handle xargs versions that exec empty commands
Some versions of xargs don't run any commands if no input is given,
others do run it at least once, causing errors.
Pass -r to xargs to avoid that behaviour and never run empty commands.
2024-05-01 19:40:00 +02:00
Timo Rothenpieler 95edaf72b4 configure: support msvc build inside WSL 2024-05-01 19:00:36 +02:00
Michael Niedermayer e757726e89 avfilter/avfiltergraph: return value of ff_request_frame() is unused
Fixes: CID1397741 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:13 +02:00
Andrew Sayers 99e43a6dfe lavu/opt: Clarify the scope of AVOptions
See discussion on the mailing list:
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-April/326054.html

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:13 +02:00
Michael Niedermayer 9f54c13bc4 avformat/iamfdec: check nb_streams in header read
Fixes: Assertion pkt->stream_index < (unsigned)s->nb_streams && "Invalid stream index.\n" failed at libavformat/demux.c:572
Fixes: 67890/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5166340789829632.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:12 +02:00
Michael Niedermayer 20a6bfda0f avformat/mxfdec: Check body_offset
Fixes: signed integer overflow: 538976288 - -9223372036315799520 cannot be represented in type 'long'
Fixes: 68060/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5523457266745344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:12 +02:00
Michael Niedermayer c26a762ea1 avformat/kvag: Check sample_rate
Fixes: Division by 0
Fixes: -copyts -start_at_zero -itsoffset 00:00:01 -itsscale 1 -ss 00:00:02  -i zgclab/ffmpeg_crash/poc1 output.mp4

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:12 +02:00
Michael Niedermayer 615c994739 avcodec/atrac9dec: Check init_get_bits8() for failure
Fixes: CID1439569 Unchecked return value
Fixes: CID1439578 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:11 +02:00
Michael Niedermayer 63415168db avcodec/ac3_parser: Check init_get_bits8() for failure
Fixes: CID1420393 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:11 +02:00
James Almer e09164940e avformat/mov: free the infe allocated item data on failure
Fixes: memleak
Fixes: 68212/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4963488540721152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-30 18:29:38 -03:00
Martin Storsjö d11be191fa checkasm: vc1dsp: Align buffers sufficiently for the mspel tests
This fixes crashes in the mspel tests on x86.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-30 23:13:47 +03:00
Niklas Haas 1d89de03d6 avcodec/dovi_rpuenc: avoid division by zero
Fixes: https://trac.ffmpeg.org/ticket/10985
2024-04-30 21:35:42 +02:00
James Almer b7debef3cc avformat/mov: support SpatialAudioBox ambisonic layouts with non-diegetic channels
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-30 11:15:13 -03:00
James Almer 37c8d93e56 avformat/mov: support SpatialAudioBox ambisonic layouts with arbitrary channel mapping
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-30 11:15:13 -03:00
Andreas Rheinhardt 08781ebe1a avcodec/riscv/vp9dsp: Fix inclusion guard
Fixes fate-source.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-29 21:23:32 +02:00
sunyuechi c3a96f97f8 lavc/vp9dsp: R-V V ipred dc
C908:
vp9_dc_8x8_8bpp_c: 46.0
vp9_dc_8x8_8bpp_rvv_i64: 41.0
vp9_dc_16x16_8bpp_c: 109.2
vp9_dc_16x16_8bpp_rvv_i32: 72.7
vp9_dc_32x32_8bpp_c: 365.2
vp9_dc_32x32_8bpp_rvv_i32: 165.5
vp9_dc_127_8x8_8bpp_c: 23.0
vp9_dc_127_8x8_8bpp_rvv_i64: 22.0
vp9_dc_127_16x16_8bpp_c: 70.2
vp9_dc_127_16x16_8bpp_rvv_i32: 50.2
vp9_dc_127_32x32_8bpp_c: 295.2
vp9_dc_127_32x32_8bpp_rvv_i32: 136.7
vp9_dc_128_8x8_8bpp_c: 23.0
vp9_dc_128_8x8_8bpp_rvv_i64: 22.0
vp9_dc_128_16x16_8bpp_c: 70.2
vp9_dc_128_16x16_8bpp_rvv_i32: 50.2
vp9_dc_128_32x32_8bpp_c: 295.2
vp9_dc_128_32x32_8bpp_rvv_i32: 136.7
vp9_dc_129_8x8_8bpp_c: 23.0
vp9_dc_129_8x8_8bpp_rvv_i64: 22.0
vp9_dc_129_16x16_8bpp_c: 70.2
vp9_dc_129_16x16_8bpp_rvv_i32: 50.2
vp9_dc_129_32x32_8bpp_c: 295.2
vp9_dc_129_32x32_8bpp_rvv_i32: 136.7
vp9_dc_left_8x8_8bpp_c: 38.0
vp9_dc_left_8x8_8bpp_rvv_i64: 36.0
vp9_dc_left_16x16_8bpp_c: 93.2
vp9_dc_left_16x16_8bpp_rvv_i32: 67.7
vp9_dc_left_32x32_8bpp_c: 333.2
vp9_dc_left_32x32_8bpp_rvv_i32: 158.5
vp9_dc_top_8x8_8bpp_c: 38.7
vp9_dc_top_8x8_8bpp_rvv_i64: 36.0
vp9_dc_top_16x16_8bpp_c: 93.2
vp9_dc_top_16x16_8bpp_rvv_i32: 67.7
vp9_dc_top_32x32_8bpp_c: 333.2
vp9_dc_top_32x32_8bpp_rvv_i32: 156.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-04-29 20:46:05 +03:00
sunyuechi dedc2456bf checkasm/vc1dsp: add mspel_pixels test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-04-29 20:34:29 +03:00
Lynne f492095bd3 opustab: macro constant as a double
May increase intermediate precision on some compilers.
2024-04-29 15:30:25 +02:00
Zhao Zhili cf4af4bca0 avcodec/mediacodecenc: Flush bsf after create extradata
Avoid leaving any data inside bsf while also avoid keep bsf in
EOF state.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-29 15:58:48 +08:00
David Rosca 1e2ac489a4 lavu/hwcontext_vaapi: Use vaMapBuffer2 for mapping image buffers
This allows some optimizations in driver, such as not having to read
back the data if write-only mapping is requested.
2024-04-29 11:08:41 +08:00
Haihao Xiang 578ac59887 lavfi/qsv: Copy metadata fields from the given input
Currently it always copies the metadata fields from the last input when
there are multiple inputs for the filter. For example, the metadata
fields from input1 are copied to the output for overlay_qsv filter,
however for regular overlay filters, the metadata fields from input0 are
copied to the output. With this fix, we may copy the metadata fields
from input0 to the ouput as well.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-29 11:08:41 +08:00
Fei Wang 67fc9b8427 lavc/qsvdec: Use FFmpeg default 1/25 framerate if can't derive it from bitstream
Fix error:
$ ffmpeg -hwaccel qsv -i input.h265 -f null -
...
[null @ 0x55da1a629200] Application provided invalid, non monotonically
increasing dts to muxer in stream 0: 3 >= 3

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-04-29 11:08:41 +08:00
Andreas Rheinhardt 651f3aa7f9 avcodec/h264dec: Remove unused coded_picture_number
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-28 19:13:17 +02:00
Yotam Ofek a9a69a5a31 avcodec/aacenc: don't redundantly re-compute max sfb
Remove an unneeded inner loop in adjust_frame_information that
had no effect, the loop body can be run only once and will compute
the same max sfb.
2024-04-28 13:59:57 +02:00
James Almer 31327c2d07 avformat/mov: fix the check for the heif item parsing loop
Fixes: Null pointer dereference
Fixes: 67861/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5352628142800896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-27 19:39:23 -03:00
Timo Rothenpieler 59767636c7 fate: allow https for git URLs 2024-04-27 23:24:58 +02:00
Michael Niedermayer 091fdce87e avcodec/pngdec: Check last AVFrame before deref
Fixes: NULL pointer dereference
Fixes: 68184/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-4926478069334016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-27 21:16:40 +02:00
Michael Niedermayer d9699464c3 avcodec/vp3: Call ff_progress_frame_unref() before ff_progress_frame_get_buffer()
Fixes: Assertion !f->f && !f->progress failed at libavcodec/decode.c:1688
Fixes: 68190/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-5942090287611904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-27 21:16:40 +02:00
Michael Niedermayer 5eb05f4450 avcodec/hevcdec: Check ref frame
Fixes: NULL pointer dereferences
Fixes: 68197/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-6382538823106560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-27 21:16:39 +02:00
Andreas Rheinhardt 4c8a6631ad fftools/ffmpeg_filter: Fix check
Fixes Coverity issues #1596529, #1596531.
Introduced in 8e35e33d42.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-27 17:00:12 +02:00
Andreas Rheinhardt 67c7c44c79 avcodec/vp8: Return error on error
Regression since e1ba00ac8f.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-27 16:55:00 +02:00
Lynne 3390693bfb aacdec: avoid generating unused code when either implementation is disabled
Minor optimization to remove extra branches.
We need to include the header for xHE anyway, which is float-only.
2024-04-27 11:12:12 +02:00
Lynne 134dba9544 opusdsp: add ability to modify deemphasis constant
xHE-AAC relies on the same postfilter mechanism
that Opus uses to improve clarity (albeit with a steeper
deemphasis filter).

The code to apply it is identical, it's still just a
simple IIR low-pass filter. This commit makes it possible
to use alternative constants.
2024-04-27 11:12:07 +02:00
Niklas Haas a2cdb2f5be avfilter/f_sidedata: synchronize with side data list
Add all recently added frame data types, as well as the more consistent
name DETECTION_BBOXES as an alias to DETECTION_BOUNDING_BOXES.
2024-04-26 21:02:46 +02:00
Derek Buitenhuis 2d5fa816fb avformat/http: Add support for Retry-After header
429 and 503 codes can, and often do (e.g. all Google Cloud
Storage URLs can), return a Retry-After header with the error,
indicating how long to wait, asd either a date, or in seconds,
before retrying again. If it is not respected by, for example,
using our default backoff stratetgy instead, chances of success
are very unlikely.

Some references:
    * https://datatracker.ietf.org/doc/html/rfc6585
    * https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.3

This adds an AVOption to respect that header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 15:21:25 +01:00
Derek Buitenhuis 6d89fd4c27 avformat/http: Rename parse_set_cookie_expiry_time to parse_http_date
That is what it actually does, and it will be needed for more
than the Expiry header soon.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 15:21:25 +01:00
Derek Buitenhuis 1f8e5b6d95 doc/protocols: Fill in missing HTTP options
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:21:25 +01:00
Derek Buitenhuis 5d568b16a0 doc/protocols: Re-order HTTP options to match http.c order
This makes the list easier to maintain.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:20:28 +01:00
Derek Buitenhuis 31de02cf31 avformat/http: Add option to limit total reconnect delay
The existing option only allows users to set the max delay for a
single attempt, rather than the total allowed delay, which is both
pretty unintitive, and only applicable when exponential backoff is
used.

The default for this option is set to 256, which is just above the
effective total delay accomplished by the the existing
reconnect_delay_max default of 120.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:19:50 +01:00
Derek Buitenhuis 10374ab5ed avformat/http: Add options to set the max number of connection retries
Not every use case benefits from setting retries in terms of the backoff.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:17:33 +01:00
Derek Buitenhuis a776d524e1 avformat/http: Rename attempts to auth_attempts
This accurately reflects what it does, as per
e75bbcf493.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:15:32 +01:00
Derek Buitenhuis fa00624693 avformat/http: Don't bail on parsing headers on "bad" HTTP codes
Many "bad" HTTP codes like 429 and 503 may include important info in
their headers.

Also, in general, there is no purpose in bailing here.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:15:08 +01:00
Derek Buitenhuis b79260550b avformat/http: Use AVERROR_HTTP_TOO_MANY_REQUESTS
Added in the previous commit.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:14:36 +01:00
Derek Buitenhuis bcae59b898 avutil/error: Add HTTP 429 Too Many Requests AVERROR code
This is a common error code from e.g. CDNs or cloud storage, and
it is useful to be able to handle it differently to a generic
4XX code.

Its source is RFC6585.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:13:47 +01:00
James Almer 5fc4a824db fate/iamf: don't demux packets in fate-iamf-5_1-{copy,demux}
They contain side data whose size is arch dependent.
This fixes fate failures on 32bit targets.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-25 09:36:19 -03:00
Michael Niedermayer cae0f2bc55 doc/examples/qsv_transcode: Initialize pointer before free
Fixees: CID1517023 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-25 03:24:59 +02:00
Michael Niedermayer 191950d1bf doc/examples/qsv_transcode: Simplify str_to_dict() loop
Fixes: CID1517022 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-25 03:24:59 +02:00
Michael Niedermayer c9c11a0866 doc/examples/vaapi_transcode: Simplify loop
Fixes: CID1428858(1/2) Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-25 03:24:58 +02:00
Michael Niedermayer 82cce20934 doc/examples/qsv_transcode: Simplify loop
Fixes: CID1428858(2/2) Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-25 03:24:58 +02:00
Diego Felix de Souza 9d675bb60d avcodec/nvenc: add high bit depth encoding for HEVC
Adding 10-bit encoding support for HEVC if the input is 8-bit. In
case of 8-bit input content, NVENC performs an internal CUDA 8 to
10-bit conversion of the input prior to encoding. Currently, only
AV1 supports encoding 8-bit content as 10-bit.

Signed-off-by: Diego Felix de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-04-25 00:33:13 +02:00
James Almer 1a8d50e379 fate/iamf: add a demux text
Using the same input sample as iamf-5_1-copy, in order to compare both test's output

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 18:12:05 -03:00
James Almer 8c27cdd2d4 fftools/ffmpeg_mux_init: add missing IAMF Param Definition copies
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 18:12:00 -03:00
James Almer f684228407 fftools/ffmpeg_mux_init: remove leftover debug log messages
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 17:37:13 -03:00
James Almer b9af58184f avutil/iamf: fix mix_gain_class name
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 17:37:12 -03:00
James Almer 8c0045f013 fate/iamf: add a remux test with stream group copying
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 15:18:56 -03:00
Haihao Xiang 8c62d77139 lavc/vp9: Fix regression introduced in 0ba05857
It is possible that ff_progress_frame_await() is called but
ff_progress_frame_report() isn't called when a hardware acceleration
method is used, so a thread for vp9 decoding might get stuck.

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-24 11:47:34 +08:00
James Almer 725d3b6f17 doc/APIchanges: fix date for the latest entry
And add the commit hash while at it.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 00:19:36 -03:00
James Almer 757367e068 avformat/demux: extract extradata from packets when context update is requested
If the demuxer doesn't set extradata in the stream's codecpar, a
need_context_update request will delete the previously extracted extradata in
the stream's internal AVCodecContext.
As we can't ensure the old extradata is valid for the stream in its post
context update request state, try to get extradata from the new packet instead
of attempting to preserve the old in some form.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 00:11:37 -03:00
James Almer c4e3d6cdb0 avcodec/codec_par: always clear extradata_size in avcodec_parameters_to_context()
Missed in d383ae43c2.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 00:11:37 -03:00
James Almer ecf87dd230 fftools/ffmpeg_mux_init: allow mapping a stream group from one of the inputs
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 23:54:46 -03:00
James Almer 8616cfe089 avutil/opt: add support for children objects in av_opt_serialize
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 23:54:46 -03:00
James Almer 855d4b5254 avutil/tests/opt: test av_opt_find2()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 23:54:46 -03:00
James Almer a9df9f95c4 avutil/test/opt: test the AV_OPT_SERIALIZE_SKIP_DEFAULTS flag
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 23:54:46 -03:00
Michael Niedermayer b91e3c4c90 avcodec/cbs_h2645: Check NAL space
Found-by-reviewing: CID1419833 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-24 02:52:17 +02:00
Michael Niedermayer 02301017d2 avfilter/vf_thumbnail_cuda: Set ret before checking it
Fixes: CID1418336 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-24 02:52:17 +02:00
Michael Niedermayer e7174e66ac avfilter/signature_lookup: Dont copy uninitialized stuff around
Fixes: CID1403238 Uninitialized pointer read
Fixes: CID1403239 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-24 02:52:16 +02:00
Michael Niedermayer 25cb66369e avfilter/signature_lookup: Fix 2 differences to the refernce SW
Fixes: CID1403227 Division or modulo by float zero

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-24 02:52:16 +02:00
Michael Niedermayer fb4a1eaadf tools: add target_enc_fuzzer.c
Sponsored-by: Sovereign Tech Fund
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-24 02:52:16 +02:00
Timo Rothenpieler 61f27e5f71 doc: use HOSTEXESUF when calling print_options
This is neccesary on WSL, and has no averse effects in normal
environments.
2024-04-24 00:09:38 +02:00
Martin Storsjö cdf71f789b Remove .travis.yml
Travis is no longer relevant for attempting to run CI jobs in our
setup.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-24 00:03:31 +03:00
James Almer ce33a5f16d avformat/movenc: remove one level of indentation
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 12:46:49 -03:00
James Almer 63702d5f9c avcodec/aac/aacdec: remove double colon
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 11:02:00 -03:00
Zhao Zhili 1b41631185 fftools: Fix implicit-const-int-float-conversion warning
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 16:09:09 +08:00
Zhao Zhili 66161166dc avcodec/mediacodecenc: add AV_CODEC_CAP_ENCODER_FLUSH support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili 9e49915195 avcodec/mediacodecenc: Add global header support
The extradata is generated by encoding a dummy frame, then reset
the encoder state by mediacodec flush(). It only works for pixel
format other than AV_PIX_FMT_MEDIACODEC, since I'm not sure how
to create a dummy frame safely with AV_PIX_FMT_MEDIACODEC.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili 3cfea6993a avcodec/mediacodecenc: Remove write only variable
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili a5a3788f56 avcodec/mediacodecenc: Fix return empty packet when bsf is used
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili 32fa20c0c9 avcodec/mediacodec_wrapper: Fix unused variable warning 2024-04-23 15:35:26 +08:00
Zhao Zhili 98b5e80fd6 avcodec/mediacodec_wrapper: link to NDK mediacodec API directly
Drop support of Android version before 5.0.
2024-04-23 15:35:26 +08:00
Zhao Zhili 309cff378c configure: Lower Android API level requirement of mediandk
AImage_delete is introduced in API level 24, while AMediaFormat_new
is introduced in API level 21. We only need API level 21 to support
NDK mediacodec. This change doesn't break or change of
android_camera_indev since camera2ndk still needs API level 24.
2024-04-23 15:35:26 +08:00
Lynne e3650886c7 aacdec: initialize float/fixed SBR tables only when either is needed 2024-04-23 08:31:41 +02:00
Lynne 176c922e4e aacsbr: constify the only SBR table 2024-04-23 08:31:41 +02:00
Lynne 03cf101645 aacdec: remove AAC-specific MIPS optimizations
The code was written in 2012, but seems to have been broken
for just as long. Compilation is broken on every MIPS/MIPS64
system with an FPU (which the code depends on).
2024-04-23 08:31:40 +02:00
Lynne ae7c6cc17d aac: move aacdec.c to aac/aacdec.c 2024-04-23 08:31:40 +02:00
Lynne 551ce16b59 aacdec: move aacdec.h into libavcodec/aac 2024-04-23 08:31:40 +02:00
Lynne cd1e404a10 aacdec: merge previously-templated code 2024-04-23 08:31:39 +02:00
Lynne ce740618d1 aacdec: move LATM decode functions into a separate file 2024-04-23 08:31:39 +02:00
Lynne e93793bf3c aacdec: fully detemplate decoder core 2024-04-23 08:31:38 +02:00
Lynne 2f90d83981 aacdec: move fixed/float DSP initialization to templated init functions 2024-04-23 08:31:38 +02:00
Lynne 905fdb0601 aacdec: reuse TNS and LTP tables between fixed and float decoders
The fixed decoder derives the values from floats anyway.
2024-04-23 08:31:38 +02:00
Lynne 49e7be1e37 aacdec: move prediction to separate files 2024-04-23 08:31:37 +02:00
Lynne b1718ce0f9 aacdec: move CCE decoding to a separate templated file
Unfortunately, although it's a purely decode function, it does
need to be templated.
2024-04-23 08:31:37 +02:00
Lynne 41c04bec0a aacdec: move fixed-point clipping to a separate function 2024-04-23 08:31:36 +02:00
Lynne 87a93a5670 aacdec: split off channel coupling into a new file 2024-04-23 08:31:36 +02:00
Lynne b7387ea00e aacdec: deduplicate table initizalization
All tables now initialized by aac/aacdec_fixed|float
2024-04-23 08:31:36 +02:00
Lynne 41ae2b03a5 aacdec: move spectrum decode and dequantization to a new file 2024-04-23 08:31:35 +02:00
Lynne 5c026e6637 aacdec: remove unnecessary decode_spectrum_and_dequant arguments
Small cleanup to reduce number of arguments.
2024-04-23 08:31:35 +02:00
Lynne eef9100a8e aacdec: template LTP windowing separately
The function is called only internally in DSP, so we do not
need to expose it.

apply_ltp on MIPS uses this function, but due to the function
being just a glue function with no real optimizations,
duplicate it there.
2024-04-23 08:31:35 +02:00
Lynne 091d85217d aacdec: template windowing and transforms separately 2024-04-23 08:31:34 +02:00
Lynne a309aa4127 aacdec: duplicate table initialization
Preparation to move all table init and support windowing functions.
2024-04-23 08:31:34 +02:00
Lynne e9fc7661da aacdec: template LTP application separately 2024-04-23 08:31:33 +02:00
Lynne db5128ef70 aacdec: template TNS application separately 2024-04-23 08:31:33 +02:00
Lynne ad16349f9b aacdec: template intensity stereo application separately 2024-04-23 08:31:33 +02:00
Lynne 9f3fa77e0d aacdec: template mid/side stereo application separately 2024-04-23 08:31:32 +02:00
Lynne a6295586f5 aacdec: template scalefactor dequantization separately 2024-04-23 08:31:32 +02:00
Lynne 7f3b3e2df1 aacdec: switch-ify scalefactor decoding
Brings it in line with dequantization.
2024-04-23 08:31:31 +02:00
Lynne 77a88bbdda aacdec: give spectrum dequant+decode SCE rather than an ICS
Eliminates using templated values in function definition.
2024-04-23 08:31:31 +02:00
Lynne 60b60dd635 aacdec: separate out scalefactor dequantization from decoding
Allows to template away dequantization.
2024-04-23 08:31:31 +02:00
Lynne ed009bfd3d aacdec: add a decoder DSP structure
To be used to abstract away DSP functions.
2024-04-23 08:31:30 +02:00
Andreas Rheinhardt 9de66fd449 avcodec/aacdec_template: Deduplicate common part of aac_decode_init()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:30 +02:00
Andreas Rheinhardt 980a55fb46 avcodec/aacdec_template: Deduplicate AVClass+AVOptions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:29 +02:00
Andreas Rheinhardt e3693c6f56 avcodec/aacdec_template: Deduplicate aac_decode_close()
This is possible now that both AAC decoders share the same
context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:29 +02:00
Andreas Rheinhardt 7117e0c7be avcodec/aacdec: Use same AACDecContext for fixed and float
Up until now, there was one AACDecContext for the fixed
and one for the floating point decoder. These differed
mostly in certain arrays which were int for the fixed-point
and float for the floating point decoder; there were also
differences in corresponding function pointers.

Yet in order to deduplicate the enormous amount of currently
duplicated code between the float and the fixed-point decoder,
one needs common contexts. Given that int and float have the
same size on all common systems, this commit replaces these
arrays by unions of int arrays and of float arrays. The names
of these arrays have been chosen to be compatible with
AAC_RENAME().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:29 +02:00
Andreas Rheinhardt fc3c2ea8dc avcodec/aacdec: PredictorState array out of SingleChannelElement
sizeof(PredictorState) is different for the floating-point and
the fixed-point AAC decoders; this is an obstacle for deduplicating
code between these decoders. So don't include this array in
SingleChannelElement, instead add a union of pointers to the
fixed-point PredictorState and the floating-point PredictorState.
The actual arrays are part of the extended ChannelElement
to be allocated by ff_aac_sbr_ctx_alloc_init(); it also
sets the pointers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:28 +02:00
Andreas Rheinhardt 8b2261e573 avcodec/aacdec: Always include AV(Fixed|Float)DSPContext in AACDecContext
Up until now, AACDecContext included pointers to one of these
contexts depending upon USE_FIXED. Yet deduplicating
the common parts of the float and fixed-point AAC decoders
needs common structures, so we put both of these pointers
in a union.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:28 +02:00
Andreas Rheinhardt 5bd7b8d999 avcodec/aacdec: Split SBR context from ChannelElement
The AAC fixed-point and floating-point decoders have
a lot of duplicated code; the main obstacle to
deduplicating it is that several structures with the
same name are actually different types, because
they contain INTFLOATs (int or float) and AAC_FLOATs
(SoftFloat or float). SoftFloat and float typically
have different sizes, so dealing with it is the more
complicated of the two.

AAC_FLOAT is mainly used in the sbr code and structures,
so one can still deduplicate the code by only exposing
the common part of ChannelElement (without SBR context)
to the common decoder part. One prerequisite of this
is to move allocating the whole ChannelElement to
code that will stay unduplicated. It is most natural
to move said allocation to ff_aac_sbr_ctx_init().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:28 +02:00
Andreas Rheinhardt 6975d965fc avcodec/aacsbr: Make ff_aac_sbr_* funcs accept ChannelElement*
Each ChannelElement contains exactly one SpectralBandReplication
structure; the latter structure contains lots of buffers
whose size depend upon USE_FIXED (i.e. AAC_FLOAT arrays).
This complicates deduplicating the parts of the AAC decoder
that are duplicated between the fixed-point and the floating
point decoder.

In order to fix this, the SpectralBandReplication structure
will be moved from the part of ChannelElement visible to
the common code. Therefore the ff_aac_sbr_* functions
are ported to accept a ChannelElement*; they will then have
to translate that to the corresponding SpectralBandReplication*
themselves (which is possible, because there are floating-point
and fixed-point versions of these functions).

While just at it, also ensure that these functions are properly
namespaced.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:27 +02:00
Lynne 3600f757db aacsbr_template: include mem.h
Future AAC changes remove the need to include this header.
2024-04-23 08:31:27 +02:00
Lynne f55b587820 aacdec: move aacdec_common to aac/aacdec_tab
Start to clean up the decoder.
Also renames a confusingly named file.
2024-04-23 08:31:18 +02:00
Jun Zhao fc02b910ad lavc/libxevd: Fixed the has_b_frames setting
has_b_frames used in decoder for size of the frame
reordering buffer, and we don't used the max_b_frames
in decoder.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-04-23 07:27:38 +08:00
Mark Thompson ba6b08c75b av1dec: Fix RefFrameSignBias calculation 2024-04-22 21:41:50 +01:00
Haihao Xiang 3032a74cac configure: fix rpuenc typos
Otherwise there are link errors:
LD      ffprobe_g
/usr/bin/ld: libavcodec/libavcodec.so: undefined reference to
`ff_dovi_rpu_generate'
/usr/bin/ld: libavcodec/libavcodec.so: undefined reference to
`ff_dovi_configure'
collect2: error: ld returned 1 exit status

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-22 17:20:16 -03:00
Niklas Haas 2f3c1e1641 avcodec/libsvtav1: implement dolby vision coding 2024-04-22 12:17:56 +02:00
Niklas Haas 39ca87ed1e avcodec/libx265: implement dolby vision coding
libx265 supports these natively, we just need to attach the generated
NALs to the x265picture, as well as setting the appropriate DV profile.
2024-04-22 12:17:56 +02:00
Niklas Haas 8dea94a146 avcodec/libaomenc: implement dolby vision coding 2024-04-22 12:17:56 +02:00
Niklas Haas 69e45a627c avformat/movenc: warn if dovi cfg ignored
Since this is guarded behind strict unofficial, we should warn if the
user feeds a dolby vision stream to this muxer, as it will otherwise
result in a broken file.
2024-04-22 12:17:56 +02:00
Niklas Haas 3306766608 avcodec/dovi_rpuenc: add ff_dovi_rpu_generate()
This function takes a decoded AVDOVIMetadata struct and turns it back
into a binary RPU. Verified using existing tools, and matches the
bitstream in official reference files.

I decided to just roll the EMDF and NAL encapsulation into this function
because the end user will need to do it otherwise anyways.
2024-04-22 12:17:56 +02:00
Niklas Haas f140935005 avcodec/dovi_rpuenc: add ff_dovi_configure()
We need to set up the configuration struct appropriately based on the
codec type, colorspace metadata, and presence/absence of an EL (though,
we currently don't support an EL).

When present, we use the signalled RPU data header to help infer (and
validate) the right values.

Behavior can be controlled by a new DOVIContext.enable flag.
2024-04-22 12:17:51 +02:00
Niklas Haas f131086a70 avcodec/dovi_rpu: split into dovi_rpu.c and dovi_rpudec.c
To allow compiling the decoding objects without the encoding objects and
vice versa. Common helpers that users of both APIs need are put into the
shared dovi_rpu.c.
2024-04-22 12:17:05 +02:00
Niklas Haas 783734d979 configure: rename dovi_rpu subsystem to dovi_rpudec
To distinguish it from the to-be-added dovi_rpuenc.
2024-04-22 12:17:05 +02:00
Niklas Haas 2a99d3527b avcodec/dovi_rpu: expose guess_profile(), clarify semantics
To allow internally re-using it for both the encoder and decoder.

This is based on HEVC only, H.264/AV1 use their own (hopefully correctly
signalled) profiles (and in particular, the AV1 decoders implicitly
default the correct profile in the absence of a configuration record).
2024-04-22 12:17:05 +02:00
Niklas Haas dbfd979c1b avcodec/dovi_rpu: clarify error on missing RPU VDR
The code was written under the misguided assumption that these fields
would only be present when the value changes, however this does not
match the actual patent specification, which says that streams are
required to either always signal this metadata, or never signal it.

That said, the specification does not really clarify what the defaults
of these fields should be in the event that this metadata is missing, so
without any sample file or other reference I don't wish to hazard
a guess at how to interpret these fields.

Fix the current behavior by making sure we always throw this error, even
for files that have the vdr sequence info in one frame but are missing
it in the next frame.
2024-04-22 12:17:05 +02:00
Niklas Haas fc616de1a5 avcodec/dovi_rpu: properly replace context header
This was never set in ff_dovi_ctx_replace(), leading to possibly
out-of-date when copying from one thread to another.
2024-04-22 12:17:05 +02:00
Niklas Haas d0392619a7 avcodec/dovi_rpu: store entire config record
And make it public.

For encoding, users may also be interested in the configured level and
compatibility ID. So generalize the dv_profile field and just expose the
whole configuration record.

This makes the already rather reductive ff_dovi_update_cfg() function
almost wholly redundant, since users can just directly assign
DOVIContext.cfg.
2024-04-22 12:17:05 +02:00
Andreas Rheinhardt 20206e14d7 avcodec/av1dec: Make av1_frame_replace() out of av1_frame_ref()
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-21 16:31:42 +02:00
Andreas Rheinhardt 0f8763fbea avcodec/av1dec: Use ProgressFrames
AV1 can put a frame into multiple reference slots;
up until now, this involved creating a new reference
to the underlying AVFrame; therefore av1_frame_ref()
could fail.
This commit changes this by using the ProgressFrame API
to share the underlying AVFrames.

(Hint: vaapi_av1_surface_id() checked whether the AV1Frames
contained in the AV1DecContext were NULL or not (of course
they were not); this has been changed to actually check for
whether said AV1Frame is blank or not.)

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-21 16:31:42 +02:00
Andreas Rheinhardt 0ec886ddc7 avcodec/hevcdec: Use union for AVFrame* and ProgressFrame
It avoids having to sync ProgressFrame.f and the pointer
typically used to access the AVFrame.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-21 16:31:42 +02:00
Andreas Rheinhardt 1d17d84b7d avcodec/progressframe: Explain how unnamed union can simplify accesses
This relies on the common initial seqence guarantee
(and on C11 support for unnamed members).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-21 16:31:42 +02:00
Jun Zhao 822e2843ca lavc/vvc/refs: Use dpb_max_num_reorder_pics to control output
Use dpb_max_num_reorder_pics to control output instead of
dpb_max_dec_pic_buffering, when dpb_max_dec_pic_buffering
is much larger than dpb_max_num_reorder_pics, it may cause
dpb overflow error.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: elinyhuang <elinyhuang@tencent.com>
2024-04-21 21:06:50 +08:00
Jun Zhao 50b8666dc6 lavc/vvc_parser: Fixed the has_b_frames setting
has_b_frames used in decoder for size of the frame reordering
buffer, setting this field from dpb_max_num_reorder_pics.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-04-21 21:06:50 +08:00
Jun Zhao d9f72eb107 lavc/vvc_parser: Remove max_b_frames setting
We don't used the max_b_frames field in decoder normally

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-04-21 21:06:50 +08:00
Andreas Rheinhardt 277f051ff6 avcodec/pthread_frame: Fix leak of coded side data
Happens in the mov-elst-ends-betn-b-and-i and mov-ibi-elst-starts-b
FATE tests with frame-threading.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-21 13:34:33 +02:00
Matthieu Bouron 8cdf1bae94 avcodec/jni: fix mixed declaration and code 2024-04-21 09:43:17 +02:00
Wu Jianhua a44c346312 avcodec/x86/vvc/vvcdsp_init: fix linking error when configuring with --disable-ssse3 --disable-optimizations options
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-04-20 12:11:43 +08:00
Wu Jianhua 2f3aaef1b5 avcodec/x86/vvc/vvcdsp_init: add avg prototypes
When we used the --disable-ssse3 --disable-optimizations options,
the compiler would not skip the MC_LINKS like the compilation that
enabled the optimization, so it would fail to find the function
prototypes. Hence, this commit uses the same way to add prototypes
for the functions as HEVC DSP.

And, when prototypes are added for the functions, we cannot add the static qualifier.
Therefore, the ff_vvc prefix is needed to avoid the naming conflict.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-04-20 12:11:43 +08:00
Wu Jianhua 4358f49568 avcodec/x86/vvc/vvcdsp_init: add put prototypes
When we used the --disable-ssse3 --disable-optimizations options,
the compiler would not skip the MC_LINKS like the compilation that
enabled the optimization, so it would fail to find the function
prototypes. Hence, this commit uses the same way to add prototypes
for the functions as HEVC DSP.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-04-20 12:11:43 +08:00
Andreas Rheinhardt bba996d6cd avcodec/hevcdec: Fix precedence, bogus film grain warning
Reviewed-by: Niklas Haas <ffmpeg@haasn.xyz>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 17:44:21 +02:00
Andreas Rheinhardt f18de5bc4a avcodec/v4l2_(m2m|buffers): Use RefStruct API for context references
Avoids allocations and therefore error checks; also avoids
indirections and allows to remove the boilerplate code
for creating an object with a dedicated free function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt fbd1b90b29 avcodec/rkmppdec: Allocate AVDRMFrameDescriptor and frame ctx jointly
Avoids an allocation and therefore one error path.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 1427e67500 avcodec/rkmppdec: Use RefStruct API for references to decoder itself
Avoids boilerplate code when creating the context
and avoids allocations and therefore whole error paths
when creating references to it. Also avoids an indirection
and improves type-safety.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 9a0614c7bd avcodec/rkmppdec: Check av_buffer_ref()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 4513300989 avcodec/rkmppdec: Fix double-free on error
After having created the AVBuffer that is put into frame->buf[0],
ownership of several objects (namely an AVDRMFrameDescriptor,
an MppFrame and some AVBufferRefs framecontextref and decoder_ref)
has passed to the AVBuffer and therefore to the frame.
Yet it has nevertheless been freed manually on error
afterwards, which would lead to a double-free as soon
as the AVFrame is unreferenced.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt d692c42938 avcodec/qsv: Use RefStruct API for memory id (mids) array
Avoids allocations and therefore error checks and cleanup code;
also avoids indirections.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt ac8288e288 avcodec/ffv1dec: Switch to ProgressFrames
Avoids implicit av_frame_ref() and therefore allocations
and error checks. It also avoids explicitly allocating
the AVFrames (done implicitly when getting the buffer).

It also fixes a data race: The AVFrame's sample_aspect_ratio
is currently updated after ff_thread_finish_setup()
and this write is unsynchronized with the read in av_frame_ref().
Removing the implicit av_frame_ref() fixed this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 2f29147b7f avcodec/pngdec: Switch to ProgressFrames
Avoids implicit av_frame_ref() and therefore allocations
and error checks. It also avoids explicitly allocating
the AVFrames (done implicitly when getting the buffer).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt a807e469d5 avcodec/hevcdec: Switch to ProgressFrames
Avoids implicit av_frame_ref() and therefore allocations
and error checks. It also avoids explicitly allocating
the AVFrames (done implicitly when getting the buffer).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 2b46ae6407 avcodec/codec_internal: Remove FF_CODEC_CAP_ALLOCATE_PROGRESS
Before commit f025b8e110,
every frame-threaded decoder used ThreadFrames, even when
they did not have any inter-frame dependencies at all.
In order to distinguish those decoders that need the AVBuffer
for progress communication from those that do not (to avoid
the allocation for the latter), the former decoders were marked
with the FF_CODEC_CAP_ALLOCATE_PROGRESS internal codec cap.

Yet distinguishing these two can be done in a more natural way:
Don't use ThreadFrames when not needed and split ff_thread_get_buffer()
into a core function that calls the user's get_buffer2 callback
and a wrapper around it that also allocates the progress AVBuffer.
This has been done in 02220b88fc
and since that commit the ALLOCATE_PROGRESS cap was nearly redundant.

The only exception was WebP and VP8. WebP can contain VP8
and uses the VP8 decoder directly (i.e. they share the same
AVCodecContext). Both decoders are frame-threaded and VP8
has inter-frame dependencies (in general, not in valid WebP)
and therefore the ALLOCATE_PROGRESS cap. In order to avoid
allocating progress in case of a frame-threaded WebP decoder
the cap and the check for the cap has been kept in place.

Yet now the VP8 decoder has been switched to use ProgressFrames
and therefore there is just no reason any more for this check
and the cap. This commit therefore removes both.

Also change the value of FF_CODEC_CAP_USES_PROGRESSFRAMES
to leave no gaps.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt d7374ac713 avcodec/vp8: Mark flushing functions as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt d48d7bc434 avcodec/vp8: Convert to ProgressFrame API
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt d74102e325 avcodec/wavpack: Move transient variable from context to stack
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 483c85e85e avcodec/wavpack: Optimize always-false comparison away
Also use the correct type limit SIZE_MAX; INT_MAX comes
from a time when this used av_buffer_allocz() which used
an int at the time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 70e79d289b avcodec/wavpack: Only reset DSD context upon parameter change
The current code resets it all the time unless we are decoding
a DSD frame with identical parameters to the last frame.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 8dd0bd4f9b avcodec/wavpack: Move initializing DSD data to a better place
Namely to code that is only executed if we are indeed
initializing a DSD context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 2aac42605c avcodec/wavpack: Use ThreadProgress API
It is more natural given that WavPack doesn't need the data of
the previous frame at all; it just needs the DSD context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 9dc8f8839e avcodec/pthread_frame: Add API to share RefStruct refs just once
This is useful when the lifetime of the object to be shared
is the whole decoding process as it allows to avoid having
to sync them every time in update_thread_context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 267a763a55 avcodec/vp9: Replace atomic_store() by atomic_init()
This part of the code is not slice-threaded and they are
semantically an initialization, so use atomic_init()
instead of the potentially expensive atomic_store()
(which uses sequentially consistent memory ordering).

Also remove the initial initialization directly after
allocating this array.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 259234b46f avcodec/vp9: Simplify replacing VP9Frame
ff_thread_progress_replace() can handle a blank ProgressFrame
as src (in which case it simply unreferences dst), but not
a NULL one. So add a blank frame to be used as source for
this case, so that we can use the replace functions
to simplify vp9_frame_replace().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 98e1e848ef avcodec/vp9: Reduce wait times
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 0ba058579f avcodec/vp9: Fix race when attaching side-data for show-existing frame
When outputting a show-existing frame, the VP9 decoder simply
created a reference to said frame and returned it immediately to
the caller, without waiting for it to have finished decoding.
In case of frame-threading it is possible for the frame to
only be decoded while it was waiting to be output.
This is normally benign.

But there is one case where it is not: If the user wants
video encoding parameters to be exported, said side data
will only be attached to the src AVFrame at the end of
decoding the frame that is actually being shown. Without
synchronisation adding said side data in the decoder thread
and the reads in av_frame_ref() in the output thread
constitute a data race. This happens e.g. when using the
venc_data_dump tool with vp90-2-10-show-existing-frame.webm
from the FATE-suite.

Fix this by actually waiting for the frame to be output.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 7bd3b73716 avcodec/vp9: Switch to ProgressFrames
This already fixes a race in the vp9-encparams test. In this test,
side data is added to the current frame after having been decoded
(and therefore after ff_thread_finish_setup() has been called).
Yet the update_thread_context callback called ff_thread_ref_frame()
and therefore av_frame_ref() with this frame as source frame and
the ensuing read was unsynchronised with adding the side data,
i.e. there was a data race.

By switching to the ProgressFrame API the implicit av_frame_ref()
is removed and the race fixed except if this frame is later reused by
a show-existing-frame which uses an explicit av_frame_ref().
The vp9-encparams test does not cover this, so this commit
already fixes all the races in this test.

This decoder kept multiple references to the same ThreadFrames
in the same context and therefore had lots of implicit av_frame_ref()
even when decoding single-threaded. This incurred lots of small
allocations: When decoding an ordinary 10s video in single-threaded
mode the number of allocations reported by Valgrind went down
from 57,814 to 20,908; for 10 threads it went down from 84,223 to
21,901.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 444bd353e9 avcodec/vp3: Switch to ProgressFrames
Avoids implicit av_frame_ref() and therefore allocations
and error checks. It also avoids explicitly allocating
the AVFrames (done implicitly when getting the buffer)
and it also allows to reuse the flushing code for freeing
the ProgressFrames.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt c381c23154 avcodec/mimic: Switch to ProgressFrames
Avoids implicit av_frame_ref() and therefore allocations
and error checks.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 2135a40b1c avcodec/decode: Add new ProgressFrame API
Frame-threaded decoders with inter-frame dependencies
use the ThreadFrame API for syncing. It works as follows:

During init each thread allocates an AVFrame for every
ThreadFrame.

Thread A reads the header of its packet and allocates
a buffer for an AVFrame with ff_thread_get_ext_buffer()
(which also allocates a small structure that is shared
with other references to this frame) and sets its fields,
including side data. Then said thread calls ff_thread_finish_setup().
From that moment onward it is not allowed to change any
of the AVFrame fields at all any more, but it may change
fields which are an indirection away, like the content of
AVFrame.data or already existing side data.

After thread A has called ff_thread_finish_setup(),
another thread (the user one) calls the codec's update_thread_context
callback which in turn calls ff_thread_ref_frame() which
calls av_frame_ref() which reads every field of A's
AVFrame; hence the above restriction on modifications
of the AVFrame (as any modification of the AVFrame by A after
ff_thread_finish_setup() would be a data race). Of course,
this av_frame_ref() also incurs allocations and therefore
needs to be checked. ff_thread_ref_frame() also references
the small structure used for communicating progress.

This av_frame_ref() makes it awkward to propagate values that
only become known during decoding to later threads (in case of
frame reordering or other mechanisms of delayed output (like
show-existing-frames) it's not the decoding thread, but a later
thread that returns the AVFrame). E.g. for VP9 when exporting video
encoding parameters as side data the number of blocks only
becomes known during decoding, so one can't allocate the side data
before ff_thread_finish_setup(). It is currently being done afterwards
and this leads to a data race in the vp9-encparams test when using
frame-threading. Returning decode_error_flags is also complicated
by this.

To perform this exchange a buffer shared between the references
is needed (notice that simply giving the later threads a pointer
to the original AVFrame does not work, because said AVFrame will
be reused lateron when thread A decodes the next packet given to it).
One could extend the buffer already used for progress for this
or use a new one (requiring yet another allocation), yet both
of these approaches have the drawback of being unnatural, ugly
and requiring quite a lot of ad-hoc code. E.g. in case of the VP9
side data mentioned above one could not simply use the helper
that allocates and adds the side data to an AVFrame in one go.

The ProgressFrame API meanwhile offers a different solution to all
of this. It is based around the idea that the most natural
shared object for sharing information about an AVFrame between
decoding threads is the AVFrame itself. To actually implement this
the AVFrame needs to be reference counted. This is achieved by
putting a (ownership) pointer into a shared (and opaque) structure
that is managed by the RefStruct API and which also contains
the stuff necessary for progress reporting.
The users get a pointer to this AVFrame with the understanding
that the owner may set all the fields until it has indicated
that it has finished decoding this AVFrame; then the users are
allowed to read everything. Every decoder may of course employ
a different contract than the one outlined above.

Given that there is no underlying av_frame_ref(), creating
references to a ProgressFrame can't fail. Only
ff_thread_progress_get_buffer() can fail, but given that
it will replace calls to ff_thread_get_ext_buffer() it is
at places where errors are already expected and properly
taken care of.

The ProgressFrames are empty (i.e. the AVFrame pointer is NULL
and the AVFrames are not allocated during init at all)
while not being in use; ff_thread_progress_get_buffer() both
sets up the actual ProgressFrame and already calls
ff_thread_get_buffer(). So instead of checking for
ThreadFrame.f->data[0] or ThreadFrame.f->buf[0] being NULL
for "this reference frame is non-existing" one should check for
ProgressFrame.f.

This also implies that one can only set AVFrame properties
after having allocated the buffer. This restriction is not deep:
if it becomes onerous for any codec, ff_thread_progress_get_buffer()
can be broken up. The user would then have to get a buffer
himself.

In order to avoid unnecessary allocations, the shared structure
is pooled, so that both the structure as well as the AVFrame
itself are reused. This means that there won't be lots of
unnecessary allocations in case of non-frame-threaded decoding.
It might even turn out to have fewer than the current code
(the current code allocates AVFrames for every DPB slot, but
these are often excessively large and not completely used;
the new code allocates them on demand). Pooling relies on the
reset function of the RefStruct pool API, it would be impossible
to implement with the AVBufferPool API.

Finally, ProgressFrames have no notion of owner; they are built
on top of the ThreadProgress API which also lacks such a concept.
Instead every ThreadProgress and every ProgressFrame contains
its own mutex and condition variable, making it completely independent
of pthread_frame.c. Just like the ThreadFrame API it is simply
presumed that only the actual owner/producer of a frame reports
progress on said frame.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt 89828417b0 avcodec/threadprogress: Add new API for frame-threaded progress
The API is similar to the ThreadFrame API, with the exception
that it no longer has an included AVFrame and that it has its
own mutexes and condition variables which makes it more independent
of pthread_frame.c. One can wait on anything via a ThreadProgress.
One just has to ensure that the lifetime of the object containing
the ThreadProgress is long enough. This will typically be solved
by putting a ThreadProgress in a refcounted structure that is
shared between threads.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: epirat07@gmail.com
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:07:48 +02:00
Stefano Sabatini 0fb0946de7 doc/muxers: add mmf 2024-04-19 09:00:59 +02:00
Stefano Sabatini b9f2e1b929 doc/muxers: add microdvd 2024-04-19 09:00:59 +02:00
Stefano Sabatini ac3460c61c doc/muxers/md5: apply misc consistency fixes 2024-04-19 09:00:41 +02:00
Stefano Sabatini 4bd192ddf4 doc/muxers/matroska: add missing options, apply misc style fixes 2024-04-19 08:44:20 +02:00
Stefano Sabatini bba492dc9c lavf/matroskaenc: apply consistent style to options descriptions 2024-04-19 08:44:20 +02:00
Frank Plowman bb9e4ff355 lavc/vvc: Skip enhancement layer NAL units
The native VVC decoder does not yet support quality/spatial/multiview
scalability.  Bitstreams requiring this feature could cause crashes.
Patch fixes this by skipping NAL units which are not in the base layer,
warning the user while doing so.

Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-18 17:38:15 -03:00
James Almer 5b9db32ccc avformat/mov: ignore old infe box versions
Some files with no image items have them, and were working prior to the recent
HEIF parsing overhaul.
Ignore such boxes instead, to recover the old behavior.

Fixes a regression since d9fed9df2a.

Tested-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-18 13:00:11 -03:00
Andrew Sayers 6927457443 avutil/frame: remove comment about avcodec_get_frame_class()
The function was deprecated a while back and deleted last year.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-18 12:24:43 -03:00
Andreas Rheinhardt 7f35c999f6 avcodec/ac3enc: Avoid copying samples
Only the last 256 samples of each frame are used;
the encoder currently uses a buffer for 1536 + 256 samples
whose first 256 samples contain are the last 256 samples
from the last frame and the next 1536 are the samples
of the current frame.
Yet since 238b2d4155 all the
DSP functions only need 256 contiguous samples and this can
be achieved by only retaining the last 256 samples of each
frame. Doing so saves 6KiB per channel.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Andreas Rheinhardt da460fb95c avcodec/ac3enc: Combine cpl_coord buffers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Andreas Rheinhardt 5b9fab0f07 avcodec/ac3enc: Combine loops
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Andreas Rheinhardt 79d1814b71 avcodec/ac3enc: Avoid indirections, allocations of small arrays
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Andreas Rheinhardt 94132dc4aa avcodec/ac3enc: Avoid allocation for mdct_window
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Andreas Rheinhardt 3b93b1af13 avcodec/ac3enc: Avoid allocation for windowed_samples
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Xinpeng Sun 35ae44c615 lavfi/tonemap_vaapi: Add support for HDR to HDR tone mapping
Usage example:
ffmpeg -y -hwaccel vaapi -hwaccel_output_format vaapi -i hdr.mp4 \
-vf "tonemap_vaapi=display=7500 3000|34000 16000|13250 34500|15635 16450|500 10000000:extra_hw_frames=64" \
-c:v hevc_vaapi output.mp4

Signed-off-by: Xinpeng Sun <xinpeng.sun@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang db22804145 lavfi/tonemap_vaapi: Update the log
demote the message to AV_LOG_VERBOSE.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang 3172a6722e lavfi/tonemap_vaapi: By default use bt709 for output frame
By default don't use the color properties from input frame as output
frame properties when performing HDR to SDR conversion

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang 1b5ca2e631 Changelog: Add pad_vaapi, drawbox_vaapi entry
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang 5c55e4e297 lavfi: Add drawbox_vaapi filter
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang 42eb10ecc6 lavfi: Add pad_vaapi filter
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Tong Wu b2e2fb0344 avcodec/vaapi_encode_h265: use is_reference to fill reference_pic_flag
This codec supports FLAG_B_PICTURE_REFERENCES. We need to fill
reference_pic_flag with pic->is_reference.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-04-18 14:43:07 +08:00
Tong Wu 02fb1782ef avcodec/vaapi_encode_h264: use is_reference to fill reference_pic_flag
This codec supports FLAG_B_PICTURE_REFERENCES. We need to correctly fill
the reference_pic_flag with is_reference variable instead of 0 for B
frames.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang 16616a3d1b lavfi/vaapi_vpp: Use dynamic frame pool in outlink if possible
This can avoid to exhaust the buffers within outlink when libva2 is
available.

For example:
$ ffmpeg -hwaccel_output_format vaapi -hwaccel vaapi -i input.mp4 \
-vf 'scale_vaapi=w=720:h=480' -c:v hevc_vaapi -f null -
...
[vf#0:0 @ 0x55acad91f400] Error while filtering: Cannot allocate memory
[vf#0:0 @ 0x55acad91f400] Task finished with error code: -12 (Cannot
allocate memory)
[vf#0:0 @ 0x55acad91f400] Terminating thread with return code -12
(Cannot allocate memory)

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang 41e3d36a39 lavc/vaapi_decode: Use dynamic frame pool if possible
libva2 doesn't require a fixed surface-array any more, so we may use
dynamic frame pool for decoding when libva2 is available, which allows a
downstream element stores more frames from VAAPI decoders and fixes the
error below:

$ ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi \
-i input.mp4 -c:v hevc_vaapi -f null -
...
[h264 @ 0x557a075a1400] get_buffer() failed
[h264 @ 0x557a075a1400] thread_get_buffer() failed
[h264 @ 0x557a075a1400] decode_slice_header error
[h264 @ 0x557a075a1400] no frame!

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Geoff Hill 1abba59738 avcodec/ac3: Remove unused fixed-point ARMv7 DSP
This diff removes 4 unused ARMv7 NEON fixed-point DSP functions.

The function were originally moved here by 4958f35a2 (Dec 2013).

After 9e05421db (Jan 2021), as part of the refactor of the AC3
DSP to consistently use 32-bit sample format in the encoder, these
functions were removed from the DSP function table, but the ARMv7
implementations were kept.

Signed-off-by: Geoff Hill <geoff@geoffhill.org>
2024-04-18 08:38:14 +02:00
Nicolas Gaullier 376b3d53c5 avfilter/vf_colorspace: use colorspace negotiation API
Fixes a regression due to the fact that the colorspace filter does
not use the new API introduced by 8c7934f73a.
The scale filter uses it since 45e09a3041, and the setparams
filter since 3bf80df3cc.

Example:
ffprobe -f lavfi yuvtestsrc,setparams=color_primaries=bt470bg:color_trc=
bt470bg:colorspace=bt470bg,colorspace=bt709:range=tv,scale,showinfo

Before:
  color_range:unknown color_space:bt470bg ...
After:
  color_range:tv color_space:bt709 ...

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-04-17 22:17:56 +02:00
Gyan Doshi 38c322681e avformat/ivfenc: remove unused var
sum_delta_pts is unused since 3b358f151d
2024-04-17 18:31:06 +05:30
Andreas Rheinhardt 639013aafc avformat/lc3: Only allow AV_CODEC_ID_LC3 in muxer
Also check for the number of streams and the AVCodecID generically
using FF_OFMT_FLAGs.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-16 21:40:13 +02:00
arch1t3cht e9e1932c1c avcodec/h264dec: Reindent after the previous commit
Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-16 16:36:22 +01:00
arch1t3cht 728ffe6ca6 avcodec/h264dec: Handle non-recovered frames when draining
When starting on a SEI recovery point close enough to the end of
the stream that draining starts before the recovery point's frame
is output, there can be non-recovered frames in the delayed picture
buffer that would currently cause the decoder to fail to output a
frame. This commit skips such frames and outputs the first recovered
frame, if there exists one.

Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-16 16:36:22 +01:00
arch1t3cht 5a856ac6e6 avcodec/h264dec: Properly mark frames as recovered when draining
When decoding starts at a SEI recovery point very shortly before the
end of the video stream, there can be frames which are decoded before
the recovery point's frame is output and which will only be output once
the draining has started. Previously, these frames would never be set
as recovered. This commit copies the logic from h264_select_output_frame
to send_next_delayed_frame to properly mark such frames as recovered.

Fixes ticket #10936.

Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-16 16:36:22 +01:00
James Almer 6b6a0fc53d avformat/iamf_writer: reject duplicated stream ids in a stream group
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-16 11:43:10 -03:00
Antoine SOULIER 257bc2a82a avformat/lc3: add file format for LC3/LC3plus transport
A file format is described in Bluetooth SIG LC3 and ETSI TS 103 634, for
test purpose.
2024-04-15 18:34:12 +02:00
Stefano Sabatini b2bc4ac69e doc/utils/eval: review and extend, clarify ld/st index meaning
Prefer idx in place of id for functions accessing the internal
variables, and add a short introduction to mention them.
2024-04-15 18:32:38 +02:00
Stefano Sabatini 8ceb37d5ad doc/utils/eval: clarify meaning of random* seed value
Possible address trac issue:
http://trac.ffmpeg.org/ticket/10763
2024-04-15 18:30:35 +02:00
Frank Plowman 993c231de0 lavc/vvc: Increase size of ctb_size_y
sps_log2_ctu_size_minus5 is between 0 and 2, with 3 reserved for future
use.  The VVC decoder allows sps_log2_ctu_size_minus5 to be 3, and so
ctb_size_y should be at least 16 bits to prevent overflows.  An
alternative patch would leave sps_log2_ctu_size_minus5 as 8 bits and
disallow sps_log2_ctu_size_minus5 = 3.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-15 21:06:13 +08:00
LuMingYin 5e380bcdb1 avfilter/af_channelsplit: fix memory leak
Signed-off-by: LuMingYin <lumingyindetect@163.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-15 10:30:46 +08:00
Lynne db09f1a5d8 vulkan_av1: add workaround for NVIDIA drivers tested on broken CTS
The first release of the CTS for AV1 decoding had incorrect
offsets for the OrderHints values.
The CTS will be fixed, and eventually, the drivers will be
updated to the proper spec-conforming behaviour, but we still
need to add a workaround as this will take months.

Only NVIDIA use these values at all, so limit the workaround
to only NVIDIA. Also, other vendors don't tend to provide accurate
CTS information.
2024-04-15 02:40:02 +02:00
Mark Thompson 3cca8dfbd8 lavc/vulkan_av1: Use av1dec reference order hint information 2024-04-14 21:05:08 +01:00
Mark Thompson 22ced1edc6 lavc/av1: Record reference ordering information for each frame
This is needed by Vulkan.  Constructing this can't be delegated to CBS
because packets might contain multiple frames (when non-shown frames are
present) but we need separate snapshots immediately before each frame
for the decoder.
2024-04-14 21:05:05 +01:00
Andreas Rheinhardt f48987f609 doc/muxers.texi: Don't use confusing variable name
reserve_index_space is a size, not an index.
Also refer to the variable in the description.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-14 17:25:16 +02:00
Diego Felix de Souza 1f265aa91d avcodec/nvenc: Multi NVENC Split Frame Encoding in HEVC and AV1
When Split frame encoding is enabled, each input frame is partitioned into
horizontal strips which are encoded independently and simultaneously by
separate NVENCs, usually resulting in increased encoding speed compared to
single NVENC encoding.

Signed-off-by: Diego Felix de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-04-13 18:00:43 +02:00
Kacper Michajłow 1c45104f74 avcodec/h2645_sei: validate Mastering Display Colour Volume SEI values
As we can read in ST 2086:

Values outside the specified ranges of luminance and chromaticity values
are not reserved by SMPTE, and can be used for purposes outside the
scope of this standard.

This is further acknowledged by ITU-T H.264 and ITU-T H.265. Which says
that values out of range are unknown or unspecified or specified by
other means not specified in this Specification.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-04-13 17:50:49 +02:00
Zhao Zhili 65c1c83ca4 avformat/tls_mbedtls: Pass FLAG_NONBLOCK to underlying transport
This fix rtmps failure since rtmps requires nonblocking read.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-12 15:24:17 +08:00
Shiyou Yin 2a7d622ddd swscale: [LA] Optimize swscale funcs in input.c
Optimized 7 funcs with LSX and LASX:
1. yuy2ToUV_c
2. yvy2ToUV_c
3. uyvyToUV_c
4. nv12ToUV_c
5. nv21ToUV_c
6. abgrToA_c
7. rgbaToA_c

Reviewed-by: colleague of Shiyou Yin
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-11 23:53:59 +02:00
Shiyou Yin 8b76df9142 swscale: [LA] Optimize yuv2plane1_8_c.
Reviewed-by: colleague of Shiyou Yin
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-11 23:53:59 +02:00
Shiyou Yin f3fe2cb5f7 swscale: [LA] Optimize range convert for yuvj420p.
Reviewed-by: 陈昊 <chenhao@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-11 23:53:41 +02:00
James Almer dd5f665b40 avutil/frame: free the old side data buffer before replacing it
Fixes memleaks reported by ASAN/Valgrind.

Reported-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 12:32:13 -03:00
James Almer 6d0c89980c avcodec/hevcdec: export global side data in AVCodecContext
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:48:39 -03:00
James Almer 6def8e3923 avcodec/decode: add AVFrameSideData helper wrappers that don't depend on frames
They will be useful to fill arrays stored in other structs.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:46:23 -03:00
James Almer 6d760c666d avutil/mastering_display_metadata: add a new allocator function that returns a size
av_mastering_display_metadata_alloc() is not useful in scenarios where you need to
know the runtime size of AVMasteringDisplayMetadata.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:46:18 -03:00
James Almer adb67bba06 avutil/version: bump minor after recent AVFrame API additions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:43:51 -03:00
James Almer 662dbf826d avutil/frame: add helper to remove side data of a given type from an array
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 09:18:19 -03:00
James Almer 55621f6fae avutil/frame: add a flag to allow overwritting existing entries
Enable it only for side data types that don't allow more than one entry.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 09:18:19 -03:00
James Almer a16338089c avutil/frame: add helper for adding side data w/ AVBufferRef to array
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 09:18:19 -03:00
Martin Storsjö e4f5c2414b tests/movenc: Validate that normal muxer usage doesn't print warnings
We have test to make sure that certain configurations do print
warnings. However, the normal operation of the muxer within this
test always printed a warning, so those tests to check for
extra warnings didn't essentially guard anything.

The warning that always was printed, "track 1: codec frame size is
not set" was not present in the libav fork where this testcase
originated, it was removed in f234e8a32e.

Set the frame size for the audio stream to silence the warning,
and use this frame size in a couple later calculations, and check
that one test configuration doesn't print warnings.

Setting the frame size apparently changes the rounding of a timestamp
in the ismv muxing testcase.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-11 14:08:55 +03:00
Andreas Rheinhardt 497a0f839d avformat/img2: Avoid relocations for ff_img_tags
The strings here are so short that using a pointer is wasteful
(the longest string takes nine bytes; on 64 bit systems,
the pointer+padding already take 12 bytes). So avoid them
and add asserts to ensure that no one ever tries to use a too
long tag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 1533351990 avcodec/flacenc: Avoid shift where possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 0458fdbeed avcodec/ac3enc: Avoid calculating the CRC multiple times
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 28ffc39808 avcodec/ac3enc: Move EAC-3 specific initialization to eac3enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 2281ab5c24 avcodec/ac3enc: Avoid function pointers to initialize MDCT
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 6c55cb95ed avcodec/ac3enc_float: Remove uninformative error message
AVERROR(ENOMEM) is enough.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 3cd136bc12 avcodec/ac3enc: Deduplicate copying input samples
These memcpy operands only depend upon sizeof(SampleType)
(and this size is actually the same for both the fixed-point
and the floating-point encoders for most (all supported?)
systems).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 7311a9086e avcodec/ac3enc: Deduplicate allocating buffers
These allocations only depend upon sizeof(SampleType)
(and this size is actually the same for both the fixed-point
and the floating-point encoders for most (all supported?)
systems).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 2fcc50d1f5 avcodec/ac3enc: Share more code between fixed/float encoders
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 1042ee36cd avcodec/ac3enc: Move ff_ac3_validate_metadate() upwards
Will avoid a forward declaration in the next commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt 6244ecf8ec avcodec/ac3enc: Use common encode_frame function
This is in preparation for sharing even more stuff
common to the fixed and floating-point encoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt fee093a570 avcodec/ac3enc: Remove disabled code for RealAudio variant of AC-3
Implicitly disabled by 4679a474f0.
Given that no one has ever complained about this, this commit
removes the now dead code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:52:46 +02:00
Andreas Rheinhardt 27a830c1d8 avcodec/ac3enc: Remove always-false sample rate check
encode_preinit_audio() already checks that the sample rate
is among AVCodec.supported_samplerates.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt e878ec7eb2 avcodec/ac3enc: Avoid copying strings
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt 8261d5d38c avcodec/ac3enc: Use bit-operations for bit-mask
Simply masking the LFE bit is more natural than subtracting
if set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt b3d12fe200 avcodec/ac3enc: Remove redundant channel layout checks
These are all checked generically via AVCodec.ch_layouts
in encode_preinit_audio().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt 13daafd5c0 avcodec/ac3enc: Don't overwrite AVCodecContext.ch_layout
This is unnecessary (the channel layout guessing code became
moot when the channel layouts were enforced generically)
and also dangerous, as a custom channel layout mapping
would leak in case one was used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt c3fb0c5bab avcodec/ac3enc: Don't presume ch_layout to be AV_CHANNEL_ORDER_NATIVE
It is perfectly legal for users to use a custom layout
that is equivalent to a supported native one.
In this case the union in AVChannelLayout is not an uint64_t mask,
but a pointer to a custom map.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Anton Khirnov 0e4dfa4709 Revert "bsf: use standard include paths"
This reverts commit 41b73ae883.

This patch was pushed extremely quickly, without giving developers the
time to object.
2024-04-10 15:17:54 +02:00
J. Dekker 985fdf8e3d tests/checkasm: add exclude_guest for non-x86 linux perf
The exclude_guest option only has an effect on x86. Omitting
'exclude_guest' defaults to zero which implies that you can count guest
events should you run one. Some non-x86 kernels just ignore it, while
others (e.g. the Asahi Linux kernels) require the user to explicitly set
the option to 1, i.e. the only behaviour that makes sense when counting
guest events isn't supported.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-10 13:37:40 +02:00
Lynne 89a9042291 lavc/avfft: fix RDFT wrapper stride
Per the lavu/tx docs:

> * For forward transforms (R2C), stride must be the spacing between two
> * samples in bytes. For inverse transforms, the stride must be set
> * to the spacing between two complex values in bytes.

The code did the reverse.
The stride parameter is currently not respected for RDFT transforms,
but has to be correct, for a potential future change.
2024-04-10 13:22:18 +02:00
Fei Wang 0534d2ac84 lavfi/dnn_backend_torch: Include mem.h
Fix build fail since 790f793844.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-04-10 18:18:49 +08:00
Stefano Sabatini 7e59c4f908 doc/muxers/matroska: apply misc consistency fixups 2024-04-10 10:56:54 +02:00
Stefano Sabatini 8510108c1d doc/muxers: add lrc 2024-04-10 10:56:54 +02:00
Stefano Sabatini 57d64bb715 doc/muxers: add kvag 2024-04-10 10:56:54 +02:00
Stefano Sabatini f7fd228560 doc/muxers: add jacosub 2024-04-10 10:56:54 +02:00
Stefano Sabatini 4fe3c8dcfd doc/muxers: add ivf 2024-04-10 10:56:54 +02:00
Martin Storsjö fbd5e238d4 movenc: Allow writing timed ID3 metadata
This is based on a spec at https://aomediacodec.github.io/id3-emsg/,
further based on ISO/IEC 23009-1:2019.

Within libavformat, timed ID3 metadata (already supported by the
mpegts demuxer and muxer) is handled as a separate data AVStream
with codec type AV_CODEC_ID_TIMED_ID3. However, it doesn't
have a corresponding track in the mov file - instead, these events
are written as separate toplevel 'emsg' boxes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-10 10:48:50 +03:00
Martin Storsjö e4e3d25d41 movenc: Remove a leftover commented out line
This line originates from 6f69f7a8bf.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-10 10:42:02 +03:00
Martin Storsjö 8339a45400 aarch64: Factorize code for CPU feature detection on Apple platforms
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-10 10:39:08 +03:00
Andrew Kelley 41b73ae883 bsf: use standard include paths
Removes the special -I flag specified in the avcodec/bsf/ subdirectory.

This makes code copy-pastable to other parts of the ffmpeg codebase, as
well as simplifying the build script.

It also reduces ambiguity, since there are many instances of same-named
header files existing in both libavformat/ and libavcodec/
subdirectories.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-09 22:21:59 -03:00
James Almer 9dbc9a0f97 avcodec/libsvt1: check return value of send/receive functions
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-09 21:37:49 -03:00
Marton Balint c38f785be4 avformat/mov_chan: add support for omitted_channel bitmask in chnl atom
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:14:22 +02:00
Marton Balint 92e7a9a4d5 avformat/mov_chan: respect channel order when parsing and creating chnl atom
Previously we always assumed that the channels are in native order, even if
they were not. The new channel layout API allows us to signal the proper
channel order, so let's do so.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:14:22 +02:00
Marton Balint da0fe26379 avformat/mov_chan: factorize some layout map search functions
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:14:22 +02:00
Marton Balint c68dc3e5f1 avformat/mov_chan: check channel count of layout tags at compile time
We can do this by using an X-macro for channel map declaration and doing a
static_assert() in one pass for the check. Thanks for Andreas Rheinhardt for
the suggestion.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:14:21 +02:00
Marton Balint 7801451376 avformat/hlsenc: use a slash separator even in win32
We don't know if the protocol used is referring to a local file or a remote
resource, so it is better to simply use slash as separator which works all the
time. (well, except in very special cases when the user specified a \\?\ path)

Fixes ticket #9780.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:13:09 +02:00
Marton Balint 4721b9f15f avfilter/buffersrc: never override channel count in av_buffersrc_add_frame_flags
Overriding unknown layouts with the negotiated layout is OK, but the number of
channels should match with what was negotiated.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:12:46 +02:00
Martin Storsjö 359b6a7f8a aarch64/ac3dsp: simplify the end of ff_ac3_sum_square_butterfly_float_neon
Before:                           Cortex A53     A72     A78      M1
ac3_sum_square_bufferfly_float_neon:  1005.7   516.5   224.5   194.0
After:
ac3_sum_square_bufferfly_float_neon:   981.7   504.5   223.2   189.5

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-09 16:50:49 +02:00
Frank Plowman 1c0149359a lavc/vvc: Fix out-of-bounds array access
The 2 which has been changed to an 8 in the array length expression is
the maximum value of sps_bitdepth_minus8.  This was missed when updating
to VVCv2, which increased this maximum from 2 to 8.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-09 22:35:48 +08:00
Frank Plowman 2b7e79e890 lavc/vvc: Avoid overflow in coeff scale intermediate
Make intermediate result 64-bits to avoid an overflow before the right
shift.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-09 22:30:35 +08:00
Frank Plowman fcf74c5ebc lavc/vvc: Fix buffer overread in CABAC
The size variable here is taken as gospel for the bounds of the input
buffer in later logic.  Clamp it to ensure that the returned region
does not extend past that allocated in the underlying GetBitContext,
even in the case entry point offsets are signalled in the bitstream.
Also assert this for good measure.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-09 22:30:18 +08:00
Frank Plowman f499503073 lavc/vvc_parser: Fix integer overflow calculating framerate
num_units_in_tick and time_scale are both 32-bit unsigned integers.
Storing them as ints was causing overflows.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-09 22:15:29 +08:00
Frank Plowman b4baa4c0b3 lavc/vvc: Fix left shifts of negative values
All these variables lie in the range [-12..12]

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-09 22:13:49 +08:00
J. Dekker 67e2f8b6bf configure, etc: switch to shebang without space
Note that the config.sh file is left without a shebang, this file is
supposed to be sourced into the current environment.

This commit is purely cosmetic.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-09 16:01:24 +02:00
J. Dekker fcfd17dbb4 ffbuild/libversion.sh: add shebang
The implicit interpreter is dependent on the environment, and isn't
guaranteed to be /bin/sh. Some packagers call this script directly, and
in certain environments such as containers using qemu-user through
binfmt_misc emulation on Linux it doesn't fallback to /bin/sh.

To fix these cases we add the interpreter explicitly.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-09 15:34:53 +02:00
J. Dekker 3090106635 configure: simplify bigendian check
The preferred way to use LTO is --enable-lto but often times packagers
still end up with -flto in cflags for various reasons. Using grep
on binary object files is brittle and relies on specific object
representation, which in the case of LLVM bitcode, debug information or
other intermediary formats can fail silently.

This patch changes the check to a more commonly used define for GCC
style compilers. More checks may be needed to cover other potential
compilers that don't use the __BYTE_ORDER__ define.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-09 15:34:13 +02:00
Niklas Haas 459648761f avcodec/hevcdec: fix segfault on invalid film grain metadata
Invalid input files may contain film grain metadata which survives
ff_h274_film_grain_params_supported() but does not pass
av_film_grain_params_select(), leading to a SIGSEGV on hevc_frame_end().

Fix this by duplicating the av_film_grain_params_select() check at frame
init time.

An alternative solution here would be to defer the incompatibility check
to hevc_frame_end(), but this has the downside of allocating a film
grain buffer even when we already know we can't apply film grain.

Fixes: https://trac.ffmpeg.org/ticket/10951
2024-04-09 15:01:58 +02:00
Anton Khirnov baf17c15be doc/ffmpeg: document that there can be multiple complex filtergraphs 2024-04-09 10:34:18 +02:00
Anton Khirnov 3bd7c57125 fftools/ffmpeg_filter: implement filtergraph chaining
This allows one complex filtergraph's output to be sent as input to
another one, which is useful in certain situations (one is described in
the docs).

Chaining filtergraphs was already effectively possible by using a
wrapped_avframe encoder connected to a loopback decoder, but it is ugly,
non-obvious and inefficient.
2024-04-09 10:34:18 +02:00
Anton Khirnov 255ae03601 fftools/ffmpeg_sched: allow filtergraphs to send to filtergraphs
Will be useful for filtergraph chaining that will be added in following
commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov 3d01996b24 fftools/ffmpeg_filter: change processing order in fg_finalise_bindings()
First bind all inputs in all filtergraphs, only then check that all
outputs are bound.

Needed by the following commit.
2024-04-09 10:34:18 +02:00
Anton Khirnov 243a51490a fftools/ffmpeg_filter: only store complex filtergraphs in global array
Store simple filtergraphs in the stream they feed. Keeping the two
separate will be useful in following commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov d74cbcb963 fftools/ffmpeg_filter: drop OutputFilter.ost
All remaining code accessing it only needs to know whether this
filtergraph output has been bound or not.
2024-04-09 10:34:18 +02:00
Anton Khirnov f2c919252d fftools/ffmpeg_filter: accept encoder thread count through OutputFilterOptions
Stop digging through encoder options manually.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov bfeb751171 fftools/ffmpeg_mux: drop OutputFile.format
It is no longer used outside of the muxing code (where we can access the
muxer directly).
2024-04-09 10:34:18 +02:00
Anton Khirnov 5b0589c8c3 fftools/ffmpeg_mux: drop OutputFile.shortest
It is no longer needed outside of of_open() and its children.
2024-04-09 10:34:18 +02:00
Anton Khirnov a4c940c86a fftools/ffmpeg_filter: move most of -apad logic to the muxer
The decision whether -apad actually does anything is made based on muxer
properties, and so more properly belongs there. Filtering code only
receives the result.
2024-04-09 10:34:18 +02:00
Anton Khirnov a2892dbe06 fftools/ffmpeg_filter: pass trim parameters through OutputFilterOptions
Do not read them from OutputStream directly.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov 83304f7c1f fftools/ffmpeg_filter: pass autoscale through OutputFilterOptions
Do not read it from OutputStream directly.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov b8e6802023 fftools/ffmpeg_filter: pass sws/swr opts through OutputFilterOptions
Do not read them from OutputStream directly.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov 23c23077fc fftools/ffmpeg_filter: drop an unnecessary use of OutputStream
OutputFilter.type contains the same information.
2024-04-09 10:34:18 +02:00
Anton Khirnov fc6354c39c fftools/ffmpeg_filter: add an AVClass to OutputFilter
Use it for logging where appropriate, avoid logging to OutputStream as
we do not own it.

This is a step towards decoupling filtering from encoding.
2024-04-09 10:34:18 +02:00
Anton Khirnov 3c3e04c8a3 fftools/ffmpeg_filter: simplify retrieving filter type 2024-04-09 10:34:18 +02:00
Anton Khirnov 114cbaa316 fftools/ffmpeg_filter: drop a redundant check
fg_finalise_bindings() already checks that all filtergraph outputs are
connected.
2024-04-09 10:34:18 +02:00
Anton Khirnov da80e0b077 fftools/ffmpeg_filter: accept a caller-provided output name
Do not construct it from OutputStream manually.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov 82c7c21b18 fftools/ffmpeg: drop OutputStream.is_cfr
It is used in a single place in the filtering code, so it is better to
inline it there.
2024-04-09 10:34:18 +02:00
Anton Khirnov 509afedaaf fftools/ffmpeg_filter: pass vsync method through OutputFilterOptions
Do not read it from OutputStream directly.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov bc206ed1b3 fftools/ffmpeg_filter: stop accessing encoder AVCodecContext
Pass all the necessary value through OutputFilterOptions.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov 17702c5f7b fftools/ffmpeg_filter: move the MJPEG format selection hack to muxer setup
That, if anywhere, is a more appropriate place for it.
2024-04-09 10:34:18 +02:00
Anton Khirnov 9d5bf2d69e fftools/ffmpeg_filter: pass enc_timebase through OutputFilterOptions
Reduces the need to access OutputStream, which will allow decoupling
filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov 606c71bb11 fftools/ffmpeg: warn about ignored -enc_time_base for subtitles earlier
Can do it as soon as that option is parsed, no need to postpone it until
opening the encoder.
2024-04-09 10:34:18 +02:00
Anton Khirnov e903c31fd1 fftools/ffmpeg_filter: pass keep_pix_fmt through OutputFilterOptions
Reduces the need to access OutputStream, which will allow decoupling
filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov b3864e7a08 fftools/ffmpeg_filter: pass ts offset through OutputFilterOptions
Reduces the need to access OutputFile, which will allow decoupling
filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov 651c79da36 fftools/ffmpeg_filter: check that filter type matches output stream type
For simple filtergraphs. For complex filtergraphs they always match.
2024-04-09 10:34:18 +02:00
Anton Khirnov 8e35e33d42 fftools/ffmpeg_filter: stop accessing AVCodecContext.codec
Instead pass the encoder through a newly-added output options struct,
analogous to previously added input options.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov 8c33085313 fftools/ffmpeg_filter: do not pass OutputStream to set_channel_layout()
It only needs a list of allowed layouts and the requested layout.
2024-04-09 10:34:18 +02:00
Anton Khirnov d7cde009ce lavfi/avfilter: add an "auto" constant to the threads option
Analogous to the same constant in avfiltergraph and avcodec.
Cf. f599ae88c2.
2024-04-09 10:34:18 +02:00
Anton Khirnov b0e1bc6298 lavfi/vf_scale: fix AVOption flags for "size"/"s" 2024-04-09 10:34:18 +02:00
James Almer b0ef9e35e8 x86/ac3dsp: clear the upper 32 bits for input arguments where needed
Fixes checkasm on win64.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-08 13:45:58 -03:00
Andreas Rheinhardt 17414abb69 avcodec/mpegvideo_dec, h264_slice: Return proper error codes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt 7f0efe2324 avcodec/mpeg12dec: Remove redundant mpeg_enc_ctx_allocated
Use context_initialized from the underlying MpegEncContext
instead. Also don't check before ff_mpv_common_end()
in mpeg_decode_end().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt 94295bb574 avcodec/mpegvideo: Remove pointless check
Possible since 315c956cbd.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt 6f2f496822 avcodec/mpegvideo_dec: Move getting Picture slot into alloc_picture()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt b7cf2d0efc avcodec/mpegvideo_dec: Factor allocating dummy frame out
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt b00c697654 avcodec/mpegvideo_dec: Remove redundant code to reset keyframe flag
These AVFrames are blank and therefore the flag is already unset.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt da4cca5fc0 avcodec/mpegvideo_dec: Remove obsolete current_picture_ptr reuse code
Obsolete since at least 74d623914f.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt 00e48e6da8 avcodec/mpeg12dec: Remove unnecessary FFCodec.close
The ipu decoder never calls ff_mpv_common_init() or allocates
anything else that would need to be freed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt f48313526b avcodec/mpegvideo_dec: Don't emit non-keyframe warning for H.261
H.261 does not have keyframes (or indeed frame types) at all,
so this warning is not warranted.

Also remove an always-true check while at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt 518f79f2a8 avcodec/mpeg12dec: Don't pretend MPEG-1/2 to support alpha
(FF_PTR_ADD has to be kept although MPEG-1/2 only supports
YUV pixel formats because our decoder also supports decoding
to AV_PIX_FMT_GRAY8 depending upon CONFIG_GRAY.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt 1a5452655a avcodec/mpeg12dec: Remove redundant check
This code only gets executed for the first field.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:01 +02:00
Andreas Rheinhardt a9709b3c83 avcodec/mpegvideo_dec, mpeg12dec: Move MPEG1/2 code to mpeg12dec.c
Up until now, ff_mpv_frame_start() offsets the data of the current
picture and doubles the linesizes of all pictures if the current
picture is field-based so that data and linesize allow to address
the current field only.

This is done based upon the current picture_structure value.
Only two mpegvideo-based decoders ever set this field: mpeg1/2
and VC-1; but the latter only does it after ff_mpv_frame_start()
(when using hardware-acceleration and in order to signal it to
the DXVA2 hwaccel) in which case no offset is applied in
ff_mpv_frame_start(). So only one decoder actually wants this
offset*; therefore move the code performing it to mpeg12dec.c.

*: VC-1 doubles linesize when using field_mode (not only the picture's
linesize, but also uvlinesize and linesize), yet it does not offset
anything. This is further proof that this should not be performed
generically.

Also move MPEG-1/2 specific setting of the top-field-first flag.
(The change here implies that the AVFrame in current_picture
may have different top-field-first flags than the AVFrame
from current_picture_ptr, but this doesn't matter as only
the latter's are used.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:01 +02:00
Andreas Rheinhardt ca7b2c393a avcodec/mpeg12: Remove always-false check
Forgotten in 7800cc6e82.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:01 +02:00
Andreas Rheinhardt 66923165d5 avcodec/mpegutils: Move definitions to better places
FRAME_SKIPPED -> h263dec.h
CANDIDATE_MB_TYPE_* -> mpegvideoenc.h
INPLACE_OFFSET -> mpegvideoenc.h
enum OutputFormat -> mpegvideo.h

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:01 +02:00
Andreas Rheinhardt 908a73df31 avcodec/mpegvideo_enc: Don't update current_picture unnecessarily
current_picture is not changed after frame_start() at all
and it therefore does not need to be updated (i.e. copied to the
slice thread contexts) a second time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:01 +02:00
James Almer 1f049d5627 avcodec/vvc/dec: fix typo
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-08 09:10:04 -03:00
James Almer 9eca5b8369 avcodec/vvc/ps: reset sps_id_used on flush
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-08 08:56:53 -03:00
Geoff Hill ee1bc723de avcodec/ac3: Implement sum_square_butterfly_float for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:40 +03:00
Geoff Hill 42e88f18f3 avcodec/ac3: Implement sum_square_butterfly_int32 for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:40 +03:00
Geoff Hill 69cb34f885 avcodec/ac3: Implement ac3_extract_exponents for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:40 +03:00
Geoff Hill 6f6bd10531 avcodec/ac3: Implement ac3_exponent_min for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:40 +03:00
Geoff Hill b69486ea18 avcodec/ac3: Implement float_to_fixed24 for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:28 +03:00
Andreas Rheinhardt 2d33d6bfcc avcodec/dv: Don't pretend initializing work chunks can fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt f3c8d0399a avcodec/huffyuvdec: Use assert to check for things that can't fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt a6d6c8442c avcodec/huffyuvdec: Use bytestream API for byte-aligned reads
This also allows to remove the padding from these buffers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt a6979e3bd2 avcodec/huffyuvenc: Deduplicate options
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt 5110d16f5a avcodec/huffyuvenc: Avoid code duplication
This also fixes misindentated code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt d517c9e51b avcodec/huffyuvenc: Avoid duplicate variables
Also simplify assigningfake strides.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt 0e5af493fc avcodec/huffyuv: Return proper error code
Also forward said error code in the encoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt cf96c0295e avcodec/huffyuv(dec|enc): Use union for temp/temp16
These pointers already point to the same buffers, so using
a union is possible and avoids the overhead of syncing the
pointers (and saves some memory).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt eef5d60ac6 avcodec/huffyuv: Inline common alloc/free functions in their callers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt cebf1d59a5 avcodec/huffyuvdec: Don't zero unnecessarily
A decoder's private data has already been zeroed (apart from options)
before init is called.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Frank Plowman 2d79ae3f8a lavc/vvc: Error if SPS ID is duplicated within CVS
Key line from the spec is:

"All SPS NAL units with a particular value of sps_seq_parameter_set_id
in a CVS shall have the same content."

Prior to this patch, the VVC decoder's behaviour on encountering a
duplicated SPS ID (within the entire bitstream, not restricted to
a CVS) was simply to replace the entry in the SPS lookup table with the
new data.  Illegal bitstreams with multiple SPSs in the same CVS sharing
an ID but differing elsewhere could cause all manner of issues.

The patch tracks which SPS IDs have been used in the given CVS using the
new sps_id_used field of VVCParamSets.  If it encounters an SPS with an
ID already in use and whose content differs from the previous SPS, it
throws an AVERROR_INVALIDDATA.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-07 10:13:45 +08:00
Andreas Rheinhardt 0dbf45120a avcodec/libdav1d: Don't cast const away unnecessarily
Possible since c89f6ae689.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-06 18:44:06 +02:00
Stefano Sabatini 1cb1f29a04 lavf/lrc: fix comments in headers 2024-04-06 12:59:56 +02:00
Antoine SOULIER 4865ea48cc avcodec/liblc3dec: retrieve duration of the last packet from the demuxer
Use the packet duration field to invalid last samples of the last frame.
2024-04-06 09:55:57 +02:00
Antoine SOULIER 6de00dc5f1 avcodec/liblc3dec: fix extradata size 2024-04-06 09:40:37 +02:00
Antoine SOULIER ad3fcfd0f2 avcodec/liblc3dec: fix typo in macro name, fix compilation 2024-04-06 09:40:32 +02:00
Oneric 57c545090d avocdec/ass: simplify linebreaks
ff_ass_subtitle_header_* still used explicit CRLF linebreaks
eventhough they will get normalised to LF later since commit
7bf1b9b357. Just directly use LF.
2024-04-06 09:26:30 +02:00
Oneric 0fc975c0d3 avcodec/ass,webvttdec: implement more portable curly brace escapes
Unlike what the old comment suggested, standard ASS has no character
escape mechanism, but a closing curly bracket doesn't even need one.

For manual authored sub files using a full-width variant of an
appropriate font and with scaling and spacing modifiers is a common
workaround.
This is not an option here, but we can still make things much less bad.
Now the desired opening bracket still shows up in libass, and
standard renders will merely display a backslash in its place
instead of stripping the following text like before.
2024-04-06 09:25:03 +02:00
Oneric baa64fa4e6 avcodec/ass,webvttdec: fix handling of backslashes
Backslashes cannot be escaped by a backslash in any ASS renderer,
but unless followed by specific characters it is just printed out.
Insert a word-joiner character after a backslash to break up
active sequences without changing the visual output.
2024-04-06 09:24:47 +02:00
Oneric 7b8b4cdd96 avcodec/webvttdec: honour bidi marks 2024-04-06 09:23:51 +02:00
James Almer 6f13f5dd59 doc/encoders: add missing libxvid option
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-05 17:20:54 -03:00
James Almer 16ba7bdd76 doc/encoders: remove non-existent flag
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-05 17:13:15 -03:00
James Almer 81b3a82fae avcodec/libaomenc: remove variable redefinition
Missed in 5e0eac3d45.

Reported-by: Niklas Haas <ffmpeg@haasn.xyz>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-05 14:57:29 -03:00
James Almer 5e0eac3d45 avcodec/libaomenc: bump the minimum required version to 2.0.0
v2.0.0 is already four years old and even newer versions are available on
stable distro releases.
With this we stop setting codec capabilities during static data initialization.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-05 14:32:08 -03:00
Andreas Rheinhardt 7b7b7819bd fate/ffmpeg: Avoid dependency on samples
Creating vsynth_lena.yuv needs the FATE suite,
yet several tests in ffmpeg.mak without a dependency
on samples used it as input file. Fix this by using
vsynth1.yuv (which does not have such a dependency)
instead.
Also use vsynth1.yuv in fate-shortest to avoid
the samples dependency in this test, too.

Fixes ticket #10947.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-05 17:37:28 +02:00
Andreas Rheinhardt d307aca184 avcodec/wavpack: Remove always-false check
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt aecd63478e avcodec/dsd: Hoist branch out of loop
This is possible by not converting from LSBF to MSBF; instead
add LSBF LUTs.
This approach necessitates reversing the initial values.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt 6d38c260e5 avcodec/dsddec: Fix decoding LSBF samples
ff_dsd2pcm_translate() works internally by converting LSBF input
to MSBF upon reading; its buffer is therefore always MSBF
and should therefore be initialized with MSBF silence;
but this is not true since e3d8963c3c
which this patch effectively reverts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt e81fa9f482 avcodec/wavpack: Only initialize DSD data when encountering DSD
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt 1c2860e815 fate/wavpack: Add test for DSD
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt c720c69188 avcodec/dsd: Use double for LUTs
Needed to make DSD->PCM conversion bitexact across arches.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt 2f59648aed avcodec/wavpack: Fix leak and segfault on reallocation error
av_realloc_f() frees the buffer it is given on allocation
failure. But in this case, the buffer is an array of
ownership pointers, causing leaks on error. Furthermore,
the count of pointers is unchanged on error and the codec's
close function uses it to free said ownership pointers,
causing a NPD.
This is a regression since 46412a8935.

Fix this by switching to av_realloc_array().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt a4800643bb avcodec/lossless_videoencdsp: Don't presume alignment in diff_bytes
The alignment of all the parameters in diff_bytes can be
anything the despite the documentation claiming otherwise.
8ecd383122 was based around
said documentation and is therefore insufficient to fix
e.g. the misaligned loads that happen in the huffyuvbgra
and huffyuvbgr24 vsynth FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:57:19 +02:00
Andreas Rheinhardt e54696bcaa avcodec/ppc/h264dsp: Fix left shifts of negative numbers
PPC equivalent of c756b3fca2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:57:19 +02:00
Leo Izen 7c338f470f avcodec, avformat/ffjni: fix duplicate JNI symbols
Use SHLIBOBJS and STLIBOBJS in the Makefiles for avcodec and avformat,
and add a stub ffjni.c to libavformat, which allows the symbols to be
duplicated for shared builds but not static builds.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2024-04-04 21:51:21 +02:00
Michael Niedermayer bf3b74142e avformat/pcm: Use 64bit in bitrate computation
Fixes: signed integer overflow: 65792 * 65312 cannot be represented in type 'int'
Fixes: 67819/clusterfuzz-testcase-minimized-ffmpeg_dem_WADY_fuzzer-5236100912185344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 19:38:30 +02:00
Michael Niedermayer ed49391961 avformat/mxfdec: Check index_edit_rate
Fixes: Assertion b >=0 failed at libavutil/mathematics.c:62
Fixes: 67811/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5108429687422976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 19:38:29 +02:00
Michael Niedermayer 1a9eda65d0 swscale/utils: Fix xInc overflow
Fixes: signed integer overflow: 2 * 1073741824 cannot be represented in type 'int'
Fixes: 67802/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6249515855183872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 19:38:29 +02:00
Michael Niedermayer 4593cf7ab3 avformat/iamf_parse: Check sound_system
Fixes: index 13 out of bounds for type 'const struct IAMFSoundSystemMap [13]'
Fixes: 67796/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4554553191104512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 19:38:29 +02:00
Michael Niedermayer 28c7094b25 avcodec/wavarc: fix signed integer overflow in block type 6/19
Fixes: signed integer overflow: -2088796289 + -91276551 cannot be represented in type 'int'
Fixes: 67772/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6533568953122816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 19:38:28 +02:00
James Almer 3db674614d avcodec/liblc3enc: don't force unspec channel layouts
We only care about channel count. Layout details will be ignored either way.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-04 13:57:34 -03:00
James Almer 45d2110fc7 avcodec/liblc3dec: sanitize channel count in avctx
Should prevent out of array accesses.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-04 13:55:16 -03:00
Antoine Soulier via ffmpeg-devel 240fd04db2 avcodec/liblc3: add encoding/decoding support of LC3 audio codec
The LC3 audio codec is the default codec of Bluetooth LE audio.
This is a wrapper over the liblc3 library (https://github.com/google/liblc3).

Signed-off-by: Antoine Soulier <asoulier@google.com>
2024-04-04 17:47:31 +02:00
Marth64 e3335e9e9e Changelog: fix typos for 7.0 section
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-04 12:43:47 -03:00
Andreas Rheinhardt 428ff7bd8c swscale/ppc/swscale_ppc_template: Reindent after the previous commit
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 16:47:21 +02:00
Andreas Rheinhardt 95b4aea5e3 swscale/ppc/swscale_ppc_template: Remove code not passing checkasm
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 16:45:23 +02:00
Andreas Rheinhardt db063212c8 avcodec/vvc: Rename vvc_?foo->foo
A namespace is unnecessary here given that all these files
are already in the vvc subfolder.

Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 16:45:00 +02:00
Jean-Baptiste Kempf 486a2b964b changelog: update for 7.0
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-04 10:57:28 -03:00
Wenbin Chen 478d97f303 libavfilter/dnn_io_proc: Take step into consideration when crop frame
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-04-04 14:26:57 +08:00
Wenbin Chen 8869f5ce86 libavfilter/dnn_backend_openvino: Check bbox's height
Check bbox's height with frame's height rather than frame's width.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-04-04 14:26:52 +08:00
Andreas Rheinhardt 9309b5bc64 avcodec/vvc/vvc_inter_template: Fix left shift of negative number
Affected the vvc-conformance-WP_A_3 FATE test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 11:36:41 +08:00
Andreas Rheinhardt 3fe28831ed configure: Only enable iamfdec, iamfenc when needed
Since 591e27d1e7 they would
always be compiled even when nothing uses them; for shared
builds the default linker behaviour is to include them
even when not needed.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 22:12:55 +02:00
Andreas Rheinhardt 9c4558b596 configure: Fix iamfdec dependencies
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 22:04:46 +02:00
Michael Niedermayer 5a5422196d doc/developer: (security) researchers should be credited
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 21:38:24 +02:00
Jan Ekström 16128f3c55 avcodec/libx265: do not arbitrarily limit color values
Newer specifications such as H.273 have, and probably will further
in the future add new values to these, so - instead of trying to update
these limits - we should simply check if the values are not set to the
value of "unspecified".

This should allow newer avutil values such as IPT-C2 or YCgCo-R
variants be passed to x265 itself, which apparently does its own
validation further down the line.
2024-04-03 21:31:35 +03:00
Jan Ekström 23d1b50175 avfilter/{buffersrc,vf_setparams}: map IPT-C2, YCgCo-R variants 2024-04-03 21:31:35 +03:00
Jan Ekström 06c53efd23 avcodec/options_table: map IPT-C2, YCgCo-R variants in colorspace 2024-04-03 21:31:35 +03:00
Jan Ekström 29561c8e2d avutil/pix{desc,fmt}: add new matrix coefficients from H.273 v3
* SMPTE ST 2128 IPT-C2 defines the coefficients utilized in DoVi
  Profile 5. Profile 5 can thus now be represented in VUI as
  {AVCOL_RANGE_JPEG, AVCOL_PRI_BT2020, AVCOL_TRC_SMPTE2084,
   AVCOL_SPC_IPT_C2, AVCHROMA_LOC_LEFT} (although other chroma
  sample locations are allowed). AVCOL_TRC_SMPTE2084 should in
  this case be interpreted as 'PQ with reshaping'.
* YCgCo-Re and YCgCo-Ro define the bitexact YCgCo-R, where the
  number of bits added to a source RGB bit depth is 2 (i.e., even)
  and 1 (i.e., odd), respectively.
2024-04-03 21:31:35 +03:00
Andreas Rheinhardt 924402f783 configure: Add missing libdav1d/av1 decoders->dovi_rpu dependency
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 20:07:54 +02:00
Andreas Rheinhardt 7895d1860f avfilter/avfilter: Don't use av_uninit
GCC 9-13 do not emit warnings for this at all optimization
levels even when -Wmaybe-uninitialized is not disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt 8d3fdb42c0 avfilter/vf_grayworld: Remove empty options and AVClass
This filter only had an AVClass and empty options because up until
recently, avfilter_init_str() errored out when options were provided
for a filter without an AVClass. But setting (generic) options is
necessary to take advantage of timeline support. So with
avfilter_init_str() fixed, the AVClass and the options can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt de288e406a avfilter/vf_hflip: Remove empty options and AVClass
This filter only had an AVClass and empty options because up until
recently, avfilter_init_str() errored out when options were provided
for a filter without an AVClass. But setting (generic) options is
necessary to take advantage of timeline support. So with
avfilter_init_str() fixed, the AVClass and the options can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt 99a200cad8 avfilter/vf_vflip: Remove empty options and AVClass
This filter only had an AVClass and empty options because up until
recently, avfilter_init_str() errored out when options were provided
for a filter without an AVClass. But setting (generic) options is
necessary to take advantage of timeline support. So with
avfilter_init_str() fixed, the AVClass and the options can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt 6260d4f770 avfilter/vf_swapuv: Remove empty options and AVClass
This filter only had an AVClass and empty options because up until
recently, avfilter_init_str() errored out when options were provided
for a filter without an AVClass. But setting (generic) options is
necessary to take advantage of timeline support. So with
avfilter_init_str() fixed, the AVClass and the options can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt 0c800c0b48 avfilter/avfilter: Honour the short options documentation
The documentation for filter arguments states that short options must
precede long options (i.e. those of the form key=value). Yet if
process_options() encounters arguments not abiding by this, it simply
treats short options after a long option as if it were parsing short
options for the first time. In particular, it overwrites options already
set earlier, possibly via other short options. This is not how it is
intended (as a comment in the code indicates).

This commit modifies the code to reject further shorthand options
after a long option has been encountered. After all, avfilter_init_str()
errors out upon unrecognized options, so it is intended to be picky.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt c96d0a0b85 avfilter/avfilter: Use AV_DICT_DONT_STRDUP_(KEY|VAL) when possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt abcb4b44f5 avcodec/tiff: Don't cast const away via bsearch
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt a5fcd97801 avcodec/libvpxenc: Avoid unused-variable warning if VP9 enc is disabled
Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:12:22 +02:00
Andreas Rheinhardt e123295cc8 avcodec/proresdec2: Rename to proresdec
Once upon a time, there used to be a LGPL and a GPL ProRes decoder
in FFmpeg; the current decoder evolved from the second of these.
But given that it is now the only ProRes decoder we have, it's file
should simply be named proresdec.c (which also brings it in line with
its header).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:10:30 +02:00
Andreas Rheinhardt 07c734b2b2 fate/ffprobe: Fix test requirements
The ffprobe-test file is generated via ffmpeg and several filters;
the requirements for them were missing.
Also deduplicate this while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:10:24 +02:00
Andreas Rheinhardt b351cbb314 fate/api: Fix requirements of fate-api-seek
It relies on the fate-lavf-flv test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:10:24 +02:00
Andreas Rheinhardt 2cd397d90d fate/lavf-container: Check earlier for presence of ffmpeg cli
Several other tests (e.g. concatdec) examine FATE_LAVF_CONTAINER
in order to enable or disable tests that depend on samples
created by the lavf-container tests; right now this procedure
did not account for CONFIG_FFMPEG.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:10:23 +02:00
Andreas Rheinhardt 7eff280599 fate/libswscale: Disable ffmpeg-dependent tests without ffmpeg
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:10:23 +02:00
Niklas Haas 9073f49e6e avcodec/dovi_rpu: attach ext blocks to frames 2024-04-03 16:16:55 +02:00
Niklas Haas f46fff27d0 avcodec/dovi_rpu: parse extension blocks
We split the inner loop between v1 and v2 extension blocks to print
a warning where an extension block was encountered in an unexpected
context.

Co-authored-by: quietvoid <tcChlisop0@gmail.com>
2024-04-03 16:16:55 +02:00
Niklas Haas 3a1916c38a avcodec/dovi_rpu: add ext_blocks array to DOVIContext 2024-04-03 16:16:55 +02:00
Niklas Haas b90c18b38c avcodec/dovi_rpu: verify RPU data CRC32
The Dolby Vision RPU contains a CRC32 to validate the payload against.
The implementation is CRC32/MPEG-2.

The CRC is only verified with the AV_EF_CRCCHECK flag.

Co-authored-by: quietvoid <tcChlisop0@gmail.com>
2024-04-03 16:16:53 +02:00
Niklas Haas a6c624f8f7 avcodec/dovi_rpu: strip container in separate step
This ensures that `gb` in the following section is fully byte-aligned,
points at the start of the actual RPU, and ends on the CRC terminator.

This is important for both calculation of the CRC, as well as dovi
extension block parsing (which aligns to byte boundaries in various
places).
2024-04-03 16:16:25 +02:00
Niklas Haas 0473270a34 avcodec/dovi_rpu: switch to AVERROR_INVALIDDATA
Instead of AVERROR(EINVAL)
2024-04-03 16:16:25 +02:00
Niklas Haas 4f55e16f2b avutil/dovi_meta: add dolby vision extension blocks
As well as accessors plus a function for allocating this struct with
extension blocks,

Definitions generously taken from quietvoid/dovi_tool, which is
assembled as a collection of various patent fragments, as well as output
by the official Dolby Vision bitstream verifier tool.
2024-04-03 16:16:25 +02:00
quietvoid 78076ede29 avutil/dovi_meta: add AVDOVIDataMapping.nlq_pivots
The NLQ pivots are not documented but should be present in the header
for profile 7 RPU format. It has been verified using Dolby's
verification toolkit.

Signed-off-by: quietvoid <tcChlisop0@gmail.com>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-04-03 16:16:23 +02:00
Eugene Zemtsov 591e27d1e7 configure: Separate subsystem for Immersive Audio Model
This change allows users to build libavfomat without support
for Immersive Audio Model by specifying --disable-iamf.
It helps to save on binary size in cases where it's important.

Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: Eugene Zemtsov <eugene@chromium.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-03 09:57:52 -03:00
Haihao Xiang 1590a96adc lavc/vaapi_encode: convert from lambda to qp
When AV_CODEC_FLAG_QSCALE is set, the value of avctx->global_quality is
lambda.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-03 10:26:33 +08:00
Fei Wang 09377887df lavc/vaapi_encode: Add VAAPI version check for BLBRC
Fix build fail when VAAPI version less than 0.39.2.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-04-03 10:23:05 +08:00
Tong Wu 0faf2ca98a avcodec/d3d12va_decode: remove extra spaces for declaration
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-04-03 10:23:05 +08:00
James Almer 50458b7fa1 avformat/isom: don't drop the known layout when parsing AAC decSpecificInfo
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 20:21:13 -03:00
Michael Niedermayer d157725cf7 avformat/isom: Uninit layout in ff_mp4_read_dec_config_descr()
Fixes: memleak
Fixes: 67442/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5068813261406208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 20:20:04 -03:00
Michael Niedermayer e3984de6ff avcodec/exr: Dont use 64bits to hold 6bits
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 00:44:38 +02:00
Michael Niedermayer 589fa8a027 avcodec/exr: Check for remaining bits in huf_unpack_enc_table()
Fixes: Timeout
Fixes: 67645/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6308760977997824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 00:44:38 +02:00
Michael Niedermayer 1887ff250c avcodec/apedec: Use NABS to avoid undefined negation
Fixes: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: 67738/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5444313212321792

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 00:44:38 +02:00
Michael Niedermayer d58037c18e avcodec/hevc_ps: --typo
Fixes: null pointer dereference
Fixes: 67737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4858162608930816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 00:44:37 +02:00
Michael Niedermayer aeb13b03be tools/target_dec_fuzzer: Adjust threshold for RV30
Fixes: Timeout
Fixes: 67530/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV30_fuzzer-6635676118351872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 00:44:37 +02:00
Mark Samuelson c52869f36e avcodec/mfenc: expose more properties of the media foundation encoder 2024-04-02 21:45:47 +01:00
Marth64 2204ea00d6 doc/indevs: update CC extraction example to use RCWT muxer
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 20:09:05 +02:00
Marth64 0866b2ba5e doc/muxers: refresh the RCWT muxer's doc to be consistent with the demuxer
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 20:09:05 +02:00
Marth64 58f04608c2 avformat/rcwtenc: remove repeated documentation
The high level summary of RCWT can be delegated doc/muxers, which
makes it easier to maintain and more consistent with the documentation
of the demuxer.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 20:09:05 +02:00
Marth64 536f0239c0 avformat/rcwtenc: don't assume .bin extension
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 20:09:05 +02:00
Marth64 15406f8377 avformat/rcwtdec: add RCWT Closed Captions demuxer
RCWT (Raw Captions With Time) is a format native to ccextractor,
a commonly used OSS tool for processing 608/708 Closed Captions (CC).
RCWT can be used to archive the original extracted CC bitstream.
The muxer was added in January 2024. In this commit, add the demuxer.

One can now demux RCWT files for rendering in ccaption_dec or interop
with ccextractor (which produces RCWT). Using the muxer/demuxer combo,
the CC bits can be kept for processing or rendering with either tool.
This can be an effective way to backup an original CC stream, including
format extensions like EIA-708 and overall original presentation.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 20:08:51 +02:00
Stefano Sabatini dfd9c21754 Changelog: add next entry 2024-04-02 20:04:46 +02:00
Marth64 1c35333671 avformat/subtitles: extend ff_subtitles_queue_insert() to support not yet available events
If ff_subtitles_queue_insert() were given a NULL buffer
with 0 length, it would still attempt to grow the packet
or memcpy depending on if merge option is enabled.

In this commit, allow passing a NULL buffer with 0 length
without attempting to do such operations. This way, if a
subtitle demuxer happens to pass an empty cue or wants to
use av_get_packet() to read bytes, there are no unnecessary
operations on the packet after it is allocated.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 19:59:01 +02:00
Nicolas Gaullier ed9363052f avformat/demux: add duration_probesize AVOption
Yet another probesize used to get the durations when
estimate_timings_from_pts is required. It is aimed at users interested
in better durations probing for itself, or because using
avformat_find_stream_info indirectly and requiring exact values: for
concatdec for example, especially if streamcopying above it.
The current code is a performance trade-off that can fail to get video
stream durations in a scenario with high bitrates and buffering for
files ending cleanly (as opposed to live captures): the physical gap
between the last video packet and the last audio packet is very high in
such a case.

Default behaviour is unchanged: 250k up to 250k << 6 (step by step).
Setting this new option has two effects:
- override the maximum probesize (currently 250k << 6)
- reduce the number of steps to 1 instead of 6, this is to avoid
detecting the audio "too early" and failing to reach a video packet.
Even if a single audio stream duration is found but not the other
audio/video stream durations, there will be a retry, so at the end the
full user-overriden probesize will be used as expected by the user.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
2024-04-02 19:53:40 +02:00
Stefano Sabatini 13cdef9d45 doc/muxers: add ircam
Most of the content copy&pasted from:
http://fileformats.archiveteam.org/wiki/Berkeley/IRCAM/Carl_Sound_Format
2024-04-02 19:48:29 +02:00
Stefano Sabatini 026bef7771 doc/muxers/image2: add mention to image2pipe
Clarify the difference with regards to the image2 muxer.
2024-04-02 19:48:28 +02:00
Stefano Sabatini 827889d8f3 doc/muxers/image2: apply misc consistency fixes 2024-04-02 19:48:28 +02:00
Stefano Sabatini b5488392f0 doc/muxers: add ilbc 2024-04-02 19:48:28 +02:00
Stefano Sabatini 3e4f0b07de doc/muxers: add stub for iamf 2024-04-02 19:48:28 +02:00
Stefano Sabatini 06f17cc9ce doc/muxers/hls: review, apply consistency fixes
Apply misc typo fixes, consistency fixes, and reformat the layout to provide more overall
internal and global consistency.
2024-04-02 19:48:28 +02:00
James Almer 8f85f657d7 RELEASE: update after 7.0 branch
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 13:02:39 -03:00
James Almer 6e52223f3a fate/vvc: add vvc-conformance-IBC_B_Tencent_2
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 12:34:26 -03:00
James Almer e60d4913ae fate/vvc: add vvc-conformance-SUBPIC_C_ERICSSON_1
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 12:15:03 -03:00
James Almer e9778d20a4 fate/vvc: disable vvc-conformance-OPI_B_3 and vvc-conformance-VPS_A_3
Both samples rely on a feature our decoder doesn't currently support.

Should fix fate failures on some systems where not even the one single frame
could be generated.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 11:50:08 -03:00
James Almer 45b56455ad avcodec/vvc_refs: don't ask for a "Inter layer ref" sample
The FATE suite has two already.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 11:48:32 -03:00
Nuo Mi 238bb653e7 avcodec/vvcdec: inter prediction, support subpicture
passed files:
    LMCS_B_Dolby_2.bit
    CodingToolsSets_E_Tencent_1.bit
    SUBPIC_A_HUAWEI_3.bit
    SUBPIC_B_HUAWEI_3.bit
    SUBPIC_C_ERICSSON_1.bit
    SUBPIC_D_ERICSSON_1.bit
    SUBPIC_E_MediaTek_1.bit

passed dvb conformance files (https://dvb.org/specifications/verification-validation/vvc-test-content):
    VVC_HDR_UHDTV1_OpenGOP_3840x2160_50fps_HLG10_mosaic.bit
    VVC_HDR_UHDTV1_OpenGOP_3840x2160_50fps_HLG10_PiP.bit
2024-04-02 20:56:22 +08:00
Nuo Mi 9bc3f3e5fc avcodec/vvcdec: mvs, support subpicture 2024-04-02 20:56:22 +08:00
Nuo Mi adeb51c30f avcodec/vvcdec: alf, support subpicture 2024-04-02 20:56:22 +08:00
Nuo Mi bbf0ccb8e7 avcodec/vvcdec: sao, support subpicture 2024-04-02 20:56:22 +08:00
Nuo Mi 0c3018b30a avcodec/vvcdec: sao, refact out tile_edge arrays 2024-04-02 20:56:22 +08:00
Nuo Mi c9e75393ed avcodec/vvcdec: refact, movie the lc->sc assignment to task_run_stage to simplify the code
This change also make the lc->sc assigned for run_sao
2024-04-02 20:56:22 +08:00
Nuo Mi 8b7304247a avcodec/vvcdec: deblock, support subpicture 2024-04-02 20:56:22 +08:00
Nuo Mi 0d12e9c3c8 avcodec/vvcdec: refact out deblock_is_boundary 2024-04-02 20:56:22 +08:00
Nuo Mi 4020e68d73 avcodec/vvcdec: misc, rename x_ctb, y_ctb, ctu_x, ctu_y to rx, ry to avoid misleading 2024-04-02 20:56:22 +08:00
Nuo Mi 260130aae8 avcodec/vvcdec: ff_vvc_decode_neighbour, support subpicture 2024-04-02 20:56:22 +08:00
Nuo Mi 4e47847119 avcodec/vvcdec: derive subpic position for PPS 2024-04-02 20:56:03 +08:00
Frank Plowman 8078a0b0fa avcodec/vvcdec: support rectangular single-slice subpics
Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
2024-04-02 20:24:31 +08:00
Frank Plowman 9c845e9087 avcodec/vvcdec: fix uninitialized last element of xxx_bd and ctb_to_xxx_bd arrays
see "6.5.1 CTB raster scanning, tile scanning, and subpicture scanning processes"

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
2024-04-02 20:24:31 +08:00
Nuo Mi 64d5cc67cd avcodec/vvcdec: misc, add specification name for pps members 2024-04-02 20:24:31 +08:00
Nuo Mi 191fbd7ddc avcodec/cbs_h266: fix sh_collocated_from_l0_flag and sh_collocated_ref_idx infer
we have to infer sh_collocated_from_l0_flag and sh_collocated_ref_idx from picture head if pps_rpl_info_in_ph_flag is true
2024-04-02 20:24:31 +08:00
Nuo Mi cd540a333e avcodec/vvcdec: NoBackwardPredFlag, only check active pictures
see "8.3.6 Decoding process for collocated picture and no backward prediction"
2024-04-02 20:24:31 +08:00
James Almer 8e294abd9d avformat/mov: simplify the entry count overflow check in the keys atom
Suggested-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 09:09:35 -03:00
James Almer 5a06d3810e avformat/mov: don't read key_size bytes twice in the keys atom
We only support mdta as type, yet we were not skipping other types,
but rather reading key_size worth of bytes twice per entry.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 00:16:31 -03:00
James Almer 3d12ba77d9 avformat/mov: take into account the first eight bytes in the keys atom
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 00:13:12 -03:00
Eugene Zemtsov 8a23a145d8 avformat/mov: Check if a key is longer than the atom containing it
Stop reading keys and return AVERROR_INVALIDDATA if key_size
is larger than the amount of space left in the atom.

Bug: https://crbug.com/41496983
Signed-off-by: Eugene Zemtsov <eugene@chromium.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 00:13:12 -03:00
Andreas Rheinhardt 9d219ff149 avformat/mov: Don't add attached pic if one is already present
Fixes: memleak
Fixes: 67714/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5671570999476224

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 04:13:44 +02:00
James Almer f492f1ac23 avformat/mov: ensure all items id referenced by a grid are valid
Fixes: null pointer dereference
Fixes: 67494/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6528714521247744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-01 21:13:04 -03:00
Andreas Rheinhardt a8e518e3a7 avcodec/vlc: Use union of uint8_t and uint16_t in VLC_MULTI_ELEM
It is more natural and simplifies writing these arrays.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:59 +02:00
Andreas Rheinhardt 4ab82d2fb6 avcodec/vlc, bitstream: Fix multi VLC with uint8_t syms on BE
VLC_MULTI_ELEM contains an uint8_t array that is supposed
to be treated as an array of uint16_t when the used symbols
have a size of two; otherwise it should be treated as just
an array of uint8_t, but it was not always treated that way:

vlc_multi_gen() initialized the first entry of the array
by writing the symbol via AV_WN16; on big endian systems,
the intended value was instead written into the second entry
of the array (where it would likely be overwritten lateron
during initialization).

read_vlc_multi() also treated this case incorrectly: In case
the code is so long that it needs a classical multi-stage lookup,
the symbol has been written to the destination as if via AV_WN16.
On little endian systems, this sets the correct first symbol and
clobbers (zeroes) the next one, but the next one will be overwritten
lateron anyway, so it won't be recognized. But on big-endian systems,
the first symbol will be set to zero and the actually read symbol
will be put into the slot for the next one (where it will be overwritten
lateron).

This commit fixes this; this fixes the magicyuv and utvideo FATE-tests
on big endian arches.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:59 +02:00
Andreas Rheinhardt 098f5e2634 fate/fits: Fix tests on BE
The fits decoder decodes to native pixel formats; so
the fitsdec-gbrap16be fate test failed on BE despite
its name because the reference file is LE.
This patch fixes this by forcing a pixel format;
the forced pixel format is BE, causing a change
in the reference file.
The fitsdec-gbrp16be test was not affected, because
its source file (lena-rgb48.png from tne FATE suite)
is actually biendian (as if someone had multiplied
8bit content by 257...).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:59 +02:00
Andreas Rheinhardt 579868f810 fate/filter-video: Insert scale, format filters in filter-yadif,bwdif10
The format and the first scale filter ensures that the filter
processing actually happens in high bit depth; the second
scale filter is only necessary for big endian arches.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt 1b684a1527 fate/filter-video: Always use little endian pixel format
Fixes filter-metadata-signalstats-yuv420p10 on BE arches.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt d5897f70d4 fate/video: Only use bitexact IDCT in avid meridian
Precludes the usage of the altivec IDCT which fixes
the avid-meridian FATE test on ppc64be here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt 8ecd383122 avcodec/huffyuvencdsp: Fix load of misaligned values
Affected many ffvhuff FATE tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt 3ed23dab98 avfilter/vf_spp: Fix left-shift of negative value
Affected the vf-spp FATE-test (on x86 only when MMX
is disabled).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt 9e4e8ae1e6 avcodec/pngdsp: Fix unaligned accesses, effective type violations
Affected the lscr fate-test (only visible on x86 if
the SSE2 is disabled).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt 356610a2ac avcodec/ppc/hpeldsp_altivec: Fix left-shift of negative number
It is UB and affected e.g. the vp5 and vp61 FATE tests:
https://fate.ffmpeg.org/report.cgi?time=20240327083327&slot=ppc-linux-gcc-13.2-ubsan-altivec-qemu

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
David Rosca 3f863f089c lavc/vaapi_encode_av1: Set roi_quant_range 2024-04-01 20:08:11 +01:00
Michael Niedermayer 84ce5ced31 avcodec/vvc/vvcdec: Do not submit frames without VVCFrameThread
Such frames will crash when pthread functions are called on the NULL pointer

Fixes: member access within null pointer of type 'VVCFrameThread' (aka 'struct VVCFrameThread')
Fixes: 65160/clusterfuzz-testcase-minimized-ffmpeg_BSF_VVC_METADATA_fuzzer-4665241535119360 (partly)
Fixes: 65636/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-5394745824182272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 19:05:31 +02:00
Michael Niedermayer cb9752d897 avformat/mpegts: Reset local nb_prg on add_program() failure
add_program() will deallocate the whole array on failure so
we must clear nb_prgs

Fixes: null pointer dereference
Fixes: crash-35a3b39ddcc5babeeb005b7399a3a1217c8781bc

Found-by: Catena cyber
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 19:03:06 +02:00
Michael Niedermayer c0532f5579 avcodec/iff: dont add into unused pointers
Fixes: overflowing pointers
Fixes: 66444/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-4812862400823296

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 19:00:30 +02:00
Michael Niedermayer 23b29f72ee avformat/aiffdec: Check for previously set channels
Fixes: out of array access (av_channel_layout_copy())
Fixes: 67087/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-4920720268263424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:59:07 +02:00
Michael Niedermayer f30fe5e8d0 avformat/mxfdec: Make edit_unit_byte_count unsigned
Suggested-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:52:38 +02:00
Michael Niedermayer d88c284c18 avformat/movenc: Check that cts fits in 32bit
Fixes: Assertion av_rescale_rnd(start_dts, mov->movie_timescale, track->timescale, AV_ROUND_DOWN) <= 0 failed at libavformat/movenc.c:3694
Fixes: poc2

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:51:59 +02:00
James Almer 0a693bce62 avformat/iamf_parse: keep count_label consistent on language_label allocation failure
Fixes: null pointer dereference
Fixes: 67023/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6011025237278720

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:28 +02:00
Michael Niedermayer f26ee6e066 avformat/iamf_reader: Check len before summing
Fixes: integer overflow
Fixes: 67275/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5438920751906816
Fixes: 67688/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5970342318243840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:28 +02:00
Michael Niedermayer d6ed6f6e8d avformat/mxfdec: Check first case of offset_temp computation for overflow
This is kind of ugly
Fixes: signed integer overflow: 255 * 1157565362826411919 cannot be represented in type 'long'
Fixes: 67313/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6250434245230592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:28 +02:00
Michael Niedermayer 7b7eea8e63 avcodec/jpeg2000htdec: warn about non zero roi shift
Suggested-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:27 +02:00
Michael Niedermayer 19ad05e9e0 avcodec/jpeg2000htdec: Check magp before using it in a shift
Fixes: shift exponent -1 is negative
Fixes: 65378/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5457678193197056

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:27 +02:00
Anton Khirnov 63f56c9943 doc/community: update conflict of interest rule according to GA vote 2024-04-01 15:38:28 +02:00
Zhao Zhili 7bf85d2d3a avcodec/h264_parse: Fix error code in decode_extradata
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-01 17:05:21 +08:00
Timo Rothenpieler 271a0a55bc avcodec/nvenc: provide nvenc with monotonic frame index 2024-04-01 00:46:12 +02:00
Timo Rothenpieler c06e9e289f avcodec/nvenc: update minimum driver version list 2024-03-31 21:43:38 +02:00
Timo Rothenpieler 21b4708969 avcodec/nvenc: add support for unidirectional b-frames 2024-03-31 21:32:55 +02:00
Timo Rothenpieler a270966118 avcodec/nvenc: add support for uhq tune 2024-03-31 21:17:11 +02:00
Timo Rothenpieler 77d23bcb1b avcodec/nvenc: add support for lookahead_level 2024-03-31 20:58:27 +02:00
Timo Rothenpieler 64e3fc9069 avcodec/nvenc: add support for HEVC temporal filtering 2024-03-31 20:47:59 +02:00
Timo Rothenpieler 06c2a2c425 avcodec/nvenc: support SDK 12.2 bit depth API 2024-03-31 19:10:49 +02:00
Timo Rothenpieler 43b417d516 avcodec/nvenc: stop using long deprecated format specifiers 2024-03-31 19:10:49 +02:00
Andreas Rheinhardt 199c479b9a avcodec/arm/vp8: Don't discard const
Forgotten in 25e1986e68.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt 0e5f71230a avutil/internal: Move avpriv_set_systematic_pal2 decl to imgutils_internal.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt 888e2c0a85 avutil/hwcontext_vulkan: Include hwcontext.h
struct Foo * declares a new type (namely struct Foo)
if there is no declaration of struct Foo already visible
in the current scope; otherwise it is just a pointer to
an element of the already declared type "struct Foo".
There is a gotcha with the first case:
struct Foo is only declared in its scope; a later declaration
of struct Foo in an enclosing scope declares a different type.

This happens in hwcontext_vulkan.h if it is included before
hwcontext.h, because some declarations of struct AVHWDeviceContext
and struct AVHWFramesContext have function prototype scope.

Compilers warn about this (during checkheaders):
‘struct AVHWDeviceContext’ declared inside parameter list will not
be visible outside of this definition or declaration

Fix this by including hwcontext.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt 0f78b26e9c avutil/internal: Move FF_MEMORY_POISON to its only user
Namely mem.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt 8041a91a32 avutil/internal: Move libm inclusion to the beginning
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt e4e6377afc avcodec/arm/mpegvideo_arm: Use static_assert to check offsets
Also move AV_CHECK_OFFSET to its only user, namely
lavc/arm/mpegvideo_arm.c and rename it to CHECK_OFFSET.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt 790f793844 avutil/common: Don't auto-include mem.h
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.

Keep it for external users in order to not cause breakages.

Also improve the other headers a bit while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt b616be1649 lib*/version: Use static_assert for static asserts
Also update the checks that guard against inserting
a new enum entry in the middle of a range.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt 2d38141ea6 swscale/swscale_internal: Don't export internal function
sws_alloc_set_opts() can actually be made internal to utils.c.
This commit does so.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt ad1cef04a9 swscale/swscale_internal: Hoist branch out of loop
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt c8549d480f avcodec/msmpeg4: Don't include x86-specific header unconditionally
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt a265e8ca92 avcodec, avfilter: Don't use "" for system headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt b49e621c83 swscale/ppc/swscale_altivec: Simplify macro
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt 72f4f1dafb swscale/ppc/swscale_altivec: Fix build with -O0
In this case GCC does not treat a const variable initialized
to the compile-time constant "3" as a compile-time constant
and errors out because the argument is not a literal value.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt 347a70f101 avcodec/pcm-bluray/dvd: Use correct pointer types on BE
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt cd63dab55c avcodec/mips/ac3dsp_mips: Add missing includes
Likely broken in d7a75d2163.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Marton Balint 2df2b4067e avfilter/buffersrc: fix overriding unknown channel layouts with negotiated one
Fixes ffplay playback of unknown layouts, when SDL directly supports the audio
format, such as:

ffplay -f lavfi anullsrc=cl=2C,aformat=s16

Without the patch, "Channel layout change is not supported" errors are
generated because buffersrc (unknown 2 channel) and buffersink (stereo)
negotiated a stereo layout, but the stereo layout was never stored in the
BufferSourceContext.

This fixes a regression of 7251f90972, but this
is more of a regression of the avfilter channel layout conversion
(1f96db959c).

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-30 20:59:15 +01:00
Andreas Rheinhardt ff215d9559 fate/image: Fix EXR tests on big endian
These tests need a scale filter to convert to the prescribed
pixel format (the native format is endian-dependent).

Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 20:33:56 +01:00
James Almer e37b233ee2 Revert "avformat/mov: ignore item boxes for animated heif"
This reverts commit f6b7b473d4.
The image in the item boxes and the animation in the trak box are not
necessarely the same, so both should be exported.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-30 12:25:59 -03:00
James Almer f8fbec8686 avutil/frame: use the same data information as the source entry when cloning side data
src->{data,size} does not need to match src->buf->{data,size}.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-30 10:15:02 -03:00
Andreas Rheinhardt ba7980d9c0 avutil/opt: Avoid av_uninit
GCC 9-13 do not emit warnings for this at all optimization
levels even when -Wmaybe-uninitialized is not disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt dc7a60529c avcodec/ratecontrol: Use forward declaration for AVExpr
Avoids including eval.h everywhere where mpegvideo.h
is included.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt 348461e550 avcodec/h264_refs: Use smaller scope, don't use av_uninit
In particular, declare iterators with loop scope.
Also remove av_uninit while at it, because they
are now unnecessary due to the changes of the preceding
commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt ac14d68277 avcodec/h264_refs: Rewrite code to make control flow clearer
While this change IMO makes the control flow clearer
for the human reader, it is especially important for
GCC: It erroneously believes that it is possible to
enter the SHORT2(UNUSED|LONG) cases without having
entered the preceding block that initializes pic,
frame_num, structure and j; it would emit -Wmaybe-uninitialized
warnings for these variables if they were not pseudo-
initialized with av_uninit(). This patch allows to remove
the latter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt 4b44b5eaf0 swscale/swscale_internal: Only include altivec header iff HAVE_ALTIVEC
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:04:41 +01:00
Andreas Rheinhardt 7d9d400695 postproc/postprocess: Don't generally include arch-specific headers
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:04:27 +01:00
Sean McGovern f63a87629e fate: fix sub2video_{basic, time_limited} on big-endian targets
The reference file uses BGRA pixel format, so request it here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:03:43 +01:00
Timo Rothenpieler e99c273fec avcodec/nvdec: reset bitstream_len/nb_slices when resetting bitstream pointer 2024-03-30 00:12:23 +01:00
James Almer 547c920193 avcodec/hevc_ps: don't use a fixed sized buffer for parameter set raw data
Allocate it instead, and use it to compare sets instead of the parsed struct.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-29 15:34:21 -03:00
Tong Wu 6bf17136a2 avcodec/hevc_ps: fix the problem of memcmp losing effectiveness
HEVCHdrParams* receives a pointer which points to a dynamically
allocated memory block. It causes the memcmp always returning 1.
Add a function to do the comparision. A condition is also added to
avoid malloc(0).

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-29 12:35:54 -03:00
Anton Khirnov fa110c32b5 lavfi/setpts: unset frame durations
Actual frame durations are, in general, not computable without buffering
a frame.

FIxes #10886
2024-03-29 09:09:40 +01:00
Anton Khirnov f121d954ac lavf/vf_setpts: unset output framerate
This filter produces VFR output in general.

Avoids dropping frames in the setpts test.
2024-03-29 09:07:13 +01:00
Anton Khirnov c240ff98b3 lavc/packet: schedule AV_PKT_DATA_QUALITY_FACTOR for removal
It is unused internally and has been marked as deprecated a long time
ago.
2024-03-29 09:01:54 +01:00
Anton Khirnov 1d843ae6c7 lavc: rename avpacket.c to packet.c
For consistency with its API header packet.h.
2024-03-29 09:01:54 +01:00
Anton Khirnov 24b9f29ff2 fftools/ffmpeg_sched: make sure to always run task cleanup
Even in cases where sch_start() failed. This ensures all links are
properly closed and no tasks are left hanging.

Fixes #10916.
2024-03-29 08:51:12 +01:00
Anton Khirnov af81788f30 fftools/ffmpeg_sched: move sch_stop() to the bottom of the file
Will allow avoiding forward declarations in following commits.
2024-03-29 08:51:12 +01:00
Andreas Rheinhardt 8d1093a784 avcodec/libvpxenc: Remove obsolete av_unused
Forgotten in 753074721b.

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-29 00:58:05 +01:00
Andreas Rheinhardt 1093b40218 avcodec/libvpxenc: Only search for side data when intending to use it
Also rewrite the code so that a variable that is only used
depending upon CONFIG_LIBVPX_VP9_ENCODER is not declared
outside of the #if block.
(The variable was declared with av_uninit, but it should have been
av_unused, as the former does not work for all compilers.)

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-29 00:45:17 +01:00
Andreas Rheinhardt e465cebfee avcodec/Makefile: Remove redundant dependencies on hevc_data.o
hevc_data.c only provides ff_hevc_diag_scan tables and
neither the QSV HEVC encoder nor the HEVC parser use these
directly and the indirect dependency is already accounted
for in the dependencies of the hevcparse subsystem since
b0c61209cd, so remove these
spurious dependencies.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-29 00:39:11 +01:00
James Almer e54591369f avformat/flac_picture: print a warning when mimetype is unknown
It's not an error since bba6df9ac7.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-28 18:00:34 -03:00
Michael Niedermayer 3d5f03bbc8 avfilter/vf_signature: Dont crash on no frames
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-03-28 18:07:13 +01:00
Dale Curtis bba6df9ac7 Don't throw an error when attached picture isn't recognized.
The MIME type field is required per the FLAC standard, but it's
not an error just because ffmpeg doesn't recognize it.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-03-28 18:07:13 +01:00
Tobias Rapp 02eb2fc577 examples/decode_filter_video: Add loop for draining the filtergraph
Depending on the filters used, the filtergraph may produce trailing data
after feeding it the last input frame. Update the example to include the
necessary loop for draining the filtergraph.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2024-03-28 12:04:09 +01:00
Tobias Rapp 55ce666062 examples/decode_filter_audio: Add loop for draining the filtergraph
Depending on the filters used, the filtergraph may produce trailing data
after feeding it the last input frame. Update the example to include the
necessary loop for draining the filtergraph.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2024-03-28 12:03:57 +01:00
Tobias Rapp 94ebe604b0 tests/audiogen: Fix total RIFF chunk size
The "RIFF" identifier and chunk size fields should not be included
within the size value.
2024-03-28 11:54:41 +01:00
Andreas Rheinhardt 5d71f97e0e all: Don't use ATOMIC_VAR_INIT
C11 required to use ATOMIC_VAR_INIT to statically initialize
atomic objects with static storage duration. Yet this macro
was unsuitable for initializing structures [1] and was actually
unneeded for all known implementations (this includes our
compatibility fallback implementations which simply wrap the value
in parentheses: #define ATOMIC_VAR_INIT(value) (value)).
Therefore C17 deprecated the macro and C23 actually removed it [2].

Since commit 5ff0eb34d2 we default
to C17 if the compiler supports it; Clang warns about ATOMIC_VAR_INIT
in this mode. Given that no implementation ever needed this macro,
this commit stops using it to avoid this warning.

[1]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2396.htm#dr_485
[2]: https://en.cppreference.com/w/c/atomic/ATOMIC_VAR_INIT

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 09:12:48 +01:00
Anton Khirnov a69cedb6a6 fftools/ffmpeg_demux: make InputStream.autorotate private
It is no longer accessed outside of ffmpeg_demux.
2024-03-28 08:40:11 +01:00
Anton Khirnov c9a90c052a fftools/ffmpeg_enc: stop copying demuxer side data to the muxer
All side data should be propagated through the trancoding pipeline.
2024-03-28 08:40:11 +01:00
Anton Khirnov e0de84ad2e lavc/encode: map AVCodecContext.decoded_side_data to coded_side_data
This way it can be automagically propagated through the encoder to
muxing.
2024-03-28 08:40:11 +01:00
Anton Khirnov a3f4670943 lavc/decode: move sd_global_map to avcodec
It will be shared with encoding code.
2024-03-28 08:40:01 +01:00
Anton Khirnov e1f384adbf lavc/frame_thread_encoder: avoid assigning a whole AVCodecContext
It is highly unsafe, as AVCodecContext contains many allocated fields.
Almost everything needed by worker threads should be covered by
routing through AVCodecParameters and av_opt_copy(), except for a few
fields that are copied manually.

avcodec_free_context() can now be used for per-thread contexts.
2024-03-28 08:40:01 +01:00
Anton Khirnov 198a7788e7 lavc: avoid leaking AVCodecContext.chroma_intra_matrix 2024-03-28 08:40:01 +01:00
Anton Khirnov 106131bb10 fftools/ffmpeg_filter: remove display matrix if we have applied it 2024-03-28 08:40:01 +01:00
Anton Khirnov b1aaa1f585 fftools/ffmpeg_dec: apply cropping manually
lavfi does not require aligned buffers, so we can safely apply top/left
cropping by any amount, without passing any special flags to lavc.
Longer term, an even better solution would probably be auto-inserting
the crop filter (or its hwaccel versions) as needed.

Multiple FATE tests no longer need -flags unaligned.
2024-03-28 08:40:01 +01:00
Anton Khirnov 0edbd00ccf fftools/ffmpeg_{demux,dec}: pass -bitexact through DecoderFlags
Avoids abusing AV_DICT_MULTIKEY and relying on undocumented AVDictionary
ordering behaviour.
2024-03-28 08:40:01 +01:00
Anton Khirnov 372c78dd42 fftools/ffmpeg_dec: apply decoder options manually
Do not pass an options dictionary to avcodec_open2().

This should be equivalent to current behaviour, but will allow
overriding caller-supplied options in a cleaner and more robust manner.

We can now set the COPY_OPAQUE flag directly rather going through
dec_opts.
2024-03-28 08:40:01 +01:00
Anton Khirnov 2d06a7570e fftools/cmdutils: do not use a random codec's private options
There is only a single caller of filter_codec_opts() that passes
a NULL codec to it, which is streamcopy in ffmpeg CLI. In that case we
only want generic AVCodecContext options, not private options of any
specific encoder.
2024-03-28 08:40:01 +01:00
Anton Khirnov da67816128 fftools/ffmpeg_demux: only call filter_codec_opts() when we have a decoder
It is pointless otherwise, as decoder options will not be used.
2024-03-28 08:40:01 +01:00
Anton Khirnov 56320880f7 doc/ffmpeg: mention how to pass options to loopback decoders 2024-03-28 08:39:19 +01:00
Andreas Rheinhardt b9297128f5 avutil/tests/.gitignore: Add side_data_array
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:37:42 +01:00
Andreas Rheinhardt c85477f78d avutil/opt: Don't cast when the result might be misaligned
A pointer conversion is UB if the resulting pointer is not
correctly aligned for the resultant type, even if no
load/store is ever performed through that pointer (C11 6.3.2.3 (7)).

This may happen in opt_copy_elem(), because the pointers are
converted even when they belong to a type that does not guarantee
sufficient alignment.

Fix this by deferring the cast after having checked the type.
Also make the casts -Wcast-qual safe and avoid an indirection
for src.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:08:01 +01:00
Andreas Rheinhardt aa7d6520e6 avutil/opt: Avoid av_strdup(NULL)
It is not documented to be safe and in any case it is nonsense:
Currently av_strdup(NULL) returns NULL and in order to distinguish
this from a genuine allocation failure, opt_copy_elem()
checked afterwards whether src was actually NULL. But then one
can simply check in advance whether one should call av_strdup()
at all.
set_string() was even worse and returned ENOMEM in case the value
to be duplicated is NULL; this only worked because
av_opt_set_defaults2() does not check the return value at all
(given that it can't propagate it).

These two places account for 389114 of 390356 av_strdup(NULL)
calls during one FATE run.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:08:01 +01:00
Andreas Rheinhardt 686d33a6b0 avcodec/profiles: Don't include avcodec.h
Forgotten in 8238bc0b5e.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:08:01 +01:00
Andreas Rheinhardt 33b1c7ebbf avcodec/magicyuvenc: Don't call functions twice due to macro
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:08:01 +01:00
Andreas Rheinhardt 8013574e9b avcodec/mjpegenc: Inline chroma subsampling
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:08:00 +01:00
Andreas Rheinhardt 0b212f3595 avcodec/bfi: Remove unused AVCodecContext* from context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:06:13 +01:00
Andreas Rheinhardt 6edd83c0e2 avcodec/ratecontrol: Avoid function pointer casts
It is undefined behaviour to call a function with a different
signature for the call than the actual function signature;
there are no exceptions for void* and RateControlEntry*.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:06:13 +01:00
Andreas Rheinhardt 641850f67f avcodec/wmaprodec: Explicitly return 0 on success
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:06:13 +01:00
Andreas Rheinhardt 432e287e27 fftools/ffmpeg_sched: Explicitly return 0 on sch_enc_send() success
Do not return the return value of the last enc_send_to_dst()
call, as this would treat the last call differently from the
earlier calls; furthermore, sch_enc_send() explicitly documents
to always return 0 on success.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:06:13 +01:00
Niklas Haas b89ee26539 avfilter: properly reduce YUV colorspace format lists
Doing this with REDUCE_FORMATS() instead of swap_color_*() is not only
shorter, but more importantly comes with the benefit of being done
inside a loop, allowing us to correctly propagate complex graphs
involving multiple conversion filters (e.g. -vf scale,zscale).

The latter family of swapping functions is only used to settle the
best *remaining* entry if no exact match was found, and as such was
never the correct solution to YUV colorspaces, which only care about
exact matches.
2024-03-27 19:11:27 +01:00
James Almer 189c32f536 avformat/mov: don't abort on duplicate Mastering Display Metadata boxes
The VP9 spec defines a SmDm box for this information, and the ISOBMFF spec defines a
mdvc one. If both are present, just ignore one of them.
This is in line with clli and CoLL boxes.

Fixes ticket #10711.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-27 13:51:28 -03:00
Andreas Rheinhardt 8ca57fcf9e avutil/fifo, file: Remove unused headers
Forgotten in 4105899245,
4c92fc02f8.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-27 17:07:22 +01:00
Andreas Rheinhardt 9223c92c88 doc/examples: Always use <> includes
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-27 17:07:06 +01:00
Zhao Zhili 89e9486bc3 avcodec/h264_mp4toannexb: Fix heap buffer overflow
Fixes: out of array write
Fixes: 64407/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_MP4TOANNEXB_fuzzer-4966763443650560

mp4toannexb_filter counts the number of bytes needed in the first
pass and allocate the memory, then do memcpy in the second pass.
Update sps/pps size in the loop makes the count invalid in the
case of SPS/PPS occur after IDR slice. This patch process in-band
SPS/PPS before the two pass loops.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-27 20:04:40 +08:00
Zhao Zhili edb1f1bc09 tests: Remove fate-libx265-hdr10
The test depends on the compile option of x265. It failed when
HIGH_BIT_DEPTH isn't enabled. It also failed when asan is enabled
because of memory issue inside of x265, which I don't think can
be fixed within FFmpeg.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-27 20:04:40 +08:00
Anton Khirnov 8fc1e1358b fftools/ffmpeg_enc: simplify error handling for decoded_side_data setup
There is no need to free the already-added items, they will be freed
alongside the codec context. There is also little point in an error
message, as the only reason this can fail is malloc failure.
2024-03-27 11:36:21 +01:00
Anton Khirnov 6f2cb0923c fftools/ffmpeg_enc: move decoded_side_data setup out of video-only block
Nothing about this code is video-specific.
2024-03-27 11:36:20 +01:00
Anton Khirnov fabf148578 fftools/ffmpeg_enc: only promote first frame side data to global when meaningful
Skip those side data types that do not make sense as global side data.
2024-03-27 11:35:27 +01:00
Anton Khirnov 2621be3539 lavu/frame: add side data descriptors
They allow exporting extended information about side data types.
2024-03-27 11:33:45 +01:00
2363 changed files with 87559 additions and 40456 deletions
+2
View File
@@ -24,3 +24,5 @@ rcombs <rcombs@rcombs.me> <rodger.combs@gmail.com>
<lq@chinaffmpeg.org> <liuqi05@kuaishou.com>
<ruiling.song83@gmail.com> <ruiling.song@intel.com>
Cosmin Stejerean <cosmin@cosmin.at> Cosmin Stejerean via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
<wutong1208@outlook.com> <tong1.wu-at-intel.com@ffmpeg.org>
<wutong1208@outlook.com> <tong1.wu@intel.com>
-30
View File
@@ -1,30 +0,0 @@
language: c
sudo: false
os:
- linux
- osx
addons:
apt:
packages:
- nasm
- diffutils
compiler:
- clang
- gcc
matrix:
exclude:
- os: osx
compiler: gcc
cache:
directories:
- ffmpeg-samples
before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install nasm; fi
script:
- mkdir -p ffmpeg-samples
- ./configure --samples=ffmpeg-samples --cc=$CC
- make -j 8
- make fate-rsync
- make check -j 8
+38 -1
View File
@@ -1,6 +1,34 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version 7.1:
- Raw Captions with Time (RCWT) closed caption demuxer
- LC3/LC3plus decoding/encoding using external library liblc3
- ffmpeg CLI filtergraph chaining
- LC3/LC3plus demuxer and muxer
- pad_vaapi, drawbox_vaapi filters
- vf_scale supports secondary ref input and framesync options
- vf_scale2ref deprecated
- qsv_params option added for QSV encoders
- VVC decoder compatible with DVB test content
- xHE-AAC decoder
- removed DEC Alpha DSP and support code
- VVC encoding support via libvvenc
- perlin video source
- D3D12VA HEVC encoder
- Cropping metadata parsing and writing in Matroska and MP4/MOV de/muxers
- Intel QSV-accelerated VVC decoding
- MediaCodec AAC/AMR-NB/AMR-WB/MP3 decoding
- YUV colorspace negotiation for codecs and filters, obsoleting the
YUVJ pixel format
- Vulkan H.264 encoder
- Vulkan H.265 encoder
- stream specifiers in fftools can now match by stream disposition
- LCEVC enhancement data exporting in H.26x and MP4/ISOBMFF
- LCEVC filter
- MV-HEVC decoding
version 7.0:
- DXV DXT1 encoder
- LEAD MCMP decoder
@@ -17,7 +45,7 @@ version 7.0:
- qrencode filter and qrencodesrc source
- quirc filter
- lavu/eval: introduce randomi() function in expressions
- VVC decoder
- VVC decoder (experimental)
- fsync filter
- Raw Captions with Time (RCWT) closed caption muxer
- ffmpeg CLI -bsf option may now be used for input as well as output
@@ -38,6 +66,15 @@ version 7.0:
- ffplay with hwaccel decoding support (depends on vulkan renderer via libplacebo)
- dnn filter libtorch backend
- Android content URIs protocol
- AOMedia Film Grain Synthesis 1 (AFGS1)
- RISC-V optimizations for AAC, FLAC, JPEG-2000, LPC, RV4.0, SVQ, VC1, VP8, and more
- Loongarch optimizations for HEVC decoding
- Important AArch64 optimizations for HEVC
- IAMF support inside MP4/ISOBMFF
- Support for HEIF/AVIF still images and tiled still images
- Dolby Vision profile 10 support in AV1
- Support for Ambient Viewing Environment metadata in MP4/ISOBMFF
- HDR10 metadata passthrough when encoding with libx264, libx265, and libsvtav1
version 6.1:
+71 -48
View File
@@ -6,10 +6,26 @@ FFmpeg code.
Please try to keep entries where you are the maintainer up to date!
Names in () mean that the maintainer currently has no time to maintain the code.
*Status*, one of the following:
[X] Old code. Something tagged obsolete generally means it has been replaced by a better system and you should be using that.
[0] No current maintainer [but maybe you could take the role as you write your new code].
[1] It has a maintainer but they don't have time to do much other than throw the odd patch in.
[2] Someone actually looks after it.
A (CC <address>) after the name means that the maintainer prefers to be CC-ed on
patches and related discussions.
(L <address>) *Mailing list* that is relevant to this area
(W <address>) *Web-page* with status/info
(B <address>) URI for where to file *bugs*. A web-page with detailed bug
filing info, a direct bug tracker link, or a mailto: URI.
(P <address>) *Subsystem Profile* document for more details submitting
patches to the given subsystem. This is either an in-tree file,
or a URI. See Documentation/maintainer/maintainer-entry-profile.rst
for details.
(T <address>) *SCM* tree type and location.
Type is one of: git, hg, quilt, stgit, topgit
Applications
============
@@ -18,10 +34,10 @@ ffmpeg:
ffmpeg.c Michael Niedermayer, Anton Khirnov
ffplay:
ffplay.c Marton Balint
ffplay.c [2] Marton Balint
ffprobe:
ffprobe.c Stefano Sabatini
ffprobe.c [2] Stefano Sabatini
Commandline utility code:
cmdutils.c, cmdutils.h Michael Niedermayer
@@ -34,25 +50,24 @@ Miscellaneous Areas
===================
documentation Stefano Sabatini, Mike Melanson, Timothy Gu, Gyan Doshi
project server day to day operations Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov
project server emergencies Árpád Gereöffy, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov
presets Robert Swain
project server day to day operations (L: root@ffmpeg.org) Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov, Timo Rothenpieler
project server emergencies (L: root@ffmpeg.org) Árpád Gereöffy, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov, Timo Rothenpieler
presets [0]
metadata subsystem Aurelien Jacobs
release management Michael Niedermayer
API tests Ludmila Glinskih
API tests [0]
Communication
=============
website Deby Barbara Lepage
fate.ffmpeg.org Timothy Gu
Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos
Patchwork Andriy Gelman
mailing lists Baptiste Coudurier
website (T: https://git.ffmpeg.org/ffmpeg-web) Deby Barbara Lepage
fate.ffmpeg.org (L: fate-admin@ffmpeg.org) (W: https://fate.ffmpeg.org) (P: https://ffmpeg.org/fate.html) (S: https://git.ffmpeg.org/fateserver) Timo Rothenpieler
Trac bug tracker (W: https://trac.ffmpeg.org) Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos
Patchwork [2] (W: https://patchwork.ffmpeg.org) Andriy Gelman
mailing lists (W: https://ffmpeg.org/contact.html#MailingLists) Baptiste Coudurier
Twitter Reynaldo H. Verdejo Pinochet
Launchpad Timothy Gu
ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, rcombs, wm4
ffmpeg-security [2] (L: ffmpeg-security@ffmpeg.org) (W: https://ffmpeg.org/security.html) Michael Niedermayer, Reimar Doeffinger
libavutil
@@ -69,22 +84,22 @@ Other:
bswap.h
des Reimar Doeffinger
dynarray.h Nicolas George
eval.c, eval.h Michael Niedermayer
eval.c, eval.h [2] Michael Niedermayer
float_dsp Loren Merritt
hash Reimar Doeffinger
hwcontext_cuda* Timo Rothenpieler
hwcontext_vulkan* Lynne
hwcontext_vulkan* [2] Lynne
intfloat* Michael Niedermayer
integer.c, integer.h Michael Niedermayer
lzo Reimar Doeffinger
mathematics.c, mathematics.h Michael Niedermayer
mem.c, mem.h Michael Niedermayer
mathematics.c, mathematics.h [2] Michael Niedermayer
mem.c, mem.h [2] Michael Niedermayer
opencl.c, opencl.h Wei Gao
opt.c, opt.h Michael Niedermayer
rational.c, rational.h Michael Niedermayer
rational.c, rational.h [2] Michael Niedermayer
rc4 Reimar Doeffinger
ripemd.c, ripemd.h James Almer
tx* Lynne
tx* [2] Lynne
libavcodec
@@ -106,20 +121,20 @@ Generic Parts:
DSP utilities:
dsputils.c, dsputils.h Michael Niedermayer
entropy coding:
rangecoder.c, rangecoder.h Michael Niedermayer
rangecoder.c, rangecoder.h [2] Michael Niedermayer
lzw.* Michael Niedermayer
floating point AAN DCT:
faandct.c, faandct.h Michael Niedermayer
faandct.c, faandct.h [2] Michael Niedermayer
Golomb coding:
golomb.c, golomb.h Michael Niedermayer
golomb.c, golomb.h [2] Michael Niedermayer
motion estimation:
motion* Michael Niedermayer
rate control:
ratecontrol.c Michael Niedermayer
ratecontrol.c [2] Michael Niedermayer
simple IDCT:
simple_idct.c, simple_idct.h Michael Niedermayer
simple_idct.c, simple_idct.h [2] Michael Niedermayer
postprocessing:
libpostproc/* Michael Niedermayer
libpostproc/* [2] Michael Niedermayer
table generation:
tableprint.c, tableprint.h Reimar Doeffinger
fixed point FFT:
@@ -127,7 +142,7 @@ Generic Parts:
Text Subtitles Clément Bœsch
Codecs:
4xm.c Michael Niedermayer
4xm.c [2] Michael Niedermayer
8bps.c Roberto Togni
8svx.c Jaikrishnan Menon
aacenc*, aaccoder.c Rostislav Pehlivanov
@@ -163,7 +178,7 @@ Codecs:
dvbsubdec.c Anshul Maheshwari
eacmv*, eaidct*, eat* Peter Ross
exif.c, exif.h Thilo Borgmann
ffv1* Michael Niedermayer
ffv1* [2] Michael Niedermayer
ffwavesynth.c Nicolas George
fifo.c Jan Sebechlebsky
flicvideo.c Mike Melanson
@@ -174,6 +189,7 @@ Codecs:
h263* Michael Niedermayer
h264* Loren Merritt, Michael Niedermayer
hap* Tom Butterworth
hevc/* Anton Khirnov
huffyuv* Michael Niedermayer
idcinvideo.c Mike Melanson
interplayvideo.c Mike Melanson
@@ -250,7 +266,7 @@ Codecs:
vp8 David Conrad, Ronald Bultje
vp9 Ronald Bultje
vqavideo.c Mike Melanson
vvc Nuo Mi
vvc [2] Nuo Mi
wmaprodec.c Sascha Sommer
wmavoice.c Ronald S. Bultje
wmv2.c Michael Niedermayer
@@ -260,6 +276,7 @@ Codecs:
Hardware acceleration:
dxva2* Hendrik Leppkes, Laurent Aimar, Steve Lhomme
d3d11va* Steve Lhomme
d3d12va_encode* Tong Wu
mediacodec* Matthieu Bouron, Aman Gupta, Zhao Zhili
vaapi* Haihao Xiang
vaapi_encode* Mark Thompson, Haihao Xiang
@@ -324,12 +341,13 @@ Filters:
vf_mestimate.c Davinder Singh
vf_minterpolate.c Davinder Singh
vf_readvitc.c Tobias Rapp (CC t.rapp at noa-archive dot com)
vf_scale.c Michael Niedermayer
vf_scale.c [2] Michael Niedermayer
vf_tonemap_opencl.c Ruiling Song
vf_yadif.c Michael Niedermayer
vf_yadif.c [2] Michael Niedermayer
vf_xfade_vulkan.c [2] Marvin Scholz (CC <epirat07@gmail.com>)
Sources:
vsrc_mandelbrot.c Michael Niedermayer
vsrc_mandelbrot.c [2] Michael Niedermayer
dnn Yejun Guo
@@ -347,7 +365,7 @@ Generic parts:
Muxers/Demuxers:
4xm.c Mike Melanson
aadec.c Vesselin Bontchev (vesselin.bontchev at yandex dot com)
adtsenc.c Robert Swain
adtsenc.c [0]
aiffdec.c Baptiste Coudurier, Matthieu Bouron
aiffenc.c Baptiste Coudurier, Matthieu Bouron
alp.c Zane van Iperen
@@ -383,6 +401,7 @@ Muxers/Demuxers:
gxf.c Reimar Doeffinger
gxfenc.c Baptiste Coudurier
hlsenc.c Christian Suloway, Steven Liu
iamf* [2] James Almer
idcin.c Mike Melanson
idroqdec.c Mike Melanson
iff.c Jaikrishnan Menon
@@ -397,9 +416,9 @@ Muxers/Demuxers:
libopenmpt.c Josh de Kock
lmlm4.c Ivo van Poorten
lxfdec.c Tomas Härdin
matroska.c Aurelien Jacobs, Andreas Rheinhardt
matroskadec.c Aurelien Jacobs, Andreas Rheinhardt
matroskaenc.c David Conrad, Andreas Rheinhardt
matroska.c Andreas Rheinhardt
matroskadec.c Andreas Rheinhardt
matroskaenc.c Andreas Rheinhardt
matroska subtitles (matroskaenc.c) John Peebles
metadata* Aurelien Jacobs
microdvd* Aurelien Jacobs
@@ -468,33 +487,34 @@ Protocols:
libzmq.c Andriy Gelman
mms*.c Ronald S. Bultje
udp.c Luca Abeni
icecast.c Marvin Scholz
icecast.c [2] Marvin Scholz (CC <epirat07@gmail.com>)
libswresample
=============
Generic parts:
audioconvert.c Michael Niedermayer
dither.c Michael Niedermayer
rematrix*.c Michael Niedermayer
swresample*.c Michael Niedermayer
audioconvert.c [2] Michael Niedermayer
dither.c [2] Michael Niedermayer
rematrix*.c [2] Michael Niedermayer
swresample*.c [2] Michael Niedermayer
Resamplers:
resample*.c Michael Niedermayer
resample*.c [2] Michael Niedermayer
soxr_resample.c Rob Sykes
Operating systems / CPU architectures
=====================================
Alpha Falk Hueffner
*BSD [2] Brad Smith
Alpha [0]
MIPS Manojkumar Bhosale, Shiyou Yin
LoongArch Shiyou Yin
LoongArch [2] Shiyou Yin
Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier
Amiga / PowerPC Colin Ward
Linux / PowerPC Lauri Kasanen
RISC-V Rémi Denis-Courmont
RISC-V [2] Rémi Denis-Courmont
Windows MinGW Alex Beregszaszi, Ramiro Polla
Windows Cygwin Victor Paesa
Windows MSVC Hendrik Leppkes
@@ -513,6 +533,7 @@ Benjamin Larsson
Bobby Bingham
Daniel Verkamp
Derek Buitenhuis
Fei Wang
Ganesh Ajjanagadde
Henrik Gramner
Ivan Uskov
@@ -535,10 +556,12 @@ wm4
Releases
========
7.0 Michael Niedermayer
6.1 Michael Niedermayer
5.1 Michael Niedermayer
4.4 Michael Niedermayer
3.4 Michael Niedermayer
2.8 Michael Niedermayer
2.7 Michael Niedermayer
2.6 Michael Niedermayer
2.5 Michael Niedermayer
If you want to maintain an older release, please contact us
+6 -1
View File
@@ -52,6 +52,9 @@ $(TOOLS): %$(EXESUF): %.o
target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
target_enc_%_fuzzer$(EXESUF): target_enc_%_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
tools/target_bsf_%_fuzzer$(EXESUF): tools/target_bsf_%_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
@@ -67,6 +70,8 @@ tools/target_io_dem_fuzzer$(EXESUF): tools/target_io_dem_fuzzer.o $(FF_DEP_LIBS)
tools/target_sws_fuzzer$(EXESUF): tools/target_sws_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
tools/target_swr_fuzzer$(EXESUF): tools/target_swr_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
tools/enum_options$(EXESUF): ELIBS = $(FF_EXTRALIBS)
tools/enum_options$(EXESUF): $(FF_DEP_LIBS)
@@ -98,7 +103,7 @@ SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
MMI-OBJS LSX-OBJS LASX-OBJS RV-OBJS RVV-OBJS \
MMI-OBJS LSX-OBJS LASX-OBJS RV-OBJS RVV-OBJS RVVB-OBJS \
OBJS SLIBOBJS SHLIBOBJS STLIBOBJS HOSTOBJS TESTOBJS
define RESET
+1 -1
View File
@@ -1 +1 @@
5.1.git
7.0.git
-173
View File
@@ -1,173 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* based on vlc_atomic.h from VLC
* Copyright (C) 2010 Rémi Denis-Courmont
*/
#ifndef COMPAT_ATOMICS_GCC_STDATOMIC_H
#define COMPAT_ATOMICS_GCC_STDATOMIC_H
#include <stddef.h>
#include <stdint.h>
#define ATOMIC_FLAG_INIT 0
#define ATOMIC_VAR_INIT(value) (value)
#define atomic_init(obj, value) \
do { \
*(obj) = (value); \
} while(0)
#define kill_dependency(y) ((void)0)
#define atomic_thread_fence(order) \
__sync_synchronize()
#define atomic_signal_fence(order) \
((void)0)
#define atomic_is_lock_free(obj) 0
typedef _Bool atomic_flag;
typedef _Bool atomic_bool;
typedef char atomic_char;
typedef signed char atomic_schar;
typedef unsigned char atomic_uchar;
typedef short atomic_short;
typedef unsigned short atomic_ushort;
typedef int atomic_int;
typedef unsigned int atomic_uint;
typedef long atomic_long;
typedef unsigned long atomic_ulong;
typedef long long atomic_llong;
typedef unsigned long long atomic_ullong;
typedef wchar_t atomic_wchar_t;
typedef int_least8_t atomic_int_least8_t;
typedef uint_least8_t atomic_uint_least8_t;
typedef int_least16_t atomic_int_least16_t;
typedef uint_least16_t atomic_uint_least16_t;
typedef int_least32_t atomic_int_least32_t;
typedef uint_least32_t atomic_uint_least32_t;
typedef int_least64_t atomic_int_least64_t;
typedef uint_least64_t atomic_uint_least64_t;
typedef int_fast8_t atomic_int_fast8_t;
typedef uint_fast8_t atomic_uint_fast8_t;
typedef int_fast16_t atomic_int_fast16_t;
typedef uint_fast16_t atomic_uint_fast16_t;
typedef int_fast32_t atomic_int_fast32_t;
typedef uint_fast32_t atomic_uint_fast32_t;
typedef int_fast64_t atomic_int_fast64_t;
typedef uint_fast64_t atomic_uint_fast64_t;
typedef intptr_t atomic_intptr_t;
typedef uintptr_t atomic_uintptr_t;
typedef size_t atomic_size_t;
typedef ptrdiff_t atomic_ptrdiff_t;
typedef intmax_t atomic_intmax_t;
typedef uintmax_t atomic_uintmax_t;
#define atomic_store(object, desired) \
do { \
*(object) = (desired); \
__sync_synchronize(); \
} while (0)
#define atomic_store_explicit(object, desired, order) \
atomic_store(object, desired)
#define atomic_load(object) \
(__sync_synchronize(), *(object))
#define atomic_load_explicit(object, order) \
atomic_load(object)
#define atomic_exchange(object, desired) \
({ \
__typeof__(object) _obj = (object); \
__typeof__(*object) _old; \
do \
_old = atomic_load(_obj); \
while (!__sync_bool_compare_and_swap(_obj, _old, (desired))); \
_old; \
})
#define atomic_exchange_explicit(object, desired, order) \
atomic_exchange(object, desired)
#define atomic_compare_exchange_strong(object, expected, desired) \
({ \
__typeof__(object) _exp = (expected); \
__typeof__(*object) _old = *_exp; \
*_exp = __sync_val_compare_and_swap((object), _old, (desired)); \
*_exp == _old; \
})
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak(object, expected, desired) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_weak(object, expected, desired)
#define atomic_fetch_add(object, operand) \
__sync_fetch_and_add(object, operand)
#define atomic_fetch_add_explicit(object, operand, order) \
atomic_fetch_add(object, operand)
#define atomic_fetch_sub(object, operand) \
__sync_fetch_and_sub(object, operand)
#define atomic_fetch_sub_explicit(object, operand, order) \
atomic_fetch_sub(object, operand)
#define atomic_fetch_or(object, operand) \
__sync_fetch_and_or(object, operand)
#define atomic_fetch_or_explicit(object, operand, order) \
atomic_fetch_or(object, operand)
#define atomic_fetch_xor(object, operand) \
__sync_fetch_and_xor(object, operand)
#define atomic_fetch_xor_explicit(object, operand, order) \
atomic_fetch_xor(object, operand)
#define atomic_fetch_and(object, operand) \
__sync_fetch_and_and(object, operand)
#define atomic_fetch_and_explicit(object, operand, order) \
atomic_fetch_and(object, operand)
#define atomic_flag_test_and_set(object) \
atomic_exchange(object, 1)
#define atomic_flag_test_and_set_explicit(object, order) \
atomic_flag_test_and_set(object)
#define atomic_flag_clear(object) \
atomic_store(object, 0)
#define atomic_flag_clear_explicit(object, order) \
atomic_flag_clear(object)
#endif /* COMPAT_ATOMICS_GCC_STDATOMIC_H */
-197
View File
@@ -1,197 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* based on vlc_atomic.h from VLC
* Copyright (C) 2010 Rémi Denis-Courmont
*/
#ifndef COMPAT_ATOMICS_PTHREAD_STDATOMIC_H
#define COMPAT_ATOMICS_PTHREAD_STDATOMIC_H
#include <stdint.h>
#define ATOMIC_FLAG_INIT 0
#define ATOMIC_VAR_INIT(value) (value)
#define atomic_init(obj, value) \
do { \
*(obj) = (value); \
} while(0)
#define kill_dependency(y) ((void)0)
#define atomic_signal_fence(order) \
((void)0)
#define atomic_is_lock_free(obj) 0
typedef intptr_t atomic_flag;
typedef intptr_t atomic_bool;
typedef intptr_t atomic_char;
typedef intptr_t atomic_schar;
typedef intptr_t atomic_uchar;
typedef intptr_t atomic_short;
typedef intptr_t atomic_ushort;
typedef intptr_t atomic_int;
typedef intptr_t atomic_uint;
typedef intptr_t atomic_long;
typedef intptr_t atomic_ulong;
typedef intptr_t atomic_llong;
typedef intptr_t atomic_ullong;
typedef intptr_t atomic_wchar_t;
typedef intptr_t atomic_int_least8_t;
typedef intptr_t atomic_uint_least8_t;
typedef intptr_t atomic_int_least16_t;
typedef intptr_t atomic_uint_least16_t;
typedef intptr_t atomic_int_least32_t;
typedef intptr_t atomic_uint_least32_t;
typedef intptr_t atomic_int_least64_t;
typedef intptr_t atomic_uint_least64_t;
typedef intptr_t atomic_int_fast8_t;
typedef intptr_t atomic_uint_fast8_t;
typedef intptr_t atomic_int_fast16_t;
typedef intptr_t atomic_uint_fast16_t;
typedef intptr_t atomic_int_fast32_t;
typedef intptr_t atomic_uint_fast32_t;
typedef intptr_t atomic_int_fast64_t;
typedef intptr_t atomic_uint_fast64_t;
typedef intptr_t atomic_intptr_t;
typedef intptr_t atomic_uintptr_t;
typedef intptr_t atomic_size_t;
typedef intptr_t atomic_ptrdiff_t;
typedef intptr_t atomic_intmax_t;
typedef intptr_t atomic_uintmax_t;
void avpriv_atomic_lock(void);
void avpriv_atomic_unlock(void);
static inline void atomic_thread_fence(int order)
{
avpriv_atomic_lock();
avpriv_atomic_unlock();
}
static inline void atomic_store(intptr_t *object, intptr_t desired)
{
avpriv_atomic_lock();
*object = desired;
avpriv_atomic_unlock();
}
#define atomic_store_explicit(object, desired, order) \
atomic_store(object, desired)
static inline intptr_t atomic_load(intptr_t *object)
{
intptr_t ret;
avpriv_atomic_lock();
ret = *object;
avpriv_atomic_unlock();
return ret;
}
#define atomic_load_explicit(object, order) \
atomic_load(object)
static inline intptr_t atomic_exchange(intptr_t *object, intptr_t desired)
{
intptr_t ret;
avpriv_atomic_lock();
ret = *object;
*object = desired;
avpriv_atomic_unlock();
return ret;
}
#define atomic_exchange_explicit(object, desired, order) \
atomic_exchange(object, desired)
static inline int atomic_compare_exchange_strong(intptr_t *object, intptr_t *expected,
intptr_t desired)
{
int ret;
avpriv_atomic_lock();
if (*object == *expected) {
ret = 1;
*object = desired;
} else {
ret = 0;
*expected = *object;
}
avpriv_atomic_unlock();
return ret;
}
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak(object, expected, desired) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_weak(object, expected, desired)
#define FETCH_MODIFY(opname, op) \
static inline intptr_t atomic_fetch_ ## opname(intptr_t *object, intptr_t operand) \
{ \
intptr_t ret; \
avpriv_atomic_lock(); \
ret = *object; \
*object = *object op operand; \
avpriv_atomic_unlock(); \
return ret; \
}
FETCH_MODIFY(add, +)
FETCH_MODIFY(sub, -)
FETCH_MODIFY(or, |)
FETCH_MODIFY(xor, ^)
FETCH_MODIFY(and, &)
#undef FETCH_MODIFY
#define atomic_fetch_add_explicit(object, operand, order) \
atomic_fetch_add(object, operand)
#define atomic_fetch_sub_explicit(object, operand, order) \
atomic_fetch_sub(object, operand)
#define atomic_fetch_or_explicit(object, operand, order) \
atomic_fetch_or(object, operand)
#define atomic_fetch_xor_explicit(object, operand, order) \
atomic_fetch_xor(object, operand)
#define atomic_fetch_and_explicit(object, operand, order) \
atomic_fetch_and(object, operand)
#define atomic_flag_test_and_set(object) \
atomic_exchange(object, 1)
#define atomic_flag_test_and_set_explicit(object, order) \
atomic_flag_test_and_set(object)
#define atomic_flag_clear(object) \
atomic_store(object, 0)
#define atomic_flag_clear_explicit(object, order) \
atomic_flag_clear(object)
#endif /* COMPAT_ATOMICS_PTHREAD_STDATOMIC_H */
-186
View File
@@ -1,186 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef COMPAT_ATOMICS_SUNCC_STDATOMIC_H
#define COMPAT_ATOMICS_SUNCC_STDATOMIC_H
#include <atomic.h>
#include <mbarrier.h>
#include <stddef.h>
#include <stdint.h>
#define ATOMIC_FLAG_INIT 0
#define ATOMIC_VAR_INIT(value) (value)
#define atomic_init(obj, value) \
do { \
*(obj) = (value); \
} while(0)
#define kill_dependency(y) ((void)0)
#define atomic_thread_fence(order) \
__machine_rw_barrier();
#define atomic_signal_fence(order) \
((void)0)
#define atomic_is_lock_free(obj) 0
typedef intptr_t atomic_flag;
typedef intptr_t atomic_bool;
typedef intptr_t atomic_char;
typedef intptr_t atomic_schar;
typedef intptr_t atomic_uchar;
typedef intptr_t atomic_short;
typedef intptr_t atomic_ushort;
typedef intptr_t atomic_int;
typedef intptr_t atomic_uint;
typedef intptr_t atomic_long;
typedef intptr_t atomic_ulong;
typedef intptr_t atomic_llong;
typedef intptr_t atomic_ullong;
typedef intptr_t atomic_wchar_t;
typedef intptr_t atomic_int_least8_t;
typedef intptr_t atomic_uint_least8_t;
typedef intptr_t atomic_int_least16_t;
typedef intptr_t atomic_uint_least16_t;
typedef intptr_t atomic_int_least32_t;
typedef intptr_t atomic_uint_least32_t;
typedef intptr_t atomic_int_least64_t;
typedef intptr_t atomic_uint_least64_t;
typedef intptr_t atomic_int_fast8_t;
typedef intptr_t atomic_uint_fast8_t;
typedef intptr_t atomic_int_fast16_t;
typedef intptr_t atomic_uint_fast16_t;
typedef intptr_t atomic_int_fast32_t;
typedef intptr_t atomic_uint_fast32_t;
typedef intptr_t atomic_int_fast64_t;
typedef intptr_t atomic_uint_fast64_t;
typedef intptr_t atomic_intptr_t;
typedef intptr_t atomic_uintptr_t;
typedef intptr_t atomic_size_t;
typedef intptr_t atomic_ptrdiff_t;
typedef intptr_t atomic_intmax_t;
typedef intptr_t atomic_uintmax_t;
static inline void atomic_store(intptr_t *object, intptr_t desired)
{
*object = desired;
__machine_rw_barrier();
}
#define atomic_store_explicit(object, desired, order) \
atomic_store(object, desired)
static inline intptr_t atomic_load(intptr_t *object)
{
__machine_rw_barrier();
return *object;
}
#define atomic_load_explicit(object, order) \
atomic_load(object)
#define atomic_exchange(object, desired) \
atomic_swap_ptr(object, desired)
#define atomic_exchange_explicit(object, desired, order) \
atomic_exchange(object, desired)
static inline int atomic_compare_exchange_strong(intptr_t *object, intptr_t *expected,
intptr_t desired)
{
intptr_t old = *expected;
*expected = (intptr_t)atomic_cas_ptr(object, (void *)old, (void *)desired);
return *expected == old;
}
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak(object, expected, desired) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_weak(object, expected, desired)
static inline intptr_t atomic_fetch_add(intptr_t *object, intptr_t operand)
{
return atomic_add_ptr_nv(object, operand) - operand;
}
#define atomic_fetch_sub(object, operand) \
atomic_fetch_add(object, -(operand))
static inline intptr_t atomic_fetch_or(intptr_t *object, intptr_t operand)
{
intptr_t old;
do {
old = atomic_load(object);
} while (!atomic_compare_exchange_strong(object, old, old | operand));
return old;
}
static inline intptr_t atomic_fetch_xor(intptr_t *object, intptr_t operand)
{
intptr_t old;
do {
old = atomic_load(object);
} while (!atomic_compare_exchange_strong(object, old, old ^ operand));
return old;
}
static inline intptr_t atomic_fetch_and(intptr_t *object, intptr_t operand)
{
intptr_t old;
do {
old = atomic_load(object);
} while (!atomic_compare_exchange_strong(object, old, old & operand));
return old;
}
#define atomic_fetch_add_explicit(object, operand, order) \
atomic_fetch_add(object, operand)
#define atomic_fetch_sub_explicit(object, operand, order) \
atomic_fetch_sub(object, operand)
#define atomic_fetch_or_explicit(object, operand, order) \
atomic_fetch_or(object, operand)
#define atomic_fetch_xor_explicit(object, operand, order) \
atomic_fetch_xor(object, operand)
#define atomic_fetch_and_explicit(object, operand, order) \
atomic_fetch_and(object, operand)
#define atomic_flag_test_and_set(object) \
atomic_exchange(object, 1)
#define atomic_flag_test_and_set_explicit(object, order) \
atomic_flag_test_and_set(object)
#define atomic_flag_clear(object) \
atomic_store(object, 0)
#define atomic_flag_clear_explicit(object, order) \
atomic_flag_clear(object)
#endif /* COMPAT_ATOMICS_SUNCC_STDATOMIC_H */
+599
View File
@@ -0,0 +1,599 @@
/*
* Copyright (C) 2023 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*/
#ifndef __STDC_VERSION_STDBIT_H__
#define __STDC_VERSION_STDBIT_H__ 202311L
#include <stdbool.h>
#include <limits.h> /* CHAR_BIT */
#define __STDC_ENDIAN_LITTLE__ 1234
#define __STDC_ENDIAN_BIG__ 4321
#ifdef __BYTE_ORDER__
# if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
# define __STDC_ENDIAN_NATIVE__ __STDC_ENDIAN_LITTLE__
# elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
# define __STDC_ENDIAN_NATIVE__ __STDC_ENDIAN_BIG__
# else
# define __STDC_ENDIAN_NATIVE__ 3412
# endif
#elif defined(_MSC_VER)
# define __STDC_ENDIAN_NATIVE__ __STDC_ENDIAN_LITTLE__
#else
# error Not implemented.
#endif
#define __stdbit_generic_type_func(func, value) \
_Generic (value, \
unsigned long long: stdc_##func##_ull((unsigned long long)(value)), \
unsigned long: stdc_##func##_ul((unsigned long)(value)), \
unsigned int: stdc_##func##_ui((unsigned int)(value)), \
unsigned short: stdc_##func##_us((unsigned short)(value)), \
unsigned char: stdc_##func##_uc((unsigned char)(value)))
#if defined (__GNUC__) || defined (__clang__)
static inline unsigned int stdc_leading_zeros_ull(unsigned long long value)
{
return value ? __builtin_clzll(value) : (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_leading_zeros_ul(unsigned long value)
{
return value ? __builtin_clzl(value) : (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_leading_zeros_ui(unsigned int value)
{
return value ? __builtin_clz(value) : (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_leading_zeros_us(unsigned short value)
{
return stdc_leading_zeros_ui(value)
- CHAR_BIT * (sizeof (int) - sizeof (value));
}
static inline unsigned int stdc_leading_zeros_uc(unsigned char value)
{
return stdc_leading_zeros_ui(value) - (CHAR_BIT * (sizeof (int) - 1));
}
#else
static inline unsigned int __stdc_leading_zeros(unsigned long long value,
unsigned int size)
{
unsigned int zeros = size * CHAR_BIT;
while (value != 0) {
value >>= 1;
zeros--;
}
return zeros;
}
static inline unsigned int stdc_leading_zeros_ull(unsigned long long value)
{
return __stdc_leading_zeros(value, sizeof (value));
}
static inline unsigned int stdc_leading_zeros_ul(unsigned long value)
{
return __stdc_leading_zeros(value, sizeof (value));
}
static inline unsigned int stdc_leading_zeros_ui(unsigned int value)
{
return __stdc_leading_zeros(value, sizeof (value));
}
static inline unsigned int stdc_leading_zeros_us(unsigned short value)
{
return __stdc_leading_zeros(value, sizeof (value));
}
static inline unsigned int stdc_leading_zeros_uc(unsigned char value)
{
return __stdc_leading_zeros(value, sizeof (value));
}
#endif
#define stdc_leading_zeros(value) \
__stdbit_generic_type_func(leading_zeros, value)
static inline unsigned int stdc_leading_ones_ull(unsigned long long value)
{
return stdc_leading_zeros_ull(~value);
}
static inline unsigned int stdc_leading_ones_ul(unsigned long value)
{
return stdc_leading_zeros_ul(~value);
}
static inline unsigned int stdc_leading_ones_ui(unsigned int value)
{
return stdc_leading_zeros_ui(~value);
}
static inline unsigned int stdc_leading_ones_us(unsigned short value)
{
return stdc_leading_zeros_us(~value);
}
static inline unsigned int stdc_leading_ones_uc(unsigned char value)
{
return stdc_leading_zeros_uc(~value);
}
#define stdc_leading_ones(value) \
__stdbit_generic_type_func(leading_ones, value)
#if defined (__GNUC__) || defined (__clang__)
static inline unsigned int stdc_trailing_zeros_ull(unsigned long long value)
{
return value ? (unsigned int)__builtin_ctzll(value)
: (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_ul(unsigned long value)
{
return value ? (unsigned int)__builtin_ctzl(value)
: (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_ui(unsigned int value)
{
return value ? (unsigned int)__builtin_ctz(value)
: (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_us(unsigned short value)
{
return value ? (unsigned int)__builtin_ctz(value)
: (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_uc(unsigned char value)
{
return value ? (unsigned int)__builtin_ctz(value)
: (CHAR_BIT * sizeof (value));
}
#else
static inline unsigned int __stdc_trailing_zeros(unsigned long long value,
unsigned int size)
{
unsigned int zeros = 0;
if (!value)
return size * CHAR_BIT;
while ((value & 1) == 0) {
value >>= 1;
zeros++;
}
return zeros;
}
static inline unsigned int stdc_trailing_zeros_ull(unsigned long long value)
{
return __stdc_trailing_zeros(value, sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_ul(unsigned long value)
{
return __stdc_trailing_zeros(value, sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_ui(unsigned int value)
{
return __stdc_trailing_zeros(value, sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_us(unsigned short value)
{
return __stdc_trailing_zeros(value, sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_uc(unsigned char value)
{
return __stdc_trailing_zeros(value, sizeof (value));
}
#endif
#define stdc_trailing_zeros(value) \
__stdbit_generic_type_func(trailing_zeros, value)
static inline unsigned int stdc_trailing_ones_ull(unsigned long long value)
{
return stdc_trailing_zeros_ull(~value);
}
static inline unsigned int stdc_trailing_ones_ul(unsigned long value)
{
return stdc_trailing_zeros_ul(~value);
}
static inline unsigned int stdc_trailing_ones_ui(unsigned int value)
{
return stdc_trailing_zeros_ui(~value);
}
static inline unsigned int stdc_trailing_ones_us(unsigned short value)
{
return stdc_trailing_zeros_us(~value);
}
static inline unsigned int stdc_trailing_ones_uc(unsigned char value)
{
return stdc_trailing_zeros_uc(~value);
}
#define stdc_trailing_ones(value) \
__stdbit_generic_type_func(trailing_ones, value)
static inline unsigned int stdc_first_leading_one_ull(unsigned long long value)
{
return value ? (stdc_leading_zeros_ull(value) + 1) : 0;
}
static inline unsigned int stdc_first_leading_one_ul(unsigned long value)
{
return value ? (stdc_leading_zeros_ul(value) + 1) : 0;
}
static inline unsigned int stdc_first_leading_one_ui(unsigned int value)
{
return value ? (stdc_leading_zeros_ui(value) + 1) : 0;
}
static inline unsigned int stdc_first_leading_one_us(unsigned short value)
{
return value ? (stdc_leading_zeros_us(value) + 1) : 0;
}
static inline unsigned int stdc_first_leading_one_uc(unsigned char value)
{
return value ? (stdc_leading_zeros_uc(value) + 1) : 0;
}
#define stdc_first_leading_one(value) \
__stdbit_generic_type_func(first_leading_one, value)
static inline unsigned int stdc_first_leading_zero_ull(unsigned long long value)
{
return stdc_leading_ones_ull(~value);
}
static inline unsigned int stdc_first_leading_zero_ul(unsigned long value)
{
return stdc_leading_ones_ul(~value);
}
static inline unsigned int stdc_first_leading_zero_ui(unsigned int value)
{
return stdc_leading_ones_ui(~value);
}
static inline unsigned int stdc_first_leading_zero_us(unsigned short value)
{
return stdc_leading_ones_us(~value);
}
static inline unsigned int stdc_first_leading_zero_uc(unsigned char value)
{
return stdc_leading_ones_uc(~value);
}
#define stdc_first_leading_zero(value) \
__stdbit_generic_type_func(first_leading_zero, value)
#if defined (__GNUC__) || defined (__clang__)
static inline unsigned int stdc_first_trailing_one_ull(unsigned long long value)
{
return __builtin_ffsll(value);
}
static inline unsigned int stdc_first_trailing_one_ul(unsigned long value)
{
return __builtin_ffsl(value);
}
static inline unsigned int stdc_first_trailing_one_ui(unsigned int value)
{
return __builtin_ffs(value);
}
static inline unsigned int stdc_first_trailing_one_us(unsigned short value)
{
return __builtin_ffs(value);
}
static inline unsigned int stdc_first_trailing_one_uc(unsigned char value)
{
return __builtin_ffs(value);
}
#else
static inline unsigned int stdc_first_trailing_one_ull(unsigned long long value)
{
return value ? (1 + stdc_trailing_zeros_ull(value)) : 0;
}
static inline unsigned int stdc_first_trailing_one_ul(unsigned long value)
{
return value ? (1 + stdc_trailing_zeros_ul(value)) : 0;
}
static inline unsigned int stdc_first_trailing_one_ui(unsigned int value)
{
return value ? (1 + stdc_trailing_zeros_ui(value)) : 0;
}
static inline unsigned int stdc_first_trailing_one_us(unsigned short value)
{
return value ? (1 + stdc_trailing_zeros_us(value)) : 0;
}
static inline unsigned int stdc_first_trailing_one_uc(unsigned char value)
{
return value ? (1 + stdc_trailing_zeros_uc(value)) : 0;
}
#endif
#define stdc_first_trailing_one(value) \
__stdbit_generic_type_func(first_trailing_one, value)
static inline unsigned int stdc_first_trailing_zero_ull(unsigned long long value)
{
return stdc_first_trailing_one_ull(~value);
}
static inline unsigned int stdc_first_trailing_zero_ul(unsigned long value)
{
return stdc_first_trailing_one_ul(~value);
}
static inline unsigned int stdc_first_trailing_zero_ui(unsigned int value)
{
return stdc_first_trailing_one_ui(~value);
}
static inline unsigned int stdc_first_trailing_zero_us(unsigned short value)
{
return stdc_first_trailing_one_us(~value);
}
static inline unsigned int stdc_first_trailing_zero_uc(unsigned char value)
{
return stdc_first_trailing_one_uc(~value);
}
#define stdc_first_trailing_zero(value) \
__stdbit_generic_type_func(first_trailing_zero, value)
#if defined (__GNUC__) || defined (__clang__)
static inline unsigned int stdc_count_ones_ull(unsigned long long value)
{
return __builtin_popcountll(value);
}
static inline unsigned int stdc_count_ones_ul(unsigned long value)
{
return __builtin_popcountl(value);
}
static inline unsigned int stdc_count_ones_ui(unsigned int value)
{
return __builtin_popcount(value);
}
static inline unsigned int stdc_count_ones_us(unsigned short value)
{
return __builtin_popcount(value);
}
static inline unsigned int stdc_count_ones_uc(unsigned char value)
{
return __builtin_popcount(value);
}
#else
static inline unsigned int __stdc_count_ones(unsigned long long value,
unsigned int size)
{
unsigned int ones = 0;
for (unsigned int c = 0; c < (size * CHAR_BIT); c++) {
ones += value & 1;
value >>= 1;
}
return ones;
}
static inline unsigned int stdc_count_ones_ull(unsigned long long value)
{
return __stdc_count_ones(value, sizeof (value));
}
static inline unsigned int stdc_count_ones_ul(unsigned long value)
{
return __stdc_count_ones(value, sizeof (value));
}
static inline unsigned int stdc_count_ones_ui(unsigned int value)
{
return __stdc_count_ones(value, sizeof (value));
}
static inline unsigned int stdc_count_ones_us(unsigned short value)
{
return __stdc_count_ones(value, sizeof (value));
}
static inline unsigned int stdc_count_ones_uc(unsigned char value)
{
return __stdc_count_ones(value, sizeof (value));
}
#endif
#define stdc_count_ones(value) \
__stdbit_generic_type_func(count_ones, value)
static inline unsigned int stdc_count_zeros_ull(unsigned long long value)
{
return stdc_count_ones_ull(~value);
}
static inline unsigned int stdc_count_zeros_ul(unsigned long value)
{
return stdc_count_ones_ul(~value);
}
static inline unsigned int stdc_count_zeros_ui(unsigned int value)
{
return stdc_count_ones_ui(~value);
}
static inline unsigned int stdc_count_zeros_us(unsigned short value)
{
return stdc_count_ones_us(~value);
}
static inline unsigned int stdc_count_zeros_uc(unsigned char value)
{
return stdc_count_ones_uc(~value);
}
#define stdc_count_zeros(value) \
__stdbit_generic_type_func(count_zeros, value)
static inline bool stdc_has_single_bit_ull(unsigned long long value)
{
return value && (value & (value - 1)) == 0;
}
static inline bool stdc_has_single_bit_ul(unsigned long value)
{
return value && (value & (value - 1)) == 0;
}
static inline bool stdc_has_single_bit_ui(unsigned int value)
{
return value && (value & (value - 1)) == 0;
}
static inline bool stdc_has_single_bit_us(unsigned short value)
{
return value && (value & (value - 1)) == 0;
}
static inline bool stdc_has_single_bit_uc(unsigned char value)
{
return value && (value & (value - 1)) == 0;
}
#define stdc_has_single_bit(value) \
__stdbit_generic_type_func(has_single_bit, value)
static inline unsigned int stdc_bit_width_ull(unsigned long long value)
{
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_ull(value);
}
static inline unsigned int stdc_bit_width_ul(unsigned long value)
{
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_ul(value);
}
static inline unsigned int stdc_bit_width_ui(unsigned int value)
{
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_ui(value);
}
static inline unsigned int stdc_bit_width_us(unsigned short value)
{
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_us(value);
}
static inline unsigned int stdc_bit_width_uc(unsigned char value)
{
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_uc(value);
}
#define stdc_bit_width(value) \
__stdbit_generic_type_func(bit_width, value)
static inline unsigned long long stdc_bit_floor_ull(unsigned long long value)
{
return value ? (1ULL << (stdc_bit_width_ull(value) - 1)) : 0ULL;
}
static inline unsigned long stdc_bit_floor_ul(unsigned long value)
{
return value ? (1UL << (stdc_bit_width_ul(value) - 1)) : 0UL;
}
static inline unsigned int stdc_bit_floor_ui(unsigned int value)
{
return value ? (1U << (stdc_bit_width_ui(value) - 1)) : 0U;
}
static inline unsigned short stdc_bit_floor_us(unsigned short value)
{
return value ? (1U << (stdc_bit_width_us(value) - 1)) : 0U;
}
static inline unsigned int stdc_bit_floor_uc(unsigned char value)
{
return value ? (1U << (stdc_bit_width_uc(value) - 1)) : 0U;
}
#define stdc_bit_floor(value) \
__stdbit_generic_type_func(bit_floor, value)
/* NOTE: Bit ceiling undefines overflow. */
static inline unsigned long long stdc_bit_ceil_ull(unsigned long long value)
{
return 1ULL << (value ? stdc_bit_width_ull(value - 1) : 0);
}
static inline unsigned long stdc_bit_ceil_ul(unsigned long value)
{
return 1UL << (value ? stdc_bit_width_ul(value - 1) : 0);
}
static inline unsigned int stdc_bit_ceil_ui(unsigned int value)
{
return 1U << (value ? stdc_bit_width_ui(value - 1) : 0);
}
static inline unsigned short stdc_bit_ceil_us(unsigned short value)
{
return 1U << (value ? stdc_bit_width_us(value - 1) : 0);
}
static inline unsigned int stdc_bit_ceil_uc(unsigned char value)
{
return 1U << (value ? stdc_bit_width_uc(value - 1) : 0);
}
#define stdc_bit_ceil(value) \
__stdbit_generic_type_func(bit_ceil, value)
#endif /* __STDC_VERSION_STDBIT_H__ */
+1
View File
@@ -26,6 +26,7 @@
#include "config.h"
#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/wchar_filename.h"
static inline wchar_t *get_module_filename(HMODULE module)
Vendored
+199 -152
View File
@@ -140,6 +140,7 @@ Component options:
--disable-error-resilience disable error resilience code
--disable-lsp disable LSP code
--disable-faan disable floating point AAN (I)DCT code
--disable-iamf disable support for Immersive Audio Model
--disable-pixelutils disable pixel utils in libavutil
Individual component options:
@@ -244,6 +245,8 @@ External library support:
--enable-libjxl enable JPEG XL de/encoding via libjxl [no]
--enable-libklvanc enable Kernel Labs VANC processing [no]
--enable-libkvazaar enable HEVC encoding via libkvazaar [no]
--enable-liblc3 enable LC3 de/encoding via liblc3 [no]
--enable-liblcevc-dec enable LCEVC decoding via liblcevc-dec [no]
--enable-liblensfun enable lensfun lens correction [no]
--enable-libmodplug enable ModPlug via libmodplug [no]
--enable-libmp3lame enable MP3 encoding via libmp3lame [no]
@@ -251,7 +254,7 @@ External library support:
--enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
--enable-libopencv enable video filtering via libopencv [no]
--enable-libopenh264 enable H.264 encoding via OpenH264 [no]
--enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
--enable-libopenjpeg enable JPEG 2000 encoding via OpenJPEG [no]
--enable-libopenmpt enable decoding tracked files via libopenmpt [no]
--enable-libopenvino enable OpenVINO as a DNN module backend
for DNN based filters like dnn_processing [no]
@@ -291,6 +294,7 @@ External library support:
--enable-libvorbis enable Vorbis en/decoding via libvorbis,
native implementation exists [no]
--enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
--enable-libvvenc enable H.266/VVC encoding via vvenc [no]
--enable-libwebp enable WebP encoding via libwebp [no]
--enable-libx264 enable H.264 encoding via x264 [no]
--enable-libx265 enable HEVC encoding via x265 [no]
@@ -1926,6 +1930,8 @@ EXTERNAL_LIBRARY_LIST="
libjxl
libklvanc
libkvazaar
liblc3
liblcevc_dec
libmodplug
libmp3lame
libmysofa
@@ -1963,6 +1969,7 @@ EXTERNAL_LIBRARY_LIST="
libvmaf
libvorbis
libvpx
libvvenc
libwebp
libxevd
libxeve
@@ -2070,6 +2077,7 @@ SUBSYSTEM_LIST="
error_resilience
faan
fast_unaligned
iamf
lsp
pixelutils
network
@@ -2111,8 +2119,6 @@ THREADS_LIST="
"
ATOMICS_LIST="
atomics_gcc
atomics_suncc
atomics_win32
"
@@ -2124,12 +2130,7 @@ AUTODETECT_LIBS="
ARCH_LIST="
aarch64
alpha
arm
avr32
avr32_ap
avr32_uc
bfin
ia64
loongarch
loongarch32
@@ -2142,7 +2143,6 @@ ARCH_LIST="
ppc64
riscv
s390
sh4
sparc
sparc64
tilegx
@@ -2218,6 +2218,8 @@ ARCH_EXT_LIST_PPC="
ARCH_EXT_LIST_RISCV="
rv
rvv
rv_zicbop
rv_zvbb
"
ARCH_EXT_LIST_X86="
@@ -2247,13 +2249,10 @@ ARCH_FEATURES="
"
BUILTIN_LIST="
atomic_cas_ptr
machine_rw_barrier
MemoryBarrier
mm_empty
rdtsc
sem_timedwait
sync_val_compare_and_swap
"
HAVE_LIST_CMDLINE="
inline_asm
@@ -2268,6 +2267,7 @@ HAVE_LIST_PUB="
HEADERS_LIST="
arpa_inet_h
asm_hwprobe_h
asm_types_h
cdio_paranoia_h
cdio_paranoia_paranoia_h
@@ -2294,6 +2294,7 @@ HEADERS_LIST="
OpenGL_gl3_h
poll_h
pthread_np_h
sys_hwprobe_h
sys_param_h
sys_resource_h
sys_select_h
@@ -2311,6 +2312,7 @@ HEADERS_LIST="
INTRINSICS_LIST="
intrinsics_neon
intrinsics_sse2
"
MATH_FUNCS="
@@ -2362,6 +2364,7 @@ SYSTEM_FUNCS="
clock_gettime
closesocket
CommandLineToArgvW
elf_aux_info
fcntl
getaddrinfo
getauxval
@@ -2410,6 +2413,7 @@ SYSTEM_FUNCS="
sysconf
sysctl
sysctlbyname
tempnam
usleep
UTGetOSTypeFromString
VirtualAlloc
@@ -2485,6 +2489,7 @@ TYPES_LIST="
struct_sockaddr_storage
struct_stat_st_mtim_tv_nsec
struct_v4l2_frmivalenum_discrete
struct_mfxConfigInterface
"
HAVE_LIST="
@@ -2517,6 +2522,7 @@ HAVE_LIST="
opencl_videotoolbox
perl
pod2man
posix_ioctl
texi2html
xmllint
zlib_gzip
@@ -2543,10 +2549,12 @@ CONFIG_EXTRA="
cbs_mpeg2
cbs_vp8
cbs_vp9
d3d12va_encode
deflate_wrapper
dirac_parse
dnn
dovi_rpu
dovi_rpudec
dovi_rpuenc
dvprofile
evcparse
exif
@@ -2578,6 +2586,7 @@ CONFIG_EXTRA="
inflate_wrapper
intrax8
iso_media
iso_writer
ividsp
jpegtables
lgplv3
@@ -2627,6 +2636,7 @@ CONFIG_EXTRA="
vp3dsp
vp56dsp
vp8dsp
vulkan_encode
wma_freqs
wmv2dsp
"
@@ -2736,6 +2746,7 @@ armv6t2_deps="arm"
armv8_deps="aarch64"
neon_deps_any="aarch64 arm"
intrinsics_neon_deps="neon"
intrinsics_sse2_deps="sse2"
vfp_deps="arm"
vfpv3_deps="vfp"
setend_deps="arm"
@@ -2753,6 +2764,8 @@ power8_deps="vsx"
rv_deps="riscv"
rvv_deps="rv"
rv_zicbop="riscv"
rv_zvbb_deps="rvv"
loongson2_deps="mips"
loongson3_deps="mips"
@@ -2805,8 +2818,8 @@ for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
done
aligned_stack_if_any="aarch64 ppc x86"
fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 riscv64 sparc64 x86_64"
fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
fast_64bit_if_any="aarch64 ia64 mips64 parisc64 ppc64 riscv64 sparc64 x86_64"
fast_clz_if_any="aarch64 mips ppc x86"
fast_unaligned_if_any="aarch64 ppc x86"
simd_align_16_if_any="altivec neon sse"
simd_align_32_if_any="avx"
@@ -2819,8 +2832,6 @@ valgrind_backtrace_conflict="optimizations"
valgrind_backtrace_deps="valgrind_valgrind_h"
# threading support
atomics_gcc_if="sync_val_compare_and_swap"
atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
atomics_win32_if="MemoryBarrier"
atomics_native_if_any="$ATOMICS_LIST"
w32threads_deps="atomics_native"
@@ -2837,9 +2848,10 @@ cbs_vp8_select="cbs"
cbs_vp9_select="cbs"
deflate_wrapper_deps="zlib"
dirac_parse_select="golomb"
dovi_rpu_select="golomb"
dnn_suggest="libtensorflow libopenvino libtorch"
dovi_rpudec_select="golomb"
dovi_rpuenc_select="golomb"
dnn_deps="avformat swscale"
dnn_deps_any="libtensorflow libopenvino libtorch"
error_resilience_select="me_cmp"
evcparse_select="golomb"
faandct_deps="faan"
@@ -2847,10 +2859,14 @@ faandct_select="fdctdsp"
faanidct_deps="faan"
faanidct_select="idctdsp"
h264dsp_select="startcode"
h264parse_select="golomb"
h264_sei_select="atsc_a53 golomb"
hevcparse_select="golomb"
hevc_sei_select="atsc_a53 golomb"
frame_thread_encoder_deps="encoders threads"
iamfdec_deps="iamf"
iamfdec_select="iso_media mpeg4audio"
iamfenc_deps="iamf"
inflate_wrapper_deps="zlib"
intrax8_select="blockdsp wmv2dsp"
iso_media_select="mpeg4audio"
@@ -2863,6 +2879,7 @@ mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp"
msmpeg4dec_select="h263_decoder"
msmpeg4enc_select="h263_encoder"
vc1dsp_select="h264chroma qpeldsp startcode"
wmv2dsp_select="qpeldsp"
# decoders / encoders
aac_decoder_select="adts_header mpeg4audio sinewin"
@@ -2894,7 +2911,9 @@ asv1_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
asv2_decoder_select="blockdsp bswapdsp idctdsp"
asv2_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
atrac1_decoder_select="sinewin"
av1_decoder_select="cbs_av1 atsc_a53"
atrac3p_decoder_select="sinewin"
atrac3pal_decoder_select="sinewin"
av1_decoder_select="atsc_a53 cbs_av1 dovi_rpudec"
bink_decoder_select="blockdsp hpeldsp"
binkaudio_dct_decoder_select="wma_freqs"
binkaudio_rdft_decoder_select="wma_freqs"
@@ -2906,7 +2925,7 @@ cook_decoder_select="audiodsp sinewin"
cri_decoder_select="mjpeg_decoder"
cscd_decoder_suggest="zlib"
dds_decoder_select="texturedsp"
dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc"
dirac_decoder_select="dirac_parse dwt golomb mpegvideoenc qpeldsp videodsp"
dnxhd_decoder_select="blockdsp idctdsp"
dnxhd_encoder_select="blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp videodsp"
dvvideo_decoder_select="dvprofile idctdsp"
@@ -2935,6 +2954,7 @@ flv_decoder_select="h263_decoder"
flv_encoder_select="h263_encoder"
fourxm_decoder_select="blockdsp bswapdsp"
fraps_decoder_select="bswapdsp huffman"
ftr_decoder_select="adts_header"
g2m_decoder_deps="zlib"
g2m_decoder_select="blockdsp idctdsp jpegtables"
g729_decoder_select="audiodsp"
@@ -2950,7 +2970,7 @@ h264_decoder_suggest="error_resilience"
hap_decoder_select="snappy texturedsp"
hap_encoder_deps="libsnappy"
hap_encoder_select="texturedspenc"
hevc_decoder_select="bswapdsp cabac dovi_rpu golomb hevcparse hevc_sei videodsp"
hevc_decoder_select="bswapdsp cabac dovi_rpudec golomb hevcparse hevc_sei videodsp"
huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llvidencdsp"
hymt_decoder_select="huffyuv_decoder"
@@ -2999,7 +3019,7 @@ mpeg1video_decoder_select="mpegvideodec"
mpeg1video_encoder_select="mpegvideoenc"
mpeg2video_decoder_select="mpegvideodec"
mpeg2video_encoder_select="mpegvideoenc"
mpeg4_decoder_select="h263_decoder mpeg4video_parser"
mpeg4_decoder_select="h263_decoder"
mpeg4_encoder_select="h263_encoder qpeldsp"
msa1_decoder_select="mss34dsp"
mscc_decoder_select="inflate_wrapper"
@@ -3020,7 +3040,7 @@ notchlc_decoder_select="lzf"
nuv_decoder_select="idctdsp"
opus_decoder_deps="swresample"
opus_encoder_select="audio_frame_queue"
pdv_decoder_deps="zlib"
pdv_decoder_select="inflate_wrapper"
png_decoder_select="inflate_wrapper"
png_encoder_select="deflate_wrapper llvidencdsp"
prores_decoder_select="blockdsp idctdsp"
@@ -3124,7 +3144,7 @@ d3d11va_deps="dxva_h ID3D11VideoDecoder ID3D11VideoContext"
d3d12va_deps="dxva_h ID3D12Device ID3D12VideoDecoder"
dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32 user32"
ffnvcodec_deps_any="libdl LoadLibrary"
mediacodec_deps="android"
mediacodec_deps="android mediandk"
nvdec_deps="ffnvcodec"
vaapi_x11_deps="xlib_x11"
videotoolbox_hwaccel_deps="videotoolbox pthreads"
@@ -3267,6 +3287,7 @@ wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
# hardware-accelerated codecs
d3d12va_encode_deps="d3d12va ID3D12VideoEncoder d3d12_encoder_feature"
mediafoundation_deps="mftransform_h MFCreateAlignedMemoryBuffer"
omx_deps="libdl pthreads"
omx_rpi_select="omx"
@@ -3275,6 +3296,7 @@ qsvdec_select="qsv"
qsvenc_select="qsv"
qsvvpp_select="qsv"
vaapi_encode_deps="vaapi"
vulkan_encode_deps="vulkan"
v4l2_m2m_deps="linux_videodev2_h sem_timedwait"
bilateral_cuda_filter_deps="ffnvcodec"
@@ -3301,13 +3323,26 @@ amf_deps_any="libdl LoadLibrary"
nvenc_deps="ffnvcodec"
nvenc_deps_any="libdl LoadLibrary"
aac_mediacodec_decoder_deps="mediacodec"
aac_mediacodec_decoder_select="aac_adtstoasc_bsf aac_parser"
aac_mf_encoder_deps="mediafoundation"
ac3_mf_encoder_deps="mediafoundation"
amrnb_mediacodec_decoder_deps="mediacodec"
amrnb_mediacodec_decoder_select="amr_parser"
amrwb_mediacodec_decoder_deps="mediacodec"
amrwb_mediacodec_decoder_select="amr_parser"
av1_amf_encoder_deps="amf"
av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS"
av1_mediacodec_decoder_deps="mediacodec"
av1_mediacodec_encoder_deps="mediacodec"
av1_mediacodec_encoder_select="extract_extradata_bsf"
av1_nvenc_encoder_deps="nvenc NV_ENC_PIC_PARAMS_AV1"
av1_nvenc_encoder_select="atsc_a53"
av1_qsv_decoder_select="qsvdec"
av1_qsv_encoder_deps="libvpl"
av1_qsv_encoder_select="qsvenc"
av1_vaapi_encoder_deps="VAEncPictureParameterBufferAV1"
av1_vaapi_encoder_select="cbs_av1 vaapi_encode"
h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
h264_amf_encoder_deps="amf"
@@ -3316,7 +3351,7 @@ h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
h264_mediacodec_decoder_deps="mediacodec"
h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
h264_mediacodec_encoder_deps="mediacodec"
h264_mediacodec_encoder_select="h264_metadata"
h264_mediacodec_encoder_select="extract_extradata_bsf h264_metadata"
h264_mf_encoder_deps="mediafoundation"
h264_mmal_decoder_deps="mmal"
h264_nvenc_encoder_deps="nvenc"
@@ -3327,16 +3362,18 @@ h264_qsv_encoder_select="atsc_a53 qsvenc"
h264_rkmpp_decoder_deps="rkmpp"
h264_rkmpp_decoder_select="h264_mp4toannexb_bsf"
h264_vaapi_encoder_select="atsc_a53 cbs_h264 vaapi_encode"
h264_vulkan_encoder_select="cbs_h264 vulkan_encode"
h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
h264_v4l2m2m_decoder_select="h264_mp4toannexb_bsf"
h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
hevc_amf_encoder_deps="amf"
hevc_cuvid_decoder_deps="cuvid"
hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
hevc_d3d12va_encoder_select="cbs_h265 d3d12va_encode"
hevc_mediacodec_decoder_deps="mediacodec"
hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser"
hevc_mediacodec_encoder_deps="mediacodec"
hevc_mediacodec_encoder_select="hevc_metadata"
hevc_mediacodec_encoder_select="extract_extradata_bsf hevc_metadata"
hevc_mf_encoder_deps="mediafoundation"
hevc_nvenc_encoder_deps="nvenc"
hevc_nvenc_encoder_select="atsc_a53"
@@ -3346,6 +3383,7 @@ hevc_rkmpp_decoder_deps="rkmpp"
hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf"
hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
hevc_vaapi_encoder_select="atsc_a53 cbs_h265 vaapi_encode"
hevc_vulkan_encoder_select="atsc_a53 cbs_h265 vulkan_encode"
hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
hevc_v4l2m2m_decoder_select="hevc_mp4toannexb_bsf"
hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
@@ -3356,6 +3394,8 @@ mjpeg_qsv_encoder_select="qsvenc"
mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
mjpeg_vaapi_encoder_select="cbs_jpeg jpegtables vaapi_encode"
mp3_mf_encoder_deps="mediafoundation"
mp3_mediacodec_decoder_deps="mediacodec"
mp3_mediacodec_decoder_select="mpegaudioheader"
mpeg1_cuvid_decoder_deps="cuvid"
mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m"
mpeg2_cuvid_decoder_deps="cuvid"
@@ -3368,6 +3408,7 @@ mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m"
mpeg4_cuvid_decoder_deps="cuvid"
mpeg4_mediacodec_decoder_deps="mediacodec"
mpeg4_mediacodec_encoder_deps="mediacodec"
mpeg4_mediacodec_encoder_select="extract_extradata_bsf"
mpeg4_mmal_decoder_deps="mmal"
mpeg4_omx_encoder_deps="omx"
mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
@@ -3395,17 +3436,13 @@ vp9_vaapi_encoder_select="vaapi_encode"
vp9_qsv_encoder_deps="libmfx MFX_CODEC_VP9"
vp9_qsv_encoder_select="qsvenc"
vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
av1_qsv_decoder_select="qsvdec"
av1_qsv_encoder_select="qsvenc"
av1_qsv_encoder_deps="libvpl"
av1_amf_encoder_deps="amf"
av1_vaapi_encoder_deps="VAEncPictureParameterBufferAV1"
av1_vaapi_encoder_select="cbs_av1 vaapi_encode"
vvc_qsv_decoder_select="vvc_mp4toannexb_bsf qsvdec"
# parsers
aac_parser_select="adts_header mpeg4audio"
av1_parser_select="cbs_av1"
evc_parser_select="evcparse"
ftr_parser_select="adts_header mpeg4audio"
h264_parser_select="golomb h264dsp h264parse h264_sei"
hevc_parser_select="hevcparse hevc_sei"
mpegaudio_parser_select="mpegaudioheader"
@@ -3418,6 +3455,7 @@ aac_adtstoasc_bsf_select="adts_header mpeg4audio"
av1_frame_merge_bsf_select="cbs_av1"
av1_frame_split_bsf_select="cbs_av1"
av1_metadata_bsf_select="cbs_av1"
dovi_rpu_bsf_select="cbs_h265 cbs_av1 dovi_rpudec dovi_rpuenc"
dts2pts_bsf_select="cbs_h264 h264parse"
eac3_core_bsf_select="ac3_parser"
evc_frame_merge_bsf_select="evcparse"
@@ -3476,14 +3514,14 @@ prores_videotoolbox_encoder_deps="pthreads"
prores_videotoolbox_encoder_select="videotoolbox_encoder"
libaom_av1_decoder_deps="libaom"
libaom_av1_encoder_deps="libaom"
libaom_av1_encoder_select="extract_extradata_bsf"
libaom_av1_encoder_select="extract_extradata_bsf dovi_rpuenc"
libaribb24_decoder_deps="libaribb24"
libaribcaption_decoder_deps="libaribcaption"
libcelt_decoder_deps="libcelt"
libcodec2_decoder_deps="libcodec2"
libcodec2_encoder_deps="libcodec2"
libdav1d_decoder_deps="libdav1d"
libdav1d_decoder_select="atsc_a53"
libdav1d_decoder_select="atsc_a53 dovi_rpudec"
libdavs2_decoder_deps="libdavs2"
libdavs2_decoder_select="avs2_parser"
libfdk_aac_decoder_deps="libfdk_aac"
@@ -3499,6 +3537,9 @@ libilbc_encoder_deps="libilbc"
libjxl_decoder_deps="libjxl libjxl_threads"
libjxl_encoder_deps="libjxl libjxl_threads"
libkvazaar_encoder_deps="libkvazaar"
liblc3_decoder_deps="liblc3"
liblc3_encoder_deps="liblc3"
liblc3_encoder_select="audio_frame_queue"
libmodplug_demuxer_deps="libmodplug"
libmp3lame_encoder_deps="libmp3lame"
libmp3lame_encoder_select="audio_frame_queue mpegaudioheader"
@@ -3522,6 +3563,7 @@ libspeex_decoder_deps="libspeex"
libspeex_encoder_deps="libspeex"
libspeex_encoder_select="audio_frame_queue"
libsvtav1_encoder_deps="libsvtav1"
libsvtav1_encoder_select="dovi_rpuenc"
libtheora_encoder_deps="libtheora"
libtwolame_encoder_deps="libtwolame"
libuavs3d_decoder_deps="libuavs3d"
@@ -3533,6 +3575,7 @@ libvpx_vp8_decoder_deps="libvpx"
libvpx_vp8_encoder_deps="libvpx"
libvpx_vp9_decoder_deps="libvpx"
libvpx_vp9_encoder_deps="libvpx"
libvvenc_encoder_deps="libvvenc"
libwebp_encoder_deps="libwebp"
libwebp_anim_encoder_deps="libwebp"
libx262_encoder_deps="libx262"
@@ -3541,7 +3584,7 @@ libx264_encoder_select="atsc_a53 golomb"
libx264rgb_encoder_deps="libx264"
libx264rgb_encoder_select="libx264_encoder"
libx265_encoder_deps="libx265"
libx265_encoder_select="atsc_a53"
libx265_encoder_select="atsc_a53 dovi_rpuenc"
libxavs_encoder_deps="libxavs"
libxavs2_encoder_deps="libxavs2"
libxevd_decoder_deps="libxevd"
@@ -3585,7 +3628,7 @@ evc_demuxer_select="evc_frame_merge_bsf evc_parser"
f4v_muxer_select="mov_muxer"
fifo_muxer_deps="threads"
flac_demuxer_select="flac_parser"
flv_muxer_select="aac_adtstoasc_bsf"
flv_muxer_select="aac_adtstoasc_bsf iso_writer"
gxf_muxer_select="pcm_rechunk_bsf"
hds_muxer_select="flv_muxer"
hls_demuxer_select="aac_demuxer ac3_demuxer adts_header ac3_parser eac3_demuxer mov_demuxer mpegts_demuxer"
@@ -3603,19 +3646,20 @@ latm_muxer_select="aac_adtstoasc_bsf mpeg4audio"
matroska_audio_muxer_select="matroska_muxer"
matroska_demuxer_select="riffdec"
matroska_demuxer_suggest="bzlib zlib"
matroska_muxer_select="mpeg4audio riffenc aac_adtstoasc_bsf pgs_frame_merge_bsf vp9_superframe_bsf"
matroska_muxer_select="iso_writer mpeg4audio riffenc aac_adtstoasc_bsf pgs_frame_merge_bsf vp9_superframe_bsf"
mlp_demuxer_select="mlp_parser"
mmf_muxer_select="riffenc"
mov_demuxer_select="iso_media riffdec iamfdec"
mov_demuxer_suggest="zlib"
mov_muxer_select="iso_media riffenc rtpenc_chain vp9_superframe_bsf aac_adtstoasc_bsf ac3_parser iamfenc"
mov_demuxer_select="iso_media riffdec"
mov_demuxer_suggest="iamfdec zlib"
mov_muxer_select="iso_media iso_writer riffenc rtpenc_chain vp9_superframe_bsf aac_adtstoasc_bsf ac3_parser"
mov_muxer_suggest="iamfenc"
mp3_demuxer_select="mpegaudio_parser"
mp3_muxer_select="mpegaudioheader"
mp4_muxer_select="mov_muxer"
mpegts_demuxer_select="iso_media"
mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf hevc_mp4toannexb_bsf vvc_mp4toannexb_bsf"
mpegtsraw_demuxer_select="mpegts_demuxer"
mxf_muxer_select="pcm_rechunk_bsf rangecoder"
mxf_muxer_select="iso_writer pcm_rechunk_bsf rangecoder"
mxf_d10_muxer_select="mxf_muxer"
mxf_opatom_muxer_select="mxf_muxer"
nut_muxer_select="riffenc"
@@ -3628,6 +3672,7 @@ ogv_muxer_select="ogg_muxer"
opus_muxer_select="ogg_muxer"
psp_muxer_select="mov_muxer"
rtp_demuxer_select="sdp_demuxer"
rtp_muxer_select="iso_writer"
rtp_mpegts_muxer_select="mpegts_muxer rtp_muxer"
rtpdec_select="asf_demuxer mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
rtsp_demuxer_select="http_protocol rtpdec"
@@ -3839,9 +3884,11 @@ histeq_filter_deps="gpl"
hqdn3d_filter_deps="gpl"
iccdetect_filter_deps="lcms2"
iccgen_filter_deps="lcms2"
identity_filter_select="scene_sad"
interlace_filter_deps="gpl"
kerndeint_filter_deps="gpl"
ladspa_filter_deps="ladspa libdl"
lcevc_filter_deps="liblcevc_dec"
lensfun_filter_deps="liblensfun version3"
libplacebo_filter_deps="libplacebo vulkan"
lv2_filter_deps="lv2"
@@ -3945,6 +3992,8 @@ vstack_qsv_filter_deps="libmfx"
vstack_qsv_filter_select="qsvvpp"
xstack_qsv_filter_deps="libmfx"
xstack_qsv_filter_select="qsvvpp"
pad_vaapi_filter_deps="vaapi_1"
drawbox_vaapi_filter_deps="vaapi_1"
# examples
avio_http_serve_files_deps="avformat avutil fork"
@@ -3978,7 +4027,7 @@ cws2fws_extralibs="zlib_extralibs"
# libraries, in any order
avcodec_deps="avutil"
avcodec_suggest="libm stdatomic"
avcodec_suggest="libm stdatomic liblcevc_dec"
avdevice_deps="avformat avcodec avutil"
avdevice_suggest="libm stdatomic"
avfilter_deps="avutil"
@@ -3999,8 +4048,8 @@ avutil_extralibs="d3d11va_extralibs d3d12va_extralibs mediacodec_extralibs nanos
# programs
ffmpeg_deps="avcodec avfilter avformat threads"
ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
hflip_filter null_filter
ffmpeg_select="aformat_filter anull_filter atrim_filter crop_filter
format_filter hflip_filter null_filter rotate_filter
transpose_filter trim_filter vflip_filter"
ffmpeg_suggest="ole32 psapi shell32"
ffplay_deps="avcodec avformat avfilter swscale swresample sdl2"
@@ -4079,6 +4128,7 @@ enable asm
enable debug
enable doc
enable faan faandct faanidct
enable iamf
enable large_tests
enable optimizations
enable ptx_compression
@@ -4499,37 +4549,49 @@ enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize=" && ! echo $CFLAGS
add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
}
add_sanitizer_flags(){
case "$1" in
asan)
add_cflags -fsanitize=address
add_ldflags -fsanitize=address
;;
lsan)
add_cflags -fsanitize=leak
add_ldflags -fsanitize=leak
;;
msan)
add_cflags -fsanitize=memory -fsanitize-memory-track-origins
add_ldflags -fsanitize=memory
;;
tsan)
add_cflags -fsanitize=thread
add_ldflags -fsanitize=thread
;;
usan)
add_cflags -fsanitize=undefined
add_ldflags -fsanitize=undefined
;;
?*)
die "Unknown sanitizer $1"
;;
esac
}
case "$toolchain" in
*-asan)
cc_default="${toolchain%-asan}"
add_cflags -fsanitize=address
add_ldflags -fsanitize=address
clang-*)
add_sanitizer_flags "${toolchain#clang-}"
cc_default="clang"
cxx_default="clang++"
;;
*-lsan)
cc_default="${toolchain%-lsan}"
add_cflags -fsanitize=leak
add_ldflags -fsanitize=leak
;;
*-msan)
cc_default="${toolchain%-msan}"
add_cflags -fsanitize=memory -fsanitize-memory-track-origins
add_ldflags -fsanitize=memory
;;
*-tsan)
cc_default="${toolchain%-tsan}"
add_cflags -fsanitize=thread
add_ldflags -fsanitize=thread
case "$toolchain" in
gcc-tsan)
add_cflags -fPIC
add_ldflags -fPIC
;;
esac
;;
*-usan)
cc_default="${toolchain%-usan}"
add_cflags -fsanitize=undefined
add_ldflags -fsanitize=undefined
gcc-*)
add_sanitizer_flags "${toolchain#gcc-}"
cc_default="gcc"
cxx_default="g++"
# In case of tsan with gcc, PIC has to be enabled
if [ "${toolchain#gcc-}" = "tsan" ]; then
add_cflags -fPIC
add_ldflags -fPIC
fi
;;
valgrind-*)
target_exec_default="valgrind"
@@ -4725,7 +4787,7 @@ chmod +x $TMPE
# make sure we can execute files in $TMPDIR
cat > $TMPSH 2>> $logfile <<EOF
#! /bin/sh
#!/bin/sh
EOF
chmod +x $TMPSH >> $logfile 2>&1
if ! $TMPSH >> $logfile 2>&1; then
@@ -5017,7 +5079,12 @@ probe_cc(){
else
_ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
fi
_DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
if [ -x "$(command -v wslpath)" ]; then
_DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); if (!match($$0, / /)) { print $$0 } }'\'' | xargs -r -d\\n -n1 wslpath -u | awk '\''BEGIN { printf "%s:", "$@" }; { sub(/\r/,""); printf " %s", $$0 }; END { print "" }'\'' > $(@:.o=.d)'
else
_DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
fi
_DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
_cflags_speed="-O2"
_cflags_size="-O1"
@@ -5211,9 +5278,6 @@ case "$arch" in
s390|s390x)
arch="s390"
;;
sh4|sh)
arch="sh4"
;;
sun4*|sparc*)
arch="sparc"
;;
@@ -5240,10 +5304,6 @@ if enabled aarch64; then
;;
esac
elif enabled alpha; then
cpuflags="-mcpu=$cpu"
elif enabled arm; then
check_arm_arch() {
@@ -5310,31 +5370,6 @@ elif enabled arm; then
test_cflags -mfp16-format=ieee && add_cflags -mfp16-format=ieee
elif enabled avr32; then
case $cpu in
ap7[02]0[0-2])
subarch="avr32_ap"
cpuflags="-mpart=$cpu"
;;
ap)
subarch="avr32_ap"
cpuflags="-march=$cpu"
;;
uc3[ab]*)
subarch="avr32_uc"
cpuflags="-mcpu=$cpu"
;;
uc)
subarch="avr32_uc"
cpuflags="-march=$cpu"
;;
esac
elif enabled bfin; then
cpuflags="-mcpu=$cpu"
elif enabled loongarch; then
enable local_aligned
@@ -5513,6 +5548,9 @@ elif enabled ppc; then
elif enabled riscv; then
check_headers asm/hwprobe.h
check_headers sys/hwprobe.h
if test_cpp_condition stddef.h "__riscv_zbb"; then
enable fast_clz
fi
@@ -5558,6 +5596,12 @@ elif enabled x86; then
;;
esac
else
if test_cpp_condition inttypes.h "UINTPTR_MAX >= UINT64_MAX"; then
enable fast_64bit
fi
fi
if [ "$cpu" != generic ]; then
@@ -5622,7 +5666,7 @@ check_64bit(){
}
case "$arch" in
aarch64|alpha|ia64)
aarch64|ia64)
enabled shared && enable_weak pic
;;
loongarch)
@@ -6101,18 +6145,16 @@ enabled pic && enable_weak_pic
test_cc <<EOF || die "Symbol mangling check failed."
int ff_extern;
EOF
sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
sym=$($nm $TMPO | awk '/[ \t]+[^ \t]?ff_extern$/{ print substr($0, match($0, /[^ \t]?ff_extern$/)) }')
extern_prefix=${sym%%ff_extern*}
log "Symbol prefix detected as: '${extern_prefix}'"
! disabled inline_asm && check_inline_asm inline_asm '"" ::'
check_cc pragma_deprecated "" '_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
# The global variable ensures the bits appear unchanged in the object file.
test_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
test_cpp_condition stdlib.h "defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)" && enable bigendian
check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
@@ -6205,10 +6247,6 @@ if enabled aarch64; then
enabled_any ${v}_external ${v}_inline || disable $v
done
elif enabled alpha; then
check_cflags -mieee
elif enabled arm; then
enabled msvc && check_cpp_condition thumb stddef.h "defined _M_ARMT"
@@ -6355,6 +6393,8 @@ elif enabled riscv; then
enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"'
enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"'
enabled rv_zicbop && check_inline_asm rv_zicbop '".option arch, +zicbop\nprefetch.r 64(a0)"'
enabled rv_zvbb && check_inline_asm rv_zvbb '".option arch, +zvbb\nvclz.v v0, v8"'
elif enabled x86; then
@@ -6436,6 +6476,7 @@ elif enabled loongarch; then
fi
check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)"
check_cc intrinsics_sse2 emmintrin.h "__m128i test = _mm_setzero_si128()"
check_ldflags -Wl,--as-needed
check_ldflags -Wl,-z,noexecstack
@@ -6480,10 +6521,7 @@ if ! disabled network; then
fi
fi
check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
check_builtin MemoryBarrier windows.h "MemoryBarrier()"
check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
@@ -6543,6 +6581,7 @@ check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
check_func strerror_r
check_func sysconf
check_func sysctl
check_func tempnam
check_func usleep
check_func_headers conio.h kbhit
@@ -6552,6 +6591,7 @@ check_func_headers mach/mach_time.h mach_absolute_time
check_func_headers stdlib.h getenv
check_func_headers sys/stat.h lstat
check_func_headers sys/auxv.h getauxval
check_func_headers sys/auxv.h elf_aux_info
check_func_headers sys/sysctl.h sysctlbyname
check_func_headers windows.h GetModuleHandle
@@ -6619,8 +6659,8 @@ check_headers asm/types.h
# some configurations also require linking to libatomic, so try
# both with -latomic and without
for LATOMIC in "-latomic" ""; do
check_builtin stdatomic stdatomic.h \
"atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar" \
check_builtin stdatomic stdatomic.h \
"atomic_int foo, bar = -1; atomic_store(&foo, 0); foo += bar" \
$LATOMIC && eval stdatomic_extralibs="\$LATOMIC" && break
done
@@ -6632,7 +6672,7 @@ check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
check_lib android android/native_window.h ANativeWindow_acquire -landroid
check_lib mediandk "stdint.h media/NdkImage.h" AImage_delete -lmediandk
check_lib mediandk "stdint.h media/NdkMediaFormat.h" AMediaFormat_new -lmediandk
check_lib camera2ndk "stdbool.h stdint.h camera/NdkCameraManager.h" ACameraManager_create -lcamera2ndk
enabled appkit && check_apple_framework AppKit
@@ -6687,6 +6727,9 @@ check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
check_type "windows.h d3d11.h" "ID3D11VideoContext"
check_type "windows.h d3d12.h" "ID3D12Device"
check_type "windows.h d3d12video.h" "ID3D12VideoDecoder"
check_type "windows.h d3d12video.h" "ID3D12VideoEncoder"
test_code cc "windows.h d3d12video.h" "D3D12_FEATURE_VIDEO feature = D3D12_FEATURE_VIDEO_ENCODER_CODEC" && \
test_code cc "windows.h d3d12video.h" "D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS req" && enable d3d12_encoder_feature
check_type "windows.h" "DPI_AWARENESS_CONTEXT" -D_WIN32_WINNT=0x0A00
check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
check_func_headers mfapi.h MFCreateAlignedMemoryBuffer -lmfplat
@@ -6822,7 +6865,7 @@ enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gn
enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
enabled ladspa && require_headers "ladspa.h dlfcn.h"
enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext
enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version
enabled libaom && require_pkg_config libaom "aom >= 2.0.0" aom/aom_codec.h aom_codec_version
enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
{ enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
@@ -6869,7 +6912,9 @@ enabled libjxl && require_pkg_config libjxl "libjxl >= 0.7.0" jxl/dec
require_pkg_config libjxl_threads "libjxl_threads >= 0.7.0" jxl/thread_parallel_runner.h JxlThreadParallelRunner
enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc
enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 2.0.0" kvazaar.h kvz_api_get
enabled liblc3 && require_pkg_config liblc3 "lc3 >= 1.1.0" lc3.h lc3_hr_setup_encoder
enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_create
enabled liblcevc_dec && require_pkg_config liblcevc_dec "lcevc_dec >= 2.0.0" "LCEVC/lcevc_dec.h" LCEVC_CreateDecoder
if enabled libmfx && enabled libvpl; then
die "ERROR: can not use libmfx and libvpl together"
@@ -6897,6 +6942,7 @@ elif enabled libvpl; then
check_pkg_config libmfx "vpl >= 2.6" "mfxvideo.h mfxdispatcher.h" MFXLoad || \
die "ERROR: libvpl >= 2.6 not found"
add_cflags -DMFX_DEPRECATED_OFF
check_type "vpl/mfxdefs.h vpl/mfxvideo.h" "struct mfxConfigInterface"
fi
if enabled libmfx; then
@@ -6990,11 +7036,12 @@ enabled libvpx && {
fi
}
enabled libvvenc && require_pkg_config libvvenc "libvvenc >= 1.6.1" "vvenc/vvenc.h" vvenc_get_version
enabled libwebp && {
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
require_cpp_condition libx264 x264.h "X264_BUILD >= 122" && {
require_cpp_condition libx264 x264.h "X264_BUILD >= 155" && {
[ "$toolchain" != "msvc" ] ||
require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
check_cpp_condition libx264_hdr10 x264.h "X264_BUILD >= 163" &&
@@ -7004,7 +7051,7 @@ enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
enabled libxevd && require_pkg_config libxevd "xevd >= 0.4.1" "xevd.h" xevd_decode
enabled libxeve && require_pkg_config libxeve "xeve >= 0.4.3" "xeve.h" xeve_encode
enabled libxeve && require_pkg_config libxeve "xeve >= 0.5.1" "xeve.h" xeve_encode
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new
@@ -7031,7 +7078,7 @@ enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h"
{ test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel "-framework OpenCL" ||
check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
die "ERROR: opencl not found"; } &&
{ test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
@@ -7039,8 +7086,8 @@ enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueN
die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
check_lib opengl OpenGL/gl3.h glGetError "-framework OpenGL" ||
check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -framework OpenGLES" ||
die "ERROR: opengl not found."
}
enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
@@ -7066,7 +7113,7 @@ enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/r
{ enabled libdrm ||
die "ERROR: rkmpp requires --enable-libdrm"; }
}
enabled vapoursynth && require_pkg_config vapoursynth "vapoursynth-script >= 42" VSScript.h vsscript_init
enabled vapoursynth && require_headers "vapoursynth/VSScript4.h vapoursynth/VapourSynth4.h"
if enabled gcrypt; then
@@ -7108,12 +7155,12 @@ if enabled decklink; then
fi
enabled securetransport &&
check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
check_func SecIdentityCreate "-framework CoreFoundation -framework Security" &&
check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-framework CoreFoundation -framework Security" ||
disable securetransport
enabled securetransport &&
check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
check_func SecItemImport "-framework CoreFoundation -framework Security"
enabled schannel &&
check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
@@ -7131,11 +7178,13 @@ pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint
check_headers linux/fb.h
check_headers linux/videodev2.h
test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
test_code cc sys/ioctl.h "int ioctl(int, int, ...)" && enable posix_ioctl
# check V4L2 codecs available in the API
if enabled v4l2_m2m; then
check_headers linux/fb.h
check_headers linux/videodev2.h
test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;"
check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;"
check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;"
@@ -7310,7 +7359,7 @@ fi
if enabled x86; then
case $target_os in
mingw32*|mingw64*|win32|win64|linux|cygwin*)
freebsd|mingw32*|mingw64*|win32|win64|linux|cygwin*)
;;
*)
disable ffnvcodec cuvid nvdec nvenc
@@ -7348,7 +7397,7 @@ fi
enabled amf &&
check_cpp_condition amf "AMF/core/Version.h" \
"(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x00010004001d0000"
"(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400210000"
# Funny iconv installations are not unusual, so check it after all flags have been set
if enabled libc_iconv; then
@@ -7731,21 +7780,18 @@ for thread in $THREADS_LIST; do
done
if disabled stdatomic; then
if enabled atomics_gcc; then
add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
elif enabled atomics_win32; then
if enabled atomics_win32; then
add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32'
elif enabled atomics_suncc; then
add_cppflags '-I\$(SRC_PATH)/compat/atomics/suncc'
elif enabled pthreads; then
add_compat atomics/pthread/stdatomic.o
add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread'
else
enabled threads && die "Threading is enabled, but no atomics are available"
add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
fi
fi
check_builtin stdbit "stdbit.h assert.h" \
'static_assert(__STDC_VERSION_STDBIT_H__ >= 202311L, "Compiler lacks stdbit.h")' || \
add_cppflags '-I\$(SRC_PATH)/compat/stdbit'
# Check if requested libraries were found.
for lib in $AUTODETECT_LIBS; do
requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found";
@@ -7762,14 +7808,14 @@ enabled elbg_filter && prepend avfilter_deps "avcodec"
enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
enabled fsync_filter && prepend avfilter_deps "avformat"
enabled mcdeint_filter && prepend avfilter_deps "avcodec"
enabled movie_filter && prepend avfilter_deps "avformat avcodec"
enabled movie_filter && prepend avfilter_deps "avformat avcodec"
enabled pan_filter && prepend avfilter_deps "swresample"
enabled pp_filter && prepend avfilter_deps "postproc"
enabled qrencode_filter && prepend_avfilter_deps "swscale"
enabled qrencodesrc_filter && prepend_avfilter_deps "swscale"
enabled qrencode_filter && prepend avfilter_deps "swscale"
enabled qrencodesrc_filter && prepend avfilter_deps "swscale"
enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
enabled sab_filter && prepend avfilter_deps "swscale"
enabled scale_filter && prepend avfilter_deps "swscale"
enabled scale_filter && prepend avfilter_deps "swscale"
enabled scale2ref_filter && prepend avfilter_deps "swscale"
enabled showcqt_filter && prepend avfilter_deps "avformat swscale"
enabled signature_filter && prepend avfilter_deps "avcodec avformat"
@@ -7901,6 +7947,7 @@ if enabled loongarch; then
echo "LASX enabled ${lasx-no}"
fi
if enabled riscv; then
echo "RISC-V CBO Prefetch ${rv_zicbop-no}"
echo "RISC-V Vector enabled ${rvv-no}"
fi
echo "debug symbols ${debug-no}"
+155
View File
@@ -2,6 +2,161 @@ The last version increases of all libraries were on 2024-03-07
API changes, most recent first:
2024-09-23 - 6940a6de2f0 - lavu 59.38.100 - frame.h
Add AV_FRAME_DATA_VIEW_ID.
2024-09-23 - 6147385393a - lavc 61.18.100 - avcodec.h
Add a new flag AV_CODEC_EXPORT_DATA_ENHANCEMENTS for export_side_data.
2024-09-18 - df609af8e44 - lavc 61.17.100 - packet.h
Add AV_PKT_DATA_LCEVC.
2024-09-18 - ba0ef0860f0 - lavf 61.5.100 - avformat.h
Add AVStreamGroupLCEVC
Add AV_STREAM_GROUP_PARAMS_LCEVC
Add AVStreamGroup.params.lcevc
2024-09-18 - 58963182294 - lavc 61.16.100 - avcodec.h
Add AV_CODEC_ID_LCEVC.
2024-09-18 - 90d12c24c51 - lavu 59.37.100 - frame.h
Add AV_FRAME_DATA_LCEVC.
2024-09-08 - 3305767560a - lavc 61.13.100 - avcodec.h
Add avcodec_get_supported_config() and enum AVCodecConfig; deprecate
AVCodec.pix_fmts, AVCodec.sample_fmts, AVCodec.supported_framerates,
AVCodec.supported_samplerates and AVCodec.ch_layouts.
2024-09-06 - c35a51f4bb1 - lavc 61.12.100 - defs.h
Add AV_PROFILE_HEVC_MULTIVIEW_MAIN
2024-09-06 - 450a3f58edb - lavu 59.36.100 - opt.h
Add av_opt_set_array() and AV_OPT_ARRAY_REPLACE.
2024-08-27 - d89930f8666 - lavu 59.35.100 - opt.h
Add av_opt_get_array_size() and av_opt_get_array().
2024-08-18 - 8657eb9c3f4 - lavc 61.11.100 - avcodec.h
Clarify the documentation for get_buffer*() functions, making it
clear that the memory returned by them should not contain sensitive
information. This is not a change in the API, it is how it already worked
before.
2024-08-10 - 5f0f1f7b7a6 - lavu 59.34.100 - hwcontext_vulkan.h
Add qf and nb_qf to AVVulkanDeviceContext.
Deprecate queue_family_index, nb_graphics_queues,
queue_family_tx_index, nb_tx_queues.
queue_family_comp_index, nb_comp_queues.
queue_family_encode_index, nb_encode_queues.
queue_family_decode_index, and nb_decode_queues,
from AVVulkanDeviceContext.
2024-07-30 - e0f9f4d4915 - lavu 59.32.100 - cpu.h
Deprecate AV_CPU_FLAG_RVF and AV_CPU_FLAG_RVD without replacement.
Deprecate AV_CPU_FLAG_RVB_ADDR, subsumed into AV_CPU_FLAG_RVB.
2024-07-29 - 753f2aeed76 - lavu 59.31.100 - intreadwrite.h
Add AV_{R,W}{L,B}{16,32}A and AV_{R,W}B64A.
2024-07-28 - cbea92c84d4 - lavu 59.30.100 - dovi_meta.h
Add AVDOVIDecoderConfigurationRecord.dv_md_compression.
2024-07-25 - 45d7078a218 - lavu 59.29.100 - cpu.h
Add AV_CPU_FLAG_RVB.
2024-07-xx - xxxxxxxxxx - lavf 61 - avformat.h
Deprecate avformat_transfer_internal_stream_timing_info()
and av_stream_get_codec_timebase() without replacement.
2024-07-08 - 1b58f3af30c - lavc 61.10.100 - packet.h
Add AV_PKT_DATA_FRAME_CROPPING.
2024-07-07 - 46f7ea44563 - lavf 61.5.100 - avformat.h
Add AV_DISPOSITION_MULTILAYER
2024-07-02 - d822146f4fc - lavu 59.28.100 - hwcontext_d3d12va.h
Add AVD3D12VAFramesContext.flags
2024-06-28 - 8af0919cc66 - lavu 59.27.100 - stereo3d.h
Add AV_STEREO3D_UNSPEC and AV_STEREO3D_VIEW_UNSPEC.
2024-06-25 - e6baf4f3841 - lavu 59.26.100 - stereo3d.h
Add av_stereo3d_alloc_size().
2024-06-19 - cc587e69c6f - lavu 59.25.100 - dovi_meta.h
Add AVDOVIRpuDataHeader.ext_mapping_idc_0_4 and ext_mapping_idc_5_7.
2024-06-18 - cf2436a0b4d - lavu 59.24.100 - stereo3d.h
Add primary_eye, baseline, horizontal_disparity_adjustment, and
horizontal_field_of_view fields to AVStereo3D.
Add AVStereo3DPrimaryEye.
Add av_stereo3d_view_name.
Add av_stereo3d_view_from_name.
Add av_stereo3d_primary_eye_name.
Add av_stereo3d_primary_eye_from_name.
2024-06-18 - 57bfba35d6b - lavu 59.23.100 - spherical.h
Add AV_SPHERICAL_HALF_EQUIRECTANGULAR, AV_SPHERICAL_RECTILINEAR, and
AV_SPHERICAL_FISHEYE values to AVSphericalProjection, and initialize
to AV_SPHERICAL_RECTILINEAR on alloc.
2024-06-13 - 39c90d6466a - lavu 59.22.100 - common.h
Deprecate av_mod_uintp2[_c]() and replace it with av_zero_extend[_c]().
2024-06-08 - 91fd6ca000c - lavc 61.7.100 - defs.h
Add AV_PROFILE_AAC_USAC.
2024-06-02 - 63e166d8028 - lavu 59.21.100 - channel_layout.h
Add AV_CHAN_SIDE_SURROUND_RIGHT and AV_CH_SIDE_SURROUND_LEFT.
Add AV_CHAN_SIDE_SURROUND_RIGHT and AV_CH_SIDE_SURROUND_RIGHT.
Add AV_CHAN_TOP_SURROUND_LEFT and AV_CH_TOP_SURROUND_LEFT.
Add AV_CHAN_TOP_SURROUND_RIGHT and AV_CH_TOP_SURROUND_RIGHT.
2024-05-23 - 8c974494822 - lavu 59.20.100 - channel_layout.h
Add av_channel_layout_ambisonic_order().
2024-05-20 - 4c0bb7d4a91 - lavu 59.19.100 - hwcontext_qsv.h
Add AVQSVFramesContext.info
2024-05-10 - 01c5f4ad9fa - lavu 59.18.100 - cpu.h
Add AV_CPU_FLAG_RV_ZVBB.
2024-05-04 - d053290d8dd - lavu 59.17.100 - opt.h
Add AV_OPT_TYPE_UINT and av_opt_eval_uint().
2024-04-24 - 8616cfe0890 - lavu 59.16.100 - opt.h
Add AV_OPT_SERIALIZE_SEARCH_CHILDREN.
2024-04-11 - 6d0c89980c7 - lavc 61.5.102 - avcodec.h
AVCodecContext.decoded_side_data may now be set by libavcodec after
calling avcodec_open2().
2024-04-11 - 6d760c666d5 - lavu 59.15.100 - frame.h
Add av_mastering_display_metadata_alloc_size().
2024-04-11 - adb67bba064 - lavu 59.14.100 - frame.h
Add av_frame_side_data_add() and av_frame_side_data_remove().
Add AV_FRAME_SIDE_DATA_FLAG_REPLACE.
2024-04-03 - 29561c8e2d4 - lavu 59.13.100 - pixfmt.h
Add AVCOL_SPC_IPT_C2, AVCOL_SPC_YCGCO_RE and AVCOL_SPC_YCGCO_RO
to map new matrix coefficients defined by H.273 v3.
2024-04-03 - 4f55e16f2bc - lavu 59.12.100 - dovi_meta.h
Add AVDOVIMetadata.ext_block_{offset,size}, AVDOVIMetadata.num_ext_blocks,
AVDOVIDmData and AVDOVIDmLevel{1..6,8..11,254..255}, av_dovi_get_ext()
and av_dovi_find_level().
2024-04-03 - 78076ede296 - lavu 59.11.100 - dovi_meta.h
Add AVDOVIDataMapping.nlq_pivots.
2024-03-29 - ed9363052f4 - lavf 61.3.100 - avformat.h
Add AVFormatContext.duration_probesize.
2024-03-27 - 2621be35397 - lavu 59.10.100 - frame.h
Add AVSideDataDescriptor, enum AVSideDataProps, and
av_frame_side_data_desc().
-------- 8< --------- FFmpeg 7.0 was cut here -------- 8< ---------
2024-03-25 - 5df901ffa56 - lavu 59.7.100 - timestamp.h
+1 -1
View File
@@ -60,7 +60,7 @@ GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
$(GENTEXI): TAG = GENTEXI
$(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
$(M)doc/print_options $* > $@
$(M)doc/print_options$(HOSTEXESUF) $* > $@
doc/%.html: TAG = HTML
doc/%-all.html: TAG = HTML
+27
View File
@@ -101,6 +101,29 @@ Remove zero padding at the end of a packet.
Extract the core from a DCA/DTS stream, dropping extensions such as
DTS-HD.
@section dovi_rpu
Manipulate Dolby Vision metadata in a HEVC/AV1 bitstream, optionally enabling
metadata compression.
@table @option
@item strip
If enabled, strip all Dolby Vision metadata (configuration record + RPU data
blocks) from the stream.
@item compression
Which compression level to enable.
@table @samp
@item none
No metadata compression.
@item limited
Limited metadata compression scheme. Should be compatible with most devices.
This is the default.
@item extended
Extended metadata compression. Devices are not required to support this. Note
that this level currently behaves the same as @samp{limited} in libavcodec.
@end table
@end table
@section dump_extra
Add extradata to the beginning of the filtered packets except when
@@ -456,6 +479,10 @@ will replace the current ones if the stream is already cropped.
These fields are set in pixels. Note that some sizes may not be
representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
@item width
@item height
Set width and height after crop.
@item level
Set the level in the VPS and SPS. See H.265 section A.4 and tables
A.6 and A.7.
+7 -2
View File
@@ -82,8 +82,6 @@ The TC has 2 modes of operation: a RFC one and an internal one.
If the TC thinks it needs the input from the larger community, the TC can call for a RFC. Else, it can decide by itself.
If the disagreement involves a member of the TC, that member should recuse themselves from the decision.
The decision to use a RFC process or an internal discussion is a discretionary decision of the TC.
The TC can also reject a seizure for a few reasons such as: the matter was not discussed enough previously; it lacks expertise to reach a beneficial decision on the matter; or the matter is too trivial.
@@ -123,6 +121,13 @@ The decisions from the TC will be sent on the mailing list, with the [TC] tag.
Internally, the TC should take decisions with a majority, or using ranked-choice voting.
Each TC member must vote on such decision according to what is, in their view, best for the project.
If a TC member feels they are affected by a conflict of interest with regards to the case, they should announce it and recuse themselves from the TC
discussion and vote.
A conflict of interest is presumed to occur when a TC member has a personal interest (e.g. financial) in a specific outcome of the case.
The decision from the TC should be published with a summary of the reasons that lead to this decision.
The decisions from the TC are final, until the matters are reopened after no less than one year.
+46 -1
View File
@@ -38,6 +38,51 @@ Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0.
@end table
@section hevc
HEVC (AKA ITU-T H.265 or ISO/IEC 23008-2) decoder.
The decoder supports MV-HEVC multiview streams with at most two views. Views to
be output are selected by supplying a list of view IDs to the decoder (the
@option{view_ids} option). This option may be set either statically before
decoder init, or from the @code{get_format()} callback - useful for the case
when the view count or IDs change dynamically during decoding.
Only the base layer is decoded by default.
Note that if you are using the @code{ffmpeg} CLI tool, you should be using view
specifiers as documented in its manual, rather than the options documented here.
@subsection Options
@table @option
@item view_ids (MV-HEVC)
Specify a list of view IDs that should be output. This option can also be set to
a single '-1', which will cause all views defined in the VPS to be decoded and
output.
@item view_ids_available (MV-HEVC)
This option may be read by the caller to retrieve an array of view IDs available
in the active VPS. The array is empty for single-layer video.
The value of this option is guaranteed to be accurate when read from the
@code{get_format()} callback. It may also be set at other times (e.g. after
opening the decoder), but the value is informational only and may be incorrect
(e.g. when the stream contains multiple distinct VPS NALUs).
@item view_pos_available (MV-HEVC)
This option may be read by the caller to retrieve an array of view positions
(left, right, or unspecified) available in the active VPS, as
@code{AVStereo3DView} values. When the array is available, its elements apply to
the corresponding elements of @option{view_ids_available}, i.e.
@code{view_pos_available[i]} contains the position of view with ID
@code{view_ids_available[i]}.
Same validity restrictions as for @option{view_ids_available} apply to
this option.
@end table
@section rawvideo
Raw video decoder.
@@ -157,7 +202,7 @@ Force to use a specific number of threads
@section QSV Decoders
The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC,
JPEG/MJPEG, VP8, VP9, AV1).
JPEG/MJPEG, VP8, VP9, AV1, VVC).
@subsection Common Options
+30
View File
@@ -1038,6 +1038,36 @@ the command:
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
@end example
@anchor{rcwtdec}
@section rcwt
RCWT (Raw Captions With Time) is a format native to ccextractor, a commonly
used open source tool for processing 608/708 Closed Captions (CC) sources.
For more information on the format, see @ref{rcwtenc,,,ffmpeg-formats}.
This demuxer implements the specification as of March 2024, which has
been stable and unchanged since April 2014.
@subsection Examples
@itemize
@item
Render CC to ASS using the built-in decoder:
@example
ffmpeg -i CC.rcwt.bin CC.ass
@end example
Note that if your output appears to be empty, you may have to manually
set the decoder's @option{data_field} option to pick the desired CC substream.
@item
Convert an RCWT backup to Scenarist (SCC) format:
@example
ffmpeg -i CC.rcwt.bin -c:s copy CC.scc
@end example
Note that the SCC format does not support all of the possible CC extensions
that can be stored in RCWT (such as EIA-708).
@end itemize
@section sbg
SBaGen script demuxer.
+11 -2
View File
@@ -390,6 +390,10 @@ If you apply a patch, send an
answer to ffmpeg-devel (or wherever you got the patch from) saying that
you applied the patch.
@subheading Credit any researchers
If a commit/patch fixes an issues found by some researcher, always credit the
researcher in the commit message for finding/reporting the issue.
@subheading Always wait long enough before pushing changes
Do NOT commit to code actively maintained by others without permission.
Send a patch to ffmpeg-devel. If no one answers within a reasonable
@@ -634,6 +638,11 @@ patch is inline or attached per mail.
You can check @url{https://patchwork.ffmpeg.org}, if your patch does not show up, its mime type
likely was wrong.
@subheading How to setup git send-email?
Please see @url{https://git-send-email.io/}.
For gmail additionally see @url{https://shallowsky.com/blog/tech/email/gmail-app-passwds.html}.
@subheading Sending patches from email clients
Using @code{git send-email} might not be desirable for everyone. The
following trick allows to send patches via email clients in a safe
@@ -678,7 +687,7 @@ number) in @file{libavcodec/version.h} or @file{libavformat/version.h}?
Did you register it in @file{allcodecs.c} or @file{allformats.c}?
@item
Did you add the AVCodecID to @file{avcodec.h}?
Did you add the AVCodecID to @file{codec_id.h}?
When adding new codec IDs, also add an entry to the codec descriptor
list in @file{libavcodec/codec_desc.c}.
@@ -693,7 +702,7 @@ already being compiled by some other rule, like a raw demuxer.
@item
Did you add an entry to the table of supported formats or codecs in
@file{doc/general.texi}?
@file{doc/general_contents.texi}?
@item
Did you add an entry in the Changelog?
+151 -7
View File
@@ -144,8 +144,7 @@ If this option is unspecified it is set to @samp{aac_low}.
AC-3 audio encoders.
These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
the undocumented RealAudio 3 (a.k.a. dnet).
These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366.
The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
encoder only uses fixed-point integer math. This does not mean that one is
@@ -814,6 +813,63 @@ ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
@end example
@end itemize
@anchor{liblc3-enc}
@section liblc3
liblc3 LC3 (Low Complexity Communication Codec) encoder wrapper.
Requires the presence of the liblc3 headers and library during configuration.
You need to explicitly configure the build with @code{--enable-liblc3}.
This encoder has support for the Bluetooth SIG LC3 codec for the LE Audio
protocol, and the following features of LC3plus:
@itemize
@item
Frame duration of 2.5 and 5ms.
@item
High-Resolution mode, 48 KHz, and 96 kHz sampling rates.
@end itemize
For more information see the liblc3 project at
@url{https://github.com/google/liblc3}.
@subsection Options
The following options are mapped on the shared FFmpeg codec options.
@table @option
@item b @var{bitrate}
Set the bit rate in bits/s. This will determine the fixed size of the encoded
frames, for a selected frame duration.
@item ar @var{frequency}
Set the audio sampling rate (in Hz).
@item channels
Set the number of audio channels.
@item frame_duration
Set the audio frame duration in milliseconds. Default value is 10ms.
Allowed frame durations are 2.5ms, 5ms, 7.5ms and 10ms.
LC3 (Bluetooth LE Audio), allows 7.5ms and 10ms; and LC3plus 2.5ms, 5ms
and 10ms.
The 10ms frame duration is available in LC3 and LC3 plus standard.
In this mode, the produced bitstream can be referenced either as LC3 or LC3plus.
@item high_resolution @var{boolean}
Enable the high-resolution mode if set to 1. The high-resolution mode is
available with all LC3plus frame durations and for a sampling rate of 48 KHz,
and 96 KHz.
The encoder automatically turns off this mode at lower sampling rates and
activates it at 96 KHz.
This mode should be preferred at high bitrates. In this mode, the audio
bandwidth is always up to the Nyquist frequency, compared to LC3 at 48 KHz,
which limits the bandwidth to 20 KHz.
@end table
@anchor{libmp3lame}
@section libmp3lame
@@ -2322,6 +2378,70 @@ Indicates frame duration
For more information about libvpx see:
@url{http://www.webmproject.org/}
@section libvvenc
VVenC H.266/VVC encoder wrapper.
This encoder requires the presence of the libvvenc headers and library
during configuration. You need to explicitly configure the build with
@option{--enable-libvvenc}.
The VVenC project website is at
@url{https://github.com/fraunhoferhhi/vvenc}.
@subsection Supported Pixel Formats
VVenC supports only 10-bit color spaces as input. But the internal (encoded)
bit depth can be set to 8-bit or 10-bit at runtime.
@subsection Options
@table @option
@item b
Sets target video bitrate.
@item g
Set the GOP size. Currently support for g=1 (Intra only) or default.
@item preset
Set the VVenC preset.
@item levelidc
Set level idc.
@item tier
Set vvc tier.
@item qp
Set constant quantization parameter.
@item subopt @var{boolean}
Set subjective (perceptually motivated) optimization. Default is 1 (on).
@item bitdepth8 @var{boolean}
Set 8bit coding mode instead of using 10bit. Default is 0 (off).
@item period
set (intra) refresh period in seconds.
@item vvenc-params
Set vvenc options using a list of @var{key}=@var{value} couples separated
by ":". See @command{vvencapp --fullhelp} or @command{vvencFFapp --fullhelp} for a list of options.
For example, the options might be provided as:
@example
intraperiod=64:decodingrefreshtype=idr:poc0idr=1:internalbitdepth=8
@end example
For example the encoding options might be provided with @option{-vvenc-params}:
@example
ffmpeg -i input -c:v libvvenc -b 1M -vvenc-params intraperiod=64:decodingrefreshtype=idr:poc0idr=1:internalbitdepth=8 output.mp4
@end example
@end table
@section libwebp
libwebp WebP Image encoder wrapper
@@ -3045,9 +3165,6 @@ Enable high quality AC prediction.
@item gray
Only encode grayscale.
@item gmc
Enable the use of global motion compensation (GMC).
@item qpel
Enable quarter-pixel motion compensation.
@@ -3059,7 +3176,9 @@ Place global headers in extradata instead of every keyframe.
@end table
@item trellis
@item gmc
Enable the use of global motion compensation (GMC). Default is 0
(disabled).
@item me_quality
Set motion estimation quality level. Possible values in decreasing order of
@@ -3114,6 +3233,9 @@ be better than any of the two specified individually. In other
words, the resulting quality will be the worse one of the two
effects.
@item trellis
Set rate-distortion optimal quantization.
@item ssim
Set structural similarity (SSIM) displaying method. Possible values:
@@ -3488,6 +3610,20 @@ Change these value to reset qsv codec's bitrate control configuration.
@item @var{pic_timing_sei}
Supported in h264_qsv and hevc_qsv.
Change this value to reset qsv codec's pic_timing_sei configuration.
@item @var{qsv_params}
Set QSV encoder parameters as a colon-separated list of key-value pairs.
The @option{qsv_params} should be formatted as @code{key1=value1:key2=value2:...}.
These parameters are passed directly to the underlying Intel Quick Sync Video (QSV) encoder using the MFXSetParameter function.
Example:
@example
ffmpeg -i input.mp4 -c:v h264_qsv -qsv_params "CodingOption1=1:CodingOption2=2" output.mp4
@end example
This option allows fine-grained control over various encoder-specific settings provided by the QSV encoder.
@end table
@subsection H264 options
@@ -3969,10 +4105,18 @@ Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provi
more accurate bitrate control to minimize the variance of bitstream size frame
by frame. Value: -1-default 0-off 1-on
@item max_frame_size
@item @var{max_frame_size}
Set the allowed max size in bytes for each frame. If the frame size exceeds
the limitation, encoder will adjust the QP value to control the frame size.
Invalid in CQP rate control mode.
@item @var{max_frame_size_i}
Maximum encoded frame size for I frames in bytes. If this value is set as larger
than zero, then for I frames the value set by max_frame_size is ignored.
@item @var{max_frame_size_p}
Maximum encoded frame size for P frames in bytes. If this value is set as larger
than zero, then for P frames the value set by max_frame_size is ignored.
@end table
@section snow
+1
View File
@@ -32,6 +32,7 @@
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/file.h>
#include <libavutil/mem.h>
struct buffer_data {
uint8_t *ptr;
+20
View File
@@ -37,6 +37,7 @@
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/channel_layout.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
static const char *filter_descr = "aresample=8000,aformat=sample_fmts=s16:channel_layouts=mono";
@@ -279,6 +280,25 @@ int main(int argc, char **argv)
}
av_packet_unref(packet);
}
if (ret == AVERROR_EOF) {
/* signal EOF to the filtergraph */
if (av_buffersrc_add_frame_flags(buffersrc_ctx, NULL, 0) < 0) {
av_log(NULL, AV_LOG_ERROR, "Error while closing the filtergraph\n");
goto end;
}
/* pull remaining frames from the filtergraph */
while (1) {
ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
break;
if (ret < 0)
goto end;
print_frame(filt_frame);
av_frame_unref(filt_frame);
}
}
end:
avfilter_graph_free(&filter_graph);
avcodec_free_context(&dec_ctx);
+20
View File
@@ -36,6 +36,7 @@
#include <libavformat/avformat.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
const char *filter_descr = "scale=78:24,transpose=cclock";
@@ -276,6 +277,25 @@ int main(int argc, char **argv)
}
av_packet_unref(packet);
}
if (ret == AVERROR_EOF) {
/* signal EOF to the filtergraph */
if (av_buffersrc_add_frame_flags(buffersrc_ctx, NULL, 0) < 0) {
av_log(NULL, AV_LOG_ERROR, "Error while closing the filtergraph\n");
goto end;
}
/* pull remaining frames from the filtergraph */
while (1) {
ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
break;
if (ret < 0)
goto end;
display_frame(filt_frame, buffersink_ctx->inputs[0]->time_base);
av_frame_unref(filt_frame);
}
}
end:
avfilter_graph_free(&filter_graph);
avcodec_free_context(&dec_ctx);
+1 -3
View File
@@ -138,11 +138,9 @@ static int decode_packet(AVCodecContext *dec, const AVPacket *pkt)
ret = output_audio_frame(frame);
av_frame_unref(frame);
if (ret < 0)
return ret;
}
return 0;
return ret;
}
static int open_codec_context(int *stream_idx,
+8 -8
View File
@@ -41,15 +41,15 @@
#include <stdio.h>
#include <stdlib.h>
#include "libavutil/channel_layout.h"
#include "libavutil/md5.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include <libavutil/channel_layout.h>
#include <libavutil/md5.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
#include <libavutil/samplefmt.h>
#include "libavfilter/avfilter.h"
#include "libavfilter/buffersink.h"
#include "libavfilter/buffersrc.h"
#include <libavfilter/avfilter.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#define INPUT_SAMPLERATE 48000
#define INPUT_FORMAT AV_SAMPLE_FMT_FLTP
+1
View File
@@ -35,6 +35,7 @@
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/mem.h>
#include <libavutil/pixdesc.h>
#include <libavutil/hwcontext.h>
#include <libavutil/opt.h>
+1 -2
View File
@@ -347,8 +347,7 @@ static int write_audio_frame(AVFormatContext *oc, OutputStream *ost)
if (frame) {
/* convert samples from native format to destination codec format, using the resampler */
/* compute destination number of samples */
dst_nb_samples = av_rescale_rnd(swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples,
c->sample_rate, c->sample_rate, AV_ROUND_UP);
dst_nb_samples = swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples;
av_assert0(dst_nb_samples == frame->nb_samples);
/* when we pass a frame to the encoder, it may keep a reference to it
+8 -8
View File
@@ -30,16 +30,16 @@
#include <stdio.h>
#include "libavformat/avformat.h"
#include "libavformat/avio.h"
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include "libavcodec/avcodec.h"
#include <libavcodec/avcodec.h>
#include "libavutil/buffer.h"
#include "libavutil/error.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_qsv.h"
#include "libavutil/mem.h"
#include <libavutil/buffer.h>
#include <libavutil/error.h>
#include <libavutil/hwcontext.h>
#include <libavutil/hwcontext_qsv.h>
#include <libavutil/mem.h>
static int get_format(AVCodecContext *avctx, const enum AVPixelFormat *pix_fmts)
{
+4 -6
View File
@@ -38,6 +38,7 @@
#include <errno.h>
#include <libavutil/hwcontext.h>
#include <libavutil/mem.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/opt.h>
@@ -75,8 +76,7 @@ static int str_to_dict(char* optstr, AVDictionary **opt)
if (value == NULL)
return AVERROR(EINVAL);
av_dict_set(opt, key, value, 0);
} while(key != NULL);
return 0;
} while(1);
}
static int dynamic_set_parameter(AVCodecContext *avctx)
@@ -334,17 +334,15 @@ static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec, char *optstr)
fail:
av_frame_free(&frame);
if (ret < 0)
return ret;
}
return 0;
return ret;
}
int main(int argc, char **argv)
{
const AVCodec *enc_codec;
int ret = 0;
AVPacket *dec_pkt;
AVPacket *dec_pkt = NULL;
if (argc < 5 || (argc - 5) % 2) {
av_log(NULL, AV_LOG_ERROR, "Usage: %s <input file> <encoder> <output file>"
+1
View File
@@ -28,6 +28,7 @@
* input to the output without transcoding.
*/
#include <libavutil/mem.h>
#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>
+1
View File
@@ -35,6 +35,7 @@
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/channel_layout.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
#include <libavutil/pixdesc.h>
+11 -10
View File
@@ -29,19 +29,20 @@
#include <stdio.h>
#include "libavformat/avformat.h"
#include "libavformat/avio.h"
#include <libavutil/mem.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include "libavcodec/avcodec.h"
#include <libavcodec/avcodec.h>
#include "libavutil/audio_fifo.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/frame.h"
#include "libavutil/opt.h"
#include <libavutil/audio_fifo.h>
#include <libavutil/avassert.h>
#include <libavutil/avstring.h>
#include <libavutil/channel_layout.h>
#include <libavutil/frame.h>
#include <libavutil/opt.h>
#include "libswresample/swresample.h"
#include <libswresample/swresample.h>
/* The output bit rate in bit/s */
#define OUTPUT_BIT_RATE 96000
+4
View File
@@ -88,6 +88,10 @@ static int encode_write(AVCodecContext *avctx, AVFrame *frame, FILE *fout)
enc_pkt->stream_index = 0;
ret = fwrite(enc_pkt->data, enc_pkt->size, 1, fout);
av_packet_unref(enc_pkt);
if (ret != enc_pkt->size) {
ret = AVERROR(errno);
break;
}
}
end:
+1 -3
View File
@@ -215,10 +215,8 @@ static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec)
fail:
av_frame_free(&frame);
if (ret < 0)
return ret;
}
return 0;
return ret;
}
int main(int argc, char **argv)
+149 -16
View File
@@ -229,12 +229,16 @@ successive integers starting at zero. These indices should then be used to refer
to loopback decoders in complex filtergraph link labels, as described in the
documentation for @option{-filter_complex}.
Decoding AVOptions can be passed to loopback decoders by placing them before
@code{-dec}, analogously to input/output options.
E.g. the following example:
@example
ffmpeg -i INPUT \
-map 0:v:0 -c:v libx264 -crf 45 -f null - \
-dec 0:0 -filter_complex '[0:v][dec:0]hstack[stack]' \
-threads 3 -dec 0:0 \
-filter_complex '[0:v][dec:0]hstack[stack]' \
-map '[stack]' -c:v ffv1 OUTPUT
@end example
@@ -244,11 +248,13 @@ reads an input video and
(line 2) encodes it with @code{libx264} at low quality;
@item
(line 3) decodes this encoded stream and places it side by side with the
original input video;
(line 3) decodes this encoded stream using 3 threads;
@item
(line 4) combined video is then losslessly encoded and written into
(line 4) places decoded video side by side with the original input video;
@item
(line 5) combined video is then losslessly encoded and written into
@file{OUTPUT}.
@end itemize
@@ -657,10 +663,11 @@ Not all muxers support embedded thumbnails, and those who do, only support a few
Creates a program with the specified @var{title}, @var{program_num} and adds the specified
@var{stream}(s) to it.
@item -stream_group type=@var{type}:st=@var{stream}[:st=@var{stream}][:stg=@var{stream_group}][:id=@var{stream_group_id}...] (@emph{output})
@item -stream_group [map=@var{input_file_id}=@var{stream_group}][type=@var{type}:]st=@var{stream}[:st=@var{stream}][:stg=@var{stream_group}][:id=@var{stream_group_id}...] (@emph{output})
Creates a stream group of the specified @var{type}, @var{stream_group_id} and adds the specified
@var{stream}(s) and/or previously defined @var{stream_group}(s) to it.
Creates a stream group of the specified @var{type} and @var{stream_group_id}, or by
@var{map}ping an input group, adding the specified @var{stream}(s) and/or previously
defined @var{stream_group}(s) to it.
@var{type} can be one of the following:
@table @option
@@ -857,6 +864,27 @@ all sub-mix element's @var{annotations}s
@end table
E.g. to create an scalable 5.1 IAMF file from several WAV input files
@example
ffmpeg -i front.wav -i back.wav -i center.wav -i lfe.wav
-map 0:0 -map 1:0 -map 2:0 -map 3:0 -c:a opus
-stream_group type=iamf_audio_element:id=1:st=0:st=1:st=2:st=3,
demixing=parameter_id=998,
recon_gain=parameter_id=101,
layer=ch_layout=stereo,
layer=ch_layout=5.1,
-stream_group type=iamf_mix_presentation:id=2:stg=0:annotations=en-us=Mix_Presentation,
submix=parameter_id=100:parameter_rate=48000|element=stg=0:parameter_id=100:annotations=en-us=Scalable_Submix|layout=sound_system=stereo|layout=sound_system=5.1
-streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 output.iamf
@end example
To copy the two stream groups (Audio Element and Mix Presentation) from an input IAMF file with four
streams into an mp4 output
@example
ffmpeg -i input.iamf -c:a copy -stream_group map=0=0:st=0:st=1:st=2:st=3 -stream_group map=0=1:stg=0
-streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 output.mp4
@end example
@item -target @var{type} (@emph{output})
Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv},
@code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or
@@ -1351,6 +1379,21 @@ Note that forcing too many keyframes is very harmful for the lookahead
algorithms of certain encoders: using fixed-GOP options or similar
would be more efficient.
@item -apply_cropping[:@var{stream_specifier}] @var{source} (@emph{input,per-stream})
Automatically crop the video after decoding according to file metadata.
Default is @emph{all}.
@table @option
@item none (0)
Don't apply any cropping metadata.
@item all (1)
Apply both codec and container level croppping. This is the default mode.
@item codec (2)
Apply codec level croppping.
@item container (3)
Apply container level croppping.
@end table
@item -copyinkf[:@var{stream_specifier}] (@emph{output,per-stream})
When doing stream copy, copy also non-key frames found at the
beginning.
@@ -1415,6 +1458,11 @@ The following options are recognized:
When @var{device} is not specified, use this option to specify the name of the kernel
driver associated with the desired device. This option is available only when
the hardware acceleration method @emph{drm} and @emph{vaapi} are enabled.
@item vendor_id
When @var{device} and @var{kernel_driver} are not specified, use this option to specify
the vendor id associated with the desired device. This option is available only when the
hardware acceleration method @emph{drm} and @emph{vaapi} are enabled and @emph{kernel_driver}
is not specified.
@end table
Examples:
@@ -1430,6 +1478,9 @@ Create a vaapi device on DirectX adapter 1.
@item -init_hw_device vaapi:,kernel_driver=i915
Create a vaapi device on a device associated with kernel driver @samp{i915}.
@item -init_hw_device vaapi:,vendor_id=0x8086
Create a vaapi device on a device associated with vendor id @samp{0x8086}.
@end table
@item vdpau
@@ -1691,12 +1742,21 @@ This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter optio
@table @option
@item -atag @var{fourcc/tag} (@emph{output})
Force audio tag/fourcc. This is an alias for @code{-tag:a}.
@item -ch_layout[:@var{stream_specifier}] @var{layout} (@emph{input/output,per-stream})
Alias for @code{-channel_layout}.
@item -channel_layout[:@var{stream_specifier}] @var{layout} (@emph{input/output,per-stream})
Set the audio channel layout. For output streams it is set by default to the
input channel layout. For input streams it overrides the channel layout of the
input. Not all decoders respect the overridden channel layout. This option
also sets the channel layout for audio grabbing devices and raw demuxers
and is mapped to the corresponding demuxer option.
@item -guess_layout_max @var{channels} (@emph{input,per-stream})
If some input channel layout is not known, try to guess only if it
corresponds to at most the specified number of channels. For example, 2
tells to @command{ffmpeg} to recognize 1 channel as mono and 2 channels as
stereo but not 6 channels as 5.1. The default is to always try to guess. Use
0 to disable all guessing.
0 to disable all guessing. Using the @code{-channel_layout} option to
explicitly specify an input layout also disables guessing.
@end table
@section Subtitle options
@@ -1739,7 +1799,7 @@ Set the size of the canvas used to render subtitles.
@section Advanced options
@table @option
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][?] | @var{[linklabel]} (@emph{output})
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][:@var{view_specifier}][?] | @var{[linklabel]} (@emph{output})
Create one or more streams in the output file. This option has two forms for
specifying the data source(s): the first selects one or more streams from some
@@ -1754,6 +1814,26 @@ only those streams that match the specifier are used (see the
A @code{-} character before the stream identifier creates a "negative" mapping.
It disables matching streams from already created mappings.
An optional @var{view_specifier} may be given after the stream specifier, which
for multiview video specifies the view to be used. The view specifier may have
one of the following formats:
@table @option
@item view:@var{view_id}
select a view by its ID; @var{view_id} may be set to 'all' to use all the views
interleaved into one stream;
@item vidx:@var{view_idx}
select a view by its index; i.e. 0 is the base view, 1 is the first non-base
view, etc.
@item vpos:@var{position}
select a view by its display position; @var{position} may be @code{left} or
@code{right}
@end table
The default for transcoding is to only use the base view, i.e. the equivalent of
@code{vidx:0}. For streamcopy, view specifiers are not supported and all views
are always copied.
A trailing @code{?} after the stream index will allow the map to be
optional: if the map matches no streams the map will be ignored instead
of failing. Note the map will still fail if an invalid input file index
@@ -2137,15 +2217,68 @@ Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
outputs. For simple graphs -- those with one input and one output of the same
type -- see the @option{-filter} options. @var{filtergraph} is a description of
the filtergraph, as described in the ``Filtergraph syntax'' section of the
ffmpeg-filters manual.
ffmpeg-filters manual. This option may be specified multiple times - each use
creates a new complex filtergraph.
Input link labels must refer to either input streams or loopback decoders. For
input streams, use the @code{[file_index:stream_specifier]} syntax (i.e. the
same as @option{-map} uses). If @var{stream_specifier} matches multiple streams,
the first one will be used.
Inputs to a complex filtergraph may come from different source types,
distinguished by the format of the corresponding link label:
@itemize
@item
To connect an input stream, use @code{[file_index:stream_specifier]} (i.e. the
same syntax as @option{-map}). If @var{stream_specifier} matches multiple
streams, the first one will be used. For multiview video, the stream specifier
may be followed by the view specifier, see documentation for the @option{-map}
option for its syntax.
For decoders, the link label must be [dec:@var{dec_idx}], where @var{dec_idx} is
the index of the loopback decoder to be connected to given input.
@item
To connect a loopback decoder use [dec:@var{dec_idx}], where @var{dec_idx} is
the index of the loopback decoder to be connected to given input. For multiview
video, the decoder index may be followed by the view specifier, see
documentation for the @option{-map} option for its syntax.
@item
To connect an output from another complex filtergraph, use its link label. E.g
the following example:
@example
ffmpeg -i input.mkv \
-filter_complex '[0:v]scale=size=hd1080,split=outputs=2[for_enc][orig_scaled]' \
-c:v libx264 -map '[for_enc]' output.mkv \
-dec 0:0 \
-filter_complex '[dec:0][orig_scaled]hstack[stacked]' \
-map '[stacked]' -c:v ffv1 comparison.mkv
@end example
reads an input video and
@itemize
@item
(line 2) uses a complex filtergraph with one input and two outputs
to scale the video to 1920x1080 and duplicate the result to both
outputs;
@item
(line 3) encodes one scaled output with @code{libx264} and writes the result to
@file{output.mkv};
@item
(line 4) decodes this encoded stream with a loopback decoder;
@item
(line 5) places the output of the loopback decoder (i.e. the
@code{libx264}-encoded video) side by side with the scaled original input;
@item
(line 6) combined video is then losslessly encoded and written into
@file{comparison.mkv}.
@end itemize
Note that the two filtergraphs cannot be combined into one, because then there
would be a cycle in the transcoding pipeline (filtergraph output goes to
encoding, from there to decoding, then back to the same graph), and such cycles
are not allowed.
@end itemize
An unlabeled input will be connected to the first unused input stream of the
matching type.
+1
View File
@@ -255,6 +255,7 @@
<xsd:attribute name="metadata" type="xsd:int" use="required" />
<xsd:attribute name="dependent" type="xsd:int" use="required" />
<xsd:attribute name="still_image" type="xsd:int" use="required" />
<xsd:attribute name="multilayer" type="xsd:int" use="required" />
</xsd:complexType>
<xsd:complexType name="streamType">
+4
View File
@@ -79,6 +79,10 @@ Match the stream by stream id (e.g. PID in MPEG-TS container).
Matches streams with the metadata tag @var{key} having the specified value. If
@var{value} is not given, matches streams that contain the given tag with any
value.
@item disp:@var{dispositions}[:@var{additional_stream_specifier}]
Matches streams with the given disposition(s). @var{dispositions} is a list of
one or more dispositions (as printed by the @option{-dispositions} option)
joined with '+'.
@item u
Matches streams with usable configuration, the codec must be defined and the
essential information such as video dimension or audio sample rate must be present.
+463 -100
View File
@@ -11092,8 +11092,8 @@ By default, a component curve is defined by the two points @var{(0;0)} and
"adjusted" to its own value, which means no change to the image.
The filter allows you to redefine these two points and add some more. A new
curve will be define to pass smoothly through all these new coordinates. The
new defined points needs to be strictly increasing over the x-axis, and their
curve will be defined to pass smoothly through all these new coordinates. The
new defined points need to be strictly increasing over the x-axis, and their
@var{x} and @var{y} values must be in the @var{[0;1]} interval. The curve is
formed by using a natural or monotonic cubic spline interpolation, depending
on the @var{interp} option (default: @code{natural}). The @code{natural}
@@ -17071,8 +17071,8 @@ ffmpeg \
-hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i dis.obu \
-hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i ref.obu \
-filter_complex "
[0:v]scale_cuda=format=yuv420p[ref]; \
[1:v]scale_cuda=format=yuv420p[dis]; \
[0:v]scale_cuda=format=yuv420p[dis]; \
[1:v]scale_cuda=format=yuv420p[ref]; \
[dis][ref]libvmaf_cuda=log_fmt=json:log_path=output.json
" \
-f null -
@@ -17290,6 +17290,9 @@ The command accepts the same syntax of the corresponding option.
If the specified expression is not valid, it is kept at its current
value.
@anchor{lutrgb}
@anchor{lutyuv}
@anchor{lut}
@section lut, lutrgb, lutyuv
Compute a look-up table for binding each pixel component input value
@@ -19941,6 +19944,7 @@ pseudocolor="'if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-
@end example
@end itemize
@anchor{psnr}
@section psnr
Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
@@ -20989,8 +20993,8 @@ the next filter, the scale filter will convert the input to the
requested format.
@subsection Options
The filter accepts the following options, or any of the options
supported by the libswscale scaler.
The filter accepts the following options, any of the options supported
by the libswscale scaler, as well as any of the @ref{framesync} options.
See @ref{scaler_options,,the ffmpeg-scaler manual,ffmpeg-scaler} for
the complete list of scaler options.
@@ -21134,6 +21138,21 @@ Set full range (0-255 in case of 8-bit luma).
Set "MPEG" range (16-235 in case of 8-bit luma).
@end table
@item in_chroma_loc
@item out_chroma_loc
Set in/output chroma sample location. If not specified, center-sited chroma
is used by default. Possible values:
@table @samp
@item auto, unknown
@item left
@item center
@item topleft
@item top
@item bottomleft
@item bottom
@end table
@item force_original_aspect_ratio
Enable decreasing or increasing output video width or height if necessary to
keep the original aspect ratio. Possible values:
@@ -21228,6 +21247,16 @@ The position (byte offset) of the frame in the input stream, or NaN if
this information is unavailable and/or meaningless (for example in case of synthetic video).
Only available with @code{eval=frame}.
Deprecated, do not use.
@item ref_w, rw
@item ref_h, rh
@item ref_a
@item ref_dar, rdar
@item ref_n
@item ref_t
@item ref_pos
Eqvuialent to the above, but for a second reference input. If any of these
variables are present, this filter accepts two inputs.
@end table
@subsection Examples
@@ -21329,6 +21358,20 @@ making sure the resulting resolution is even (required by some codecs):
@example
scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
@end example
@item
Scale a subtitle stream (sub) to match the main video (main) in size before
overlaying. ("scale2ref")
@example
'[main]split[a][b]; [ref][a]scale=rw:rh[c]; [b][c]overlay'
@end example
@item
Scale a logo to 1/10th the height of a video, while preserving its display
aspect ratio.
@example
[logo-in][video-in]scale=w=oh*dar:h=rh/10[logo-out]
@end example
@end itemize
@subsection Commands
@@ -21564,79 +21607,6 @@ Only available with @code{eval=frame}.
Deprecated, do not use.
@end table
@section scale2ref
Scale (resize) the input video, based on a reference video.
See the scale filter for available options, scale2ref supports the same but
uses the reference video instead of the main input as basis. scale2ref also
supports the following additional constants for the @option{w} and
@option{h} options:
@table @var
@item main_w
@item main_h
The main input video's width and height
@item main_a
The same as @var{main_w} / @var{main_h}
@item main_sar
The main input video's sample aspect ratio
@item main_dar, mdar
The main input video's display aspect ratio. Calculated from
@code{(main_w / main_h) * main_sar}.
@item main_hsub
@item main_vsub
The main input video's horizontal and vertical chroma subsample values.
For example for the pixel format "yuv422p" @var{hsub} is 2 and @var{vsub}
is 1.
@item main_n
The (sequential) number of the main input frame, starting from 0.
Only available with @code{eval=frame}.
@item main_t
The presentation timestamp of the main input frame, expressed as a number of
seconds. Only available with @code{eval=frame}.
@item main_pos
The position (byte offset) of the frame in the main input stream, or NaN if
this information is unavailable and/or meaningless (for example in case of synthetic video).
Only available with @code{eval=frame}.
@end table
@subsection Examples
@itemize
@item
Scale a subtitle stream (b) to match the main video (a) in size before overlaying
@example
'scale2ref[b][a];[a][b]overlay'
@end example
@item
Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
@example
[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
@end example
@end itemize
@subsection Commands
This filter supports the following commands:
@table @option
@item width, w
@item height, h
Set the output video dimension expression.
The command accepts the same syntax of the corresponding option.
If the specified expression is not valid, it is kept at its current
value.
@end table
@section scale2ref_npp
Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input
@@ -22119,6 +22089,23 @@ Keep the same colorspace property (default).
@item chroma-derived-c
@item ictcp
@end table
@item chroma_location
Set the chroma sample location.
Available values are:
@table @samp
@item auto
Keep the same chroma location (default).
@item unspecified, unknown
@item left
@item center
@item topleft
@item top
@item bottomleft
@item bottom
@end table
@end table
@section sharpen_npp
@@ -22702,9 +22689,27 @@ whether a pixel should be blurred or not. The option value must be an
integer in the range [-30,30]. A value of 0 will filter all the image,
a value included in [0,30] will filter flat areas and a value included
in [-30,0] will filter edges. Default value is @option{luma_threshold}.
@item alpha_radius, ar
Set the alpha radius. The option value must be a float number in
the range [0.1,5.0] that specifies the variance of the gaussian filter
used to blur the image (slower if larger). Default value is @option{luma_radius}.
@item alpha_strength, as
Set the alpha strength. The option value must be a float number
in the range [-1.0,1.0] that configures the blurring. A value included
in [0.0,1.0] will blur the image whereas a value included in
[-1.0,0.0] will sharpen the image. Default value is @option{luma_strength}.
@item alpha_threshold, at
Set the alpha threshold used as a coefficient to determine
whether a pixel should be blurred or not. The option value must be an
integer in the range [-30,30]. A value of 0 will filter all the image,
a value included in [0,30] will filter flat areas and a value included
in [-30,0] will filter edges. Default value is @option{luma_threshold}.
@end table
If a chroma option is not explicitly set, the corresponding luma value
If a chroma or alpha option is not explicitly set, the corresponding luma value
is set.
@section sobel
@@ -23574,12 +23579,13 @@ tile=3x2:nb_frames=5:padding=7:margin=2
@end itemize
@section tiltandshift
Apply tilt-and-shift effect.
What happens when you invert time and space?
Normally a video is composed of several frames that represent a different
instant of time and shows a scence that evolves in the space captured by the
frame. This filter is the antipode of that concept, taking inspiration by
instant of time and shows a scene that evolves in the space captured by the
frame. This filter is the antipode of that concept, taking inspiration from
tilt and shift photography.
A filtered frame contains the whole timeline of events composing the sequence,
@@ -23587,13 +23593,13 @@ and this is obtained by placing a slice of pixels from each frame into a single
one. However, since there are no infinite-width frames, this is done up the
width of the input frame, and a video is recomposed by shifting away one
column for each subsequent frame. In order to map space to time, the filter
tilts each input frame as well, so that motion is preseved. This is accomplished
tilts each input frame as well, so that motion is preserved. This is accomplished
by progressively selecting a different column from each input frame.
The end result is a sort of inverted parralax, so that far away objects move
The end result is a sort of inverted parallax, so that far away objects move
much faster that the ones in the front. The ideal conditions for this video
effect are when there is either very little motion and the backgroud is static,
or when there is a lot of motion and a very wide depth of field (eg. wide
or when there is a lot of motion and a very wide depth of field (e.g. wide
panorama, while moving on a train).
The filter accepts the following parameters:
@@ -23618,7 +23624,7 @@ How many columns should be inserted before end of filtering.
@end table
Normally the filter shifts and tils from the very first frame, and stops when
Normally the filter shifts and tilts from the very first frame, and stops when
the last one is received. However, before filtering starts, normal video may
be preseved, so that the effect is slowly shifted in its place. Similarly,
the last video frame may be reconstructed at the end. Alternatively it is
@@ -23626,7 +23632,7 @@ possible to just start and end with black.
@table @samp
@item none
Filtering is starts immediately and ends when the last frame is received.
Filtering starts immediately and ends when the last frame is received.
@item frame
The first frames or the very last frame are kept intact during processing.
@@ -24458,7 +24464,7 @@ The way this differs from the behavior of spp is that uspp actually encodes &
decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
DCT similar to MJPEG.
This filter is only available in ffmpeg version 4.4 or earlier.
This filter is not available in ffmpeg versions between 5.0 and 6.0.
The filter accepts the following options:
@@ -26059,6 +26065,73 @@ minimum values, and @code{1} maximum values.
This filter supports all above options as @ref{commands}, excluding option @code{inputs}.
@anchor{xpsnr}
@section xpsnr
Obtain the average (across all input frames) and minimum (across all color plane averages)
eXtended Perceptually weighted peak Signal-to-Noise Ratio (XPSNR) between two input videos.
The XPSNR is a low-complexity psychovisually motivated distortion measurement algorithm for
assessing the difference between two video streams or images. This is especially useful for
objectively quantifying the distortions caused by video and image codecs, as an alternative
to a formal subjective test. The logarithmic XPSNR output values are in a similar range as
those of traditional @ref{psnr} assessments but better reflect human impressions of visual
coding quality. More details on the XPSNR measure, which essentially represents a blockwise
weighted variant of the PSNR measure, can be found in the following freely available papers:
@itemize
@item
C. R. Helmrich, M. Siekmann, S. Becker, S. Bosse, D. Marpe, and T. Wiegand, "XPSNR: A
Low-Complexity Extension of the Perceptually Weighted Peak Signal-to-Noise Ratio for
High-Resolution Video Quality Assessment," in Proc. IEEE Int. Conf. Acoustics, Speech,
Sig. Process. (ICASSP), virt./online, May 2020. @url{www.ecodis.de/xpsnr.htm}
@item
C. R. Helmrich, S. Bosse, H. Schwarz, D. Marpe, and T. Wiegand, "A Study of the
Extended Perceptually Weighted Peak Signal-to-Noise Ratio (XPSNR) for Video Compression
with Different Resolutions and Bit Depths," ITU Journal: ICT Discoveries, vol. 3, no.
1, pp. 65 - 72, May 2020. @url{http://handle.itu.int/11.1002/pub/8153d78b-en}
@end itemize
When publishing the results of XPSNR assessments obtained using, e.g., this FFmpeg filter, a
reference to the above papers as a means of documentation is strongly encouraged. The filter
requires two input videos. The first input is considered a (usually not distorted) reference
source and is passed unchanged to the output, whereas the second input is a (distorted) test
signal. Except for the bit depth, these two video inputs must have the same pixel format. In
addition, for best performance, both compared input videos should be in YCbCr color format.
The obtained overall XPSNR values mentioned above are printed through the logging system. In
case of input with multiple color planes, we suggest reporting of the minimum XPSNR average.
The following parameter, which behaves like the one for the @ref{psnr} filter, is accepted:
@table @option
@item stats_file, f
If specified, the filter will use the named file to save the XPSNR value of each individual
frame and color plane. When the file name equals "-", that data is sent to standard output.
@end table
This filter also supports the @ref{framesync} options.
@subsection Examples
@itemize
@item
XPSNR analysis of two 1080p HD videos, ref_source.yuv and test_video.yuv, both at 24 frames
per second, with color format 4:2:0, bit depth 8, and output of a logfile named "xpsnr.log":
@example
ffmpeg -s 1920x1080 -framerate 24 -pix_fmt yuv420p -i ref_source.yuv -s 1920x1080 -framerate
24 -pix_fmt yuv420p -i test_video.yuv -lavfi xpsnr="stats_file=xpsnr.log" -f null -
@end example
@item
XPSNR analysis of two 2160p UHD videos, ref_source.yuv with bit depth 8 and test_video.yuv
with bit depth 10, both at 60 frames per second with color format 4:2:0, no logfile output:
@example
ffmpeg -s 3840x2160 -framerate 60 -pix_fmt yuv420p -i ref_source.yuv -s 3840x2160 -framerate
60 -pix_fmt yuv420p10le -i test_video.yuv -lavfi xpsnr="stats_file=-" -f null -
@end example
@end itemize
@anchor{xstack}
@section xstack
Stack video inputs into custom layout.
@@ -27832,8 +27905,7 @@ The inputs have same memory layout for color channels, the overlay has additiona
@section tonemap_vaapi
Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping.
It maps the dynamic range of HDR10 content to the SDR content.
Perform HDR-to-SDR or HDR-to-HDR tone-mapping.
It currently only accepts HDR10 as input.
It accepts the following parameters:
@@ -27842,28 +27914,42 @@ It accepts the following parameters:
@item format
Specify the output pixel format.
Currently supported formats are:
@table @var
@item p010
@item nv12
@end table
Default is nv12.
Default is nv12 for HDR-to-SDR tone-mapping and p010 for HDR-to-HDR
tone-mapping.
@item primaries, p
Set the output color primaries.
Default is same as input.
Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
tone-mapping.
@item transfer, t
Set the output transfer characteristics.
Default is bt709.
Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
tone-mapping.
@item matrix, m
Set the output colorspace matrix.
Default is same as input.
Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
tone-mapping.
@item display
Set the output mastering display colour volume. It is given by a '|'-separated
list of two values, two values are space separated. It set display primaries
x & y in G, B, R order, then white point x & y, the nominal minimum & maximum
display luminances.
HDR-to-HDR tone-mapping will be performed when this option is set.
@item light
Set the output content light level information. It accepts 2 space-separated
values, the first input is the maximum light level and the second input is
the maximum average light level.
It is ignored for HDR-to-SDR tone-mapping, and optional for HDR-to-HDR
tone-mapping.
@end table
@@ -27875,6 +27961,11 @@ Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
@example
tonemap_vaapi=format=p010:t=bt2020-10
@end example
@item
Convert HDR video to HDR video
@example
tonemap_vaapi=display=7500\ 3000|34000\ 16000|13250\ 34500|15635\ 16450|500\ 10000000
@end example
@end itemize
@section hstack_vaapi
@@ -27955,6 +28046,168 @@ first input stream. For the syntax of this option, check the
See @ref{xstack}.
@end table
@section pad_vaapi
Add paddings to the input image, and place the original input at the
provided @var{x}, @var{y} coordinates.
It accepts the following options:
@table @option
@item width, w
@item height, h
Specify an expression for the size of the output image with the
paddings added. If the value for @var{width} or @var{height} is 0, the
corresponding input size is used for the output.
The @var{width} expression can reference the value set by the
@var{height} expression, and vice versa.
The default value of @var{width} and @var{height} is 0.
@item x
@item y
Specify the offsets to place the input image at within the padded area,
with respect to the top/left border of the output image.
The @var{x} expression can reference the value set by the @var{y}
expression, and vice versa.
The default value of @var{x} and @var{y} is 0.
If @var{x} or @var{y} evaluate to a negative number, they'll be changed
so the input image is centered on the padded area.
@item color
Specify the color of the padded area. For the syntax of this option,
check the @ref{color syntax,,"Color" section in the ffmpeg-utils
manual,ffmpeg-utils}.
@item aspect
Pad to an aspect instead to a resolution.
@end table
The value for the @var{width}, @var{height}, @var{x}, and @var{y}
options are expressions containing the following constants:
@table @option
@item in_w
@item in_h
The input video width and height.
@item iw
@item ih
These are the same as @var{in_w} and @var{in_h}.
@item out_w
@item out_h
The output width and height (the size of the padded area), as
specified by the @var{width} and @var{height} expressions.
@item ow
@item oh
These are the same as @var{out_w} and @var{out_h}.
@item x
@item y
The x and y offsets as specified by the @var{x} and @var{y}
expressions, or NAN if not yet specified.
@item a
same as @var{iw} / @var{ih}
@item sar
input sample aspect ratio
@item dar
input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
@end table
@section drawbox_vaapi
Draw a colored box on the input image.
It accepts the following parameters:
@table @option
@item x
@item y
The expressions which specify the top left corner coordinates of the box. It defaults to 0.
@item width, w
@item height, h
The expressions which specify the width and height of the box; if 0 they are interpreted as
the input width and height. It defaults to 0.
@item color, c
Specify the color of the box to write. For the general syntax of this option,
check the @ref{color syntax,,"Color" section in the ffmpeg-utils manual,ffmpeg-utils}.
@item thickness, t
The expression which sets the thickness of the box edge.
A value of @code{fill} will create a filled box. Default value is @code{3}.
See below for the list of accepted constants.
@item replace
With value @code{1}, the pixels of the painted box will overwrite the video's color and alpha pixels.
Default is @code{0}, which composites the box onto the input video.
@end table
The parameters for @var{x}, @var{y}, @var{w} and @var{h} and @var{t} are expressions containing the
following constants:
@table @option
@item in_h, ih
@item in_w, iw
The input width and height.
@item x
@item y
The x and y offset coordinates where the box is drawn.
@item w
@item h
The width and height of the drawn box.
@item t
The thickness of the drawn box.
@end table
@subsection Examples
@itemize
@item
Draw a black box around the edge of the input image:
@example
drawbox
@end example
@item
Draw a box with color red and an opacity of 50%:
@example
drawbox=10:20:200:60:red@@0.5
@end example
The previous example can be specified as:
@example
drawbox=x=10:y=20:w=200:h=60:color=red@@0.5
@end example
@item
Fill the box with pink color:
@example
drawbox=x=10:y=10:w=100:h=100:color=pink@@0.5:t=fill
@end example
@item
Draw a 2-pixel red 2.40:1 mask:
@example
drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
@end example
@end itemize
@c man end VAAPI VIDEO FILTERS
@chapter Vulkan Video Filters
@@ -29131,6 +29384,107 @@ ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_c
@end example
@end itemize
@section perlin
Generate Perlin noise.
Perlin noise is a kind of noise with local continuity in space. This
can be used to generate patterns with continuity in space and time,
e.g. to simulate smoke, fluids, or terrain.
In case more than one octave is specified through the @option{octaves}
option, Perlin noise is generated as a sum of components, each one
with doubled frequency. In this case the @option{persistence} option
specify the ratio of the amplitude with respect to the previous
component. More octave components enable to specify more high
frequency details in the generated noise (e.g. small size variations
due to boulders in a generated terrain).
@subsection Options
@table @option
@item size, s
Specify the size (width and height) of the buffered video frames. For the
syntax of this option, check the
@ref{video size syntax,,"Video size" section in the ffmpeg-utils manual,ffmpeg-utils}.
Default value is @code{320x240}.
@item rate, r
Specify the frame rate expected for the video stream, expressed as a
number of frames per second. Default value is @code{25}.
@item octaves
Specify the total number of components making up the noise, each one
with doubled frequency. Default value is @code{1}.
@item persistence
Set the ratio used to compute the amplitude of the next octave
component with respect to the previous component amplitude. Default
value is @code{1}.
@item xscale
@item yscale
Define a scale factor used to multiple the x, y coordinates. This can
be useful to define an effect with a pattern stretched along the x or
y axis. Default value is @code{1}.
@item tscale
Define a scale factor used to multiple the time coordinate. This can
be useful to change the time variation speed. Default value is @code{1}.
@item random_mode
Set random mode used to compute initial pattern.
Supported values are:
@table @option
@item random
Compute and use random seed.
@item ken
Use the predefined initial pattern defined by Ken Perlin in the
original article, can be useful to compare the output with other
sources.
@item seed
Use the value specified by @option{random_seed} option.
@end table
Default value is @code{random}.
@item random_seed, seed
When @option{random_mode} is set to @var{random_seed}, use this value
to compute the initial pattern. Default value is @code{0}.
@end table
@subsection Examples
@itemize
@item
Generate single component:
@example
perlin
@end example
@item
Use Perlin noise with 7 components, each one with a halved contribution
to total amplitude:
@example
perlin=octaves=7:persistence=0.5
@end example
@item
Chain Perlin noise with the @ref{lutyuv} to generate a black&white
effect:
@example
perlin=octaves=3:tscale=0.3,lutyuv=y='if(lt(val\,128)\,255\,0)'
@end example
@item
Stretch noise along the y axis, and convert gray level to red-only
signal:
@example
perlin=octaves=7:tscale=0.4:yscale=0.3,lutrgb=r=val:b=0:g=0
@end example
@end itemize
@section qrencodesrc
Generate a QR code using the libqrencode library (see
@@ -30751,6 +31105,15 @@ missing.
That basically means that an input frame is selected if its pts is within the
interval set by the concat demuxer.
@item iw @emph{(video only)}
Represents the width of the input video frame.
@item ih @emph{(video only)}
Represents the height of the input video frame.
@item view @emph{(video only)}
View ID for multi-view video.
@end table
The default value of the select expression is "1".
+18 -1
View File
@@ -225,9 +225,26 @@ Specifies the maximum number of streams. This can be used to reject files that
would require too many resources due to a large number of streams.
@item skip_estimate_duration_from_pts @var{bool} (@emph{input})
Skip estimation of input duration when calculated using PTS.
Skip estimation of input duration if it requires an additional probing for PTS at end of file.
At present, applicable for MPEG-PS and MPEG-TS.
@item duration_probesize @var{integer} (@emph{input})
Set probing size, in bytes, for input duration estimation when it actually requires
an additional probing for PTS at end of file (at present: MPEG-PS and MPEG-TS).
It is aimed at users interested in better durations probing for itself, or indirectly
because using the concat demuxer, for example.
The typical use case is an MPEG-TS CBR with a high bitrate, high video buffering and
ending cleaning with similar PTS for video and audio: in such a scenario, the large
physical gap between the last video packet and the last audio packet makes it necessary
to read many bytes in order to get the video stream duration.
Another use case is where the default probing behaviour only reaches a single video frame which is
not the last one of the stream due to frame reordering, so the duration is not accurate.
Setting this option has a performance impact even for small files because the probing
size is fixed.
Default behaviour is a general purpose trade-off, largely adaptive, but the probing size
will not be extended to get streams durations at all costs.
Must be an integer not lesser than 1, or 0 for default behaviour.
@item strict, f_strict @var{integer} (@emph{input/output})
Specify how strictly to follow the standards. @code{f_strict} is deprecated and
should be used only via the @command{ffmpeg} tool.
+25 -1
View File
@@ -160,6 +160,19 @@ Go to @url{http://lame.sourceforge.net/} and follow the
instructions for installing the library.
Then pass @code{--enable-libmp3lame} to configure to enable it.
@section LCEVCdec
FFmpeg can make use of the liblcevc_dec library for LCEVC enhacement layer
decoding on supported bitstreams.
Go to @url{https://github.com/v-novaltd/LCEVCdec} and follow the instructions
for installing the library. Then pass @code{--enable-liblcevc-dec} to configure to
enable it.
@float NOTE
LCEVCdec is under the BSD-3-Clause-Clear License.
@end float
@section libilbc
iLBC is a narrowband speech codec that has been made freely available
@@ -237,6 +250,14 @@ Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
instructions for installing the library.
Then pass @code{--enable-libfdk-aac} to configure to enable it.
@subsection LC3 library
FFmpeg can make use of the Google LC3 library for LC3 decoding & encoding.
Go to @url{https://github.com/google/liblc3/} and follow the instructions for
installing the library.
Then pass @code{--enable-liblc3} to configure to enable it.
@section OpenH264
FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding.
@@ -1015,6 +1036,8 @@ following image formats are supported:
@item Kega Game Video (KGV1) @tab @tab X
@tab Kega emulator screen capture codec.
@item Lagarith @tab @tab X
@item LCEVC / MPEG-5 LCEVC / MPEG-5 Part 2 @tab @tab E
@tab decoding supported through external library liblcevc-dec
@item LCL (LossLess Codec Library) MSZH @tab @tab X
@item LCL (LossLess Codec Library) ZLIB @tab E @tab E
@item LEAD MCMP @tab @tab X
@@ -1300,7 +1323,8 @@ following image formats are supported:
@tab encoding and decoding supported through external library libilbc
@item IMC (Intel Music Coder) @tab @tab X
@item Interplay ACM @tab @tab X
@item MACE (Macintosh Audio Compression/Expansion) 3:1 @tab @tab X
@item LC3 @tab E @tab E
@tab supported through external library liblc3
@item MACE (Macintosh Audio Compression/Expansion) 6:1 @tab @tab X
@item Marian's A-pac audio @tab @tab X
@item MI-SC4 (Micronas SC-4 Audio) @tab @tab X
+18 -2
View File
@@ -396,6 +396,22 @@ Defaults to @samp{audio}.
@item draw_bars
If set to @samp{true}, color bars are drawn in the event of a signal loss.
Defaults to @samp{true}.
This option is deprecated, please use the @code{signal_loss_action} option.
@item signal_loss_action
Sets the action to take in the event of a signal loss. Accepts one of the
following values:
@table @option
@item 1, none
Do nothing on signal loss. This usually results in black frames.
@item 2, bars
Draw color bars on signal loss. Only supported for 8-bit input signals.
@item 3, repeat
Repeat the last video frame on signal loss.
@end table
Defaults to @samp{bars}.
@item queue_size
Sets maximum input buffer size in bytes. If the buffering reaches this value,
@@ -1069,9 +1085,9 @@ ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
@end example
@item
Dump decoded frames to images and closed captions to a file (experimental):
Dump decoded frames to images and Closed Captions to an RCWT backup:
@example
ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rcwt subcc.bin
@end example
@end itemize
-3
View File
@@ -157,9 +157,6 @@ Perform a site search using your favorite search engine. Example:
You can ask for help in the official @t{#ffmpeg} IRC channel on Libera Chat.
Some users prefer the third-party @url{http://www.ffmpeg-archive.org/, Nabble}
interface which presents the mailing lists in a typical forum layout.
There are also numerous third-party help sites such as
@url{https://superuser.com/tags/ffmpeg, Super User} and
@url{https://www.reddit.com/r/ffmpeg/, r/ffmpeg on reddit}.
-6
View File
@@ -49,11 +49,6 @@ Files that have MIPS copyright notice in them:
libm_mips.h
softfloat_tables.h
* libavcodec/mips/
aacdec_fixed.c
aacsbr_fixed.c
aacsbr_template.c
aaccoder_mips.c
aacpsy_mips.h
ac3dsp_mips.c
acelp_filters_mips.c
acelp_vectors_mips.c
@@ -64,7 +59,6 @@ Files that have MIPS copyright notice in them:
compute_antialias_fixed.h
compute_antialias_float.h
lsp_mips.h
dsputil_mips.c
fmtconvert_mips.c
iirfilter_mips.c
mpegaudiodsp_mips_fixed.c
+7 -8
View File
@@ -36,9 +36,9 @@ Frame threading -
* Codecs similar to ffv1, whose streams don't reset across frames,
will not work because their bitstreams cannot be decoded in parallel.
* The contents of buffers must not be read before ff_thread_await_progress()
* The contents of buffers must not be read before ff_progress_frame_await()
has been called on them. reget_buffer() and buffer age optimizations no longer work.
* The contents of buffers must not be written to after ff_thread_report_progress()
* The contents of buffers must not be written to after ff_progress_frame_report()
has been called on them. This includes draw_edges().
Porting codecs to frame threading
@@ -53,14 +53,13 @@ thread.
Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
speed gain at this point but it should work.
If there are inter-frame dependencies, so the codec calls
ff_thread_report/await_progress(), set FF_CODEC_CAP_ALLOCATE_PROGRESS in
FFCodec.caps_internal and use ff_thread_get_buffer() to allocate frames.
Otherwise decode directly into the user-supplied frames.
Use ff_thread_get_buffer() (or ff_progress_frame_get_buffer()
in case you have inter-frame dependencies and use the ProgressFrame API)
to allocate frame buffers.
Call ff_thread_report_progress() after some part of the current picture has decoded.
Call ff_progress_frame_report() after some part of the current picture has decoded.
A good place to put this is where draw_horiz_band() is called - add this if it isn't
called anywhere, as it's useful too and the implementation is trivial when you're
doing this. Note that draw_edges() needs to be called before reporting progress.
Before accessing a reference frame or its MVs, call ff_thread_await_progress().
Before accessing a reference frame or its MVs, call ff_progress_frame_await().
+433 -229
View File
File diff suppressed because it is too large Load Diff
+88 -55
View File
@@ -442,9 +442,6 @@ value is -1.
@item chunked_post
If set to 1 use chunked Transfer-Encoding for posts, default is 1.
@item content_type
Set a specific content type for the POST messages or for listen mode.
@item http_proxy
set HTTP proxy to tunnel through e.g. http://example.com:1234
@@ -452,42 +449,33 @@ set HTTP proxy to tunnel through e.g. http://example.com:1234
Set custom HTTP headers, can override built in default headers. The
value must be a string encoding the headers.
@item content_type
Set a specific content type for the POST messages or for listen mode.
@item user_agent
Override the User-Agent header. If not specified the protocol will use a
string describing the libavformat build. ("Lavf/<version>")
@item referer
Set the Referer header. Include 'Referer: URL' header in HTTP request.
@item multiple_requests
Use persistent connections if set to 1, default is 0.
@item post_data
Set custom HTTP post data.
@item referer
Set the Referer header. Include 'Referer: URL' header in HTTP request.
@item user_agent
Override the User-Agent header. If not specified the protocol will use a
string describing the libavformat build. ("Lavf/<version>")
@item reconnect_at_eof
If set then eof is treated like an error and causes reconnection, this is useful
for live / endless streams.
@item reconnect_streamed
If set then even streamed/non seekable streams will be reconnected on errors.
@item reconnect_on_network_error
Reconnect automatically in case of TCP/TLS errors during connect.
@item reconnect_on_http_error
A comma separated list of HTTP status codes to reconnect on. The list can
include specific status codes (e.g. '503') or the strings '4xx' / '5xx'.
@item reconnect_delay_max
Sets the maximum delay in seconds after which to give up reconnecting
@item mime_type
Export the MIME type.
@item http_version
Exports the HTTP response version number. Usually "1.0" or "1.1".
@item cookies
Set the cookies to be sent in future requests. The format of each cookie is the
same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
delimited by a newline character.
@item icy
If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
supports this, the metadata has to be retrieved by the application by reading
@@ -504,10 +492,40 @@ contains the last non-empty metadata packet sent by the server. It should be
polled in regular intervals by applications interested in mid-stream metadata
updates.
@item cookies
Set the cookies to be sent in future requests. The format of each cookie is the
same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
delimited by a newline character.
@item metadata
Set an exported dictionary containing Icecast metadata from the bitstream, if present.
Only useful with the C API.
@item auth_type
Set HTTP authentication type. No option for Digest, since this method requires
getting nonce parameters from the server first and can't be used straight away like
Basic.
@table @option
@item none
Choose the HTTP authentication type automatically. This is the default.
@item basic
Choose the HTTP basic authentication.
Basic authentication sends a Base64-encoded string that contains a user name and password
for the client. Base64 is not a form of encryption and should be considered the same as
sending the user name and password in clear text (Base64 is a reversible encoding).
If a resource needs to be protected, strongly consider using an authentication scheme
other than basic authentication. HTTPS/TLS should be used with basic authentication.
Without these additional security enhancements, basic authentication should not be used
to protect sensitive or valuable information.
@end table
@item send_expect_100
Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
to 0 it won't, if set to -1 it will try to send if it is applicable. Default
value is -1.
@item location
An exported dictionary containing the content location. Only useful with the C
API.
@item offset
Set initial byte offset.
@@ -525,6 +543,37 @@ be given a Bad Request response.
When unset the HTTP method is not checked for now. This will be replaced by
autodetection in the future.
@item reconnect
Reconnect automatically when disconnected before EOF is hit.
@item reconnect_at_eof
If set then eof is treated like an error and causes reconnection, this is useful
for live / endless streams.
@item reconnect_on_network_error
Reconnect automatically in case of TCP/TLS errors during connect.
@item reconnect_on_http_error
A comma separated list of HTTP status codes to reconnect on. The list can
include specific status codes (e.g. '503') or the strings '4xx' / '5xx'.
@item reconnect_streamed
If set then even streamed/non seekable streams will be reconnected on errors.
@item reconnect_delay_max
Set the maximum delay in seconds after which to give up reconnecting.
@item reconnect_max_retries
Set the maximum number of times to retry a connection. Default unset.
@item reconnect_delay_total_max
Set the maximum total delay in seconds after which to give up reconnecting.
@item respect_retry_after
If enabled, and a Retry-After header is encountered, its requested reconnection
delay will be honored, rather than using exponential backoff. Useful for 429 and
503 errors. Default enabled.
@item listen
If set to 1 enables experimental HTTP server. This can be used to send data when
used as an output option, or read data from a client with HTTP POST when used as
@@ -551,32 +600,16 @@ ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://@var{server}:@var{p
wget --post-file=somefile.ogg http://@var{server}:@var{port}
@end example
@item send_expect_100
Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
to 0 it won't, if set to -1 it will try to send if it is applicable. Default
value is -1.
@item resource
The resource requested by a client, when the experimental HTTP server is in use.
@item auth_type
@item reply_code
The HTTP code returned to the client, when the experimental HTTP server is in use.
Set HTTP authentication type. No option for Digest, since this method requires
getting nonce parameters from the server first and can't be used straight away like
Basic.
@table @option
@item none
Choose the HTTP authentication type automatically. This is the default.
@item basic
Choose the HTTP basic authentication.
Basic authentication sends a Base64-encoded string that contains a user name and password
for the client. Base64 is not a form of encryption and should be considered the same as
sending the user name and password in clear text (Base64 is a reversible encoding).
If a resource needs to be protected, strongly consider using an authentication scheme
other than basic authentication. HTTPS/TLS should be used with basic authentication.
Without these additional security enhancements, basic authentication should not be used
to protect sensitive or valuable information.
@end table
@item short_seek_size
Set the threshold, in bytes, for when a readahead should be prefered over a seek and
new HTTP request. This is useful, for example, to make sure the same connection
is used for reading large video packets with small audio packets in between.
@end table
+1 -1
View File
@@ -1,4 +1,4 @@
#! /usr/bin/env perl
#!/usr/bin/env perl
# This script will print the dependency of a Texinfo file to stdout.
# texidep.pl <src-path> <input.texi> <output.ext>
+45 -27
View File
@@ -801,6 +801,11 @@ The following binary operators are available: @code{+}, @code{-},
The following unary operators are available: @code{+}, @code{-}.
Some internal variables can be used to store and load intermediary
results. They can be accessed using the @code{ld} and @code{st}
functions with an index argument varying from 0 to 9 to specify which
internal variable to access.
The following functions are available:
@table @option
@item abs(x)
@@ -898,9 +903,9 @@ Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
@item isnan(x)
Return 1.0 if @var{x} is NAN, 0.0 otherwise.
@item ld(var)
Load the value of the internal variable with number
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
@item ld(idx)
Load the value of the internal variable with index @var{idx}, which was
previously stored with st(@var{idx}, @var{expr}).
The function returns the loaded value.
@item lerp(x, y, z)
@@ -933,21 +938,31 @@ Compute the power of @var{x} elevated @var{y}, it is equivalent to
@item print(t)
@item print(t, l)
Print the value of expression @var{t} with loglevel @var{l}. If
@var{l} is not specified then a default log level is used.
Returns the value of the expression printed.
Prints t with loglevel l
Print the value of expression @var{t} with loglevel @var{l}. If @var{l} is not
specified then a default log level is used.
Return the value of the expression printed.
@item random(idx)
Return a pseudo random value between 0.0 and 1.0. @var{idx} is the
index of the internal variable which will be used to save the
seed/state.
index of the internal variable used to save the seed/state, which can be
previously stored with @code{st(idx)}.
To initialize the seed, you need to store the seed value as a 64-bit
unsigned integer in the internal variable with index @var{idx}.
For example, to store the seed with value @code{42} in the internal
variable with index @code{0} and print a few random values:
@example
st(0,42); print(random(0)); print(random(0)); print(random(0))
@end example
@item randomi(idx, min, max)
Return a pseudo random value in the interval between @var{min} and
@var{max}. @var{idx} is the index of the internal variable which will
be used to save the seed/state.
@var{max}. @var{idx} is the index of the internal variable which will be used to
save the seed/state, which can be previously stored with @code{st(idx)}.
To initialize the seed, you need to store the seed value as a 64-bit
unsigned integer in the internal variable with index @var{idx}.
@item root(expr, max)
Find an input value for which the function represented by @var{expr}
@@ -956,14 +971,14 @@ with argument @var{ld(0)} is 0 in the interval 0..@var{max}.
The expression in @var{expr} must denote a continuous function or the
result is undefined.
@var{ld(0)} is used to represent the function input value, which means
that the given expression will be evaluated multiple times with
various input values that the expression can access through
@code{ld(0)}. When the expression evaluates to 0 then the
corresponding input value will be returned.
@var{ld(0)} is used to represent the function input value, which means that the
given expression will be evaluated multiple times with various input values that
the expression can access through @code{ld(0)}. When the expression evaluates to
0 then the corresponding input value will be returned.
@item round(expr)
Round the value of expression @var{expr} to the nearest integer. For example, "round(1.5)" is "2.0".
Round the value of expression @var{expr} to the nearest integer. For example,
"round(1.5)" is "2.0".
@item sgn(x)
Compute sign of @var{x}.
@@ -981,12 +996,15 @@ Compute the square root of @var{expr}. This is equivalent to
@item squish(x)
Compute expression @code{1/(1 + exp(4*x))}.
@item st(var, expr)
@item st(idx, expr)
Store the value of the expression @var{expr} in an internal
variable. @var{var} specifies the number of the variable where to
store the value, and it is a value ranging from 0 to 9. The function
returns the value stored in the internal variable.
Note, Variables are currently not shared between expressions.
variable. @var{idx} specifies the index of the variable where to store
the value, and it is a value ranging from 0 to 9. The function returns
the value stored in the internal variable.
The stored value can be retrieved with @code{ld(var)}.
Note: variables are currently not shared between expressions.
@item tan(x)
Compute tangent of @var{x}.
@@ -995,16 +1013,16 @@ Compute tangent of @var{x}.
Compute hyperbolic tangent of @var{x}.
@item taylor(expr, x)
@item taylor(expr, x, id)
@item taylor(expr, x, idx)
Evaluate a Taylor series at @var{x}, given an expression representing
the @code{ld(id)}-th derivative of a function at 0.
the @code{ld(idx)}-th derivative of a function at 0.
When the series does not converge the result is undefined.
@var{ld(id)} is used to represent the derivative order in @var{expr},
@var{ld(idx)} is used to represent the derivative order in @var{expr},
which means that the given expression will be evaluated multiple times
with various input values that the expression can access through
@code{ld(id)}. If @var{id} is not specified then 0 is assumed.
@code{ld(idx)}. If @var{idx} is not specified then 0 is assumed.
Note, when you have the derivatives at y instead of 0,
@code{taylor(expr, x-y)} can be used.
+1
View File
@@ -17,6 +17,7 @@ OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes)
OBJS-$(HAVE_RV) += $(RV-OBJS) $(RV-OBJS-yes)
OBJS-$(HAVE_RVV) += $(RVV-OBJS) $(RVV-OBJS-yes)
OBJS-$(HAVE_RV_ZVBB) += $(RVVB-OBJS) $(RVVB-OBJS-yes)
OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes)
OBJS-$(HAVE_X86ASM) += $(X86ASM-OBJS) $(X86ASM-OBJS-yes)
+1
View File
@@ -1,3 +1,4 @@
#!/bin/sh
toupper(){
echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
}
+402 -21
View File
@@ -33,17 +33,14 @@
#include "compat/va_copy.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
#include "libswscale/version.h"
#include "libswresample/swresample.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/display.h"
#include "libavutil/getenv_utf8.h"
#include "libavutil/mathematics.h"
#include "libavutil/imgutils.h"
#include "libavutil/libm.h"
#include "libavutil/mem.h"
#include "libavutil/parseutils.h"
#include "libavutil/eval.h"
#include "libavutil/dict.h"
@@ -249,6 +246,8 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
(uint8_t *)optctx + po->u.off : po->u.dst_ptr;
char *arg_allocated = NULL;
enum OptionType so_type = po->type;
SpecifierOptList *sol = NULL;
double num;
int ret = 0;
@@ -289,6 +288,14 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
goto finish;
}
sol->opt[sol->nb_opt - 1].specifier = str;
if (po->flags & OPT_FLAG_PERSTREAM) {
ret = stream_specifier_parse(&sol->opt[sol->nb_opt - 1].stream_spec,
str, 0, NULL);
if (ret < 0)
goto finish;
}
dst = &sol->opt[sol->nb_opt - 1].u;
}
@@ -313,8 +320,9 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
goto finish;
*(int *)dst = num;
so_type = OPT_TYPE_INT;
} else if (po->type == OPT_TYPE_INT64) {
ret = parse_number(opt, arg, OPT_TYPE_INT64, INT64_MIN, INT64_MAX, &num);
ret = parse_number(opt, arg, OPT_TYPE_INT64, INT64_MIN, (double)INT64_MAX, &num);
if (ret < 0)
goto finish;
@@ -326,6 +334,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
opt, arg);
goto finish;
}
so_type = OPT_TYPE_INT64;
} else if (po->type == OPT_TYPE_FLOAT) {
ret = parse_number(opt, arg, OPT_TYPE_FLOAT, -INFINITY, INFINITY, &num);
if (ret < 0)
@@ -355,7 +364,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
}
if (sol) {
sol->type = po->type;
sol->type = so_type;
sol->opt_canon = (po->flags & OPT_HAS_CANON) ?
find_option(defs, po->u1.name_canon) : po;
}
@@ -581,7 +590,7 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit,
return o;
}
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0
#define FLAGS ((o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0)
int opt_default(void *optctx, const char *opt, const char *arg)
{
const AVOption *o;
@@ -793,7 +802,7 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
while (optindex < argc) {
const char *opt = argv[optindex++], *arg;
const OptionDef *po;
int ret, group_idx;
int group_idx;
av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt);
@@ -979,17 +988,366 @@ FILE *get_preset_file(char *filename, size_t filename_size,
return f;
}
int cmdutils_isalnum(char c)
{
return (c >= '0' && c <= '9') ||
(c >= 'A' && c <= 'Z') ||
(c >= 'a' && c <= 'z');
}
void stream_specifier_uninit(StreamSpecifier *ss)
{
av_freep(&ss->meta_key);
av_freep(&ss->meta_val);
av_freep(&ss->remainder);
memset(ss, 0, sizeof(*ss));
}
int stream_specifier_parse(StreamSpecifier *ss, const char *spec,
int allow_remainder, void *logctx)
{
char *endptr;
int ret;
memset(ss, 0, sizeof(*ss));
ss->idx = -1;
ss->media_type = AVMEDIA_TYPE_UNKNOWN;
ss->stream_list = STREAM_LIST_ALL;
av_log(logctx, AV_LOG_TRACE, "Parsing stream specifier: %s\n", spec);
while (*spec) {
if (*spec <= '9' && *spec >= '0') { /* opt:index */
ss->idx = strtol(spec, &endptr, 0);
av_assert0(endptr > spec);
spec = endptr;
av_log(logctx, AV_LOG_TRACE,
"Parsed index: %d; remainder: %s\n", ss->idx, spec);
// this terminates the specifier
break;
} else if ((*spec == 'v' || *spec == 'a' || *spec == 's' ||
*spec == 'd' || *spec == 't' || *spec == 'V') &&
!cmdutils_isalnum(*(spec + 1))) { /* opt:[vasdtV] */
if (ss->media_type != AVMEDIA_TYPE_UNKNOWN) {
av_log(logctx, AV_LOG_ERROR, "Stream type specified multiple times\n");
ret = AVERROR(EINVAL);
goto fail;
}
switch (*spec++) {
case 'v': ss->media_type = AVMEDIA_TYPE_VIDEO; break;
case 'a': ss->media_type = AVMEDIA_TYPE_AUDIO; break;
case 's': ss->media_type = AVMEDIA_TYPE_SUBTITLE; break;
case 'd': ss->media_type = AVMEDIA_TYPE_DATA; break;
case 't': ss->media_type = AVMEDIA_TYPE_ATTACHMENT; break;
case 'V': ss->media_type = AVMEDIA_TYPE_VIDEO;
ss->no_apic = 1; break;
default: av_assert0(0);
}
av_log(logctx, AV_LOG_TRACE, "Parsed media type: %s; remainder: %s\n",
av_get_media_type_string(ss->media_type), spec);
} else if (*spec == 'g' && *(spec + 1) == ':') {
if (ss->stream_list != STREAM_LIST_ALL)
goto multiple_stream_lists;
spec += 2;
if (*spec == '#' || (*spec == 'i' && *(spec + 1) == ':')) {
ss->stream_list = STREAM_LIST_GROUP_ID;
spec += 1 + (*spec == 'i');
} else
ss->stream_list = STREAM_LIST_GROUP_IDX;
ss->list_id = strtol(spec, &endptr, 0);
if (spec == endptr) {
av_log(logctx, AV_LOG_ERROR, "Expected stream group idx/ID, got: %s\n", spec);
ret = AVERROR(EINVAL);
goto fail;
}
spec = endptr;
av_log(logctx, AV_LOG_TRACE, "Parsed stream group %s: %"PRId64"; remainder: %s\n",
ss->stream_list == STREAM_LIST_GROUP_ID ? "ID" : "index", ss->list_id, spec);
} else if (*spec == 'p' && *(spec + 1) == ':') {
if (ss->stream_list != STREAM_LIST_ALL)
goto multiple_stream_lists;
ss->stream_list = STREAM_LIST_PROGRAM;
spec += 2;
ss->list_id = strtol(spec, &endptr, 0);
if (spec == endptr) {
av_log(logctx, AV_LOG_ERROR, "Expected program ID, got: %s\n", spec);
ret = AVERROR(EINVAL);
goto fail;
}
spec = endptr;
av_log(logctx, AV_LOG_TRACE,
"Parsed program ID: %"PRId64"; remainder: %s\n", ss->list_id, spec);
} else if (!strncmp(spec, "disp:", 5)) {
const AVClass *st_class = av_stream_get_class();
const AVOption *o = av_opt_find(&st_class, "disposition", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ);
char *disp = NULL;
size_t len;
av_assert0(o);
if (ss->disposition) {
av_log(logctx, AV_LOG_ERROR, "Multiple disposition specifiers\n");
ret = AVERROR(EINVAL);
goto fail;
}
spec += 5;
for (len = 0; cmdutils_isalnum(spec[len]) ||
spec[len] == '_' || spec[len] == '+'; len++)
continue;
disp = av_strndup(spec, len);
if (!disp) {
ret = AVERROR(ENOMEM);
goto fail;
}
ret = av_opt_eval_flags(&st_class, o, disp, &ss->disposition);
av_freep(&disp);
if (ret < 0) {
av_log(logctx, AV_LOG_ERROR, "Invalid disposition specifier\n");
goto fail;
}
spec += len;
av_log(logctx, AV_LOG_TRACE,
"Parsed disposition: 0x%x; remainder: %s\n", ss->disposition, spec);
} else if (*spec == '#' ||
(*spec == 'i' && *(spec + 1) == ':')) {
if (ss->stream_list != STREAM_LIST_ALL)
goto multiple_stream_lists;
ss->stream_list = STREAM_LIST_STREAM_ID;
spec += 1 + (*spec == 'i');
ss->list_id = strtol(spec, &endptr, 0);
if (spec == endptr) {
av_log(logctx, AV_LOG_ERROR, "Expected stream ID, got: %s\n", spec);
ret = AVERROR(EINVAL);
goto fail;
}
spec = endptr;
av_log(logctx, AV_LOG_TRACE,
"Parsed stream ID: %"PRId64"; remainder: %s\n", ss->list_id, spec);
// this terminates the specifier
break;
} else if (*spec == 'm' && *(spec + 1) == ':') {
av_assert0(!ss->meta_key && !ss->meta_val);
spec += 2;
ss->meta_key = av_get_token(&spec, ":");
if (!ss->meta_key) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (*spec == ':') {
spec++;
ss->meta_val = av_get_token(&spec, ":");
if (!ss->meta_val) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
av_log(logctx, AV_LOG_TRACE,
"Parsed metadata: %s:%s; remainder: %s", ss->meta_key,
ss->meta_val ? ss->meta_val : "<any value>", spec);
// this terminates the specifier
break;
} else if (*spec == 'u' && (*(spec + 1) == '\0' || *(spec + 1) == ':')) {
ss->usable_only = 1;
spec++;
av_log(logctx, AV_LOG_ERROR, "Parsed 'usable only'\n");
// this terminates the specifier
break;
} else
break;
if (*spec == ':')
spec++;
}
if (*spec) {
if (!allow_remainder) {
av_log(logctx, AV_LOG_ERROR,
"Trailing garbage at the end of a stream specifier: %s\n",
spec);
ret = AVERROR(EINVAL);
goto fail;
}
if (*spec == ':')
spec++;
ss->remainder = av_strdup(spec);
if (!ss->remainder) {
ret = AVERROR(EINVAL);
goto fail;
}
}
return 0;
multiple_stream_lists:
av_log(logctx, AV_LOG_ERROR,
"Cannot combine multiple program/group designators in a "
"single stream specifier");
ret = AVERROR(EINVAL);
fail:
stream_specifier_uninit(ss);
return ret;
}
unsigned stream_specifier_match(const StreamSpecifier *ss,
const AVFormatContext *s, const AVStream *st,
void *logctx)
{
const AVStreamGroup *g = NULL;
const AVProgram *p = NULL;
int start_stream = 0, nb_streams;
int nb_matched = 0;
switch (ss->stream_list) {
case STREAM_LIST_STREAM_ID:
// <n-th> stream with given ID makes no sense and should be impossible to request
av_assert0(ss->idx < 0);
// return early if we know for sure the stream does not match
if (st->id != ss->list_id)
return 0;
start_stream = st->index;
nb_streams = st->index + 1;
break;
case STREAM_LIST_ALL:
start_stream = ss->idx >= 0 ? 0 : st->index;
nb_streams = st->index + 1;
break;
case STREAM_LIST_PROGRAM:
for (unsigned i = 0; i < s->nb_programs; i++) {
if (s->programs[i]->id == ss->list_id) {
p = s->programs[i];
break;
}
}
if (!p) {
av_log(logctx, AV_LOG_WARNING, "No program with ID %"PRId64" exists,"
" stream specifier can never match\n", ss->list_id);
return 0;
}
nb_streams = p->nb_stream_indexes;
break;
case STREAM_LIST_GROUP_ID:
for (unsigned i = 0; i < s->nb_stream_groups; i++) {
if (ss->list_id == s->stream_groups[i]->id) {
g = s->stream_groups[i];
break;
}
}
// fall-through
case STREAM_LIST_GROUP_IDX:
if (ss->stream_list == STREAM_LIST_GROUP_IDX &&
ss->list_id >= 0 && ss->list_id < s->nb_stream_groups)
g = s->stream_groups[ss->list_id];
if (!g) {
av_log(logctx, AV_LOG_WARNING, "No stream group with group %s %"
PRId64" exists, stream specifier can never match\n",
ss->stream_list == STREAM_LIST_GROUP_ID ? "ID" : "index",
ss->list_id);
return 0;
}
nb_streams = g->nb_streams;
break;
default: av_assert0(0);
}
for (int i = start_stream; i < nb_streams; i++) {
const AVStream *candidate = s->streams[g ? g->streams[i]->index :
p ? p->stream_index[i] : i];
if (ss->media_type != AVMEDIA_TYPE_UNKNOWN &&
(ss->media_type != candidate->codecpar->codec_type ||
(ss->no_apic && (candidate->disposition & AV_DISPOSITION_ATTACHED_PIC))))
continue;
if (ss->meta_key) {
const AVDictionaryEntry *tag = av_dict_get(candidate->metadata,
ss->meta_key, NULL, 0);
if (!tag)
continue;
if (ss->meta_val && strcmp(tag->value, ss->meta_val))
continue;
}
if (ss->usable_only) {
const AVCodecParameters *par = candidate->codecpar;
switch (par->codec_type) {
case AVMEDIA_TYPE_AUDIO:
if (!par->sample_rate || !par->ch_layout.nb_channels ||
par->format == AV_SAMPLE_FMT_NONE)
continue;
break;
case AVMEDIA_TYPE_VIDEO:
if (!par->width || !par->height || par->format == AV_PIX_FMT_NONE)
continue;
break;
case AVMEDIA_TYPE_UNKNOWN:
continue;
}
}
if (ss->disposition &&
(candidate->disposition & ss->disposition) != ss->disposition)
continue;
if (st == candidate)
return ss->idx < 0 || ss->idx == nb_matched;
nb_matched++;
}
return 0;
}
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
{
int ret = avformat_match_stream_specifier(s, st, spec);
StreamSpecifier ss;
int ret;
ret = stream_specifier_parse(&ss, spec, 0, NULL);
if (ret < 0)
av_log(s, AV_LOG_ERROR, "Invalid stream specifier: %s.\n", spec);
return ret;
ret = stream_specifier_match(&ss, s, st, NULL);
stream_specifier_uninit(&ss);
return ret;
}
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
AVFormatContext *s, AVStream *st, const AVCodec *codec,
AVDictionary **dst)
AVDictionary **dst, AVDictionary **opts_used)
{
AVDictionary *ret = NULL;
const AVDictionaryEntry *t = NULL;
@@ -998,10 +1356,6 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
char prefix = 0;
const AVClass *cc = avcodec_get_class();
if (!codec)
codec = s->oformat ? avcodec_find_encoder(codec_id)
: avcodec_find_decoder(codec_id);
switch (st->codecpar->codec_type) {
case AVMEDIA_TYPE_VIDEO:
prefix = 'v';
@@ -1020,6 +1374,7 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
while (t = av_dict_iterate(opts, t)) {
const AVClass *priv_class;
char *p = strchr(t->key, ':');
int used = 0;
/* check stream specification in opt name */
if (p) {
@@ -1037,15 +1392,21 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
!codec ||
((priv_class = codec->priv_class) &&
av_opt_find(&priv_class, t->key, NULL, flags,
AV_OPT_SEARCH_FAKE_OBJ)))
AV_OPT_SEARCH_FAKE_OBJ))) {
av_dict_set(&ret, t->key, t->value, 0);
else if (t->key[0] == prefix &&
used = 1;
} else if (t->key[0] == prefix &&
av_opt_find(&cc, t->key + 1, NULL, flags,
AV_OPT_SEARCH_FAKE_OBJ))
AV_OPT_SEARCH_FAKE_OBJ)) {
av_dict_set(&ret, t->key + 1, t->value, 0);
used = 1;
}
if (p)
*p = ':';
if (used && opts_used)
av_dict_set(opts_used, t->key, "", 0);
}
*dst = ret;
@@ -1053,7 +1414,7 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
}
int setup_find_stream_info_opts(AVFormatContext *s,
AVDictionary *codec_opts,
AVDictionary *local_codec_opts,
AVDictionary ***dst)
{
int ret;
@@ -1069,8 +1430,8 @@ int setup_find_stream_info_opts(AVFormatContext *s,
return AVERROR(ENOMEM);
for (int i = 0; i < s->nb_streams; i++) {
ret = filter_codec_opts(codec_opts, s->streams[i]->codecpar->codec_id,
s, s->streams[i], NULL, &opts[i]);
ret = filter_codec_opts(local_codec_opts, s->streams[i]->codecpar->codec_id,
s, s->streams[i], NULL, &opts[i], NULL);
if (ret < 0)
goto fail;
}
@@ -1153,3 +1514,23 @@ char *file_read(const char *filename)
return NULL;
return str;
}
void remove_avoptions(AVDictionary **a, AVDictionary *b)
{
const AVDictionaryEntry *t = NULL;
while ((t = av_dict_iterate(b, t))) {
av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE);
}
}
int check_avoptions(AVDictionary *m)
{
const AVDictionaryEntry *t = av_dict_iterate(m, NULL);
if (t) {
av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key);
return AVERROR_OPTION_NOT_FOUND;
}
return 0;
}
+77 -15
View File
@@ -102,8 +102,70 @@ enum OptionType {
int parse_number(const char *context, const char *numstr, enum OptionType type,
double min, double max, double *dst);
enum StreamList {
STREAM_LIST_ALL,
STREAM_LIST_STREAM_ID,
STREAM_LIST_PROGRAM,
STREAM_LIST_GROUP_ID,
STREAM_LIST_GROUP_IDX,
};
typedef struct StreamSpecifier {
// trailing stream index - pick idx-th stream that matches
// all the other constraints; -1 when not present
int idx;
// which stream list to consider
enum StreamList stream_list;
// STREAM_LIST_STREAM_ID: stream ID
// STREAM_LIST_GROUP_IDX: group index
// STREAM_LIST_GROUP_ID: group ID
// STREAM_LIST_PROGRAM: program ID
int64_t list_id;
// when not AVMEDIA_TYPE_UNKNOWN, consider only streams of this type
enum AVMediaType media_type;
uint8_t no_apic;
uint8_t usable_only;
int disposition;
char *meta_key;
char *meta_val;
char *remainder;
} StreamSpecifier;
/**
* Parse a stream specifier string into a form suitable for matching.
*
* @param ss Parsed specifier will be stored here; must be uninitialized
* with stream_specifier_uninit() when no longer needed.
* @param spec String containing the stream specifier to be parsed.
* @param allow_remainder When 1, the part of spec that is left after parsing
* the stream specifier is stored into ss->remainder.
* When 0, any remainder will cause parsing to fail.
*/
int stream_specifier_parse(StreamSpecifier *ss, const char *spec,
int allow_remainder, void *logctx);
/**
* @return 1 if st matches the parsed specifier, 0 if it does not
*/
unsigned stream_specifier_match(const StreamSpecifier *ss,
const AVFormatContext *s, const AVStream *st,
void *logctx);
void stream_specifier_uninit(StreamSpecifier *ss);
typedef struct SpecifierOpt {
char *specifier; /**< stream/chapter/program/... specifier */
// original specifier or empty string
char *specifier;
// parsed specifier for OPT_FLAG_PERSTREAM options
StreamSpecifier stream_spec;
union {
uint8_t *str;
int i;
@@ -120,6 +182,9 @@ typedef struct SpecifierOptList {
/* Canonical option definition that was parsed into this list. */
const struct OptionDef *opt_canon;
/* Type corresponding to the field that should be used from SpecifierOpt.u.
* May not match the option type, e.g. OPT_TYPE_BOOL options are stored as
* int, so this field would be OPT_TYPE_INT for them */
enum OptionType type;
} SpecifierOptList;
@@ -371,11 +436,13 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
* @param codec The particular codec for which the options should be filtered.
* If null, the default one is looked up according to the codec id.
* @param dst a pointer to the created dictionary
* @param opts_used if non-NULL, every option stored in dst is also stored here,
* with specifiers preserved
* @return a non-negative number on success, a negative error code on failure
*/
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
AVFormatContext *s, AVStream *st, const AVCodec *codec,
AVDictionary **dst);
AVDictionary **dst, AVDictionary **opts_used);
/**
* Setup AVCodecContext options for avformat_find_stream_info().
@@ -465,22 +532,17 @@ void *allocate_array_elem(void *array, size_t elem_size, int *nb_elems);
#define GROW_ARRAY(array, nb_elems)\
grow_array((void**)&array, sizeof(*array), &nb_elems, nb_elems + 1)
#define GET_PIX_FMT_NAME(pix_fmt)\
const char *name = av_get_pix_fmt_name(pix_fmt);
#define GET_CODEC_NAME(id)\
const char *name = avcodec_descriptor_get(id)->name;
#define GET_SAMPLE_FMT_NAME(sample_fmt)\
const char *name = av_get_sample_fmt_name(sample_fmt)
#define GET_SAMPLE_RATE_NAME(rate)\
char name[16];\
snprintf(name, sizeof(name), "%d", rate);
double get_rotation(const int32_t *displaymatrix);
/* read file contents into a string */
char *file_read(const char *filename);
/* Remove keys in dictionary b from dictionary a */
void remove_avoptions(AVDictionary **a, AVDictionary *b);
/* Check if any keys exist in dictionary m */
int check_avoptions(AVDictionary *m);
int cmdutils_isalnum(char c);
#endif /* FFTOOLS_CMDUTILS_H */
+59 -42
View File
@@ -68,40 +68,19 @@
#include <conio.h>
#endif
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/dict.h"
#include "libavutil/display.h"
#include "libavutil/fifo.h"
#include "libavutil/hwcontext.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/libm.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/samplefmt.h"
#include "libavutil/thread.h"
#include "libavutil/threadmessage.h"
#include "libavutil/mem.h"
#include "libavutil/time.h"
#include "libavutil/timestamp.h"
#include "libavcodec/version.h"
#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libswresample/swresample.h"
#include "cmdutils.h"
#include "ffmpeg.h"
#include "ffmpeg_sched.h"
#include "ffmpeg_utils.h"
#include "sync_queue.h"
const char program_name[] = "ffmpeg";
const int program_birth_year = 2000;
@@ -157,7 +136,7 @@ void term_exit(void)
static volatile int received_sigterm = 0;
static volatile int received_nb_signals = 0;
static atomic_int transcode_init_done = ATOMIC_VAR_INIT(0);
static atomic_int transcode_init_done = 0;
static volatile int ffmpeg_exited = 0;
static int64_t copy_ts_first_pts = AV_NOPTS_VALUE;
@@ -306,8 +285,9 @@ static int read_key(void)
}
//Read it
if(nchars != 0) {
read(0, &ch, 1);
return ch;
if (read(0, &ch, 1) == 1)
return ch;
return 0;
}else{
return -1;
}
@@ -329,8 +309,8 @@ const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };
static void ffmpeg_cleanup(int ret)
{
if (do_benchmark) {
int maxrss = getmaxrss() / 1024;
av_log(NULL, AV_LOG_INFO, "bench: maxrss=%iKiB\n", maxrss);
int64_t maxrss = getmaxrss() / 1024;
av_log(NULL, AV_LOG_INFO, "bench: maxrss=%"PRId64"KiB\n", maxrss);
}
for (int i = 0; i < nb_filtergraphs; i++)
@@ -494,21 +474,51 @@ const FrameData *packet_data_c(AVPacket *pkt)
return ret < 0 ? NULL : (const FrameData*)pkt->opaque_ref->data;
}
void remove_avoptions(AVDictionary **a, AVDictionary *b)
int check_avoptions_used(const AVDictionary *opts, const AVDictionary *opts_used,
void *logctx, int decode)
{
const AVDictionaryEntry *t = NULL;
const AVClass *class = avcodec_get_class();
const AVClass *fclass = avformat_get_class();
while ((t = av_dict_iterate(b, t))) {
av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE);
}
}
const int flag = decode ? AV_OPT_FLAG_DECODING_PARAM :
AV_OPT_FLAG_ENCODING_PARAM;
const AVDictionaryEntry *e = NULL;
int check_avoptions(AVDictionary *m)
{
const AVDictionaryEntry *t;
if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key);
return AVERROR_OPTION_NOT_FOUND;
while ((e = av_dict_iterate(opts, e))) {
const AVOption *option, *foption;
char *optname, *p;
if (av_dict_get(opts_used, e->key, NULL, 0))
continue;
optname = av_strdup(e->key);
if (!optname)
return AVERROR(ENOMEM);
p = strchr(optname, ':');
if (p)
*p = 0;
option = av_opt_find(&class, optname, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
foption = av_opt_find(&fclass, optname, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
av_freep(&optname);
if (!option || foption)
continue;
if (!(option->flags & flag)) {
av_log(logctx, AV_LOG_ERROR, "Codec AVOption %s (%s) is not a %s "
"option.\n", e->key, option->help ? option->help : "",
decode ? "decoding" : "encoding");
return AVERROR(EINVAL);
}
av_log(logctx, AV_LOG_WARNING, "Codec AVOption %s (%s) has not been used "
"for any stream. The most likely reason is either wrong type "
"(e.g. a video option with no video streams) or that it is a "
"private option of some decoder which was not actually used "
"for any stream.\n", e->key, option->help ? option->help : "");
}
return 0;
@@ -577,7 +587,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
av_bprintf(&buf_script, "stream_%d_%d_q=%.1f\n",
ost->file->index, ost->index, q);
}
if (!vid && ost->type == AVMEDIA_TYPE_VIDEO && ost->filter) {
if (!vid && ost->type == AVMEDIA_TYPE_VIDEO) {
float fps;
uint64_t frame_number = atomic_load(&ost->packets_written);
@@ -591,8 +601,10 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
if (is_last_report)
av_bprintf(&buf, "L");
nb_frames_dup = atomic_load(&ost->filter->nb_frames_dup);
nb_frames_drop = atomic_load(&ost->filter->nb_frames_drop);
if (ost->filter) {
nb_frames_dup = atomic_load(&ost->filter->nb_frames_dup);
nb_frames_drop = atomic_load(&ost->filter->nb_frames_drop);
}
vid = 1;
}
@@ -808,6 +820,11 @@ static int check_keyboard_interaction(int64_t cur_time)
(n = sscanf(buf, "%63[^ ] %lf %255[^ ] %255[^\n]", target, &time, command, arg)) >= 3) {
av_log(NULL, AV_LOG_DEBUG, "Processing command target:%s time:%f command:%s arg:%s",
target, time, command, arg);
for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
if (ost->fg_simple)
fg_send_command(ost->fg_simple, time, target, command, arg,
key == 'C');
}
for (i = 0; i < nb_filtergraphs; i++)
fg_send_command(filtergraphs[i], time, target, command, arg,
key == 'C');
+133 -64
View File
@@ -112,12 +112,32 @@ typedef struct HWDevice {
AVBufferRef *device_ref;
} HWDevice;
enum ViewSpecifierType {
// no specifier given
VIEW_SPECIFIER_TYPE_NONE = 0,
// val is view index
VIEW_SPECIFIER_TYPE_IDX,
// val is view ID
VIEW_SPECIFIER_TYPE_ID,
// specify view by its position, val is AV_STEREO3D_VIEW_LEFT/RIGHT
VIEW_SPECIFIER_TYPE_POS,
// use all views, val is ignored
VIEW_SPECIFIER_TYPE_ALL,
};
typedef struct ViewSpecifier {
enum ViewSpecifierType type;
unsigned val;
} ViewSpecifier;
/* select an input stream for an output stream */
typedef struct StreamMap {
int disabled; /* 1 is this mapping is disabled by a negative map */
int file_index;
int stream_index;
char *linklabel; /* name of an output link, for mapping lavfi outputs */
ViewSpecifier vs;
} StreamMap;
typedef struct OptionsContext {
@@ -155,6 +175,7 @@ typedef struct OptionsContext {
SpecifierOptList hwaccel_devices;
SpecifierOptList hwaccel_output_formats;
SpecifierOptList autorotate;
SpecifierOptList apply_cropping;
/* output options */
StreamMap *stream_maps;
@@ -239,6 +260,7 @@ enum IFilterFlags {
IFILTER_FLAG_AUTOROTATE = (1 << 0),
IFILTER_FLAG_REINIT = (1 << 1),
IFILTER_FLAG_CFR = (1 << 2),
IFILTER_FLAG_CROP = (1 << 3),
};
typedef struct InputFilterOptions {
@@ -254,6 +276,11 @@ typedef struct InputFilterOptions {
* accurate */
AVRational framerate;
unsigned crop_top;
unsigned crop_bottom;
unsigned crop_left;
unsigned crop_right;
int sub2video_width;
int sub2video_height;
@@ -263,20 +290,78 @@ typedef struct InputFilterOptions {
AVFrame *fallback;
} InputFilterOptions;
enum OFilterFlags {
OFILTER_FLAG_DISABLE_CONVERT = (1 << 0),
// produce 24-bit audio
OFILTER_FLAG_AUDIO_24BIT = (1 << 1),
OFILTER_FLAG_AUTOSCALE = (1 << 2),
};
typedef struct OutputFilterOptions {
// Caller-provided name for this output
char *name;
// Codec used for encoding, may be NULL
const AVCodec *enc;
int64_t trim_start_us;
int64_t trim_duration_us;
int64_t ts_offset;
/* Desired output timebase.
* Numerator can be one of EncTimeBase values, or 0 when no preference.
*/
AVRational output_tb;
AVDictionary *sws_opts;
AVDictionary *swr_opts;
const char *nb_threads;
// A combination of OFilterFlags.
unsigned flags;
int format;
int width;
int height;
enum AVColorSpace color_space;
enum AVColorRange color_range;
enum VideoSyncMethod vsync_method;
int sample_rate;
AVChannelLayout ch_layout;
const int *formats;
const int *sample_rates;
const AVChannelLayout *ch_layouts;
const AVRational *frame_rates;
const enum AVColorSpace *color_spaces;
const enum AVColorRange *color_ranges;
// for simple filtergraphs only, view specifier passed
// along to the decoder
const ViewSpecifier *vs;
} OutputFilterOptions;
typedef struct InputFilter {
struct FilterGraph *graph;
uint8_t *name;
} InputFilter;
typedef struct OutputFilter {
struct OutputStream *ost;
const AVClass *class;
struct FilterGraph *graph;
uint8_t *name;
/* for filters that are not yet bound to an output stream,
* this stores the output linklabel, if any */
int bound;
uint8_t *linklabel;
char *apad;
enum AVMediaType type;
atomic_uint_least64_t nb_frames_dup;
@@ -304,6 +389,8 @@ enum DecoderFlags {
DECODER_FLAG_TOP_FIELD_FIRST = (1 << 3),
#endif
DECODER_FLAG_SEND_END_TS = (1 << 4),
// force bitexact decoding
DECODER_FLAG_BITEXACT = (1 << 5),
};
typedef struct DecoderOpts {
@@ -368,8 +455,6 @@ typedef struct InputStream {
int top_field_first;
#endif
int autorotate;
int fix_sub_duration;
/* decoded data from this stream goes into all those filters
@@ -492,6 +577,13 @@ typedef struct KeyframeForceCtx {
typedef struct Encoder Encoder;
enum CroppingType {
CROP_DISABLED = 0,
CROP_ALL,
CROP_CODEC,
CROP_CONTAINER,
};
typedef struct OutputStream {
const AVClass *class;
@@ -515,21 +607,16 @@ typedef struct OutputStream {
AVStream *st; /* stream in the output file */
AVRational enc_timebase;
Encoder *enc;
AVCodecContext *enc_ctx;
/* video only */
AVRational frame_rate;
AVRational max_frame_rate;
enum VideoSyncMethod vsync_method;
int is_cfr;
int force_fps;
#if FFMPEG_OPT_TOP
int top_field_first;
#endif
int autoscale;
int bitexact;
int bits_per_raw_sample;
@@ -537,20 +624,15 @@ typedef struct OutputStream {
KeyframeForceCtx kf;
char *logfile_prefix;
const char *logfile_prefix;
FILE *logfile;
// simple filtergraph feeding this stream, if any
FilterGraph *fg_simple;
OutputFilter *filter;
AVDictionary *encoder_opts;
AVDictionary *sws_dict;
AVDictionary *swr_opts;
char *apad;
char *attachment_filename;
int keep_pix_fmt;
/* stats */
// number of packets send to the muxer
atomic_uint_least64_t packets_written;
@@ -576,7 +658,6 @@ typedef struct OutputFile {
int index;
const AVOutputFormat *format;
const char *url;
OutputStream **streams;
@@ -585,7 +666,6 @@ typedef struct OutputFile {
int64_t recording_time; ///< desired length of the resulting file in microseconds == AV_TIME_BASE units
int64_t start_time; ///< start time in microseconds == AV_TIME_BASE units
int shortest;
int bitexact;
} OutputFile;
@@ -618,6 +698,7 @@ extern int nb_input_files;
extern OutputFile **output_files;
extern int nb_output_files;
// complex filtergraphs
extern FilterGraph **filtergraphs;
extern int nb_filtergraphs;
@@ -672,11 +753,10 @@ void term_exit(void);
void show_usage(void);
void remove_avoptions(AVDictionary **a, AVDictionary *b);
int check_avoptions(AVDictionary *m);
int check_avoptions_used(const AVDictionary *opts, const AVDictionary *opts_used,
void *logctx, int decode);
int assert_file_overwrite(const char *filename);
AVDictionary *strip_specifiers(const AVDictionary *dict);
int find_codec(void *logctx, const char *name,
enum AVMediaType type, int encoder, const AVCodec **codec);
int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global);
@@ -684,8 +764,9 @@ int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_id
int filtergraph_is_simple(const FilterGraph *fg);
int init_simple_filtergraph(InputStream *ist, OutputStream *ost,
char *graph_desc,
Scheduler *sch, unsigned sch_idx_enc);
int fg_finalise_bindings(FilterGraph *fg);
Scheduler *sch, unsigned sch_idx_enc,
const OutputFilterOptions *opts);
int fg_finalise_bindings(void);
/**
* Get our axiliary frame data attached to the frame, allocating it
@@ -699,7 +780,8 @@ FrameData *packet_data (AVPacket *pkt);
const FrameData *packet_data_c(AVPacket *pkt);
int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost,
unsigned sched_idx_enc);
unsigned sched_idx_enc,
const OutputFilterOptions *opts);
/**
* Create a new filtergraph in the global filtergraph list.
@@ -759,7 +841,21 @@ void dec_free(Decoder **pdec);
*
* @param opts filtergraph input options, to be filled by this function
*/
int dec_filter_add(Decoder *dec, InputFilter *ifilter, InputFilterOptions *opts);
int dec_filter_add(Decoder *dec, InputFilter *ifilter, InputFilterOptions *opts,
const ViewSpecifier *vs, SchedulerNode *src);
/*
* For multiview video, request output of the view(s) determined by vs.
* May be called multiple times.
*
* If this function is never called, only the base view is output. If it is
* called at least once, only the views requested are output.
*
* @param src scheduler node from which the frames corresponding vs
* will originate
*/
int dec_request_view(Decoder *dec, const ViewSpecifier *vs,
SchedulerNode *src);
int enc_alloc(Encoder **penc, const AVCodec *codec,
Scheduler *sch, unsigned sch_idx);
@@ -789,7 +885,8 @@ void ifile_close(InputFile **f);
int ist_output_add(InputStream *ist, OutputStream *ost);
int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
InputFilterOptions *opts);
const ViewSpecifier *vs, InputFilterOptions *opts,
SchedulerNode *src);
/**
* Find an unused input stream of given type.
@@ -806,46 +903,18 @@ OutputStream *ost_iter(OutputStream *prev);
void update_benchmark(const char *fmt, ...);
#define SPECIFIER_OPT_FMT_str "%s"
#define SPECIFIER_OPT_FMT_i "%i"
#define SPECIFIER_OPT_FMT_i64 "%"PRId64
#define SPECIFIER_OPT_FMT_ui64 "%"PRIu64
#define SPECIFIER_OPT_FMT_f "%f"
#define SPECIFIER_OPT_FMT_dbl "%lf"
#define WARN_MULTIPLE_OPT_USAGE(optname, type, idx, st)\
{\
char namestr[128] = "";\
const SpecifierOpt *so = &o->optname.opt[idx];\
const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";\
snprintf(namestr, sizeof(namestr), "-%s", o->optname.opt_canon->name);\
if (o->optname.opt_canon->flags & OPT_HAS_ALT) {\
const char * const *names_alt = o->optname.opt_canon->u1.names_alt;\
for (int _i = 0; names_alt[_i]; _i++)\
av_strlcatf(namestr, sizeof(namestr), "/-%s", names_alt[_i]);\
}\
av_log(NULL, AV_LOG_WARNING, "Multiple %s options specified for stream %d, only the last option '-%s%s%s "SPECIFIER_OPT_FMT_##type"' will be used.\n",\
namestr, st->index, o->optname.opt_canon->name, spec[0] ? ":" : "", spec, so->u.type);\
}
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
{\
int _ret, _matches = 0, _match_idx;\
for (int _i = 0; _i < o->name.nb_opt; _i++) {\
char *spec = o->name.opt[_i].specifier;\
if ((_ret = check_stream_specifier(fmtctx, st, spec)) > 0) {\
outvar = o->name.opt[_i].u.type;\
_match_idx = _i;\
_matches++;\
} else if (_ret < 0)\
return _ret;\
}\
if (_matches > 1 && o->name.opt_canon)\
WARN_MULTIPLE_OPT_USAGE(name, type, _match_idx, st);\
}
const char *opt_match_per_type_str(const SpecifierOptList *sol,
char mediatype);
void opt_match_per_stream_str(void *logctx, const SpecifierOptList *sol,
AVFormatContext *fc, AVStream *st, const char **out);
void opt_match_per_stream_int(void *logctx, const SpecifierOptList *sol,
AVFormatContext *fc, AVStream *st, int *out);
void opt_match_per_stream_int64(void *logctx, const SpecifierOptList *sol,
AVFormatContext *fc, AVStream *st, int64_t *out);
void opt_match_per_stream_dbl(void *logctx, const SpecifierOptList *sol,
AVFormatContext *fc, AVStream *st, double *out);
int view_specifier_parse(const char **pspec, ViewSpecifier *vs);
int muxer_thread(void *arg);
int encoder_thread(void *arg);
+426 -27
View File
@@ -16,24 +16,25 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdbit.h>
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/error.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/stereo3d.h"
#include "libavutil/time.h"
#include "libavutil/timestamp.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/codec.h"
#include "libavfilter/buffersrc.h"
#include "ffmpeg.h"
#include "ffmpeg_utils.h"
#include "thread_queue.h"
typedef struct DecoderPriv {
Decoder dec;
@@ -41,6 +42,7 @@ typedef struct DecoderPriv {
AVCodecContext *dec_ctx;
AVFrame *frame;
AVFrame *frame_tmp_ref;
AVPacket *pkt;
// override output video sample aspect ratio with this value
@@ -50,6 +52,7 @@ typedef struct DecoderPriv {
// a combination of DECODER_FLAG_*, provided to dec_open()
int flags;
int apply_cropping;
enum AVPixelFormat hwaccel_pix_fmt;
enum HWAccelID hwaccel_id;
@@ -78,6 +81,23 @@ typedef struct DecoderPriv {
char log_name[32];
char *parent_name;
// user specified decoder multiview options manually
int multiview_user_config;
struct {
ViewSpecifier vs;
unsigned out_idx;
} *views_requested;
int nb_views_requested;
/* A map of view ID to decoder outputs.
* MUST NOT be accessed outside of get_format()/get_buffer() */
struct {
unsigned id;
uintptr_t out_mask;
} *view_map;
int nb_view_map;
struct {
AVDictionary *opts;
const AVCodec *codec;
@@ -107,6 +127,7 @@ void dec_free(Decoder **pdec)
avcodec_free_context(&dp->dec_ctx);
av_frame_free(&dp->frame);
av_frame_free(&dp->frame_tmp_ref);
av_packet_free(&dp->pkt);
av_dict_free(&dp->standalone_init.opts);
@@ -117,6 +138,9 @@ void dec_free(Decoder **pdec)
av_freep(&dp->parent_name);
av_freep(&dp->views_requested);
av_freep(&dp->view_map);
av_freep(pdec);
}
@@ -261,6 +285,10 @@ static int64_t video_duration_estimate(const DecoderPriv *dp, const AVFrame *fra
const int ts_unreliable = dp->flags & DECODER_FLAG_TS_UNRELIABLE;
const int fr_forced = dp->flags & DECODER_FLAG_FRAMERATE_FORCED;
int64_t codec_duration = 0;
// difference between this and last frame's timestamps
const int64_t ts_diff =
(frame->pts != AV_NOPTS_VALUE && dp->last_frame_pts != AV_NOPTS_VALUE) ?
frame->pts - dp->last_frame_pts : -1;
// XXX lavf currently makes up frame durations when they are not provided by
// the container. As there is no way to reliably distinguish real container
@@ -268,8 +296,13 @@ static int64_t video_duration_estimate(const DecoderPriv *dp, const AVFrame *fra
// the container has timestamps. Eventually lavf should stop making up
// durations, then this should be simplified.
// frame duration is unreliable (typically guessed by lavf) when it is equal
// to 1 and the actual duration of the last frame is more than 2x larger
const int duration_unreliable = frame->duration == 1 && ts_diff > 2 * frame->duration;
// prefer frame duration for containers with timestamps
if (frame->duration > 0 && (!ts_unreliable || fr_forced))
if (fr_forced ||
(frame->duration > 0 && !ts_unreliable && !duration_unreliable))
return frame->duration;
if (dp->dec_ctx->framerate.den && dp->dec_ctx->framerate.num) {
@@ -286,9 +319,8 @@ static int64_t video_duration_estimate(const DecoderPriv *dp, const AVFrame *fra
// when timestamps are available, repeat last frame's actual duration
// (i.e. pts difference between this and last frame)
if (frame->pts != AV_NOPTS_VALUE && dp->last_frame_pts != AV_NOPTS_VALUE &&
frame->pts > dp->last_frame_pts)
return frame->pts - dp->last_frame_pts;
if (ts_diff > 0)
return ts_diff;
// try frame/codec duration
if (frame->duration > 0)
@@ -350,7 +382,8 @@ fail:
return err;
}
static int video_frame_process(DecoderPriv *dp, AVFrame *frame)
static int video_frame_process(DecoderPriv *dp, AVFrame *frame,
unsigned *outputs_mask)
{
#if FFMPEG_OPT_TOP
if (dp->flags & DECODER_FLAG_TOP_FIELD_FIRST) {
@@ -403,6 +436,18 @@ static int video_frame_process(DecoderPriv *dp, AVFrame *frame)
if (dp->sar_override.num)
frame->sample_aspect_ratio = dp->sar_override;
if (dp->apply_cropping) {
// lavfi does not require aligned frame data
int ret = av_frame_apply_cropping(frame, AV_FRAME_CROP_UNALIGNED);
if (ret < 0) {
av_log(dp, AV_LOG_ERROR, "Error applying decoder cropping\n");
return ret;
}
}
if (frame->opaque)
*outputs_mask = (uintptr_t)frame->opaque;
return 0;
}
@@ -562,7 +607,7 @@ static int process_subtitle(DecoderPriv *dp, AVFrame *frame)
if (!subtitle)
return 0;
ret = sch_dec_send(dp->sch, dp->sch_idx, frame);
ret = sch_dec_send(dp->sch, dp->sch_idx, 0, frame);
if (ret < 0)
av_frame_unref(frame);
@@ -604,7 +649,7 @@ static int transcode_subtitles(DecoderPriv *dp, const AVPacket *pkt,
frame->time_base = pkt->time_base;
frame->opaque = (void*)(intptr_t)FRAME_OPAQUE_SUB_HEARTBEAT;
ret = sch_dec_send(dp->sch, dp->sch_idx, frame);
ret = sch_dec_send(dp->sch, dp->sch_idx, 0, frame);
return ret == AVERROR_EOF ? AVERROR_EXIT : ret;
} else if (pkt && (intptr_t)pkt->opaque == PKT_OPAQUE_FIX_SUB_DURATION) {
return fix_sub_duration_heartbeat(dp, av_rescale_q(pkt->pts, pkt->time_base,
@@ -699,6 +744,7 @@ static int packet_decode(DecoderPriv *dp, AVPacket *pkt, AVFrame *frame)
while (1) {
FrameData *fd;
unsigned outputs_mask = 1;
av_frame_unref(frame);
@@ -747,7 +793,7 @@ static int packet_decode(DecoderPriv *dp, AVPacket *pkt, AVFrame *frame)
audio_ts_process(dp, frame);
} else {
ret = video_frame_process(dp, frame);
ret = video_frame_process(dp, frame, &outputs_mask);
if (ret < 0) {
av_log(dp, AV_LOG_FATAL,
"Error while processing the decoded data\n");
@@ -757,10 +803,28 @@ static int packet_decode(DecoderPriv *dp, AVPacket *pkt, AVFrame *frame)
dp->dec.frames_decoded++;
ret = sch_dec_send(dp->sch, dp->sch_idx, frame);
if (ret < 0) {
av_frame_unref(frame);
return ret == AVERROR_EOF ? AVERROR_EXIT : ret;
for (int i = 0; i < stdc_count_ones(outputs_mask); i++) {
AVFrame *to_send = frame;
int pos;
av_assert0(outputs_mask);
pos = stdc_trailing_zeros(outputs_mask);
outputs_mask &= ~(1U << pos);
// this is not the last output and sch_dec_send() consumes the frame
// given to it, so make a temporary reference
if (outputs_mask) {
to_send = dp->frame_tmp_ref;
ret = av_frame_ref(to_send, frame);
if (ret < 0)
return ret;
}
ret = sch_dec_send(dp->sch, dp->sch_idx, pos, to_send);
if (ret < 0) {
av_frame_unref(to_send);
return ret == AVERROR_EOF ? AVERROR_EXIT : ret;
}
}
}
}
@@ -935,7 +999,7 @@ static int decoder_thread(void *arg)
dp->last_frame_pts + dp->last_frame_duration_est;
dt.frame->time_base = dp->last_frame_tb;
ret = sch_dec_send(dp->sch, dp->sch_idx, dt.frame);
ret = sch_dec_send(dp->sch, dp->sch_idx, 0, dt.frame);
if (ret < 0 && ret != AVERROR_EOF) {
av_log(dp, AV_LOG_FATAL,
"Error signalling EOF timestamp: %s\n", av_err2str(ret));
@@ -959,10 +1023,307 @@ finish:
return ret;
}
int dec_request_view(Decoder *d, const ViewSpecifier *vs,
SchedulerNode *src)
{
DecoderPriv *dp = dp_from_dec(d);
unsigned out_idx = 0;
int ret;
if (dp->multiview_user_config) {
if (!vs || vs->type == VIEW_SPECIFIER_TYPE_NONE) {
*src = SCH_DEC_OUT(dp->sch_idx, 0);
return 0;
}
av_log(dp, AV_LOG_ERROR,
"Manually selecting views with -view_ids cannot be combined "
"with view selection via stream specifiers. It is strongly "
"recommended you always use stream specifiers only.\n");
return AVERROR(EINVAL);
}
// when multiview_user_config is not set, NONE specifier is treated
// as requesting the base view
vs = (vs && vs->type != VIEW_SPECIFIER_TYPE_NONE) ? vs :
&(ViewSpecifier){ .type = VIEW_SPECIFIER_TYPE_IDX, .val = 0 };
// check if the specifier matches an already-existing one
for (int i = 0; i < dp->nb_views_requested; i++) {
const ViewSpecifier *vs1 = &dp->views_requested[i].vs;
if (vs->type == vs1->type &&
(vs->type == VIEW_SPECIFIER_TYPE_ALL || vs->val == vs1->val)) {
*src = SCH_DEC_OUT(dp->sch_idx, dp->views_requested[i].out_idx);
return 0;
}
}
// we use a bitmask to map view IDs to decoder outputs, which
// limits the number of outputs allowed
if (dp->nb_views_requested >= sizeof(dp->view_map[0].out_mask) * 8) {
av_log(dp, AV_LOG_ERROR, "Too many view specifiers\n");
return AVERROR(ENOSYS);
}
ret = GROW_ARRAY(dp->views_requested, dp->nb_views_requested);
if (ret < 0)
return ret;
if (dp->nb_views_requested > 1) {
ret = sch_add_dec_output(dp->sch, dp->sch_idx);
if (ret < 0)
return ret;
out_idx = ret;
}
dp->views_requested[dp->nb_views_requested - 1].out_idx = out_idx;
dp->views_requested[dp->nb_views_requested - 1].vs = *vs;
*src = SCH_DEC_OUT(dp->sch_idx,
dp->views_requested[dp->nb_views_requested - 1].out_idx);
return 0;
}
static int multiview_setup(DecoderPriv *dp, AVCodecContext *dec_ctx)
{
unsigned views_wanted = 0;
unsigned nb_view_ids_av, nb_view_ids;
unsigned *view_ids_av = NULL, *view_pos_av = NULL;
int *view_ids = NULL;
int ret;
// no views/only base view were requested - do nothing
if (!dp->nb_views_requested ||
(dp->nb_views_requested == 1 &&
dp->views_requested[0].vs.type == VIEW_SPECIFIER_TYPE_IDX &&
dp->views_requested[0].vs.val == 0))
return 0;
av_freep(&dp->view_map);
dp->nb_view_map = 0;
// retrieve views available in current CVS
ret = av_opt_get_array_size(dec_ctx, "view_ids_available",
AV_OPT_SEARCH_CHILDREN, &nb_view_ids_av);
if (ret < 0) {
av_log(dp, AV_LOG_ERROR,
"Multiview decoding requested, but decoder '%s' does not "
"support it\n", dec_ctx->codec->name);
return AVERROR(ENOSYS);
}
if (nb_view_ids_av) {
unsigned nb_view_pos_av;
if (nb_view_ids_av >= sizeof(views_wanted) * 8) {
av_log(dp, AV_LOG_ERROR, "Too many views in video: %u\n", nb_view_ids_av);
ret = AVERROR(ENOSYS);
goto fail;
}
view_ids_av = av_calloc(nb_view_ids_av, sizeof(*view_ids_av));
if (!view_ids_av) {
ret = AVERROR(ENOMEM);
goto fail;
}
ret = av_opt_get_array(dec_ctx, "view_ids_available",
AV_OPT_SEARCH_CHILDREN, 0, nb_view_ids_av,
AV_OPT_TYPE_UINT, view_ids_av);
if (ret < 0)
goto fail;
ret = av_opt_get_array_size(dec_ctx, "view_pos_available",
AV_OPT_SEARCH_CHILDREN, &nb_view_pos_av);
if (ret >= 0 && nb_view_pos_av == nb_view_ids_av) {
view_pos_av = av_calloc(nb_view_ids_av, sizeof(*view_pos_av));
if (!view_pos_av) {
ret = AVERROR(ENOMEM);
goto fail;
}
ret = av_opt_get_array(dec_ctx, "view_pos_available",
AV_OPT_SEARCH_CHILDREN, 0, nb_view_ids_av,
AV_OPT_TYPE_UINT, view_pos_av);
if (ret < 0)
goto fail;
}
} else {
// assume there is a single view with ID=0
nb_view_ids_av = 1;
view_ids_av = av_calloc(nb_view_ids_av, sizeof(*view_ids_av));
view_pos_av = av_calloc(nb_view_ids_av, sizeof(*view_pos_av));
if (!view_ids_av || !view_pos_av) {
ret = AVERROR(ENOMEM);
goto fail;
}
view_pos_av[0] = AV_STEREO3D_VIEW_UNSPEC;
}
dp->view_map = av_calloc(nb_view_ids_av, sizeof(*dp->view_map));
if (!dp->view_map) {
ret = AVERROR(ENOMEM);
goto fail;
}
dp->nb_view_map = nb_view_ids_av;
for (int i = 0; i < dp->nb_view_map; i++)
dp->view_map[i].id = view_ids_av[i];
// figure out which views should go to which output
for (int i = 0; i < dp->nb_views_requested; i++) {
const ViewSpecifier *vs = &dp->views_requested[i].vs;
switch (vs->type) {
case VIEW_SPECIFIER_TYPE_IDX:
if (vs->val >= nb_view_ids_av) {
av_log(dp, exit_on_error ? AV_LOG_ERROR : AV_LOG_WARNING,
"View with index %u requested, but only %u views available "
"in current video sequence (more views may or may not be "
"available in later sequences).\n",
vs->val, nb_view_ids_av);
if (exit_on_error) {
ret = AVERROR(EINVAL);
goto fail;
}
continue;
}
views_wanted |= 1U << vs->val;
dp->view_map[vs->val].out_mask |= 1ULL << i;
break;
case VIEW_SPECIFIER_TYPE_ID: {
int view_idx = -1;
for (unsigned j = 0; j < nb_view_ids_av; j++) {
if (view_ids_av[j] == vs->val) {
view_idx = j;
break;
}
}
if (view_idx < 0) {
av_log(dp, exit_on_error ? AV_LOG_ERROR : AV_LOG_WARNING,
"View with ID %u requested, but is not available "
"in the video sequence\n", vs->val);
if (exit_on_error) {
ret = AVERROR(EINVAL);
goto fail;
}
continue;
}
views_wanted |= 1U << view_idx;
dp->view_map[view_idx].out_mask |= 1ULL << i;
break;
}
case VIEW_SPECIFIER_TYPE_POS: {
int view_idx = -1;
for (unsigned j = 0; view_pos_av && j < nb_view_ids_av; j++) {
if (view_pos_av[j] == vs->val) {
view_idx = j;
break;
}
}
if (view_idx < 0) {
av_log(dp, exit_on_error ? AV_LOG_ERROR : AV_LOG_WARNING,
"View position '%s' requested, but is not available "
"in the video sequence\n", av_stereo3d_view_name(vs->val));
if (exit_on_error) {
ret = AVERROR(EINVAL);
goto fail;
}
continue;
}
views_wanted |= 1U << view_idx;
dp->view_map[view_idx].out_mask |= 1ULL << i;
break;
}
case VIEW_SPECIFIER_TYPE_ALL:
views_wanted |= (1U << nb_view_ids_av) - 1;
for (int j = 0; j < dp->nb_view_map; j++)
dp->view_map[j].out_mask |= 1ULL << i;
break;
}
}
if (!views_wanted) {
av_log(dp, AV_LOG_ERROR, "No views were selected for decoding\n");
ret = AVERROR(EINVAL);
goto fail;
}
// signal to decoder which views we want
nb_view_ids = stdc_count_ones(views_wanted);
view_ids = av_malloc_array(nb_view_ids, sizeof(*view_ids));
if (!view_ids) {
ret = AVERROR(ENOMEM);
goto fail;
}
for (unsigned i = 0; i < nb_view_ids; i++) {
int pos;
av_assert0(views_wanted);
pos = stdc_trailing_zeros(views_wanted);
views_wanted &= ~(1U << pos);
view_ids[i] = view_ids_av[pos];
}
// unset view_ids in case we set it earlier
av_opt_set(dec_ctx, "view_ids", NULL, AV_OPT_SEARCH_CHILDREN);
ret = av_opt_set_array(dec_ctx, "view_ids", AV_OPT_SEARCH_CHILDREN,
0, nb_view_ids, AV_OPT_TYPE_INT, view_ids);
if (ret < 0)
goto fail;
if (!dp->frame_tmp_ref) {
dp->frame_tmp_ref = av_frame_alloc();
if (!dp->frame_tmp_ref) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
fail:
av_freep(&view_ids_av);
av_freep(&view_pos_av);
av_freep(&view_ids);
return ret;
}
static void multiview_check_manual(DecoderPriv *dp, const AVDictionary *dec_opts)
{
if (av_dict_get(dec_opts, "view_ids", NULL, 0)) {
av_log(dp, AV_LOG_WARNING, "Manually selecting views with -view_ids "
"is not recommended, use view specifiers instead\n");
dp->multiview_user_config = 1;
}
}
static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
{
DecoderPriv *dp = s->opaque;
const enum AVPixelFormat *p;
int ret;
ret = multiview_setup(dp, s);
if (ret < 0) {
av_log(dp, AV_LOG_ERROR, "Error setting up multiview decoding: %s\n",
av_err2str(ret));
return AV_PIX_FMT_NONE;
}
for (p = pix_fmts; *p != AV_PIX_FMT_NONE; p++) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p);
@@ -993,6 +1354,26 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
return *p;
}
static int get_buffer(AVCodecContext *dec_ctx, AVFrame *frame, int flags)
{
DecoderPriv *dp = dec_ctx->opaque;
// for multiview video, store the output mask in frame opaque
if (dp->nb_view_map) {
const AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIEW_ID);
int view_id = sd ? *(int*)sd->data : 0;
for (int i = 0; i < dp->nb_view_map; i++) {
if (dp->view_map[i].id == view_id) {
frame->opaque = (void*)dp->view_map[i].out_mask;
break;
}
}
}
return avcodec_default_get_buffer2(dec_ctx, frame, flags);
}
static HWDevice *hw_device_match_by_codec(const AVCodec *codec)
{
const AVCodecHWConfig *config;
@@ -1186,13 +1567,12 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
dp->dec_ctx->opaque = dp;
dp->dec_ctx->get_format = get_format;
dp->dec_ctx->get_buffer2 = get_buffer;
dp->dec_ctx->pkt_timebase = o->time_base;
if (!av_dict_get(*dec_opts, "threads", NULL, 0))
av_dict_set(dec_opts, "threads", "auto", 0);
av_dict_set(dec_opts, "flags", "+copy_opaque", AV_DICT_MULTIKEY);
ret = hw_device_setup_for_decode(dp, codec, o->hwaccel_device);
if (ret < 0) {
av_log(dp, AV_LOG_ERROR,
@@ -1201,7 +1581,25 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
return ret;
}
if ((ret = avcodec_open2(dp->dec_ctx, codec, dec_opts)) < 0) {
ret = av_opt_set_dict2(dp->dec_ctx, dec_opts, AV_OPT_SEARCH_CHILDREN);
if (ret < 0) {
av_log(dp, AV_LOG_ERROR, "Error applying decoder options: %s\n",
av_err2str(ret));
return ret;
}
ret = check_avoptions(*dec_opts);
if (ret < 0)
return ret;
dp->dec_ctx->flags |= AV_CODEC_FLAG_COPY_OPAQUE;
if (o->flags & DECODER_FLAG_BITEXACT)
dp->dec_ctx->flags |= AV_CODEC_FLAG_BITEXACT;
// we apply cropping outselves
dp->apply_cropping = dp->dec_ctx->apply_cropping;
dp->dec_ctx->apply_cropping = 0;
if ((ret = avcodec_open2(dp->dec_ctx, codec, NULL)) < 0) {
av_log(dp, AV_LOG_ERROR, "Error while opening decoder: %s\n",
av_err2str(ret));
return ret;
@@ -1220,10 +1618,6 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
dp->dec_ctx->extra_hw_frames = extra_frames;
}
ret = check_avoptions(*dec_opts);
if (ret < 0)
return ret;
dp->dec.subtitle_header = dp->dec_ctx->subtitle_header;
dp->dec.subtitle_header_size = dp->dec_ctx->subtitle_header_size;
@@ -1263,6 +1657,8 @@ int dec_init(Decoder **pdec, Scheduler *sch,
if (ret < 0)
return ret;
multiview_check_manual(dp, *dec_opts);
ret = dec_open(dp, dec_opts, o, param_out);
if (ret < 0)
goto fail;
@@ -1327,7 +1723,7 @@ int dec_create(const OptionsContext *o, const char *arg, Scheduler *sch)
return ret;
enc_idx = ret;
ret = sch_connect(sch, SCH_ENC(enc_idx), SCH_DEC(dp->sch_idx));
ret = sch_connect(sch, SCH_ENC(enc_idx), SCH_DEC_IN(dp->sch_idx));
if (ret < 0)
return ret;
@@ -1335,6 +1731,8 @@ int dec_create(const OptionsContext *o, const char *arg, Scheduler *sch)
if (ret < 0)
return ret;
multiview_check_manual(dp, dp->standalone_init.opts);
if (o->codec_names.nb_opt) {
const char *name = o->codec_names.opt[o->codec_names.nb_opt - 1].u.str;
dp->standalone_init.codec = avcodec_find_decoder_by_name(name);
@@ -1347,7 +1745,8 @@ int dec_create(const OptionsContext *o, const char *arg, Scheduler *sch)
return 0;
}
int dec_filter_add(Decoder *d, InputFilter *ifilter, InputFilterOptions *opts)
int dec_filter_add(Decoder *d, InputFilter *ifilter, InputFilterOptions *opts,
const ViewSpecifier *vs, SchedulerNode *src)
{
DecoderPriv *dp = dp_from_dec(d);
char name[16];
@@ -1357,5 +1756,5 @@ int dec_filter_add(Decoder *d, InputFilter *ifilter, InputFilterOptions *opts)
if (!opts->name)
return AVERROR(ENOMEM);
return dp->sch_idx;
return dec_request_view(d, vs, src);
}
+151 -96
View File
@@ -28,6 +28,7 @@
#include "libavutil/display.h"
#include "libavutil/error.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
@@ -64,6 +65,9 @@ typedef struct DemuxStream {
int streamcopy_needed;
int have_sub2video;
int reinit_filters;
int autorotate;
int apply_cropping;
int wrap_correction_done;
int saw_first_ts;
@@ -870,7 +874,8 @@ void ifile_close(InputFile **pf)
av_freep(pf);
}
static int ist_use(InputStream *ist, int decoding_needed)
static int ist_use(InputStream *ist, int decoding_needed,
const ViewSpecifier *vs, SchedulerNode *src)
{
Demuxer *d = demuxer_from_ifile(ist->file);
DemuxStream *ds = ds_from_ist(ist);
@@ -908,11 +913,11 @@ static int ist_use(InputStream *ist, int decoding_needed)
if (decoding_needed && ds->sch_idx_dec < 0) {
int is_audio = ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO;
ds->dec_opts.flags = (!!ist->fix_sub_duration * DECODER_FLAG_FIX_SUB_DURATION) |
(!!(d->f.ctx->iformat->flags & AVFMT_NOTIMESTAMPS) * DECODER_FLAG_TS_UNRELIABLE) |
(!!(d->loop && is_audio) * DECODER_FLAG_SEND_END_TS)
ds->dec_opts.flags |= (!!ist->fix_sub_duration * DECODER_FLAG_FIX_SUB_DURATION) |
(!!(d->f.ctx->iformat->flags & AVFMT_NOTIMESTAMPS) * DECODER_FLAG_TS_UNRELIABLE) |
(!!(d->loop && is_audio) * DECODER_FLAG_SEND_END_TS)
#if FFMPEG_OPT_TOP
| ((ist->top_field_first >= 0) * DECODER_FLAG_TOP_FIELD_FIRST)
| ((ist->top_field_first >= 0) * DECODER_FLAG_TOP_FIELD_FIRST)
#endif
;
@@ -950,22 +955,33 @@ static int ist_use(InputStream *ist, int decoding_needed)
ds->sch_idx_dec = ret;
ret = sch_connect(d->sch, SCH_DSTREAM(d->f.index, ds->sch_idx_stream),
SCH_DEC(ds->sch_idx_dec));
SCH_DEC_IN(ds->sch_idx_dec));
if (ret < 0)
return ret;
d->have_audio_dec |= is_audio;
}
if (decoding_needed && ist->par->codec_type == AVMEDIA_TYPE_VIDEO) {
ret = dec_request_view(ist->decoder, vs, src);
if (ret < 0)
return ret;
} else {
*src = decoding_needed ?
SCH_DEC_OUT(ds->sch_idx_dec, 0) :
SCH_DSTREAM(d->f.index, ds->sch_idx_stream);
}
return 0;
}
int ist_output_add(InputStream *ist, OutputStream *ost)
{
DemuxStream *ds = ds_from_ist(ist);
SchedulerNode src;
int ret;
ret = ist_use(ist, ost->enc ? DECODING_FOR_OST : 0);
ret = ist_use(ist, ost->enc ? DECODING_FOR_OST : 0, NULL, &src);
if (ret < 0)
return ret;
@@ -979,14 +995,16 @@ int ist_output_add(InputStream *ist, OutputStream *ost)
}
int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
InputFilterOptions *opts)
const ViewSpecifier *vs, InputFilterOptions *opts,
SchedulerNode *src)
{
Demuxer *d = demuxer_from_ifile(ist->file);
DemuxStream *ds = ds_from_ist(ist);
int64_t tsoffset = 0;
int ret;
ret = ist_use(ist, is_simple ? DECODING_FOR_OST : DECODING_FOR_FILTER);
ret = ist_use(ist, is_simple ? DECODING_FOR_OST : DECODING_FOR_FILTER,
vs, src);
if (ret < 0)
return ret;
@@ -997,11 +1015,23 @@ int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
ist->filters[ist->nb_filters - 1] = ifilter;
if (ist->par->codec_type == AVMEDIA_TYPE_VIDEO) {
const AVPacketSideData *sd = av_packet_side_data_get(ist->par->coded_side_data,
ist->par->nb_coded_side_data,
AV_PKT_DATA_FRAME_CROPPING);
if (ist->framerate.num > 0 && ist->framerate.den > 0) {
opts->framerate = ist->framerate;
opts->flags |= IFILTER_FLAG_CFR;
} else
opts->framerate = av_guess_frame_rate(d->f.ctx, ist->st, NULL);
if (sd && sd->size >= sizeof(uint32_t) * 4) {
opts->crop_top = AV_RL32(sd->data + 0);
opts->crop_bottom = AV_RL32(sd->data + 4);
opts->crop_left = AV_RL32(sd->data + 8);
opts->crop_right = AV_RL32(sd->data + 12);
if (ds->apply_cropping && ds->apply_cropping != CROP_CODEC &&
(opts->crop_top | opts->crop_bottom | opts->crop_left | opts->crop_right))
opts->flags |= IFILTER_FLAG_CROP;
}
} else if (ist->par->codec_type == AVMEDIA_TYPE_SUBTITLE) {
/* Compute the size of the canvas for the subtitles stream.
If the subtitles codecpar has set a size, use it. Otherwise use the
@@ -1055,20 +1085,21 @@ int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
if (!opts->name)
return AVERROR(ENOMEM);
opts->flags |= IFILTER_FLAG_AUTOROTATE * !!(ist->autorotate) |
opts->flags |= IFILTER_FLAG_AUTOROTATE * !!(ds->autorotate) |
IFILTER_FLAG_REINIT * !!(ds->reinit_filters);
return ds->sch_idx_dec;
return 0;
}
static int choose_decoder(const OptionsContext *o, AVFormatContext *s, AVStream *st,
static int choose_decoder(const OptionsContext *o, void *logctx,
AVFormatContext *s, AVStream *st,
enum HWAccelID hwaccel_id, enum AVHWDeviceType hwaccel_device_type,
const AVCodec **pcodec)
{
char *codec_name = NULL;
const char *codec_name = NULL;
MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, st);
opt_match_per_stream_str(logctx, &o->codec_names, s, st, &codec_name);
if (codec_name) {
int ret = find_codec(NULL, codec_name, st->codecpar->codec_type, 0, pcodec);
if (ret < 0)
@@ -1134,9 +1165,9 @@ static int add_display_matrix_to_stream(const OptionsContext *o,
int hflip_set = 0, vflip_set = 0, rotation_set = 0;
int32_t *buf;
MATCH_PER_STREAM_OPT(display_rotations, dbl, rotation, ctx, st);
MATCH_PER_STREAM_OPT(display_hflips, i, hflip, ctx, st);
MATCH_PER_STREAM_OPT(display_vflips, i, vflip, ctx, st);
opt_match_per_stream_dbl(ist, &o->display_rotations, ctx, st, &rotation);
opt_match_per_stream_int(ist, &o->display_hflips, ctx, st, &hflip);
opt_match_per_stream_int(ist, &o->display_vflips, ctx, st, &vflip);
rotation_set = rotation != DBL_MAX;
hflip_set = hflip != -1;
@@ -1204,19 +1235,20 @@ static DemuxStream *demux_stream_alloc(Demuxer *d, AVStream *st)
return ds;
}
static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictionary **opts_used)
{
AVFormatContext *ic = d->f.ctx;
AVCodecParameters *par = st->codecpar;
DemuxStream *ds;
InputStream *ist;
char *framerate = NULL, *hwaccel_device = NULL;
const char *framerate = NULL, *hwaccel_device = NULL;
const char *hwaccel = NULL;
char *hwaccel_output_format = NULL;
char *codec_tag = NULL;
char *bsfs = NULL;
const char *apply_cropping = NULL;
const char *hwaccel_output_format = NULL;
const char *codec_tag = NULL;
const char *bsfs = NULL;
char *next;
char *discard_str = NULL;
const char *discard_str = NULL;
int ret;
ds = demux_stream_alloc(d, st);
@@ -1233,12 +1265,39 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
ds->dec_opts.time_base = st->time_base;
ds->ts_scale = 1.0;
MATCH_PER_STREAM_OPT(ts_scale, dbl, ds->ts_scale, ic, st);
opt_match_per_stream_dbl(ist, &o->ts_scale, ic, st, &ds->ts_scale);
ist->autorotate = 1;
MATCH_PER_STREAM_OPT(autorotate, i, ist->autorotate, ic, st);
ds->autorotate = 1;
opt_match_per_stream_int(ist, &o->autorotate, ic, st, &ds->autorotate);
MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, ic, st);
ds->apply_cropping = CROP_ALL;
opt_match_per_stream_str(ist, &o->apply_cropping, ic, st, &apply_cropping);
if (apply_cropping) {
const AVOption opts[] = {
{ "apply_cropping", NULL, 0, AV_OPT_TYPE_INT,
{ .i64 = CROP_ALL }, CROP_DISABLED, CROP_CONTAINER, AV_OPT_FLAG_DECODING_PARAM, .unit = "apply_cropping" },
{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CROP_DISABLED }, .unit = "apply_cropping" },
{ "all", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CROP_ALL }, .unit = "apply_cropping" },
{ "codec", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CROP_CODEC }, .unit = "apply_cropping" },
{ "container", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CROP_CONTAINER }, .unit = "apply_cropping" },
{ NULL },
};
const AVClass class = {
.class_name = "apply_cropping",
.item_name = av_default_item_name,
.option = opts,
.version = LIBAVUTIL_VERSION_INT,
};
const AVClass *pclass = &class;
ret = av_opt_eval_int(&pclass, opts, apply_cropping, &ds->apply_cropping);
if (ret < 0) {
av_log(ist, AV_LOG_ERROR, "Invalid apply_cropping value '%s'.\n", apply_cropping);
return ret;
}
}
opt_match_per_stream_str(ist, &o->codec_tags, ic, st, &codec_tag);
if (codec_tag) {
uint32_t tag = strtol(codec_tag, &next, 0);
if (*next) {
@@ -1255,10 +1314,9 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
if (ret < 0)
return ret;
MATCH_PER_STREAM_OPT(hwaccels, str, hwaccel, ic, st);
MATCH_PER_STREAM_OPT(hwaccel_output_formats, str,
hwaccel_output_format, ic, st);
opt_match_per_stream_str(ist, &o->hwaccels, ic, st, &hwaccel);
opt_match_per_stream_str(ist, &o->hwaccel_output_formats, ic, st,
&hwaccel_output_format);
if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel, "cuvid")) {
av_log(ist, AV_LOG_WARNING,
"WARNING: defaulting hwaccel_output_format to cuda for compatibility "
@@ -1316,7 +1374,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
}
}
MATCH_PER_STREAM_OPT(hwaccel_devices, str, hwaccel_device, ic, st);
opt_match_per_stream_str(ist, &o->hwaccel_devices, ic, st, &hwaccel_device);
if (hwaccel_device) {
ds->dec_opts.hwaccel_device = av_strdup(hwaccel_device);
if (!ds->dec_opts.hwaccel_device)
@@ -1324,18 +1382,20 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
}
}
ret = choose_decoder(o, ic, st, ds->dec_opts.hwaccel_id,
ret = choose_decoder(o, ist, ic, st, ds->dec_opts.hwaccel_id,
ds->dec_opts.hwaccel_device_type, &ist->dec);
if (ret < 0)
return ret;
ret = filter_codec_opts(o->g->codec_opts, ist->st->codecpar->codec_id,
ic, st, ist->dec, &ds->decoder_opts);
if (ret < 0)
return ret;
if (ist->dec) {
ret = filter_codec_opts(o->g->codec_opts, ist->st->codecpar->codec_id,
ic, st, ist->dec, &ds->decoder_opts, opts_used);
if (ret < 0)
return ret;
}
ds->reinit_filters = -1;
MATCH_PER_STREAM_OPT(reinit_filters, i, ds->reinit_filters, ic, st);
opt_match_per_stream_int(ist, &o->reinit_filters, ic, st, &ds->reinit_filters);
ist->user_set_discard = AVDISCARD_NONE;
@@ -1345,7 +1405,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
(o->data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA))
ist->user_set_discard = AVDISCARD_ALL;
MATCH_PER_STREAM_OPT(discard, str, discard_str, ic, st);
opt_match_per_stream_str(ist, &o->discard, ic, st, &discard_str);
if (discard_str) {
ret = av_opt_set(ist->st, "discard", discard_str, 0);
if (ret < 0) {
@@ -1355,8 +1415,10 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
ist->user_set_discard = ist->st->discard;
}
if (o->bitexact)
av_dict_set(&ds->decoder_opts, "flags", "+bitexact", AV_DICT_MULTIKEY);
ds->dec_opts.flags |= DECODER_FLAG_BITEXACT * !!o->bitexact;
av_dict_set_int(&ds->decoder_opts, "apply_cropping",
ds->apply_cropping && ds->apply_cropping != CROP_CONTAINER, 0);
/* Attached pics are sparse, therefore we would not want to delay their decoding
* till EOF. */
@@ -1365,7 +1427,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
switch (par->codec_type) {
case AVMEDIA_TYPE_VIDEO:
MATCH_PER_STREAM_OPT(frame_rates, str, framerate, ic, st);
opt_match_per_stream_str(ist, &o->frame_rates, ic, st, &framerate);
if (framerate) {
ret = av_parse_video_rate(&ist->framerate, framerate);
if (ret < 0) {
@@ -1377,21 +1439,44 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
#if FFMPEG_OPT_TOP
ist->top_field_first = -1;
MATCH_PER_STREAM_OPT(top_field_first, i, ist->top_field_first, ic, st);
opt_match_per_stream_int(ist, &o->top_field_first, ic, st, &ist->top_field_first);
#endif
break;
case AVMEDIA_TYPE_AUDIO: {
int guess_layout_max = INT_MAX;
MATCH_PER_STREAM_OPT(guess_layout_max, i, guess_layout_max, ic, st);
guess_input_channel_layout(ist, par, guess_layout_max);
const char *ch_layout_str = NULL;
opt_match_per_stream_str(ist, &o->audio_ch_layouts, ic, st, &ch_layout_str);
if (ch_layout_str) {
AVChannelLayout ch_layout;
ret = av_channel_layout_from_string(&ch_layout, ch_layout_str);
if (ret < 0) {
av_log(ist, AV_LOG_ERROR, "Error parsing channel layout %s.\n", ch_layout_str);
return ret;
}
if (par->ch_layout.nb_channels <= 0 || par->ch_layout.nb_channels == ch_layout.nb_channels) {
av_channel_layout_uninit(&par->ch_layout);
par->ch_layout = ch_layout;
} else {
av_log(ist, AV_LOG_ERROR,
"Specified channel layout '%s' has %d channels, but input has %d channels.\n",
ch_layout_str, ch_layout.nb_channels, par->ch_layout.nb_channels);
av_channel_layout_uninit(&ch_layout);
return AVERROR(EINVAL);
}
} else {
int guess_layout_max = INT_MAX;
opt_match_per_stream_int(ist, &o->guess_layout_max, ic, st, &guess_layout_max);
guess_input_channel_layout(ist, par, guess_layout_max);
}
break;
}
case AVMEDIA_TYPE_DATA:
case AVMEDIA_TYPE_SUBTITLE: {
char *canvas_size = NULL;
MATCH_PER_STREAM_OPT(fix_sub_duration, i, ist->fix_sub_duration, ic, st);
MATCH_PER_STREAM_OPT(canvas_sizes, str, canvas_size, ic, st);
const char *canvas_size = NULL;
opt_match_per_stream_int(ist, &o->fix_sub_duration, ic, st, &ist->fix_sub_duration);
opt_match_per_stream_str(ist, &o->canvas_sizes, ic, st, &canvas_size);
if (canvas_size) {
ret = av_parse_video_size(&par->width, &par->height,
canvas_size);
@@ -1421,7 +1506,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
if (ist->st->sample_aspect_ratio.num)
ist->par->sample_aspect_ratio = ist->st->sample_aspect_ratio;
MATCH_PER_STREAM_OPT(bitstream_filters, str, bsfs, ic, st);
opt_match_per_stream_str(ist, &o->bitstream_filters, ic, st, &bsfs);
if (bsfs) {
ret = av_bsf_list_parse_str(bsfs, &ds->bsf);
if (ret < 0) {
@@ -1526,10 +1611,9 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
InputFile *f;
AVFormatContext *ic;
const AVInputFormat *file_iformat = NULL;
int err, i, ret = 0;
int err, ret = 0;
int64_t timestamp;
AVDictionary *unused_opts = NULL;
const AVDictionaryEntry *e = NULL;
AVDictionary *opts_used = NULL;
const char* video_codec_name = NULL;
const char* audio_codec_name = NULL;
const char* subtitle_codec_name = NULL;
@@ -1682,9 +1766,9 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
return ret;
/* apply forced codec ids */
for (i = 0; i < ic->nb_streams; i++) {
for (int i = 0; i < ic->nb_streams; i++) {
const AVCodec *dummy;
ret = choose_decoder(o, ic, ic->streams[i], HWACCEL_NONE, AV_HWDEVICE_TYPE_NONE,
ret = choose_decoder(o, f, ic, ic->streams[i], HWACCEL_NONE, AV_HWDEVICE_TYPE_NONE,
&dummy);
if (ret < 0)
return ret;
@@ -1702,7 +1786,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
first frames to get it. (used in mpeg case for example) */
ret = avformat_find_stream_info(ic, opts);
for (i = 0; i < orig_nb_streams; i++)
for (int i = 0; i < orig_nb_streams; i++)
av_dict_free(&opts[i]);
av_freep(&opts);
@@ -1743,7 +1827,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
if (!(ic->iformat->flags & AVFMT_SEEK_TO_PTS)) {
int dts_heuristic = 0;
for (i=0; i<ic->nb_streams; i++) {
for (int i = 0; i < ic->nb_streams; i++) {
const AVCodecParameters *par = ic->streams[i]->codecpar;
if (par->video_delay) {
dts_heuristic = 1;
@@ -1801,53 +1885,24 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
/* Add all the streams from the given input file to the demuxer */
for (int i = 0; i < ic->nb_streams; i++) {
ret = ist_add(o, d, ic->streams[i]);
if (ret < 0)
ret = ist_add(o, d, ic->streams[i], &opts_used);
if (ret < 0) {
av_dict_free(&opts_used);
return ret;
}
}
/* dump the file content */
av_dump_format(ic, f->index, filename, 0);
/* check if all codec options have been used */
unused_opts = strip_specifiers(o->g->codec_opts);
for (i = 0; i < f->nb_streams; i++) {
DemuxStream *ds = ds_from_ist(f->streams[i]);
e = NULL;
while ((e = av_dict_iterate(ds->decoder_opts, e)))
av_dict_set(&unused_opts, e->key, NULL, 0);
}
ret = check_avoptions_used(o->g->codec_opts, opts_used, d, 1);
av_dict_free(&opts_used);
if (ret < 0)
return ret;
e = NULL;
while ((e = av_dict_iterate(unused_opts, e))) {
const AVClass *class = avcodec_get_class();
const AVOption *option = av_opt_find(&class, e->key, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
const AVClass *fclass = avformat_get_class();
const AVOption *foption = av_opt_find(&fclass, e->key, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
if (!option || foption)
continue;
if (!(option->flags & AV_OPT_FLAG_DECODING_PARAM)) {
av_log(d, AV_LOG_ERROR, "Codec AVOption %s (%s) is not a decoding "
"option.\n", e->key, option->help ? option->help : "");
return AVERROR(EINVAL);
}
av_log(d, AV_LOG_WARNING, "Codec AVOption %s (%s) has not been used "
"for any stream. The most likely reason is either wrong type "
"(e.g. a video option with no video streams) or that it is a "
"private option of some decoder which was not actually used "
"for any stream.\n", e->key, option->help ? option->help : "");
}
av_dict_free(&unused_opts);
for (i = 0; i < o->dump_attachment.nb_opt; i++) {
int j;
for (j = 0; j < f->nb_streams; j++) {
for (int i = 0; i < o->dump_attachment.nb_opt; i++) {
for (int j = 0; j < f->nb_streams; j++) {
InputStream *ist = f->streams[j];
if (check_stream_specifier(ic, ist->st, o->dump_attachment.opt[i].specifier) == 1) {
+22 -62
View File
@@ -20,8 +20,6 @@
#include <stdint.h>
#include "ffmpeg.h"
#include "ffmpeg_utils.h"
#include "thread_queue.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
@@ -32,6 +30,7 @@
#include "libavutil/frame.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "libavutil/rational.h"
#include "libavutil/time.h"
@@ -39,8 +38,6 @@
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
struct Encoder {
// combined size of all the packets received from the encoder
uint64_t data_size;
@@ -171,7 +168,7 @@ int enc_open(void *opaque, const AVFrame *frame)
InputStream *ist = ost->ist;
Encoder *e = ost->enc;
AVCodecContext *enc_ctx = ost->enc_ctx;
Decoder *dec;
Decoder *dec = NULL;
const AVCodec *enc = enc_ctx->codec;
OutputFile *of = ost->file;
FrameData *fd;
@@ -187,6 +184,20 @@ int enc_open(void *opaque, const AVFrame *frame)
if (frame) {
av_assert0(frame->opaque_ref);
fd = (FrameData*)frame->opaque_ref->data;
for (int i = 0; i < frame->nb_side_data; i++) {
const AVSideDataDescriptor *desc = av_frame_side_data_desc(frame->side_data[i]->type);
if (!(desc->props & AV_SIDE_DATA_PROP_GLOBAL))
continue;
ret = av_frame_side_data_clone(&enc_ctx->decoded_side_data,
&enc_ctx->nb_decoded_side_data,
frame->side_data[i],
AV_FRAME_SIDE_DATA_FLAG_UNIQUE);
if (ret < 0)
return ret;
}
}
ret = set_encoder_id(of, ost);
@@ -246,21 +257,6 @@ int enc_open(void *opaque, const AVFrame *frame)
enc_ctx->colorspace = frame->colorspace;
enc_ctx->chroma_sample_location = frame->chroma_location;
for (int i = 0; i < frame->nb_side_data; i++) {
ret = av_frame_side_data_clone(
&enc_ctx->decoded_side_data, &enc_ctx->nb_decoded_side_data,
frame->side_data[i], AV_FRAME_SIDE_DATA_FLAG_UNIQUE);
if (ret < 0) {
av_frame_side_data_free(
&enc_ctx->decoded_side_data,
&enc_ctx->nb_decoded_side_data);
av_log(NULL, AV_LOG_ERROR,
"failed to configure video encoder: %s!\n",
av_err2str(ret));
return ret;
}
}
if (enc_ctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) ||
(frame->flags & AV_FRAME_FLAG_INTERLACED)
#if FFMPEG_OPT_TOP
@@ -284,9 +280,6 @@ int enc_open(void *opaque, const AVFrame *frame)
break;
}
case AVMEDIA_TYPE_SUBTITLE:
if (ost->enc_timebase.num)
av_log(ost, AV_LOG_WARNING,
"-enc_time_base not supported for subtitles, ignoring\n");
enc_ctx->time_base = AV_TIME_BASE_Q;
if (!enc_ctx->width) {
@@ -314,16 +307,10 @@ int enc_open(void *opaque, const AVFrame *frame)
if (ost->bitexact)
enc_ctx->flags |= AV_CODEC_FLAG_BITEXACT;
if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
if (enc->capabilities & AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE)
enc_ctx->flags |= AV_CODEC_FLAG_COPY_OPAQUE;
if (enc->capabilities & AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE) {
ret = av_dict_set(&ost->encoder_opts, "flags", "+copy_opaque", AV_DICT_MULTIKEY);
if (ret < 0)
return ret;
}
av_dict_set(&ost->encoder_opts, "flags", "+frame_duration", AV_DICT_MULTIKEY);
enc_ctx->flags |= AV_CODEC_FLAG_FRAME_DURATION;
ret = hw_device_setup_for_encode(ost, frame ? frame->hw_frames_ctx : NULL);
if (ret < 0) {
@@ -332,7 +319,7 @@ int enc_open(void *opaque, const AVFrame *frame)
return ret;
}
if ((ret = avcodec_open2(ost->enc_ctx, enc, &ost->encoder_opts)) < 0) {
if ((ret = avcodec_open2(ost->enc_ctx, enc, NULL)) < 0) {
if (ret != AVERROR_EXPERIMENTAL)
av_log(ost, AV_LOG_ERROR, "Error while opening encoder - maybe "
"incorrect parameters such as bit_rate, rate, width or height.\n");
@@ -344,10 +331,6 @@ int enc_open(void *opaque, const AVFrame *frame)
if (ost->enc_ctx->frame_size)
frame_samples = ost->enc_ctx->frame_size;
ret = check_avoptions(ost->encoder_opts);
if (ret < 0)
return ret;
if (ost->enc_ctx->bit_rate && ost->enc_ctx->bit_rate < 1000 &&
ost->enc_ctx->codec_id != AV_CODEC_ID_CODEC2 /* don't complain about 700 bit/s modes */)
av_log(ost, AV_LOG_WARNING, "The bitrate parameter is set too low."
@@ -360,29 +343,6 @@ int enc_open(void *opaque, const AVFrame *frame)
return ret;
}
/*
* Add global input side data. For now this is naive, and copies it
* from the input stream's global side data. All side data should
* really be funneled over AVFrame and libavfilter, then added back to
* packet side data, and then potentially using the first packet for
* global side data.
*/
if (ist) {
for (int i = 0; i < ist->st->codecpar->nb_coded_side_data; i++) {
AVPacketSideData *sd_src = &ist->st->codecpar->coded_side_data[i];
if (sd_src->type != AV_PKT_DATA_CPB_PROPERTIES) {
AVPacketSideData *sd_dst = av_packet_side_data_new(&ost->par_in->coded_side_data,
&ost->par_in->nb_coded_side_data,
sd_src->type, sd_src->size, 0);
if (!sd_dst)
return AVERROR(ENOMEM);
memcpy(sd_dst->data, sd_src->data, sd_src->size);
if (ist->autorotate && sd_src->type == AV_PKT_DATA_DISPLAYMATRIX)
av_display_rotation_set((int32_t *)sd_dst->data, 0);
}
}
}
// copy timebase while removing common factors
if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0)
ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
@@ -504,9 +464,9 @@ void enc_stats_write(OutputStream *ost, EncStats *es,
AVRational tbi = (AVRational){ 0, 1};
int64_t ptsi = INT64_MAX;
const FrameData *fd;
const FrameData *fd = NULL;
if ((frame && frame->opaque_ref) || (pkt && pkt->opaque_ref)) {
if (frame ? frame->opaque_ref : pkt->opaque_ref) {
fd = (const FrameData*)(frame ? frame->opaque_ref->data : pkt->opaque_ref->data);
tbi = fd->dec.tb;
ptsi = fd->dec.pts;
+410 -219
View File
File diff suppressed because it is too large Load Diff
+1 -3
View File
@@ -18,9 +18,7 @@
#include <string.h>
#include "libavutil/avstring.h"
#include "libavutil/pixdesc.h"
#include "libavfilter/buffersink.h"
#include "libavutil/mem.h"
#include "ffmpeg.h"
+13 -14
View File
@@ -140,7 +140,7 @@ static int mux_fixup_ts(Muxer *mux, MuxStream *ms, AVPacket *pkt)
OutputStream *ost = &ms->ost;
#if FFMPEG_OPT_VSYNC_DROP
if (ost->type == AVMEDIA_TYPE_VIDEO && ost->vsync_method == VSYNC_DROP)
if (ost->type == AVMEDIA_TYPE_VIDEO && ms->ts_drop)
pkt->pts = pkt->dts = AV_NOPTS_VALUE;
#endif
@@ -290,7 +290,7 @@ static int mux_packet_filter(Muxer *mux, MuxThreadContext *mt,
{
MuxStream *ms = ms_from_ost(ost);
const char *err_msg;
int ret = 0;
int ret;
if (pkt && !ost->enc) {
ret = of_streamcopy(&mux->of, ost, pkt);
@@ -299,7 +299,6 @@ static int mux_packet_filter(Muxer *mux, MuxThreadContext *mt,
else if (ret == AVERROR_EOF) {
av_packet_unref(pkt);
pkt = NULL;
ret = 0;
*stream_eof = 1;
} else if (ret < 0)
goto fail;
@@ -370,10 +369,11 @@ fail:
return ret;
}
static void thread_set_name(OutputFile *of)
static void thread_set_name(Muxer *mux)
{
char name[16];
snprintf(name, sizeof(name), "mux%d:%s", of->index, of->format->name);
snprintf(name, sizeof(name), "mux%d:%s",
mux->of.index, mux->fc->oformat->name);
ff_thread_setname(name);
}
@@ -417,7 +417,7 @@ int muxer_thread(void *arg)
if (ret < 0)
goto finish;
thread_set_name(of);
thread_set_name(mux);
while (1) {
OutputStream *ost;
@@ -515,8 +515,10 @@ int print_sdp(const char *filename)
if (!avc)
return AVERROR(ENOMEM);
for (int i = 0; i < nb_output_files; i++) {
if (!strcmp(output_files[i]->format->name, "rtp")) {
avc[j] = mux_from_of(output_files[i])->fc;
Muxer *mux = mux_from_of(output_files[i]);
if (!strcmp(mux->fc->oformat->name, "rtp")) {
avc[j] = mux->fc;
j++;
}
}
@@ -756,7 +758,7 @@ int of_write_trailer(OutputFile *of)
mux->last_filesize = filesize(fc->pb);
if (!(of->format->flags & AVFMT_NOFILE)) {
if (!(fc->oformat->flags & AVFMT_NOFILE)) {
ret = avio_closep(&fc->pb);
if (ret < 0) {
av_log(mux, AV_LOG_ERROR, "Error closing file: %s\n", av_err2str(ret));
@@ -794,6 +796,7 @@ static void ost_free(OutputStream **post)
ms = ms_from_ost(ost);
enc_free(&ost->enc);
fg_free(&ost->fg_simple);
if (ost->logfile) {
if (fclose(ost->logfile))
@@ -809,19 +812,14 @@ static void ost_free(OutputStream **post)
av_packet_free(&ms->bsf_pkt);
av_packet_free(&ms->pkt);
av_dict_free(&ost->encoder_opts);
av_freep(&ost->kf.pts);
av_expr_free(ost->kf.pexpr);
av_freep(&ost->logfile_prefix);
av_freep(&ost->apad);
av_freep(&ost->attachment_filename);
av_dict_free(&ost->sws_dict);
av_dict_free(&ost->swr_opts);
if (ost->enc_ctx)
av_freep(&ost->enc_ctx->stats_in);
avcodec_free_context(&ost->enc_ctx);
@@ -865,6 +863,7 @@ void of_free(OutputFile **pof)
av_freep(&mux->sch_stream_idx);
av_dict_free(&mux->opts);
av_dict_free(&mux->enc_opts_used);
av_packet_free(&mux->sq_pkt);
+8
View File
@@ -75,6 +75,11 @@ typedef struct MuxStream {
int copy_initial_nonkeyframes;
int copy_prior_start;
int streamcopy_started;
#if FFMPEG_OPT_VSYNC_DROP
int ts_drop;
#endif
const char *apad;
} MuxStream;
typedef struct Muxer {
@@ -94,6 +99,9 @@ typedef struct Muxer {
AVDictionary *opts;
// used to validate that all encoder avoptions have been actually used
AVDictionary *enc_opts_used;
/* filesize limit expressed in bytes */
int64_t limit_filesize;
atomic_int_least64_t last_filesize;
+534 -246
View File
File diff suppressed because it is too large Load Diff
+181 -59
View File
@@ -31,7 +31,6 @@
#include "ffmpeg_sched.h"
#include "cmdutils.h"
#include "opt_common.h"
#include "sync_queue.h"
#include "libavformat/avformat.h"
@@ -43,16 +42,11 @@
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/avutil.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/display.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/fifo.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/stereo3d.h"
HWDevice *filter_hw_device;
@@ -94,8 +88,6 @@ int recast_media = 0;
static void uninit_options(OptionsContext *o)
{
int i;
/* all OPT_SPEC and OPT_TYPE_STRING can be freed in generic way */
for (const OptionDef *po = options; po->name; po++) {
void *dst;
@@ -108,6 +100,8 @@ static void uninit_options(OptionsContext *o)
SpecifierOptList *so = dst;
for (int i = 0; i < so->nb_opt; i++) {
av_freep(&so->opt[i].specifier);
if (po->flags & OPT_FLAG_PERSTREAM)
stream_specifier_uninit(&so->opt[i].stream_spec);
if (po->type == OPT_TYPE_STRING)
av_freep(&so->opt[i].u.str);
}
@@ -117,11 +111,11 @@ static void uninit_options(OptionsContext *o)
av_freep(dst);
}
for (i = 0; i < o->nb_stream_maps; i++)
for (int i = 0; i < o->nb_stream_maps; i++)
av_freep(&o->stream_maps[i].linklabel);
av_freep(&o->stream_maps);
for (i = 0; i < o->nb_attachments; i++)
for (int i = 0; i < o->nb_attachments; i++)
av_freep(&o->attachments[i]);
av_freep(&o->attachments);
@@ -158,24 +152,6 @@ static int show_hwaccels(void *optctx, const char *opt, const char *arg)
return 0;
}
/* return a copy of the input with the stream specifiers removed from the keys */
AVDictionary *strip_specifiers(const AVDictionary *dict)
{
const AVDictionaryEntry *e = NULL;
AVDictionary *ret = NULL;
while ((e = av_dict_iterate(dict, e))) {
char *p = strchr(e->key, ':');
if (p)
*p = 0;
av_dict_set(&ret, e->key, e->value, 0);
if (p)
*p = ':';
}
return ret;
}
const char *opt_match_per_type_str(const SpecifierOptList *sol,
char mediatype)
{
@@ -189,6 +165,123 @@ const char *opt_match_per_type_str(const SpecifierOptList *sol,
return NULL;
}
static unsigned opt_match_per_stream(void *logctx, enum OptionType type,
const SpecifierOptList *sol,
AVFormatContext *fc, AVStream *st)
{
int matches = 0, match_idx = -1;
av_assert0((type == sol->type) || !sol->nb_opt);
for (int i = 0; i < sol->nb_opt; i++) {
const StreamSpecifier *ss = &sol->opt[i].stream_spec;
if (stream_specifier_match(ss, fc, st, logctx)) {
match_idx = i;
matches++;
}
}
if (matches > 1 && sol->opt_canon) {
const SpecifierOpt *so = &sol->opt[match_idx];
const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";
char namestr[128] = "";
char optval_buf[32];
const char *optval = optval_buf;
snprintf(namestr, sizeof(namestr), "-%s", sol->opt_canon->name);
if (sol->opt_canon->flags & OPT_HAS_ALT) {
const char * const *names_alt = sol->opt_canon->u1.names_alt;
for (int i = 0; names_alt[i]; i++)
av_strlcatf(namestr, sizeof(namestr), "/-%s", names_alt[i]);
}
switch (sol->type) {
case OPT_TYPE_STRING: optval = so->u.str; break;
case OPT_TYPE_INT: snprintf(optval_buf, sizeof(optval_buf), "%d", so->u.i); break;
case OPT_TYPE_INT64: snprintf(optval_buf, sizeof(optval_buf), "%"PRId64, so->u.i64); break;
case OPT_TYPE_FLOAT: snprintf(optval_buf, sizeof(optval_buf), "%f", so->u.f); break;
case OPT_TYPE_DOUBLE: snprintf(optval_buf, sizeof(optval_buf), "%f", so->u.dbl); break;
default: av_assert0(0);
}
av_log(logctx, AV_LOG_WARNING, "Multiple %s options specified for "
"stream %d, only the last option '-%s%s%s %s' will be used.\n",
namestr, st->index, sol->opt_canon->name, spec[0] ? ":" : "",
spec, optval);
}
return match_idx + 1;
}
#define OPT_MATCH_PER_STREAM(name, type, opt_type, m) \
void opt_match_per_stream_ ## name(void *logctx, const SpecifierOptList *sol, \
AVFormatContext *fc, AVStream *st, type *out) \
{ \
unsigned ret = opt_match_per_stream(logctx, opt_type, sol, fc, st); \
if (ret > 0) \
*out = sol->opt[ret - 1].u.m; \
}
OPT_MATCH_PER_STREAM(str, const char *, OPT_TYPE_STRING, str);
OPT_MATCH_PER_STREAM(int, int, OPT_TYPE_INT, i);
OPT_MATCH_PER_STREAM(int64, int64_t, OPT_TYPE_INT64, i64);
OPT_MATCH_PER_STREAM(dbl, double, OPT_TYPE_DOUBLE, dbl);
int view_specifier_parse(const char **pspec, ViewSpecifier *vs)
{
const char *spec = *pspec;
char *endptr;
vs->type = VIEW_SPECIFIER_TYPE_NONE;
if (!strncmp(spec, "view:", 5)) {
spec += 5;
if (!strncmp(spec, "all", 3)) {
spec += 3;
vs->type = VIEW_SPECIFIER_TYPE_ALL;
} else {
vs->type = VIEW_SPECIFIER_TYPE_ID;
vs->val = strtoul(spec, &endptr, 0);
if (endptr == spec) {
av_log(NULL, AV_LOG_ERROR, "Invalid view ID: %s\n", spec);
return AVERROR(EINVAL);
}
spec = endptr;
}
} else if (!strncmp(spec, "vidx:", 5)) {
spec += 5;
vs->type = VIEW_SPECIFIER_TYPE_IDX;
vs->val = strtoul(spec, &endptr, 0);
if (endptr == spec) {
av_log(NULL, AV_LOG_ERROR, "Invalid view index: %s\n", spec);
return AVERROR(EINVAL);
}
spec = endptr;
} else if (!strncmp(spec, "vpos:", 5)) {
spec += 5;
vs->type = VIEW_SPECIFIER_TYPE_POS;
if (!strncmp(spec, "left", 4) && !cmdutils_isalnum(spec[4])) {
spec += 4;
vs->val = AV_STEREO3D_VIEW_LEFT;
} else if (!strncmp(spec, "right", 5) && !cmdutils_isalnum(spec[5])) {
spec += 5;
vs->val = AV_STEREO3D_VIEW_RIGHT;
} else {
av_log(NULL, AV_LOG_ERROR, "Invalid view position: %s\n", spec);
return AVERROR(EINVAL);
}
} else
return 0;
*pspec = spec;
return 0;
}
int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global)
{
if (!av_strcasecmp(arg, "cfr")) *vsync_var = VSYNC_CFR;
@@ -324,7 +417,7 @@ static int opt_filter_threads(void *optctx, const char *opt, const char *arg)
static int opt_abort_on(void *optctx, const char *opt, const char *arg)
{
static const AVOption opts[] = {
{ "abort_on" , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" },
{ "abort_on" , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, (double)INT64_MAX, .unit = "flags" },
{ "empty_output" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = ABORT_ON_FLAG_EMPTY_OUTPUT }, .unit = "flags" },
{ "empty_output_stream", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM }, .unit = "flags" },
{ NULL },
@@ -386,22 +479,20 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
{
OptionsContext *o = optctx;
StreamMap *m = NULL;
StreamSpecifier ss;
int i, negative = 0, file_idx, disabled = 0;
int ret;
char *map, *p;
char *allow_unused;
int ret, allow_unused = 0;
memset(&ss, 0, sizeof(ss));
if (*arg == '-') {
negative = 1;
arg++;
}
map = av_strdup(arg);
if (!map)
return AVERROR(ENOMEM);
if (map[0] == '[') {
if (arg[0] == '[') {
/* this mapping refers to lavfi output */
const char *c = map + 1;
const char *c = arg + 1;
ret = GROW_ARRAY(o->stream_maps, o->nb_stream_maps);
if (ret < 0)
@@ -410,33 +501,62 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
m = &o->stream_maps[o->nb_stream_maps - 1];
m->linklabel = av_get_token(&c, "]");
if (!m->linklabel) {
av_log(NULL, AV_LOG_ERROR, "Invalid output link label: %s.\n", map);
av_log(NULL, AV_LOG_ERROR, "Invalid output link label: %s.\n", arg);
ret = AVERROR(EINVAL);
goto fail;
}
} else {
if (allow_unused = strchr(map, '?'))
*allow_unused = 0;
file_idx = strtol(map, &p, 0);
ViewSpecifier vs;
char *endptr;
file_idx = strtol(arg, &endptr, 0);
if (file_idx >= nb_input_files || file_idx < 0) {
av_log(NULL, AV_LOG_FATAL, "Invalid input file index: %d.\n", file_idx);
ret = AVERROR(EINVAL);
goto fail;
}
arg = endptr;
ret = stream_specifier_parse(&ss, *arg == ':' ? arg + 1 : arg, 1, NULL);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Invalid stream specifier: %s\n", arg);
goto fail;
}
arg = ss.remainder ? ss.remainder : "";
ret = view_specifier_parse(&arg, &vs);
if (ret < 0)
goto fail;
if (*arg) {
if (!strcmp(arg, "?"))
allow_unused = 1;
else {
av_log(NULL, AV_LOG_ERROR,
"Trailing garbage after stream specifier: %s\n", arg);
ret = AVERROR(EINVAL);
goto fail;
}
}
if (negative)
/* disable some already defined maps */
for (i = 0; i < o->nb_stream_maps; i++) {
m = &o->stream_maps[i];
if (file_idx == m->file_index &&
check_stream_specifier(input_files[m->file_index]->ctx,
stream_specifier_match(&ss,
input_files[m->file_index]->ctx,
input_files[m->file_index]->ctx->streams[m->stream_index],
*p == ':' ? p + 1 : p) > 0)
NULL))
m->disabled = 1;
}
else
for (i = 0; i < input_files[file_idx]->nb_streams; i++) {
if (check_stream_specifier(input_files[file_idx]->ctx, input_files[file_idx]->ctx->streams[i],
*p == ':' ? p + 1 : p) <= 0)
if (!stream_specifier_match(&ss,
input_files[file_idx]->ctx,
input_files[file_idx]->ctx->streams[i],
NULL))
continue;
if (input_files[file_idx]->streams[i]->user_set_discard == AVDISCARD_ALL) {
disabled = 1;
@@ -450,6 +570,7 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
m->file_index = file_idx;
m->stream_index = i;
m->vs = vs;
}
}
@@ -470,7 +591,7 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
}
ret = 0;
fail:
av_freep(&map);
stream_specifier_uninit(&ss);
return ret;
}
@@ -1271,12 +1392,10 @@ int ffmpeg_parse_options(int argc, char **argv, Scheduler *sch)
}
// bind unbound filtegraph inputs/outputs and check consistency
for (int i = 0; i < nb_filtergraphs; i++) {
ret = fg_finalise_bindings(filtergraphs[i]);
if (ret < 0) {
errmsg = "binding filtergraph inputs/outputs";
goto fail;
}
ret = fg_finalise_bindings();
if (ret < 0) {
errmsg = "binding filtergraph inputs/outputs";
goto fail;
}
correct_input_start_times();
@@ -1504,9 +1623,6 @@ const OptionDef options[] = {
{ "bitexact", OPT_TYPE_BOOL, OPT_EXPERT | OPT_OFFSET | OPT_OUTPUT | OPT_INPUT,
{ .off = OFFSET(bitexact) },
"bitexact mode" },
{ "apad", OPT_TYPE_STRING, OPT_PERSTREAM | OPT_EXPERT | OPT_OUTPUT,
{ .off = OFFSET(apad) },
"audio pad", "" },
{ "dts_delta_threshold", OPT_TYPE_FLOAT, OPT_EXPERT,
{ &dts_delta_threshold },
"timestamp discontinuity delta threshold", "threshold" },
@@ -1735,12 +1851,15 @@ const OptionDef options[] = {
{ "hwaccels", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT,
{ .func_arg = show_hwaccels },
"show available HW acceleration methods" },
{ "autorotate", OPT_TYPE_BOOL, OPT_PERSTREAM | OPT_EXPERT | OPT_INPUT,
{ "autorotate", OPT_TYPE_BOOL, OPT_VIDEO | OPT_PERSTREAM | OPT_EXPERT | OPT_INPUT,
{ .off = OFFSET(autorotate) },
"automatically insert correct rotate filters" },
{ "autoscale", OPT_TYPE_BOOL, OPT_PERSTREAM | OPT_EXPERT | OPT_OUTPUT,
{ "autoscale", OPT_TYPE_BOOL, OPT_VIDEO | OPT_PERSTREAM | OPT_EXPERT | OPT_OUTPUT,
{ .off = OFFSET(autoscale) },
"automatically insert a scale filter at the end of the filter graph" },
{ "apply_cropping", OPT_TYPE_STRING, OPT_VIDEO | OPT_PERSTREAM | OPT_EXPERT | OPT_INPUT,
{ .off = OFFSET(apply_cropping) },
"select the cropping to apply" },
{ "fix_sub_duration_heartbeat", OPT_TYPE_BOOL, OPT_VIDEO | OPT_EXPERT | OPT_PERSTREAM | OPT_OUTPUT,
{ .off = OFFSET(fix_sub_duration_heartbeat) },
"set this video output stream to be a heartbeat stream for "
@@ -1771,6 +1890,9 @@ const OptionDef options[] = {
{ "ab", OPT_TYPE_FUNC, OPT_AUDIO | OPT_FUNC_ARG | OPT_PERFILE | OPT_OUTPUT,
{ .func_arg = opt_bitrate },
"alias for -b:a (select bitrate for audio streams)", "bitrate" },
{ "apad", OPT_TYPE_STRING, OPT_AUDIO | OPT_PERSTREAM | OPT_EXPERT | OPT_OUTPUT,
{ .off = OFFSET(apad) },
"audio pad", "" },
{ "atag", OPT_TYPE_FUNC, OPT_AUDIO | OPT_FUNC_ARG | OPT_EXPERT | OPT_PERFILE | OPT_OUTPUT | OPT_HAS_CANON,
{ .func_arg = opt_old2new },
"force audio tag/fourcc", "fourcc/tag",
+242 -155
View File
@@ -71,13 +71,19 @@ typedef struct SchTask {
int thread_running;
} SchTask;
typedef struct SchDecOutput {
SchedulerNode *dst;
uint8_t *dst_finished;
unsigned nb_dst;
} SchDecOutput;
typedef struct SchDec {
const AVClass *class;
SchedulerNode src;
SchedulerNode *dst;
uint8_t *dst_finished;
unsigned nb_dst;
SchDecOutput *outputs;
unsigned nb_outputs;
SchTask task;
// Queue for receiving input packets, one stream.
@@ -260,6 +266,12 @@ typedef struct SchFilterGraph {
int task_exited;
} SchFilterGraph;
enum SchedulerState {
SCH_STATE_UNINIT,
SCH_STATE_STARTED,
SCH_STATE_STOPPED,
};
struct Scheduler {
const AVClass *class;
@@ -292,7 +304,7 @@ struct Scheduler {
char *sdp_filename;
int sdp_auto;
int transcode_started;
enum SchedulerState state;
atomic_int terminate;
atomic_int task_failed;
@@ -399,22 +411,6 @@ static int queue_alloc(ThreadQueue **ptq, unsigned nb_streams, unsigned queue_si
static void *task_wrapper(void *arg);
static int task_stop(SchTask *task)
{
int ret;
void *thread_ret;
if (!task->thread_running)
return 0;
ret = pthread_join(task->thread, &thread_ret);
av_assert0(ret == 0);
task->thread_running = 0;
return (intptr_t)thread_ret;
}
static int task_start(SchTask *task)
{
int ret;
@@ -468,59 +464,6 @@ static int64_t trailing_dts(const Scheduler *sch, int count_finished)
return min_dts == INT64_MAX ? AV_NOPTS_VALUE : min_dts;
}
int sch_stop(Scheduler *sch, int64_t *finish_ts)
{
int ret = 0, err;
atomic_store(&sch->terminate, 1);
for (unsigned type = 0; type < 2; type++)
for (unsigned i = 0; i < (type ? sch->nb_demux : sch->nb_filters); i++) {
SchWaiter *w = type ? &sch->demux[i].waiter : &sch->filters[i].waiter;
waiter_set(w, 1);
}
for (unsigned i = 0; i < sch->nb_demux; i++) {
SchDemux *d = &sch->demux[i];
err = task_stop(&d->task);
ret = err_merge(ret, err);
}
for (unsigned i = 0; i < sch->nb_dec; i++) {
SchDec *dec = &sch->dec[i];
err = task_stop(&dec->task);
ret = err_merge(ret, err);
}
for (unsigned i = 0; i < sch->nb_filters; i++) {
SchFilterGraph *fg = &sch->filters[i];
err = task_stop(&fg->task);
ret = err_merge(ret, err);
}
for (unsigned i = 0; i < sch->nb_enc; i++) {
SchEnc *enc = &sch->enc[i];
err = task_stop(&enc->task);
ret = err_merge(ret, err);
}
for (unsigned i = 0; i < sch->nb_mux; i++) {
SchMux *mux = &sch->mux[i];
err = task_stop(&mux->task);
ret = err_merge(ret, err);
}
if (finish_ts)
*finish_ts = trailing_dts(sch, 1);
return ret;
}
void sch_free(Scheduler **psch)
{
Scheduler *sch = *psch;
@@ -576,8 +519,14 @@ void sch_free(Scheduler **psch)
av_thread_message_queue_free(&dec->queue_end_ts);
av_freep(&dec->dst);
av_freep(&dec->dst_finished);
for (unsigned j = 0; j < dec->nb_outputs; j++) {
SchDecOutput *o = &dec->outputs[j];
av_freep(&o->dst);
av_freep(&o->dst_finished);
}
av_freep(&dec->outputs);
av_frame_free(&dec->send_frame);
}
@@ -775,14 +724,28 @@ int sch_add_demux_stream(Scheduler *sch, unsigned demux_idx)
return ret < 0 ? ret : d->nb_streams - 1;
}
int sch_add_dec_output(Scheduler *sch, unsigned dec_idx)
{
SchDec *dec;
int ret;
av_assert0(dec_idx < sch->nb_dec);
dec = &sch->dec[dec_idx];
ret = GROW_ARRAY(dec->outputs, dec->nb_outputs);
if (ret < 0)
return ret;
return dec->nb_outputs - 1;
}
static const AVClass sch_dec_class = {
.class_name = "SchDec",
.version = LIBAVUTIL_VERSION_INT,
.parent_log_context_offset = offsetof(SchDec, task.func_arg),
};
int sch_add_dec(Scheduler *sch, SchThreadFunc func, void *ctx,
int send_end_ts)
int sch_add_dec(Scheduler *sch, SchThreadFunc func, void *ctx, int send_end_ts)
{
const unsigned idx = sch->nb_dec;
@@ -802,6 +765,10 @@ int sch_add_dec(Scheduler *sch, SchThreadFunc func, void *ctx,
if (!dec->send_frame)
return AVERROR(ENOMEM);
ret = sch_add_dec_output(sch, idx);
if (ret < 0)
return ret;
ret = queue_alloc(&dec->queue, 1, 0, QUEUE_PACKETS);
if (ret < 0)
return ret;
@@ -1006,15 +973,19 @@ int sch_connect(Scheduler *sch, SchedulerNode src, SchedulerNode dst)
}
case SCH_NODE_TYPE_DEC: {
SchDec *dec;
SchDecOutput *o;
av_assert0(src.idx < sch->nb_dec);
dec = &sch->dec[src.idx];
ret = GROW_ARRAY(dec->dst, dec->nb_dst);
av_assert0(src.idx_stream < dec->nb_outputs);
o = &dec->outputs[src.idx_stream];
ret = GROW_ARRAY(o->dst, o->nb_dst);
if (ret < 0)
return ret;
dec->dst[dec->nb_dst - 1] = dst;
o->dst[o->nb_dst - 1] = dst;
// decoded frames go to filters or encoding
switch (dst.type) {
@@ -1046,20 +1017,40 @@ int sch_connect(Scheduler *sch, SchedulerNode src, SchedulerNode dst)
}
case SCH_NODE_TYPE_FILTER_OUT: {
SchFilterOut *fo;
SchEnc *enc;
av_assert0(src.idx < sch->nb_filters &&
src.idx_stream < sch->filters[src.idx].nb_outputs);
// filtered frames go to encoding
av_assert0(dst.type == SCH_NODE_TYPE_ENC &&
dst.idx < sch->nb_enc);
fo = &sch->filters[src.idx].outputs[src.idx_stream];
fo = &sch->filters[src.idx].outputs[src.idx_stream];
enc = &sch->enc[dst.idx];
av_assert0(!fo->dst.type);
fo->dst = dst;
// filtered frames go to encoding or another filtergraph
switch (dst.type) {
case SCH_NODE_TYPE_ENC: {
SchEnc *enc;
av_assert0(dst.idx < sch->nb_enc);
enc = &sch->enc[dst.idx];
av_assert0(!enc->src.type);
enc->src = src;
break;
}
case SCH_NODE_TYPE_FILTER_IN: {
SchFilterIn *fi;
av_assert0(dst.idx < sch->nb_filters &&
dst.idx_stream < sch->filters[dst.idx].nb_inputs);
fi = &sch->filters[dst.idx].inputs[dst.idx_stream];
av_assert0(!fi->src.type);
fi->src = src;
break;
}
default: av_assert0(0);
}
av_assert0(!fo->dst.type && !enc->src.type);
fo->dst = dst;
enc->src = src;
break;
}
@@ -1213,7 +1204,8 @@ int sch_mux_stream_ready(Scheduler *sch, unsigned mux_idx, unsigned stream_idx)
// this may be called during initialization - do not start
// threads before sch_start() is called
if (++mux->nb_streams_ready == mux->nb_streams && sch->transcode_started)
if (++mux->nb_streams_ready == mux->nb_streams &&
sch->state >= SCH_STATE_STARTED)
ret = mux_init(sch, mux);
pthread_mutex_unlock(&sch->mux_ready_lock);
@@ -1413,24 +1405,13 @@ static int check_acyclic(Scheduler *sch)
goto fail;
}
// trace the transcoding graph upstream from every output stream
// fed by a filtergraph
for (unsigned i = 0; i < sch->nb_mux; i++) {
SchMux *mux = &sch->mux[i];
for (unsigned j = 0; j < mux->nb_streams; j++) {
SchMuxStream *ms = &mux->streams[j];
SchedulerNode src = ms->src_sched;
if (src.type != SCH_NODE_TYPE_FILTER_OUT)
continue;
src.idx_stream = 0;
ret = check_acyclic_for_output(sch, src, filters_visited, filters_stack);
if (ret < 0) {
av_log(mux, AV_LOG_ERROR, "Transcoding graph has a cycle\n");
goto fail;
}
// trace the transcoding graph upstream from every filtegraph
for (unsigned i = 0; i < sch->nb_filters; i++) {
ret = check_acyclic_for_output(sch, (SchedulerNode){ .idx = i },
filters_visited, filters_stack);
if (ret < 0) {
av_log(&sch->filters[i], AV_LOG_ERROR, "Transcoding graph has a cycle\n");
goto fail;
}
}
@@ -1470,15 +1451,20 @@ static int start_prepare(Scheduler *sch)
"Decoder not connected to a source\n");
return AVERROR(EINVAL);
}
if (!dec->nb_dst) {
av_log(dec, AV_LOG_ERROR,
"Decoder not connected to any sink\n");
return AVERROR(EINVAL);
}
dec->dst_finished = av_calloc(dec->nb_dst, sizeof(*dec->dst_finished));
if (!dec->dst_finished)
return AVERROR(ENOMEM);
for (unsigned j = 0; j < dec->nb_outputs; j++) {
SchDecOutput *o = &dec->outputs[j];
if (!o->nb_dst) {
av_log(dec, AV_LOG_ERROR,
"Decoder output %u not connected to any sink\n", j);
return AVERROR(EINVAL);
}
o->dst_finished = av_calloc(o->nb_dst, sizeof(*o->dst_finished));
if (!o->dst_finished)
return AVERROR(ENOMEM);
}
}
for (unsigned i = 0; i < sch->nb_enc; i++) {
@@ -1546,13 +1532,18 @@ static int start_prepare(Scheduler *sch)
"Filtergraph input %u not connected to a source\n", j);
return AVERROR(EINVAL);
}
av_assert0(fi->src.type == SCH_NODE_TYPE_DEC);
dec = &sch->dec[fi->src.idx];
switch (dec->src.type) {
case SCH_NODE_TYPE_DEMUX: fi->src_sched = dec->src; break;
case SCH_NODE_TYPE_ENC: fi->src_sched = sch->enc[dec->src.idx].src; break;
default: av_assert0(0);
if (fi->src.type == SCH_NODE_TYPE_FILTER_OUT)
fi->src_sched = fi->src;
else {
av_assert0(fi->src.type == SCH_NODE_TYPE_DEC);
dec = &sch->dec[fi->src.idx];
switch (dec->src.type) {
case SCH_NODE_TYPE_DEMUX: fi->src_sched = dec->src; break;
case SCH_NODE_TYPE_ENC: fi->src_sched = sch->enc[dec->src.idx].src; break;
default: av_assert0(0);
}
}
}
@@ -1583,7 +1574,8 @@ int sch_start(Scheduler *sch)
if (ret < 0)
return ret;
sch->transcode_started = 1;
av_assert0(sch->state == SCH_STATE_UNINIT);
sch->state = SCH_STATE_STARTED;
for (unsigned i = 0; i < sch->nb_mux; i++) {
SchMux *mux = &sch->mux[i];
@@ -1591,7 +1583,7 @@ int sch_start(Scheduler *sch)
if (mux->nb_streams_ready == mux->nb_streams) {
ret = mux_init(sch, mux);
if (ret < 0)
return ret;
goto fail;
}
}
@@ -1600,7 +1592,7 @@ int sch_start(Scheduler *sch)
ret = task_start(&enc->task);
if (ret < 0)
return ret;
goto fail;
}
for (unsigned i = 0; i < sch->nb_filters; i++) {
@@ -1608,7 +1600,7 @@ int sch_start(Scheduler *sch)
ret = task_start(&fg->task);
if (ret < 0)
return ret;
goto fail;
}
for (unsigned i = 0; i < sch->nb_dec; i++) {
@@ -1616,7 +1608,7 @@ int sch_start(Scheduler *sch)
ret = task_start(&dec->task);
if (ret < 0)
return ret;
goto fail;
}
for (unsigned i = 0; i < sch->nb_demux; i++) {
@@ -1627,7 +1619,7 @@ int sch_start(Scheduler *sch)
ret = task_start(&d->task);
if (ret < 0)
return ret;
goto fail;
}
pthread_mutex_lock(&sch->schedule_lock);
@@ -1635,6 +1627,9 @@ int sch_start(Scheduler *sch)
pthread_mutex_unlock(&sch->schedule_lock);
return 0;
fail:
sch_stop(sch, NULL);
return ret;
}
int sch_wait(Scheduler *sch, uint64_t timeout_us, int64_t *transcode_ts)
@@ -2215,21 +2210,26 @@ finish:
return AVERROR_EOF;
}
int sch_dec_send(Scheduler *sch, unsigned dec_idx, AVFrame *frame)
int sch_dec_send(Scheduler *sch, unsigned dec_idx,
unsigned out_idx, AVFrame *frame)
{
SchDec *dec;
int ret = 0;
SchDecOutput *o;
int ret;
unsigned nb_done = 0;
av_assert0(dec_idx < sch->nb_dec);
dec = &sch->dec[dec_idx];
for (unsigned i = 0; i < dec->nb_dst; i++) {
uint8_t *finished = &dec->dst_finished[i];
av_assert0(out_idx < dec->nb_outputs);
o = &dec->outputs[out_idx];
for (unsigned i = 0; i < o->nb_dst; i++) {
uint8_t *finished = &o->dst_finished[i];
AVFrame *to_send = frame;
// sending a frame consumes it, so make a temporary reference if needed
if (i < dec->nb_dst - 1) {
if (i < o->nb_dst - 1) {
to_send = dec->send_frame;
// frame may sometimes contain props only,
@@ -2240,19 +2240,18 @@ int sch_dec_send(Scheduler *sch, unsigned dec_idx, AVFrame *frame)
return ret;
}
ret = dec_send_to_dst(sch, dec->dst[i], finished, to_send);
ret = dec_send_to_dst(sch, o->dst[i], finished, to_send);
if (ret < 0) {
av_frame_unref(to_send);
if (ret == AVERROR_EOF) {
nb_done++;
ret = 0;
continue;
}
return ret;
}
}
return (nb_done == dec->nb_dst) ? AVERROR_EOF : 0;
return (nb_done == o->nb_dst) ? AVERROR_EOF : 0;
}
static int dec_done(Scheduler *sch, unsigned dec_idx)
@@ -2267,10 +2266,14 @@ static int dec_done(Scheduler *sch, unsigned dec_idx)
if (dec->queue_end_ts)
av_thread_message_queue_set_err_recv(dec->queue_end_ts, AVERROR_EOF);
for (unsigned i = 0; i < dec->nb_dst; i++) {
int err = dec_send_to_dst(sch, dec->dst[i], &dec->dst_finished[i], NULL);
if (err < 0 && err != AVERROR_EOF)
ret = err_merge(ret, err);
for (unsigned i = 0; i < dec->nb_outputs; i++) {
SchDecOutput *o = &dec->outputs[i];
for (unsigned j = 0; j < o->nb_dst; j++) {
int err = dec_send_to_dst(sch, o->dst[j], &o->dst_finished[j], NULL);
if (err < 0 && err != AVERROR_EOF)
ret = err_merge(ret, err);
}
}
return ret;
@@ -2344,15 +2347,13 @@ int sch_enc_send(Scheduler *sch, unsigned enc_idx, AVPacket *pkt)
ret = enc_send_to_dst(sch, enc->dst[i], finished, to_send);
if (ret < 0) {
av_packet_unref(to_send);
if (ret == AVERROR_EOF) {
ret = 0;
if (ret == AVERROR_EOF)
continue;
}
return ret;
}
}
return ret;
return 0;
}
static int enc_done(Scheduler *sch, unsigned enc_idx)
@@ -2439,12 +2440,17 @@ void sch_filter_receive_finish(Scheduler *sch, unsigned fg_idx, unsigned in_idx)
int sch_filter_send(Scheduler *sch, unsigned fg_idx, unsigned out_idx, AVFrame *frame)
{
SchFilterGraph *fg;
SchedulerNode dst;
av_assert0(fg_idx < sch->nb_filters);
fg = &sch->filters[fg_idx];
av_assert0(out_idx < fg->nb_outputs);
return send_to_enc(sch, &sch->enc[fg->outputs[out_idx].dst.idx], frame);
dst = fg->outputs[out_idx].dst;
return (dst.type == SCH_NODE_TYPE_ENC) ?
send_to_enc (sch, &sch->enc[dst.idx], frame) :
send_to_filter(sch, &sch->filters[dst.idx], dst.idx_stream, frame);
}
static int filter_done(Scheduler *sch, unsigned fg_idx)
@@ -2456,8 +2462,11 @@ static int filter_done(Scheduler *sch, unsigned fg_idx)
tq_receive_finish(fg->queue, i);
for (unsigned i = 0; i < fg->nb_outputs; i++) {
SchEnc *enc = &sch->enc[fg->outputs[i].dst.idx];
int err = send_to_enc(sch, enc, NULL);
SchedulerNode dst = fg->outputs[i].dst;
int err = (dst.type == SCH_NODE_TYPE_ENC) ?
send_to_enc (sch, &sch->enc[dst.idx], NULL) :
send_to_filter(sch, &sch->filters[dst.idx], dst.idx_stream, NULL);
if (err < 0 && err != AVERROR_EOF)
ret = err_merge(ret, err);
}
@@ -2483,6 +2492,18 @@ int sch_filter_command(Scheduler *sch, unsigned fg_idx, AVFrame *frame)
return send_to_filter(sch, fg, fg->nb_inputs, frame);
}
static int task_cleanup(Scheduler *sch, SchedulerNode node)
{
switch (node.type) {
case SCH_NODE_TYPE_DEMUX: return demux_done (sch, node.idx);
case SCH_NODE_TYPE_MUX: return mux_done (sch, node.idx);
case SCH_NODE_TYPE_DEC: return dec_done (sch, node.idx);
case SCH_NODE_TYPE_ENC: return enc_done (sch, node.idx);
case SCH_NODE_TYPE_FILTER_IN: return filter_done(sch, node.idx);
default: av_assert0(0);
}
}
static void *task_wrapper(void *arg)
{
SchTask *task = arg;
@@ -2495,15 +2516,7 @@ static void *task_wrapper(void *arg)
av_log(task->func_arg, AV_LOG_ERROR,
"Task finished with error code: %d (%s)\n", ret, av_err2str(ret));
switch (task->node.type) {
case SCH_NODE_TYPE_DEMUX: err = demux_done (sch, task->node.idx); break;
case SCH_NODE_TYPE_MUX: err = mux_done (sch, task->node.idx); break;
case SCH_NODE_TYPE_DEC: err = dec_done (sch, task->node.idx); break;
case SCH_NODE_TYPE_ENC: err = enc_done (sch, task->node.idx); break;
case SCH_NODE_TYPE_FILTER_IN: err = filter_done(sch, task->node.idx); break;
default: av_assert0(0);
}
err = task_cleanup(sch, task->node);
ret = err_merge(ret, err);
// EOF is considered normal termination
@@ -2518,3 +2531,77 @@ static void *task_wrapper(void *arg)
return (void*)(intptr_t)ret;
}
static int task_stop(Scheduler *sch, SchTask *task)
{
int ret;
void *thread_ret;
if (!task->thread_running)
return task_cleanup(sch, task->node);
ret = pthread_join(task->thread, &thread_ret);
av_assert0(ret == 0);
task->thread_running = 0;
return (intptr_t)thread_ret;
}
int sch_stop(Scheduler *sch, int64_t *finish_ts)
{
int ret = 0, err;
if (sch->state != SCH_STATE_STARTED)
return 0;
atomic_store(&sch->terminate, 1);
for (unsigned type = 0; type < 2; type++)
for (unsigned i = 0; i < (type ? sch->nb_demux : sch->nb_filters); i++) {
SchWaiter *w = type ? &sch->demux[i].waiter : &sch->filters[i].waiter;
waiter_set(w, 1);
}
for (unsigned i = 0; i < sch->nb_demux; i++) {
SchDemux *d = &sch->demux[i];
err = task_stop(sch, &d->task);
ret = err_merge(ret, err);
}
for (unsigned i = 0; i < sch->nb_dec; i++) {
SchDec *dec = &sch->dec[i];
err = task_stop(sch, &dec->task);
ret = err_merge(ret, err);
}
for (unsigned i = 0; i < sch->nb_filters; i++) {
SchFilterGraph *fg = &sch->filters[i];
err = task_stop(sch, &fg->task);
ret = err_merge(ret, err);
}
for (unsigned i = 0; i < sch->nb_enc; i++) {
SchEnc *enc = &sch->enc[i];
err = task_stop(sch, &enc->task);
ret = err_merge(ret, err);
}
for (unsigned i = 0; i < sch->nb_mux; i++) {
SchMux *mux = &sch->mux[i];
err = task_stop(sch, &mux->task);
ret = err_merge(ret, err);
}
if (finish_ts)
*finish_ts = trailing_dts(sch, 1);
sch->state = SCH_STATE_STOPPED;
return ret;
}
+21 -6
View File
@@ -41,7 +41,8 @@
* - filtergraphs, each containing zero or more inputs (0 in case the
* filtergraph contains a lavfi source filter), and one or more outputs; the
* inputs and outputs need not have matching media types;
* each filtergraph input receives decoded frames from some decoder;
* each filtergraph input receives decoded frames from some decoder or another
* filtergraph output;
* filtered frames from each output are sent to some encoder;
* - encoders, which receive decoded frames from some decoder (subtitles) or
* some filtergraph output (audio/video), encode them, and send encoded
@@ -51,6 +52,9 @@
* encoder (transcoding); those packets are interleaved and written out by the
* muxer.
*
* The structure formed by the above components is a directed acyclic graph
* (absence of cycles is checked at startup).
*
* There must be at least one muxer instance, otherwise the transcode produces
* no output and is meaningless. Otherwise, in a generic transcoding scenario
* there may be arbitrary number of instances of any of the above components,
@@ -110,9 +114,12 @@ typedef int (*SchThreadFunc)(void *arg);
#define SCH_MSTREAM(file, stream) \
(SchedulerNode){ .type = SCH_NODE_TYPE_MUX, \
.idx = file, .idx_stream = stream }
#define SCH_DEC(decoder) \
#define SCH_DEC_IN(decoder) \
(SchedulerNode){ .type = SCH_NODE_TYPE_DEC, \
.idx = decoder }
.idx = decoder }
#define SCH_DEC_OUT(decoder, out_idx) \
(SchedulerNode){ .type = SCH_NODE_TYPE_DEC, \
.idx = decoder, .idx_stream = out_idx }
#define SCH_ENC(encoder) \
(SchedulerNode){ .type = SCH_NODE_TYPE_ENC, \
.idx = encoder }
@@ -174,8 +181,15 @@ int sch_add_demux_stream(Scheduler *sch, unsigned demux_idx);
* @retval ">=0" Index of the newly-created decoder.
* @retval "<0" Error code.
*/
int sch_add_dec(Scheduler *sch, SchThreadFunc func, void *ctx,
int send_end_ts);
int sch_add_dec(Scheduler *sch, SchThreadFunc func, void *ctx, int send_end_ts);
/**
* Add another output to decoder (e.g. for multiview video).
*
* @retval ">=0" Index of the newly-added decoder output.
* @retval "<0" Error code.
*/
int sch_add_dec_output(Scheduler *sch, unsigned dec_idx);
/**
* Add a filtergraph to the scheduler.
@@ -375,7 +389,8 @@ int sch_dec_receive(Scheduler *sch, unsigned dec_idx, struct AVPacket *pkt);
* @retval AVERROR_EOF all consumers are done, should terminate decoding
* @retval "another negative error code" other failure
*/
int sch_dec_send(Scheduler *sch, unsigned dec_idx, struct AVFrame *frame);
int sch_dec_send(Scheduler *sch, unsigned dec_idx,
unsigned out_idx, struct AVFrame *frame);
/**
* Called by filtergraph tasks to obtain frames for filtering. Will wait for a
+3 -2
View File
@@ -35,11 +35,12 @@ typedef struct Timestamp {
/**
* Merge two return codes - return one of the error codes if at least one of
* them was negative, 0 otherwise.
* Currently just picks the first one, eventually we might want to do something
* more sophisticated, like sorting them by priority.
*/
static inline int err_merge(int err0, int err1)
{
// prefer "real" errors over EOF
if ((err0 >= 0 || err0 == AVERROR_EOF) && err1 < 0)
return err1;
return (err0 < 0) ? err0 : FFMIN(err1, 0);
}
+26 -22
View File
@@ -25,7 +25,6 @@
#include "config.h"
#include "config_components.h"
#include <inttypes.h>
#include <math.h>
#include <limits.h>
#include <signal.h>
@@ -33,13 +32,11 @@
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/eval.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/dict.h"
#include "libavutil/fifo.h"
#include "libavutil/parseutils.h"
#include "libavutil/samplefmt.h"
#include "libavutil/time.h"
#include "libavutil/bprint.h"
@@ -1966,16 +1963,21 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
theta = get_rotation(displaymatrix);
if (fabs(theta - 90) < 1.0) {
INSERT_FILT("transpose", "clock");
INSERT_FILT("transpose", displaymatrix[3] > 0 ? "cclock_flip" : "clock");
} else if (fabs(theta - 180) < 1.0) {
INSERT_FILT("hflip", NULL);
INSERT_FILT("vflip", NULL);
if (displaymatrix[0] < 0)
INSERT_FILT("hflip", NULL);
if (displaymatrix[4] < 0)
INSERT_FILT("vflip", NULL);
} else if (fabs(theta - 270) < 1.0) {
INSERT_FILT("transpose", "cclock");
INSERT_FILT("transpose", displaymatrix[3] < 0 ? "clock_flip" : "cclock");
} else if (fabs(theta) > 1.0) {
char rotate_buf[64];
snprintf(rotate_buf, sizeof(rotate_buf), "%f*PI/180", theta);
INSERT_FILT("rotate", rotate_buf);
} else {
if (displaymatrix && displaymatrix[4] < 0)
INSERT_FILT("vflip", NULL);
}
}
@@ -2394,12 +2396,13 @@ static int audio_decode_frame(VideoState *is)
av_channel_layout_compare(&af->frame->ch_layout, &is->audio_src.ch_layout) ||
af->frame->sample_rate != is->audio_src.freq ||
(wanted_nb_samples != af->frame->nb_samples && !is->swr_ctx)) {
int ret;
swr_free(&is->swr_ctx);
swr_alloc_set_opts2(&is->swr_ctx,
ret = swr_alloc_set_opts2(&is->swr_ctx,
&is->audio_tgt.ch_layout, is->audio_tgt.fmt, is->audio_tgt.freq,
&af->frame->ch_layout, af->frame->format, af->frame->sample_rate,
0, NULL);
if (!is->swr_ctx || swr_init(is->swr_ctx) < 0) {
if (ret < 0 || swr_init(is->swr_ctx) < 0) {
av_log(NULL, AV_LOG_ERROR,
"Cannot create sample rate converter for conversion of %d Hz %s %d channels to %d Hz %s %d channels!\n",
af->frame->sample_rate, av_get_sample_fmt_name(af->frame->format), af->frame->ch_layout.nb_channels,
@@ -2628,7 +2631,6 @@ static int stream_component_open(VideoState *is, int stream_index)
const AVCodec *codec;
const char *forced_codec_name = NULL;
AVDictionary *opts = NULL;
const AVDictionaryEntry *t = NULL;
int sample_rate;
AVChannelLayout ch_layout = { 0 };
int ret = 0;
@@ -2676,7 +2678,7 @@ static int stream_component_open(VideoState *is, int stream_index)
avctx->flags2 |= AV_CODEC_FLAG2_FAST;
ret = filter_codec_opts(codec_opts, avctx->codec_id, ic,
ic->streams[stream_index], codec, &opts);
ic->streams[stream_index], codec, &opts, NULL);
if (ret < 0)
goto fail;
@@ -2696,11 +2698,9 @@ static int stream_component_open(VideoState *is, int stream_index)
if ((ret = avcodec_open2(avctx, codec, &opts)) < 0) {
goto fail;
}
if ((t = av_dict_get(opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
ret = AVERROR_OPTION_NOT_FOUND;
ret = check_avoptions(opts);
if (ret < 0)
goto fail;
}
is->eof = 0;
ic->streams[stream_index]->discard = AVDISCARD_DEFAULT;
@@ -2863,12 +2863,11 @@ static int read_thread(void *arg)
}
if (scan_all_pmts_set)
av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
remove_avoptions(&format_opts, codec_opts);
if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
ret = AVERROR_OPTION_NOT_FOUND;
ret = check_avoptions(format_opts);
if (ret < 0)
goto fail;
}
is->ic = ic;
if (genpts)
@@ -3842,8 +3841,13 @@ int main(int argc, char **argv)
if (vk_renderer) {
AVDictionary *dict = NULL;
if (vulkan_params)
av_dict_parse_string(&dict, vulkan_params, "=", ":", 0);
if (vulkan_params) {
int ret = av_dict_parse_string(&dict, vulkan_params, "=", ":", 0);
if (ret < 0) {
av_log(NULL, AV_LOG_FATAL, "Failed to parse, %s\n", vulkan_params);
do_exit(NULL);
}
}
ret = vk_renderer_create(vk_renderer, window, dict);
av_dict_free(&dict);
if (ret < 0) {
+2 -1
View File
@@ -42,6 +42,7 @@
#include <SDL_vulkan.h>
#include "libavutil/bprint.h"
#include "libavutil/mem.h"
#endif
@@ -765,7 +766,7 @@ static void destroy(VkRenderer *renderer)
vkDestroySurfaceKHR = (PFN_vkDestroySurfaceKHR)
ctx->get_proc_addr(ctx->inst, "vkDestroySurfaceKHR");
vkDestroySurfaceKHR(ctx->inst, ctx->vk_surface, NULL);
ctx->vk_surface = NULL;
ctx->vk_surface = VK_NULL_HANDLE;
}
av_buffer_unref(&ctx->hw_device_ref);
+26 -4
View File
@@ -46,6 +46,7 @@
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/hdr_dynamic_vivid_metadata.h"
#include "libavutil/dovi_meta.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/spherical.h"
@@ -2543,6 +2544,11 @@ static void print_pkt_side_data(WriterContext *w,
const AVStereo3D *stereo = (AVStereo3D *)sd->data;
print_str("type", av_stereo3d_type_name(stereo->type));
print_int("inverted", !!(stereo->flags & AV_STEREO3D_FLAG_INVERT));
print_str("view", av_stereo3d_view_name(stereo->view));
print_str("primary_eye", av_stereo3d_primary_eye_name(stereo->primary_eye));
print_int("baseline", stereo->baseline);
print_q("horizontal_disparity_adjustment", stereo->horizontal_disparity_adjustment, '/');
print_q("horizontal_field_of_view", stereo->horizontal_field_of_view, '/');
} else if (sd->type == AV_PKT_DATA_SPHERICAL) {
const AVSphericalMapping *spherical = (AVSphericalMapping *)sd->data;
print_str("projection", av_spherical_projection_name(spherical->projection));
@@ -2597,6 +2603,7 @@ static void print_pkt_side_data(WriterContext *w,
print_dynamic_hdr10_plus(w, metadata);
} else if (sd->type == AV_PKT_DATA_DOVI_CONF) {
AVDOVIDecoderConfigurationRecord *dovi = (AVDOVIDecoderConfigurationRecord *)sd->data;
const char *comp = "unknown";
print_int("dv_version_major", dovi->dv_version_major);
print_int("dv_version_minor", dovi->dv_version_minor);
print_int("dv_profile", dovi->dv_profile);
@@ -2605,6 +2612,14 @@ static void print_pkt_side_data(WriterContext *w,
print_int("el_present_flag", dovi->el_present_flag);
print_int("bl_present_flag", dovi->bl_present_flag);
print_int("dv_bl_signal_compatibility_id", dovi->dv_bl_signal_compatibility_id);
switch (dovi->dv_md_compression)
{
case AV_DOVI_COMPRESSION_NONE: comp = "none"; break;
case AV_DOVI_COMPRESSION_LIMITED: comp = "limited"; break;
case AV_DOVI_COMPRESSION_RESERVED: comp = "reserved"; break;
case AV_DOVI_COMPRESSION_EXTENDED: comp = "extended"; break;
}
print_str("dv_md_compression", comp);
} else if (sd->type == AV_PKT_DATA_AUDIO_SERVICE_TYPE) {
enum AVAudioServiceType *t = (enum AVAudioServiceType *)sd->data;
print_int("service_type", *t);
@@ -2622,6 +2637,11 @@ static void print_pkt_side_data(WriterContext *w,
if (do_show_data)
writer_print_data(w, "data", sd->data, sd->size);
writer_print_data_hash(w, "data_hash", sd->data, sd->size);
} else if (sd->type == AV_PKT_DATA_FRAME_CROPPING && sd->size >= sizeof(uint32_t) * 4) {
print_int("crop_top", AV_RL32(sd->data));
print_int("crop_bottom", AV_RL32(sd->data + 4));
print_int("crop_left", AV_RL32(sd->data + 8));
print_int("crop_right", AV_RL32(sd->data + 12));
} else if (sd->type == AV_PKT_DATA_AFD && sd->size > 0) {
print_int("active_format", *sd->data);
}
@@ -2900,6 +2920,8 @@ static void print_frame_side_data(WriterContext *w,
} else if (sd->type == AV_FRAME_DATA_FILM_GRAIN_PARAMS) {
AVFilmGrainParams *fgp = (AVFilmGrainParams *)sd->data;
print_film_grain_params(w, fgp);
} else if (sd->type == AV_FRAME_DATA_VIEW_ID) {
print_int("view_id", *(int*)sd->data);
}
writer_print_section_footer(w);
}
@@ -3323,8 +3345,8 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
if (sar.num) {
print_q("sample_aspect_ratio", sar, ':');
av_reduce(&dar.num, &dar.den,
par->width * sar.num,
par->height * sar.den,
(int64_t) par->width * sar.num,
(int64_t) par->height * sar.den,
1024*1024);
print_q("display_aspect_ratio", dar, ':');
} else {
@@ -3921,7 +3943,7 @@ static int open_input_file(InputFile *ifile, const char *filename,
AVDictionary *opts;
err = filter_codec_opts(codec_opts, stream->codecpar->codec_id,
fmt_ctx, stream, codec, &opts);
fmt_ctx, stream, codec, &opts, NULL);
if (err < 0)
exit(1);
@@ -3950,7 +3972,7 @@ static int open_input_file(InputFile *ifile, const char *filename,
exit(1);
}
if ((t = av_dict_get(opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
if ((t = av_dict_iterate(opts, NULL))) {
av_log(NULL, AV_LOG_ERROR, "Option %s for input stream %d not found\n",
t->key, stream->index);
return AVERROR_OPTION_NOT_FOUND;
+1
View File
@@ -27,6 +27,7 @@
* CRT, and FILE* handles can't be shared across them.) */
#ifdef _WIN32
#include "libavutil/mem.h"
#include "libavutil/wchar_filename.h"
static inline FILE *fopen_utf8(const char *path_utf8, const char *mode)
+56 -48
View File
@@ -262,22 +262,36 @@ int show_buildconf(void *optctx, const char *opt, const char *arg)
return 0;
}
#define PRINT_CODEC_SUPPORTED(codec, field, type, list_name, term, get_name) \
if (codec->field) { \
const type *p = codec->field; \
\
printf(" Supported " list_name ":"); \
while (*p != term) { \
get_name(*p); \
printf(" %s", name); \
p++; \
} \
printf("\n"); \
} \
#define PRINT_CODEC_SUPPORTED(codec, config, type, name, elem, fmt, ...) \
do { \
int num = 0; \
const type *elem = NULL; \
avcodec_get_supported_config(NULL, codec, config, 0, \
(const void **) &elem, &num); \
if (elem) { \
printf(" Supported " name ":"); \
for (int i = 0; i < num; i++) { \
printf(" " fmt, __VA_ARGS__); \
elem++; \
} \
printf("\n"); \
} \
} while (0)
static const char *get_channel_layout_desc(const AVChannelLayout *layout, AVBPrint *bp)
{
int ret;
av_bprint_clear(bp);
ret = av_channel_layout_describe_bprint(layout, bp);
if (!av_bprint_is_complete(bp) || ret < 0)
return "unknown/invalid";
return bp->str;
}
static void print_codec(const AVCodec *c)
{
int encoder = av_codec_is_encoder(c);
AVBPrint desc;
printf("%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name,
c->long_name ? c->long_name : "");
@@ -343,35 +357,20 @@ static void print_codec(const AVCodec *c)
printf("\n");
}
if (c->supported_framerates) {
const AVRational *fps = c->supported_framerates;
PRINT_CODEC_SUPPORTED(c, AV_CODEC_CONFIG_FRAME_RATE, AVRational, "framerates",
fps, "%d/%d", fps->num, fps->den);
PRINT_CODEC_SUPPORTED(c, AV_CODEC_CONFIG_PIX_FORMAT, enum AVPixelFormat,
"pixel formats", fmt, "%s", av_get_pix_fmt_name(*fmt));
PRINT_CODEC_SUPPORTED(c, AV_CODEC_CONFIG_SAMPLE_RATE, int, "sample rates",
rate, "%d", *rate);
PRINT_CODEC_SUPPORTED(c, AV_CODEC_CONFIG_SAMPLE_FORMAT, enum AVSampleFormat,
"sample formats", fmt, "%s", av_get_sample_fmt_name(*fmt));
printf(" Supported framerates:");
while (fps->num) {
printf(" %d/%d", fps->num, fps->den);
fps++;
}
printf("\n");
}
PRINT_CODEC_SUPPORTED(c, pix_fmts, enum AVPixelFormat, "pixel formats",
AV_PIX_FMT_NONE, GET_PIX_FMT_NAME);
PRINT_CODEC_SUPPORTED(c, supported_samplerates, int, "sample rates", 0,
GET_SAMPLE_RATE_NAME);
PRINT_CODEC_SUPPORTED(c, sample_fmts, enum AVSampleFormat, "sample formats",
AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME);
if (c->ch_layouts) {
const AVChannelLayout *p = c->ch_layouts;
printf(" Supported channel layouts:");
while (p->nb_channels) {
char name[128];
av_channel_layout_describe(p, name, sizeof(name));
printf(" %s", name);
p++;
}
printf("\n");
}
av_bprint_init(&desc, 0, AV_BPRINT_SIZE_AUTOMATIC);
PRINT_CODEC_SUPPORTED(c, AV_CODEC_CONFIG_CHANNEL_LAYOUT, AVChannelLayout,
"channel layouts", layout, "%s",
get_channel_layout_desc(layout, &desc));
av_bprint_finalize(&desc, NULL);
if (c->priv_class) {
show_help_children(c->priv_class,
@@ -566,8 +565,15 @@ static void show_help_bsf(const char *name)
}
printf("Bit stream filter %s\n", bsf->name);
PRINT_CODEC_SUPPORTED(bsf, codec_ids, enum AVCodecID, "codecs",
AV_CODEC_ID_NONE, GET_CODEC_NAME);
if (bsf->codec_ids) {
const enum AVCodecID *id = bsf->codec_ids;
printf(" Supported codecs:");
while (*id != AV_CODEC_ID_NONE) {
printf(" %s", avcodec_descriptor_get(*id)->name);
id++;
}
printf("\n");
}
if (bsf->priv_class)
show_help_children(bsf->priv_class, AV_OPT_FLAG_BSF_PARAM);
}
@@ -724,10 +730,13 @@ int show_codecs(void *optctx, const char *opt, const char *arg)
return 0;
}
static void print_codecs(int encoder)
static int print_codecs(int encoder)
{
const AVCodecDescriptor **codecs;
unsigned i, nb_codecs = get_codecs_sorted(&codecs);
int i, nb_codecs = get_codecs_sorted(&codecs);
if (nb_codecs < 0)
return nb_codecs;
printf("%s:\n"
" V..... = Video\n"
@@ -762,18 +771,17 @@ static void print_codecs(int encoder)
}
}
av_free(codecs);
return 0;
}
int show_decoders(void *optctx, const char *opt, const char *arg)
{
print_codecs(0);
return 0;
return print_codecs(0);
}
int show_encoders(void *optctx, const char *opt, const char *arg)
{
print_codecs(1);
return 0;
return print_codecs(1);
}
int show_bsfs(void *optctx, const char *opt, const char *arg)
-3
View File
@@ -64,9 +64,6 @@ static int zero12v_decode_frame(AVCodecContext *avctx, AVFrame *pic,
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
return ret;
pic->pict_type = AV_PICTURE_TYPE_I;
pic->flags |= AV_FRAME_FLAG_KEY;
line_end = avpkt->data + stride;
for (line = 0; line < avctx->height; line++) {
uint16_t y_temp[6] = {0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000};
+1
View File
@@ -30,6 +30,7 @@
#include "libavutil/frame.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "avcodec.h"
+1
View File
@@ -40,6 +40,7 @@
#include "config_components.h"
#include "libavutil/avassert.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
+45 -35
View File
@@ -32,7 +32,7 @@ OBJS = ac3_parser.o \
avcodec.o \
avdct.o \
avfft.o \
avpacket.o \
packet.o \
bitstream.o \
bitstream_filters.o \
bsf.o \
@@ -46,6 +46,7 @@ OBJS = ac3_parser.o \
get_buffer.o \
imgconvert.o \
jni.o \
lcevcdec.o \
mathtables.o \
mediacodec.o \
mpeg12framerate.o \
@@ -56,6 +57,7 @@ OBJS = ac3_parser.o \
qsv_api.o \
raw.o \
refstruct.o \
threadprogress.o \
utils.o \
version.o \
vlc.o \
@@ -63,6 +65,9 @@ OBJS = ac3_parser.o \
xiph.o \
# subsystems
include $(SRC_PATH)/libavcodec/aac/Makefile
include $(SRC_PATH)/libavcodec/hevc/Makefile
include $(SRC_PATH)/libavcodec/opus/Makefile
include $(SRC_PATH)/libavcodec/vvc/Makefile
-include $(SRC_PATH)/libavcodec/$(ARCH)/vvc/Makefile
OBJS-$(CONFIG_AANDCTTABLES) += aandcttab.o
@@ -84,8 +89,10 @@ OBJS-$(CONFIG_CBS_JPEG) += cbs_jpeg.o
OBJS-$(CONFIG_CBS_MPEG2) += cbs_mpeg2.o
OBJS-$(CONFIG_CBS_VP8) += cbs_vp8.o vp8data.o
OBJS-$(CONFIG_CBS_VP9) += cbs_vp9.o
OBJS-$(CONFIG_D3D12VA_ENCODE) += d3d12va_encode.o hw_base_encode.o
OBJS-$(CONFIG_DEFLATE_WRAPPER) += zlib_wrapper.o
OBJS-$(CONFIG_DOVI_RPU) += dovi_rpu.o
OBJS-$(CONFIG_DOVI_RPUDEC) += dovi_rpu.o dovi_rpudec.o
OBJS-$(CONFIG_DOVI_RPUENC) += dovi_rpu.o dovi_rpuenc.o
OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o
OBJS-$(CONFIG_EVCPARSE) += evc_parse.o evc_ps.o
OBJS-$(CONFIG_EXIF) += exif.o tiff_common.o
@@ -97,15 +104,14 @@ OBJS-$(CONFIG_GOLOMB) += golomb.o
OBJS-$(CONFIG_H263DSP) += h263dsp.o
OBJS-$(CONFIG_H264CHROMA) += h264chroma.o
OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o
OBJS-$(CONFIG_H264PARSE) += h264_parse.o h264_ps.o h2645data.o \
h2645_parse.o h2645_vui.o
OBJS-$(CONFIG_H264PARSE) += h264_parse.o h264_ps.o h264data.o \
h2645data.o h2645_parse.o h2645_vui.o
OBJS-$(CONFIG_H264PRED) += h264pred.o
OBJS-$(CONFIG_H264QPEL) += h264qpel.o
OBJS-$(CONFIG_H264_SEI) += h264_sei.o h2645_sei.o
OBJS-$(CONFIG_HEVCPARSE) += hevc_parse.o hevc_ps.o hevc_data.o \
h2645data.o h2645_parse.o h2645_vui.o
OBJS-$(CONFIG_HEVC_SEI) += hevc_sei.o h2645_sei.o \
dynamic_hdr_vivid.o aom_film_grain.o
OBJS-$(CONFIG_HEVCPARSE) += h2645data.o h2645_parse.o h2645_vui.o
OBJS-$(CONFIG_HEVC_SEI) += h2645_sei.o aom_film_grain.o \
dynamic_hdr_vivid.o
OBJS-$(CONFIG_HPELDSP) += hpeldsp.o
OBJS-$(CONFIG_HUFFMAN) += huffman.o
OBJS-$(CONFIG_HUFFYUVDSP) += huffyuvdsp.o
@@ -113,7 +119,7 @@ OBJS-$(CONFIG_HUFFYUVENCDSP) += huffyuvencdsp.o
OBJS-$(CONFIG_IDCTDSP) += idctdsp.o simple_idct.o jrevdct.o
OBJS-$(CONFIG_IIRFILTER) += iirfilter.o
OBJS-$(CONFIG_INFLATE_WRAPPER) += zlib_wrapper.o
OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o msmpeg4data.o
OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o msmpeg4_vc1_data.o
OBJS-$(CONFIG_IVIDSP) += ivi_dsp.o
OBJS-$(CONFIG_JNI) += ffjni.o jni.o
OBJS-$(CONFIG_JPEGTABLES) += jpegtables.o
@@ -162,7 +168,7 @@ OBJS-$(CONFIG_STARTCODE) += startcode.o
OBJS-$(CONFIG_TEXTUREDSP) += texturedsp.o
OBJS-$(CONFIG_TEXTUREDSPENC) += texturedspenc.o
OBJS-$(CONFIG_TPELDSP) += tpeldsp.o
OBJS-$(CONFIG_VAAPI_ENCODE) += vaapi_encode.o
OBJS-$(CONFIG_VAAPI_ENCODE) += vaapi_encode.o hw_base_encode.o
OBJS-$(CONFIG_AV1_AMF_ENCODER) += amfenc_av1.o
OBJS-$(CONFIG_VC1DSP) += vc1dsp.o
OBJS-$(CONFIG_VIDEODSP) += videodsp.o
@@ -177,11 +183,11 @@ OBJS-$(CONFIG_WMV2DSP) += wmv2dsp.o
OBJS-$(CONFIG_ZERO12V_DECODER) += 012v.o
OBJS-$(CONFIG_A64MULTI_ENCODER) += a64multienc.o elbg.o
OBJS-$(CONFIG_A64MULTI5_ENCODER) += a64multienc.o elbg.o
OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aacdec_common.o aactab.o \
OBJS-$(CONFIG_AAC_DECODER) += aactab.o \
aacsbr.o aacps_common.o aacps_float.o \
kbdwin.o \
sbrdsp.o aacpsdsp_float.o cbrt_data.o
OBJS-$(CONFIG_AAC_FIXED_DECODER) += aacdec_fixed.o aacdec_common.o aactab.o \
OBJS-$(CONFIG_AAC_FIXED_DECODER) += aactab.o \
aacsbr_fixed.o aacps_common.o aacps_fixed.o \
kbdwin.o \
sbrdsp_fixed.o aacpsdsp_fixed.o cbrt_data_fixed.o
@@ -193,6 +199,7 @@ OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o aacenctab.o \
aacenc_pred.o \
psymodel.o kbdwin.o \
mpeg4audio_sample_rates.o
OBJS-$(CONFIG_AAC_MEDIACODEC_DECODER) += mediacodecdec.o
OBJS-$(CONFIG_AAC_MF_ENCODER) += mfenc.o mf_utils.o
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
OBJS-$(CONFIG_AC3_DECODER) += ac3dec_float.o ac3dec_data.o ac3.o \
@@ -219,6 +226,8 @@ OBJS-$(CONFIG_AMRWB_DECODER) += amrwbdec.o celp_filters.o \
celp_math.o acelp_filters.o \
acelp_vectors.o \
acelp_pitch_delay.o
OBJS-$(CONFIG_AMRNB_MEDIACODEC_DECODER) += mediacodecdec.o
OBJS-$(CONFIG_AMRWB_MEDIACODEC_DECODER) += mediacodecdec.o
OBJS-$(CONFIG_AMV_ENCODER) += mjpegenc.o mjpegenc_common.o
OBJS-$(CONFIG_ANM_DECODER) += anm.o
OBJS-$(CONFIG_ANULL_DECODER) += null.o
@@ -265,8 +274,6 @@ OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o
OBJS-$(CONFIG_AVS_DECODER) += avs.o
OBJS-$(CONFIG_AVUI_DECODER) += avuidec.o
OBJS-$(CONFIG_AVUI_ENCODER) += avuienc.o
OBJS-$(CONFIG_AYUV_DECODER) += v408dec.o
OBJS-$(CONFIG_AYUV_ENCODER) += v408enc.o
OBJS-$(CONFIG_BETHSOFTVID_DECODER) += bethsoftvideo.o
OBJS-$(CONFIG_BFI_DECODER) += bfi.o
OBJS-$(CONFIG_BINK_DECODER) += bink.o binkdsp.o
@@ -284,7 +291,7 @@ OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brenderpix.o
OBJS-$(CONFIG_C93_DECODER) += c93.o
OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
cavsdata.o
OBJS-$(CONFIG_CBD2_DECODER) += dpcm.o
OBJS-$(CONFIG_CBD2_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_CCAPTION_DECODER) += ccaption_dec.o ass.o
OBJS-$(CONFIG_CDGRAPHICS_DECODER) += cdgraphics.o
OBJS-$(CONFIG_CDTOONS_DECODER) += cdtoons.o
@@ -419,7 +426,10 @@ OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec.o
OBJS-$(CONFIG_H264_QSV_ENCODER) += qsvenc_h264.o
OBJS-$(CONFIG_H264_RKMPP_DECODER) += rkmppdec.o
OBJS-$(CONFIG_H264_VAAPI_ENCODER) += vaapi_encode_h264.o h264_levels.o \
h2645data.o
h2645data.o hw_base_encode_h264.o
OBJS-$(CONFIG_H264_VULKAN_ENCODER) += vulkan_encode.o vulkan_encode_h264.o \
hw_base_encode.o hw_base_encode_h264.o \
h264_levels.o h2645data.o
OBJS-$(CONFIG_H264_VIDEOTOOLBOX_ENCODER) += videotoolboxenc.o
OBJS-$(CONFIG_H264_V4L2M2M_DECODER) += v4l2_m2m_dec.o
OBJS-$(CONFIG_H264_V4L2M2M_ENCODER) += v4l2_m2m_enc.o
@@ -429,22 +439,23 @@ OBJS-$(CONFIG_HCA_DECODER) += hcadec.o
OBJS-$(CONFIG_HCOM_DECODER) += hcom.o
OBJS-$(CONFIG_HDR_DECODER) += hdrdec.o
OBJS-$(CONFIG_HDR_ENCODER) += hdrenc.o
OBJS-$(CONFIG_HEVC_DECODER) += hevcdec.o hevc_mvs.o \
hevc_cabac.o hevc_refs.o hevcpred.o \
hevcdsp.o hevc_filter.o hevc_data.o \
h274.o aom_film_grain.o
OBJS-$(CONFIG_HEVC_DECODER) += aom_film_grain.o h274.o container_fifo.o
OBJS-$(CONFIG_HEVC_AMF_ENCODER) += amfenc_hevc.o
OBJS-$(CONFIG_HEVC_CUVID_DECODER) += cuviddec.o
OBJS-$(CONFIG_HEVC_D3D12VA_ENCODER) += d3d12va_encode_hevc.o h265_profile_level.o \
h2645data.o
OBJS-$(CONFIG_HEVC_MEDIACODEC_DECODER) += mediacodecdec.o
OBJS-$(CONFIG_HEVC_MEDIACODEC_ENCODER) += mediacodecenc.o
OBJS-$(CONFIG_HEVC_MF_ENCODER) += mfenc.o mf_utils.o
OBJS-$(CONFIG_HEVC_NVENC_ENCODER) += nvenc_hevc.o nvenc.o
OBJS-$(CONFIG_HEVC_QSV_DECODER) += qsvdec.o
OBJS-$(CONFIG_HEVC_QSV_ENCODER) += qsvenc_hevc.o hevc_ps_enc.o \
hevc_data.o
OBJS-$(CONFIG_HEVC_QSV_ENCODER) += qsvenc_hevc.o hevc/ps_enc.o
OBJS-$(CONFIG_HEVC_RKMPP_DECODER) += rkmppdec.o
OBJS-$(CONFIG_HEVC_VAAPI_ENCODER) += vaapi_encode_h265.o h265_profile_level.o \
h2645data.o
h2645data.o hw_base_encode_h265.o
OBJS-$(CONFIG_HEVC_VULKAN_ENCODER) += vulkan_encode.o vulkan_encode_h265.o \
hw_base_encode.o hw_base_encode_h265.o \
h265_profile_level.o h2645data.o
OBJS-$(CONFIG_HEVC_V4L2M2M_DECODER) += v4l2_m2m_dec.o
OBJS-$(CONFIG_HEVC_V4L2M2M_ENCODER) += v4l2_m2m_enc.o
OBJS-$(CONFIG_HEVC_VIDEOTOOLBOX_ENCODER) += videotoolboxenc.o
@@ -521,6 +532,7 @@ OBJS-$(CONFIG_MP2FIXED_ENCODER) += mpegaudioenc_fixed.o mpegaudio.o \
mpegaudiotabs.o
OBJS-$(CONFIG_MP2FLOAT_DECODER) += mpegaudiodec_float.o
OBJS-$(CONFIG_MP3_DECODER) += mpegaudiodec_fixed.o
OBJS-$(CONFIG_MP3_MEDIACODEC_DECODER) += mediacodecdec.o
OBJS-$(CONFIG_MP3_MF_ENCODER) += mfenc.o mf_utils.o
OBJS-$(CONFIG_MP3ADU_DECODER) += mpegaudiodec_fixed.o
OBJS-$(CONFIG_MP3ADUFLOAT_DECODER) += mpegaudiodec_float.o
@@ -576,11 +588,7 @@ OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o
OBJS-$(CONFIG_NOTCHLC_DECODER) += notchlc.o
OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o jpegquanttables.o
OBJS-$(CONFIG_ON2AVC_DECODER) += on2avc.o on2avcdata.o
OBJS-$(CONFIG_OPUS_DECODER) += opusdec.o opusdec_celt.o opus_celt.o \
opus_pvq.o opus_silk.o opustab.o vorbis_data.o \
opusdsp.o opus_parse.o opus_rc.o
OBJS-$(CONFIG_OPUS_ENCODER) += opusenc.o opusenc_psy.o opus_celt.o \
opus_pvq.o opus_rc.o opustab.o
OBJS-$(CONFIG_OPUS_DECODER) += vorbis_data.o
OBJS-$(CONFIG_OSQ_DECODER) += osq.o
OBJS-$(CONFIG_PAF_AUDIO_DECODER) += pafaudio.o
OBJS-$(CONFIG_PAF_VIDEO_DECODER) += pafvideo.o
@@ -609,7 +617,7 @@ OBJS-$(CONFIG_PNG_DECODER) += png.o pngdec.o pngdsp.o
OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o
OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o proresdsp.o proresdata.o
OBJS-$(CONFIG_PRORES_DECODER) += proresdec.o proresdsp.o proresdata.o
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o proresdata.o
OBJS-$(CONFIG_PRORES_AW_ENCODER) += proresenc_anatoliy.o proresdata.o
OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o
@@ -1068,6 +1076,7 @@ STLIBOBJS-$(CONFIG_ISO_MEDIA) += mpegaudiotabs.o
STLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o
STLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o
STLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o
STLIBOBJS-$(CONFIG_JNI) += ffjni.o
STLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o
STLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o
STLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o
@@ -1123,6 +1132,8 @@ OBJS-$(CONFIG_LIBILBC_ENCODER) += libilbc.o
OBJS-$(CONFIG_LIBJXL_DECODER) += libjxldec.o libjxl.o
OBJS-$(CONFIG_LIBJXL_ENCODER) += libjxlenc.o libjxl.o
OBJS-$(CONFIG_LIBKVAZAAR_ENCODER) += libkvazaar.o
OBJS-$(CONFIG_LIBLC3_ENCODER) += liblc3enc.o
OBJS-$(CONFIG_LIBLC3_DECODER) += liblc3dec.o
OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
@@ -1150,6 +1161,7 @@ OBJS-$(CONFIG_LIBVPX_VP8_DECODER) += libvpxdec.o
OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o
OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o
OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o
OBJS-$(CONFIG_LIBVVENC_ENCODER) += libvvenc.o
OBJS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc_common.o libwebpenc.o
OBJS-$(CONFIG_LIBWEBP_ANIM_ENCODER) += libwebpenc_common.o libwebpenc_animencoder.o
OBJS-$(CONFIG_LIBX262_ENCODER) += libx264.o
@@ -1196,7 +1208,6 @@ OBJS-$(CONFIG_GSM_PARSER) += gsm_parser.o
OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264data.o
OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o hevc_data.o
OBJS-$(CONFIG_HDR_PARSER) += hdr_parser.o
OBJS-$(CONFIG_IPU_PARSER) += ipu_parser.o
OBJS-$(CONFIG_JPEG2000_PARSER) += jpeg2000_parser.o
@@ -1210,8 +1221,7 @@ OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o
OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \
mpeg12.o mpeg12data.o
OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus_parse.o \
vorbis_data.o
OBJS-$(CONFIG_OPUS_PARSER) += vorbis_data.o
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o
@@ -1262,7 +1272,7 @@ SKIPHEADERS += %_tablegen.h \
SKIPHEADERS-$(CONFIG_AMF) += amfenc.h
SKIPHEADERS-$(CONFIG_D3D11VA) += d3d11va.h dxva2_internal.h
SKIPHEADERS-$(CONFIG_D3D12VA) += d3d12va_decode.h
SKIPHEADERS-$(CONFIG_D3D12VA) += d3d12va_decode.h d3d12va_encode.h
SKIPHEADERS-$(CONFIG_DXVA2) += dxva2.h dxva2_internal.h
SKIPHEADERS-$(CONFIG_JNI) += ffjni.h
SKIPHEADERS-$(CONFIG_LCMS2) += fflcms2.h
@@ -1279,7 +1289,7 @@ SKIPHEADERS-$(CONFIG_QSVENC) += qsvenc.h
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_decode.h vaapi_hevc.h vaapi_encode.h
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h
SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vt_internal.h
SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h
SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_encode.h vulkan_decode.h
SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h v4l2_m2m.h
SKIPHEADERS-$(CONFIG_ZLIB) += zlib_wrapper.h
@@ -1347,7 +1357,7 @@ $(GEN_HEADERS): $(SUBDIR)%_tables.h: $(SUBDIR)%_tablegen$(HOSTEXESUF)
ifdef CONFIG_HARDCODED_TABLES
$(SUBDIR)cbrt_data.o: $(SUBDIR)cbrt_tables.h
$(SUBDIR)cbrt_data_fixed.o: $(SUBDIR)cbrt_fixed_tables.h
$(SUBDIR)aacdec_fixed.o: $(SUBDIR)sinewin_fixed_tables.h
$(SUBDIR)aac/aacdec_fixed.o: $(SUBDIR)sinewin_fixed_tables.h
$(SUBDIR)aacps_float.o: $(SUBDIR)aacps_tables.h
$(SUBDIR)aacps_fixed.o: $(SUBDIR)aacps_fixed_tables.h
$(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h
+1 -1
View File
@@ -32,8 +32,8 @@
#include "elbg.h"
#include "encode.h"
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#define DITHERSTEPS 8
#define CHARSET_CHARS 256
+17 -18
View File
@@ -30,11 +30,8 @@
#ifndef AVCODEC_AAC_H
#define AVCODEC_AAC_H
#include "aac_defines.h"
#define MAX_CHANNELS 64
#define MAX_ELEM_ID 16
#define MAX_ELEM_ID 64
#define TNS_MAX_ORDER 20
#define MAX_LTP_LONG_SFB 40
@@ -85,20 +82,6 @@ enum ChannelPosition {
AAC_CHANNEL_CC = 5,
};
/**
* Predictor State
*/
typedef struct PredictorState {
AAC_FLOAT cor0;
AAC_FLOAT cor1;
AAC_FLOAT var0;
AAC_FLOAT var1;
AAC_FLOAT r0;
AAC_FLOAT r1;
AAC_FLOAT k1;
AAC_FLOAT x_est;
} PredictorState;
#define MAX_PREDICTORS 672
#define SCALE_DIV_512 36 ///< scalefactor difference that corresponds to scale difference in 512 times
@@ -120,4 +103,20 @@ typedef struct Pulse {
int amp[4];
} Pulse;
static inline int ff_aac_sample_rate_idx(int rate)
{
if (92017 <= rate) return 0;
else if (75132 <= rate) return 1;
else if (55426 <= rate) return 2;
else if (46009 <= rate) return 3;
else if (37566 <= rate) return 4;
else if (27713 <= rate) return 5;
else if (23004 <= rate) return 6;
else if (18783 <= rate) return 7;
else if (13856 <= rate) return 8;
else if (11502 <= rate) return 9;
else if (9391 <= rate) return 10;
else return 11;
}
#endif /* AVCODEC_AAC_H */
+8
View File
@@ -0,0 +1,8 @@
clean::
$(RM) $(CLEANSUFFIXES:%=libavcodec/aac/%)
OBJS-$(CONFIG_AAC_DECODER) += aac/aacdec.o aac/aacdec_tab.o \
aac/aacdec_float.o aac/aacdec_usac.o \
aac/aacdec_ac.o aac/aacdec_lpd.o
OBJS-$(CONFIG_AAC_FIXED_DECODER) += aac/aacdec.o aac/aacdec_tab.o \
aac/aacdec_fixed.o
File diff suppressed because it is too large Load Diff
+562
View File
@@ -0,0 +1,562 @@
/*
* AAC decoder definitions and structures
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC decoder definitions and structures
* @author Oded Shimon ( ods15 ods15 dyndns org )
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
*/
#ifndef AVCODEC_AAC_AACDEC_H
#define AVCODEC_AAC_AACDEC_H
#include <stdint.h>
#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "libavutil/fixed_dsp.h"
#include "libavutil/mem_internal.h"
#include "libavutil/tx.h"
#include "libavcodec/aac.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/mpeg4audio.h"
#include "aacdec_ac.h"
typedef struct AACDecContext AACDecContext;
/**
* Output configuration status
*/
enum OCStatus {
OC_NONE, ///< Output unconfigured
OC_TRIAL_PCE, ///< Output configuration under trial specified by an inband PCE
OC_TRIAL_FRAME, ///< Output configuration under trial specified by a frame header
OC_GLOBAL_HDR, ///< Output configuration set in a global header but not yet locked
OC_LOCKED, ///< Output configuration locked in place
};
enum AACOutputChannelOrder {
CHANNEL_ORDER_DEFAULT,
CHANNEL_ORDER_CODED,
};
/**
* The point during decoding at which channel coupling is applied.
*/
enum CouplingPoint {
BEFORE_TNS,
BETWEEN_TNS_AND_IMDCT,
AFTER_IMDCT = 3,
};
enum AACUsacElem {
ID_USAC_SCE = 0,
ID_USAC_CPE = 1,
ID_USAC_LFE = 2,
ID_USAC_EXT = 3,
};
enum ExtensionHeaderType {
ID_CONFIG_EXT_FILL = 0,
ID_CONFIG_EXT_LOUDNESS_INFO = 2,
ID_CONFIG_EXT_STREAM_ID = 7,
};
enum AACUsacExtension {
ID_EXT_ELE_FILL,
ID_EXT_ELE_MPEGS,
ID_EXT_ELE_SAOC,
ID_EXT_ELE_AUDIOPREROLL,
ID_EXT_ELE_UNI_DRC,
};
enum AACUSACLoudnessExt {
UNIDRCLOUDEXT_TERM = 0x0,
UNIDRCLOUDEXT_EQ = 0x1,
};
// Supposed to be equal to AAC_RENAME() in case of USE_FIXED.
#define RENAME_FIXED(name) name ## _fixed
#define INTFLOAT_UNION(name, elems) \
union { \
int RENAME_FIXED(name) elems; \
float name elems; \
}
#define INTFLOAT_ALIGNED_UNION(alignment, name, nb_elems) \
union { \
DECLARE_ALIGNED(alignment, int, RENAME_FIXED(name))[nb_elems]; \
DECLARE_ALIGNED(alignment, float, name)[nb_elems]; \
}
/**
* Long Term Prediction
*/
typedef struct LongTermPrediction {
int8_t present;
int16_t lag;
INTFLOAT_UNION(coef,);
int8_t used[MAX_LTP_LONG_SFB];
} LongTermPrediction;
/* Per channel core mode */
typedef struct AACUsacElemData {
uint8_t core_mode;
uint8_t scale_factor_grouping;
uint8_t tns_data_present;
/* Timewarping ratio */
#define NUM_TW_NODES 16
uint8_t tw_ratio[NUM_TW_NODES];
struct {
uint8_t acelp_core_mode : 3;
uint8_t lpd_mode : 5;
uint8_t bpf_control_info : 1;
uint8_t core_mode_last : 1;
uint8_t fac_data_present : 1;
int last_lpd_mode;
} ldp;
struct {
unsigned int seed;
uint8_t level : 3;
uint8_t offset : 5;
} noise;
struct {
uint8_t gain;
uint32_t kv[8 /* (1024 / 16) / 8 */][8];
} fac;
AACArithState ac;
} AACUsacElemData;
/**
* Individual Channel Stream
*/
typedef struct IndividualChannelStream {
uint8_t max_sfb; ///< number of scalefactor bands per group
enum WindowSequence window_sequence[2];
uint8_t use_kb_window[2]; ///< If set, use Kaiser-Bessel window, otherwise use a sine window.
int num_window_groups;
int prev_num_window_groups; ///< Previous frame's number of window groups
uint8_t group_len[8];
LongTermPrediction ltp;
const uint16_t *swb_offset; ///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window
int num_swb; ///< number of scalefactor window bands
int num_windows;
int tns_max_bands;
int predictor_present;
int predictor_initialized;
int predictor_reset_group;
uint8_t prediction_used[41];
uint8_t window_clipping[8]; ///< set if a certain window is near clipping
} IndividualChannelStream;
/**
* Temporal Noise Shaping
*/
typedef struct TemporalNoiseShaping {
int present;
int n_filt[8];
int length[8][4];
int direction[8][4];
int order[8][4];
INTFLOAT_UNION(coef, [8][4][TNS_MAX_ORDER]);
} TemporalNoiseShaping;
/**
* coupling parameters
*/
typedef struct ChannelCoupling {
enum CouplingPoint coupling_point; ///< The point during decoding at which coupling is applied.
int num_coupled; ///< number of target elements
enum RawDataBlockType type[8]; ///< Type of channel element to be coupled - SCE or CPE.
int id_select[8]; ///< element id
int ch_select[8]; /**< [0] shared list of gains; [1] list of gains for right channel;
* [2] list of gains for left channel; [3] lists of gains for both channels
*/
INTFLOAT_UNION(gain, [16][120]);
} ChannelCoupling;
/**
* Single Channel Element - used for both SCE and LFE elements.
*/
typedef struct SingleChannelElement {
IndividualChannelStream ics;
AACUsacElemData ue; ///< USAC element data
TemporalNoiseShaping tns;
enum BandType band_type[128]; ///< band types
int sfo[128]; ///< scalefactor offsets
INTFLOAT_UNION(sf, [128]); ///< scalefactors (8 windows * 16 sfb max)
INTFLOAT_ALIGNED_UNION(32, coeffs, 1024); ///< coefficients for IMDCT, maybe processed
INTFLOAT_ALIGNED_UNION(32, prev_coeffs, 1024); ///< unscaled previous contents of coeffs[] for USAC
INTFLOAT_ALIGNED_UNION(32, saved, 1536); ///< overlap
INTFLOAT_ALIGNED_UNION(32, ret_buf, 2048); ///< PCM output buffer
INTFLOAT_ALIGNED_UNION(16, ltp_state, 3072); ///< time signal for LTP
union {
struct PredictorStateFixed *RENAME_FIXED(predictor_state);
struct PredictorState *predictor_state;
};
union {
float *output; ///< PCM output
int *RENAME_FIXED(output); ///< PCM output
};
} SingleChannelElement;
typedef struct AACUsacStereo {
uint8_t common_window;
uint8_t common_tw;
uint8_t tns_on_lr; ///< Apply TNS before M/S and stereo prediction
uint8_t ms_mask_mode;
uint8_t config_idx;
/* Complex prediction */
uint8_t use_prev_frame;
uint8_t pred_dir;
uint8_t complex_coef;
uint8_t pred_used[128];
INTFLOAT_ALIGNED_UNION(32, alpha_q_re, 1024);
INTFLOAT_ALIGNED_UNION(32, alpha_q_im, 1024);
INTFLOAT_ALIGNED_UNION(32, prev_alpha_q_re, 1024);
INTFLOAT_ALIGNED_UNION(32, prev_alpha_q_im, 1024);
INTFLOAT_ALIGNED_UNION(32, dmix_re, 1024);
INTFLOAT_ALIGNED_UNION(32, prev_dmix_re, 1024); /* Recalculated on every frame */
INTFLOAT_ALIGNED_UNION(32, dmix_im, 1024); /* Final prediction data */
} AACUsacStereo;
/**
* channel element - generic struct for SCE/CPE/CCE/LFE
*/
typedef struct ChannelElement {
int present;
// CPE specific
uint8_t max_sfb_ste; ///< (USAC) Maximum of both max_sfb values
uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scalefactor window band
// shared
SingleChannelElement ch[2];
// CCE specific
ChannelCoupling coup;
// USAC stereo coupling data
AACUsacStereo us;
} ChannelElement;
typedef struct AACUSACLoudnessInfo {
uint8_t drc_set_id : 6;
uint8_t downmix_id : 7;
struct {
uint16_t lvl : 12;
uint8_t present : 1;
} sample_peak;
struct {
uint16_t lvl : 12;
uint8_t measurement : 4;
uint8_t reliability : 2;
uint8_t present : 1;
} true_peak;
uint8_t nb_measurements : 4;
struct {
uint8_t method_def : 4;
uint8_t method_val;
uint8_t measurement : 4;
uint8_t reliability : 2;
} measurements[16];
} AACUSACLoudnessInfo;
typedef struct AACUsacElemConfig {
enum AACUsacElem type;
uint8_t tw_mdct : 1;
uint8_t noise_fill : 1;
uint8_t stereo_config_index;
struct {
int ratio;
uint8_t harmonic_sbr : 1; /* harmonicSBR */
uint8_t bs_intertes : 1; /* bs_interTes */
uint8_t bs_pvc : 1; /* bs_pvc */
struct {
uint8_t start_freq; /* dflt_start_freq */
uint8_t stop_freq; /* dflt_stop_freq */
uint8_t freq_scale; /* dflt_freq_scale */
uint8_t alter_scale : 1; /* dflt_alter_scale */
uint8_t noise_bands; /* dflt_noise_bands */
uint8_t limiter_bands; /* dflt_limiter_bands */
uint8_t limiter_gains; /* dflt_limiter_gains */
uint8_t interpol_freq : 1; /* dflt_interpol_freq */
uint8_t smoothing_mode : 1; /* dflt_smoothing_mode */
} dflt;
} sbr;
struct {
uint8_t freq_res; /* bsFreqRes */
uint8_t fixed_gain; /* bsFixedGainDMX */
uint8_t temp_shape_config; /* bsTempShapeConfig */
uint8_t decorr_config; /* bsDecorrConfig */
uint8_t high_rate_mode : 1; /* bsHighRateMode */
uint8_t phase_coding : 1; /* bsPhaseCoding */
uint8_t otts_bands_phase; /* bsOttBandsPhase */
uint8_t residual_coding; /* bsResidualCoding */
uint8_t residual_bands; /* bsResidualBands */
uint8_t pseudo_lr : 1; /* bsPseudoLr */
uint8_t env_quant_mode : 1; /* bsEnvQuantMode */
} mps;
struct {
enum AACUsacExtension type;
uint8_t payload_frag;
uint32_t default_len;
uint32_t pl_data_offset;
uint8_t *pl_data;
} ext;
} AACUsacElemConfig;
typedef struct AACUSACConfig {
uint8_t core_sbr_frame_len_idx; /* coreSbrFrameLengthIndex */
uint16_t core_frame_len;
uint16_t stream_identifier;
AACUsacElemConfig elems[64];
int nb_elems;
struct {
uint8_t nb_album;
AACUSACLoudnessInfo album_info[64];
uint8_t nb_info;
AACUSACLoudnessInfo info[64];
} loudness;
} AACUSACConfig;
typedef struct OutputConfiguration {
MPEG4AudioConfig m4ac;
uint8_t layout_map[MAX_ELEM_ID*4][3];
int layout_map_tags;
AVChannelLayout ch_layout;
enum OCStatus status;
AACUSACConfig usac;
} OutputConfiguration;
/**
* Dynamic Range Control - decoded from the bitstream but not processed further.
*/
typedef struct DynamicRangeControl {
int pce_instance_tag; ///< Indicates with which program the DRC info is associated.
int dyn_rng_sgn[17]; ///< DRC sign information; 0 - positive, 1 - negative
int dyn_rng_ctl[17]; ///< DRC magnitude information
int exclude_mask[MAX_CHANNELS]; ///< Channels to be excluded from DRC processing.
int band_incr; ///< Number of DRC bands greater than 1 having DRC info.
int interpolation_scheme; ///< Indicates the interpolation scheme used in the SBR QMF domain.
int band_top[17]; ///< Indicates the top of the i-th DRC band in units of 4 spectral lines.
int prog_ref_level; /**< A reference level for the long-term program audio level for all
* channels combined.
*/
} DynamicRangeControl;
/**
* Decode-specific primitives
*/
typedef struct AACDecProc {
int (*decode_spectrum_and_dequant)(AACDecContext *ac,
GetBitContext *gb,
const Pulse *pulse,
SingleChannelElement *sce);
int (*decode_cce)(AACDecContext *ac, GetBitContext *gb, ChannelElement *che);
int (*sbr_ctx_alloc_init)(AACDecContext *ac, ChannelElement **che, int id_aac);
int (*sbr_decode_extension)(AACDecContext *ac, ChannelElement *che,
GetBitContext *gb, int crc, int cnt, int id_aac);
void (*sbr_apply)(AACDecContext *ac, ChannelElement *che,
int id_aac, void /* INTFLOAT */ *L, void /* INTFLOAT */ *R);
void (*sbr_ctx_close)(ChannelElement *che);
} AACDecProc;
/**
* DSP-specific primitives
*/
typedef struct AACDecDSP {
void (*dequant_scalefactors)(SingleChannelElement *sce);
void (*apply_mid_side_stereo)(AACDecContext *ac, ChannelElement *cpe);
void (*apply_intensity_stereo)(AACDecContext *ac, ChannelElement *cpe,
int ms_present);
void (*apply_tns)(void *_coef_param, TemporalNoiseShaping *tns,
IndividualChannelStream *ics, int decode);
void (*apply_ltp)(AACDecContext *ac, SingleChannelElement *sce);
void (*update_ltp)(AACDecContext *ac, SingleChannelElement *sce);
void (*apply_prediction)(AACDecContext *ac, SingleChannelElement *sce);
void (*apply_dependent_coupling)(AACDecContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index);
void (*apply_independent_coupling)(AACDecContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index);
void (*imdct_and_windowing)(AACDecContext *ac, SingleChannelElement *sce);
void (*imdct_and_windowing_768)(AACDecContext *ac, SingleChannelElement *sce);
void (*imdct_and_windowing_960)(AACDecContext *ac, SingleChannelElement *sce);
void (*imdct_and_windowing_ld)(AACDecContext *ac, SingleChannelElement *sce);
void (*imdct_and_windowing_eld)(AACDecContext *ac, SingleChannelElement *sce);
void (*clip_output)(AACDecContext *ac, ChannelElement *che, int type, int samples);
} AACDecDSP;
/**
* main AAC decoding context
*/
struct AACDecContext {
const struct AVClass *class;
struct AVCodecContext *avctx;
AACDecDSP dsp;
AACDecProc proc;
struct AVFrame *frame;
int is_saved; ///< Set if elements have stored overlap from previous frame.
DynamicRangeControl che_drc;
/**
* @name Channel element related data
* @{
*/
ChannelElement *che[4][MAX_ELEM_ID];
ChannelElement *tag_che_map[4][MAX_ELEM_ID];
int tags_mapped;
int warned_remapping_once;
/** @} */
/**
* @name temporary aligned temporary buffers
* (We do not want to have these on the stack.)
* @{
*/
INTFLOAT_ALIGNED_UNION(32, buf_mdct, 1024);
INTFLOAT_ALIGNED_UNION(32, temp, 128);
/** @} */
/**
* @name Computed / set up during initialization
* @{
*/
AVTXContext *mdct96;
AVTXContext *mdct120;
AVTXContext *mdct128;
AVTXContext *mdct480;
AVTXContext *mdct512;
AVTXContext *mdct768;
AVTXContext *mdct960;
AVTXContext *mdct1024;
AVTXContext *mdct_ltp;
av_tx_fn mdct96_fn;
av_tx_fn mdct120_fn;
av_tx_fn mdct128_fn;
av_tx_fn mdct480_fn;
av_tx_fn mdct512_fn;
av_tx_fn mdct768_fn;
av_tx_fn mdct960_fn;
av_tx_fn mdct1024_fn;
av_tx_fn mdct_ltp_fn;
union {
AVFixedDSPContext *RENAME_FIXED(fdsp);
AVFloatDSPContext *fdsp;
};
int random_state;
/** @} */
/**
* @name Members used for output
* @{
*/
SingleChannelElement *output_element[MAX_CHANNELS]; ///< Points to each SingleChannelElement
/** @} */
/**
* @name Japanese DTV specific extension
* @{
*/
int force_dmono_mode;///< 0->not dmono, 1->use first channel, 2->use second channel
int dmono_mode; ///< 0->not dmono, 1->use first channel, 2->use second channel
/** @} */
enum AACOutputChannelOrder output_channel_order;
OutputConfiguration oc[2];
int warned_num_aac_frames;
int warned_960_sbr;
unsigned warned_71_wide;
int warned_gain_control;
int warned_he_aac_mono;
int is_fixed;
};
#if defined(USE_FIXED) && USE_FIXED
#define fdsp RENAME_FIXED(fdsp)
#endif
int ff_aac_decode_init(AVCodecContext *avctx);
int ff_aac_decode_init_float(AVCodecContext *avctx);
int ff_aac_decode_init_fixed(AVCodecContext *avctx);
int ff_aac_decode_ics(AACDecContext *ac, SingleChannelElement *sce,
GetBitContext *gb, int common_window, int scale_flag);
int ff_aac_decode_tns(AACDecContext *ac, TemporalNoiseShaping *tns,
GetBitContext *gb, const IndividualChannelStream *ics);
int ff_aac_set_default_channel_config(AACDecContext *ac, AVCodecContext *avctx,
uint8_t (*layout_map)[3],
int *tags,
int channel_config);
int ff_aac_output_configure(AACDecContext *ac,
uint8_t layout_map[MAX_ELEM_ID * 4][3], int tags,
enum OCStatus oc_type, int get_new_frame);
ChannelElement *ff_aac_get_che(AACDecContext *ac, int type, int elem_id);
#endif /* AVCODEC_AAC_AACDEC_H */
+208
View File
@@ -0,0 +1,208 @@
/*
* AAC definitions and structures
* Copyright (c) 2024 Lynne
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavcodec/aactab.h"
#include "aacdec_ac.h"
uint32_t ff_aac_ac_map_process(AACArithState *state, int reset, int N)
{
float ratio;
if (reset) {
memset(state->last, 0, sizeof(state->last));
state->last_len = N;
} else if (state->last_len != N) {
int i;
uint8_t last[512 /* 2048 / 4 */];
memcpy(last, state->last, sizeof(last));
ratio = state->last_len / (float)N;
for (i = 0; i < N/2; i++) {
int k = (int)(i * ratio);
state->last[i] = last[k];
}
for (; i < FF_ARRAY_ELEMS(state->last); i++)
state->last[i] = 0;
state->last_len = N;
}
state->cur[3] = 0;
state->cur[2] = 0;
state->cur[1] = 0;
state->cur[0] = 1;
state->state_pre = state->last[0] << 12;
return state->last[0] << 12;
}
uint32_t ff_aac_ac_get_context(AACArithState *state, uint32_t c, int i, int N)
{
c = state->state_pre >> 8;
c = c + (state->last[i + 1] << 8);
c = (c << 4);
c += state->cur[1];
state->state_pre = c;
if (i > 3 &&
((state->cur[3] + state->cur[2] + state->cur[1]) < 5))
return c + 0x10000;
return c;
}
uint32_t ff_aac_ac_get_pk(uint32_t c)
{
int i_min = -1;
int i, j;
int i_max = FF_ARRAY_ELEMS(ff_aac_ac_lookup_m) - 1;
while ((i_max - i_min) > 1) {
i = i_min + ((i_max - i_min) / 2);
j = ff_aac_ac_hash_m[i];
if (c < (j >> 8))
i_max = i;
else if (c > (j >> 8))
i_min = i;
else
return (j & 0xFF);
}
return ff_aac_ac_lookup_m[i_max];
}
void ff_aac_ac_update_context(AACArithState *state, int idx,
uint16_t a, uint16_t b)
{
state->cur[0] = a + b + 1;
if (state->cur[0] > 0xF)
state->cur[0] = 0xF;
state->cur[3] = state->cur[2];
state->cur[2] = state->cur[1];
state->cur[1] = state->cur[0];
state->last[idx] = state->cur[0];
}
/* Initialize AC */
void ff_aac_ac_init(AACArith *ac, GetBitContext *gb)
{
ac->low = 0;
ac->high = UINT16_MAX;
ac->val = get_bits(gb, 16);
}
uint16_t ff_aac_ac_decode(AACArith *ac, GetBitContext *gb,
const uint16_t *cdf, uint16_t cdf_len)
{
int val = ac->val;
int low = ac->low;
int high = ac->high;
int sym;
int rng = high - low + 1;
int c = ((((int)(val - low + 1)) << 14) - ((int)1));
const uint16_t *p = cdf - 1;
/* One for each possible CDF length in the spec */
switch (cdf_len) {
case 2:
if ((p[1] * rng) > c)
p += 1;
break;
case 4:
if ((p[2] * rng) > c)
p += 2;
if ((p[1] * rng) > c)
p += 1;
break;
case 17:
/* First check if the current probability is even met at all */
if ((p[1] * rng) <= c)
break;
p += 1;
for (int i = 8; i >= 1; i >>= 1)
if ((p[i] * rng) > c)
p += i;
break;
case 27:
if ((p[16] * rng) > c)
p += 16;
if ((p[8] * rng) > c)
p += 8;
if (p != (cdf - 1 + 24))
if ((p[4] * rng) > c)
p += 4;
if ((p[2] * rng) > c)
p += 2;
if (p != (cdf - 1 + 24 + 2))
if ((p[1] * rng) > c)
p += 1;
break;
default:
/* This should never happen */
av_assert2(0);
}
sym = (int)((ptrdiff_t)(p - cdf)) + 1;
if (sym)
high = low + ((rng * cdf[sym - 1]) >> 14) - 1;
low += (rng * cdf[sym]) >> 14;
/* This loop could be done faster */
while (1) {
if (high < 32768) {
;
} else if (low >= 32768) {
val -= 32768;
low -= 32768;
high -= 32768;
} else if (low >= 16384 && high < 49152) {
val -= 16384;
low -= 16384;
high -= 16384;
} else {
break;
}
low += low;
high += high + 1;
val = (val << 1) | get_bits1(gb);
};
ac->low = low;
ac->high = high;
ac->val = val;
return sym;
}
void ff_aac_ac_finish(AACArithState *state, int offset, int N)
{
int i;
for (i = offset; i < N/2; i++)
state->last[i] = 1;
for (; i < FF_ARRAY_ELEMS(state->last); i++)
state->last[i] = 0;
}
+54
View File
@@ -0,0 +1,54 @@
/*
* AAC definitions and structures
* Copyright (c) 2024 Lynne
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AAC_AACDEC_AC_H
#define AVCODEC_AAC_AACDEC_AC_H
#include "libavcodec/get_bits.h"
typedef struct AACArithState {
uint8_t last[512 /* 2048 / 4 */ + 1];
int last_len;
uint8_t cur[4];
uint16_t state_pre;
} AACArithState;
typedef struct AACArith {
uint16_t low;
uint16_t high;
uint16_t val;
} AACArith;
#define FF_AAC_AC_ESCAPE 16
uint32_t ff_aac_ac_map_process(AACArithState *state, int reset, int len);
uint32_t ff_aac_ac_get_context(AACArithState *state, uint32_t old_c, int idx, int len);
uint32_t ff_aac_ac_get_pk(uint32_t c);
void ff_aac_ac_update_context(AACArithState *state, int idx, uint16_t a, uint16_t b);
void ff_aac_ac_init(AACArith *ac, GetBitContext *gb);
uint16_t ff_aac_ac_decode(AACArith *ac, GetBitContext *gb,
const uint16_t *cdf, uint16_t cdf_len);
void ff_aac_ac_finish(AACArithState *state, int offset, int nb);
#endif /* AVCODEC_AACDEC_AC_H */
+688
View File
@@ -0,0 +1,688 @@
/*
* AAC decoder
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
*
* AAC LATM decoder
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* AAC decoder fixed-point implementation
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "aacdec.h"
#include "libavcodec/lpc_functions.h"
#include "libavcodec/aactab.h"
/**
* Convert integer scalefactors to the decoder's native expected
* scalefactor values.
*/
static void AAC_RENAME(dequant_scalefactors)(SingleChannelElement *sce)
{
IndividualChannelStream *ics = &sce->ics;
const int *sfo = sce->sfo;
INTFLOAT *sf = sce->AAC_RENAME(sf);
int idx = 0;
for (int g = 0; g < ics->num_window_groups; g++) {
for (int sfb = 0; sfb < ics->max_sfb; sfb++, idx++) {
switch (sce->band_type[g*ics->max_sfb + sfb]) {
case ZERO_BT:
sf[idx] = FIXR(0.);
break;
case INTENSITY_BT: /* fallthrough */
case INTENSITY_BT2:
#if USE_FIXED
sf[idx] = 100 - (sfo[idx] + 100);
#else
sf[idx] = ff_aac_pow2sf_tab[-sfo[idx] - 100 + POW_SF2_ZERO];
#endif /* USE_FIXED */
break;
case NOISE_BT:
#if USE_FIXED
sf[idx] = -(100 + sfo[idx]);
#else
sf[idx] = -ff_aac_pow2sf_tab[sfo[idx] + POW_SF2_ZERO];
#endif /* USE_FIXED */
break;
default:
#if USE_FIXED
sf[idx] = -sfo[idx] - 100;
#else
sf[idx] = -ff_aac_pow2sf_tab[sfo[idx] + POW_SF2_ZERO];
#endif /* USE_FIXED */
break;
}
}
}
}
/**
* Mid/Side stereo decoding; reference: 4.6.8.1.3.
*/
static void AAC_RENAME(apply_mid_side_stereo)(AACDecContext *ac, ChannelElement *cpe)
{
const IndividualChannelStream *ics = &cpe->ch[0].ics;
INTFLOAT *ch0 = cpe->ch[0].AAC_RENAME(coeffs);
INTFLOAT *ch1 = cpe->ch[1].AAC_RENAME(coeffs);
const uint16_t *offsets = ics->swb_offset;
for (int g = 0; g < ics->num_window_groups; g++) {
for (int sfb = 0; sfb < cpe->max_sfb_ste; sfb++) {
const int idx = g*cpe->max_sfb_ste + sfb;
if (cpe->ms_mask[idx] &&
cpe->ch[0].band_type[idx] < NOISE_BT &&
cpe->ch[1].band_type[idx] < NOISE_BT) {
for (int group = 0; group < ics->group_len[g]; group++)
#if USE_FIXED
ac->fdsp->butterflies_fixed(ch0 + group * 128 + offsets[sfb],
ch1 + group * 128 + offsets[sfb],
offsets[sfb+1] - offsets[sfb]);
#else
ac->fdsp->butterflies_float(ch0 + group * 128 + offsets[sfb],
ch1 + group * 128 + offsets[sfb],
offsets[sfb+1] - offsets[sfb]);
#endif /* USE_FIXED */
}
}
ch0 += ics->group_len[g] * 128;
ch1 += ics->group_len[g] * 128;
}
}
/**
* intensity stereo decoding; reference: 4.6.8.2.3
*
* @param ms_present Indicates mid/side stereo presence. [0] mask is all 0s;
* [1] mask is decoded from bitstream; [2] mask is all 1s;
* [3] reserved for scalable AAC
*/
static void AAC_RENAME(apply_intensity_stereo)(AACDecContext *ac,
ChannelElement *cpe, int ms_present)
{
const IndividualChannelStream *ics = &cpe->ch[1].ics;
SingleChannelElement *sce1 = &cpe->ch[1];
INTFLOAT *coef0 = cpe->ch[0].AAC_RENAME(coeffs), *coef1 = cpe->ch[1].AAC_RENAME(coeffs);
const uint16_t *offsets = ics->swb_offset;
int c;
INTFLOAT scale;
for (int g = 0; g < ics->num_window_groups; g++) {
for (int sfb = 0; sfb < ics->max_sfb; sfb++) {
const int idx = g*ics->max_sfb + sfb;
if (sce1->band_type[idx] == INTENSITY_BT ||
sce1->band_type[idx] == INTENSITY_BT2) {
c = -1 + 2 * (sce1->band_type[idx] - 14);
if (ms_present)
c *= 1 - 2 * cpe->ms_mask[idx];
scale = c * sce1->AAC_RENAME(sf)[idx];
for (int group = 0; group < ics->group_len[g]; group++)
#if USE_FIXED
subband_scale(coef1 + group * 128 + offsets[sfb],
coef0 + group * 128 + offsets[sfb],
scale,
23,
offsets[sfb + 1] - offsets[sfb], ac->avctx);
#else
ac->fdsp->vector_fmul_scalar(coef1 + group * 128 + offsets[sfb],
coef0 + group * 128 + offsets[sfb],
scale,
offsets[sfb + 1] - offsets[sfb]);
#endif /* USE_FIXED */
}
}
coef0 += ics->group_len[g] * 128;
coef1 += ics->group_len[g] * 128;
}
}
/**
* Decode Temporal Noise Shaping filter coefficients and apply all-pole filters; reference: 4.6.9.3.
*
* @param decode 1 if tool is used normally, 0 if tool is used in LTP.
* @param coef spectral coefficients
*/
static void AAC_RENAME(apply_tns)(void *_coef_param, TemporalNoiseShaping *tns,
IndividualChannelStream *ics, int decode)
{
const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb);
int w, filt, m, i;
int bottom, top, order, start, end, size, inc;
INTFLOAT *coef_param = _coef_param;
INTFLOAT lpc[TNS_MAX_ORDER];
INTFLOAT tmp[TNS_MAX_ORDER+1];
UINTFLOAT *coef = coef_param;
if(!mmm)
return;
for (w = 0; w < ics->num_windows; w++) {
bottom = ics->num_swb;
for (filt = 0; filt < tns->n_filt[w]; filt++) {
top = bottom;
bottom = FFMAX(0, top - tns->length[w][filt]);
order = tns->order[w][filt];
if (order == 0)
continue;
// tns_decode_coef
compute_lpc_coefs(tns->AAC_RENAME(coef)[w][filt], order, lpc, 0, 0, 0);
start = ics->swb_offset[FFMIN(bottom, mmm)];
end = ics->swb_offset[FFMIN( top, mmm)];
if ((size = end - start) <= 0)
continue;
if (tns->direction[w][filt]) {
inc = -1;
start = end - 1;
} else {
inc = 1;
}
start += w * 128;
if (decode) {
// ar filter
for (m = 0; m < size; m++, start += inc)
for (i = 1; i <= FFMIN(m, order); i++)
coef[start] -= AAC_MUL26((INTFLOAT)coef[start - i * inc], lpc[i - 1]);
} else {
// ma filter
for (m = 0; m < size; m++, start += inc) {
tmp[0] = coef[start];
for (i = 1; i <= FFMIN(m, order); i++)
coef[start] += AAC_MUL26(tmp[i], lpc[i - 1]);
for (i = order; i > 0; i--)
tmp[i] = tmp[i - 1];
}
}
}
}
}
/**
* Apply windowing and MDCT to obtain the spectral
* coefficient from the predicted sample by LTP.
*/
static inline void AAC_RENAME(windowing_and_mdct_ltp)(AACDecContext *ac,
INTFLOAT *out, INTFLOAT *in,
IndividualChannelStream *ics)
{
const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024);
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128);
const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024);
const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128);
if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) {
ac->fdsp->vector_fmul(in, in, lwindow_prev, 1024);
} else {
memset(in, 0, 448 * sizeof(*in));
ac->fdsp->vector_fmul(in + 448, in + 448, swindow_prev, 128);
}
if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
ac->fdsp->vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
} else {
ac->fdsp->vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
memset(in + 1024 + 576, 0, 448 * sizeof(*in));
}
ac->mdct_ltp_fn(ac->mdct_ltp, out, in, sizeof(INTFLOAT));
}
/**
* Apply the long term prediction
*/
static void AAC_RENAME(apply_ltp)(AACDecContext *ac, SingleChannelElement *sce)
{
const LongTermPrediction *ltp = &sce->ics.ltp;
const uint16_t *offsets = sce->ics.swb_offset;
int i, sfb;
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
INTFLOAT *predTime = sce->AAC_RENAME(output);
INTFLOAT *predFreq = ac->AAC_RENAME(buf_mdct);
int16_t num_samples = 2048;
if (ltp->lag < 1024)
num_samples = ltp->lag + 1024;
for (i = 0; i < num_samples; i++)
predTime[i] = AAC_MUL30(sce->AAC_RENAME(ltp_state)[i + 2048 - ltp->lag], ltp->AAC_RENAME(coef));
memset(&predTime[i], 0, (2048 - i) * sizeof(*predTime));
AAC_RENAME(windowing_and_mdct_ltp)(ac, predFreq, predTime, &sce->ics);
if (sce->tns.present)
AAC_RENAME(apply_tns)(predFreq, &sce->tns, &sce->ics, 0);
for (sfb = 0; sfb < FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB); sfb++)
if (ltp->used[sfb])
for (i = offsets[sfb]; i < offsets[sfb + 1]; i++)
sce->AAC_RENAME(coeffs)[i] += (UINTFLOAT)predFreq[i];
}
}
/**
* Update the LTP buffer for next frame
*/
static void AAC_RENAME(update_ltp)(AACDecContext *ac, SingleChannelElement *sce)
{
IndividualChannelStream *ics = &sce->ics;
INTFLOAT *saved = sce->AAC_RENAME(saved);
INTFLOAT *saved_ltp = sce->AAC_RENAME(coeffs);
const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024);
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128);
int i;
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
memcpy(saved_ltp, saved, 512 * sizeof(*saved_ltp));
memset(saved_ltp + 576, 0, 448 * sizeof(*saved_ltp));
ac->fdsp->vector_fmul_reverse(saved_ltp + 448, ac->AAC_RENAME(buf_mdct) + 960, &swindow[64], 64);
for (i = 0; i < 64; i++)
saved_ltp[i + 512] = AAC_MUL31(ac->AAC_RENAME(buf_mdct)[1023 - i], swindow[63 - i]);
} else if (1 && ics->window_sequence[0] == LONG_START_SEQUENCE) {
memcpy(saved_ltp, ac->AAC_RENAME(buf_mdct) + 512, 448 * sizeof(*saved_ltp));
memset(saved_ltp + 576, 0, 448 * sizeof(*saved_ltp));
ac->fdsp->vector_fmul_reverse(saved_ltp + 448, ac->AAC_RENAME(buf_mdct) + 960, &swindow[64], 64);
for (i = 0; i < 64; i++)
saved_ltp[i + 512] = AAC_MUL31(ac->AAC_RENAME(buf_mdct)[1023 - i], swindow[63 - i]);
} else if (1) { // LONG_STOP or ONLY_LONG
ac->fdsp->vector_fmul_reverse(saved_ltp, ac->AAC_RENAME(buf_mdct) + 512, &lwindow[512], 512);
for (i = 0; i < 512; i++)
saved_ltp[i + 512] = AAC_MUL31(ac->AAC_RENAME(buf_mdct)[1023 - i], lwindow[511 - i]);
}
memcpy(sce->AAC_RENAME(ltp_state), sce->AAC_RENAME(ltp_state)+1024,
1024 * sizeof(*sce->AAC_RENAME(ltp_state)));
memcpy(sce->AAC_RENAME(ltp_state) + 1024, sce->AAC_RENAME(output),
1024 * sizeof(*sce->AAC_RENAME(ltp_state)));
memcpy(sce->AAC_RENAME(ltp_state) + 2048, saved_ltp,
1024 * sizeof(*sce->AAC_RENAME(ltp_state)));
}
/**
* Conduct IMDCT and windowing.
*/
static void AAC_RENAME(imdct_and_windowing)(AACDecContext *ac, SingleChannelElement *sce)
{
IndividualChannelStream *ics = &sce->ics;
INTFLOAT *in = sce->AAC_RENAME(coeffs);
INTFLOAT *out = sce->AAC_RENAME(output);
INTFLOAT *saved = sce->AAC_RENAME(saved);
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128);
const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024);
const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128);
INTFLOAT *buf = ac->AAC_RENAME(buf_mdct);
INTFLOAT *temp = ac->AAC_RENAME(temp);
int i;
// imdct
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
for (i = 0; i < 1024; i += 128)
ac->mdct128_fn(ac->mdct128, buf + i, in + i, sizeof(INTFLOAT));
} else {
ac->mdct1024_fn(ac->mdct1024, buf, in, sizeof(INTFLOAT));
}
/* window overlapping
* NOTE: To simplify the overlapping code, all 'meaningless' short to long
* and long to short transitions are considered to be short to short
* transitions. This leaves just two cases (long to long and short to short)
* with a little special sauce for EIGHT_SHORT_SEQUENCE.
*/
if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
(ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
ac->fdsp->vector_fmul_window( out, saved, buf, lwindow_prev, 512);
} else {
memcpy( out, saved, 448 * sizeof(*out));
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
ac->fdsp->vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
ac->fdsp->vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
ac->fdsp->vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
ac->fdsp->vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
ac->fdsp->vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
memcpy( out + 448 + 4*128, temp, 64 * sizeof(*out));
} else {
ac->fdsp->vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
memcpy( out + 576, buf + 64, 448 * sizeof(*out));
}
}
// buffer update
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
memcpy( saved, temp + 64, 64 * sizeof(*saved));
ac->fdsp->vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
ac->fdsp->vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
ac->fdsp->vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(*saved));
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
memcpy( saved, buf + 512, 448 * sizeof(*saved));
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(*saved));
} else { // LONG_STOP or ONLY_LONG
memcpy( saved, buf + 512, 512 * sizeof(*saved));
}
}
/**
* Conduct IMDCT and windowing for 768-point frames.
*/
static void AAC_RENAME(imdct_and_windowing_768)(AACDecContext *ac, SingleChannelElement *sce)
{
IndividualChannelStream *ics = &sce->ics;
INTFLOAT *in = sce->AAC_RENAME(coeffs);
INTFLOAT *out = sce->AAC_RENAME(output);
INTFLOAT *saved = sce->AAC_RENAME(saved);
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(aac_kbd_short_96) : AAC_RENAME(sine_96);
const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(aac_kbd_long_768) : AAC_RENAME(sine_768);
const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(aac_kbd_short_96) : AAC_RENAME(sine_96);
INTFLOAT *buf = ac->AAC_RENAME(buf_mdct);
INTFLOAT *temp = ac->AAC_RENAME(temp);
int i;
// imdct
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
for (i = 0; i < 8; i++)
ac->mdct96_fn(ac->mdct96, buf + i * 96, in + i * 96, sizeof(INTFLOAT));
} else {
ac->mdct768_fn(ac->mdct768, buf, in, sizeof(INTFLOAT));
}
/* window overlapping
* NOTE: To simplify the overlapping code, all 'meaningless' short to long
* and long to short transitions are considered to be short to short
* transitions. This leaves just two cases (long to long and short to short)
* with a little special sauce for EIGHT_SHORT_SEQUENCE.
*/
if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
(ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
ac->fdsp->vector_fmul_window( out, saved, buf, lwindow_prev, 384);
} else {
memcpy( out, saved, 336 * sizeof(*out));
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
ac->fdsp->vector_fmul_window(out + 336 + 0*96, saved + 336, buf + 0*96, swindow_prev, 48);
ac->fdsp->vector_fmul_window(out + 336 + 1*96, buf + 0*96 + 48, buf + 1*96, swindow, 48);
ac->fdsp->vector_fmul_window(out + 336 + 2*96, buf + 1*96 + 48, buf + 2*96, swindow, 48);
ac->fdsp->vector_fmul_window(out + 336 + 3*96, buf + 2*96 + 48, buf + 3*96, swindow, 48);
ac->fdsp->vector_fmul_window(temp, buf + 3*96 + 48, buf + 4*96, swindow, 48);
memcpy( out + 336 + 4*96, temp, 48 * sizeof(*out));
} else {
ac->fdsp->vector_fmul_window(out + 336, saved + 336, buf, swindow_prev, 48);
memcpy( out + 432, buf + 48, 336 * sizeof(*out));
}
}
// buffer update
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
memcpy( saved, temp + 48, 48 * sizeof(*saved));
ac->fdsp->vector_fmul_window(saved + 48, buf + 4*96 + 48, buf + 5*96, swindow, 48);
ac->fdsp->vector_fmul_window(saved + 144, buf + 5*96 + 48, buf + 6*96, swindow, 48);
ac->fdsp->vector_fmul_window(saved + 240, buf + 6*96 + 48, buf + 7*96, swindow, 48);
memcpy( saved + 336, buf + 7*96 + 48, 48 * sizeof(*saved));
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
memcpy( saved, buf + 384, 336 * sizeof(*saved));
memcpy( saved + 336, buf + 7*96 + 48, 48 * sizeof(*saved));
} else { // LONG_STOP or ONLY_LONG
memcpy( saved, buf + 384, 384 * sizeof(*saved));
}
}
/**
* Conduct IMDCT and windowing.
*/
static void AAC_RENAME(imdct_and_windowing_960)(AACDecContext *ac, SingleChannelElement *sce)
{
IndividualChannelStream *ics = &sce->ics;
INTFLOAT *in = sce->AAC_RENAME(coeffs);
INTFLOAT *out = sce->AAC_RENAME(output);
INTFLOAT *saved = sce->AAC_RENAME(saved);
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(aac_kbd_short_120) : AAC_RENAME(sine_120);
const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(aac_kbd_long_960) : AAC_RENAME(sine_960);
const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(aac_kbd_short_120) : AAC_RENAME(sine_120);
INTFLOAT *buf = ac->AAC_RENAME(buf_mdct);
INTFLOAT *temp = ac->AAC_RENAME(temp);
int i;
// imdct
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
for (i = 0; i < 8; i++)
ac->mdct120_fn(ac->mdct120, buf + i * 120, in + i * 128, sizeof(INTFLOAT));
} else {
ac->mdct960_fn(ac->mdct960, buf, in, sizeof(INTFLOAT));
}
/* window overlapping
* NOTE: To simplify the overlapping code, all 'meaningless' short to long
* and long to short transitions are considered to be short to short
* transitions. This leaves just two cases (long to long and short to short)
* with a little special sauce for EIGHT_SHORT_SEQUENCE.
*/
if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
(ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
ac->fdsp->vector_fmul_window( out, saved, buf, lwindow_prev, 480);
} else {
memcpy( out, saved, 420 * sizeof(*out));
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
ac->fdsp->vector_fmul_window(out + 420 + 0*120, saved + 420, buf + 0*120, swindow_prev, 60);
ac->fdsp->vector_fmul_window(out + 420 + 1*120, buf + 0*120 + 60, buf + 1*120, swindow, 60);
ac->fdsp->vector_fmul_window(out + 420 + 2*120, buf + 1*120 + 60, buf + 2*120, swindow, 60);
ac->fdsp->vector_fmul_window(out + 420 + 3*120, buf + 2*120 + 60, buf + 3*120, swindow, 60);
ac->fdsp->vector_fmul_window(temp, buf + 3*120 + 60, buf + 4*120, swindow, 60);
memcpy( out + 420 + 4*120, temp, 60 * sizeof(*out));
} else {
ac->fdsp->vector_fmul_window(out + 420, saved + 420, buf, swindow_prev, 60);
memcpy( out + 540, buf + 60, 420 * sizeof(*out));
}
}
// buffer update
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
memcpy( saved, temp + 60, 60 * sizeof(*saved));
ac->fdsp->vector_fmul_window(saved + 60, buf + 4*120 + 60, buf + 5*120, swindow, 60);
ac->fdsp->vector_fmul_window(saved + 180, buf + 5*120 + 60, buf + 6*120, swindow, 60);
ac->fdsp->vector_fmul_window(saved + 300, buf + 6*120 + 60, buf + 7*120, swindow, 60);
memcpy( saved + 420, buf + 7*120 + 60, 60 * sizeof(*saved));
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
memcpy( saved, buf + 480, 420 * sizeof(*saved));
memcpy( saved + 420, buf + 7*120 + 60, 60 * sizeof(*saved));
} else { // LONG_STOP or ONLY_LONG
memcpy( saved, buf + 480, 480 * sizeof(*saved));
}
}
static void AAC_RENAME(imdct_and_windowing_ld)(AACDecContext *ac, SingleChannelElement *sce)
{
IndividualChannelStream *ics = &sce->ics;
INTFLOAT *in = sce->AAC_RENAME(coeffs);
INTFLOAT *out = sce->AAC_RENAME(output);
INTFLOAT *saved = sce->AAC_RENAME(saved);
INTFLOAT *buf = ac->AAC_RENAME(buf_mdct);
// imdct
ac->mdct512_fn(ac->mdct512, buf, in, sizeof(INTFLOAT));
// window overlapping
if (ics->use_kb_window[1]) {
// AAC LD uses a low overlap sine window instead of a KBD window
memcpy(out, saved, 192 * sizeof(*out));
ac->fdsp->vector_fmul_window(out + 192, saved + 192, buf, AAC_RENAME2(sine_128), 64);
memcpy( out + 320, buf + 64, 192 * sizeof(*out));
} else {
ac->fdsp->vector_fmul_window(out, saved, buf, AAC_RENAME2(sine_512), 256);
}
// buffer update
memcpy(saved, buf + 256, 256 * sizeof(*saved));
}
static void AAC_RENAME(imdct_and_windowing_eld)(AACDecContext *ac, SingleChannelElement *sce)
{
UINTFLOAT *in = sce->AAC_RENAME(coeffs);
INTFLOAT *out = sce->AAC_RENAME(output);
INTFLOAT *saved = sce->AAC_RENAME(saved);
INTFLOAT *buf = ac->AAC_RENAME(buf_mdct);
int i;
const int n = ac->oc[1].m4ac.frame_length_short ? 480 : 512;
const int n2 = n >> 1;
const int n4 = n >> 2;
const INTFLOAT *const window = n == 480 ? AAC_RENAME(ff_aac_eld_window_480) :
AAC_RENAME(ff_aac_eld_window_512);
// Inverse transform, mapped to the conventional IMDCT by
// Chivukula, R.K.; Reznik, Y.A.; Devarajan, V.,
// "Efficient algorithms for MPEG-4 AAC-ELD, AAC-LD and AAC-LC filterbanks,"
// International Conference on Audio, Language and Image Processing, ICALIP 2008.
// URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4590245&isnumber=4589950
for (i = 0; i < n2; i+=2) {
INTFLOAT temp;
temp = in[i ]; in[i ] = -in[n - 1 - i]; in[n - 1 - i] = temp;
temp = -in[i + 1]; in[i + 1] = in[n - 2 - i]; in[n - 2 - i] = temp;
}
if (n == 480)
ac->mdct480_fn(ac->mdct480, buf, in, sizeof(INTFLOAT));
else
ac->mdct512_fn(ac->mdct512, buf, in, sizeof(INTFLOAT));
for (i = 0; i < n; i+=2) {
buf[i + 0] = -(UINTFLOAT)(USE_FIXED + 1)*buf[i + 0];
buf[i + 1] = (UINTFLOAT)(USE_FIXED + 1)*buf[i + 1];
}
// Like with the regular IMDCT at this point we still have the middle half
// of a transform but with even symmetry on the left and odd symmetry on
// the right
// window overlapping
// The spec says to use samples [0..511] but the reference decoder uses
// samples [128..639].
for (i = n4; i < n2; i ++) {
out[i - n4] = AAC_MUL31( buf[ n2 - 1 - i] , window[i - n4]) +
AAC_MUL31( saved[ i + n2] , window[i + n - n4]) +
AAC_MUL31(-saved[n + n2 - 1 - i] , window[i + 2*n - n4]) +
AAC_MUL31(-saved[ 2*n + n2 + i] , window[i + 3*n - n4]);
}
for (i = 0; i < n2; i ++) {
out[n4 + i] = AAC_MUL31( buf[ i] , window[i + n2 - n4]) +
AAC_MUL31(-saved[ n - 1 - i] , window[i + n2 + n - n4]) +
AAC_MUL31(-saved[ n + i] , window[i + n2 + 2*n - n4]) +
AAC_MUL31( saved[2*n + n - 1 - i] , window[i + n2 + 3*n - n4]);
}
for (i = 0; i < n4; i ++) {
out[n2 + n4 + i] = AAC_MUL31( buf[ i + n2] , window[i + n - n4]) +
AAC_MUL31(-saved[n2 - 1 - i] , window[i + 2*n - n4]) +
AAC_MUL31(-saved[n + n2 + i] , window[i + 3*n - n4]);
}
// buffer update
memmove(saved + n, saved, 2 * n * sizeof(*saved));
memcpy( saved, buf, n * sizeof(*saved));
}
static void AAC_RENAME(clip_output)(AACDecContext *ac, ChannelElement *che,
int type, int samples)
{
#if USE_FIXED
/* preparation for resampler */
for (int j = 0; j < samples; j++){
che->ch[0].output_fixed[j] = (int32_t)av_clip64((int64_t)che->ch[0].output_fixed[j]*128,
INT32_MIN, INT32_MAX-0x8000)+0x8000;
if (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1))
che->ch[1].output_fixed[j] = (int32_t)av_clip64((int64_t)che->ch[1].output_fixed[j]*128,
INT32_MIN, INT32_MAX-0x8000)+0x8000;
}
#endif
}
static inline void reset_all_predictors(PredictorState *ps)
{
int i;
for (i = 0; i < MAX_PREDICTORS; i++)
reset_predict_state(&ps[i]);
}
static inline void reset_predictor_group(PredictorState *ps, int group_num)
{
int i;
for (i = group_num - 1; i < MAX_PREDICTORS; i += 30)
reset_predict_state(&ps[i]);
}
/**
* Apply AAC-Main style frequency domain prediction.
*/
static void AAC_RENAME(apply_prediction)(AACDecContext *ac, SingleChannelElement *sce)
{
int sfb, k;
if (!sce->ics.predictor_initialized) {
reset_all_predictors(sce->AAC_RENAME(predictor_state));
sce->ics.predictor_initialized = 1;
}
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
for (sfb = 0;
sfb < ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index];
sfb++) {
for (k = sce->ics.swb_offset[sfb];
k < sce->ics.swb_offset[sfb + 1];
k++) {
predict(&sce->AAC_RENAME(predictor_state)[k],
&sce->AAC_RENAME(coeffs)[k],
sce->ics.predictor_present &&
sce->ics.prediction_used[sfb]);
}
}
if (sce->ics.predictor_reset_group)
reset_predictor_group(sce->AAC_RENAME(predictor_state),
sce->ics.predictor_reset_group);
} else
reset_all_predictors(sce->AAC_RENAME(predictor_state));
}
static av_cold void AAC_RENAME(aac_dsp_init)(AACDecDSP *aac_dsp)
{
#define SET(member) aac_dsp->member = AAC_RENAME(member)
SET(dequant_scalefactors);
SET(apply_mid_side_stereo);
SET(apply_intensity_stereo);
SET(apply_tns);
SET(apply_ltp);
SET(update_ltp);
SET(apply_prediction);
SET(imdct_and_windowing);
SET(imdct_and_windowing_768);
SET(imdct_and_windowing_960);
SET(imdct_and_windowing_ld);
SET(imdct_and_windowing_eld);
SET(apply_dependent_coupling);
SET(apply_independent_coupling);
SET(clip_output);
#undef SET
}
+105
View File
@@ -0,0 +1,105 @@
/*
* AAC decoder
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
*
* AAC LATM decoder
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* AAC decoder fixed-point implementation
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define USE_FIXED 1
#include "libavutil/thread.h"
#include "libavcodec/aac_defines.h"
#include "libavcodec/avcodec.h"
#include "aacdec.h"
#include "libavcodec/aactab.h"
#include "libavcodec/sinewin_fixed_tablegen.h"
#include "libavcodec/kbdwin.h"
#include "libavcodec/cbrt_data.h"
#include "libavcodec/aacsbr.h"
DECLARE_ALIGNED(32, static int, aac_kbd_long_1024_fixed)[1024];
DECLARE_ALIGNED(32, static int, aac_kbd_short_128_fixed)[128];
DECLARE_ALIGNED(32, static int, aac_kbd_long_960_fixed)[960];
DECLARE_ALIGNED(32, static int, aac_kbd_short_120_fixed)[120];
DECLARE_ALIGNED(32, static int, aac_kbd_long_768_fixed)[768];
DECLARE_ALIGNED(32, static int, aac_kbd_short_96_fixed)[96];
static void init_tables_fixed_fn(void)
{
ff_cbrt_tableinit_fixed();
ff_kbd_window_init_fixed(aac_kbd_long_1024_fixed, 4.0, 1024);
ff_kbd_window_init_fixed(aac_kbd_short_128_fixed, 6.0, 128);
ff_kbd_window_init_fixed(aac_kbd_long_960_fixed, 4.0, 960);
ff_kbd_window_init_fixed(aac_kbd_short_120_fixed, 6.0, 120);
ff_aac_sbr_init_fixed();
init_sine_windows_fixed();
}
static const int cce_scale_fixed[8] = {
Q30(1.0), //2^(0/8)
Q30(1.0905077327), //2^(1/8)
Q30(1.1892071150), //2^(2/8)
Q30(1.2968395547), //2^(3/8)
Q30(1.4142135624), //2^(4/8)
Q30(1.5422108254), //2^(5/8)
Q30(1.6817928305), //2^(6/8)
Q30(1.8340080864), //2^(7/8)
};
/** Dequantization-related */
#include "aacdec_fixed_dequant.h"
#include "aacdec_fixed_coupling.h"
#include "aacdec_fixed_prediction.h"
#include "aacdec_dsp_template.c"
#include "aacdec_proc_template.c"
av_cold int ff_aac_decode_init_fixed(AVCodecContext *avctx)
{
static AVOnce init_fixed_once = AV_ONCE_INIT;
AACDecContext *ac = avctx->priv_data;
ac->is_fixed = 1;
avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
aac_dsp_init_fixed(&ac->dsp);
aac_proc_init_fixed(&ac->proc);
ac->fdsp = avpriv_alloc_fixed_dsp(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!ac->fdsp)
return AVERROR(ENOMEM);
ff_thread_once(&init_fixed_once, init_tables_fixed_fn);
return ff_aac_decode_init(avctx);
}
+137
View File
@@ -0,0 +1,137 @@
/*
* AAC decoder
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
*
* AAC LATM decoder
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* AAC decoder fixed-point implementation
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AAC_AACDEC_FIXED_COUPLING_H
#define AVCODEC_AAC_AACDEC_FIXED_COUPLING_H
#include "aacdec.h"
/**
* Apply dependent channel coupling (applied before IMDCT).
*
* @param index index into coupling gain array
*/
static void AAC_RENAME(apply_dependent_coupling)(AACDecContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
IndividualChannelStream *ics = &cce->ch[0].ics;
const uint16_t *offsets = ics->swb_offset;
int *dest = target->coeffs_fixed;
const int *src = cce->ch[0].coeffs_fixed;
int g, i, group, k, idx = 0;
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
av_log(ac->avctx, AV_LOG_ERROR,
"Dependent coupling is not supported together with LTP\n");
return;
}
for (g = 0; g < ics->num_window_groups; g++) {
for (i = 0; i < ics->max_sfb; i++, idx++) {
if (cce->ch[0].band_type[idx] != ZERO_BT) {
const int gain = cce->coup.gain[index][idx];
int shift, round, c, tmp;
if (gain < 0) {
c = -cce_scale_fixed[-gain & 7];
shift = (-gain-1024) >> 3;
}
else {
c = cce_scale_fixed[gain & 7];
shift = (gain-1024) >> 3;
}
if (shift < -31) {
// Nothing to do
} else if (shift < 0) {
shift = -shift;
round = 1 << (shift - 1);
for (group = 0; group < ics->group_len[g]; group++) {
for (k = offsets[i]; k < offsets[i + 1]; k++) {
tmp = (int)(((int64_t)src[group * 128 + k] * c + \
(int64_t)0x1000000000) >> 37);
dest[group * 128 + k] += (tmp + (int64_t)round) >> shift;
}
}
}
else {
for (group = 0; group < ics->group_len[g]; group++) {
for (k = offsets[i]; k < offsets[i + 1]; k++) {
tmp = (int)(((int64_t)src[group * 128 + k] * c + \
(int64_t)0x1000000000) >> 37);
dest[group * 128 + k] += tmp * (1U << shift);
}
}
}
}
}
dest += ics->group_len[g] * 128;
src += ics->group_len[g] * 128;
}
}
/**
* Apply independent channel coupling (applied after IMDCT).
*
* @param index index into coupling gain array
*/
static void AAC_RENAME(apply_independent_coupling)(AACDecContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
int i, c, shift, round, tmp;
const int gain = cce->coup.gain[index][0];
const int *src = cce->ch[0].output_fixed;
unsigned int *dest = target->output_fixed;
const int len = 1024 << (ac->oc[1].m4ac.sbr == 1);
c = cce_scale_fixed[gain & 7];
shift = (gain-1024) >> 3;
if (shift < -31) {
return;
} else if (shift < 0) {
shift = -shift;
round = 1 << (shift - 1);
for (i = 0; i < len; i++) {
tmp = (int)(((int64_t)src[i] * c + (int64_t)0x1000000000) >> 37);
dest[i] += (tmp + round) >> shift;
}
}
else {
for (i = 0; i < len; i++) {
tmp = (int)(((int64_t)src[i] * c + (int64_t)0x1000000000) >> 37);
dest[i] += tmp * (1U << shift);
}
}
}
#endif /* AVCODEC_AAC_AACDEC_FIXED_COUPLING_H */
+174
View File
@@ -0,0 +1,174 @@
/*
* AAC decoder
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
*
* AAC LATM decoder
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* AAC decoder fixed-point implementation
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AAC_AACDEC_FIXED_DEQUANT_H
#define AVCODEC_AAC_AACDEC_FIXED_DEQUANT_H
#include "aacdec_tab.h"
static void inline vector_pow43(int *coefs, int len)
{
int i, coef;
for (i=0; i<len; i++) {
coef = coefs[i];
if (coef < 0)
coef = -(int)ff_cbrt_tab_fixed[(-coef) & 8191];
else
coef = (int)ff_cbrt_tab_fixed[ coef & 8191];
coefs[i] = coef;
}
}
/* 2^0, 2^0.25, 2^0.5, 2^0.75 */
static const int exp2tab[4] = {
Q31(1.0000000000/2), Q31(1.1892071150/2),
Q31(1.4142135624/2), Q31(1.6817928305/2)
};
static void inline subband_scale(int *dst, int *src, int scale,
int offset, int len, void *log_context)
{
int ssign = scale < 0 ? -1 : 1;
int s = FFABS(scale);
unsigned int round;
int i, out, c = exp2tab[s & 3];
s = offset - (s >> 2);
if (s > 31) {
for (i=0; i<len; i++) {
dst[i] = 0;
}
} else if (s > 0) {
round = 1 << (s-1);
for (i=0; i<len; i++) {
out = (int)(((int64_t)src[i] * c) >> 32);
dst[i] = ((int)(out+round) >> s) * ssign;
}
} else if (s > -32) {
s = s + 32;
round = 1U << (s-1);
for (i=0; i<len; i++) {
out = (int)((int64_t)((int64_t)src[i] * c + round) >> s);
dst[i] = out * (unsigned)ssign;
}
} else {
av_log(log_context, AV_LOG_ERROR, "Overflow in subband_scale()\n");
}
}
static void noise_scale(int *coefs, int scale, int band_energy, int len)
{
int s = -scale;
unsigned int round;
int i, out, c = exp2tab[s & 3];
int nlz = 0;
av_assert0(s >= 0);
while (band_energy > 0x7fff) {
band_energy >>= 1;
nlz++;
}
c /= band_energy;
s = 21 + nlz - (s >> 2);
if (s > 31) {
for (i=0; i<len; i++) {
coefs[i] = 0;
}
} else if (s >= 0) {
round = s ? 1 << (s-1) : 0;
for (i=0; i<len; i++) {
out = (int)(((int64_t)coefs[i] * c) >> 32);
coefs[i] = -((int)(out+round) >> s);
}
}
else {
s = s + 32;
if (s > 0) {
round = 1 << (s-1);
for (i=0; i<len; i++) {
out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);
coefs[i] = -out;
}
} else {
for (i=0; i<len; i++)
coefs[i] = -(int64_t)coefs[i] * c * (1 << -s);
}
}
}
static inline int *DEC_SPAIR(int *dst, unsigned idx)
{
dst[0] = (idx & 15) - 4;
dst[1] = (idx >> 4 & 15) - 4;
return dst + 2;
}
static inline int *DEC_SQUAD(int *dst, unsigned idx)
{
dst[0] = (idx & 3) - 1;
dst[1] = (idx >> 2 & 3) - 1;
dst[2] = (idx >> 4 & 3) - 1;
dst[3] = (idx >> 6 & 3) - 1;
return dst + 4;
}
static inline int *DEC_UPAIR(int *dst, unsigned idx, unsigned sign)
{
dst[0] = (idx & 15) * (1 - (sign & 0xFFFFFFFE));
dst[1] = (idx >> 4 & 15) * (1 - ((sign & 1) * 2));
return dst + 2;
}
static inline int *DEC_UQUAD(int *dst, unsigned idx, unsigned sign)
{
unsigned nz = idx >> 12;
dst[0] = (idx & 3) * (1 + (((int)sign >> 31) * 2));
sign <<= nz & 1;
nz >>= 1;
dst[1] = (idx >> 2 & 3) * (1 + (((int)sign >> 31) * 2));
sign <<= nz & 1;
nz >>= 1;
dst[2] = (idx >> 4 & 3) * (1 + (((int)sign >> 31) * 2));
sign <<= nz & 1;
nz >>= 1;
dst[3] = (idx >> 6 & 3) * (1 + (((int)sign >> 31) * 2));
return dst + 4;
}
#endif /* AVCODEC_AAC_AACDEC_FIXED_DEQUANT_H */
+151
View File
@@ -0,0 +1,151 @@
/*
* AAC decoder
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
*
* AAC LATM decoder
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* AAC decoder fixed-point implementation
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AAC_AACDEC_FIXED_PREDICTION_H
#define AVCODEC_AAC_AACDEC_FIXED_PREDICTION_H
static av_always_inline SoftFloat flt16_round(SoftFloat pf)
{
SoftFloat tmp;
int s;
tmp.exp = pf.exp;
s = pf.mant >> 31;
tmp.mant = (pf.mant ^ s) - s;
tmp.mant = (tmp.mant + 0x00200000U) & 0xFFC00000U;
tmp.mant = (tmp.mant ^ s) - s;
return tmp;
}
static av_always_inline SoftFloat flt16_even(SoftFloat pf)
{
SoftFloat tmp;
int s;
tmp.exp = pf.exp;
s = pf.mant >> 31;
tmp.mant = (pf.mant ^ s) - s;
tmp.mant = (tmp.mant + 0x001FFFFFU + (tmp.mant & 0x00400000U >> 16)) & 0xFFC00000U;
tmp.mant = (tmp.mant ^ s) - s;
return tmp;
}
static av_always_inline SoftFloat flt16_trunc(SoftFloat pf)
{
SoftFloat pun;
int s;
pun.exp = pf.exp;
s = pf.mant >> 31;
pun.mant = (pf.mant ^ s) - s;
pun.mant = pun.mant & 0xFFC00000U;
pun.mant = (pun.mant ^ s) - s;
return pun;
}
static av_always_inline void predict(PredictorState *ps, int *coef,
int output_enable)
{
const SoftFloat a = { 1023410176, 0 }; // 61.0 / 64
const SoftFloat alpha = { 973078528, 0 }; // 29.0 / 32
SoftFloat e0, e1;
SoftFloat pv;
SoftFloat k1, k2;
SoftFloat r0 = ps->r0, r1 = ps->r1;
SoftFloat cor0 = ps->cor0, cor1 = ps->cor1;
SoftFloat var0 = ps->var0, var1 = ps->var1;
SoftFloat tmp;
if (var0.exp > 1 || (var0.exp == 1 && var0.mant > 0x20000000)) {
k1 = av_mul_sf(cor0, flt16_even(av_div_sf(a, var0)));
}
else {
k1.mant = 0;
k1.exp = 0;
}
if (var1.exp > 1 || (var1.exp == 1 && var1.mant > 0x20000000)) {
k2 = av_mul_sf(cor1, flt16_even(av_div_sf(a, var1)));
}
else {
k2.mant = 0;
k2.exp = 0;
}
tmp = av_mul_sf(k1, r0);
pv = flt16_round(av_add_sf(tmp, av_mul_sf(k2, r1)));
if (output_enable) {
int shift = 28 - pv.exp;
if (shift < 31) {
if (shift > 0) {
*coef += (unsigned)((pv.mant + (1 << (shift - 1))) >> shift);
} else
*coef += (unsigned)pv.mant << -shift;
}
}
e0 = av_int2sf(*coef, 2);
e1 = av_sub_sf(e0, tmp);
ps->cor1 = flt16_trunc(av_add_sf(av_mul_sf(alpha, cor1), av_mul_sf(r1, e1)));
tmp = av_add_sf(av_mul_sf(r1, r1), av_mul_sf(e1, e1));
tmp.exp--;
ps->var1 = flt16_trunc(av_add_sf(av_mul_sf(alpha, var1), tmp));
ps->cor0 = flt16_trunc(av_add_sf(av_mul_sf(alpha, cor0), av_mul_sf(r0, e0)));
tmp = av_add_sf(av_mul_sf(r0, r0), av_mul_sf(e0, e0));
tmp.exp--;
ps->var0 = flt16_trunc(av_add_sf(av_mul_sf(alpha, var0), tmp));
ps->r1 = flt16_trunc(av_mul_sf(a, av_sub_sf(r0, av_mul_sf(k1, e0))));
ps->r0 = flt16_trunc(av_mul_sf(a, e0));
}
static av_always_inline void reset_predict_state(PredictorState *ps)
{
ps->r0.mant = 0;
ps->r0.exp = 0;
ps->r1.mant = 0;
ps->r1.exp = 0;
ps->cor0.mant = 0;
ps->cor0.exp = 0;
ps->cor1.mant = 0;
ps->cor1.exp = 0;
ps->var0.mant = 0x20000000;
ps->var0.exp = 1;
ps->var1.mant = 0x20000000;
ps->var1.exp = 1;
}
#endif /* AVCODEC_AAC_AACDEC_FIXED_PREDICTION_H */
+182
View File
@@ -0,0 +1,182 @@
/*
* AAC decoder
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
*
* AAC LATM decoder
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* AAC decoder fixed-point implementation
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define USE_FIXED 0
#include "libavutil/thread.h"
#include "libavcodec/aac_defines.h"
#include "libavcodec/avcodec.h"
#include "aacdec.h"
#include "libavcodec/aactab.h"
#include "libavcodec/sinewin.h"
#include "libavcodec/kbdwin.h"
#include "libavcodec/cbrt_data.h"
#include "libavutil/mathematics.h"
#include "libavcodec/aacsbr.h"
DECLARE_ALIGNED(32, static float, sine_96)[96];
DECLARE_ALIGNED(32, static float, sine_120)[120];
DECLARE_ALIGNED(32, static float, sine_768)[768];
DECLARE_ALIGNED(32, static float, sine_960)[960];
DECLARE_ALIGNED(32, static float, aac_kbd_long_960)[960];
DECLARE_ALIGNED(32, static float, aac_kbd_short_120)[120];
DECLARE_ALIGNED(32, static float, aac_kbd_long_768)[768];
DECLARE_ALIGNED(32, static float, aac_kbd_short_96)[96];
static void init_tables_float_fn(void)
{
ff_cbrt_tableinit();
ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
ff_kbd_window_init(aac_kbd_long_960, 4.0, 960);
ff_kbd_window_init(aac_kbd_short_120, 6.0, 120);
ff_sine_window_init(sine_960, 960);
ff_sine_window_init(sine_120, 120);
ff_init_ff_sine_windows(9);
ff_aac_sbr_init();
ff_aac_float_common_init();
}
static const float cce_scale[] = {
1.09050773266525765921, //2^(1/8)
1.18920711500272106672, //2^(1/4)
M_SQRT2,
2,
};
/** Dequantization-related **/
#include "aacdec_tab.h"
#include "libavutil/intfloat.h"
#include "config.h"
#if ARCH_ARM
#include "libavcodec/arm/aac.h"
#endif
#ifndef VMUL2
static inline float *VMUL2(float *dst, const float *v, unsigned idx,
const float *scale)
{
float s = *scale;
*dst++ = v[idx & 15] * s;
*dst++ = v[idx>>4 & 15] * s;
return dst;
}
#endif
#ifndef VMUL4
static inline float *VMUL4(float *dst, const float *v, unsigned idx,
const float *scale)
{
float s = *scale;
*dst++ = v[idx & 3] * s;
*dst++ = v[idx>>2 & 3] * s;
*dst++ = v[idx>>4 & 3] * s;
*dst++ = v[idx>>6 & 3] * s;
return dst;
}
#endif
#ifndef VMUL2S
static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
union av_intfloat32 s0, s1;
s0.f = s1.f = *scale;
s0.i ^= sign >> 1 << 31;
s1.i ^= sign << 31;
*dst++ = v[idx & 15] * s0.f;
*dst++ = v[idx>>4 & 15] * s1.f;
return dst;
}
#endif
#ifndef VMUL4S
static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
unsigned nz = idx >> 12;
union av_intfloat32 s = { .f = *scale };
union av_intfloat32 t;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx & 3] * t.f;
sign <<= nz & 1; nz >>= 1;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx>>2 & 3] * t.f;
sign <<= nz & 1; nz >>= 1;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx>>4 & 3] * t.f;
sign <<= nz & 1;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx>>6 & 3] * t.f;
return dst;
}
#endif
#include "aacdec_float_coupling.h"
#include "aacdec_float_prediction.h"
#include "aacdec_dsp_template.c"
#include "aacdec_proc_template.c"
av_cold int ff_aac_decode_init_float(AVCodecContext *avctx)
{
static AVOnce init_float_once = AV_ONCE_INIT;
AACDecContext *ac = avctx->priv_data;
ac->is_fixed = 0;
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
aac_dsp_init(&ac->dsp);
aac_proc_init(&ac->proc);
ac->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!ac->fdsp)
return AVERROR(ENOMEM);
ff_thread_once(&init_float_once, init_tables_float_fn);
return ff_aac_decode_init(avctx);
}
+90
View File
@@ -0,0 +1,90 @@
/*
* AAC decoder
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
*
* AAC LATM decoder
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* AAC decoder fixed-point implementation
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AAC_AACDEC_FLOAT_COUPLING_H
#define AVCODEC_AAC_AACDEC_FLOAT_COUPLING_H
#include "aacdec.h"
/**
* Apply dependent channel coupling (applied before IMDCT).
*
* @param index index into coupling gain array
*/
static void AAC_RENAME(apply_dependent_coupling)(AACDecContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
IndividualChannelStream *ics = &cce->ch[0].ics;
const uint16_t *offsets = ics->swb_offset;
float *dest = target->coeffs;
const float *src = cce->ch[0].coeffs;
int g, i, group, k, idx = 0;
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
av_log(ac->avctx, AV_LOG_ERROR,
"Dependent coupling is not supported together with LTP\n");
return;
}
for (g = 0; g < ics->num_window_groups; g++) {
for (i = 0; i < ics->max_sfb; i++, idx++) {
if (cce->ch[0].band_type[idx] != ZERO_BT) {
const float gain = cce->coup.gain[index][idx];
for (group = 0; group < ics->group_len[g]; group++) {
for (k = offsets[i]; k < offsets[i + 1]; k++) {
// FIXME: SIMDify
dest[group * 128 + k] += gain * src[group * 128 + k];
}
}
}
}
dest += ics->group_len[g] * 128;
src += ics->group_len[g] * 128;
}
}
/**
* Apply independent channel coupling (applied after IMDCT).
*
* @param index index into coupling gain array
*/
static void AAC_RENAME(apply_independent_coupling)(AACDecContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
const float gain = cce->coup.gain[index][0];
const float *src = cce->ch[0].output;
float *dest = target->output;
const int len = 1024 << (ac->oc[1].m4ac.sbr == 1);
ac->fdsp->vector_fmac_scalar(dest, src, gain, len);
}
#endif /* AVCODEC_AAC_AACDEC_FLOAT_COUPLING_H */
+100
View File
@@ -0,0 +1,100 @@
/*
* AAC decoder
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
*
* AAC LATM decoder
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* AAC decoder fixed-point implementation
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AAC_AACDEC_FLOAT_PREDICTION_H
#define AVCODEC_AAC_AACDEC_FLOAT_PREDICTION_H
static av_always_inline float flt16_round(float pf)
{
union av_intfloat32 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
return tmp.f;
}
static av_always_inline float flt16_even(float pf)
{
union av_intfloat32 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
return tmp.f;
}
static av_always_inline float flt16_trunc(float pf)
{
union av_intfloat32 pun;
pun.f = pf;
pun.i &= 0xFFFF0000U;
return pun.f;
}
static av_always_inline void predict(PredictorState *ps, float *coef,
int output_enable)
{
const float a = 0.953125; // 61.0 / 64
const float alpha = 0.90625; // 29.0 / 32
float e0, e1;
float pv;
float k1, k2;
float r0 = ps->r0, r1 = ps->r1;
float cor0 = ps->cor0, cor1 = ps->cor1;
float var0 = ps->var0, var1 = ps->var1;
k1 = var0 > 1 ? cor0 * flt16_even(a / var0) : 0;
k2 = var1 > 1 ? cor1 * flt16_even(a / var1) : 0;
pv = flt16_round(k1 * r0 + k2 * r1);
if (output_enable)
*coef += pv;
e0 = *coef;
e1 = e0 - k1 * r0;
ps->cor1 = flt16_trunc(alpha * cor1 + r1 * e1);
ps->var1 = flt16_trunc(alpha * var1 + 0.5f * (r1 * r1 + e1 * e1));
ps->cor0 = flt16_trunc(alpha * cor0 + r0 * e0);
ps->var0 = flt16_trunc(alpha * var0 + 0.5f * (r0 * r0 + e0 * e0));
ps->r1 = flt16_trunc(a * (r0 - k1 * e0));
ps->r0 = flt16_trunc(a * e0);
}
static av_always_inline void reset_predict_state(PredictorState *ps)
{
ps->r0 = 0.0f;
ps->r1 = 0.0f;
ps->cor0 = 0.0f;
ps->cor1 = 0.0f;
ps->var0 = 1.0f;
ps->var1 = 1.0f;
}
#endif /* AVCODEC_AAC_AACDEC_FLOAT_PREDICTION_H */
@@ -8,6 +8,10 @@
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* AAC decoder fixed-point implementation
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
@@ -25,239 +29,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC decoder
* @author Oded Shimon ( ods15 ods15 dyndns org )
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
*/
#define USE_FIXED 0
#define TX_TYPE AV_TX_FLOAT_MDCT
#include "libavutil/float_dsp.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "get_bits.h"
#include "kbdwin.h"
#include "sinewin.h"
#include "aac.h"
#include "aacdec.h"
#include "aactab.h"
#include "aacdectab.h"
#include "adts_header.h"
#include "cbrt_data.h"
#include "sbr.h"
#include "aacsbr.h"
#include "mpeg4audio.h"
#include "profiles.h"
#include "libavutil/intfloat.h"
#include <errno.h>
#include <math.h>
#include <stdint.h>
#include <string.h>
#if ARCH_ARM
# include "arm/aac.h"
#elif ARCH_MIPS
# include "mips/aacdec_mips.h"
#endif
DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(sine_120))[120];
DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(sine_960))[960];
DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(aac_kbd_long_960))[960];
DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(aac_kbd_short_120))[120];
static av_always_inline void reset_predict_state(PredictorState *ps)
{
ps->r0 = 0.0f;
ps->r1 = 0.0f;
ps->cor0 = 0.0f;
ps->cor1 = 0.0f;
ps->var0 = 1.0f;
ps->var1 = 1.0f;
}
#ifndef VMUL2
static inline float *VMUL2(float *dst, const float *v, unsigned idx,
const float *scale)
{
float s = *scale;
*dst++ = v[idx & 15] * s;
*dst++ = v[idx>>4 & 15] * s;
return dst;
}
#endif
#ifndef VMUL4
static inline float *VMUL4(float *dst, const float *v, unsigned idx,
const float *scale)
{
float s = *scale;
*dst++ = v[idx & 3] * s;
*dst++ = v[idx>>2 & 3] * s;
*dst++ = v[idx>>4 & 3] * s;
*dst++ = v[idx>>6 & 3] * s;
return dst;
}
#endif
#ifndef VMUL2S
static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
union av_intfloat32 s0, s1;
s0.f = s1.f = *scale;
s0.i ^= sign >> 1 << 31;
s1.i ^= sign << 31;
*dst++ = v[idx & 15] * s0.f;
*dst++ = v[idx>>4 & 15] * s1.f;
return dst;
}
#endif
#ifndef VMUL4S
static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
unsigned nz = idx >> 12;
union av_intfloat32 s = { .f = *scale };
union av_intfloat32 t;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx & 3] * t.f;
sign <<= nz & 1; nz >>= 1;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx>>2 & 3] * t.f;
sign <<= nz & 1; nz >>= 1;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx>>4 & 3] * t.f;
sign <<= nz & 1;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx>>6 & 3] * t.f;
return dst;
}
#endif
static av_always_inline float flt16_round(float pf)
{
union av_intfloat32 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
return tmp.f;
}
static av_always_inline float flt16_even(float pf)
{
union av_intfloat32 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
return tmp.f;
}
static av_always_inline float flt16_trunc(float pf)
{
union av_intfloat32 pun;
pun.f = pf;
pun.i &= 0xFFFF0000U;
return pun.f;
}
static av_always_inline void predict(PredictorState *ps, float *coef,
int output_enable)
{
const float a = 0.953125; // 61.0 / 64
const float alpha = 0.90625; // 29.0 / 32
float e0, e1;
float pv;
float k1, k2;
float r0 = ps->r0, r1 = ps->r1;
float cor0 = ps->cor0, cor1 = ps->cor1;
float var0 = ps->var0, var1 = ps->var1;
k1 = var0 > 1 ? cor0 * flt16_even(a / var0) : 0;
k2 = var1 > 1 ? cor1 * flt16_even(a / var1) : 0;
pv = flt16_round(k1 * r0 + k2 * r1);
if (output_enable)
*coef += pv;
e0 = *coef;
e1 = e0 - k1 * r0;
ps->cor1 = flt16_trunc(alpha * cor1 + r1 * e1);
ps->var1 = flt16_trunc(alpha * var1 + 0.5f * (r1 * r1 + e1 * e1));
ps->cor0 = flt16_trunc(alpha * cor0 + r0 * e0);
ps->var0 = flt16_trunc(alpha * var0 + 0.5f * (r0 * r0 + e0 * e0));
ps->r1 = flt16_trunc(a * (r0 - k1 * e0));
ps->r0 = flt16_trunc(a * e0);
}
/**
* Apply dependent channel coupling (applied before IMDCT).
*
* @param index index into coupling gain array
*/
static void apply_dependent_coupling(AACDecContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
IndividualChannelStream *ics = &cce->ch[0].ics;
const uint16_t *offsets = ics->swb_offset;
float *dest = target->coeffs;
const float *src = cce->ch[0].coeffs;
int g, i, group, k, idx = 0;
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
av_log(ac->avctx, AV_LOG_ERROR,
"Dependent coupling is not supported together with LTP\n");
return;
}
for (g = 0; g < ics->num_window_groups; g++) {
for (i = 0; i < ics->max_sfb; i++, idx++) {
if (cce->ch[0].band_type[idx] != ZERO_BT) {
const float gain = cce->coup.gain[index][idx];
for (group = 0; group < ics->group_len[g]; group++) {
for (k = offsets[i]; k < offsets[i + 1]; k++) {
// FIXME: SIMDify
dest[group * 128 + k] += gain * src[group * 128 + k];
}
}
}
}
dest += ics->group_len[g] * 128;
src += ics->group_len[g] * 128;
}
}
/**
* Apply independent channel coupling (applied after IMDCT).
*
* @param index index into coupling gain array
*/
static void apply_independent_coupling(AACDecContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
const float gain = cce->coup.gain[index][0];
const float *src = cce->ch[0].ret;
float *dest = target->ret;
const int len = 1024 << (ac->oc[1].m4ac.sbr == 1);
ac->fdsp->vector_fmac_scalar(dest, src, gain, len);
}
#include "aacdec_template.c"
#ifndef AVCODEC_AAC_AACDEC_LATM_H
#define AVCODEC_AAC_AACDEC_LATM_H
#define LOAS_SYNC_WORD 0x2b7 ///< 11 bits LOAS sync word
@@ -283,7 +56,8 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
{
AACDecContext *ac = &latmctx->aac_ctx;
AVCodecContext *avctx = ac->avctx;
MPEG4AudioConfig m4ac = { 0 };
OutputConfiguration oc = { 0 };
MPEG4AudioConfig *m4ac = &oc.m4ac;
GetBitContext gbc;
int config_start_bit = get_bits_count(gb);
int sync_extension = 0;
@@ -303,7 +77,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
if (get_bits_left(gb) <= 0)
return AVERROR_INVALIDDATA;
bits_consumed = decode_audio_specific_config_gb(NULL, avctx, &m4ac,
bits_consumed = decode_audio_specific_config_gb(NULL, avctx, &oc,
&gbc, config_start_bit,
sync_extension);
@@ -315,11 +89,12 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
asclen = bits_consumed;
if (!latmctx->initialized ||
ac->oc[1].m4ac.sample_rate != m4ac.sample_rate ||
ac->oc[1].m4ac.chan_config != m4ac.chan_config) {
ac->oc[1].m4ac.sample_rate != m4ac->sample_rate ||
ac->oc[1].m4ac.chan_config != m4ac->chan_config) {
if (latmctx->initialized) {
av_log(avctx, AV_LOG_INFO, "audio config changed (sample_rate=%d, chan_config=%d)\n", m4ac.sample_rate, m4ac.chan_config);
av_log(avctx, AV_LOG_INFO, "audio config changed (sample_rate=%d, chan_config=%d)\n",
m4ac->sample_rate, m4ac->chan_config);
} else {
av_log(avctx, AV_LOG_DEBUG, "initializing latmctx\n");
}
@@ -507,7 +282,7 @@ static int latm_decode_frame(AVCodecContext *avctx, AVFrame *out,
} else {
push_output_configuration(&latmctx->aac_ctx);
if ((err = decode_audio_specific_config(
&latmctx->aac_ctx, avctx, &latmctx->aac_ctx.oc[1].m4ac,
&latmctx->aac_ctx, avctx, &latmctx->aac_ctx.oc[1],
avctx->extradata, avctx->extradata_size*8LL, 1)) < 0) {
pop_output_configuration(&latmctx->aac_ctx);
return err;
@@ -542,7 +317,7 @@ static int latm_decode_frame(AVCodecContext *avctx, AVFrame *out,
static av_cold int latm_decode_init(AVCodecContext *avctx)
{
struct LATMContext *latmctx = avctx->priv_data;
int ret = aac_decode_init(avctx);
int ret = ff_aac_decode_init_float(avctx);
if (avctx->extradata_size > 0)
latmctx->initialized = !ret;
@@ -550,26 +325,6 @@ static av_cold int latm_decode_init(AVCodecContext *avctx)
return ret;
}
const FFCodec ff_aac_decoder = {
.p.name = "aac",
CODEC_LONG_NAME("AAC (Advanced Audio Coding)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(AACDecContext),
.init = aac_decode_init,
.close = aac_decode_close,
FF_CODEC_DECODE_CB(aac_decode_frame),
.p.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.ch_layouts = ff_aac_ch_layout,
.flush = flush,
.p.priv_class = &aac_decoder_class,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
};
/*
Note: This decoder filter is intended to decode LATM streams transferred
in MPEG transport streams which only contain one program.
@@ -582,7 +337,7 @@ const FFCodec ff_aac_latm_decoder = {
.p.id = AV_CODEC_ID_AAC_LATM,
.priv_data_size = sizeof(struct LATMContext),
.init = latm_decode_init,
.close = aac_decode_close,
.close = decode_close,
FF_CODEC_DECODE_CB(latm_decode_frame),
.p.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
@@ -593,3 +348,5 @@ const FFCodec ff_aac_latm_decoder = {
.flush = flush,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
};
#endif /* AVCODEC_AAC_AACDEC_LATM_H */
+198
View File
@@ -0,0 +1,198 @@
/*
* Copyright (c) 2024 Lynne <dev@lynne.ee>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "aacdec_lpd.h"
#include "aacdec_usac.h"
#include "libavcodec/unary.h"
const uint8_t ff_aac_lpd_mode_tab[32][4] = {
{ 0, 0, 0, 0 },
{ 1, 0, 0, 0 },
{ 0, 1, 0, 0 },
{ 1, 1, 0, 0 },
{ 0, 0, 1, 0 },
{ 1, 0, 1, 0 },
{ 0, 1, 1, 0 },
{ 1, 1, 1, 0 },
{ 0, 0, 0, 1 },
{ 1, 0, 0, 1 },
{ 0, 1, 0, 1 },
{ 1, 1, 0, 1 },
{ 0, 0, 1, 1 },
{ 1, 0, 1, 1 },
{ 0, 1, 1, 1 },
{ 1, 1, 1, 1 },
{ 2, 2, 0, 0 },
{ 2, 2, 1, 0 },
{ 2, 2, 0, 1 },
{ 2, 2, 1, 1 },
{ 0, 0, 2, 2 },
{ 1, 0, 2, 2 },
{ 0, 1, 2, 2 },
{ 1, 1, 2, 2 },
{ 2, 2, 2, 2 },
{ 3, 3, 3, 3 },
/* Larger values are reserved, but permit them for resilience */
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
};
static void parse_qn(GetBitContext *gb, int *qn, int nk_mode, int no_qn)
{
if (nk_mode == 1) {
for (int k = 0; k < no_qn; k++) {
qn[k] = get_unary(gb, 0, INT32_MAX); // TODO: find proper ranges
if (qn[k])
qn[k]++;
}
return;
}
for (int k = 0; k < no_qn; k++)
qn[k] = get_bits(gb, 2) + 2;
if (nk_mode == 2) {
for (int k = 0; k < no_qn; k++) {
if (qn[k] > 4) {
qn[k] = get_unary(gb, 0, INT32_MAX);;
if (qn[k])
qn[k] += 4;
}
}
return;
}
for (int k = 0; k < no_qn; k++) {
if (qn[k] > 4) {
int qn_ext = get_unary(gb, 0, INT32_MAX);;
switch (qn_ext) {
case 0: qn[k] = 5; break;
case 1: qn[k] = 6; break;
case 2: qn[k] = 0; break;
default: qn[k] = qn_ext + 4; break;
}
}
}
}
static int parse_codebook_idx(GetBitContext *gb, uint32_t *kv,
int nk_mode, int no_qn)
{
int n, nk;
int qn[2];
parse_qn(gb, qn, nk_mode, no_qn);
for (int k = 0; k < no_qn; k++) {
if (qn[k] > 4) {
nk = (qn[k] - 3) / 2;
n = qn[k] - nk*2;
} else {
nk = 0;
n = qn[k];
}
}
skip_bits(gb, 4*n);
if (nk > 0)
for (int i = 0; i < 8; i++)
kv[i] = get_bits(gb, nk);
return 0;
}
int ff_aac_parse_fac_data(AACUsacElemData *ce, GetBitContext *gb,
int use_gain, int len)
{
int ret;
if (use_gain)
ce->fac.gain = get_bits(gb, 7);
if (len/8 > 8)
return AVERROR_PATCHWELCOME;
for (int i = 0; i < len/8; i++) {
ret = parse_codebook_idx(gb, ce->fac.kv[i], 1, 1);
if (ret < 0)
return ret;
}
return 0;
}
int ff_aac_ldp_parse_channel_stream(AACDecContext *ac, AACUSACConfig *usac,
AACUsacElemData *ce, GetBitContext *gb)
{
int k;
const uint8_t *mod;
int first_ldp_flag;
ce->ldp.acelp_core_mode = get_bits(gb, 3);
ce->ldp.lpd_mode = get_bits(gb, 5);
ce->ldp.bpf_control_info = get_bits1(gb);
ce->ldp.core_mode_last = get_bits1(gb);
ce->ldp.fac_data_present = get_bits1(gb);
mod = ff_aac_lpd_mode_tab[ce->ldp.lpd_mode];
first_ldp_flag = !ce->ldp.core_mode_last;
if (first_ldp_flag)
ce->ldp.last_lpd_mode = -1; /* last_ldp_mode is a **STATEFUL** value */
k = 0;
while (k < 0) {
if (!k) {
if (ce->ldp.core_mode_last && ce->ldp.fac_data_present)
ff_aac_parse_fac_data(ce, gb, 0, usac->core_frame_len/8);
} else {
if (!ce->ldp.last_lpd_mode && mod[k] > 0 ||
ce->ldp.last_lpd_mode && !mod[k])
ff_aac_parse_fac_data(ce, gb, 0, usac->core_frame_len/8);
}
if (!mod[k]) {
// parse_acelp_coding();
ce->ldp.last_lpd_mode = 0;
k++;
} else {
// parse_tcx_coding();
ce->ldp.last_lpd_mode = mod[k];
k += (1 << (mod[k] - 1));
}
}
// parse_lpc_data(first_lpd_flag);
if (!ce->ldp.core_mode_last && ce->ldp.fac_data_present) {
uint16_t len_8 = usac->core_frame_len / 8;
uint16_t len_16 = usac->core_frame_len / 16;
uint16_t fac_len = get_bits1(gb) /* short_fac_flag */ ? len_8 : len_16;
int ret = ff_aac_parse_fac_data(ce, gb, 1, fac_len);
if (ret < 0)
return ret;
}
return 0;
}
+33
View File
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2024 Lynne <dev@lynne.ee>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AAC_AACDEC_LPD_H
#define AVCODEC_AAC_AACDEC_LPD_H
#include "aacdec.h"
#include "libavcodec/get_bits.h"
int ff_aac_parse_fac_data(AACUsacElemData *ce, GetBitContext *gb,
int use_gain, int len);
int ff_aac_ldp_parse_channel_stream(AACDecContext *ac, AACUSACConfig *usac,
AACUsacElemData *ce, GetBitContext *gb);
#endif /* AVCODEC_AAC_AACDEC_LPD_H */
+448
View File
@@ -0,0 +1,448 @@
/*
* AAC decoder
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
*
* AAC LATM decoder
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* AAC decoder fixed-point implementation
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* linear congruential pseudorandom number generator
*
* @param previous_val pointer to the current state of the generator
*
* @return Returns a 32-bit pseudorandom integer
*/
static av_always_inline int lcg_random(unsigned previous_val)
{
union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 };
return v.s;
}
/**
* Decode spectral data; reference: table 4.50.
* Dequantize and scale spectral data; reference: 4.6.3.3.
*
* @param coef array of dequantized, scaled spectral data
* @param sf array of scalefactors or intensity stereo positions
* @param pulse_present set if pulses are present
* @param pulse pointer to pulse data struct
* @param band_type array of the used band type
*
* @return Returns error status. 0 - OK, !0 - error
*/
static int AAC_RENAME(decode_spectrum_and_dequant)(AACDecContext *ac,
GetBitContext *gb,
const Pulse *pulse,
SingleChannelElement *sce)
{
int i, k, g, idx = 0;
INTFLOAT *coef = sce->AAC_RENAME(coeffs);
IndividualChannelStream *ics = &sce->ics;
const int c = 1024 / ics->num_windows;
const uint16_t *offsets = ics->swb_offset;
const INTFLOAT *sf = sce->AAC_RENAME(sf);
const enum BandType *band_type = sce->band_type;
INTFLOAT *coef_base = coef;
for (g = 0; g < ics->num_windows; g++)
memset(coef + g * 128 + offsets[ics->max_sfb], 0,
sizeof(INTFLOAT) * (c - offsets[ics->max_sfb]));
for (g = 0; g < ics->num_window_groups; g++) {
unsigned g_len = ics->group_len[g];
for (i = 0; i < ics->max_sfb; i++, idx++) {
const unsigned cbt_m1 = band_type[idx] - 1;
INTFLOAT *cfo = coef + offsets[i];
int off_len = offsets[i + 1] - offsets[i];
int group;
if (cbt_m1 >= INTENSITY_BT2 - 1) {
for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
memset(cfo, 0, off_len * sizeof(*cfo));
}
} else if (cbt_m1 == NOISE_BT - 1) {
for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
INTFLOAT band_energy;
#if USE_FIXED
for (k = 0; k < off_len; k++) {
ac->random_state = lcg_random(ac->random_state);
cfo[k] = ac->random_state >> 3;
}
band_energy = ac->fdsp->scalarproduct_fixed(cfo, cfo, off_len);
band_energy = fixed_sqrt(band_energy, 31);
noise_scale(cfo, sf[idx], band_energy, off_len);
#else
float scale;
for (k = 0; k < off_len; k++) {
ac->random_state = lcg_random(ac->random_state);
cfo[k] = ac->random_state;
}
band_energy = ac->fdsp->scalarproduct_float(cfo, cfo, off_len);
scale = sf[idx] / sqrtf(band_energy);
ac->fdsp->vector_fmul_scalar(cfo, cfo, scale, off_len);
#endif /* USE_FIXED */
}
} else {
#if !USE_FIXED
const float *vq = ff_aac_codebook_vector_vals[cbt_m1];
#endif /* !USE_FIXED */
const VLCElem *vlc_tab = ff_vlc_spectral[cbt_m1];
OPEN_READER(re, gb);
switch (cbt_m1 >> 1) {
case 0:
for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
INTFLOAT *cf = cfo;
int len = off_len;
do {
int code;
unsigned cb_idx;
UPDATE_CACHE(re, gb);
GET_VLC(code, re, gb, vlc_tab, 8, 2);
cb_idx = code;
#if USE_FIXED
cf = DEC_SQUAD(cf, cb_idx);
#else
cf = VMUL4(cf, vq, cb_idx, sf + idx);
#endif /* USE_FIXED */
} while (len -= 4);
}
break;
case 1:
for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
INTFLOAT *cf = cfo;
int len = off_len;
do {
int code;
unsigned nnz;
unsigned cb_idx;
uint32_t bits;
UPDATE_CACHE(re, gb);
GET_VLC(code, re, gb, vlc_tab, 8, 2);
cb_idx = code;
nnz = cb_idx >> 8 & 15;
bits = nnz ? GET_CACHE(re, gb) : 0;
LAST_SKIP_BITS(re, gb, nnz);
#if USE_FIXED
cf = DEC_UQUAD(cf, cb_idx, bits);
#else
cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx);
#endif /* USE_FIXED */
} while (len -= 4);
}
break;
case 2:
for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
INTFLOAT *cf = cfo;
int len = off_len;
do {
int code;
unsigned cb_idx;
UPDATE_CACHE(re, gb);
GET_VLC(code, re, gb, vlc_tab, 8, 2);
cb_idx = code;
#if USE_FIXED
cf = DEC_SPAIR(cf, cb_idx);
#else
cf = VMUL2(cf, vq, cb_idx, sf + idx);
#endif /* USE_FIXED */
} while (len -= 2);
}
break;
case 3:
case 4:
for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
INTFLOAT *cf = cfo;
int len = off_len;
do {
int code;
unsigned nnz;
unsigned cb_idx;
unsigned sign;
UPDATE_CACHE(re, gb);
GET_VLC(code, re, gb, vlc_tab, 8, 2);
cb_idx = code;
nnz = cb_idx >> 8 & 15;
sign = nnz ? SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0;
LAST_SKIP_BITS(re, gb, nnz);
#if USE_FIXED
cf = DEC_UPAIR(cf, cb_idx, sign);
#else
cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx);
#endif /* USE_FIXED */
} while (len -= 2);
}
break;
default:
for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
#if USE_FIXED
int *icf = cfo;
int v;
#else
float *cf = cfo;
uint32_t *icf = (uint32_t *) cf;
#endif /* USE_FIXED */
int len = off_len;
do {
int code;
unsigned nzt, nnz;
unsigned cb_idx;
uint32_t bits;
int j;
UPDATE_CACHE(re, gb);
GET_VLC(code, re, gb, vlc_tab, 8, 2);
cb_idx = code;
if (cb_idx == 0x0000) {
*icf++ = 0;
*icf++ = 0;
continue;
}
nnz = cb_idx >> 12;
nzt = cb_idx >> 8;
bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
LAST_SKIP_BITS(re, gb, nnz);
for (j = 0; j < 2; j++) {
if (nzt & 1<<j) {
uint32_t b;
int n;
/* The total length of escape_sequence must be < 22 bits according
to the specification (i.e. max is 111111110xxxxxxxxxxxx). */
UPDATE_CACHE(re, gb);
b = GET_CACHE(re, gb);
b = 31 - av_log2(~b);
if (b > 8) {
av_log(ac->avctx, AV_LOG_ERROR, "error in spectral data, ESC overflow\n");
return AVERROR_INVALIDDATA;
}
SKIP_BITS(re, gb, b + 1);
b += 4;
n = (1 << b) + SHOW_UBITS(re, gb, b);
LAST_SKIP_BITS(re, gb, b);
#if USE_FIXED
v = n;
if (bits & 1U<<31)
v = -v;
*icf++ = v;
#else
*icf++ = ff_cbrt_tab[n] | (bits & 1U<<31);
#endif /* USE_FIXED */
bits <<= 1;
} else {
#if USE_FIXED
v = cb_idx & 15;
if (bits & 1U<<31)
v = -v;
*icf++ = v;
#else
unsigned v = ((const uint32_t*)vq)[cb_idx & 15];
*icf++ = (bits & 1U<<31) | v;
#endif /* USE_FIXED */
bits <<= !!v;
}
cb_idx >>= 4;
}
} while (len -= 2);
#if !USE_FIXED
ac->fdsp->vector_fmul_scalar(cfo, cfo, sf[idx], off_len);
#endif /* !USE_FIXED */
}
}
CLOSE_READER(re, gb);
}
}
coef += g_len << 7;
}
if (pulse) {
idx = 0;
for (i = 0; i < pulse->num_pulse; i++) {
INTFLOAT co = coef_base[ pulse->pos[i] ];
while (offsets[idx + 1] <= pulse->pos[i])
idx++;
if (band_type[idx] != NOISE_BT && sf[idx]) {
INTFLOAT ico = -pulse->amp[i];
#if USE_FIXED
if (co) {
ico = co + (co > 0 ? -ico : ico);
}
coef_base[ pulse->pos[i] ] = ico;
#else
if (co) {
co /= sf[idx];
ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico);
}
coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico * sf[idx];
#endif /* USE_FIXED */
}
}
}
#if USE_FIXED
coef = coef_base;
idx = 0;
for (g = 0; g < ics->num_window_groups; g++) {
unsigned g_len = ics->group_len[g];
for (i = 0; i < ics->max_sfb; i++, idx++) {
const unsigned cbt_m1 = band_type[idx] - 1;
int *cfo = coef + offsets[i];
int off_len = offsets[i + 1] - offsets[i];
int group;
if (cbt_m1 < NOISE_BT - 1) {
for (group = 0; group < (int)g_len; group++, cfo+=128) {
vector_pow43(cfo, off_len);
subband_scale(cfo, cfo, sf[idx], 34, off_len, ac->avctx);
}
}
}
coef += g_len << 7;
}
#endif /* USE_FIXED */
return 0;
}
/**
* Decode coupling_channel_element; reference: table 4.8.
*
* @return Returns error status. 0 - OK, !0 - error
*/
static int AAC_RENAME(decode_cce)(AACDecContext *ac, GetBitContext *gb, ChannelElement *che)
{
int num_gain = 0;
int c, g, sfb, ret;
int sign;
INTFLOAT scale;
SingleChannelElement *sce = &che->ch[0];
ChannelCoupling *coup = &che->coup;
coup->coupling_point = 2 * get_bits1(gb);
coup->num_coupled = get_bits(gb, 3);
for (c = 0; c <= coup->num_coupled; c++) {
num_gain++;
coup->type[c] = get_bits1(gb) ? TYPE_CPE : TYPE_SCE;
coup->id_select[c] = get_bits(gb, 4);
if (coup->type[c] == TYPE_CPE) {
coup->ch_select[c] = get_bits(gb, 2);
if (coup->ch_select[c] == 3)
num_gain++;
} else
coup->ch_select[c] = 2;
}
coup->coupling_point += get_bits1(gb) || (coup->coupling_point >> 1);
sign = get_bits(gb, 1);
#if USE_FIXED
scale = get_bits(gb, 2);
#else
scale = cce_scale[get_bits(gb, 2)];
#endif
if ((ret = ff_aac_decode_ics(ac, sce, gb, 0, 0)))
return ret;
for (c = 0; c < num_gain; c++) {
int idx = 0;
int cge = 1;
int gain = 0;
INTFLOAT gain_cache = FIXR10(1.);
if (c) {
cge = coup->coupling_point == AFTER_IMDCT ? 1 : get_bits1(gb);
gain = cge ? get_vlc2(gb, ff_vlc_scalefactors, 7, 3) - 60: 0;
gain_cache = GET_GAIN(scale, gain);
#if USE_FIXED
if ((abs(gain_cache)-1024) >> 3 > 30)
return AVERROR(ERANGE);
#endif
}
if (coup->coupling_point == AFTER_IMDCT) {
coup->gain[c][0] = gain_cache;
} else {
for (g = 0; g < sce->ics.num_window_groups; g++) {
for (sfb = 0; sfb < sce->ics.max_sfb; sfb++, idx++) {
if (sce->band_type[idx] != ZERO_BT) {
if (!cge) {
int t = get_vlc2(gb, ff_vlc_scalefactors, 7, 3) - 60;
if (t) {
int s = 1;
t = gain += t;
if (sign) {
s -= 2 * (t & 0x1);
t >>= 1;
}
gain_cache = GET_GAIN(scale, t) * s;
#if USE_FIXED
if ((abs(gain_cache)-1024) >> 3 > 30)
return AVERROR(ERANGE);
#endif
}
}
coup->gain[c][idx] = gain_cache;
}
}
}
}
}
return 0;
}
static av_cold void AAC_RENAME(aac_proc_init)(AACDecProc *aac_proc)
{
#define SET(member) aac_proc->member = AAC_RENAME(member)
SET(decode_spectrum_and_dequant);
SET(decode_cce);
#undef SET
#define SET(member) aac_proc->member = AV_JOIN(ff_aac_, AAC_RENAME(member));
SET(sbr_ctx_alloc_init);
SET(sbr_decode_extension);
SET(sbr_apply);
SET(sbr_ctx_close);
#undef SET
}
@@ -25,11 +25,12 @@
* Common code and tables of the AAC fixed- and floating-point decoders
*/
#include "aac.h"
#include "aacdectab.h"
#include "aacps.h"
#include "aactab.h"
#include "vlc.h"
#include "aacdec_tab.h"
#include "libavcodec/aac.h"
#include "libavcodec/aacps.h"
#include "libavcodec/aactab.h"
#include "libavcodec/vlc.h"
#include "libavutil/attributes.h"
#include "libavutil/thread.h"
@@ -25,12 +25,12 @@
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
*/
#ifndef AVCODEC_AACDECTAB_H
#define AVCODEC_AACDECTAB_H
#ifndef AVCODEC_AAC_AACDEC_TAB_H
#define AVCODEC_AAC_AACDEC_TAB_H
#include <stdint.h>
#include "vlc.h"
#include "libavcodec/vlc.h"
#include "libavutil/attributes_internal.h"
#include "libavutil/channel_layout.h"
@@ -52,4 +52,4 @@ extern const int16_t ff_aac_channel_map[3][4][6];
extern const AVChannelLayout ff_aac_ch_layout[];
FF_VISIBILITY_POP_HIDDEN
#endif /* AVCODEC_AACDECTAB_H */
#endif /* AVCODEC_AAC_AACDEC_TAB_H */
File diff suppressed because it is too large Load Diff
+37
View File
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2024 Lynne <dev@lynne.ee>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AAC_AACDEC_USAC_H
#define AVCODEC_AAC_AACDEC_USAC_H
#include "aacdec.h"
#include "libavcodec/get_bits.h"
int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx,
GetBitContext *gb, OutputConfiguration *oc,
int channel_config);
int ff_aac_usac_reset_state(AACDecContext *ac, OutputConfiguration *oc);
int ff_aac_usac_decode_frame(AVCodecContext *avctx, AACDecContext *ac,
GetBitContext *gb, int *got_frame_ptr);
#endif /* AVCODEC_AAC_AACDEC_USAC_H */
+3 -4
View File
@@ -144,10 +144,9 @@ get_next:
#endif
} else {
#if CONFIG_AAC_PARSER
AACADTSHeaderInfo hdr, *phrd = &hdr;
int ret = avpriv_adts_header_parse(&phrd, buf, buf_size);
if (ret < 0)
AACADTSHeaderInfo hdr;
if (buf_size < AV_AAC_ADTS_HEADER_SIZE ||
ff_adts_header_parse_buf(buf, &hdr) < 0)
return i;
bit_rate = hdr.bit_rate;
-10
View File
@@ -28,16 +28,6 @@
#include "avcodec.h"
#include "parser.h"
typedef enum {
AAC_AC3_PARSE_ERROR_SYNC = -0x1030c0a,
AAC_AC3_PARSE_ERROR_BSID = -0x2030c0a,
AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a,
AAC_AC3_PARSE_ERROR_FRAME_SIZE = -0x4030c0a,
AAC_AC3_PARSE_ERROR_FRAME_TYPE = -0x5030c0a,
AAC_AC3_PARSE_ERROR_CRC = -0x6030c0a,
AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -0x7030c0a,
} AACAC3ParseError;
typedef struct AACAC3ParseContext {
ParseContext pc;
int header_size;

Some files were not shown because too many files have changed in this diff Show More