FFmpeg
vf_rotate.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Stefano Sabatini
3  * Copyright (c) 2008 Vitor Sessak
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 /**
23  * @file
24  * rotation filter, partially based on the tests/rotozoom.c program
25 */
26 
27 #include "libavutil/avstring.h"
28 #include "libavutil/eval.h"
29 #include "libavutil/opt.h"
30 #include "libavutil/intreadwrite.h"
31 #include "libavutil/parseutils.h"
32 #include "libavutil/pixdesc.h"
33 
34 #include "avfilter.h"
35 #include "drawutils.h"
36 #include "internal.h"
37 #include "video.h"
38 
39 #include <float.h>
40 
41 static const char * const var_names[] = {
42  "in_w" , "iw", ///< width of the input video
43  "in_h" , "ih", ///< height of the input video
44  "out_w", "ow", ///< width of the input video
45  "out_h", "oh", ///< height of the input video
46  "hsub", "vsub",
47  "n", ///< number of frame
48  "t", ///< timestamp expressed in seconds
49  NULL
50 };
51 
52 enum var_name {
61 };
62 
63 typedef struct RotContext {
64  const AVClass *class;
65  double angle;
66  char *angle_expr_str; ///< expression for the angle
67  AVExpr *angle_expr; ///< parsed expression for the angle
69  int outh, outw;
70  uint8_t fillcolor[4]; ///< color expressed either in YUVA or RGBA colorspace for the padding area
73  int hsub, vsub;
74  int nb_planes;
76  float sinx, cosx;
80  uint8_t *(*interpolate_bilinear)(uint8_t *dst_color,
81  const uint8_t *src, int src_linesize, int src_linestep,
82  int x, int y, int max_x, int max_y);
83 } RotContext;
84 
85 typedef struct ThreadData {
86  AVFrame *in, *out;
87  int inw, inh;
88  int outw, outh;
89  int plane;
90  int xi, yi;
91  int xprime, yprime;
92  int c, s;
93 } ThreadData;
94 
95 #define OFFSET(x) offsetof(RotContext, x)
96 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
97 #define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
98 
99 static const AVOption rotate_options[] = {
100  { "angle", "set angle (in radians)", OFFSET(angle_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, 0, 0, .flags=TFLAGS },
101  { "a", "set angle (in radians)", OFFSET(angle_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, 0, 0, .flags=TFLAGS },
102  { "out_w", "set output width expression", OFFSET(outw_expr_str), AV_OPT_TYPE_STRING, {.str="iw"}, 0, 0, .flags=FLAGS },
103  { "ow", "set output width expression", OFFSET(outw_expr_str), AV_OPT_TYPE_STRING, {.str="iw"}, 0, 0, .flags=FLAGS },
104  { "out_h", "set output height expression", OFFSET(outh_expr_str), AV_OPT_TYPE_STRING, {.str="ih"}, 0, 0, .flags=FLAGS },
105  { "oh", "set output height expression", OFFSET(outh_expr_str), AV_OPT_TYPE_STRING, {.str="ih"}, 0, 0, .flags=FLAGS },
106  { "fillcolor", "set background fill color", OFFSET(fillcolor_str), AV_OPT_TYPE_STRING, {.str="black"}, 0, 0, .flags=FLAGS },
107  { "c", "set background fill color", OFFSET(fillcolor_str), AV_OPT_TYPE_STRING, {.str="black"}, 0, 0, .flags=FLAGS },
108  { "bilinear", "use bilinear interpolation", OFFSET(use_bilinear), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, .flags=FLAGS },
109  { NULL }
110 };
111 
113 
115 {
116  RotContext *rot = ctx->priv;
117 
118  if (!strcmp(rot->fillcolor_str, "none"))
119  rot->fillcolor_enable = 0;
120  else if (av_parse_color(rot->fillcolor, rot->fillcolor_str, -1, ctx) >= 0)
121  rot->fillcolor_enable = 1;
122  else
123  return AVERROR(EINVAL);
124  return 0;
125 }
126 
128 {
129  RotContext *rot = ctx->priv;
130 
131  av_expr_free(rot->angle_expr);
132  rot->angle_expr = NULL;
133 }
134 
136 {
137  static const enum AVPixelFormat pix_fmts[] = {
158  };
159 
161 }
162 
163 static double get_rotated_w(void *opaque, double angle)
164 {
165  RotContext *rot = opaque;
166  double inw = rot->var_values[VAR_IN_W];
167  double inh = rot->var_values[VAR_IN_H];
168  float sinx = sin(angle);
169  float cosx = cos(angle);
170 
171  return FFMAX(0, inh * sinx) + FFMAX(0, -inw * cosx) +
172  FFMAX(0, inw * cosx) + FFMAX(0, -inh * sinx);
173 }
174 
175 static double get_rotated_h(void *opaque, double angle)
176 {
177  RotContext *rot = opaque;
178  double inw = rot->var_values[VAR_IN_W];
179  double inh = rot->var_values[VAR_IN_H];
180  float sinx = sin(angle);
181  float cosx = cos(angle);
182 
183  return FFMAX(0, -inh * cosx) + FFMAX(0, -inw * sinx) +
184  FFMAX(0, inh * cosx) + FFMAX(0, inw * sinx);
185 }
186 
187 static double (* const func1[])(void *, double) = {
190  NULL
191 };
192 
193 static const char * const func1_names[] = {
194  "rotw",
195  "roth",
196  NULL
197 };
198 
199 #define FIXP (1<<16)
200 #define FIXP2 (1<<20)
201 #define INT_PI 3294199 //(M_PI * FIXP2)
202 
203 /**
204  * Compute the sin of a using integer values.
205  * Input is scaled by FIXP2 and output values are scaled by FIXP.
206  */
207 static int64_t int_sin(int64_t a)
208 {
209  int64_t a2, res = 0;
210  int i;
211  if (a < 0) a = INT_PI-a; // 0..inf
212  a %= 2 * INT_PI; // 0..2PI
213 
214  if (a >= INT_PI*3/2) a -= 2*INT_PI; // -PI/2 .. 3PI/2
215  if (a >= INT_PI/2 ) a = INT_PI - a; // -PI/2 .. PI/2
216 
217  /* compute sin using Taylor series approximated to the fifth term */
218  a2 = (a*a)/(FIXP2);
219  for (i = 2; i < 11; i += 2) {
220  res += a;
221  a = -a*a2 / (FIXP2*i*(i+1));
222  }
223  return (res + 8)>>4;
224 }
225 
226 /**
227  * Interpolate the color in src at position x and y using bilinear
228  * interpolation.
229  */
230 static uint8_t *interpolate_bilinear8(uint8_t *dst_color,
231  const uint8_t *src, int src_linesize, int src_linestep,
232  int x, int y, int max_x, int max_y)
233 {
234  int int_x = av_clip(x>>16, 0, max_x);
235  int int_y = av_clip(y>>16, 0, max_y);
236  int frac_x = x&0xFFFF;
237  int frac_y = y&0xFFFF;
238  int i;
239  int int_x1 = FFMIN(int_x+1, max_x);
240  int int_y1 = FFMIN(int_y+1, max_y);
241 
242  for (i = 0; i < src_linestep; i++) {
243  int s00 = src[src_linestep * int_x + i + src_linesize * int_y ];
244  int s01 = src[src_linestep * int_x1 + i + src_linesize * int_y ];
245  int s10 = src[src_linestep * int_x + i + src_linesize * int_y1];
246  int s11 = src[src_linestep * int_x1 + i + src_linesize * int_y1];
247  int s0 = (((1<<16) - frac_x)*s00 + frac_x*s01);
248  int s1 = (((1<<16) - frac_x)*s10 + frac_x*s11);
249 
250  dst_color[i] = ((int64_t)((1<<16) - frac_y)*s0 + (int64_t)frac_y*s1) >> 32;
251  }
252 
253  return dst_color;
254 }
255 
256 /**
257  * Interpolate the color in src at position x and y using bilinear
258  * interpolation.
259  */
260 static uint8_t *interpolate_bilinear16(uint8_t *dst_color,
261  const uint8_t *src, int src_linesize, int src_linestep,
262  int x, int y, int max_x, int max_y)
263 {
264  int int_x = av_clip(x>>16, 0, max_x);
265  int int_y = av_clip(y>>16, 0, max_y);
266  int frac_x = x&0xFFFF;
267  int frac_y = y&0xFFFF;
268  int i;
269  int int_x1 = FFMIN(int_x+1, max_x);
270  int int_y1 = FFMIN(int_y+1, max_y);
271 
272  for (i = 0; i < src_linestep; i+=2) {
273  int s00 = AV_RL16(&src[src_linestep * int_x + i + src_linesize * int_y ]);
274  int s01 = AV_RL16(&src[src_linestep * int_x1 + i + src_linesize * int_y ]);
275  int s10 = AV_RL16(&src[src_linestep * int_x + i + src_linesize * int_y1]);
276  int s11 = AV_RL16(&src[src_linestep * int_x1 + i + src_linesize * int_y1]);
277  int s0 = (((1<<16) - frac_x)*s00 + frac_x*s01);
278  int s1 = (((1<<16) - frac_x)*s10 + frac_x*s11);
279 
280  AV_WL16(&dst_color[i], ((int64_t)((1<<16) - frac_y)*s0 + (int64_t)frac_y*s1) >> 32);
281  }
282 
283  return dst_color;
284 }
285 
286 static int config_props(AVFilterLink *outlink)
287 {
288  AVFilterContext *ctx = outlink->src;
289  RotContext *rot = ctx->priv;
290  AVFilterLink *inlink = ctx->inputs[0];
291  const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(inlink->format);
292  int ret;
293  double res;
294  char *expr;
295 
296  ff_draw_init(&rot->draw, inlink->format, 0);
297  ff_draw_color(&rot->draw, &rot->color, rot->fillcolor);
298 
299  rot->hsub = pixdesc->log2_chroma_w;
300  rot->vsub = pixdesc->log2_chroma_h;
301 
302  if (pixdesc->comp[0].depth == 8)
304  else
306 
307  rot->var_values[VAR_IN_W] = rot->var_values[VAR_IW] = inlink->w;
308  rot->var_values[VAR_IN_H] = rot->var_values[VAR_IH] = inlink->h;
309  rot->var_values[VAR_HSUB] = 1<<rot->hsub;
310  rot->var_values[VAR_VSUB] = 1<<rot->vsub;
311  rot->var_values[VAR_N] = NAN;
312  rot->var_values[VAR_T] = NAN;
313  rot->var_values[VAR_OUT_W] = rot->var_values[VAR_OW] = NAN;
314  rot->var_values[VAR_OUT_H] = rot->var_values[VAR_OH] = NAN;
315 
316  av_expr_free(rot->angle_expr);
317  rot->angle_expr = NULL;
318  if ((ret = av_expr_parse(&rot->angle_expr, expr = rot->angle_expr_str, var_names,
319  func1_names, func1, NULL, NULL, 0, ctx)) < 0) {
321  "Error occurred parsing angle expression '%s'\n", rot->angle_expr_str);
322  return ret;
323  }
324 
325 #define SET_SIZE_EXPR(name, opt_name) do { \
326  ret = av_expr_parse_and_eval(&res, expr = rot->name##_expr_str, \
327  var_names, rot->var_values, \
328  func1_names, func1, NULL, NULL, rot, 0, ctx); \
329  if (ret < 0 || isnan(res) || isinf(res) || res <= 0) { \
330  av_log(ctx, AV_LOG_ERROR, \
331  "Error parsing or evaluating expression for option %s: " \
332  "invalid expression '%s' or non-positive or indefinite value %f\n", \
333  opt_name, expr, res); \
334  return ret; \
335  } \
336 } while (0)
337 
338  /* evaluate width and height */
339  av_expr_parse_and_eval(&res, expr = rot->outw_expr_str, var_names, rot->var_values,
340  func1_names, func1, NULL, NULL, rot, 0, ctx);
341  rot->var_values[VAR_OUT_W] = rot->var_values[VAR_OW] = res;
342  rot->outw = res + 0.5;
343  SET_SIZE_EXPR(outh, "out_h");
344  rot->var_values[VAR_OUT_H] = rot->var_values[VAR_OH] = res;
345  rot->outh = res + 0.5;
346 
347  /* evaluate the width again, as it may depend on the evaluated output height */
348  SET_SIZE_EXPR(outw, "out_w");
349  rot->var_values[VAR_OUT_W] = rot->var_values[VAR_OW] = res;
350  rot->outw = res + 0.5;
351 
352  /* compute number of planes */
353  rot->nb_planes = av_pix_fmt_count_planes(inlink->format);
354  outlink->w = rot->outw;
355  outlink->h = rot->outh;
356  return 0;
357 }
358 
359 static av_always_inline void copy_elem(uint8_t *pout, const uint8_t *pin, int elem_size)
360 {
361  int v;
362  switch (elem_size) {
363  case 1:
364  *pout = *pin;
365  break;
366  case 2:
367  *((uint16_t *)pout) = *((uint16_t *)pin);
368  break;
369  case 3:
370  v = AV_RB24(pin);
371  AV_WB24(pout, v);
372  break;
373  case 4:
374  *((uint32_t *)pout) = *((uint32_t *)pin);
375  break;
376  default:
377  memcpy(pout, pin, elem_size);
378  break;
379  }
380 }
381 
382 static av_always_inline void simple_rotate_internal(uint8_t *dst, const uint8_t *src, int src_linesize, int angle, int elem_size, int len)
383 {
384  int i;
385  switch(angle) {
386  case 0:
387  memcpy(dst, src, elem_size * len);
388  break;
389  case 1:
390  for (i = 0; i<len; i++)
391  copy_elem(dst + i*elem_size, src + (len-i-1)*src_linesize, elem_size);
392  break;
393  case 2:
394  for (i = 0; i<len; i++)
395  copy_elem(dst + i*elem_size, src + (len-i-1)*elem_size, elem_size);
396  break;
397  case 3:
398  for (i = 0; i<len; i++)
399  copy_elem(dst + i*elem_size, src + i*src_linesize, elem_size);
400  break;
401  }
402 }
403 
404 static av_always_inline void simple_rotate(uint8_t *dst, const uint8_t *src, int src_linesize, int angle, int elem_size, int len)
405 {
406  switch(elem_size) {
407  case 1 : simple_rotate_internal(dst, src, src_linesize, angle, 1, len); break;
408  case 2 : simple_rotate_internal(dst, src, src_linesize, angle, 2, len); break;
409  case 3 : simple_rotate_internal(dst, src, src_linesize, angle, 3, len); break;
410  case 4 : simple_rotate_internal(dst, src, src_linesize, angle, 4, len); break;
411  default: simple_rotate_internal(dst, src, src_linesize, angle, elem_size, len); break;
412  }
413 }
414 
415 static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
416 {
417  ThreadData *td = arg;
418  AVFrame *in = td->in;
419  AVFrame *out = td->out;
420  RotContext *rot = ctx->priv;
421  const int outw = td->outw, outh = td->outh;
422  const int inw = td->inw, inh = td->inh;
423  const int plane = td->plane;
424  const int xi = td->xi, yi = td->yi;
425  const int c = td->c, s = td->s;
426  const int start = (outh * job ) / nb_jobs;
427  const int end = (outh * (job+1)) / nb_jobs;
428  int xprime = td->xprime + start * s;
429  int yprime = td->yprime + start * c;
430  int i, j, x, y;
431 
432  for (j = start; j < end; j++) {
433  x = xprime + xi + FIXP*(inw-1)/2;
434  y = yprime + yi + FIXP*(inh-1)/2;
435 
436  if (fabs(rot->angle - 0) < FLT_EPSILON && outw == inw && outh == inh) {
437  simple_rotate(out->data[plane] + j * out->linesize[plane],
438  in->data[plane] + j * in->linesize[plane],
439  in->linesize[plane], 0, rot->draw.pixelstep[plane], outw);
440  } else if (fabs(rot->angle - M_PI/2) < FLT_EPSILON && outw == inh && outh == inw) {
441  simple_rotate(out->data[plane] + j * out->linesize[plane],
442  in->data[plane] + j * rot->draw.pixelstep[plane],
443  in->linesize[plane], 1, rot->draw.pixelstep[plane], outw);
444  } else if (fabs(rot->angle - M_PI) < FLT_EPSILON && outw == inw && outh == inh) {
445  simple_rotate(out->data[plane] + j * out->linesize[plane],
446  in->data[plane] + (outh-j-1) * in->linesize[plane],
447  in->linesize[plane], 2, rot->draw.pixelstep[plane], outw);
448  } else if (fabs(rot->angle - 3*M_PI/2) < FLT_EPSILON && outw == inh && outh == inw) {
449  simple_rotate(out->data[plane] + j * out->linesize[plane],
450  in->data[plane] + (outh-j-1) * rot->draw.pixelstep[plane],
451  in->linesize[plane], 3, rot->draw.pixelstep[plane], outw);
452  } else {
453 
454  for (i = 0; i < outw; i++) {
455  int32_t v;
456  int x1, y1;
457  uint8_t *pin, *pout;
458  x1 = x>>16;
459  y1 = y>>16;
460 
461  /* the out-of-range values avoid border artifacts */
462  if (x1 >= -1 && x1 <= inw && y1 >= -1 && y1 <= inh) {
463  uint8_t inp_inv[4]; /* interpolated input value */
464  pout = out->data[plane] + j * out->linesize[plane] + i * rot->draw.pixelstep[plane];
465  if (rot->use_bilinear) {
466  pin = rot->interpolate_bilinear(inp_inv,
467  in->data[plane], in->linesize[plane], rot->draw.pixelstep[plane],
468  x, y, inw-1, inh-1);
469  } else {
470  int x2 = av_clip(x1, 0, inw-1);
471  int y2 = av_clip(y1, 0, inh-1);
472  pin = in->data[plane] + y2 * in->linesize[plane] + x2 * rot->draw.pixelstep[plane];
473  }
474  switch (rot->draw.pixelstep[plane]) {
475  case 1:
476  *pout = *pin;
477  break;
478  case 2:
479  v = AV_RL16(pin);
480  AV_WL16(pout, v);
481  break;
482  case 3:
483  v = AV_RB24(pin);
484  AV_WB24(pout, v);
485  break;
486  case 4:
487  *((uint32_t *)pout) = *((uint32_t *)pin);
488  break;
489  default:
490  memcpy(pout, pin, rot->draw.pixelstep[plane]);
491  break;
492  }
493  }
494  x += c;
495  y -= s;
496  }
497  }
498  xprime += s;
499  yprime += c;
500  }
501 
502  return 0;
503 }
504 
506 {
507  AVFilterContext *ctx = inlink->dst;
508  AVFilterLink *outlink = ctx->outputs[0];
509  AVFrame *out;
510  RotContext *rot = ctx->priv;
511  int angle_int, s, c, plane;
512  double res;
513 
514  out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
515  if (!out) {
516  av_frame_free(&in);
517  return AVERROR(ENOMEM);
518  }
520 
521  rot->var_values[VAR_N] = inlink->frame_count_out;
522  rot->var_values[VAR_T] = TS2T(in->pts, inlink->time_base);
523  rot->angle = res = av_expr_eval(rot->angle_expr, rot->var_values, rot);
524 
525  av_log(ctx, AV_LOG_DEBUG, "n:%f time:%f angle:%f/PI\n",
526  rot->var_values[VAR_N], rot->var_values[VAR_T], rot->angle/M_PI);
527 
528  angle_int = res * FIXP * 16;
529  s = int_sin(angle_int);
530  c = int_sin(angle_int + INT_PI/2);
531 
532  /* fill background */
533  if (rot->fillcolor_enable)
534  ff_fill_rectangle(&rot->draw, &rot->color, out->data, out->linesize,
535  0, 0, outlink->w, outlink->h);
536 
537  for (plane = 0; plane < rot->nb_planes; plane++) {
538  int hsub = plane == 1 || plane == 2 ? rot->hsub : 0;
539  int vsub = plane == 1 || plane == 2 ? rot->vsub : 0;
540  const int outw = AV_CEIL_RSHIFT(outlink->w, hsub);
541  const int outh = AV_CEIL_RSHIFT(outlink->h, vsub);
542  ThreadData td = { .in = in, .out = out,
543  .inw = AV_CEIL_RSHIFT(inlink->w, hsub),
544  .inh = AV_CEIL_RSHIFT(inlink->h, vsub),
545  .outh = outh, .outw = outw,
546  .xi = -(outw-1) * c / 2, .yi = (outw-1) * s / 2,
547  .xprime = -(outh-1) * s / 2,
548  .yprime = -(outh-1) * c / 2,
549  .plane = plane, .c = c, .s = s };
550 
553  }
554 
555  av_frame_free(&in);
556  return ff_filter_frame(outlink, out);
557 }
558 
559 static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
560  char *res, int res_len, int flags)
561 {
562  RotContext *rot = ctx->priv;
563  int ret;
564 
565  if (!strcmp(cmd, "angle") || !strcmp(cmd, "a")) {
566  AVExpr *old = rot->angle_expr;
567  ret = av_expr_parse(&rot->angle_expr, args, var_names,
568  NULL, NULL, NULL, NULL, 0, ctx);
569  if (ret < 0) {
571  "Error when parsing the expression '%s' for angle command\n", args);
572  rot->angle_expr = old;
573  return ret;
574  }
575  av_expr_free(old);
576  } else
577  ret = AVERROR(ENOSYS);
578 
579  return ret;
580 }
581 
582 static const AVFilterPad rotate_inputs[] = {
583  {
584  .name = "default",
585  .type = AVMEDIA_TYPE_VIDEO,
586  .filter_frame = filter_frame,
587  },
588 };
589 
590 static const AVFilterPad rotate_outputs[] = {
591  {
592  .name = "default",
593  .type = AVMEDIA_TYPE_VIDEO,
594  .config_props = config_props,
595  },
596 };
597 
599  .name = "rotate",
600  .description = NULL_IF_CONFIG_SMALL("Rotate the input image."),
601  .priv_size = sizeof(RotContext),
602  .init = init,
603  .uninit = uninit,
608  .priv_class = &rotate_class,
610 };
RotContext::hsub
int hsub
Definition: vf_rotate.c:73
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:98
int_sin
static int64_t int_sin(int64_t a)
Compute the sin of a using integer values.
Definition: vf_rotate.c:207
AV_PIX_FMT_YUV420P9LE
@ AV_PIX_FMT_YUV420P9LE
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:147
td
#define td
Definition: regdef.h:70
FFDrawColor
Definition: drawutils.h:49
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
av_clip
#define av_clip
Definition: common.h:96
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
out
FILE * out
Definition: movenc.c:54
VAR_N
@ VAR_N
Definition: vf_rotate.c:58
FIXP2
#define FIXP2
Definition: vf_rotate.c:200
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1019
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2564
av_parse_color
int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, void *log_ctx)
Put the RGBA values that correspond to color_string in rgba_color.
Definition: parseutils.c:354
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
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:112
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:303
pixdesc.h
AVFrame::pts
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:396
AVComponentDescriptor::depth
int depth
Number of bits in the component.
Definition: pixdesc.h:57
AVOption
AVOption.
Definition: opt.h:247
VAR_T
@ VAR_T
Definition: vf_rotate.c:59
RotContext
Definition: vf_rotate.c:63
AV_PIX_FMT_YUV420P16LE
@ AV_PIX_FMT_YUV420P16LE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:121
float.h
filter_slice
static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
Definition: vf_rotate.c:415
RotContext::fillcolor
uint8_t fillcolor[4]
color expressed either in YUVA or RGBA colorspace for the padding area
Definition: vf_rotate.c:70
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
VAR_IW
@ VAR_IW
Definition: vf_rotate.c:53
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:153
ThreadData::out
AVFrame * out
Definition: af_adeclick.c:492
RotContext::color
FFDrawColor color
Definition: vf_rotate.c:79
VAR_OW
@ VAR_OW
Definition: vf_rotate.c:55
FIXP
#define FIXP
Definition: vf_rotate.c:199
video.h
interpolate_bilinear16
static uint8_t * interpolate_bilinear16(uint8_t *dst_color, const uint8_t *src, int src_linesize, int src_linestep, int x, int y, int max_x, int max_y)
Interpolate the color in src at position x and y using bilinear interpolation.
Definition: vf_rotate.c:260
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_rotate.c:559
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:317
FFDrawContext::pixelstep
int pixelstep[MAX_PLANES]
Definition: drawutils.h:39
get_rotated_h
static double get_rotated_h(void *opaque, double angle)
Definition: vf_rotate.c:175
AV_PIX_FMT_YUV444P16LE
@ AV_PIX_FMT_YUV444P16LE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:125
hsub
static void hsub(htype *dst, const htype *src, int bins)
Definition: vf_median.c:74
av_expr_parse
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
Definition: eval.c:685
ff_vf_rotate
const AVFilter ff_vf_rotate
Definition: vf_rotate.c:598
av_pix_fmt_count_planes
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2604
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(rotate)
simple_rotate_internal
static av_always_inline void simple_rotate_internal(uint8_t *dst, const uint8_t *src, int src_linesize, int angle, int elem_size, int len)
Definition: vf_rotate.c:382
RotContext::angle_expr
AVExpr * angle_expr
parsed expression for the angle
Definition: vf_rotate.c:67
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
AV_PIX_FMT_YUV420P12LE
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:233
RotContext::nb_planes
int nb_planes
Definition: vf_rotate.c:74
RotContext::angle
double angle
Definition: vf_rotate.c:65
func1_names
static const char *const func1_names[]
Definition: vf_rotate.c:193
av_expr_free
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
Definition: eval.c:336
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:50
AV_PIX_FMT_YUV420P10LE
@ AV_PIX_FMT_YUV420P10LE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:149
rotate
static void rotate(const float rot_quaternion[2][4], float *vec)
Rotate vector with given rotation quaternion.
Definition: vf_v360.c:4080
AV_PIX_FMT_YUV444P12LE
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:241
ThreadData::xi
int xi
Definition: vf_rotate.c:90
TS2T
#define TS2T(ts, tb)
Definition: internal.h:225
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
av_cold
#define av_cold
Definition: attributes.h:90
ThreadData::plane
int plane
Definition: vf_blend.c:58
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:257
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
VAR_IN_H
@ VAR_IN_H
Definition: vf_rotate.c:54
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:51
RotContext::interpolate_bilinear
uint8_t *(* interpolate_bilinear)(uint8_t *dst_color, const uint8_t *src, int src_linesize, int src_linestep, int x, int y, int max_x, int max_y)
Definition: vf_rotate.c:80
ThreadData::yi
int yi
Definition: vf_rotate.c:90
VAR_IN_W
@ VAR_IN_W
Definition: vf_rotate.c:53
s1
#define s1
Definition: regdef.h:38
ff_set_common_formats_from_list
int ff_set_common_formats_from_list(AVFilterContext *ctx, const int *fmts)
Equivalent to ff_set_common_formats(ctx, ff_make_format_list(fmts))
Definition: formats.c:698
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:290
var_name
var_name
Definition: noise_bsf.c:47
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:201
ctx
AVFormatContext * ctx
Definition: movenc.c:48
AV_RL16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:94
xi
#define xi(width, name, var, range_min, range_max, subs,...)
Definition: cbs_h2645.c:404
av_expr_eval
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
Definition: eval.c:766
AVExpr
Definition: eval.c:157
RotContext::outw
int outw
Definition: vf_rotate.c:69
ff_draw_init
int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
Init a draw context.
Definition: drawutils.c:82
AVPixFmtDescriptor::log2_chroma_w
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:80
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
NAN
#define NAN
Definition: mathematics.h:64
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:152
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_rotate.c:505
AV_PIX_FMT_YUVJ444P
@ 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:80
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:93
AV_PIX_FMT_YUV444P10LE
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:155
arg
const char * arg
Definition: jacosubdec.c:67
RotContext::use_bilinear
int use_bilinear
Definition: vf_rotate.c:75
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
fabs
static __device__ float fabs(float a)
Definition: cuda_runtime.h:182
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:537
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_rotate.c:114
AV_PIX_FMT_YUVJ420P
@ 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:78
src
#define src
Definition: vp8dsp.c:255
parseutils.h
AV_PIX_FMT_YUVA444P9LE
@ AV_PIX_FMT_YUVA444P9LE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:173
AV_PIX_FMT_YUVA420P16LE
@ AV_PIX_FMT_YUVA420P16LE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:181
AV_PIX_FMT_BGR0
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:230
ThreadData::c
int c
Definition: vf_rotate.c:92
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
AV_PIX_FMT_YUVA420P9LE
@ AV_PIX_FMT_YUVA420P9LE
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
Definition: pixfmt.h:169
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
RotContext::vsub
int vsub
Definition: vf_rotate.c:73
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
eval.h
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:68
simple_rotate
static av_always_inline void simple_rotate(uint8_t *dst, const uint8_t *src, int src_linesize, int angle, int elem_size, int len)
Definition: vf_rotate.c:404
OFFSET
#define OFFSET(x)
Definition: vf_rotate.c:95
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:117
av_expr_parse_and_eval
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
Definition: eval.c:776
VAR_VARS_NB
@ VAR_VARS_NB
Definition: vf_rotate.c:60
VAR_IH
@ VAR_IH
Definition: vf_rotate.c:54
VAR_OUT_W
@ VAR_OUT_W
Definition: vf_rotate.c:55
VAR_OH
@ VAR_OH
Definition: vf_rotate.c:56
ff_fill_rectangle
void ff_fill_rectangle(FFDrawContext *draw, FFDrawColor *color, uint8_t *dst[], int dst_linesize[], int dst_x, int dst_y, int w, int h)
Fill a rectangle with an uniform color.
Definition: drawutils.c:222
AV_WB24
#define AV_WB24(p, d)
Definition: intreadwrite.h:450
AV_WL16
#define AV_WL16(p, v)
Definition: intreadwrite.h:412
ThreadData::yprime
int yprime
Definition: vf_rotate.c:91
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
rotate_inputs
static const AVFilterPad rotate_inputs[]
Definition: vf_rotate.c:582
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:167
AV_PIX_FMT_RGB0
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition: pixfmt.h:228
AV_PIX_FMT_YUVA420P10LE
@ AV_PIX_FMT_YUVA420P10LE
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:175
rotate_outputs
static const AVFilterPad rotate_outputs[]
Definition: vf_rotate.c:590
M_PI
#define M_PI
Definition: mathematics.h:52
RotContext::outh_expr_str
char * outh_expr_str
Definition: vf_rotate.c:68
internal.h
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#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:130
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:92
SET_SIZE_EXPR
#define SET_SIZE_EXPR(name, opt_name)
rotate_options
static const AVOption rotate_options[]
Definition: vf_rotate.c:99
ThreadData::s
int s
Definition: vf_rotate.c:92
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_rotate.c:127
func1
static double(*const func1[])(void *, double)
Definition: vf_rotate.c:187
get_rotated_w
static double get_rotated_w(void *opaque, double angle)
Definition: vf_rotate.c:163
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:271
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_rotate.c:135
a2
#define a2
Definition: regdef.h:48
ff_filter_get_nb_threads
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:804
ThreadData
Used for passing data between threads.
Definition: dsddec.c:67
av_always_inline
#define av_always_inline
Definition: attributes.h:49
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
FFDrawContext
Definition: drawutils.h:35
ThreadData::xprime
int xprime
Definition: vf_rotate.c:91
len
int len
Definition: vorbis_enc_data.h:426
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:56
ff_draw_color
void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4])
Prepare a color.
Definition: drawutils.c:135
AVFilter
Filter definition.
Definition: avfilter.h:149
ret
ret
Definition: filter_design.txt:187
RotContext::fillcolor_str
char * fillcolor_str
Definition: vf_rotate.c:71
INT_PI
#define INT_PI
Definition: vf_rotate.c:201
AV_PIX_FMT_0BGR
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition: pixfmt.h:229
RotContext::cosx
float cosx
Definition: vf_rotate.c:76
RotContext::draw
FFDrawContext draw
Definition: vf_rotate.c:78
FLAGS
#define FLAGS
Definition: vf_rotate.c:96
ThreadData::outh
int outh
Definition: vf_rotate.c:88
config_props
static int config_props(AVFilterLink *outlink)
Definition: vf_rotate.c:286
ThreadData::outw
int outw
Definition: vf_rotate.c:88
RotContext::fillcolor_enable
int fillcolor_enable
Definition: vf_rotate.c:72
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
RotContext::var_values
double var_values[VAR_VARS_NB]
Definition: vf_rotate.c:77
avfilter.h
AV_PIX_FMT_YUV444P9LE
@ AV_PIX_FMT_YUV444P9LE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:153
AVPixFmtDescriptor::comp
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:105
RotContext::angle_expr_str
char * angle_expr_str
expression for the angle
Definition: vf_rotate.c:66
VAR_VSUB
@ VAR_VSUB
Definition: vf_rotate.c:57
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
AVFilterContext
An instance of a filter.
Definition: avfilter.h:346
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:121
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
RotContext::outh
int outh
Definition: vf_rotate.c:69
var_names
static const char *const var_names[]
Definition: vf_rotate.c:41
s0
#define s0
Definition: regdef.h:37
ThreadData::in
AVFrame * in
Definition: af_adecorrelate.c:171
AV_PIX_FMT_YUVA444P10LE
@ AV_PIX_FMT_YUVA444P10LE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:179
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
TFLAGS
#define TFLAGS
Definition: vf_rotate.c:97
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:241
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:153
ThreadData::inh
int inh
Definition: vf_rotate.c:87
RotContext::outw_expr_str
char * outw_expr_str
Definition: vf_rotate.c:68
int32_t
int32_t
Definition: audioconvert.c:56
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:334
AV_PIX_FMT_0RGB
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition: pixfmt.h:227
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
VAR_OUT_H
@ VAR_OUT_H
Definition: vf_rotate.c:56
interpolate_bilinear8
static uint8_t * interpolate_bilinear8(uint8_t *dst_color, const uint8_t *src, int src_linesize, int src_linestep, int x, int y, int max_x, int max_y)
Interpolate the color in src at position x and y using bilinear interpolation.
Definition: vf_rotate.c:230
avstring.h
AV_PIX_FMT_YUVA444P16LE
@ AV_PIX_FMT_YUVA444P16LE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:185
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228
drawutils.h
ff_filter_execute
static av_always_inline int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
Definition: internal.h:143
AV_RB24
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
Definition: bytestream.h:97
RotContext::sinx
float sinx
Definition: vf_rotate.c:76
copy_elem
static av_always_inline void copy_elem(uint8_t *pout, const uint8_t *pin, int elem_size)
Definition: vf_rotate.c:359
AVPixFmtDescriptor::log2_chroma_h
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:89
VAR_HSUB
@ VAR_HSUB
Definition: vf_rotate.c:57
ThreadData::inw
int inw
Definition: vf_rotate.c:87