1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (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
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19 #include <string.h>
21
24
27 #define STRIDE (WIDTH + 32)
28
30 {
32
35 unsigned threshold);
36
38 for (
int y = 0; y <
HEIGHT; y++) {
39 for (
int x = 0; x <
WIDTH; x++)
41 }
42
43 const unsigned threshold = 16 << (depth - 8);
44
46 if (depth == 16)
48
50 /* Ensure odd tail is handled correctly */
53 if (count_ref != count_new) {
54 fprintf(stderr, "blackdetect%d: count mismatch: %u != %u\n",
55 depth, count_ref, count_new);
57 }
59 }
60 }
61
63 {
66
69 }