pdc是什么意思| 细菌性痢疾吃什么药| 犬子是什么意思| 腺样体增生是什么意思| 辄的意思是什么| b长什么样| 徐州有什么好玩的| 喝断片了是什么意思| 补肝血吃什么药| 表面活性剂是什么| 胆红素三个指标都高是什么原因| 盆腔静脉石是什么意思| 苏木是什么意思| 煲什么汤去湿气最好| 读书心得是什么意思| 利空是什么意思| 蝉代表什么生肖| 脚板痛是什么原因| 小鸭子吃什么食物| 极有家是什么意思| 指甲盖有竖纹是什么原因| 湿疹是什么| 土色是什么颜色的图片| 青蛙为什么叫| 皮肤发白一块一块的是什么病| 阴历7月22是什么日子| 什么是面首| 悲智双运什么意思| 耳石症吃什么药| 肺和大肠相表里是什么意思| 什么是高脂肪食物| 什么叫屌丝| 疱疹挂号挂什么科室| 系统性红斑狼疮是什么病| 曹操字什么| 九头鸟是什么意思| 康熙是乾隆的什么人| 甲状腺1度肿大是什么意思| 身正不怕影子斜是什么意思| 癫疯病发作前兆有什么症状| 九三年属鸡是什么命| 胸椎退行性变什么意思| 消化快容易饿什么原因| 焦虑症是什么病| 标准差是什么意思| saa是什么意思| 宫颈hsil是什么意思| 山药有什么营养| 盆腔炎是什么病| 老百姓是什么意思| 政治庇护是什么意思| 流鼻涕是什么原因| 二聚体测定是什么| 什么是胎记| 耿耿于怀是什么意思| 心电图j点抬高什么意思| 水疗是什么意思| 寄生虫长什么样子| 97年的属什么生肖| 二月一号是什么星座| 子宫占位是什么意思| 见红是什么意思| 苕皮是什么| 特诊科是什么意思| 脾的作用和功能是什么| 月完念什么| prn是什么意思| 西柚不能和什么一起吃| 肺的主要功能是什么| 跳蚤是什么样的图片| 女人手心热吃什么药好| 锑对人体有什么危害| 黄飞鸿是什么生肖| 补肺养肺吃什么食物最好| 梦到和死人说话是什么意思| 珀莱雅属于什么档次| 金火什么字| 皮肤发痒是什么原因| 羊宝是什么| 孕激素低吃什么补得快| 理疗是什么意思| 查结核做什么检查| 看病人买什么水果| 用印是什么意思| 什么是尿常规检查| 侄子是什么关系| 十月二十六是什么星座| 荞麦长什么样子| 手指腱鞘炎是什么原因造成的| 土羊是什么字| 回族信奉什么教| 炸鸡翅裹什么粉| 2月25日是什么星座| jdv是什么牌子| 什么什么致志| 风吹动窗吹动夜声响是什么歌| 疝气挂什么科| 眼仁发黄是什么原因| 什么叫高潮| 组织委员的职责是什么| 甲低是什么原因造成的| mi医学上是什么意思| 生理期没来是什么原因| 身体上有小红点是什么病| 拉肚子发烧吃什么药| 9月28号什么星座| 碳水化合物指的是什么| 人为什么要读书| 仙姑是什么意思| 夏天什么颜色最防晒| 怀孕周期是从什么时候开始算的| 宝宝咳嗽吃什么药好| 凤尾菜又叫什么菜| 虚热吃什么药| 五彩绳什么时候扔掉| vivi是什么意思| 党参长什么样| 喉咙肿痛吃什么药| 骨髓瘤是什么病| 伤心的反义词是什么| 孟子是什么时期的人| 血小板低会出现什么症状| 海参为什么越小越贵| 多吃青菜有什么好处| 来大姨妈肚子疼是什么原因| 柿子什么时候成熟| 烧仙草是什么| 三八是什么意思| 早上7点是什么时辰| 11.22是什么星座| 肝脏不好吃什么食物才能养肝护肝| 烟火气息是什么意思| 刘邦的老婆叫什么名字| 核磁共振挂什么科| 筒骨炖什么好吃| 眼发花是什么病的征兆| 骨蒸潮热是什么症状| 晚上吃什么不胖| 8月一日是什么节日| hbv是什么| 心身医学科是看什么病| 01年是什么年| 肺气肿是什么| 晚上尿次数多什么原因| 拉比是什么意思| 冷战的男人是什么心理| 泌尿外科看什么病| 7月9日是什么星座| 水土不服吃什么药管用| 艾司唑仑是什么药| 风平浪静是什么生肖| 海龟汤是什么| 无伤大雅是什么意思| 反流性食管炎可以吃什么水果| 车挂件挂什么保平安好| sph是什么意思| 丝状疣挂什么科| 腰无力是什么原因| 1988是什么生肖| 牛河是什么| 高挑是什么意思| 狗狗气喘吃什么药| 砭石是什么东西| 俱往矣是什么意思| 补肾吃什么药效果最好| 海参什么人不适合吃| hpv亚临床感染是什么意思| 日复一日是什么意思| 云为什么不会掉下来| 里急后重吃什么药最好| 桃子是什么颜色| 变格是什么意思| 游离甲状腺素偏低是什么意思| 17是什么意思| 2009年属什么生肖| 忤逆是什么意思| 一直发低烧是什么原因| 绝对是什么意思| daddy是什么意思| 5月4日什么星座| 不为良相便为良医是什么意思| 支原体吃什么药| 食指戴戒指是什么意思| 鹅口疮用什么药效果好| 疱疹用什么药好| 不让看朋友圈显示什么| 什么是国企单位| 大胯疼是什么原因引起| 天生丽质难自弃是什么意思| 痣为什么会越来越多| 白带是什么样子| 心脏彩超挂什么科| 人走茶凉下一句是什么| 喝老陈皮水有什么好处| 为什么会闪电| fred是什么牌子| 脊椎痛什么原因| 班草是什么意思| 亚急性甲状腺炎吃什么药| 掉头发去医院挂什么科| 吃什么能降血糖| 为什么恐龙会灭绝| 曲奇饼干为什么不成形| 二代身份证是什么意思| 穹窿是什么意思| 农历七月初七俗称什么| 刮宫后能吃什么水果| 什么的光华| 氢氧化钙是什么东西| 什么蚌相争| 人为什么要穿衣服| 鹅蛋脸适合什么刘海| 打激素有什么副作用| 长寿花什么时候开花| 阳虚吃什么好| 乳腺增生什么意思| 嗯呢是什么意思| 吃什么减肥效果最快| 张嘴睡觉有什么危害| 使婢差奴过一生是什么意思| 失眠是什么原因导致的| 月经血是黑色的是什么原因| 减肥晚饭吃什么好| 骨盐量偏低代表什么| 屈光度是什么意思| 手肿是什么病的前兆| 重度脂肪肝吃什么药| 灵芝有什么功效与作用| 什么木头做菜板好| 一个口一个麦念什么| 什么中不足成语| 效应是什么意思| 羊肉配什么菜好吃| 和田玉对身体有什么好处| 属羊的和什么属相不合| 嗓子发炎挂什么科| 颈椎病引起的头晕吃什么药| 球镜柱镜是什么意思| 吊孝是什么意思| 绝经前有什么症状| 月经下不来吃什么药| 喝苏打水有什么好处和坏处| 洧是什么意思| 什么是分子| 脱肛和痔疮有什么区别| 城隍爷叫什么名字| 五花肉炒什么好吃| 金命适合什么颜色| 悉如外人的悉是什么意思| 明天叫什么日子| 安全期是什么意思| 保家仙是什么意思| 脂肪最怕什么| 体温偏高的人说明什么| 什么东西化痰效果最好最快| 女性尿道炎吃什么药| 脱落细胞学检查是什么| 梦见自己准备结婚是什么意思| 男人眉骨高代表什么| 排卵试纸一深一浅说明什么| 脑梗是什么原因造成的| 女攻男受是什么意思| 紫草是什么| 属马五行属什么| 百度

