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 A802C45940 for ; Thu, 27 Apr 2023 14:26:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 735A068BEC0; Thu, 27 Apr 2023 17:26:12 +0300 (EEST) 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 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 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) -- 2.39.2 _______________________________________________ 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".