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

50328 Commits

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