From patchwork Thu Apr 27 14:25:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41363 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp562887pzb; Thu, 27 Apr 2023 07:26:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JUSpQlc6MatID4fWFRIEBmAovEHlbyuhTplZBnYvCXNpP07rkikW5dV9M1cXqVarkFpcK X-Received: by 2002:a19:7409:0:b0:4ea:f7be:e071 with SMTP id v9-20020a197409000000b004eaf7bee071mr587259lfe.46.1682605580510; Thu, 27 Apr 2023 07:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682605580; cv=none; d=google.com; s=arc-20160816; b=u5wH8h09tNpgUzk4sUoAVxY+1r/praKr4lqW+AvCWwHNoWdpjX78iCe++U8an8X3nL fxEcVvupogbpL68/ve/0fWJrl+lT2Ai9CSlS0VQtAwk2Q7BtdcRMQZr8O8VaWBz5WhYw YEI26N6mPfI5oVLjtXgDCJwPYDLB8vTZZi/AcTJu1jbrMiRMXAbEbx6mdrmGefvpyL0e 2VOI7zr5N4a5K1aoauhvROFGCA0wHaaWfkpeG2s7nfACITJFZBawOt9yslalDrLGJ57m gOlK7IlhLkq8wyIBG5yu9QK4UB0Fj6DGCg1hV+ROi7y9OrybyBLD3zVyil05aWUfCT1o 3bIA== 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=IN/S0XCUiOgnIB3j21kDxyfTzKnKU5SpEMwG76/y00A=; b=zCnzYqYiesAbx/XFdtXJy7UtAnlhn0Vz0e0t7kvawYqWxfSwkwE0Bur/dETdRS/czn 2no+LLUQlnyTVvW+kuMKCvkhoVHYe9tgvEOFVLmKiKoor3NRImrnnIn1OoAVzS3n+vok Q17Zwh0O9PvUsPFoCOBONZ/dnrP0wsO6QTDF02sJxDmrnnNKzWwqhptzS5IbldFQlxc+ 3LxJlqh50zr8I24sCllDmnVqQRh8Cba0tSXzDRFkEz39x0Gp3NQq9Z95ULFMj6Q13v2l UNAYTR9U3r9qBmsqrWM+54bjcbd+KD/+iy9eeciCazdqZkjcYahz0bpoK36tuHoz0y0k /vEA== 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 o11-20020aa7d3cb000000b00504a290ccccsi14930560edr.6.2023.04.27.07.26.16; Thu, 27 Apr 2023 07:26:20 -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; 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 B0E1568BF18; Thu, 27 Apr 2023 17:26:12 +0300 (EEST) 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 7BB3668BDB3 for ; Thu, 27 Apr 2023 17:26:06 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 22466240D1C for ; Thu, 27 Apr 2023 16:26:06 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id taUBbKslAsd9 for ; Thu, 27 Apr 2023 16:26:05 +0200 (CEST) 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 4B9522404F5 for ; Thu, 27 Apr 2023 16:26:05 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 1D6273A03F3 for ; Thu, 27 Apr 2023 16:26:05 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 27 Apr 2023 16:25:43 +0200 Message-Id: <20230427142601.2613-3-anton@khirnov.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230427142601.2613-1-anton@khirnov.net> References: <20230427142601.2613-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/21] fftools/ffmpeg: drop OutputStream.pict_type 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: lkgISOrguTxK It is no longer used outside of update_video_stats(), so make it a stack variable in that function. --- fftools/ffmpeg.h | 3 --- fftools/ffmpeg_enc.c | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index a41bc9b518..c3cb365a3b 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -671,9 +671,6 @@ typedef struct OutputStream { /* packet quality factor */ int quality; - /* packet picture type */ - int pict_type; - /* frame encode sum of squared error values */ int64_t error[4]; diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 859c7fdeee..096e0ce14a 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -587,11 +587,12 @@ static void update_video_stats(OutputStream *ost, const AVPacket *pkt, int write const uint8_t *sd = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_STATS, NULL); AVCodecContext *enc = ost->enc_ctx; + enum AVPictureType pict_type; int64_t frame_number; double ti1, bitrate, avg_bitrate; ost->quality = sd ? AV_RL32(sd) : -1; - ost->pict_type = sd ? sd[4] : AV_PICTURE_TYPE_NONE; + pict_type = sd ? sd[4] : AV_PICTURE_TYPE_NONE; for (int i = 0; ierror); i++) { if (sd && i < sd[5]) @@ -634,7 +635,7 @@ static void update_video_stats(OutputStream *ost, const AVPacket *pkt, int write avg_bitrate = (double)(e->data_size * 8) / ti1 / 1000.0; fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ", (double)e->data_size / 1024, ti1, bitrate, avg_bitrate); - fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(ost->pict_type)); + fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(pict_type)); } static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)