1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

115707 Commits

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