aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-06-02 14:02:52 +0200
committerAnton Khirnov <anton@khirnov.net>2024-06-11 17:39:35 +0200
commitfe171a3b51a1f20ff34159fe75ec44ed0c256348 (patch)
tree44c3fd6e2a7bd5ab145a70febf1473f8eb9fffce
parent6ee550d83d155225c3f57b49b22a992c9d4e59f8 (diff)
downloadffmpeg-fe171a3b51a1f20ff34159fe75ec44ed0c256348.tar.gz
lavc/hevcdec: move calling hwaccel decode_slice to decode_slice_data()
From decode_nal_unit(), as that is a more appropriate place for it.
-rw-r--r--libavcodec/hevc/hevcdec.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 0bf68ea45c..c148244361 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -2811,6 +2811,15 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext
}
}
+ if (s->avctx->hwaccel)
+ return FF_HW_CALL(s->avctx, decode_slice, nal->raw_data, nal->raw_size);
+
+ if (s->avctx->profile == AV_PROFILE_HEVC_SCC) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "SCC profile is not yet implemented in hevc native decoder.\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
s->local_ctx[0].first_qp_group = !s->sh.dependent_slice_segment_flag;
if (!pps->cu_qp_delta_enabled_flag)
@@ -3152,30 +3161,17 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
}
}
- if (s->avctx->hwaccel) {
- ret = FF_HW_CALL(s->avctx, decode_slice, nal->raw_data, nal->raw_size);
+ ctb_addr_ts = decode_slice_data(s, nal, &gb);
+ if (ctb_addr_ts >= s->cur_frame->ctb_count) {
+ ret = hevc_frame_end(s);
if (ret < 0)
goto fail;
- } else {
- if (s->avctx->profile == AV_PROFILE_HEVC_SCC) {
- av_log(s->avctx, AV_LOG_ERROR,
- "SCC profile is not yet implemented in hevc native decoder.\n");
- ret = AVERROR_PATCHWELCOME;
- goto fail;
- }
-
- ctb_addr_ts = decode_slice_data(s, nal, &gb);
- if (ctb_addr_ts >= s->cur_frame->ctb_count) {
- ret = hevc_frame_end(s);
- if (ret < 0)
- goto fail;
- s->is_decoded = 1;
- }
+ s->is_decoded = 1;
+ }
- if (ctb_addr_ts < 0) {
- ret = ctb_addr_ts;
- goto fail;
- }
+ if (ctb_addr_ts < 0) {
+ ret = ctb_addr_ts;
+ goto fail;
}
break;
case HEVC_NAL_EOS_NUT: