[FFmpeg-cvslog] fftools/ffmpeg: drop OutputStream.pict_type
Anton Khirnov
git at videolan.org
Tue May 2 12:30:58 EEST 2023
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Apr 20 09:08:00 2023 +0200| [52b632b65be91264543065296a6a197d2a087c70] | committer: Anton Khirnov
fftools/ffmpeg: drop OutputStream.pict_type
It is no longer used outside of update_video_stats(), so make it a stack
variable in that function.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=52b632b65be91264543065296a6a197d2a087c70
---
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; i<FF_ARRAY_ELEMS(ost->error); 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)
More information about the ffmpeg-cvslog
mailing list