FFmpeg
Loading...
Searching...
No Matches
vf_eq_init.c
Go to the documentation of this file.
1/*
2 *
3 * Original MPlayer filters by Richard Felker.
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
23#include "libavutil/cpu.h"
24#include "libavutil/x86/cpu.h"
25#include "libavfilter/vf_eq.h"
26
27extern void ff_process_one_line_sse2(const uint8_t *src, uint8_t *dst, short contrast,
28 short brightness, int w);
29
30static void process_sse2(EQParameters *param, uint8_t *dst, int dst_stride,
31 const uint8_t *src, int src_stride, int w, int h)
32{
33 short contrast = (short) (param->contrast * 256 * 16);
34 short brightness = ((short) (100.0 * param->brightness + 100.0) * 511)
35 / 200 - 128 - contrast / 32;
36
37 while (h--) {
38 ff_process_one_line_sse2(src, dst, contrast, brightness, w);
39 src += src_stride;
40 dst += dst_stride;
41 }
42}
43
45{
48 eq->process = process_sse2;
49 }
50}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
Macro definitions for various function/variable attributes.
#define av_cold
Definition attributes.h:117
static atomic_int cpu_flags
Definition cpu.c:56
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition cpu.c:109
#define EXTERNAL_SSE2(flags)
Definition cpu.h:53
uint8_t w
Definition llvidencdsp.c:39
double contrast
Definition vf_eq.h:51
double brightness
Definition vf_eq.h:51
#define src
Definition vp8dsp.c:248
static void process_sse2(EQParameters *param, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
Definition vf_eq_init.c:30
av_cold void ff_eq_init_x86(EQContext *eq)
Definition vf_eq_init.c:44
void ff_process_one_line_sse2(const uint8_t *src, uint8_t *dst, short contrast, short brightness, int w)
#define eq(A, B)
Definition vf_xbr.c:92