lavc/hevcdec: Put slice address checking after hwaccel decode slice

Slice address tab only been updated in software decode slice data.

Fixes hwaccel decoding after d725c737fe.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
This commit is contained in:
Fei Wang 2024-06-24 14:23:30 +08:00
parent 092ef4097c
commit e741cf665d

View File

@ -2765,15 +2765,6 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext
const HEVCPPS *pps = s->pps;
int ret;
if (s->sh.dependent_slice_segment_flag) {
int ctb_addr_ts = pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs];
int prev_rs = pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1];
if (s->tab_slice_address[prev_rs] != s->sh.slice_addr) {
av_log(s->avctx, AV_LOG_ERROR, "Previous slice segment missing\n");
return AVERROR_INVALIDDATA;
}
}
if (!s->sh.dependent_slice_segment_flag && s->sh.slice_type != HEVC_SLICE_I) {
ret = ff_hevc_slice_rpl(s);
if (ret < 0) {
@ -2794,6 +2785,15 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext
return AVERROR_PATCHWELCOME;
}
if (s->sh.dependent_slice_segment_flag) {
int ctb_addr_ts = pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs];
int prev_rs = pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1];
if (s->tab_slice_address[prev_rs] != s->sh.slice_addr) {
av_log(s->avctx, AV_LOG_ERROR, "Previous slice segment missing\n");
return AVERROR_INVALIDDATA;
}
}
s->local_ctx[0].first_qp_group = !s->sh.dependent_slice_segment_flag;
if (!pps->cu_qp_delta_enabled_flag)