金门酒厂与北京鹿鸣乐福强强联手共赢市场新局面


Directory: ../../../ffmpeg/
File: src/tests/checkasm/vf_colordetect.c
Date: 2025-08-04 11:35:17
Exec Total Coverage
Lines: 68 70 97.1%
Functions: 3 3 100.0%
Branches: 28 44 63.6%

Line Branch Exec Source
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>
20 #include "checkasm.h"
21
22 #include "libavfilter/vf_colordetect.h"
23 #include "libavutil/mem_internal.h"
24
25 #define WIDTH 256
26 #define HEIGHT 16
27 #define STRIDE (WIDTH + 32)
28
29 26 static void check_range_detect(int depth)
30 {
31 26 const int mpeg_min = 16 << (depth - 8);
32 26 const int mpeg_max = 235 << (depth - 8);
33
34 26 FFColorDetectDSPContext dsp = {0};
35 26 ff_color_detect_dsp_init(&dsp, depth, AVCOL_RANGE_UNSPECIFIED);
36
37 26 declare_func(int, const uint8_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t, int, int);
38
39 /* Initialize to 128, which should always return 0 */
40 26 LOCAL_ALIGNED_32(uint8_t, in, [HEIGHT * STRIDE]);
41 26 memset(in, 0x80, HEIGHT * STRIDE);
42
43 /* Place an out-of-range value in a random position near the center */
44 26 const int h2 = HEIGHT >> 1;
45 26 int idx0 = ((rnd() % h2) + h2) * STRIDE + (rnd() % WIDTH);
46
2/2
✓ Branch 0 taken 13 times.
✓ Branch 1 taken 13 times.
26 if (depth > 8) {
47 13 idx0 &= ~1;
48 13 in[idx0] = in[idx0 + 1] = 0;
49 } else {
50 13 in[idx0] = 0;
51 }
52
53 26 int w = WIDTH;
54
2/2
✓ Branch 0 taken 13 times.
✓ Branch 1 taken 13 times.
26 if (depth > 8)
55 13 w /= 2;
56
57
2/2
✓ Branch 3 taken 4 times.
✓ Branch 4 taken 22 times.
26 if (check_func(dsp.detect_range, "detect_range_%d", depth)) {
58 /* Test increasing height, to ensure we hit the placed 0 eventually */
59
2/2
✓ Branch 0 taken 64 times.
✓ Branch 1 taken 4 times.
68 for (int h = 1; h <= HEIGHT; h++) {
60 64 int res_ref = call_ref(in, STRIDE, w, h, mpeg_min, mpeg_max);
61 64 int res_new = call_new(in, STRIDE, w, h, mpeg_min, mpeg_max);
62
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 64 times.
64 if (res_ref != res_new)
63 fail();
64 }
65
66 /* Test performance of base case without any out-of-range values */
67 4 memset(in, 0x80, HEIGHT * STRIDE);
68
1/8
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
4 bench_new(in, STRIDE, w, HEIGHT, mpeg_min, mpeg_max);
69 }
70 26 }
71
72 52 static void check_alpha_detect(int depth, enum AVColorRange range)
73 {
74 52 const int mpeg_min = 16 << (depth - 8);
75 52 const int mpeg_max = 235 << (depth - 8);
76 52 const int p = (1 << depth) - 1;
77 52 const int q = mpeg_max - mpeg_min;
78 52 const int k = p * mpeg_min + q + (1 << (depth - 1));
79
80 52 FFColorDetectDSPContext dsp = {0};
81 52 ff_color_detect_dsp_init(&dsp, depth, range);
82
83 52 declare_func(int, const uint8_t *, ptrdiff_t, const uint8_t *, ptrdiff_t,
84 ptrdiff_t, ptrdiff_t, int p, int q, int k);
85
86 52 LOCAL_ALIGNED_32(uint8_t, luma, [HEIGHT * STRIDE]);
87 52 LOCAL_ALIGNED_32(uint8_t, alpha, [HEIGHT * STRIDE]);
88 52 memset(luma, 0x80, HEIGHT * STRIDE);
89 52 memset(alpha, 0xFF, HEIGHT * STRIDE);
90
91 /* Try and force overflow */
92
4/4
✓ Branch 0 taken 26 times.
✓ Branch 1 taken 26 times.
✓ Branch 2 taken 13 times.
✓ Branch 3 taken 13 times.
52 if (depth > 8 && range == AVCOL_RANGE_MPEG) {
93 13 ((uint16_t *) luma)[0] = 235 << (depth - 8);
94 13 ((uint16_t *) luma)[1] = 16 << (depth - 8);
95 } else {
96 39 luma[0] = 235;
97 39 luma[1] = 16;
98 }
99
100 /* Place an out-of-range value in a random position near the center */
101 52 const int h2 = HEIGHT >> 1;
102 52 int idx0 = ((rnd() % h2) + h2) * STRIDE + (rnd() % WIDTH);
103
2/2
✓ Branch 0 taken 26 times.
✓ Branch 1 taken 26 times.
52 if (depth > 8) {
104 26 idx0 &= ~1;
105 26 alpha[idx0] = alpha[idx0 + 1] = 0;
106 } else {
107 26 alpha[idx0] = 0;
108 }
109
110 52 int w = WIDTH;
111
2/2
✓ Branch 0 taken 26 times.
✓ Branch 1 taken 26 times.
52 if (depth > 8)
112 26 w /= 2;
113
114
4/4
✓ Branch 2 taken 26 times.
✓ Branch 3 taken 26 times.
✓ Branch 5 taken 8 times.
✓ Branch 6 taken 44 times.
52 if (check_func(dsp.detect_alpha, "detect_alpha_%d_%s", depth, range == AVCOL_RANGE_JPEG ? "full" : "limited")) {
115 /* Test increasing height, to ensure we hit the placed 0 eventually */
116
2/2
✓ Branch 0 taken 128 times.
✓ Branch 1 taken 8 times.
136 for (int h = 1; h <= HEIGHT; h++) {
117 128 int res_ref = call_ref(luma, STRIDE, alpha, STRIDE, w, h, p, q, k);
118 128 int res_new = call_new(luma, STRIDE, alpha, STRIDE, w, h, p, q, k);
119
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 128 times.
128 if (res_ref != res_new)
120 fail();
121 }
122
123 /* Test performance of base case without any out-of-range values */
124 8 memset(alpha, 0xFF, HEIGHT * STRIDE);
125
1/8
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
8 bench_new(luma, STRIDE, alpha, STRIDE, w, HEIGHT, p, q, k);
126 }
127 52 }
128
129 13 void checkasm_check_colordetect(void)
130 {
131
2/2
✓ Branch 0 taken 26 times.
✓ Branch 1 taken 13 times.
39 for (int depth = 8; depth <= 16; depth += 8) {
132 26 check_range_detect(depth);
133 26 report("detect_range_%d", depth);
134
135 26 check_alpha_detect(depth, AVCOL_RANGE_JPEG);
136 26 check_alpha_detect(depth, AVCOL_RANGE_MPEG);
137 26 report("detect_alpha_%d", depth);
138 }
139 13 }
140

