You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
fftools/ffmpeg: move OutputStream.last_nb0_frames to Encoder
It is video encoding-only and does not need to be visible outside of ffmpeg_enc.c Also, rename the variable to frames_prev_hist to be consistent with the naming in do_video_out().
This commit is contained in:
@@ -590,7 +590,6 @@ typedef struct OutputStream {
|
|||||||
AVFrame *filtered_frame;
|
AVFrame *filtered_frame;
|
||||||
AVPacket *pkt;
|
AVPacket *pkt;
|
||||||
int64_t last_dropped;
|
int64_t last_dropped;
|
||||||
int64_t last_nb0_frames[3];
|
|
||||||
|
|
||||||
/* video only */
|
/* video only */
|
||||||
AVRational frame_rate;
|
AVRational frame_rate;
|
||||||
|
@@ -50,6 +50,10 @@ struct Encoder {
|
|||||||
AVFrame *last_frame;
|
AVFrame *last_frame;
|
||||||
/* number of frames emitted by the video-encoding sync code */
|
/* number of frames emitted by the video-encoding sync code */
|
||||||
int64_t vsync_frame_number;
|
int64_t vsync_frame_number;
|
||||||
|
/* history of nb_frames_prev, i.e. the number of times the
|
||||||
|
* previous frame was duplicated by vsync code in recent
|
||||||
|
* do_video_out() calls */
|
||||||
|
int64_t frames_prev_hist[3];
|
||||||
|
|
||||||
AVFrame *sq_frame;
|
AVFrame *sq_frame;
|
||||||
};
|
};
|
||||||
@@ -999,18 +1003,18 @@ static void do_video_out(OutputFile *of,
|
|||||||
|
|
||||||
if (!next_picture) {
|
if (!next_picture) {
|
||||||
//end, flushing
|
//end, flushing
|
||||||
nb_frames_prev = nb_frames = mid_pred(ost->last_nb0_frames[0],
|
nb_frames_prev = nb_frames = mid_pred(e->frames_prev_hist[0],
|
||||||
ost->last_nb0_frames[1],
|
e->frames_prev_hist[1],
|
||||||
ost->last_nb0_frames[2]);
|
e->frames_prev_hist[2]);
|
||||||
} else {
|
} else {
|
||||||
video_sync_process(of, ost, next_picture, duration,
|
video_sync_process(of, ost, next_picture, duration,
|
||||||
&nb_frames, &nb_frames_prev);
|
&nb_frames, &nb_frames_prev);
|
||||||
}
|
}
|
||||||
|
|
||||||
memmove(ost->last_nb0_frames + 1,
|
memmove(e->frames_prev_hist + 1,
|
||||||
ost->last_nb0_frames,
|
e->frames_prev_hist,
|
||||||
sizeof(ost->last_nb0_frames[0]) * (FF_ARRAY_ELEMS(ost->last_nb0_frames) - 1));
|
sizeof(e->frames_prev_hist[0]) * (FF_ARRAY_ELEMS(e->frames_prev_hist) - 1));
|
||||||
ost->last_nb0_frames[0] = nb_frames_prev;
|
e->frames_prev_hist[0] = nb_frames_prev;
|
||||||
|
|
||||||
if (nb_frames_prev == 0 && ost->last_dropped) {
|
if (nb_frames_prev == 0 && ost->last_dropped) {
|
||||||
nb_frames_drop++;
|
nb_frames_drop++;
|
||||||
|
Reference in New Issue
Block a user