FFmpeg
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
c
d
g
h
i
o
q
r
s
v
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
a
d
e
f
h
i
j
l
m
n
p
r
s
v
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
libavfilter
vf_blackdetect.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_BLACKDETECT_H
20
#define AVFILTER_BLACKDETECT_H
21
22
#include <stddef.h>
23
#include <stdint.h>
24
25
typedef
unsigned (*
ff_blackdetect_fn
)(
const
uint8_t *
src
, ptrdiff_t
stride
,
26
ptrdiff_t
width
, ptrdiff_t
height
,
27
unsigned
threshold);
28
29
ff_blackdetect_fn
ff_blackdetect_get_fn_x86
(
int
depth);
30
31
static
unsigned
count_pixels8_c
(
const
uint8_t *
src
, ptrdiff_t
stride
,
32
ptrdiff_t
width
, ptrdiff_t
height
,
33
unsigned
threshold)
34
{
35
unsigned
int
counter = 0;
36
while
(
height
--) {
37
for
(
int
x = 0; x <
width
; x++)
38
counter +=
src
[x] <= threshold;
39
src
+=
stride
;
40
}
41
return
counter;
42
}
43
44
static
unsigned
count_pixels16_c
(
const
uint8_t *
src
, ptrdiff_t
stride
,
45
ptrdiff_t
width
, ptrdiff_t
height
,
46
unsigned
threshold)
47
{
48
unsigned
int
counter = 0;
49
while
(
height
--) {
50
const
uint16_t *src16 = (
const
uint16_t *)
src
;
51
for
(
int
x = 0; x <
width
; x++)
52
counter += src16[x] <= threshold;
53
src
+=
stride
;
54
}
55
return
counter;
56
}
57
58
59
static
inline
ff_blackdetect_fn
ff_blackdetect_get_fn
(
int
depth)
60
{
61
ff_blackdetect_fn
fn
=
NULL
;
62
#if ARCH_X86
63
fn
=
ff_blackdetect_get_fn_x86
(depth);
64
#endif
65
66
if
(!
fn
)
67
fn
= depth == 8 ?
count_pixels8_c
:
count_pixels16_c
;
68
return
fn
;
69
}
70
71
#endif
/* AVFILTER_BLACKDETECT_H */
count_pixels16_c
static unsigned count_pixels16_c(const uint8_t *src, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, unsigned threshold)
Definition:
vf_blackdetect.h:44
NULL
#define NULL
Definition:
coverity.c:32
ff_blackdetect_fn
unsigned(* ff_blackdetect_fn)(const uint8_t *src, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, unsigned threshold)
Definition:
vf_blackdetect.h:25
height
#define height
Definition:
dsp.h:89
fn
#define fn(a)
Definition:
aap_template.c:37
count_pixels8_c
static unsigned count_pixels8_c(const uint8_t *src, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, unsigned threshold)
Definition:
vf_blackdetect.h:31
stride
#define stride
Definition:
h264pred_template.c:536
ff_blackdetect_get_fn
static ff_blackdetect_fn ff_blackdetect_get_fn(int depth)
Definition:
vf_blackdetect.h:59
ff_blackdetect_get_fn_x86
ff_blackdetect_fn ff_blackdetect_get_fn_x86(int depth)
Definition:
vf_blackdetect_init.c:28
width
#define width
Definition:
dsp.h:89
src
#define src
Definition:
vp8dsp.c:248
Generated on Fri Jul 25 2025 19:22:36 for FFmpeg by
1.8.17