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 551D948BD7 for ; Fri, 7 Jun 2024 13:08:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 36B0268D848; Fri, 7 Jun 2024 16:04:26 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AE6C068D782 for ; Fri, 7 Jun 2024 16:03:51 +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=JAPjoPcL; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 9A8F04D42 for ; Fri, 7 Jun 2024 15:03:51 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id bC2iiJCjmrcQ for ; Fri, 7 Jun 2024 15:03:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1717765422; bh=3cTQOCv2A8Of8Kd47Y0Vc84R25s1Qa+rXv9USyQz2n4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JAPjoPcLWbLUVS5AyrhCucds37Xfred1NO82sWO/ghO8hmFkkiiClqA7QB1+0jOEg whoGmpjvqOVajhw1GFxNf4THcjsJ2kLU5piFKtAZks9TsTdyXNOvMNdiF3h6B08wdI 1i+2IxYbb5I7YjutDwYmoVnaKz3tb0n4FmoJh9+/Uv3Yn1Yen20WyIt+4+ot8m5SuZ G1qjFtygKFrSbjbePH+eiYoIon7djN8wNeAFAHea4h0+hMm/aNT6Itr9yuDd1WW8Xr gXNiC7AI2Uoc23gNEypAwmr9Je//y4e+rg1LWdKGofySTOphefh2cKJBJZCHFw7Dpa ArCDCcGAxuoPw== 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 D9F384E11 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 DA8453A1E82 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:29 +0200 Message-ID: <20240607130135.9088-33-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 33/39] lavc/hevcdec: move setting slice_initialized out of hls_slice_header() 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: hls_slice_header() no longer modifies anything in HEVCContext besides SliceHeader. --- libavcodec/hevc/hevcdec.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index b13e3e06a3..2809e1e61d 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -589,9 +589,8 @@ fail: return ret; } -static int hls_slice_header(HEVCContext *s, GetBitContext *gb) +static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext *gb) { - SliceHeader *sh = &s->sh; const HEVCPPS *pps; const HEVCSPS *sps; unsigned pps_id; @@ -647,12 +646,9 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) } } else { sh->slice_segment_addr = sh->slice_addr = 0; - s->slice_initialized = 0; } if (!sh->dependent_slice_segment_flag) { - s->slice_initialized = 0; - for (i = 0; i < pps->num_extra_slice_header_bits; i++) skip_bits(gb, 1); // slice_reserved_undetermined_flag[] @@ -991,8 +987,6 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) return AVERROR_INVALIDDATA; } - s->slice_initialized = 1; - return 0; } @@ -2798,6 +2792,8 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext } } + s->slice_initialized = 1; + if (s->avctx->hwaccel) return FF_HW_CALL(s->avctx, decode_slice, nal->raw_data, nal->raw_size); @@ -3042,6 +3038,7 @@ fail: if (s->cur_frame) ff_hevc_unref_frame(s->cur_frame, ~0); s->cur_frame = s->collocated_ref = NULL; + s->slice_initialized = 0; return ret; } @@ -3131,7 +3128,7 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) case HEVC_NAL_RADL_R: case HEVC_NAL_RASL_N: case HEVC_NAL_RASL_R: - ret = hls_slice_header(s, &gb); + ret = hls_slice_header(&s->sh, s, &gb); if (ret < 0) return ret; if (ret == 1) { @@ -3139,7 +3136,6 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) goto fail; } - if ((s->avctx->skip_frame >= AVDISCARD_BIDIR && s->sh.slice_type == HEVC_SLICE_B) || (s->avctx->skip_frame >= AVDISCARD_NONINTRA && s->sh.slice_type != HEVC_SLICE_I) || (s->avctx->skip_frame >= AVDISCARD_NONKEY && !IS_IRAP(s)) || @@ -3211,6 +3207,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) s->last_eos = s->eos; s->eos = 0; s->overlap = 0; + s->slice_initialized = 0; /* split the input packet into NAL units, so we know the upper bound on the * number of slices in the frame */ -- 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".