Go to the documentation of this file.
29 #define OFFSET(x) offsetof(IDETContext, x)
30 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
37 {
"analyze_interlaced_flag",
"set number of frames to use to determine if the interlace flag is accurate",
OFFSET(analyze_interlaced_flag),
AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX,
FLAGS },
46 case TFF :
return "tff";
47 case BFF :
return "bff";
54 #define PRECISION 1048576
56 static uint64_t
uintpow(uint64_t
b,
unsigned int e)
67 uint64_t print_precision =
uintpow(10, digits);
71 snprintf(valuestr,
sizeof(valuestr),
"%"PRId64
".%0*"PRId64,
72 value / print_precision, digits,
value % print_precision);
79 switch(repeated_field) {
93 int v = (*
a++ + *
c++) - 2 * *
b++;
106 int v = (*
a++ + *
c++) - 2 * *
b++;
117 int64_t
alpha[2]={0};
119 int64_t gamma[2]={0};
135 for (y = 2; y <
h - 2; y++) {
142 gamma[(y^1)&1] += idet->
filter_line(cur , prev, cur ,
w);
340 av_log(
ctx,
AV_LOG_INFO,
"Repeated Fields: Neither:%6"PRId64
" Top:%6"PRId64
" Bottom:%6"PRId64
"\n",
345 av_log(
ctx,
AV_LOG_INFO,
"Single frame detection: TFF:%6"PRId64
" BFF:%6"PRId64
" Progressive:%6"PRId64
" Undetermined:%6"PRId64
"\n",
351 av_log(
ctx,
AV_LOG_INFO,
"Multi frame detection: TFF:%6"PRId64
" BFF:%6"PRId64
" Progressive:%6"PRId64
" Undetermined:%6"PRId64
"\n",
452 .priv_class = &idet_class,
AVPixelFormat
Pixel format.
static const char * type2str(Type type)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int request_frame(AVFilterLink *link)
@ PROGRESSIVE
in the bitstream is reported as 00b
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AVERROR_EOF
End of file.
ff_idet_filter_func filter_line
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
int depth
Number of bits in the component.
int top_field_first
If the content is interlaced, is top field displayed first.
static int filter_frame(AVFilterLink *link, AVFrame *picref)
#define AV_PIX_FMT_YUV420P10
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
int analyze_interlaced_flag_done
const char * name
Filter name.
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int ff_idet_filter_line_c_16bit(const uint16_t *a, const uint16_t *b, const uint16_t *c, int w)
AVFILTER_DEFINE_CLASS(idet)
#define AV_PIX_FMT_YUV422P9
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define AV_PIX_FMT_GRAY16
float interlace_threshold
A filter pad used for either input or output.
#define AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV422P16
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
#define AV_PIX_FMT_YUV444P16
#define AV_CEIL_RSHIFT(a, b)
static int av_dict_set_fxp(AVDictionary **pm, const char *key, uint64_t value, unsigned int digits, int flags)
static const AVFilterPad outputs[]
static const AVFilterPad idet_outputs[]
static enum AVPixelFormat pix_fmts[]
#define AV_PIX_FMT_YUV420P9
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_PIX_FMT_YUV420P16
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
static av_cold int init(AVFilterContext *ctx)
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
const AVPixFmtDescriptor * csp
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static const AVOption idet_options[]
uint8_t nb_components
The number of components each pixel has, (1-4)
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
static const AVFilterPad idet_inputs[]
static uint64_t uintpow(uint64_t b, unsigned int e)
#define AV_PIX_FMT_YUV422P10
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
uint64_t total_poststat[4]
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int interlaced_flag_accuracy
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static void filter(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV444P12
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
int(* ff_idet_filter_func)(const uint8_t *a, const uint8_t *b, const uint8_t *c, int w)
int analyze_interlaced_flag
#define AV_LOG_INFO
Standard information.
int interlaced_frame
The content of the picture is interlaced.
static const char * rep2str(RepeatedField repeated_field)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
const char * name
Pad name.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
#define AV_PIX_FMT_YUV444P9
uint64_t total_prestat[4]
uint64_t total_repeats[3]
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV422P14
uint8_t history[HIST_SIZE]
static int query_formats(AVFilterContext *ctx)
AVDictionary * metadata
metadata.
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
int ff_idet_filter_line_c(const uint8_t *a, const uint8_t *b, const uint8_t *c, int w)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
uint64_t decay_coefficient
float progressive_threshold
static const int16_t alpha[]
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
#define flags(name, subs,...)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
#define AV_PIX_FMT_YUV444P14
void ff_idet_init_x86(IDETContext *idet, int for_16b)
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
#define AV_PIX_FMT_YUV420P14