1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-12 19:18:44 +02:00
Commit Graph

49452 Commits

Author SHA1 Message Date
Andreas Rheinhardt
72becd0627 avcodec/refstruct: Don't use STRIDE_ALIGN for alignment
It was always intended that the buffers returned by
RefStruct shall have the same alignment guarantees
as the buffers returned by av_malloc(); said alignment
depends upon the arch and the enabled instruction set
and the code used STRIDE_ALIGN as a proxy for this.

Yet since 7945d30e91
there is a better way to get av_malloc's alignment:
ALIGN_64 in mem_internal.h. So use this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:35:42 +01:00
Andreas Rheinhardt
d36cb46681 avcodec/libxeve: Use av_dict_iterate()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:34:26 +01:00
Andreas Rheinhardt
fbf1e51352 avcodec/libxevd: Fix "if (ret = ff_foo() < 0)" precedence problem
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:34:26 +01:00
Andreas Rheinhardt
0c92c8e6e3 avcodec/libxevd: Improve included headers a bit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:34:26 +01:00
Andreas Rheinhardt
ec0bd89297 avcodec/libxevd: Use CODEC_LONG_NAME()
Brings the length of the line down to less than 80 chars.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:34:26 +01:00
Andreas Rheinhardt
9209350f8d avcodec/libxevd: Remove useless AVClass
This decoder does not have options.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:34:26 +01:00
Andreas Rheinhardt
c4dceb8354 avcodec/libxevd: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:34:26 +01:00
Andreas Rheinhardt
cb9fb80c7f avcodec/libxevd: Deduplicate code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:34:26 +01:00
Andreas Rheinhardt
85fc5a0c3f avcodec/libxevd: Avoid cloning AVPacket
Cloning a packet whose source is going to be unreferenced
immediately afterwards is wasteful.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:34:26 +01:00
Andreas Rheinhardt
4e14a8e6be avcodec/libxevd: Set AV_CODEC_CAP_DR1
This decoder uses av_image_copy() to copy decoded images
to buffers obtained via ff_get_buffer(); ergo it can handle
user-provided buffers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:34:26 +01:00
Andreas Rheinhardt
bbeee3339f avcodec/libxevd: Remove FF_CODEC_CAP_SETS_PKT_DTS cap
This decoder implements the receive_frame API; such decoders
always have to set the pkt_dts field themselves and the avcodec
test checks for this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:34:19 +01:00
Andreas Rheinhardt
5a4702cba9 avcodec/Makefile: Add missing AV1 decoder->av1_parse.o dependency
Needed for ff_av1_framerate().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:33:03 +01:00
James Almer
194414f62d avcodec/av1dec: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
Fixes errors when opening streams with no extradata (like those from raw OBU
sources). It also calls get_format() on new Sequence Headers when required.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-29 14:48:00 -03:00
Andreas Rheinhardt
4a134eb14a avcodec/intrax8: Fix assert
Commit 900ce6f8c3 replaced
IntraX8Context.ac_vlc by IntraX8Context.ac_vlc_table,
but forgot to update an av_assert2()*.
cf7ed01938 then
replaced this with a check for j_ac_vlc[mode],
but this makes no sense as j_ac_vlc is of type
const VLCElem [2][2][8][].

Worse yet, mode can be up to three and then
j_ac_vlc[mode] is undefined behaviour. This happened
during the wmv8-x8intra FATE test.

*: Since 84f16bb5e6
config.h was no longer auto-included in avassert.h
and this disabled av_assert1() and av_assert2()
in files where config.h has not been included before
the inclusion of avassert.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-29 10:30:16 +01:00
Haihao Xiang
d263fce2b2 lavc/qsvenc: update the selection of bitrate control method
The default method is changed to CQP

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-02-29 13:36:41 +08:00
Fei Wang
57fbe929f3 avcodec/av1dec: Return error for unsupported tile list OBU
Otherwise decoding maybe successful but output result is incorrect.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-02-29 13:36:41 +08:00
Fei Wang
3f7e50f539 avcodec/av1dec: Move message of OBU info back to the beginning
So that can show OBU info even it doesn't have decomposed content. And
add OBU content status into the message.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-02-29 13:36:41 +08:00
J. Dekker
570052cd2a avcodec/aarch64/hevc: add luma deblock NEON
Benched using single-threaded full decode on an Ampere Altra.

