FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vf_amplify.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Paul B Mahol
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 "libavutil/imgutils.h"
22 #include "libavutil/intreadwrite.h"
23 #include "libavutil/opt.h"
24 #include "libavutil/pixdesc.h"
25 
26 #include "avfilter.h"
27 #include "formats.h"
28 #include "internal.h"
29 #include "video.h"
30 
31 typedef struct AmplifyContext {
32  const AVClass *class;
34  int radius;
35  float factor;
36  float threshold;
37  int planes;
38 
39  int llimit;
40  int hlimit;
41  int nb_inputs;
42  int nb_frames;
43 
44  int depth;
45  int nb_planes;
46  int linesize[4];
47  int height[4];
48 
51 
53 {
54  static const enum AVPixelFormat pixel_fmts[] = {
74  };
76  if (!formats)
77  return AVERROR(ENOMEM);
78  return ff_set_common_formats(ctx, formats);
79 }
80 
82 {
83  AmplifyContext *s = ctx->priv;
84 
85  s->nb_inputs = s->radius * 2 + 1;
86 
87  s->frames = av_calloc(s->nb_inputs, sizeof(*s->frames));
88  if (!s->frames)
89  return AVERROR(ENOMEM);
90 
91  return 0;
92 }
93 
94 typedef struct ThreadData {
95  AVFrame **in, *out;
96 } ThreadData;
97 
98 static int amplify_frame(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
99 {
100  AmplifyContext *s = ctx->priv;
101  ThreadData *td = arg;
102  AVFrame **in = td->in;
103  AVFrame *out = td->out;
104  const int radius = s->radius;
105  const int nb_inputs = s->nb_inputs;
106  const float threshold = s->threshold;
107  const float factor = s->factor;
108  const int llimit = s->llimit;
109  const int hlimit = s->hlimit;
110  const int depth = s->depth;
111  int i, p, x, y;
112 
113  if (s->depth <= 8) {
114  for (p = 0; p < s->nb_planes; p++) {
115  const int slice_start = (s->height[p] * jobnr) / nb_jobs;
116  const int slice_end = (s->height[p] * (jobnr+1)) / nb_jobs;
117  uint8_t *dst = out->data[p] + slice_start * out->linesize[p];
118 
119  if (!((1 << p) & s->planes)) {
120  av_image_copy_plane(dst, out->linesize[p],
121  in[radius]->data[p] + slice_start * in[radius]->linesize[p],
122  in[radius]->linesize[p],
123  s->linesize[p], slice_end - slice_start);
124  continue;
125  }
126 
127  for (y = slice_start; y < slice_end; y++) {
128  for (x = 0; x < s->linesize[p]; x++) {
129  int src = in[radius]->data[p][y * in[radius]->linesize[p] + x];
130  float diff, avg;
131  int sum = 0;
132 
133  for (i = 0; i < nb_inputs; i++) {
134  sum += in[i]->data[p][y * in[i]->linesize[p] + x];
135  }
136 
137  avg = sum / (float)nb_inputs;
138  diff = src - avg;
139  if (fabsf(diff) < threshold) {
140  int amp;
141  if (diff < 0) {
142  amp = -FFMIN(FFABS(diff * factor), llimit);
143  } else {
144  amp = FFMIN(FFABS(diff * factor), hlimit);
145  }
146  dst[x] = av_clip_uint8(src + amp);
147  } else {
148  dst[x] = src;
149  }
150  }
151 
152  dst += out->linesize[p];
153  }
154  }
155  } else {
156  for (p = 0; p < s->nb_planes; p++) {
157  const int slice_start = (s->height[p] * jobnr) / nb_jobs;
158  const int slice_end = (s->height[p] * (jobnr+1)) / nb_jobs;
159  uint16_t *dst = (uint16_t *)(out->data[p] + slice_start * out->linesize[p]);
160 
161  if (!((1 << p) & s->planes)) {
162  av_image_copy_plane((uint8_t *)dst, out->linesize[p],
163  in[radius]->data[p] + slice_start * in[radius]->linesize[p],
164  in[radius]->linesize[p],
165  s->linesize[p], slice_end - slice_start);
166  continue;
167  }
168 
169  for (y = slice_start; y < slice_end; y++) {
170  for (x = 0; x < s->linesize[p] / 2; x++) {
171  int src = AV_RN16(in[radius]->data[p] + y * in[radius]->linesize[p] + x * 2);
172  float diff, avg;
173  int sum = 0;
174 
175  for (i = 0; i < nb_inputs; i++) {
176  sum += AV_RN16(in[i]->data[p] + y * in[i]->linesize[p] + x * 2);
177  }
178 
179  avg = sum / (float)nb_inputs;
180  diff = src - avg;
181 
182  if (fabsf(diff) < threshold) {
183  int amp;
184  if (diff < 0) {
185  amp = -FFMIN(FFABS(diff * factor), llimit);
186  } else {
187  amp = FFMIN(FFABS(diff * factor), hlimit);
188  }
189  dst[x] = av_clip_uintp2_c(src + amp, depth);
190  } else {
191  dst[x] = src;
192  }
193  }
194 
195  dst += out->linesize[p] / 2;
196  }
197  }
198  }
199 
200  return 0;
201 }
202 
203 static int config_output(AVFilterLink *outlink)
204 {
205  AVFilterContext *ctx = outlink->src;
206  AmplifyContext *s = ctx->priv;
207  AVFilterLink *inlink = ctx->inputs[0];
208  int ret;
209 
210  s->desc = av_pix_fmt_desc_get(outlink->format);
211  if (!s->desc)
212  return AVERROR_BUG;
214  s->depth = s->desc->comp[0].depth;
215 
216  if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
217  return ret;
218 
219  s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, s->desc->log2_chroma_h);
220  s->height[0] = s->height[3] = inlink->h;
221 
222  return 0;
223 }
224 
226 {
227  AmplifyContext *s = ctx->priv;
228  int i;
229 
230  if (s->frames) {
231  for (i = 0; i < s->nb_frames; i++)
232  av_frame_free(&s->frames[i]);
233  }
234  av_freep(&s->frames);
235 }
236 
237 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
238 {
239  AVFilterContext *ctx = inlink->dst;
240  AVFilterLink *outlink = ctx->outputs[0];
241  AmplifyContext *s = ctx->priv;
242  ThreadData td;
243  AVFrame *out;
244 
245  if (s->nb_frames < s->nb_inputs) {
246  s->frames[s->nb_frames] = in;
247  s->nb_frames++;
248  return 0;
249  } else {
250  av_frame_free(&s->frames[0]);
251  memmove(&s->frames[0], &s->frames[1], sizeof(*s->frames) * (s->nb_inputs - 1));
252  s->frames[s->nb_inputs - 1] = in;
253  }
254 
255  out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
256  if (!out)
257  return AVERROR(ENOMEM);
258  out->pts = s->frames[0]->pts;
259 
260  td.out = out;
261  td.in = s->frames;
262  ctx->internal->execute(ctx, amplify_frame, &td, NULL, FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
263 
264  return ff_filter_frame(outlink, out);
265 }
266 
267 #define OFFSET(x) offsetof(AmplifyContext, x)
268 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
269 
270 static const AVOption amplify_options[] = {
271  { "radius", "set radius", OFFSET(radius), AV_OPT_TYPE_INT, {.i64=2}, 1, 63, .flags = FLAGS },
272  { "factor", "set factor", OFFSET(factor), AV_OPT_TYPE_FLOAT, {.dbl=2}, 0, UINT16_MAX, .flags = FLAGS },
273  { "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_FLOAT, {.dbl=10}, 0, UINT16_MAX, .flags = FLAGS },
274  { "low", "set low limit for amplification", OFFSET(llimit), AV_OPT_TYPE_INT, {.i64=UINT16_MAX}, 0, UINT16_MAX, .flags = FLAGS },
275  { "high", "set high limit for amplification", OFFSET(hlimit), AV_OPT_TYPE_INT, {.i64=UINT16_MAX}, 0, UINT16_MAX, .flags = FLAGS },
276  { "planes", "set what planes to filter", OFFSET(planes), AV_OPT_TYPE_FLAGS, {.i64=7}, 0, 15, FLAGS },
277  { NULL },
278 };
279 
280 static const AVFilterPad inputs[] = {
281  {
282  .name = "default",
283  .type = AVMEDIA_TYPE_VIDEO,
284  .filter_frame = filter_frame,
285  },
286  { NULL }
287 };
288 
289 static const AVFilterPad outputs[] = {
290  {
291  .name = "default",
292  .type = AVMEDIA_TYPE_VIDEO,
293  .config_props = config_output,
294  },
295  { NULL }
296 };
297 
298 AVFILTER_DEFINE_CLASS(amplify);
299 
301  .name = "amplify",
302  .description = NULL_IF_CONFIG_SMALL("Amplify changes between successive video frames."),
303  .priv_size = sizeof(AmplifyContext),
304  .priv_class = &amplify_class,
306  .outputs = outputs,
307  .inputs = inputs,
308  .init = init,
309  .uninit = uninit,
311 };
#define NULL
Definition: coverity.c:32
AVFrame * out
Definition: af_adeclick.c:485
#define AV_PIX_FMT_YUV440P10
Definition: pixfmt.h:381
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2446
This structure describes decoded (raw) audio or video data.
Definition: frame.h:226
AVOption.
Definition: opt.h:246
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:389
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
misc image utilities
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2486
Main libavfilter public API header.
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:395
#define AV_PIX_FMT_GRAY9
Definition: pixfmt.h:359
static const AVFilterPad inputs[]
Definition: vf_amplify.c:280
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:383
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:99
#define src
Definition: vp8dsp.c:254
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
Definition: mem.c:244
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:283
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:360
#define OFFSET(x)
Definition: vf_amplify.c:267
#define FLAGS
Definition: vf_amplify.c:268
const char * name
Pad name.
Definition: internal.h:60
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:361
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:346
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1080
AVFrame * in
Definition: af_afftdn.c:1082
static av_cold int init(AVFilterContext *ctx)
Definition: vf_amplify.c:81
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:117
uint8_t
#define av_cold
Definition: attributes.h:82
AVOptions.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:319
float threshold
Definition: vf_amplify.c:36
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:394
static int query_formats(AVFilterContext *ctx)
Definition: vf_amplify.c:52
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:100
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:392
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:384
AVFrame ** in
Definition: vf_amplify.c:95
A filter pad used for either input or output.
Definition: internal.h:54
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:568
#define td
Definition: regdef.h:70
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:101
#define AVERROR(e)
Definition: error.h:43
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:202
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
void * priv
private data for use by the filter
Definition: avfilter.h:353
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
const char * arg
Definition: jacosubdec.c:66
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_amplify.c:225
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:382
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:377
static const struct @304 planes[]
AVFrame ** frames
Definition: vf_amplify.c:49
static const AVFilterPad outputs[]
Definition: vf_amplify.c:289
int linesize[4]
Definition: vf_amplify.c:46
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:398
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:802
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:363
#define FFMIN(a, b)
Definition: common.h:96
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
AVFormatContext * ctx
Definition: movenc.c:48
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:72
#define s(width, name)
Definition: cbs_vp9.c:257
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:378
static const AVOption amplify_options[]
Definition: vf_amplify.c:270
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:397
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:390
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:387
Used for passing data between threads.
Definition: af_adeclick.c:484
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:257
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
#define AV_RN16(p)
Definition: intreadwrite.h:360
#define AV_PIX_FMT_GRAY14
Definition: pixfmt.h:362
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> in
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Definition: error.h:50
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:379
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
AVFilter ff_vf_amplify
Definition: vf_amplify.c:300
Describe the class of an AVClass context structure.
Definition: log.h:67
Filter definition.
Definition: avfilter.h:144
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.
Definition: imgutils.c:89
static const int factor[16]
Definition: vf_pp7.c:75
const char * name
Filter name.
Definition: avfilter.h:148
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:385
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:376
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:350
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:388
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:396
#define flags(name, subs,...)
Definition: cbs_av1.c:596
AVFilterInternal * internal
An opaque struct for libavfilter internal use.
Definition: avfilter.h:378
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:380
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:386
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:240
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_amplify.c:237
#define avg(a, b, c, d)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
Y , 8bpp.
Definition: pixfmt.h:74
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
static int config_output(AVFilterLink *outlink)
Definition: vf_amplify.c:203
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:73
avfilter_execute_func * execute
Definition: internal.h:155
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Handle slice ends.
Definition: mpeg12dec.c:2029
static av_always_inline int diff(const uint32_t a, const uint32_t b)
A list of supported formats for one end of a filter link.
Definition: formats.h:64
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:258
An instance of a filter.
Definition: avfilter.h:338
int height[4]
Definition: vf_amplify.c:47
FILE * out
Definition: movenc.c:54
#define av_freep(p)
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
formats
Definition: signature.h:48
AVFILTER_DEFINE_CLASS(amplify)
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.
Definition: imgutils.c:338
internal API functions
int depth
Number of bits in the component.
Definition: pixdesc.h:58
static int amplify_frame(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_amplify.c:98
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:391
const AVPixFmtDescriptor * desc
Definition: vf_amplify.c:33
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
Clip a signed integer to an unsigned power of two range.
Definition: common.h:229