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 0ACF142B04 for ; Tue, 11 Jan 2022 20:49:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D0FA068AF85; Tue, 11 Jan 2022 22:47:42 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5F8A468AE87 for ; Tue, 11 Jan 2022 22:47:34 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id E8C6324017C for ; Tue, 11 Jan 2022 21:47:33 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 6B7zhhHyw_NX for ; Tue, 11 Jan 2022 21:47:33 +0100 (CET) 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 mail0.khirnov.net (Postfix) with ESMTPS id 3E8CC24062A for ; Tue, 11 Jan 2022 21:47:26 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 334E23A0BE6; Tue, 11 Jan 2022 21:47:25 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 11 Jan 2022 21:45:53 +0100 Message-Id: <20220111204610.14262-18-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220111204610.14262-1-anton@khirnov.net> References: <20220111204610.14262-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 18/35] lavc/libvpxenc: remove unneeded context variable 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: discard_hdr10_plus is 0 IFF hdr10_plus_fifo is non-NULL, so we can test for the latter and avoid an extra variable. --- libavcodec/libvpxenc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 55f587c490..6bb19289ff 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -127,7 +127,6 @@ typedef struct VPxEncoderContext { int tune_content; int corpus_complexity; int tpl_model; - int discard_hdr10_plus; AVFifoBuffer *hdr10_plus_fifo; /** * If the driver does not support ROI then warn the first time we @@ -899,7 +898,6 @@ static av_cold int vpx_init(AVCodecContext *avctx, #endif AVDictionaryEntry* en = NULL; - ctx->discard_hdr10_plus = 1; av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str()); av_log(avctx, AV_LOG_VERBOSE, "%s\n", vpx_codec_build_config()); @@ -919,7 +917,6 @@ static av_cold int vpx_init(AVCodecContext *avctx, // Keep HDR10+ if it has bit depth higher than 8 and // it has PQ trc (SMPTE2084). if (enccfg.g_bit_depth > 8 && avctx->color_trc == AVCOL_TRC_SMPTE2084) { - ctx->discard_hdr10_plus = 0; ctx->hdr10_plus_fifo = av_fifo_alloc2(1, sizeof(FrameHDR10Plus), AV_FIFO_FLAG_AUTO_GROW); if (!ctx->hdr10_plus_fifo) @@ -1289,7 +1286,7 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, } if (cx_frame->frame_number != -1) { VPxContext *ctx = avctx->priv_data; - if (!ctx->discard_hdr10_plus) { + if (ctx->hdr10_plus_fifo) { int err = copy_hdr10_plus_to_pkt(ctx->hdr10_plus_fifo, pkt); if (err < 0) return err; @@ -1704,7 +1701,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt, } } - if (!ctx->discard_hdr10_plus) { + if (ctx->hdr10_plus_fifo) { AVFrameSideData *hdr10_plus_metadata; // Add HDR10+ metadata to queue. hdr10_plus_metadata = av_frame_get_side_data(frame, AV_FRAME_DATA_DYNAMIC_HDR_PLUS); -- 2.33.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".