FFmpeg
vf_super2xsai.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010 Niel van der Westhuizen <nielkie@gmail.com>
3  * Copyright (c) 2002 A'rpi
4  * Copyright (c) 1997-2001 ZSNES Team ( zsknight@zsnes.com / _demo_@zsnes.com )
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 /**
24  * @file
25  * Super 2xSaI video filter
26  * Ported from MPlayer libmpcodecs/vf_2xsai.c.
27  */
28 
29 #include "libavutil/pixdesc.h"
30 #include "libavutil/intreadwrite.h"
31 #include "avfilter.h"
32 #include "internal.h"
33 #include "video.h"
34 
35 typedef struct Super2xSaIContext {
36  /* masks used for two pixels interpolation */
37  uint32_t hi_pixel_mask;
38  uint32_t lo_pixel_mask;
39 
40  /* masks used for four pixels interpolation */
41  uint32_t q_hi_pixel_mask;
42  uint32_t q_lo_pixel_mask;
43 
44  int bpp; ///< bytes per pixel, pixel stride for each (packed) pixel
45  int is_be;
47 
48 typedef struct ThreadData {
49  AVFrame *in, *out;
50 } ThreadData;
51 
52 #define GET_RESULT(A, B, C, D) ((A != C || A != D) - (B != C || B != D))
53 
54 #define INTERPOLATE(A, B) (((A & hi_pixel_mask) >> 1) + ((B & hi_pixel_mask) >> 1) + (A & B & lo_pixel_mask))
55 
56 #define Q_INTERPOLATE(A, B, C, D) ((A & q_hi_pixel_mask) >> 2) + ((B & q_hi_pixel_mask) >> 2) + ((C & q_hi_pixel_mask) >> 2) + ((D & q_hi_pixel_mask) >> 2) \
57  + ((((A & q_lo_pixel_mask) + (B & q_lo_pixel_mask) + (C & q_lo_pixel_mask) + (D & q_lo_pixel_mask)) >> 2) & q_lo_pixel_mask)
58 
59 static int super2xsai(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
60 {
61  Super2xSaIContext *s = ctx->priv;
62  ThreadData *td = arg;
63  AVFrame *in = td->in;
64  AVFrame *out = td->out;
65  const uint8_t *src = in->data[0];
66  uint8_t *dst = out->data[0];
67  const int src_linesize = in->linesize[0];
68  const int dst_linesize = out->linesize[0];
69  const int width = in->width;
70  const int height = in->height;
71  unsigned int x, y;
72  uint32_t color[4][4];
73  const uint8_t *src_line[4];
74  const int bpp = s->bpp;
75  const uint32_t hi_pixel_mask = s->hi_pixel_mask;
76  const uint32_t lo_pixel_mask = s->lo_pixel_mask;
77  const uint32_t q_hi_pixel_mask = s->q_hi_pixel_mask;
78  const uint32_t q_lo_pixel_mask = s->q_lo_pixel_mask;
79  const int slice_start = (height * jobnr) / nb_jobs;
80  const int slice_end = (height * (jobnr+1)) / nb_jobs;
81 
82  /* Point to the first 4 lines, first line is duplicated */
83  src_line[0] = src + src_linesize*FFMAX(slice_start - 1, 0);
84  src_line[1] = src + src_linesize*slice_start;
85  src_line[2] = src + src_linesize*FFMIN(slice_start + 1, height-1);
86  src_line[3] = src + src_linesize*FFMIN(slice_start + 2, height-1);
87 
88 #define READ_COLOR4(dst, src_line, off) dst = *((const uint32_t *)src_line + off)
89 #define READ_COLOR3(dst, src_line, off) dst = AV_RL24 (src_line + 3*off)
90 #define READ_COLOR2(dst, src_line, off) dst = s->is_be ? AV_RB16(src_line + 2 * off) : AV_RL16(src_line + 2 * off)
91 
92  for (y = slice_start; y < slice_end; y++) {
93  uint8_t *dst_line[2];
94 
95  dst_line[0] = dst + dst_linesize*2*y;
96  dst_line[1] = dst + dst_linesize*(2*y+1);
97 
98  switch (bpp) {
99  case 4:
100  READ_COLOR4(color[0][0], src_line[0], 0); color[0][1] = color[0][0]; READ_COLOR4(color[0][2], src_line[0], 1); READ_COLOR4(color[0][3], src_line[0], 2);
101  READ_COLOR4(color[1][0], src_line[1], 0); color[1][1] = color[1][0]; READ_COLOR4(color[1][2], src_line[1], 1); READ_COLOR4(color[1][3], src_line[1], 2);
102  READ_COLOR4(color[2][0], src_line[2], 0); color[2][1] = color[2][0]; READ_COLOR4(color[2][2], src_line[2], 1); READ_COLOR4(color[2][3], src_line[2], 2);
103  READ_COLOR4(color[3][0], src_line[3], 0); color[3][1] = color[3][0]; READ_COLOR4(color[3][2], src_line[3], 1); READ_COLOR4(color[3][3], src_line[3], 2);
104  break;
105  case 3:
106  READ_COLOR3(color[0][0], src_line[0], 0); color[0][1] = color[0][0]; READ_COLOR3(color[0][2], src_line[0], 1); READ_COLOR3(color[0][3], src_line[0], 2);
107  READ_COLOR3(color[1][0], src_line[1], 0); color[1][1] = color[1][0]; READ_COLOR3(color[1][2], src_line[1], 1); READ_COLOR3(color[1][3], src_line[1], 2);
108  READ_COLOR3(color[2][0], src_line[2], 0); color[2][1] = color[2][0]; READ_COLOR3(color[2][2], src_line[2], 1); READ_COLOR3(color[2][3], src_line[2], 2);
109  READ_COLOR3(color[3][0], src_line[3], 0); color[3][1] = color[3][0]; READ_COLOR3(color[3][2], src_line[3], 1); READ_COLOR3(color[3][3], src_line[3], 2);
110  break;
111  default:
112  READ_COLOR2(color[0][0], src_line[0], 0); color[0][1] = color[0][0]; READ_COLOR2(color[0][2], src_line[0], 1); READ_COLOR2(color[0][3], src_line[0], 2);
113  READ_COLOR2(color[1][0], src_line[1], 0); color[1][1] = color[1][0]; READ_COLOR2(color[1][2], src_line[1], 1); READ_COLOR2(color[1][3], src_line[1], 2);
114  READ_COLOR2(color[2][0], src_line[2], 0); color[2][1] = color[2][0]; READ_COLOR2(color[2][2], src_line[2], 1); READ_COLOR2(color[2][3], src_line[2], 2);
115  READ_COLOR2(color[3][0], src_line[3], 0); color[3][1] = color[3][0]; READ_COLOR2(color[3][2], src_line[3], 1); READ_COLOR2(color[3][3], src_line[3], 2);
116  }
117 
118  for (x = 0; x < width; x++) {
119  uint32_t product1a, product1b, product2a, product2b;
120 
121 //--------------------------------------- B0 B1 B2 B3 0 1 2 3
122 // 4 5* 6 S2 -> 4 5* 6 7
123 // 1 2 3 S1 8 9 10 11
124 // A0 A1 A2 A3 12 13 14 15
125 //--------------------------------------
126  if (color[2][1] == color[1][2] && color[1][1] != color[2][2]) {
127  product2b = color[2][1];
128  product1b = product2b;
129  } else if (color[1][1] == color[2][2] && color[2][1] != color[1][2]) {
130  product2b = color[1][1];
131  product1b = product2b;
132  } else if (color[1][1] == color[2][2] && color[2][1] == color[1][2]) {
133  int r = 0;
134 
135  r += GET_RESULT(color[1][2], color[1][1], color[1][0], color[3][1]);
136  r += GET_RESULT(color[1][2], color[1][1], color[2][0], color[0][1]);
137  r += GET_RESULT(color[1][2], color[1][1], color[3][2], color[2][3]);
138  r += GET_RESULT(color[1][2], color[1][1], color[0][2], color[1][3]);
139 
140  if (r > 0)
141  product1b = color[1][2];
142  else if (r < 0)
143  product1b = color[1][1];
144  else
145  product1b = INTERPOLATE(color[1][1], color[1][2]);
146 
147  product2b = product1b;
148  } else {
149  if (color[1][2] == color[2][2] && color[2][2] == color[3][1] && color[2][1] != color[3][2] && color[2][2] != color[3][0])
150  product2b = Q_INTERPOLATE(color[2][2], color[2][2], color[2][2], color[2][1]);
151  else if (color[1][1] == color[2][1] && color[2][1] == color[3][2] && color[3][1] != color[2][2] && color[2][1] != color[3][3])
152  product2b = Q_INTERPOLATE(color[2][1], color[2][1], color[2][1], color[2][2]);
153  else
154  product2b = INTERPOLATE(color[2][1], color[2][2]);
155 
156  if (color[1][2] == color[2][2] && color[1][2] == color[0][1] && color[1][1] != color[0][2] && color[1][2] != color[0][0])
157  product1b = Q_INTERPOLATE(color[1][2], color[1][2], color[1][2], color[1][1]);
158  else if (color[1][1] == color[2][1] && color[1][1] == color[0][2] && color[0][1] != color[1][2] && color[1][1] != color[0][3])
159  product1b = Q_INTERPOLATE(color[1][2], color[1][1], color[1][1], color[1][1]);
160  else
161  product1b = INTERPOLATE(color[1][1], color[1][2]);
162  }
163 
164  if (color[1][1] == color[2][2] && color[2][1] != color[1][2] && color[1][0] == color[1][1] && color[1][1] != color[3][2])
165  product2a = INTERPOLATE(color[2][1], color[1][1]);
166  else if (color[1][1] == color[2][0] && color[1][2] == color[1][1] && color[1][0] != color[2][1] && color[1][1] != color[3][0])
167  product2a = INTERPOLATE(color[2][1], color[1][1]);
168  else
169  product2a = color[2][1];
170 
171  if (color[2][1] == color[1][2] && color[1][1] != color[2][2] && color[2][0] == color[2][1] && color[2][1] != color[0][2])
172  product1a = INTERPOLATE(color[2][1], color[1][1]);
173  else if (color[1][0] == color[2][1] && color[2][2] == color[2][1] && color[2][0] != color[1][1] && color[2][1] != color[0][0])
174  product1a = INTERPOLATE(color[2][1], color[1][1]);
175  else
176  product1a = color[1][1];
177 
178  /* Set the calculated pixels */
179  switch (bpp) {
180  case 4:
181  AV_WN32A(dst_line[0] + x * 8, product1a);
182  AV_WN32A(dst_line[0] + x * 8 + 4, product1b);
183  AV_WN32A(dst_line[1] + x * 8, product2a);
184  AV_WN32A(dst_line[1] + x * 8 + 4, product2b);
185  break;
186  case 3:
187  AV_WL24(dst_line[0] + x * 6, product1a);
188  AV_WL24(dst_line[0] + x * 6 + 3, product1b);
189  AV_WL24(dst_line[1] + x * 6, product2a);
190  AV_WL24(dst_line[1] + x * 6 + 3, product2b);
191  break;
192  default: // bpp = 2
193  if (s->is_be) {
194  AV_WB32(dst_line[0] + x * 4, product1a | (product1b << 16));
195  AV_WB32(dst_line[1] + x * 4, product2a | (product2b << 16));
196  } else {
197  AV_WL32(dst_line[0] + x * 4, product1a | (product1b << 16));
198  AV_WL32(dst_line[1] + x * 4, product2a | (product2b << 16));
199  }
200  }
201 
202  /* Move color matrix forward */
203  color[0][0] = color[0][1]; color[0][1] = color[0][2]; color[0][2] = color[0][3];
204  color[1][0] = color[1][1]; color[1][1] = color[1][2]; color[1][2] = color[1][3];
205  color[2][0] = color[2][1]; color[2][1] = color[2][2]; color[2][2] = color[2][3];
206  color[3][0] = color[3][1]; color[3][1] = color[3][2]; color[3][2] = color[3][3];
207 
208  if (x < width - 3) {
209  x += 3;
210  switch (bpp) {
211  case 4:
212  READ_COLOR4(color[0][3], src_line[0], x);
213  READ_COLOR4(color[1][3], src_line[1], x);
214  READ_COLOR4(color[2][3], src_line[2], x);
215  READ_COLOR4(color[3][3], src_line[3], x);
216  break;
217  case 3:
218  READ_COLOR3(color[0][3], src_line[0], x);
219  READ_COLOR3(color[1][3], src_line[1], x);
220  READ_COLOR3(color[2][3], src_line[2], x);
221  READ_COLOR3(color[3][3], src_line[3], x);
222  break;
223  default: /* case 2 */
224  READ_COLOR2(color[0][3], src_line[0], x);
225  READ_COLOR2(color[1][3], src_line[1], x);
226  READ_COLOR2(color[2][3], src_line[2], x);
227  READ_COLOR2(color[3][3], src_line[3], x);
228  }
229  x -= 3;
230  }
231  }
232 
233  /* We're done with one line, so we shift the source lines up */
234  src_line[0] = src_line[1];
235  src_line[1] = src_line[2];
236  src_line[2] = src_line[3];
237 
238  /* Read next line */
239  src_line[3] = src_line[2];
240  if (y < height - 3)
241  src_line[3] += src_linesize;
242  } // y loop
243 
244  return 0;
245 }
246 
247 static const enum AVPixelFormat pix_fmts[] = {
253 };
254 
256 {
257  Super2xSaIContext *s = inlink->dst->priv;
258 
259  s->hi_pixel_mask = 0xFEFEFEFE;
260  s->lo_pixel_mask = 0x01010101;
261  s->q_hi_pixel_mask = 0xFCFCFCFC;
262  s->q_lo_pixel_mask = 0x03030303;
263  s->bpp = 4;
264 
265  switch (inlink->format) {
266  case AV_PIX_FMT_RGB24:
267  case AV_PIX_FMT_BGR24:
268  s->bpp = 3;
269  break;
270 
271  case AV_PIX_FMT_RGB565BE:
272  case AV_PIX_FMT_BGR565BE:
273  s->is_be = 1;
274  case AV_PIX_FMT_RGB565LE:
275  case AV_PIX_FMT_BGR565LE:
276  s->hi_pixel_mask = 0xF7DEF7DE;
277  s->lo_pixel_mask = 0x08210821;
278  s->q_hi_pixel_mask = 0xE79CE79C;
279  s->q_lo_pixel_mask = 0x18631863;
280  s->bpp = 2;
281  break;
282 
283  case AV_PIX_FMT_BGR555BE:
284  case AV_PIX_FMT_RGB555BE:
285  s->is_be = 1;
286  case AV_PIX_FMT_BGR555LE:
287  case AV_PIX_FMT_RGB555LE:
288  s->hi_pixel_mask = 0x7BDE7BDE;
289  s->lo_pixel_mask = 0x04210421;
290  s->q_hi_pixel_mask = 0x739C739C;
291  s->q_lo_pixel_mask = 0x0C630C63;
292  s->bpp = 2;
293  break;
294  }
295 
296  return 0;
297 }
298 
299 static int config_output(AVFilterLink *outlink)
300 {
301  AVFilterLink *inlink = outlink->src->inputs[0];
302 
303  outlink->w = inlink->w*2;
304  outlink->h = inlink->h*2;
305 
306  av_log(inlink->dst, AV_LOG_VERBOSE, "fmt:%s size:%dx%d -> size:%dx%d\n",
307  av_get_pix_fmt_name(inlink->format),
308  inlink->w, inlink->h, outlink->w, outlink->h);
309 
310  return 0;
311 }
312 
314 {
315  AVFilterContext *ctx = inlink->dst;
316  AVFilterLink *outlink = ctx->outputs[0];
317  ThreadData td;
318  AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
319  if (!out) {
320  av_frame_free(&in);
321  return AVERROR(ENOMEM);
322  }
324  out->width = outlink->w;
325  out->height = outlink->h;
326 
327  td.in = in, td.out = out;
330 
331  av_frame_free(&in);
332  return ff_filter_frame(outlink, out);
333 }
334 
335 static const AVFilterPad super2xsai_inputs[] = {
336  {
337  .name = "default",
338  .type = AVMEDIA_TYPE_VIDEO,
339  .config_props = config_input,
340  .filter_frame = filter_frame,
341  },
342 };
343 
344 static const AVFilterPad super2xsai_outputs[] = {
345  {
346  .name = "default",
347  .type = AVMEDIA_TYPE_VIDEO,
348  .config_props = config_output,
349  },
350 };
351 
353  .name = "super2xsai",
354  .description = NULL_IF_CONFIG_SMALL("Scale the input by 2x using the Super2xSaI pixel art algorithm."),
355  .priv_size = sizeof(Super2xSaIContext),
360 };
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:112
super2xsai_outputs
static const AVFilterPad super2xsai_outputs[]
Definition: vf_super2xsai.c:344
td
#define td
Definition: regdef.h:70
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
r
const char * r
Definition: vf_curves.c:126
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
AV_WL32
#define AV_WL32(p, v)
Definition: intreadwrite.h:424
out
FILE * out
Definition: movenc.c:54
color
Definition: vf_paletteuse.c:511
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1018
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:162
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
Super2xSaIContext
Definition: vf_super2xsai.c:35
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:88
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:340
pixdesc.h
AVFrame::width
int width
Definition: frame.h:412
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_super2xsai.c:255
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:196
Super2xSaIContext::bpp
int bpp
bytes per pixel, pixel stride for each (packed) pixel
Definition: vf_super2xsai.c:44
AV_WN32A
#define AV_WN32A(p, v)
Definition: intreadwrite.h:536
Super2xSaIContext::lo_pixel_mask
uint32_t lo_pixel_mask
Definition: vf_super2xsai.c:38
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:76
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:102
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:170
ThreadData::out
AVFrame * out
Definition: af_adeclick.c:526
super2xsai_inputs
static const AVFilterPad super2xsai_inputs[]
Definition: vf_super2xsai.c:335
video.h
ThreadData::in
AVFrame * in
Definition: af_adecorrelate.c:153
AV_PIX_FMT_RGB555BE
@ AV_PIX_FMT_RGB555BE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:114
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:361
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:33
slice_start
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
Definition: vvcdec.c:685
width
#define width
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
slice_end
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Handle slice ends.
Definition: mpeg12dec.c:1717
ctx
AVFormatContext * ctx
Definition: movenc.c:48
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:100
arg
const char * arg
Definition: jacosubdec.c:67
AV_PIX_FMT_RGB565LE
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:113
NULL
#define NULL
Definition: coverity.c:32
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_super2xsai.c:313
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:637
Super2xSaIContext::q_lo_pixel_mask
uint32_t q_lo_pixel_mask
Definition: vf_super2xsai.c:42
AVFilterContext::inputs
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:415
AV_WL24
#define AV_WL24(p, d)
Definition: intreadwrite.h:462
AV_PIX_FMT_BGR565LE
@ AV_PIX_FMT_BGR565LE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Definition: pixfmt.h:118
ff_vf_super2xsai
const AVFilter ff_vf_super2xsai
Definition: vf_super2xsai.c:352
AV_PIX_FMT_BGR555BE
@ AV_PIX_FMT_BGR555BE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:119
READ_COLOR3
#define READ_COLOR3(dst, src_line, off)
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:101
Super2xSaIContext::q_hi_pixel_mask
uint32_t q_hi_pixel_mask
Definition: vf_super2xsai.c:41
Super2xSaIContext::is_be
int is_be
Definition: vf_super2xsai.c:45
AV_WB32
#define AV_WB32(p, v)
Definition: intreadwrite.h:417
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_super2xsai.c:299
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:106
READ_COLOR2
#define READ_COLOR2(dst, src_line, off)
Super2xSaIContext::hi_pixel_mask
uint32_t hi_pixel_mask
Definition: vf_super2xsai.c:37
height
#define height
super2xsai
static int super2xsai(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_super2xsai.c:59
GET_RESULT
#define GET_RESULT(A, B, C, D)
Definition: vf_super2xsai.c:52
AV_PIX_FMT_BGR565BE
@ AV_PIX_FMT_BGR565BE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:117
INTERPOLATE
#define INTERPOLATE(A, B)
Definition: vf_super2xsai.c:54
internal.h
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:99
AV_PIX_FMT_RGB555LE
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:115
ff_filter_get_nb_threads
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:825
ThreadData
Used for passing data between threads.
Definition: dsddec.c:69
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:39
AVFilter
Filter definition.
Definition: avfilter.h:166
AVFrame::height
int height
Definition: frame.h:412
Q_INTERPOLATE
#define Q_INTERPOLATE(A, B, C, D)
Definition: vf_super2xsai.c:56
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
avfilter.h
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_super2xsai.c:247
AV_PIX_FMT_RGB565BE
@ AV_PIX_FMT_RGB565BE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
Definition: pixfmt.h:112
AVFilterContext
An instance of a filter.
Definition: avfilter.h:407
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:117
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_BGR555LE
@ AV_PIX_FMT_BGR555LE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:120
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
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:385
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
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:134
av_get_pix_fmt_name
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
Definition: pixdesc.c:2882
READ_COLOR4
#define READ_COLOR4(dst, src_line, off)