1
0

lavc/hevcdec: Update slice index before hwaccel decode slice

Otherwise, slice index will never update for hwaccel decode, and slice
RPL will be always overlap into first one which use slice index to construct.

Fixes hwaccel decoding after 47d34ba7fb

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
This commit is contained in:
Fei Wang 2024-06-24 14:23:31 +08:00 committed by Hendrik Leppkes
parent b6819ffc9c
commit 7f5c18281f
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5

View File

@ -2771,6 +2771,9 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext
const HEVCPPS *pps = s->pps;
int ret;
if (!s->sh.first_slice_in_pic_flag)
s->slice_idx += !s->sh.dependent_slice_segment_flag;
if (!s->sh.dependent_slice_segment_flag && s->sh.slice_type != HEVC_SLICE_I) {
ret = ff_hevc_slice_rpl(s);
if (ret < 0) {
@ -2808,8 +2811,6 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext
s->local_ctx[0].tu.cu_qp_offset_cb = 0;
s->local_ctx[0].tu.cu_qp_offset_cr = 0;
s->slice_idx += !s->sh.dependent_slice_segment_flag;
if (s->avctx->active_thread_type == FF_THREAD_SLICE &&
s->sh.num_entry_point_offsets > 0 &&
pps->num_tile_rows == 1 && pps->num_tile_columns == 1)