FFmpeg
vf_colordetect_init.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025 Zhao Zhili <quinkblack@foxmail.com>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "libavutil/aarch64/cpu.h"
23 
24 int ff_detect_alpha_full_neon(const uint8_t *color, ptrdiff_t color_stride,
25  const uint8_t *alpha, ptrdiff_t alpha_stride,
26  ptrdiff_t width, ptrdiff_t height,
27  int alpha_max, int mpeg_range, int offset);
28 
29 int ff_detect_alpha16_full_neon(const uint8_t *color, ptrdiff_t color_stride,
30  const uint8_t *alpha, ptrdiff_t alpha_stride,
31  ptrdiff_t width, ptrdiff_t height,
32  int alpha_max, int mpeg_range, int offset);
33 
34 int ff_detect_alpha_limited_neon(const uint8_t *color, ptrdiff_t color_stride,
35  const uint8_t *alpha, ptrdiff_t alpha_stride,
36  ptrdiff_t width, ptrdiff_t height,
37  int alpha_max, int mpeg_range, int offset);
38 
39 int ff_detect_alpha16_limited_neon(const uint8_t *color, ptrdiff_t color_stride,
40  const uint8_t *alpha, ptrdiff_t alpha_stride,
41  ptrdiff_t width, ptrdiff_t height,
42  int alpha_max, int mpeg_range, int offset);
43 
44 int ff_detect_range_neon(const uint8_t *data, ptrdiff_t stride,
45  ptrdiff_t width, ptrdiff_t height,
46  int mpeg_min, int mpeg_max);
47 
48 int ff_detect_range16_neon(const uint8_t *data, ptrdiff_t stride,
49  ptrdiff_t width, ptrdiff_t height,
50  int mpeg_min, int mpeg_max);
51 
54 {
56 
57  if (have_neon(cpu_flags)) {
61  else
63  }
64 }
ff_detect_range_neon
int ff_detect_range_neon(const uint8_t *data, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, int mpeg_min, int mpeg_max)
vf_colordetect.h
color
Definition: vf_paletteuse.c:513
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:767
data
const char data[16]
Definition: mxf.c:149
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:109
cpu_flags
static atomic_int cpu_flags
Definition: cpu.c:56
av_cold
#define av_cold
Definition: attributes.h:90
color_range
color_range
Definition: vf_selectivecolor.c:43
ff_detect_range16_neon
int ff_detect_range16_neon(const uint8_t *data, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, int mpeg_min, int mpeg_max)
ff_detect_alpha16_full_neon
int ff_detect_alpha16_full_neon(const uint8_t *color, ptrdiff_t color_stride, const uint8_t *alpha, ptrdiff_t alpha_stride, ptrdiff_t width, ptrdiff_t height, int alpha_max, int mpeg_range, int offset)
ff_color_detect_dsp_init_aarch64
av_cold void ff_color_detect_dsp_init_aarch64(FFColorDetectDSPContext *dsp, int depth, enum AVColorRange color_range)
Definition: vf_colordetect_init.c:52
FFColorDetectDSPContext::detect_alpha
int(* detect_alpha)(const uint8_t *color, ptrdiff_t color_stride, const uint8_t *alpha, ptrdiff_t alpha_stride, ptrdiff_t width, ptrdiff_t height, int alpha_max, int mpeg_range, int offset)
Definition: vf_colordetect.h:44
height
#define height
Definition: dsp.h:89
ff_detect_alpha16_limited_neon
int ff_detect_alpha16_limited_neon(const uint8_t *color, ptrdiff_t color_stride, const uint8_t *alpha, ptrdiff_t alpha_stride, ptrdiff_t width, ptrdiff_t height, int alpha_max, int mpeg_range, int offset)
have_neon
#define have_neon(flags)
Definition: cpu.h:26
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
FFColorDetectDSPContext::detect_range
int(* detect_range)(const uint8_t *data, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, int mpeg_min, int mpeg_max)
Definition: vf_colordetect.h:39
stride
#define stride
Definition: h264pred_template.c:536
alpha
static const int16_t alpha[]
Definition: ilbcdata.h:55
ff_detect_alpha_limited_neon
int ff_detect_alpha_limited_neon(const uint8_t *color, ptrdiff_t color_stride, const uint8_t *alpha, ptrdiff_t alpha_stride, ptrdiff_t width, ptrdiff_t height, int alpha_max, int mpeg_range, int offset)
FFColorDetectDSPContext
Definition: vf_colordetect.h:37
ff_detect_alpha_full_neon
int ff_detect_alpha_full_neon(const uint8_t *color, ptrdiff_t color_stride, const uint8_t *alpha, ptrdiff_t alpha_stride, ptrdiff_t width, ptrdiff_t height, int alpha_max, int mpeg_range, int offset)
width
#define width
Definition: dsp.h:89
cpu.h
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:732