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 52CE14B246 for ; Fri, 31 May 2024 17:50:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0BE9268D635; Fri, 31 May 2024 20:48:34 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 221B968D607 for ; Fri, 31 May 2024 20:48:20 +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=e5GcitCY; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 228004DDC for ; Fri, 31 May 2024 19:48:17 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id WbQmHN24dX2k for ; Fri, 31 May 2024 19:48:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1717177694; bh=9EHZ6Y7cOgmm+LLPBS+zI12l47pvAX1dRLjWQSSYe6o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e5GcitCY/z/TKxMWSANQg0jqv0NobmWYeo2jhCLMcm0kZouCNu9d2Qj2z9ZrxDI0I QyQ4U9OdOX2F+StJbvxpJokMHI77fK5oSPFr6XluOfi4UIC2/dBSHzP+7e4CMyTupg NMYSWu1oNwxbxJKHBawN6w062L7NvnhNj5wjoTTNJKGfOMy2TgrfnlioJhrqxNFtTU 0WuVWqwA3sdoLWkE+QhjTVxO7V7X0lwhikNkPsrOqhtbkxvOHPBooU6yDnKl4Ugw6L Bu9bF+QWX1B30+9nn5VSTRusXwFid8I2BgKh6CYBibAGfdu5DIWf2Z0oODU5MAYY5v hs9Ltr7Ae/hbg== 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 EA3964DEC for ; Fri, 31 May 2024 19:48:13 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id EC2DB3A3732 for ; Fri, 31 May 2024 19:48:06 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 31 May 2024 19:47:43 +0200 Message-ID: <20240531174804.17572-5-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240531174804.17572-1-anton@khirnov.net> References: <20240531174804.17572-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/11] lavc/hevcdec: drop HEVCContext.HEVClc 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: It is merely a pointer to local_ctx[0], which we can just as well use directly. --- libavcodec/hevcdec.c | 24 ++++++++++-------------- libavcodec/hevcdec.h | 2 -- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 0a9443505a..75d0ed613a 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -1036,14 +1036,14 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) return AVERROR_INVALIDDATA; } - s->HEVClc->first_qp_group = !s->sh.dependent_slice_segment_flag; + s->local_ctx[0].first_qp_group = !s->sh.dependent_slice_segment_flag; if (!s->ps.pps->cu_qp_delta_enabled_flag) - s->HEVClc->qp_y = s->sh.slice_qp; + s->local_ctx[0].qp_y = s->sh.slice_qp; s->slice_initialized = 1; - s->HEVClc->tu.cu_qp_offset_cb = 0; - s->HEVClc->tu.cu_qp_offset_cr = 0; + s->local_ctx[0].tu.cu_qp_offset_cb = 0; + s->local_ctx[0].tu.cu_qp_offset_cr = 0; return 0; } @@ -2534,7 +2534,7 @@ static void hls_decode_neighbour(HEVCLocalContext *lc, int x_ctb, int y_ctb, static int hls_decode_entry(HEVCContext *s, GetBitContext *gb) { - HEVCLocalContext *const lc = s->HEVClc; + HEVCLocalContext *const lc = &s->local_ctx[0]; const uint8_t *slice_data = gb->buffer + s->sh.data_offset; const size_t slice_size = gb->buffer_end - gb->buffer - s->sh.data_offset; int ctb_size = 1 << s->ps.sps->log2_ctb_size; @@ -2704,7 +2704,6 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) memcpy(tmp, s->local_ctx, sizeof(*s->local_ctx) * s->nb_local_ctx); av_free(s->local_ctx); s->local_ctx = tmp; - s->HEVClc = &s->local_ctx[0]; for (unsigned i = s->nb_local_ctx; i < s->threads_number; i++) { tmp = &s->local_ctx[i]; @@ -2757,7 +2756,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) for (i = 1; i < s->threads_number; i++) { s->local_ctx[i].first_qp_group = 1; - s->local_ctx[i].qp_y = s->HEVClc->qp_y; + s->local_ctx[i].qp_y = s->local_ctx[0].qp_y; } atomic_store(&s->wpp_err, 0); @@ -2868,7 +2867,6 @@ static int set_side_data(HEVCContext *s) static int hevc_frame_start(HEVCContext *s) { - HEVCLocalContext *lc = s->HEVClc; int pic_size_in_ctb = ((s->ps.sps->width >> s->ps.sps->log2_min_cb_size) + 1) * ((s->ps.sps->height >> s->ps.sps->log2_min_cb_size) + 1); int ret; @@ -2885,7 +2883,7 @@ static int hevc_frame_start(HEVCContext *s) s->no_rasl_output_flag = IS_IDR(s) || IS_BLA(s) || (s->nal_unit_type == HEVC_NAL_CRA_NUT && s->last_eos); if (s->ps.pps->tiles_enabled_flag) - lc->end_of_tiles_x = s->ps.pps->column_width[0] << s->ps.sps->log2_ctb_size; + s->local_ctx[0].end_of_tiles_x = s->ps.pps->column_width[0] << s->ps.sps->log2_ctb_size; ret = ff_hevc_set_new_ref(s, &s->frame, s->poc); if (ret < 0) @@ -3505,11 +3503,9 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) return AVERROR(ENOMEM); s->nb_local_ctx = 1; - s->HEVClc = &s->local_ctx[0]; - - s->HEVClc->parent = s; - s->HEVClc->logctx = avctx; - s->HEVClc->common_cabac_state = &s->cabac; + s->local_ctx[0].parent = s; + s->local_ctx[0].logctx = avctx; + s->local_ctx[0].common_cabac_state = &s->cabac; s->output_frame = av_frame_alloc(); if (!s->output_frame) diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index 0ed51a5392..6957cd1091 100644 --- a/libavcodec/hevcdec.h +++ b/libavcodec/hevcdec.h @@ -452,8 +452,6 @@ typedef struct HEVCContext { HEVCLocalContext *local_ctx; unsigned nb_local_ctx; - HEVCLocalContext *HEVClc; - uint8_t threads_type; uint8_t threads_number; -- 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".