FFmpeg
vf_photosensitivity.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019, 2020, 2022, 2026 Vladimir Panteleev
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>
22 
23 #include "libavutil/opt.h"
24 #include "avfilter.h"
25 
26 #include "filters.h"
27 #include "video.h"
28 
29 #define MAX_FRAMES 240
30 #define GRID_SIZE 8
31 #define NUM_CHANNELS 3
32 
33 typedef struct PhotosensitivityFrame {
34  uint8_t grid[GRID_SIZE][GRID_SIZE][4];
36 
37 typedef struct PhotosensitivityContext {
38  const AVClass *class;
39 
40  int nb_frames;
41  int skip;
43  int bypass;
44 
46 
47  /* Circular buffer */
50 
54 
55 #define OFFSET(x) offsetof(PhotosensitivityContext, x)
56 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
57 
59  { "frames", "set how many frames to use", OFFSET(nb_frames), AV_OPT_TYPE_INT, {.i64=30}, 2, MAX_FRAMES, FLAGS },
60  { "f", "set how many frames to use", OFFSET(nb_frames), AV_OPT_TYPE_INT, {.i64=30}, 2, MAX_FRAMES, FLAGS },
61  { "threshold", "set detection threshold factor (lower is stricter)", OFFSET(threshold_multiplier), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0.1, FLT_MAX, FLAGS },
62  { "t", "set detection threshold factor (lower is stricter)", OFFSET(threshold_multiplier), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0.1, FLT_MAX, FLAGS },
63  { "skip", "set pixels to skip when sampling frames", OFFSET(skip), AV_OPT_TYPE_INT, {.i64=1}, 1, 1024, FLAGS },
64  { "bypass", "leave frames unchanged", OFFSET(bypass), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
65  { "blend", "set blending factor (0 always duplicates frames)", OFFSET(blend_factor), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, FLAGS },
66  { NULL }
67 };
68 
69 AVFILTER_DEFINE_CLASS(photosensitivity);
70 
72 {
75  int skip;
77 
78 #define NUM_CELLS (GRID_SIZE * GRID_SIZE)
79 
80 static int convert_frame_partial(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
81 {
82  int cell, gx, gy, x0, x1, y0, y1, x, y, c, area;
83  int sum[NUM_CHANNELS];
84  const uint8_t *p;
85 
87 
88  const int slice_start = ff_slice_pos(NUM_CELLS, jobnr, nb_jobs);
89  const int slice_end = ff_slice_pos(NUM_CELLS, jobnr + 1, nb_jobs);
90 
91  int width = td->in->width, height = td->in->height, linesize = td->in->linesize[0], skip = td->skip;
92  const uint8_t *data = td->in->data[0];
93 
94  for (cell = slice_start; cell < slice_end; cell++) {
95  gx = cell % GRID_SIZE;
96  gy = cell / GRID_SIZE;
97 
98  x0 = width * gx / GRID_SIZE;
99  x1 = width * (gx+1) / GRID_SIZE;
100  y0 = height * gy / GRID_SIZE;
101  y1 = height * (gy+1) / GRID_SIZE;
102 
103  for (c = 0; c < NUM_CHANNELS; c++) {
104  sum[c] = 0;
105  }
106  for (y = y0; y < y1; y += skip) {
107  p = data + y * linesize + x0 * NUM_CHANNELS;
108  for (x = x0; x < x1; x += skip) {
109  //av_log(NULL, AV_LOG_VERBOSE, "%d %d %d : (%d,%d) (%d,%d) -> %d,%d | *%d\n", c, gx, gy, x0, y0, x1, y1, x, y, (int)row);
110  sum[0] += p[0];
111  sum[1] += p[1];
112  sum[2] += p[2];
113  p += NUM_CHANNELS * skip;
114  // TODO: variable size
115  }
116  }
117 
118  area = ((x1 - x0 + skip - 1) / skip) * ((y1 - y0 + skip - 1) / skip);
119  for (c = 0; c < NUM_CHANNELS; c++) {
120  if (area)
121  sum[c] /= area;
122  td->out->grid[gy][gx][c] = sum[c];
123  }
124  }
125  return 0;
126 }
127 
129 {
131  td.in = in;
132  td.out = out;
133  td.skip = skip;
136 }
137 
139 {
142  uint16_t s_mul;
144 
145 static int blend_frame_partial(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
146 {
147  int x, y;
148  uint8_t *t, *s;
149 
151  const uint16_t s_mul = td->s_mul;
152  const uint16_t t_mul = 0x100 - s_mul;
153  const int slice_start = ff_slice_pos(td->target->height, jobnr, nb_jobs);
154  const int slice_end = ff_slice_pos(td->target->height, jobnr + 1, nb_jobs);
155  const int linesize = td->target->linesize[0];
156 
157  for (y = slice_start; y < slice_end; y++) {
158  t = td->target->data[0] + y * td->target->linesize[0];
159  s = td->source->data[0] + y * td->source->linesize[0];
160  for (x = 0; x < linesize; x++) {
161  *t = (*t * t_mul + *s * s_mul) >> 8;
162  t++; s++;
163  }
164  }
165  return 0;
166 }
167 
168 static void blend_frame(AVFilterContext *ctx, AVFrame *target, AVFrame *source, float factor)
169 {
171  td.target = target;
172  td.source = source;
173  td.s_mul = (uint16_t)(factor * 0x100);
175  FFMIN(ctx->outputs[0]->h, ff_filter_get_nb_threads(ctx)));
176 }
177 
179 {
180  int badness, x, y, c;
181  badness = 0;
182  for (c = 0; c < NUM_CHANNELS; c++) {
183  for (y = 0; y < GRID_SIZE; y++) {
184  for (x = 0; x < GRID_SIZE; x++) {
185  badness += abs((int)a->grid[y][x][c] - (int)b->grid[y][x][c]);
186  //av_log(NULL, AV_LOG_VERBOSE, "%d - %d -> %d \n", a->grid[y][x], b->grid[y][x], badness);
187  //av_log(NULL, AV_LOG_VERBOSE, "%d -> %d \n", abs((int)a->grid[y][x] - (int)b->grid[y][x]), badness);
188  }
189  }
190  }
191  return badness;
192 }
193 
195 {
196  /* const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); */
197  AVFilterContext *ctx = inlink->dst;
198  PhotosensitivityContext *s = ctx->priv;
199 
200  s->badness_threshold = (int)(GRID_SIZE * GRID_SIZE * 4 * 256 * s->threshold_multiplier / 128);
201 
202  return 0;
203 }
204 
206 {
207  int this_badness, current_badness, fixed_badness, new_badness, badness_threshold, i, res, start;
209  AVFrame *src, *out;
210  int free_in = 0;
211  float factor;
213 
214  AVFilterContext *ctx = inlink->dst;
215  AVFilterLink *outlink = ctx->outputs[0];
216  PhotosensitivityContext *s = ctx->priv;
217 
218  /* weighted moving average */
219  current_badness = 0;
220  if (s->history_size) {
221  start = s->nb_frames + s->history_pos - s->history_size;
222  for (i = 1; i < s->history_size; i++)
223  current_badness += i * s->history[(start + i) % s->nb_frames];
224  current_badness /= s->history_size;
225  badness_threshold = s->badness_threshold * s->history_size;
226  } else {
227  badness_threshold = INT_MAX;
228  }
229 
230  convert_frame(ctx, in, &ef, s->skip);
231  this_badness = get_badness(&ef, &s->last_frame_e);
232  new_badness = current_badness + this_badness;
233  av_log(ctx, AV_LOG_VERBOSE, "badness: %6d -> %6d / %6d (%3d%% - %s)\n",
234  current_badness, new_badness, badness_threshold,
235  100 * new_badness / badness_threshold, new_badness < badness_threshold ? "OK" : "EXCEEDED");
236 
237  if (new_badness < badness_threshold || !s->last_frame_av || s->bypass) {
238  factor = 1; /* for metadata */
239  av_frame_free(&s->last_frame_av);
240  s->last_frame_av = src = in;
241  s->last_frame_e = ef;
242  fixed_badness = new_badness;
243  } else {
244  factor = (float)(badness_threshold - current_badness) / (new_badness - current_badness) * s->blend_factor;
245  if (factor <= 0) {
246  /* just duplicate the frame */
247  this_badness = 0; /* frame was duplicated, thus, delta is zero */
248  fixed_badness = current_badness;
249  } else {
250  res = ff_inlink_make_frame_writable(inlink, &s->last_frame_av);
251  if (res) {
252  av_frame_free(&in);
253  return res;
254  }
255  blend_frame(ctx, s->last_frame_av, in, factor);
256 
257  convert_frame(ctx, s->last_frame_av, &ef, s->skip);
258  this_badness = get_badness(&ef, &s->last_frame_e);
259  fixed_badness = current_badness + this_badness;
260  av_log(ctx, AV_LOG_VERBOSE, " fixed: %6d -> %6d / %6d (%3d%%) factor=%5.3f\n",
261  current_badness, fixed_badness, badness_threshold,
262  100 * new_badness / badness_threshold, factor);
263  s->last_frame_e = ef;
264  }
265  src = s->last_frame_av;
266  free_in = 1;
267  }
268  s->history[s->history_pos] = this_badness;
269  s->history_pos = (s->history_pos + 1) % s->nb_frames;
270  if (s->history_size < s->nb_frames)
271  s->history_size++;
272 
273  out = ff_get_video_buffer(outlink, in->width, in->height);
274  if (!out) {
275  if (free_in == 1)
276  av_frame_free(&in);
277  return AVERROR(ENOMEM);
278  }
280  metadata = &out->metadata;
281  if (metadata) {
282  char value[128];
283 
284  snprintf(value, sizeof(value), "%f", (float)new_badness / badness_threshold);
285  av_dict_set(metadata, "lavfi.photosensitivity.badness", value, 0);
286 
287  snprintf(value, sizeof(value), "%f", (float)fixed_badness / badness_threshold);
288  av_dict_set(metadata, "lavfi.photosensitivity.fixed-badness", value, 0);
289 
290  snprintf(value, sizeof(value), "%f", (float)this_badness / badness_threshold);
291  av_dict_set(metadata, "lavfi.photosensitivity.frame-badness", value, 0);
292 
293  snprintf(value, sizeof(value), "%f", factor);
294  av_dict_set(metadata, "lavfi.photosensitivity.factor", value, 0);
295  }
297  if (free_in == 1)
298  av_frame_free(&in);
299  return ff_filter_frame(outlink, out);
300 }
301 
303 {
304  PhotosensitivityContext *s = ctx->priv;
305 
306  av_frame_free(&s->last_frame_av);
307 }
308 
309 static const AVFilterPad inputs[] = {
310  {
311  .name = "default",
312  .type = AVMEDIA_TYPE_VIDEO,
313  .filter_frame = filter_frame,
314  .config_props = config_input,
315  },
316 };
317 
319  .p.name = "photosensitivity",
320  .p.description = NULL_IF_CONFIG_SMALL("Filter out photosensitive epilepsy seizure-inducing flashes."),
321  .p.priv_class = &photosensitivity_class,
322  .priv_size = sizeof(PhotosensitivityContext),
323  .uninit = uninit,
327 };
ff_get_video_buffer
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:89
factor
static const int factor[16]
Definition: vf_pp7.c:98
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(photosensitivity)
AVERROR
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
opt.h
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_photosensitivity.c:194
out
static FILE * out
Definition: movenc.c:55
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1068
PhotosensitivityContext
Definition: vf_photosensitivity.c:37
av_cold
#define av_cold
Definition: attributes.h:119
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
PhotosensitivityContext::history
int history[MAX_FRAMES]
Definition: vf_photosensitivity.c:48
PhotosensitivityContext::badness_threshold
int badness_threshold
Definition: vf_photosensitivity.c:45
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:64
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:472
AVFrame::width
int width
Definition: frame.h:544
GRID_SIZE
#define GRID_SIZE
Definition: vf_photosensitivity.c:30
AVOption
AVOption.
Definition: opt.h:428
b
#define b
Definition: input.c:43
filters.h
data
const char data[16]
Definition: mxf.c:149
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:226
float.h
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:76
AVDictionary
Definition: dict.c:32
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:219
video.h
convert_frame_partial
static int convert_frame_partial(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_photosensitivity.c:80
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:493
ThreadData_blend_frame::target
AVFrame * target
Definition: vf_photosensitivity.c:140
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_photosensitivity.c:302
slice_end
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
Definition: mpeg12dec.c:1697
photosensitivity_options
static const AVOption photosensitivity_options[]
Definition: vf_photosensitivity.c:58
PhotosensitivityContext::last_frame_e
PhotosensitivityFrame last_frame_e
Definition: vf_photosensitivity.c:51
PhotosensitivityContext::last_frame_av
AVFrame * last_frame_av
Definition: vf_photosensitivity.c:52
ThreadData_convert_frame::skip
int skip
Definition: vf_photosensitivity.c:75
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:40
FILTER_PIXFMTS
#define FILTER_PIXFMTS(...)
Definition: filters.h:250
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:37
FFFilter
Definition: filters.h:267
float
float
Definition: af_crystalizer.c:122
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:265
ff_vf_photosensitivity
const FFFilter ff_vf_photosensitivity
Definition: vf_photosensitivity.c:318
PhotosensitivityContext::blend_factor
float blend_factor
Definition: vf_photosensitivity.c:42
ThreadData_convert_frame
Definition: vf_photosensitivity.c:71
PhotosensitivityFrame::grid
uint8_t grid[GRID_SIZE][GRID_SIZE][4]
Definition: vf_photosensitivity.c:34
OFFSET
#define OFFSET(x)
Definition: vf_photosensitivity.c:55
ctx
static AVFormatContext * ctx
Definition: movenc.c:49
convert_frame
static void convert_frame(AVFilterContext *ctx, AVFrame *in, PhotosensitivityFrame *out, int skip)
Definition: vf_photosensitivity.c:128
ff_inlink_make_frame_writable
int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe)
Make sure a frame is writable.
Definition: avfilter.c:1567
arg
const char * arg
Definition: jacosubdec.c:65
if
if(ret)
Definition: filter_design.txt:179
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:76
metadata
Stream codec metadata
Definition: ogg-flac-chained-meta.txt:2
NULL
#define NULL
Definition: coverity.c:32
av_frame_copy_props
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:599
FLAGS
#define FLAGS
Definition: vf_photosensitivity.c:56
ThreadData_convert_frame::out
PhotosensitivityFrame * out
Definition: vf_photosensitivity.c:74
PhotosensitivityFrame
Definition: vf_photosensitivity.c:33
abs
#define abs(x)
Definition: cuda_runtime.h:35
c
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
Definition: undefined.txt:32
PhotosensitivityContext::history_pos
int history_pos
Definition: vf_photosensitivity.c:49
source
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 the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a source
Definition: filter_design.txt:256
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:75
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:88
height
#define height
Definition: dsp.h:89
av_frame_copy
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
Definition: frame.c:711
i
#define i(width, name, range_min, range_max)
Definition: cbs_h264.c:63
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_photosensitivity.c:205
blend_frame
static void blend_frame(AVFilterContext *ctx, AVFrame *target, AVFrame *source, float factor)
Definition: vf_photosensitivity.c:168
a
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
Definition: undefined.txt:41
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition: opt.h:270
PhotosensitivityContext::skip
int skip
Definition: vf_photosensitivity.c:41
NUM_CHANNELS
#define NUM_CHANNELS
Definition: vf_photosensitivity.c:31
ff_filter_get_nb_threads
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:846
s
uint8_t s
Definition: llvidencdsp.c:39
value
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
Definition: writing_filters.txt:86
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
ThreadData_blend_frame::s_mul
uint16_t s_mul
Definition: vf_photosensitivity.c:142
AVFilterPad::name
const char * name
Pad name.
Definition: filters.h:46
slice_start
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
Definition: dec.c:844
PhotosensitivityContext::bypass
int bypass
Definition: vf_photosensitivity.c:43
ThreadData_blend_frame
Definition: vf_photosensitivity.c:138
ThreadData_blend_frame::source
AVFrame * source
Definition: vf_photosensitivity.c:141
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:264
MAX_FRAMES
#define MAX_FRAMES
Definition: vf_photosensitivity.c:29
AVFrame::height
int height
Definition: frame.h:544
blend_frame_partial
static int blend_frame_partial(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_photosensitivity.c:145
ff_filter_execute
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
Definition: avfilter.c:1696
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:258
avfilter.h
PhotosensitivityContext::history_size
int history_size
Definition: vf_photosensitivity.c:49
Windows::Graphics::DirectX::Direct3D11::p
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
Definition: vsrc_gfxcapture_winrt.hpp:53
AVFilterContext
An instance of a filter.
Definition: avfilter.h:273
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
FFFilter::p
AVFilter p
The public AVFilter.
Definition: filters.h:271
inputs
static const AVFilterPad inputs[]
Definition: vf_photosensitivity.c:309
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:326
av_dict_set
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:86
ff_slice_pos
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:763
AVFrame::linesize
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:517
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
PhotosensitivityContext::nb_frames
int nb_frames
Definition: vf_photosensitivity.c:40
get_badness
static int get_badness(PhotosensitivityFrame *a, PhotosensitivityFrame *b)
Definition: vf_photosensitivity.c:178
width
#define width
Definition: dsp.h:89
NUM_CELLS
#define NUM_CELLS
Definition: vf_photosensitivity.c:78
snprintf
#define snprintf
Definition: snprintf.h:34
PhotosensitivityContext::threshold_multiplier
float threshold_multiplier
Definition: vf_photosensitivity.c:42
skip
static void BS_FUNC() skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
Definition: bitstream_template.h:383
src
#define src
Definition: vp8dsp.c:248
ThreadData_convert_frame::in
AVFrame * in
Definition: vf_photosensitivity.c:73