FFmpeg
Loading...
Searching...
No Matches
vf_limiter_init.h
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef AVFILTER_LIMITER_INIT_H
20#define AVFILTER_LIMITER_INIT_H
21
22#include "config.h"
24#include "libavutil/common.h"
25#include "limiter.h"
26
27#define LIMITER(n, type) \
28static void limiter##n(const uint8_t *src8, uint8_t *dst8, \
29 ptrdiff_t slinesize, ptrdiff_t dlinesize,\
30 int w, int h, int min, int max) \
31{ \
32 for (int y = 0; y < h; y++) { \
33 const type *src = (const type *)src8; \
34 type *dst = (type *)dst8; \
35 for (int x = 0; x < w; x++) { \
36 dst[x] = av_clip(src[x], min, max); \
37 } \
38 \
39 dst8 += dlinesize; \
40 src8 += slinesize; \
41 } \
42}
43
44LIMITER(8, uint8_t)
45LIMITER(16, uint16_t)
46
48{
49 if (depth == 8) {
50 s->limiter = limiter8;
51 } else {
52 s->limiter = limiter16;
53 }
54
55#if ARCH_X86 && HAVE_X86ASM
56 ff_limiter_init_x86(s, depth);
57#endif
58
59}
60
61#endif /* AVFILTER_LIMITER_INIT_H */
#define s(width, name)
Definition cbs_vp9.c:198
common internal and external API header
Macro definitions for various function/variable attributes.
#define av_unused
Definition attributes.h:164
void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
#define LIMITER(n, type)
static av_unused void ff_limiter_init(LimiterDSPContext *s, int depth)