From patchwork Wed Apr 10 13:31:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 47997 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c90a:b0:1a7:a0dc:8de5 with SMTP id gx10csp556577pzb; Wed, 10 Apr 2024 06:31:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVLB7a6tf9rju51If58Tvx07jAbnv4F1U3aMCpEXaxyBThVtZN0dap3iZc7/134AzIS7SvoJdEAaNzc2Mxo2cT+epaPU1OMPhlmhA== X-Google-Smtp-Source: AGHT+IGp6L1zryivriWZzVKmTyAW+Kks2uSNLy48JF4roKrFnwqAn0PQF+wr+ZjpX9trSSXWSV4W X-Received: by 2002:a50:bb23:0:b0:56d:f246:bfa4 with SMTP id y32-20020a50bb23000000b0056df246bfa4mr2119548ede.23.1712755897101; Wed, 10 Apr 2024 06:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712755897; cv=none; d=google.com; s=arc-20160816; b=MDvnTfDDmGpD1/R6OI46qMpVCF2KqqOun0Lfh5YQmAasQrFCvQ7ex46kN4NxEGFK4r o/9NxmZspT5YZzmYCAHmuYrGj5+42keTDAk2A9hY9/UJf87Makv934STGOm+dwt6NikZ p3xYEdafMkFQJyuNJDIqevnbBZ4NyIxclzBo0DQuoeajcijZSgAC5aa3E3hWx1xUEda2 8XJXbDtyirDYXZr2IszYzYGVPyPrIJB/TzjFygeIZ5tBK//HB6w40QyyUlBaU+KZtLP6 gqMdFtkXFBJjtGy/0gPnka4mxJLN9U3ejQQ3Kq2Lh677hhDZ+IVDXg1fSPulmyWMaXZp n3Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=QBCogHuRPcIUvNZbkD0YjF1C5VluJH3Z6v5Px7y3Z5s=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=m4xSGCxP9UR9I0Xal+/2QYmZb8qaVTu7SlpgrvnxvJntf+g7Wwz0TYhrNB2bJ+vgrT u4m9Kth4O5vF/jxHdrzOKavEkGBjtV4TBKR+0kU6D/TwSF+ybm3a+qREx+u6xvxJYVbb EWuXhOT9cKKtn5ZB/tyu+H6FFni2bIgA/zWP89dnZYT5BNFDixMa5j+bsw/AF4PVI4j6 sVPf1r5N3//FGdaQwaciAbQOR26xdB0XvzL9CqKutcAiQZPdX3Z701Lrr2Zqpj2gj70Y IKNHZm+Ulg3GfN+GSlMJeoLluHPTlrEAhut5uEK1a4b/FgR7pERbW+xmMQccVUi2/QPT kmIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=WIbtQPQR; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f17-20020a0564021e9100b0056e6601fc9asi2765096edf.469.2024.04.10.06.31.36; Wed, 10 Apr 2024 06:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=WIbtQPQR; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5178868D02A; Wed, 10 Apr 2024 16:31:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5582F68CB46 for ; Wed, 10 Apr 2024 16:31:27 +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=WIbtQPQR; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id AC8EF4D84 for ; Wed, 10 Apr 2024 15:31:25 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 8kRcOnyrKGud for ; Wed, 10 Apr 2024 15:31:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1712755884; bh=9QLbPoV8xCNZpk7N8WodennmaDCJfH3EYkCu6A1LNrg=; h=From:To:Subject:Date:From; b=WIbtQPQRE8R+ljrmvX5RS/swS5ej5m/jRzCIfBes4kWJM2Iqa8glOPQIC2+2VVNxy 1QDb0baxwk+HcstbKcQ3twyDRKerolD2/4tj97d15yrD0oPTfX1CiHp3nD/xnuAhXq 2W9UFD3z+HxQve1LLB8433VOlIdxebuCBdpQ2FFgGSqHhrB6jkz6+AyHlTGPUh9tYd ecBVHbq0N+z2gdaU0p8ZfQYF/MQcj0y0kERyHbcKcPV84dzaxNb639upn6TJylSRqU 3gC7DQbhs3i58Zs/SQFJYvrCKJqt3+HRUY4no7a8WB/sPqQ0KtmpPkeRfEW64qgKIH hTzfrWVJhFj5g== 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 AB6184D6E for ; Wed, 10 Apr 2024 15:31:24 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 83D723A0357 for ; Wed, 10 Apr 2024 15:31:24 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 10 Apr 2024 15:31:09 +0200 Message-ID: <20240410133118.28144-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/10] lavc/hevcdec: rename HEVCContext.HEVClcList to local_ctx 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: EOl6vnURdDch It is more consistent with our naming conventions. --- libavcodec/hevcdec.c | 30 +++++++++++++++--------------- libavcodec/hevcdec.h | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index d3b668af00..c70937a756 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2697,14 +2697,14 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) } for (i = 1; i < s->threads_number; i++) { - if (s->HEVClcList[i]) + if (s->local_ctx[i]) continue; - s->HEVClcList[i] = av_mallocz(sizeof(HEVCLocalContext)); - if (!s->HEVClcList[i]) + s->local_ctx[i] = av_mallocz(sizeof(HEVCLocalContext)); + if (!s->local_ctx[i]) return AVERROR(ENOMEM); - s->HEVClcList[i]->logctx = s->avctx; - s->HEVClcList[i]->parent = s; - s->HEVClcList[i]->common_cabac_state = &s->cabac; + s->local_ctx[i]->logctx = s->avctx; + s->local_ctx[i]->parent = s; + s->local_ctx[i]->common_cabac_state = &s->cabac; } offset = (lc->gb.index >> 3); @@ -2742,8 +2742,8 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) s->data = data; for (i = 1; i < s->threads_number; i++) { - s->HEVClcList[i]->first_qp_group = 1; - s->HEVClcList[i]->qp_y = s->HEVClc->qp_y; + s->local_ctx[i]->first_qp_group = 1; + s->local_ctx[i]->qp_y = s->HEVClc->qp_y; } atomic_store(&s->wpp_err, 0); @@ -2756,7 +2756,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) return AVERROR(ENOMEM); if (s->ps.pps->entropy_coding_sync_enabled_flag) - s->avctx->execute2(s->avctx, hls_decode_entry_wpp, s->HEVClcList, ret, s->sh.num_entry_point_offsets + 1); + s->avctx->execute2(s->avctx, hls_decode_entry_wpp, s->local_ctx, ret, s->sh.num_entry_point_offsets + 1); for (i = 0; i <= s->sh.num_entry_point_offsets; i++) res += ret[i]; @@ -3474,13 +3474,13 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) av_freep(&s->sh.offset); av_freep(&s->sh.size); - if (s->HEVClcList) { + if (s->local_ctx) { for (i = 1; i < s->threads_number; i++) { - av_freep(&s->HEVClcList[i]); + av_freep(&s->local_ctx[i]); } } av_freep(&s->HEVClc); - av_freep(&s->HEVClcList); + av_freep(&s->local_ctx); ff_h2645_packet_uninit(&s->pkt); @@ -3497,13 +3497,13 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) s->avctx = avctx; s->HEVClc = av_mallocz(sizeof(HEVCLocalContext)); - s->HEVClcList = av_mallocz(sizeof(HEVCLocalContext*) * s->threads_number); - if (!s->HEVClc || !s->HEVClcList) + s->local_ctx = av_mallocz(sizeof(HEVCLocalContext*) * s->threads_number); + if (!s->HEVClc || !s->local_ctx) return AVERROR(ENOMEM); s->HEVClc->parent = s; s->HEVClc->logctx = avctx; s->HEVClc->common_cabac_state = &s->cabac; - s->HEVClcList[0] = s->HEVClc; + s->local_ctx[0] = s->HEVClc; s->output_frame = av_frame_alloc(); if (!s->output_frame) diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index e65a6180ca..9e3e6a8cd7 100644 --- a/libavcodec/hevcdec.h +++ b/libavcodec/hevcdec.h @@ -441,7 +441,7 @@ typedef struct HEVCContext { const AVClass *c; // needed by private avoptions AVCodecContext *avctx; - HEVCLocalContext **HEVClcList; + HEVCLocalContext **local_ctx; HEVCLocalContext *HEVClc; uint8_t threads_type;