Commit Graph

115630 Commits

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