FFmpeg
Loading...
Searching...
No Matches
vf_idet.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 Michael Niedermayer <michaelni@gmx.at>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <float.h> /* FLT_MAX */
22
23#include "libavutil/common.h"
24#include "libavutil/mem.h"
25#include "libavutil/opt.h"
26#include "libavutil/pixdesc.h"
27
28#include "filters.h"
29#include "vf_idetdsp.h"
30
37
43
49
50/* below this many luma pixels per job, threading costs more than it saves */
51#define MIN_PIXELS_PER_JOB (128 * 1024)
52
89
90#define OFFSET(x) offsetof(IDETContext, x)
91#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
92
93static const AVOption idet_options[] = {
94 { "intl_thres", "set interlacing threshold", OFFSET(interlace_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 1.04}, -1, FLT_MAX, FLAGS },
95 { "prog_thres", "set progressive threshold", OFFSET(progressive_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 1.5}, -1, FLT_MAX, FLAGS },
96 { "rep_thres", "set repeat threshold", OFFSET(repeat_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 3.0}, -1, FLT_MAX, FLAGS },
97 { "half_life", "half life of cumulative statistics", OFFSET(half_life), AV_OPT_TYPE_FLOAT, {.dbl = 0.0}, -1, INT_MAX, FLAGS },
98 { "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 },
99 { NULL }
100};
101
103
104static const char *type2str(Type type)
105{
106 switch(type) {
107 case TFF : return "tff";
108 case BFF : return "bff";
109 case PROGRESSIVE : return "progressive";
110 case UNDETERMINED : return "undetermined";
111 }
112 return NULL;
113}
114
115#define PRECISION 1048576
116
117static uint64_t uintpow(uint64_t b,unsigned int e)
118{
119 uint64_t r=1;
120 while(e--) r*=b;
121 return r;
122}
123
124static int av_dict_set_fxp(AVDictionary **pm, const char *key, uint64_t value, unsigned int digits,
125 int flags)
126{
127 char valuestr[44];
128 uint64_t print_precision = uintpow(10, digits);
129
130 value = av_rescale(value, print_precision, PRECISION);
131
132 snprintf(valuestr, sizeof(valuestr), "%"PRId64".%0*"PRId64,
133 value / print_precision, digits, value % print_precision);
134
135 return av_dict_set(pm, key, valuestr, flags);
136}
137
138static const char *rep2str(RepeatedField repeated_field)
139{
140 switch(repeated_field) {
141 case REPEAT_NONE : return "neither";
142 case REPEAT_TOP : return "top";
143 case REPEAT_BOTTOM : return "bottom";
144 }
145 return NULL;
146}
147
148static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
149{
150 IDETContext *idet = ctx->priv;
151 IDETSums *sums = &idet->sums[jobnr];
152 int64_t alpha[2] = { 0 };
153 int64_t delta = 0;
154 int64_t gamma[2] = { 0 };
155 ff_idet_filter_func filter_line = idet->dsp.filter_line;
156
157 for (int i = 0; i < idet->csp->nb_components; i++) {
158 int w = idet->cur->width;
159 int h = idet->cur->height;
160 int refs = idet->cur->linesize[i];
161 int rows, start, end;
162
163 if (i && i<3) {
166 }
167
168 /* rows 2 to h - 3 are analyzed, split across the jobs */
169 rows = FFMAX(h - 4, 0);
170 start = 2 + ff_slice_pos(rows, jobnr, nb_jobs);
171 end = 2 + ff_slice_pos(rows, jobnr + 1, nb_jobs);
172
173 for (int y = start; y < end; y++) {
174 uint8_t *prev = &idet->prev->data[i][y*idet->prev->linesize[i]];
175 uint8_t *cur = &idet->cur ->data[i][y*refs];
176 uint8_t *next = &idet->next->data[i][y*idet->next->linesize[i]];
177 alpha[ y &1] += filter_line(cur-refs, prev, cur+refs, w);
178 alpha[(y^1)&1] += filter_line(cur-refs, next, cur+refs, w);
179 delta += filter_line(cur-refs, cur, cur+refs, w);
180 gamma[(y^1)&1] += filter_line(cur , prev, cur , w);
181 }
182 }
183
184 sums->alpha[0] = alpha[0];
185 sums->alpha[1] = alpha[1];
186 sums->delta = delta;
187 sums->gamma[0] = gamma[0];
188 sums->gamma[1] = gamma[1];
189
190 return 0;
191}
192
194{
195 IDETContext *idet = ctx->priv;
196 int i;
197 int64_t alpha[2]={0};
198 int64_t delta=0;
199 int64_t gamma[2]={0};
200 Type type, best_type;
201 RepeatedField repeat;
202 int match = 0;
203 AVDictionary **metadata = &idet->cur->metadata;
204 const int64_t pixels = (int64_t)idet->cur->width * idet->cur->height;
205 const int nb_jobs = av_clip64(pixels / MIN_PIXELS_PER_JOB, 1,
206 FFMIN(idet->cur->height, idet->nb_threads));
207
209
210 for (i = 0; i < nb_jobs; i++) {
211 alpha[0] += idet->sums[i].alpha[0];
212 alpha[1] += idet->sums[i].alpha[1];
213 delta += idet->sums[i].delta;
214 gamma[0] += idet->sums[i].gamma[0];
215 gamma[1] += idet->sums[i].gamma[1];
216 }
217
218 if (alpha[0] > idet->interlace_threshold * alpha[1]){
219 type = TFF;
220 }else if(alpha[1] > idet->interlace_threshold * alpha[0]){
221 type = BFF;
222 }else if(alpha[1] > idet->progressive_threshold * delta){
224 }else{
226 }
227
228 if ( gamma[0] > idet->repeat_threshold * gamma[1] ){
229 repeat = REPEAT_TOP;
230 } else if ( gamma[1] > idet->repeat_threshold * gamma[0] ){
231 repeat = REPEAT_BOTTOM;
232 } else {
233 repeat = REPEAT_NONE;
234 }
235
236 memmove(idet->history+1, idet->history, HIST_SIZE-1);
237 idet->history[0] = type;
238 best_type = UNDETERMINED;
239 for(i=0; i<HIST_SIZE; i++){
240 if(idet->history[i] != UNDETERMINED){
241 if(best_type == UNDETERMINED)
242 best_type = idet->history[i];
243
244 if(idet->history[i] == best_type) {
245 match++;
246 }else{
247 match=0;
248 break;
249 }
250 }
251 }
252 if(idet->last_type == UNDETERMINED){
253 if(match ) idet->last_type = best_type;
254 }else{
255 if(match>2) idet->last_type = best_type;
256 }
257
258 if (idet->last_type == TFF){
260 }else if(idet->last_type == BFF){
263 }else if(idet->last_type == PROGRESSIVE){
265 }
266
267 for(i=0; i<3; i++)
268 idet->repeats[i] = av_rescale(idet->repeats [i], idet->decay_coefficient, PRECISION);
269
270 for(i=0; i<4; i++){
271 idet->prestat [i] = av_rescale(idet->prestat [i], idet->decay_coefficient, PRECISION);
272 idet->poststat[i] = av_rescale(idet->poststat[i], idet->decay_coefficient, PRECISION);
273 }
274
275 idet->total_repeats [ repeat] ++;
276 idet->repeats [ repeat] += PRECISION;
277
278 idet->total_prestat [ type] ++;
279 idet->prestat [ type] += PRECISION;
280
281 idet->total_poststat[idet->last_type] ++;
282 idet->poststat [idet->last_type] += PRECISION;
283
284 av_log(ctx, AV_LOG_DEBUG, "Repeated Field:%12s, Single frame:%12s, Multi frame:%12s\n",
285 rep2str(repeat), type2str(type), type2str(idet->last_type));
286
287 av_dict_set (metadata, "lavfi.idet.repeated.current_frame", rep2str(repeat), 0);
288 av_dict_set_fxp(metadata, "lavfi.idet.repeated.neither", idet->repeats[REPEAT_NONE], 2, 0);
289 av_dict_set_fxp(metadata, "lavfi.idet.repeated.top", idet->repeats[REPEAT_TOP], 2, 0);
290 av_dict_set_fxp(metadata, "lavfi.idet.repeated.bottom", idet->repeats[REPEAT_BOTTOM], 2, 0);
291
292 av_dict_set (metadata, "lavfi.idet.single.current_frame", type2str(type), 0);
293 av_dict_set_fxp(metadata, "lavfi.idet.single.tff", idet->prestat[TFF], 2 , 0);
294 av_dict_set_fxp(metadata, "lavfi.idet.single.bff", idet->prestat[BFF], 2, 0);
295 av_dict_set_fxp(metadata, "lavfi.idet.single.progressive", idet->prestat[PROGRESSIVE], 2, 0);
296 av_dict_set_fxp(metadata, "lavfi.idet.single.undetermined", idet->prestat[UNDETERMINED], 2, 0);
297
298 av_dict_set (metadata, "lavfi.idet.multiple.current_frame", type2str(idet->last_type), 0);
299 av_dict_set_fxp(metadata, "lavfi.idet.multiple.tff", idet->poststat[TFF], 2, 0);
300 av_dict_set_fxp(metadata, "lavfi.idet.multiple.bff", idet->poststat[BFF], 2, 0);
301 av_dict_set_fxp(metadata, "lavfi.idet.multiple.progressive", idet->poststat[PROGRESSIVE], 2, 0);
302 av_dict_set_fxp(metadata, "lavfi.idet.multiple.undetermined", idet->poststat[UNDETERMINED], 2, 0);
303}
304
305static int filter_frame(AVFilterLink *link, AVFrame *picref)
306{
307 AVFilterContext *ctx = link->dst;
308 IDETContext *idet = ctx->priv;
309
310 // initial frame(s) and not interlaced, just pass through for
311 // the analyze_interlaced_flag mode
312 if (idet->analyze_interlaced_flag &&
313 !(picref->flags & AV_FRAME_FLAG_INTERLACED) &&
314 !idet->next) {
315 return ff_filter_frame(ctx->outputs[0], picref);
316 }
318 if ((picref->flags & AV_FRAME_FLAG_INTERLACED) && idet->interlaced_flag_accuracy < 0) {
320 }
321 return ff_filter_frame(ctx->outputs[0], picref);
322 }
323
324 av_frame_free(&idet->prev);
325
326 if( picref->width != link->w
327 || picref->height != link->h
328 || picref->format != link->format) {
329 link->dst->inputs[0]->format = picref->format;
330 link->dst->inputs[0]->w = picref->width;
331 link->dst->inputs[0]->h = picref->height;
332
333 av_frame_free(&idet->cur );
334 av_frame_free(&idet->next);
335 idet->csp = NULL;
336 }
337
338 idet->prev = idet->cur;
339 idet->cur = idet->next;
340 idet->next = picref;
341
342 if (!idet->cur &&
343 !(idet->cur = av_frame_clone(idet->next)))
344 return AVERROR(ENOMEM);
345
346 if (!idet->prev)
347 return 0;
348
349 if (!idet->csp) {
350 idet->csp = av_pix_fmt_desc_get(link->format);
351 ff_idet_dsp_init(&idet->dsp, idet->csp->comp[0].depth);
352 }
353
354 if (idet->analyze_interlaced_flag) {
355 if (idet->cur->flags & AV_FRAME_FLAG_INTERLACED) {
357 filter(ctx);
358 if (idet->last_type == PROGRESSIVE) {
361 } else if (idet->last_type != UNDETERMINED) {
364 }
365 if (idet->analyze_interlaced_flag == 1) {
366 ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur));
367
368 if ((idet->next->flags & AV_FRAME_FLAG_INTERLACED) && idet->interlaced_flag_accuracy < 0) {
370 }
372 av_log(ctx, AV_LOG_INFO, "Final flag accuracy %d\n", idet->interlaced_flag_accuracy);
373 return ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->next));
374 }
375 }
376 } else {
377 filter(ctx);
378 }
379
380 return ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur));
381}
382
384{
385 AVFilterContext *ctx = link->src;
386 IDETContext *idet = ctx->priv;
387 int ret;
388
389 if (idet->eof)
390 return AVERROR_EOF;
391
392 ret = ff_request_frame(link->src->inputs[0]);
393
394 if (ret == AVERROR_EOF && idet->cur && !idet->analyze_interlaced_flag_done) {
395 AVFrame *next = av_frame_clone(idet->next);
396
397 if (!next)
398 return AVERROR(ENOMEM);
399
400 ret = filter_frame(link->src->inputs[0], next);
401 idet->eof = 1;
402 }
403
404 return ret;
405}
406
408{
409 IDETContext *idet = ctx->priv;
410
411 av_log(ctx, AV_LOG_INFO, "Repeated Fields: Neither:%6"PRId64" Top:%6"PRId64" Bottom:%6"PRId64"\n",
415 );
416 av_log(ctx, AV_LOG_INFO, "Single frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
417 idet->total_prestat[TFF],
418 idet->total_prestat[BFF],
421 );
422 av_log(ctx, AV_LOG_INFO, "Multi frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
423 idet->total_poststat[TFF],
424 idet->total_poststat[BFF],
427 );
428
429 av_frame_free(&idet->prev);
430 av_frame_free(&idet->cur );
431 av_frame_free(&idet->next);
432 av_freep(&idet->sums);
433}
434
468
470{
471 IDETContext *idet = ctx->priv;
472
473 idet->eof = 0;
474 idet->last_type = UNDETERMINED;
475 memset(idet->history, UNDETERMINED, HIST_SIZE);
476
477 if( idet->half_life > 0 )
478 idet->decay_coefficient = lrint( PRECISION * exp2(-1.0 / idet->half_life) );
479 else
481
482 ff_idet_dsp_init(&idet->dsp, 8);
483
484 return 0;
485}
486
487static int config_input(AVFilterLink *inlink)
488{
489 AVFilterContext *ctx = inlink->dst;
490 IDETContext *idet = ctx->priv;
491
493 av_freep(&idet->sums);
494 idet->sums = av_calloc(idet->nb_threads, sizeof(*idet->sums));
495 if (!idet->sums)
496 return AVERROR(ENOMEM);
497
498 return 0;
499}
500
501static const AVFilterPad idet_inputs[] = {
502 {
503 .name = "default",
504 .type = AVMEDIA_TYPE_VIDEO,
505 .filter_frame = filter_frame,
506 .config_props = config_input,
507 },
508};
509
510static const AVFilterPad idet_outputs[] = {
511 {
512 .name = "default",
513 .type = AVMEDIA_TYPE_VIDEO,
514 .request_frame = request_frame
515 },
516};
517
519 .p.name = "idet",
520 .p.description = NULL_IF_CONFIG_SMALL("Interlace detect Filter."),
522 .p.priv_class = &idet_class,
523 .priv_size = sizeof(IDETContext),
524 .init = init,
525 .uninit = uninit,
529};
static int config_input(AVFilterLink *inlink)
static int request_frame(AVFilterLink *outlink)
Definition af_aecho.c:272
const FFFilter ff_vf_idet
Definition vf_idet.c:518
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1112
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
Definition avfilter.c:525
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
Definition avfilter.c:1754
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition avfilter.c:890
static int FUNC metadata(CodedBitstreamContext *ctx, RWContext *rw, APVRawMetadata *current)
#define flags(name, subs,...)
Definition cbs_h264.c:74
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define FLAGS
Definition cmdutils.c:596
common internal and external API header
#define AV_CEIL_RSHIFT(a, b)
Definition common.h:60
#define av_clip64
Definition common.h:103
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:613
double value
Definition eval.c:102
#define HIST_SIZE
Definition f_ebur128.c:52
const char * key
int ret
Definition ffplay.c:391
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition opt.h:270
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition avfilter.h:172
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition avfilter.h:188
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition dict.c:87
#define AVERROR_EOF
End of file.
Definition error.h:57
#define AVERROR(e)
Definition error.h:45
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
Definition frame.h:702
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
Definition frame.h:707
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:65
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition frame.c:486
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition log.h:231
#define AV_LOG_INFO
Standard information.
Definition log.h:221
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static const int16_t alpha[]
Definition ilbcdata.h:55
#define r
Definition input.c:42
#define b
Definition input.c:43
enum MPFType type
Definition jpegmpfenc.c:55
static av_cold void uninit(AVBitStreamFilterContext *ctx)
const char * arg
Definition jacosubdec.c:66
#define FILTER_INPUTS(array)
Definition filters.h:279
#define FILTER_OUTPUTS(array)
Definition filters.h:280
static int ff_slice_pos(int total, int jobnr, int nb_jobs)
Compute the boundary index for a slice when work of size total is split into nb_jobs slices.
Definition filters.h:813
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:259
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:493
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition vf_idet.c:148
Type
Definition vf_idet.c:31
@ TFF
Definition vf_idet.c:32
@ BFF
Definition vf_idet.c:33
@ UNDETERMINED
Definition vf_idet.c:35
static const AVOption idet_options[]
Definition vf_idet.c:93
static const AVFilterPad idet_outputs[]
Definition vf_idet.c:510
static const char * rep2str(RepeatedField repeated_field)
Definition vf_idet.c:138
static int config_input(AVFilterLink *inlink)
Definition vf_idet.c:487
static const char * type2str(Type type)
Definition vf_idet.c:104
#define HIST_SIZE
Definition vf_idet.c:72
static int request_frame(AVFilterLink *link)
Definition vf_idet.c:383
RepeatedField
Definition vf_idet.c:38
@ REPEAT_BOTTOM
Definition vf_idet.c:41
@ REPEAT_NONE
Definition vf_idet.c:39
@ REPEAT_TOP
Definition vf_idet.c:40
static av_cold void uninit(AVFilterContext *ctx)
Definition vf_idet.c:407
#define MIN_PIXELS_PER_JOB
Definition vf_idet.c:51
#define OFFSET(x)
Definition vf_idet.c:90
static const AVFilterPad idet_inputs[]
Definition vf_idet.c:501
static int av_dict_set_fxp(AVDictionary **pm, const char *key, uint64_t value, unsigned int digits, int flags)
Definition vf_idet.c:124
static int filter_frame(AVFilterLink *link, AVFrame *picref)
Definition vf_idet.c:305
static uint64_t uintpow(uint64_t b, unsigned int e)
Definition vf_idet.c:117
#define av_cold
Definition attributes.h:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:97
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
uint8_t w
Definition llvidencdsp.c:39
#define FFMIN(a, b)
Definition macros.h:49
#define FFMAX(a, b)
Definition macros.h:47
void * av_calloc(size_t nmemb, size_t size)
Definition mem.c:370
Memory handling functions.
AVOptions.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3484
#define AV_PIX_FMT_YUV420P16
Definition pixfmt.h:559
#define AV_PIX_FMT_YUV444P12
Definition pixfmt.h:555
#define AV_PIX_FMT_YUV444P9
Definition pixfmt.h:547
#define AV_PIX_FMT_YUV420P10
Definition pixfmt.h:548
#define AV_PIX_FMT_YUV422P9
Definition pixfmt.h:546
#define AV_PIX_FMT_YUV420P12
Definition pixfmt.h:552
#define AV_PIX_FMT_YUV422P12
Definition pixfmt.h:553
#define AV_PIX_FMT_YUV422P10
Definition pixfmt.h:549
#define AV_PIX_FMT_YUV420P9
Definition pixfmt.h:545
#define AV_PIX_FMT_YUV420P14
Definition pixfmt.h:556
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition pixfmt.h:106
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition pixfmt.h:108
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition pixfmt.h:107
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition pixfmt.h:79
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition pixfmt.h:80
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition pixfmt.h:174
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition pixfmt.h:86
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition pixfmt.h:173
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition pixfmt.h:87
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition pixfmt.h:85
#define AV_PIX_FMT_YUV422P14
Definition pixfmt.h:557
#define AV_PIX_FMT_YUV422P16
Definition pixfmt.h:560
#define AV_PIX_FMT_GRAY16
Definition pixfmt.h:531
#define AV_PIX_FMT_YUV444P14
Definition pixfmt.h:558
#define AV_PIX_FMT_YUV444P16
Definition pixfmt.h:561
#define AV_PIX_FMT_YUV444P10
Definition pixfmt.h:551
Describe the class of an AVClass context structure.
Definition log.h:76
int depth
Number of bits in the component.
Definition pixdesc.h:57
An instance of a filter.
Definition avfilter.h:279
AVFilterLink ** inputs
array of pointers to input links
Definition avfilter.h:287
A filter pad used for either input or output.
Definition filters.h:40
This structure describes decoded (raw) audio or video data.
Definition frame.h:479
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:500
int width
Definition frame.h:551
int height
Definition frame.h:551
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
Definition frame.h:723
AVDictionary * metadata
metadata.
Definition frame.h:760
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition frame.h:524
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition frame.h:566
AVOption.
Definition opt.h:428
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition pixdesc.h:69
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition pixdesc.h:105
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition pixdesc.h:80
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition pixdesc.h:89
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition pixdesc.h:71
float interlace_threshold
Definition vf_idet.c:57
uint64_t total_poststat[4]
Definition vf_idet.c:70
IDETDSPContext dsp
Definition vf_idet.c:55
AVFrame * cur
Definition vf_idet.c:75
uint64_t total_prestat[4]
Definition vf_idet.c:69
Type last_type
Definition vf_idet.c:63
AVFrame * next
Definition vf_idet.c:76
const AVPixFmtDescriptor * csp
Definition vf_idet.c:83
uint8_t history[HIST_SIZE]
Definition vf_idet.c:73
int interlaced_flag_accuracy
Definition vf_idet.c:79
AVFrame * prev
Definition vf_idet.c:77
IDETSums * sums
Definition vf_idet.c:87
int analyze_interlaced_flag
Definition vf_idet.c:80
uint64_t prestat[4]
Definition vf_idet.c:66
float repeat_threshold
Definition vf_idet.c:59
uint64_t repeats[3]
Definition vf_idet.c:65
uint64_t total_repeats[3]
Definition vf_idet.c:68
uint64_t poststat[4]
Definition vf_idet.c:67
int nb_threads
Definition vf_idet.c:86
int analyze_interlaced_flag_done
Definition vf_idet.c:81
float half_life
Definition vf_idet.c:60
uint64_t decay_coefficient
Definition vf_idet.c:61
float progressive_threshold
Definition vf_idet.c:58
ff_idet_filter_func filter_line
Definition vf_idetdsp.h:27
int64_t gamma[2]
Definition vf_idet.c:47
int64_t alpha[2]
Definition vf_idet.c:45
int64_t delta
Definition vf_idet.c:46
#define lrint
Definition tablegen.h:53
#define av_freep(p)
#define av_log(a,...)
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
Definition h263dsp.c:29
@ PROGRESSIVE
in the bitstream is reported as 00b
Definition vc1.h:152
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
void av_cold ff_idet_dsp_init(IDETDSPContext *dsp, int depth)
Definition vf_idetdsp.c:56
int(* ff_idet_filter_func)(const uint8_t *a, const uint8_t *b, const uint8_t *c, int w)
Definition vf_idetdsp.h:24
float delta
#define PRECISION
Definition wavpack.c:59