From patchwork Sun Nov 27 17:03:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 39536 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a05:6a11:561f:b0:33d:fc04:f431 with SMTP id rr31csp8295610pxb; Sun, 27 Nov 2022 09:09:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ghi2PjKTkpeLUweixSXdc++kS+sbWzGJ5TdWkDdvfPEkDBHXkBt5Z0xqbMbQCNln8UBZA X-Received: by 2002:aa7:db91:0:b0:458:bd09:1b20 with SMTP id u17-20020aa7db91000000b00458bd091b20mr44939835edt.176.1669568966881; Sun, 27 Nov 2022 09:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669568966; cv=none; d=google.com; s=arc-20160816; b=pprdHt2M9FRIGnIf8Y/ffKVdAZz2WqehyZMQ9b2Pc/jKxOKr7eeDlemOjxduSUgIV7 COB5HIWslcrt2+G/iAn9EhJy+pW0bPp8/5I0t/H7urd7SUnV8JHZF8NETRHmDaQQv0u7 AFHQ8Q9oSlk/n9kN3cleUBYnRcQzZYZllW3DQtt1T4EPjCxJObZAFY/nq5IEjKCvW3n6 5TkbNxqbiRPpWGJFKjwjzlbkOZf7xTygc2IqYLuiQ67j18iyKyCCF6WAnENyw6SIcwVs APw0aNbnBlbWZUk3bzuUsVQFKULmSC07mGZIPLTfY7DhOzVx909l4scCaaatsgow29rm ERqQ== 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:references:in-reply-to:message-id :date:to:from:delivered-to; bh=FGvGeQeTs/CrkRxE0wjNsI8zNZNHWKm3De5HW1iHFsw=; b=W5m+cnCXsSbw4NpQh8TKpERa01JY79U1JwUqvWc8T3nEvtQ74gaJ875Trmf5eZH/kf xoXrcPHvLCVJzjsMLEKMYgh1K7pzKiSTydEiO8KRKFzh+ueWWa6L+l7rdQzOrhkPHiA5 +Z3uCsmaMkJUsCzAgPAbTtsKFd6ajywHaq+fHSRyTIWCPWC/3S+ZixQOyBbNciflc/NU JHEb+Era9D0QxvCjYhusxLS90TdziWr4qowEhDwawYGe1wJoKXXFuUV6rD/+1KJjqO4s 9uqOXmINHKgA8Ul1s/yUfwxXVqYi8WTbIKPeb93qvNXq1y1jm5CfyTNF6rW9ieLGIlDt vFvA== ARC-Authentication-Results: i=1; mx.google.com; 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 z10-20020a50eb4a000000b004676b9092e0si7708841edp.408.2022.11.27.09.09.25; Sun, 27 Nov 2022 09:09:26 -0800 (PST) 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; 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 8E8FC68BC64; Sun, 27 Nov 2022 19:06:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 076C468BA30 for ; Sun, 27 Nov 2022 19:05:59 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 677D52406CB for ; Sun, 27 Nov 2022 18:05:57 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 3N0M-ctPy0fZ for ; Sun, 27 Nov 2022 18:05:56 +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 CC3E82406D0 for ; Sun, 27 Nov 2022 18:05:51 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 448DB3A25C2 for ; Sun, 27 Nov 2022 18:05:46 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 27 Nov 2022 18:03:32 +0100 Message-Id: <20221127170351.11477-11-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221127170351.11477-1-anton@khirnov.net> References: <20221127170351.11477-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 11/30] lavc/libx264: use a local variable to shorten code 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: lvCv61xDOFnF Content-Length: 1643 --- libavcodec/libx264.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 1819809a48..b680e2098e 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -410,6 +410,7 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame, x264_picture_t **ppic) { X264Context *x4 = ctx->priv_data; + X264Opaque *opaque = &x4->reordered_opaque[x4->next_reordered_opaque]; x264_picture_t *pic = &x4->pic; x264_sei_t *sei = &pic->extra_sei; unsigned int sei_data_size = 0; @@ -439,11 +440,13 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame, pic->i_pts = frame->pts; - x4->reordered_opaque[x4->next_reordered_opaque].reordered_opaque = frame->reordered_opaque; - x4->reordered_opaque[x4->next_reordered_opaque].wallclock = wallclock; + opaque->reordered_opaque = frame->reordered_opaque; + opaque->wallclock = wallclock; if (ctx->export_side_data & AV_CODEC_EXPORT_DATA_PRFT) - x4->reordered_opaque[x4->next_reordered_opaque].wallclock = av_gettime(); - pic->opaque = &x4->reordered_opaque[x4->next_reordered_opaque]; + opaque->wallclock = av_gettime(); + + pic->opaque = opaque; + x4->next_reordered_opaque++; x4->next_reordered_opaque %= x4->nb_reordered_opaque;