From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 00A234803C for ; Fri, 7 Jun 2024 13:07:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3D64568D82E; Fri, 7 Jun 2024 16:04:19 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E7B9868D76F for ; Fri, 7 Jun 2024 16:03:50 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=Kh0hb95C; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id D0A3B4D76 for ; Fri, 7 Jun 2024 15:03:50 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id IcLn3_T2jUsg for ; Fri, 7 Jun 2024 15:03:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1717765422; bh=zXRNmjRmisussH92dLzqYKLX0QfbocptqStO8woikSY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Kh0hb95C2emLxOiqOvl+pio85hCsX7FsYqA3DxVRbjs6gufHtvEhBxymBWFH2SBl1 8lc7y/qPGv2d/I7PvjjuStFRmAhJUl4KeMN7YrzkcyAawx4JpCr0jVRuKw9cCB4DV+ TvQ0ReBGGQnzZJtoKcSzP/JwQ8Tneoy5UZ0CkrilzqPhlwwBJINqXAAvENWUyUk93y RH82DNxQv6vfhpwWxd78ypDWeHKhr5FkXncd5rt25z3dVfRL603zGDaxo8ftYkLCmw HVrL8ErXOQZF/woVfWeakWe4oBhmik2z/yLLBRNEd15PWz4NOKf5w5akIZSRm+z7uN nAlvZyH9HKPNg== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 7CBB44E05 for ; Fri, 7 Jun 2024 15:03:42 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id AB84F3A1A4F for ; Fri, 07 Jun 2024 15:03:35 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 7 Jun 2024 15:01:25 +0200 Message-ID: <20240607130135.9088-29-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240607130135.9088-1-anton@khirnov.net> References: <20240607130135.9088-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 29/39] lavc/hevcdec: move calling hwaccel decode_slice to decode_slice_data() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: >From decode_nal_unit(), as that is a more appropriate place for it. --- libavcodec/hevc/hevcdec.c | 38 +++++++++++++++++--------------------- 1 file 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; - } + s->is_decoded = 1; + } - 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; - } - - 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: -- 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".