Anton Khirnov
08ea7d6b8e
lavc/hevcdec: constify source frame in hevc_ref_frame()
7 months ago
Anton Khirnov
ccd391d6a3
lavc/hevcdec: do not unref current frame on frame_end() failure
...
It's a race with frame threading.
7 months ago
Anton Khirnov
d725c737fe
lavc/hevcdec: move some frame-end code to hevc_frame_end()
...
Specifically, calling hwaccel end_frame, verifying frame checksum,
and printing the frame-was-decoded message.
7 months ago
Anton Khirnov
edb6a471c4
lavc/hevcdec: factor decoding a slice NALU out of decode_nal_unit()
7 months ago
Anton Khirnov
90e75c4ec9
lavc/hevcdec: drop a redundant multiple-frame-per-packet check
7 months ago
Anton Khirnov
3cd6492fb5
lavc/hevcdec: move the check for multiple frames in a packet
...
Do not do it in hls_slice_header(), which is the wrong place for it.
Avoids special magic return value of 1 in that function. The comment
mentioning potential corrupted state is no longer relevant, as
hls_slice_header() modifies no state beyond SliceHeader, which will only
get used for a valid frame.
7 months ago
Anton Khirnov
a8f9d52c22
lavc/hevcdec: move setting slice_initialized out of hls_slice_header()
...
hls_slice_header() no longer modifies anything in HEVCContext besides
SliceHeader.
7 months ago
Anton Khirnov
82ded1ad3a
lavc/hevcdec: move sequence increment/IDR handling to hevc_frame_start()
...
From hls_slice_header(). It is only done once per frame, so that is a
more appropriate place for this code.
7 months ago
Anton Khirnov
a2e77caf37
lavc/hevcdec: set active PPS/SPS in hevc_frame_start()
...
Not in hls_slice_header(), as it should only be done once per frame.
7 months ago
Anton Khirnov
47d34ba7fb
lavc/hevcdec: move constructing slice RPL to decode_slice_data()
7 months ago
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.
7 months ago
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.
7 months ago
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().
7 months ago
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).
7 months ago
Anton Khirnov
7cce612a26
lavc/hevcdec: move a slice segment sanity check to hls_slice_header()
...
Combine it with an existing similar check.
7 months ago
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().
7 months ago
Anton Khirnov
e4e9e1da15
lavc/hevcdec: drop redundant HEVCContext.threads_{type,number}
...
They are useless duplicates of corresponding AVCodecContext fields.
7 months ago
Anton Khirnov
b0c29a45dc
lavc/hevc/cabac: do not infer WPP use based on HEVCContext.threads_number
...
Pass this information explicitly instead.
7 months ago
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.
7 months ago
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.
7 months ago
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().
7 months ago
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.
7 months ago
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.
7 months ago
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.
7 months ago
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.
7 months ago
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.
7 months ago
Anton Khirnov
8eb134f4f9
lavc/hevcdec: drop an always-zero variable
7 months ago
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.
7 months ago
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.
7 months ago
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.
7 months ago
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.
7 months ago
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.
7 months ago
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.
7 months ago
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.
7 months ago
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.
7 months ago
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()
7 months ago
Anton Khirnov
a82f2b0924
lavc/hevcdec: simplify condition
7 months ago
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.
7 months ago
Anton Khirnov
a13b892080
lavc/hevcdec: deduplicate calling hwaccel decode_params()
7 months ago
Anton Khirnov
e4601cc339
lavc/hevc*: move to hevc/ subdir
7 months ago
Anton Khirnov
ba56a300a9
lavc/hevcdec: drop HEVCContext.frame
...
It is merely a redundant pointer to cur_frame->f
7 months ago
Anton Khirnov
db84c1c6ef
lavc/hevcdec: rename HEVCFrame.frame to just f
...
This is shorter, loses no information, and is consistent with other
similar structs.
7 months ago
Anton Khirnov
9226514ced
lavc/hevcdec: rename HEVCContext.ref to cur_frame
...
Since it stores a pointer to the current frame.
7 months ago
Anton Khirnov
7ad9400952
lavc/hevcdec: drop HEVCContext.HEVClc
...
It is merely a pointer to local_ctx[0], which we can just as well use
directly.
7 months ago
Anton Khirnov
67ca18dd56
lavc/hevcdec: drop HEVCLocalContext.gb
...
In all HEVCLocalContext instances except the first one, the bitreader is
never used for actually reading bits, but merely for passing the buffer
to ff_init_cabac_decoder(), which is better done directly.
The instance that actually is used for bitreading gets moved to stack in
decode_nal_unit(), which makes its lifetime clearer.
7 months ago
Anton Khirnov
ac69e6caf6
lavc/hevcdec: include first row in SliceHeader.offset/size
...
Will be useful in the following commit.
7 months ago
Anton Khirnov
79c0310aca
lavc/hevcdec: drop a useless condition
...
hls_slice_data_wpp() is only called when num_entry_point_offsets>0
7 months ago
Anton Khirnov
74159cbfc3
lavc/hevcdec: move handling of byte alignment at the end of slice header
...
Do it in hls_slice_header() rather than cabac_init_decoder() - the
former is a more logical place as according the spec the byte alignment
is a part of the slice header, not slice data. Avoids a second instance
of alignment handling in vaapi_hevc.
Also, check that alignment_bit_equal_to_one is, in fact, equal to one.
7 months ago
Anton Khirnov
6fed1841a1
lavc/hevc_ps/HEVCSPS: change flags into uint8_t
...
Reduces sizeof(HEVCSPS) by 64 bytes.
Also improve flag names: drop redundant suffixes and prefixes, and
consistently use disabled/enabled.
7 months ago
Anton Khirnov
bd1a06dc43
lavc/hevc_ps: reduce the size of used_by_curr_pic_lt_sps_flag
...
It is currently an array of 32 uint8_t, each storing a single flag. A
single uint32_t is sufficient.
7 months ago