FFmpeg
vf_pp7.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
3  * Copyright (c) 2014 Arwa Arif <arwaarif1994@gmail.com>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (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
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 /**
23  * @file
24  * Postprocessing filter - 7
25  *
26  * Originally written by Michael Niedermayer for the MPlayer
27  * project, and ported by Arwa Arif for FFmpeg.
28  */
29 
30 #include "libavutil/emms.h"
31 #include "libavutil/imgutils.h"
32 #include "libavutil/mem.h"
33 #include "libavutil/mem_internal.h"
34 #include "libavutil/opt.h"
35 #include "libavutil/pixdesc.h"
36 #include "internal.h"
37 #include "qp_table.h"
38 #include "vf_pp7.h"
39 #include "video.h"
40 
41 enum mode {
45 };
46 
47 #define OFFSET(x) offsetof(PP7Context, x)
48 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
49 static const AVOption pp7_options[] = {
50  { "qp", "force a constant quantizer parameter", OFFSET(qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 64, FLAGS },
51  { "mode", "set thresholding mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MODE_MEDIUM}, 0, 2, FLAGS, .unit = "mode" },
52  { "hard", "hard thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_HARD}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" },
53  { "soft", "soft thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_SOFT}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" },
54  { "medium", "medium thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_MEDIUM}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" },
55  { NULL }
56 };
57 
59 
60 DECLARE_ALIGNED(8, static const uint8_t, dither)[8][8] = {
61  { 0, 48, 12, 60, 3, 51, 15, 63, },
62  { 32, 16, 44, 28, 35, 19, 47, 31, },
63  { 8, 56, 4, 52, 11, 59, 7, 55, },
64  { 40, 24, 36, 20, 43, 27, 39, 23, },
65  { 2, 50, 14, 62, 1, 49, 13, 61, },
66  { 34, 18, 46, 30, 33, 17, 45, 29, },
67  { 10, 58, 6, 54, 9, 57, 5, 53, },
68  { 42, 26, 38, 22, 41, 25, 37, 21, },
69 };
70 
71 #define N0 4
72 #define N1 5
73 #define N2 10
74 #define SN0 2
75 #define SN1 2.2360679775
76 #define SN2 3.16227766017
77 #define N (1 << 16)
78 
79 static const int factor[16] = {
80  N / (N0 * N0), N / (N0 * N1), N / (N0 * N0), N / (N0 * N2),
81  N / (N1 * N0), N / (N1 * N1), N / (N1 * N0), N / (N1 * N2),
82  N / (N0 * N0), N / (N0 * N1), N / (N0 * N0), N / (N0 * N2),
83  N / (N2 * N0), N / (N2 * N1), N / (N2 * N0), N / (N2 * N2),
84 };
85 
86 static void init_thres2(PP7Context *p)
87 {
88  int qp, i;
89  int bias = 0; //FIXME
90 
91  for (qp = 0; qp < 99; qp++) {
92  for (i = 0; i < 16; i++) {
93  p->thres2[qp][i] = ((i&1) ? SN2 : SN0) * ((i&4) ? SN2 : SN0) * FFMAX(1, qp) * (1<<2) - 1 - bias;
94  }
95  }
96 }
97 
98 static inline void dctA_c(int16_t *dst, uint8_t *src, int stride)
99 {
100  int i;
101 
102  for (i = 0; i < 4; i++) {
103  int s0 = src[0 * stride] + src[6 * stride];
104  int s1 = src[1 * stride] + src[5 * stride];
105  int s2 = src[2 * stride] + src[4 * stride];
106  int s3 = src[3 * stride];
107  int s = s3 + s3;
108  s3 = s - s0;
109  s0 = s + s0;
110  s = s2 + s1;
111  s2 = s2 - s1;
112  dst[0] = s0 + s;
113  dst[2] = s0 - s;
114  dst[1] = 2 * s3 + s2;
115  dst[3] = s3 - 2 * s2;
116  src++;
117  dst += 4;
118  }
119 }
120 
121 static void dctB_c(int16_t *dst, int16_t *src)
122 {
123  int i;
124 
125  for (i = 0; i < 4; i++) {
126  int s0 = src[0 * 4] + src[6 * 4];
127  int s1 = src[1 * 4] + src[5 * 4];
128  int s2 = src[2 * 4] + src[4 * 4];
129  int s3 = src[3 * 4];
130  int s = s3 + s3;
131  s3 = s - s0;
132  s0 = s + s0;
133  s = s2 + s1;
134  s2 = s2 - s1;
135  dst[0 * 4] = s0 + s;
136  dst[2 * 4] = s0 - s;
137  dst[1 * 4] = 2 * s3 + s2;
138  dst[3 * 4] = s3 - 2 * s2;
139  src++;
140  dst++;
141  }
142 }
143 
144 static int hardthresh_c(PP7Context *p, int16_t *src, int qp)
145 {
146  int i;
147  int a;
148 
149  a = src[0] * factor[0];
150  for (i = 1; i < 16; i++) {
151  unsigned int threshold1 = p->thres2[qp][i];
152  unsigned int threshold2 = threshold1 << 1;
153  int level = src[i];
154  if (((unsigned)(level + threshold1)) > threshold2)
155  a += level * factor[i];
156  }
157  return (a + (1 << 11)) >> 12;
158 }
159 
160 static int mediumthresh_c(PP7Context *p, int16_t *src, int qp)
161 {
162  int i;
163  int a;
164 
165  a = src[0] * factor[0];
166  for (i = 1; i < 16; i++) {
167  unsigned int threshold1 = p->thres2[qp][i];
168  unsigned int threshold2 = threshold1 << 1;
169  int level = src[i];
170  if (((unsigned)(level + threshold1)) > threshold2) {
171  if (((unsigned)(level + 2 * threshold1)) > 2 * threshold2)
172  a += level * factor[i];
173  else {
174  if (level > 0)
175  a += 2 * (level - (int)threshold1) * factor[i];
176  else
177  a += 2 * (level + (int)threshold1) * factor[i];
178  }
179  }
180  }
181  return (a + (1 << 11)) >> 12;
182 }
183 
184 static int softthresh_c(PP7Context *p, int16_t *src, int qp)
185 {
186  int i;
187  int a;
188 
189  a = src[0] * factor[0];
190  for (i = 1; i < 16; i++) {
191  unsigned int threshold1 = p->thres2[qp][i];
192  unsigned int threshold2 = threshold1 << 1;
193  int level = src[i];
194  if (((unsigned)(level + threshold1)) > threshold2) {
195  if (level > 0)
196  a += (level - (int)threshold1) * factor[i];
197  else
198  a += (level + (int)threshold1) * factor[i];
199  }
200  }
201  return (a + (1 << 11)) >> 12;
202 }
203 
204 static void filter(PP7Context *p, uint8_t *dst, uint8_t *src,
205  int dst_stride, int src_stride,
206  int width, int height,
207  uint8_t *qp_store, int qp_stride, int is_luma)
208 {
209  int x, y;
210  const int stride = is_luma ? p->temp_stride : ((width + 16 + 15) & (~15));
211  uint8_t *p_src = p->src + 8 * stride;
212  int16_t *block = (int16_t *)p->src;
213  int16_t *temp = (int16_t *)(p->src + 32);
214 
215  if (!src || !dst) return;
216  for (y = 0; y < height; y++) {
217  int index = 8 + 8 * stride + y * stride;
218  memcpy(p_src + index, src + y * src_stride, width);
219  for (x = 0; x < 8; x++) {
220  p_src[index - x - 1]= p_src[index + x ];
221  p_src[index + width + x ]= p_src[index + width - x - 1];
222  }
223  }
224  for (y = 0; y < 8; y++) {
225  memcpy(p_src + ( 7 - y ) * stride, p_src + ( y + 8 ) * stride, stride);
226  memcpy(p_src + (height + 8 + y) * stride, p_src + (height - y + 7) * stride, stride);
227  }
228  //FIXME (try edge emu)
229 
230  for (y = 0; y < height; y++) {
231  for (x = -8; x < 0; x += 4) {
232  const int index = x + y * stride + (8 - 3) * (1 + stride) + 8; //FIXME silly offset
233  uint8_t *src = p_src + index;
234  int16_t *tp = temp + 4 * x;
235 
236  dctA_c(tp + 4 * 8, src, stride);
237  }
238  for (x = 0; x < width; ) {
239  const int qps = 3 + is_luma;
240  int qp;
241  int end = FFMIN(x + 8, width);
242 
243  if (p->qp)
244  qp = p->qp;
245  else {
246  qp = qp_store[ (FFMIN(x, width - 1) >> qps) + (FFMIN(y, height - 1) >> qps) * qp_stride];
247  qp = ff_norm_qscale(qp, p->qscale_type);
248  }
249  for (; x < end; x++) {
250  const int index = x + y * stride + (8 - 3) * (1 + stride) + 8; //FIXME silly offset
251  uint8_t *src = p_src + index;
252  int16_t *tp = temp + 4 * x;
253  int v;
254 
255  if ((x & 3) == 0)
256  dctA_c(tp + 4 * 8, src, stride);
257 
258  p->dctB(block, tp);
259 
260  v = p->requantize(p, block, qp);
261  v = (v + dither[y & 7][x & 7]) >> 6;
262  if ((unsigned)v > 255)
263  v = (-v) >> 31;
264  dst[x + y * dst_stride] = v;
265  }
266  }
267  }
268 }
269 
270 static const enum AVPixelFormat pix_fmts[] = {
278 };
279 
281 {
282  AVFilterContext *ctx = inlink->dst;
283  PP7Context *pp7 = ctx->priv;
284  const int h = FFALIGN(inlink->h + 16, 16);
286 
287  pp7->hsub = desc->log2_chroma_w;
288  pp7->vsub = desc->log2_chroma_h;
289 
290  pp7->temp_stride = FFALIGN(inlink->w + 16, 16);
291  pp7->src = av_malloc_array(pp7->temp_stride, (h + 8) * sizeof(uint8_t));
292 
293  if (!pp7->src)
294  return AVERROR(ENOMEM);
295 
296  init_thres2(pp7);
297 
298  switch (pp7->mode) {
299  case 0: pp7->requantize = hardthresh_c; break;
300  case 1: pp7->requantize = softthresh_c; break;
301  default:
302  case 2: pp7->requantize = mediumthresh_c; break;
303  }
304 
305  pp7->dctB = dctB_c;
306 
307 #if ARCH_X86
308  ff_pp7_init_x86(pp7);
309 #endif
310 
311  return 0;
312 }
313 
315 {
316  AVFilterContext *ctx = inlink->dst;
317  PP7Context *pp7 = ctx->priv;
318  AVFilterLink *outlink = ctx->outputs[0];
319  AVFrame *out = in;
320 
321  int qp_stride = 0;
322  int8_t *qp_table = NULL;
323 
324  if (!pp7->qp) {
325  int ret = ff_qp_table_extract(in, &qp_table, &qp_stride, NULL, &pp7->qscale_type);
326  if (ret < 0) {
327  av_frame_free(&in);
328  return ret;
329  }
330  }
331 
332  if (!ctx->is_disabled) {
333  const int cw = AV_CEIL_RSHIFT(inlink->w, pp7->hsub);
334  const int ch = AV_CEIL_RSHIFT(inlink->h, pp7->vsub);
335 
336  /* get a new frame if in-place is not possible or if the dimensions
337  * are not multiple of 8 */
338  if (!av_frame_is_writable(in) || (inlink->w & 7) || (inlink->h & 7)) {
339  const int aligned_w = FFALIGN(inlink->w, 8);
340  const int aligned_h = FFALIGN(inlink->h, 8);
341 
342  out = ff_get_video_buffer(outlink, aligned_w, aligned_h);
343  if (!out) {
344  av_frame_free(&in);
345  av_freep(&qp_table);
346  return AVERROR(ENOMEM);
347  }
349  out->width = in->width;
350  out->height = in->height;
351  }
352 
353  if (qp_table || pp7->qp) {
354 
355  filter(pp7, out->data[0], in->data[0], out->linesize[0], in->linesize[0],
356  inlink->w, inlink->h, qp_table, qp_stride, 1);
357  filter(pp7, out->data[1], in->data[1], out->linesize[1], in->linesize[1],
358  cw, ch, qp_table, qp_stride, 0);
359  filter(pp7, out->data[2], in->data[2], out->linesize[2], in->linesize[2],
360  cw, ch, qp_table, qp_stride, 0);
361  emms_c();
362  }
363  }
364 
365  if (in != out) {
366  if (in->data[3])
367  av_image_copy_plane(out->data[3], out->linesize[3],
368  in ->data[3], in ->linesize[3],
369  inlink->w, inlink->h);
370  av_frame_free(&in);
371  }
372  av_freep(&qp_table);
373  return ff_filter_frame(outlink, out);
374 }
375 
377 {
378  PP7Context *pp7 = ctx->priv;
379  av_freep(&pp7->src);
380 }
381 
382 static const AVFilterPad pp7_inputs[] = {
383  {
384  .name = "default",
385  .type = AVMEDIA_TYPE_VIDEO,
386  .config_props = config_input,
387  .filter_frame = filter_frame,
388  },
389 };
390 
392  .name = "pp7",
393  .description = NULL_IF_CONFIG_SMALL("Apply Postprocessing 7 filter."),
394  .priv_size = sizeof(PP7Context),
395  .uninit = uninit,
399  .priv_class = &pp7_class,
401 };
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
OFFSET
#define OFFSET(x)
Definition: vf_pp7.c:47
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
level
uint8_t level
Definition: svq3.c:205
qp_table.h
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
mem_internal.h
out
FILE * out
Definition: movenc.c:55
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1015
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2965
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
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:160
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:374
pixdesc.h
AVFrame::width
int width
Definition: frame.h:446
pp7_options
static const AVOption pp7_options[]
Definition: vf_pp7.c:49
AVOption
AVOption.
Definition: opt.h:346
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:106
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
N2
#define N2
Definition: vf_pp7.c:73
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:170
ff_norm_qscale
static int ff_norm_qscale(int qscale, enum AVVideoEncParamsType type)
Normalize the qscale factor FIXME Add support for other values of enum AVVideoEncParamsType besides A...
Definition: qp_table.h:39
MODE_HARD
@ MODE_HARD
Definition: vf_pp7.c:42
video.h
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:395
av_image_copy_plane
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:374
init_thres2
static void init_thres2(PP7Context *p)
Definition: vf_pp7.c:86
PP7Context::requantize
int(* requantize)(struct PP7Context *p, int16_t *src, int qp)
Definition: vf_pp7.h:40
s3
#define s3
Definition: regdef.h:40
softthresh_c
static int softthresh_c(PP7Context *p, int16_t *src, int qp)
Definition: vf_pp7.c:184
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(pp7)
dctB_c
static void dctB_c(int16_t *dst, int16_t *src)
Definition: vf_pp7.c:121
FLAGS
#define FLAGS
Definition: vf_pp7.c:48
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:33
SN0
#define SN0
Definition: vf_pp7.c:74
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_pp7.c:376
av_cold
#define av_cold
Definition: attributes.h:90
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:37
hardthresh_c
static int hardthresh_c(PP7Context *p, int16_t *src, int qp)
Definition: vf_pp7.c:144
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:86
emms_c
#define emms_c()
Definition: emms.h:63
width
#define width
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:59
s1
#define s1
Definition: regdef.h:38
ctx
AVFormatContext * ctx
Definition: movenc.c:49
filter
static void filter(PP7Context *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, uint8_t *qp_store, int qp_stride, int is_luma)
Definition: vf_pp7.c:204
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:73
ff_vf_pp7
const AVFilter ff_vf_pp7
Definition: vf_pp7.c:391
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
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:87
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:709
bias
static int bias(int x, int c)
Definition: vqcdec.c:115
N
#define N
Definition: vf_pp7.c:77
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:85
mediumthresh_c
static int mediumthresh_c(PP7Context *p, int16_t *src, int qp)
Definition: vf_pp7.c:160
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
index
int index
Definition: gxfenc.c:90
PP7Context::temp_stride
int temp_stride
Definition: vf_pp7.h:37
s2
#define s2
Definition: regdef.h:39
SN2
#define SN2
Definition: vf_pp7.c:76
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:94
DECLARE_ALIGNED
#define DECLARE_ALIGNED(n, t, v)
Definition: mem_internal.h:109
N0
#define N0
Definition: vf_pp7.c:71
dither
static const uint8_t dither[8][8]
Definition: vf_pp7.c:60
vf_pp7.h
av_frame_is_writable
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
Definition: frame.c:645
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_pp7.c:314
height
#define height
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
dctA_c
static void dctA_c(int16_t *dst, uint8_t *src, int stride)
Definition: vf_pp7.c:98
PP7Context::hsub
int hsub
Definition: vf_pp7.h:35
internal.h
emms.h
PP7Context::qscale_type
enum AVVideoEncParamsType qscale_type
Definition: vf_pp7.h:34
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
av_malloc_array
#define av_malloc_array(a, b)
Definition: tableprint_vlc.h:31
PP7Context::src
uint8_t * src
Definition: vf_pp7.h:38
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
AV_PIX_FMT_YUVJ440P
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition: pixfmt.h:107
MODE_SOFT
@ MODE_SOFT
Definition: vf_pp7.c:43
PP7Context::thres2
int thres2[99][16]
Definition: vf_pp7.h:30
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:39
pp7_inputs
static const AVFilterPad pp7_inputs[]
Definition: vf_pp7.c:382
PP7Context::vsub
int vsub
Definition: vf_pp7.h:36
PP7Context::qp
int qp
Definition: vf_pp7.h:32
stride
#define stride
Definition: h264pred_template.c:537
AVFilter
Filter definition.
Definition: avfilter.h:166
ret
ret
Definition: filter_design.txt:187
ff_qp_table_extract
int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table_h, enum AVVideoEncParamsType *qscale_type)
Extract a libpostproc-compatible QP table - an 8-bit QP value per 16x16 macroblock,...
Definition: qp_table.c:27
ff_pp7_init_x86
void ff_pp7_init_x86(PP7Context *pp7)
Definition: vf_pp7_init.c:28
N1
#define N1
Definition: vf_pp7.c:72
AVFrame::height
int height
Definition: frame.h:446
PP7Context::mode
int mode
Definition: vf_pp7.h:33
mode
mode
Definition: ebur128.h:83
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
temp
else temp
Definition: vf_mcdeint.c:263
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:78
AVFilterContext
An instance of a filter.
Definition: avfilter.h:407
factor
static const int factor[16]
Definition: vf_pp7.c:79
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:165
desc
const char * desc
Definition: libsvtav1.c:75
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
mem.h
s0
#define s0
Definition: regdef.h:37
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:78
MODE_MEDIUM
@ MODE_MEDIUM
Definition: vf_pp7.c:44
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:80
PP7Context
Definition: vf_pp7.h:28
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:155
imgutils.h
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:419
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:79
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
h
h
Definition: vp9dsp_template.c:2038
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_pp7.c:270
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_pp7.c:280
int
int
Definition: ffmpeg_filter.c:424
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:244
PP7Context::dctB
void(* dctB)(int16_t *dst, int16_t *src)
Definition: vf_pp7.h:41