喝什么排肝毒最快 现字五行属什么 神龙见首不见尾是什么意思 恶心反胃想吐吃什么药 护照免签是什么意思
早期教育是什么 微白蛋白高是什么情况 慢性肠炎是什么症状 nafion溶液是什么 狮子男和什么星座最配
梦见下暴雨是什么意思 脚踩棉花感见于什么病 准生证什么时候办 血栓是什么症状 豆绿色配什么颜色好看
早上6点半是什么时辰 rap什么意思 2017年五行属什么 头痛吃什么 叶酸是什么
高压氧是什么hcv7jop6ns9r.cn 薄熙来为什么被抓hcv9jop5ns6r.cn 利尿吃什么药hcv9jop6ns1r.cn 吃黄豆有什么好处hcv8jop8ns0r.cn 628是什么星座hcv9jop3ns1r.cn
生命之水是什么hcv9jop0ns4r.cn 纯水是什么hcv9jop5ns7r.cn 小仓鼠吃什么zhiyanzhang.com 脾虚湿气重喝什么茶hcv8jop9ns4r.cn 4月28日是什么星座hcv8jop6ns4r.cn
不孕不育做什么检查hcv9jop3ns2r.cn 乳腺增生乳腺结节吃什么药dayuxmw.com 印字五行属什么hcv8jop2ns9r.cn 6.8什么星座hcv8jop5ns0r.cn 小暑是什么时候hcv8jop1ns5r.cn
什么的花灯hcv7jop5ns0r.cn 大阪烧是什么hcv8jop4ns6r.cn 生物碱是什么hcv8jop1ns4r.cn 什么是放疗治疗hcv7jop5ns6r.cn 2月24号是什么星座hcv9jop0ns4r.cn
百度