From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 10/11] lavc/hevcdec: deduplicate calling hwaccel decode_params()
Date: Fri, 31 May 2024 19:47:48 +0200
Message-ID: <20240531174804.17572-10-anton@khirnov.net> (raw)
In-Reply-To: <20240531174804.17572-1-anton@khirnov.net>
---
libavcodec/hevc/hevcdec.c | 36 ++++++++++++------------------------
1 file changed, 12 insertions(+), 24 deletions(-)
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 4a07fa6612..4e0df4d033 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -2985,49 +2985,37 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
s->nal_unit_type = nal->type;
s->temporal_id = nal->temporal_id;
+ if (FF_HW_HAS_CB(s->avctx, decode_params) &&
+ (s->nal_unit_type == HEVC_NAL_VPS ||
+ s->nal_unit_type == HEVC_NAL_SPS ||
+ s->nal_unit_type == HEVC_NAL_PPS ||
+ s->nal_unit_type == HEVC_NAL_SEI_PREFIX ||
+ s->nal_unit_type == HEVC_NAL_SEI_SUFFIX)) {
+ ret = FF_HW_CALL(s->avctx, decode_params,
+ nal->type, nal->raw_data, nal->raw_size);
+ if (ret < 0)
+ goto fail;
+ }
+
switch (s->nal_unit_type) {
case HEVC_NAL_VPS:
- if (FF_HW_HAS_CB(s->avctx, decode_params)) {
- ret = FF_HW_CALL(s->avctx, decode_params,
- nal->type, nal->raw_data, nal->raw_size);
- if (ret < 0)
- goto fail;
- }
ret = ff_hevc_decode_nal_vps(&gb, s->avctx, &s->ps);
if (ret < 0)
goto fail;
break;
case HEVC_NAL_SPS:
- if (FF_HW_HAS_CB(s->avctx, decode_params)) {
- ret = FF_HW_CALL(s->avctx, decode_params,
- nal->type, nal->raw_data, nal->raw_size);
- if (ret < 0)
- goto fail;
- }
ret = ff_hevc_decode_nal_sps(&gb, s->avctx, &s->ps,
s->apply_defdispwin);
if (ret < 0)
goto fail;
break;
case HEVC_NAL_PPS:
- if (FF_HW_HAS_CB(s->avctx, decode_params)) {
- ret = FF_HW_CALL(s->avctx, decode_params,
- nal->type, nal->raw_data, nal->raw_size);
- if (ret < 0)
- goto fail;
- }
ret = ff_hevc_decode_nal_pps(&gb, s->avctx, &s->ps);
if (ret < 0)
goto fail;
break;
case HEVC_NAL_SEI_PREFIX:
case HEVC_NAL_SEI_SUFFIX:
- if (FF_HW_HAS_CB(s->avctx, decode_params)) {
- ret = FF_HW_CALL(s->avctx, decode_params,
- nal->type, nal->raw_data, nal->raw_size);
- if (ret < 0)
- goto fail;
- }
ret = ff_hevc_decode_nal_sei(&gb, s->avctx, &s->sei, &s->ps, s->nal_unit_type);
if (ret < 0)
goto fail;
--
2.43.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-05-31 17:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-31 17:47 [FFmpeg-devel] [PATCH 01/11] lavc/hevcdec: move handling of byte alignment at the end of slice header Anton Khirnov
2024-05-31 17:47 ` [FFmpeg-devel] [PATCH 02/11] lavc/hevcdec: drop a useless condition Anton Khirnov
2024-05-31 17:47 ` [FFmpeg-devel] [PATCH 03/11] lavc/hevcdec: include first row in SliceHeader.offset/size Anton Khirnov
2024-05-31 17:47 ` [FFmpeg-devel] [PATCH 04/11] lavc/hevcdec: drop HEVCLocalContext.gb Anton Khirnov
2024-05-31 17:47 ` [FFmpeg-devel] [PATCH 05/11] lavc/hevcdec: drop HEVCContext.HEVClc Anton Khirnov
2024-05-31 17:47 ` [FFmpeg-devel] [PATCH 06/11] lavc/hevcdec: rename HEVCContext.ref to cur_frame Anton Khirnov
2024-05-31 17:47 ` [FFmpeg-devel] [PATCH 07/11] lavc/hevcdec: rename HEVCFrame.frame to just f Anton Khirnov
2024-05-31 17:47 ` [FFmpeg-devel] [PATCH 08/11] lavc/hevcdec: drop HEVCContext.frame Anton Khirnov
2024-05-31 17:47 ` [FFmpeg-devel] [PATCH 09/11] lavc/hevc*: move to hevc/ subdir Anton Khirnov
2024-06-02 0:39 ` James Almer
2024-06-02 6:50 ` Anton Khirnov
2024-05-31 17:47 ` Anton Khirnov [this message]
2024-05-31 17:47 ` [FFmpeg-devel] [PATCH 11/11] lavc/hevcdec: drop unused HEVCContext.width/height Anton Khirnov
2024-05-31 19:11 ` Vittorio Giovara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240531174804.17572-10-anton@khirnov.net \
--to=anton@khirnov.net \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git