Bpp Before  After  Speedup
8   73,3s   65,2s  1.124x
10  114,2s  104,0s 1.098x
12  125,8s  115,7s 1.087x

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-02-28 10:14:58 +01:00
Cosmin Stejerean
69dd1ce610 avcodec/libsvtav1: send the EOS signal without a one frame delay to allow for the library to operate in a low-delay mode
Co-authored-by: Amir Naghdinezhad <amir.naghdinezhad@intel.com>
Signed-off-by: Cosmin Stejerean <cosmin@cosmin.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-27 19:38:23 -03:00
Andreas Rheinhardt
0c204ce9f6 avcodec/dxvenc: Use proper alignment, write endian-independent output
Fixes the dxv3enc-dxt1 FATE test with UBSan and on big-endian
hardware.

Reviewed-by: James Almer <jamrial@gmail.com>
Tested-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-27 23:05:26 +01:00
sunyuechi
40911bc1a1 lavc/dnxhdenc: add ff_dnxhdenc_init
This is for clarity and use in testing, consistent with other parts of the code.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-02-27 20:32:37 +02:00
sunyuechi
a7ad76fbbf lavc/me_cmp: R-V V nsse
C908:
nsse_0_c: 1990.0
nsse_0_rvv_i32: 572.0
nsse_1_c: 910.0
nsse_1_rvv_i32: 456.0

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-02-27 20:31:30 +02:00
Andreas Rheinhardt
a6aa043baa avcodec/aac: Split ChannelElement in decoder and encoder structs
The AAC decoders share no common code with the AAC encoder,
so they are not restricted to using the same structures.
This implies that one can use different structs for each
component and remove elements not used by the decoders/
the encoder. This leads to quite sizeable savings:
sizeof(ChannelElement) for the encoder went down to 134432B
here from 547552B; for the decoder it went down to 512800B.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-27 00:11:21 +01:00
Andreas Rheinhardt
6c92347ab9 avcodec/sbr: Remove unused AACDecContext* parameter from sbr_lf_gen_mips
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-27 00:11:21 +01:00
Andreas Rheinhardt
80eca6ec99 avcodec/aacps: Inline ff_ps_ctx_init()
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-27 00:11:21 +01:00
Andreas Rheinhardt
1ecc906536 avcodec/aacdec: Rename AACContext to AACDecContext
It is decoder-only; furthermore, there is already
an AACContext in use by libfdk-aacenc.
Also make aacdec.h provide the typedef for AACContext;
up until now, this has been done by sbr.h.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-27 00:11:21 +01:00
Andreas Rheinhardt
1b048dd443 avcodec/aacsbr: Remove unused parameter from sbr_gain_calc
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-27 00:11:21 +01:00
Andreas Rheinhardt
a0fa6b6030 avocdec/aac: Move decoder-only stuff to new header aacdec.h
AACContext is not used by the encoder at all.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-27 00:11:21 +01:00
Andreas Rheinhardt
c6cf253c98 avcodec/aacdec_template: Don't use intermediate void*
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-27 00:11:21 +01:00
Ronald S. Bultje
d6083f503d avcodec/x86/hevc: fix luma 12b overflow
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-02-26 12:29:58 +01:00
Zhao Zhili
a3ca4beeaa avcodec/evc: Remove redefine of HEVC_MAX_ENTRY_POINT_OFFSETS
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-02-26 16:28:37 +08:00
Tong Wu
cfa802bdc3 avcodec/vaapi_encode: remove a duplicate av_freep
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-02-26 14:52:06 +08:00
Frank Plowman
8b6219a99d lavc/vvc: Read subpic ID when only one subpicture is present
Previously, the following syntax elements were not read in the case
sps_num_subpics_minus is 0:
* sps_subpic_id_len_minus1
* sps_subpic_id_mapping_explicitly_signalled_flag
* sps_subpic_id_mapping_present_flag
* sps_subpic_id[i]
This was causing failures to decode bitstreams, for example the DVB's
"VVC HDR UHDTV1 OpenGOP 3840x2160 50fps HLG10 PiP" V&V bitstream.

Patch fixes this by moving the reads for these syntax elements out a
scope.

Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-25 19:55:01 -03:00
Frank Plowman
53ab7ff67e lavc/vvc: Correct sps_num_subpics_minus1 minimum
The spec says "the value of sps_num_subpics_minus1 shall be in the
range of 0 to MaxSlicesPerAu − 1, inclusive."

Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-25 18:52:18 -03:00
Frank Plowman
248a1f9d00 lavc/vvc: Increase VVC_MAX_* definitions for level 6.3
Reported-by: James Almer <jamrial@gmail.com>
Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-25 18:30:34 -03:00
Andreas Rheinhardt
ab2173c0a5 avcodec/cbs_h2645: Avoid function pointer casts, fix UB
The SEI message read/write functions are called
via function pointers where the SEI message-specific
context is passed as void*. But the actual function
definitions use a pointer to their proper context
in place of void*, making the calls undefined behaviour.
Clang UBSan 17 warns about this.

This commit fixes this by adding wrapper functions
(created via macros) that have the right type that
call the actual functions. This reduced the number of failing
FATE tests with UBSan from 164 to 85 here.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-25 13:42:47 +01:00
sunyuechi
9b90d0d36a lavc/me_cmp: R-V V vsse vsad intra
C908:
vsad_4_c: 681.0
vsad_4_rvv_i32: 182.2
vsad_5_c: 278.0
vsad_5_rvv_i32: 145.2
vsse_4_c: 595.0
vsse_4_rvv_i32: 125.2
vsse_5_c: 281.0
vsse_5_rvv_i32: 101.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-02-25 11:05:25 +02:00
sunyuechi
925b55a5e8 lavc/me_cmp: R-V V vsse vsad
C908:
vsad_0_c: 936.0
vsad_0_rvv_i32: 236.2
vsad_1_c: 424.0
vsad_1_rvv_i32: 190.2
vsse_0_c: 877.0
vsse_0_rvv_i32: 204.2
vsse_1_c: 439.0
vsse_1_rvv_i32: 140.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-02-25 11:05:25 +02:00
Andreas Rheinhardt
484e7716bc avcodec/cbs_h266_syntax_template: Don't omit unused function parameter
The calls to the sei_decoded_picture_hash read and write functions
are performed with four pointer arguments; just because one
of them is unused by the callees does not mean that they
can be omitted: This is undefined behaviour.
(This was not recognized because the SEI_MESSAGE_RW macro
contains casts.)

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-25 02:19:18 +01:00
Wu Jianhua
6c83cd5cb3 avcodec/vvcdec: add Intra Block Copy decoder
Introduction at https://ieeexplore.ieee.org/document/9408666

passed files:
    10b444_A_Kwai_3.bit
    10b444_B_Kwai_3.bit
    CodingToolsSets_D_Tencent_2.bit
    IBC_A_Tencent_2.bit
    IBC_B_Tencent_2.bit
    IBC_C_Tencent_2.bit
    IBC_D_Tencent_2.bit
    IBC_E_Tencent_1.bit
    LOSSLESS_B_HHI_3.bit

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Nuo Mi <nuomi2021@gmail.com>
2024-02-24 20:24:56 +08:00
Wu Jianhua
9481887755 avcodec/vvcdec: add Intra Block Copy parser
Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
2024-02-24 20:24:56 +08:00
Nuo Mi
422e8a877b avcodec/vvcdec: refact, rename !is_mvp to check_mer
For IBC, we'll utilize the check_available function.
However, neither MVP nor merge mode need to check the motion estimation region.
Let's rename it to avoid confusion.
2024-02-24 20:24:56 +08:00
Nuo Mi
1ffeeb8a26 avcodec/vvcdec: fix dual tree for skipped transform tree/unit
fix IBC_E_Tencent_1.bit
2024-02-24 20:24:55 +08:00
Nuo Mi
c503c0b33e avcodec/vvcdec: ff_vvc_set_intra_mvf, refact to support dmvr tab 2024-02-24 20:24:55 +08:00
Nuo Mi
3241aa26d1 avcodec/vvcdec: skip inter prediction for IBC blocks
Intra Block Copy relies on reconstructed pixels from the current frame.
We skip IBC during the inter prediction stage and handle it during the reconstruction stage.
2024-02-24 20:24:55 +08:00
Wu Jianhua
09946dc40b avcodec/vvcdec: implement update_hmvp for IBC
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Nuo Mi <nuomi2021@gmail.com>
2024-02-24 20:24:55 +08:00
Nuo Mi
5a388d2cc6 avcodec/vvcdec: cabac, fix non_inter_flag, pred_mode_flag, amvr_shift for IBC 2024-02-24 20:24:55 +08:00
Nuo Mi
dd3650cada avcodec/vvcdec: deblock_bs, fix intra check for IBC
An Intra Block Copy clip may use different modes for luma and chroma.
For example, MODE_IBC for luma and MODE_INTRA for chroma.
We have to check luma and chroma CuPredMode (cpm) separately.
2024-02-24 20:24:55 +08:00
Nuo Mi
37ebebd055 avcodec/vvcdec: set CuPredMode table for chroma
follow the spec
2024-02-24 20:24:55 +08:00
Nuo Mi
ab2c9dfb26 avcodec/vvcdec: refact out deblock_bs to reduce duplicate code 2024-02-24 20:24:55 +08:00