77#define OFFSET(x) offsetof(IDETContext, x)
78#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
85 {
"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 },
94 case TFF :
return "tff";
95 case BFF :
return "bff";
102#define PRECISION 1048576
115 uint64_t print_precision =
uintpow(10, digits);
119 snprintf(valuestr,
sizeof(valuestr),
"%"PRId64
".%0*"PRId64,
120 value / print_precision, digits,
value % print_precision);
127 switch(repeated_field) {
158 for (y = 2; y <
h - 2; y++) {
159 uint8_t *prev = &idet->
prev->
data[
i][y*refs];
160 uint8_t *cur = &idet->
cur ->
data[
i][y*refs];
161 uint8_t *next = &idet->
next->
data[
i][y*refs];
162 alpha[ y &1] += filter_line(cur-refs, prev, cur+refs,
w);
163 alpha[(y^1)&1] += filter_line(cur-refs, next, cur+refs,
w);
164 delta += filter_line(cur-refs, cur, cur+refs,
w);
165 gamma[(y^1)&1] += filter_line(cur , prev, cur ,
w);
277 if( picref->
width != link->
w
362 av_log(
ctx,
AV_LOG_INFO,
"Repeated Fields: Neither:%6"PRId64
" Top:%6"PRId64
" Bottom:%6"PRId64
"\n",
367 av_log(
ctx,
AV_LOG_INFO,
"Single frame detection: TFF:%6"PRId64
" BFF:%6"PRId64
" Progressive:%6"PRId64
" Undetermined:%6"PRId64
"\n",
373 av_log(
ctx,
AV_LOG_INFO,
"Multi frame detection: TFF:%6"PRId64
" BFF:%6"PRId64
" Progressive:%6"PRId64
" Undetermined:%6"PRId64
"\n",
457 .p.priv_class = &idet_class,
static int request_frame(AVFilterLink *outlink)
const FFFilter ff_vf_idet
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
static int FUNC metadata(CodedBitstreamContext *ctx, RWContext *rw, APVRawMetadata *current)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
common internal and external API header
#define AV_CEIL_RSHIFT(a, b)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_EOF
End of file.
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_INFO
Standard information.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
static const int16_t alpha[]
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define FILTER_PIXFMTS_ARRAY(array)
#define AVFILTER_DEFINE_CLASS(fname)
static const AVOption idet_options[]
static const AVFilterPad idet_outputs[]
static const char * rep2str(RepeatedField repeated_field)
static const char * type2str(Type type)
static int request_frame(AVFilterLink *link)
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad idet_inputs[]
static int av_dict_set_fxp(AVDictionary **pm, const char *key, uint64_t value, unsigned int digits, int flags)
static int filter_frame(AVFilterLink *link, AVFrame *picref)
static uint64_t uintpow(uint64_t b, unsigned int e)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static enum AVPixelFormat pix_fmts[]
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P14
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ 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_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
#define AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P10
Describe the class of an AVClass context structure.
int depth
Number of bits in the component.
AVFilterLink ** inputs
array of pointers to input links
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
AVDictionary * metadata
metadata.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
uint8_t nb_components
The number of components each pixel has, (1-4)
float interlace_threshold
uint64_t total_poststat[4]
uint64_t total_prestat[4]
const AVPixFmtDescriptor * csp
uint8_t history[HIST_SIZE]
int interlaced_flag_accuracy
int analyze_interlaced_flag
uint64_t total_repeats[3]
int analyze_interlaced_flag_done
uint64_t decay_coefficient
float progressive_threshold
ff_idet_filter_func filter_line
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
static AVFormatContext * ctx
@ PROGRESSIVE
in the bitstream is reported as 00b
void av_cold ff_idet_dsp_init(IDETDSPContext *dsp, int depth)
int(* ff_idet_filter_func)(const uint8_t *a, const uint8_t *b, const uint8_t *c, int w)