FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vf_convolution.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2013 Oka Motofumi (chikuzen.mo at gmail dot com)
3  * Copyright (c) 2015 Paul B Mahol
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "libavutil/avstring.h"
23 #include "libavutil/imgutils.h"
24 #include "libavutil/opt.h"
25 #include "libavutil/pixdesc.h"
26 #include "avfilter.h"
27 #include "formats.h"
28 #include "internal.h"
29 #include "video.h"
30 
31 typedef struct ConvolutionContext {
32  const AVClass *class;
33 
34  char *matrix_str[4];
35  float rdiv[4];
36  float bias[4];
37 
38  int bstride;
40  int nb_planes;
41  int planewidth[4];
42  int planeheight[4];
43  int matrix[4][25];
44  int matrix_length[4];
45  int copy[4];
46 
49 
50 #define OFFSET(x) offsetof(ConvolutionContext, x)
51 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
52 
53 static const AVOption convolution_options[] = {
54  { "0m", "set matrix for 1st plane", OFFSET(matrix_str[0]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
55  { "1m", "set matrix for 2nd plane", OFFSET(matrix_str[1]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
56  { "2m", "set matrix for 3rd plane", OFFSET(matrix_str[2]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
57  { "3m", "set matrix for 4th plane", OFFSET(matrix_str[3]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
58  { "0rdiv", "set rdiv for 1st plane", OFFSET(rdiv[0]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
59  { "1rdiv", "set rdiv for 2nd plane", OFFSET(rdiv[1]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
60  { "2rdiv", "set rdiv for 3rd plane", OFFSET(rdiv[2]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
61  { "3rdiv", "set rdiv for 4th plane", OFFSET(rdiv[3]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
62  { "0bias", "set bias for 1st plane", OFFSET(bias[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
63  { "1bias", "set bias for 2nd plane", OFFSET(bias[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
64  { "2bias", "set bias for 3rd plane", OFFSET(bias[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
65  { "3bias", "set bias for 4th plane", OFFSET(bias[3]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
66  { NULL }
67 };
68 
69 AVFILTER_DEFINE_CLASS(convolution);
70 
71 static const int same3x3[9] = {0, 0, 0,
72  0, 1, 0,
73  0, 0, 0};
74 
75 static const int same5x5[25] = {0, 0, 0, 0, 0,
76  0, 0, 0, 0, 0,
77  0, 0, 1, 0, 0,
78  0, 0, 0, 0, 0,
79  0, 0, 0, 0, 0};
80 
82 {
83  static const enum AVPixelFormat pix_fmts[] = {
92  };
93 
94  return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
95 }
96 
97 static int config_input(AVFilterLink *inlink)
98 {
99  ConvolutionContext *s = inlink->dst->priv;
101  int ret;
102 
103  if ((ret = av_image_fill_linesizes(s->planewidth, inlink->format, inlink->w)) < 0)
104  return ret;
105 
106  s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
107  s->planeheight[0] = s->planeheight[3] = inlink->h;
108 
110 
111  s->bstride = s->planewidth[0] + 32;
112  s->buffer = av_malloc(5 * s->bstride);
113  if (!s->buffer)
114  return AVERROR(ENOMEM);
115 
116  return 0;
117 }
118 
119 static inline void line_copy8(uint8_t *line, const uint8_t *srcp, int width, int mergin)
120 {
121  int i;
122 
123  memcpy(line, srcp, width);
124 
125  for (i = mergin; i > 0; i--) {
126  line[-i] = line[i];
127  line[width - 1 + i] = line[width - 1 - i];
128  }
129 }
130 
132 {
133  const uint8_t *src = in->data[plane];
134  uint8_t *dst = out->data[plane];
135  const int stride = in->linesize[plane];
136  const int bstride = s->bstride;
137  const int height = s->planeheight[plane];
138  const int width = s->planewidth[plane];
139  uint8_t *p0 = s->buffer + 16;
140  uint8_t *p1 = p0 + bstride;
141  uint8_t *p2 = p1 + bstride;
142  uint8_t *orig = p0, *end = p2;
143  const int *matrix = s->matrix[plane];
144  const float rdiv = s->rdiv[plane];
145  const float bias = s->bias[plane];
146  int y, x;
147 
148  line_copy8(p0, src + stride, width, 1);
149  line_copy8(p1, src, width, 1);
150 
151  for (y = 0; y < height; y++) {
152  src += stride * (y < height - 1 ? 1 : -1);
153  line_copy8(p2, src, width, 1);
154 
155  for (x = 0; x < width; x++) {
156  int sum = p0[x - 1] * matrix[0] +
157  p0[x] * matrix[1] +
158  p0[x + 1] * matrix[2] +
159  p1[x - 1] * matrix[3] +
160  p1[x] * matrix[4] +
161  p1[x + 1] * matrix[5] +
162  p2[x - 1] * matrix[6] +
163  p2[x] * matrix[7] +
164  p2[x + 1] * matrix[8];
165  sum = (int)(sum * rdiv + bias + 0.5f);
166  dst[x] = av_clip_uint8(sum);
167  }
168 
169  p0 = p1;
170  p1 = p2;
171  p2 = (p2 == end) ? orig: p2 + bstride;
172  dst += out->linesize[plane];
173  }
174 }
175 
177 {
178  const uint8_t *src = in->data[plane];
179  uint8_t *dst = out->data[plane];
180  const int stride = in->linesize[plane];
181  const int bstride = s->bstride;
182  const int height = s->planeheight[plane];
183  const int width = s->planewidth[plane];
184  uint8_t *p0 = s->buffer + 16;
185  uint8_t *p1 = p0 + bstride;
186  uint8_t *p2 = p1 + bstride;
187  uint8_t *p3 = p2 + bstride;
188  uint8_t *p4 = p3 + bstride;
189  uint8_t *orig = p0, *end = p4;
190  const int *matrix = s->matrix[plane];
191  float rdiv = s->rdiv[plane];
192  float bias = s->bias[plane];
193  int y, x, i;
194 
195  line_copy8(p0, src + 2 * stride, width, 2);
196  line_copy8(p1, src + stride, width, 2);
197  line_copy8(p2, src, width, 2);
198  src += stride;
199  line_copy8(p3, src, width, 2);
200 
201 
202  for (y = 0; y < height; y++) {
203  uint8_t *array[] = {
204  p0 - 2, p0 - 1, p0, p0 + 1, p0 + 2,
205  p1 - 2, p1 - 1, p1, p1 + 1, p1 + 2,
206  p2 - 2, p2 - 1, p2, p2 + 1, p2 + 2,
207  p3 - 2, p3 - 1, p3, p3 + 1, p3 + 2,
208  p4 - 2, p4 - 1, p4, p4 + 1, p4 + 2
209  };
210 
211  src += stride * (y < height - 2 ? 1 : -1);
212  line_copy8(p4, src, width, 2);
213 
214  for (x = 0; x < width; x++) {
215  int sum = 0;
216 
217  for (i = 0; i < 25; i++) {
218  sum += *(array[i] + x) * matrix[i];
219  }
220  sum = (int)(sum * rdiv + bias + 0.5f);
221  dst[x] = av_clip_uint8(sum);
222  }
223 
224  p0 = p1;
225  p1 = p2;
226  p2 = p3;
227  p3 = p4;
228  p4 = (p4 == end) ? orig: p4 + bstride;
229  dst += out->linesize[plane];
230  }
231 }
232 
233 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
234 {
235  ConvolutionContext *s = inlink->dst->priv;
236  AVFilterLink *outlink = inlink->dst->outputs[0];
237  AVFrame *out;
238  int plane;
239 
240  out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
241  if (!out) {
242  av_frame_free(&in);
243  return AVERROR(ENOMEM);
244  }
245  av_frame_copy_props(out, in);
246 
247  for (plane = 0; plane < s->nb_planes; plane++) {
248  if (s->copy[plane]) {
249  av_image_copy_plane(out->data[plane], out->linesize[plane],
250  in->data[plane], in->linesize[plane],
251  s->planewidth[plane],
252  s->planeheight[plane]);
253  continue;
254  }
255 
256  s->filter[plane](s, in, out, plane);
257  }
258 
259  av_frame_free(&in);
260  return ff_filter_frame(outlink, out);
261 }
262 
264 {
265  ConvolutionContext *s = ctx->priv;
266  int i;
267 
268  for (i = 0; i < 4; i++) {
269  int *matrix = (int *)s->matrix[i];
270  char *p, *arg, *saveptr = NULL;
271 
272  p = s->matrix_str[i];
273  while (s->matrix_length[i] < 25) {
274  if (!(arg = av_strtok(p, " ", &saveptr)))
275  break;
276 
277  p = NULL;
278  sscanf(arg, "%d", &matrix[s->matrix_length[i]]);
279  s->matrix_length[i]++;
280  }
281 
282  if (s->matrix_length[i] == 9) {
283  if (!memcmp(matrix, same3x3, sizeof(same3x3)))
284  s->copy[i] = 1;
285  else
286  s->filter[i] = filter_3x3;
287  } else if (s->matrix_length[i] == 25) {
288  if (!memcmp(matrix, same5x5, sizeof(same5x5)))
289  s->copy[i] = 1;
290  else
291  s->filter[i] = filter_5x5;
292  } else {
293  return AVERROR(EINVAL);
294  }
295  }
296 
297  return 0;
298 }
299 
301 {
302  ConvolutionContext *s = ctx->priv;
303 
304  av_freep(&s->buffer);
305 }
306 
307 static const AVFilterPad convolution_inputs[] = {
308  {
309  .name = "default",
310  .type = AVMEDIA_TYPE_VIDEO,
311  .config_props = config_input,
312  .filter_frame = filter_frame,
313  },
314  { NULL }
315 };
316 
318  {
319  .name = "default",
320  .type = AVMEDIA_TYPE_VIDEO,
321  },
322  { NULL }
323 };
324 
326  .name = "convolution",
327  .description = NULL_IF_CONFIG_SMALL("Apply convolution filter."),
328  .priv_size = sizeof(ConvolutionContext),
329  .priv_class = &convolution_class,
330  .init = init,
331  .uninit = uninit,
333  .inputs = convolution_inputs,
334  .outputs = convolution_outputs,
336 };
int plane
Definition: avisynth_c.h:291
#define NULL
Definition: coverity.c:32
const char * s
Definition: avisynth_c.h:631
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2222
This structure describes decoded (raw) audio or video data.
Definition: frame.h:184
AVOption.
Definition: opt.h:245
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67
misc image utilities
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2262
Main libavfilter public API header.
const char * desc
Definition: nvenc.c:89
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:180
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:76
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:283
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:123
BYTE int const BYTE * srcp
Definition: avisynth_c.h:676
const char * name
Pad name.
Definition: internal.h:59
static void filter_5x5(ConvolutionContext *s, AVFrame *in, AVFrame *out, int plane)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1180
uint8_t
#define av_cold
Definition: attributes.h:82
#define av_malloc(s)
AVOptions.
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:90
#define height
static void filter_3x3(ConvolutionContext *s, AVFrame *in, AVFrame *out, int plane)
static av_cold void uninit(AVFilterContext *ctx)
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:101
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:75
A filter pad used for either input or output.
Definition: internal.h:53
static void line_copy8(uint8_t *line, const uint8_t *srcp, int width, int mergin)
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
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:153
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const AVFilterPad convolution_inputs[]
void * priv
private data for use by the filter
Definition: avfilter.h:320
const char * arg
Definition: jacosubdec.c:66
Definition: graph2dot.c:48
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
static const AVFilterPad convolution_outputs[]
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:74
#define width
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
static const AVOption convolution_options[]
AVFormatContext * ctx
Definition: movenc.c:48
static int query_formats(AVFilterContext *ctx)
static av_cold int init(AVFilterContext *ctx)
void(* filter[4])(struct ConvolutionContext *s, AVFrame *in, AVFrame *out, int plane)
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
#define src
Definition: vp9dsp.c:530
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:215
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
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
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:68
Describe the class of an AVClass context structure.
Definition: log.h:67
Filter definition.
Definition: avfilter.h:142
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:88
AVFILTER_DEFINE_CLASS(convolution)
static const int same3x3[9]
const char * name
Filter name.
Definition: avfilter.h:146
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:317
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:262
static int flags
Definition: cpu.c:47
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:198
AVFilter ff_vf_convolution
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok()...
Definition: avstring.c:184
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:105
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
Y , 8bpp.
Definition: pixfmt.h:70
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:228
static const int same5x5[25]
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:76
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:69
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:271
static int config_input(AVFilterLink *inlink)
#define FLAGS
An instance of a filter.
Definition: avfilter.h:305
#define OFFSET(x)
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:100
static int array[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:106
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:287
#define stride
internal API functions
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:580
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58