Commit Graph

115113 Commits

Author SHA1 Message Date
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