27 #include "libavutil/avstring.h"
28 #include "libavutil/imgutils.h"
29 #include "libavutil/opt.h"
30 #include "libavutil/pixdesc.h"
55 #define OFFSET(x) offsetof(TelecineContext, x)
56 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
64 {
"pattern",
"pattern that describe for how many fields a frame is to be displayed",
OFFSET(pattern),
AV_OPT_TYPE_STRING, {.str=
"23"}, 0, 0,
FLAGS},
81 for (p = tc->
pattern; *p; p++) {
87 max =
FFMAX(*p -
'0', max);
93 av_log(ctx,
AV_LOG_INFO,
"Telecine pattern %s yields up to %d frames per frame, pts advance factor: %d/%d\n",
125 for (i = 0; i < tc->
out_cnt; i++) {
149 if (!fps.
num || !fps.
den) {
151 "current rate of %d/%d is invalid\n", fps.
num, fps.
den);
174 int i,
len,
ret = 0, nout = 0;
230 for (i = 0; i < nout; i++) {
252 for (i = 0; i < tc->
out_cnt; i++)
279 .priv_class = &telecine_class,
283 .
inputs = telecine_inputs,
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
const char * name
Filter name.
void * priv
private data for use by the filter
static const AVFilterPad outputs[]
int h
agreed upon image height
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int av_isdigit(int c)
Locale-independent conversion of ASCII isdigit.
static int config_input(AVFilterLink *inlink)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
const char * name
Pad name.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static int first_field(const struct video_data *s, int fd)
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
#define FF_CEIL_RSHIFT(a, b)
static double av_q2d(AVRational a)
Convert rational to double.
AVRational av_mul_q(AVRational b, AVRational c) av_const
Multiply two rationals.
#define AV_LOG_VERBOSE
Detailed information.
static const AVFilterPad telecine_outputs[]
A filter pad used for either input or output.
A link between two filters.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned flags
Link processing flags.
static int config_output(AVFilterLink *outlink)
Frame requests may need to loop in order to be fulfilled.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown; if left to 0/0, will be automatically be cop...
static av_cold int init(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
AVFilterContext * src
source filter
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int w
agreed upon image width
int format
agreed upon media format
Main libavfilter public API header.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
AVFilterLink ** outputs
array of pointers to output links
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
#define AV_LOG_INFO
Standard information.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Describe the class of an AVClass context structure.
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
Fill plane linesizes for an image with pixel format pix_fmt and width width.
static const AVFilterPad inputs[]
AVFilterLink ** inputs
array of pointers to input links
rational number numerator/denominator
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
AVFilterContext * dst
dest filter
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
AVFrame * av_frame_clone(AVFrame *src)
Create a new frame that references the same data as src.
static const AVOption telecine_options[]
static const AVFilterPad telecine_inputs[]
#define AVERROR_INVALIDDATA
#define AVFILTER_DEFINE_CLASS(fname)
static av_cold void uninit(AVFilterContext *ctx)
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
AVFilter avfilter_vf_telecine
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
static int query_formats(AVFilterContext *ctx)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int64_t frame_count
Number of past frames sent through the link.