FFmpeg
framerate.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef AVFILTER_FRAMERATE_H
20 #define AVFILTER_FRAMERATE_H
21 
22 #include "scene_sad.h"
23 #include "avfilter.h"
24 
25 #define BLEND_FUNC_PARAMS const uint8_t *src1, ptrdiff_t src1_linesize, \
26  const uint8_t *src2, ptrdiff_t src2_linesize, \
27  uint8_t *dst, ptrdiff_t dst_linesize, \
28  ptrdiff_t width, ptrdiff_t height, \
29  int factor1, int factor2, int half
30 
31 #define BLEND_FACTOR_DEPTH(n) (n-1)
32 
33 typedef void (*blend_func)(BLEND_FUNC_PARAMS);
34 
35 typedef struct FrameRateContext {
36  const AVClass *class;
37  // parameters
38  AVRational dest_frame_rate; ///< output frames per second
39  int flags; ///< flags affecting frame rate conversion algorithm
40  double scene_score; ///< score that denotes a scene change has happened
41  int interp_start; ///< start of range to apply linear interpolation
42  int interp_end; ///< end of range to apply linear interpolation
43 
44  int line_size[4]; ///< bytes of pixel data per line for each plane
45  int height[4]; ///< height of each plane
46  int vsub;
47 
48  AVRational srce_time_base; ///< timebase of source
49  AVRational dest_time_base; ///< timebase of destination
50 
51  ff_scene_sad_fn sad; ///< Sum of the absolute difference function (scene detect only)
52  double prev_mafd; ///< previous MAFD (scene detect only)
53 
55  int bitdepth;
57 
58  AVFrame *f0; ///< last frame
59  AVFrame *f1; ///< current frame
60  int64_t pts0; ///< last frame pts in dest_time_base
61  int64_t pts1; ///< current frame pts in dest_time_base
62  int64_t delta; ///< pts1 to pts0 delta
63  double score; ///< scene change score (f0 to f1)
64  int flush; ///< 1 if the filter is being flushed
65  int64_t start_pts; ///< pts of the first output frame
66  int64_t n; ///< output frame counter
67 
70 
73 
74 #endif /* AVFILTER_FRAMERATE_H */
FrameRateContext::pts0
int64_t pts0
last frame pts in dest_time_base
Definition: framerate.h:60
FrameRateContext::scene_score
double scene_score
score that denotes a scene change has happened
Definition: framerate.h:40
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:318
FrameRateContext
Definition: framerate.h:35
FrameRateContext::score
double score
scene change score (f0 to f1)
Definition: framerate.h:63
FrameRateContext::interp_end
int interp_end
end of range to apply linear interpolation
Definition: framerate.h:42
blend_func
void(* blend_func)(BLEND_FUNC_PARAMS)
Definition: framerate.h:33
FrameRateContext::pts1
int64_t pts1
current frame pts in dest_time_base
Definition: framerate.h:61
FrameRateContext::blend
blend_func blend
Definition: framerate.h:68
FrameRateContext::dest_frame_rate
AVRational dest_frame_rate
output frames per second
Definition: framerate.h:38
s
#define s(width, name)
Definition: cbs_vp9.c:257
FrameRateContext::flags
int flags
flags affecting frame rate conversion algorithm
Definition: framerate.h:39
FrameRateContext::line_size
int line_size[4]
bytes of pixel data per line for each plane
Definition: framerate.h:44
FrameRateContext::interp_start
int interp_start
start of range to apply linear interpolation
Definition: framerate.h:41
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
FrameRateContext::n
int64_t n
output frame counter
Definition: framerate.h:66
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
FrameRateContext::prev_mafd
double prev_mafd
previous MAFD (scene detect only)
Definition: framerate.h:52
scene_sad.h
BLEND_FUNC_PARAMS
#define BLEND_FUNC_PARAMS
Definition: framerate.h:25
FrameRateContext::blend_factor_max
int blend_factor_max
Definition: framerate.h:54
ff_scene_sad_fn
void(* ff_scene_sad_fn)(SCENE_SAD_PARAMS)
Definition: scene_sad.h:34
FrameRateContext::srce_time_base
AVRational srce_time_base
timebase of source
Definition: framerate.h:48
FrameRateContext::work
AVFrame * work
Definition: framerate.h:56
FrameRateContext::bitdepth
int bitdepth
Definition: framerate.h:55
FrameRateContext::dest_time_base
AVRational dest_time_base
timebase of destination
Definition: framerate.h:49
FrameRateContext::vsub
int vsub
Definition: framerate.h:46
avfilter.h
FrameRateContext::start_pts
int64_t start_pts
pts of the first output frame
Definition: framerate.h:65
FrameRateContext::f0
AVFrame * f0
last frame
Definition: framerate.h:58
ff_framerate_init_x86
void ff_framerate_init_x86(FrameRateContext *s)
Definition: vf_framerate_init.c:28
ff_framerate_init
void ff_framerate_init(FrameRateContext *s)
Definition: vf_framerate.c:265
FrameRateContext::sad
ff_scene_sad_fn sad
Sum of the absolute difference function (scene detect only)
Definition: framerate.h:51
FrameRateContext::delta
int64_t delta
pts1 to pts0 delta
Definition: framerate.h:62
FrameRateContext::height
int height[4]
height of each plane
Definition: framerate.h:45
FrameRateContext::f1
AVFrame * f1
current frame
Definition: framerate.h:59
FrameRateContext::flush
int flush
1 if the filter is being flushed
Definition: framerate.h:64