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 4D8D44803C for ; Fri, 7 Jun 2024 13:08:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E6FDD68D841; Fri, 7 Jun 2024 16:04:24 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8F78568D7B3 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=cGbSMI8p; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 7986C4D76 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 AzOtRJtwHdap 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=nkhomVhzMfOqaIl57qMjt1QZ2bvZSSK4dF+uRSh56PQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cGbSMI8p43ioqMJDgatvhAPfm+9Po34O1JH39vVmwd/SGFUY/ULz0ugRAKc0EDWtI k8ub4kgWVziCS/7VBaZVUvBbJudAIHTELeVokLQ1Gx3YVQ7LHfNqT0xYA4eg4KexvG n8xjQYoBMqc1x4M8uxhl0Aac9xbhc/pcxyH5GkXdHS2DG273dJb9QBXPSpwiIxg9lA M2I4wAzdc32hr/sdPiMIp4U/c33aGsaYzoKg901MFb6NezAwpNbbB65WbHsL38aAOO Js7md6gIZ+fKod3qFw3wgUhSZyt4OWpTOxCI+9ld7hpiUROQn6+GEmBTbY34vE/g9S Fg8tbnUQnCXNw== 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 D3CDC4E0C 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 B72483A1A61 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:26 +0200 Message-ID: <20240607130135.9088-30-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 30/39] lavc/hevcdec: move constructing slice RPL 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: --- libavcodec/hevc/hevcdec.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index c148244361..804cceac3e 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -665,11 +665,9 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) if (!sh->dependent_slice_segment_flag) { sh->slice_addr = sh->slice_segment_addr; - s->slice_idx++; } } else { sh->slice_segment_addr = sh->slice_addr = 0; - s->slice_idx = 0; s->slice_initialized = 0; } @@ -2801,6 +2799,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext *gb) { 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]; @@ -2811,6 +2810,15 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext } } + if (!s->sh.dependent_slice_segment_flag && s->sh.slice_type != HEVC_SLICE_I) { + ret = ff_hevc_slice_rpl(s); + if (ret < 0) { + av_log(s->avctx, AV_LOG_WARNING, + "Error constructing the reference lists for the current slice.\n"); + return ret; + } + } + if (s->avctx->hwaccel) return FF_HW_CALL(s->avctx, decode_slice, nal->raw_data, nal->raw_size); @@ -2828,6 +2836,8 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext s->local_ctx[0].tu.cu_qp_offset_cb = 0; s->local_ctx[0].tu.cu_qp_offset_cr = 0; + s->slice_idx += !s->sh.dependent_slice_segment_flag; + if (s->avctx->active_thread_type == FF_THREAD_SLICE && s->sh.num_entry_point_offsets > 0 && pps->num_tile_rows == 1 && pps->num_tile_columns == 1) @@ -2938,6 +2948,7 @@ static int hevc_frame_start(HEVCContext *s) memset(s->tab_slice_address, -1, pic_size_in_ctb * sizeof(*s->tab_slice_address)); s->is_decoded = 0; + s->slice_idx = 0; s->first_nal_type = s->nal_unit_type; s->poc = s->sh.poc; @@ -3151,16 +3162,6 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) 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) { - av_log(s->avctx, AV_LOG_WARNING, - "Error constructing the reference lists for the current slice.\n"); - 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); -- 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".