../../../ffmpeg/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
308 / 488
63.1%
Branches:
273 / 488
55.9%
Functions:
11 / 16
68.8%

libavcodec/h26x/h2656_sao_template.c
Line Branch Exec Source
1 /*
2 * HEVC/VVC SAO template
3 *
4 * Copyright (C) 2024 Nuo Mi
5 * Copyright (C) 2012 - 2013 Guillaume Martres
6 *
7 * This file is part of FFmpeg.
8 *
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24 109459 static void FUNC(sao_band_filter)(uint8_t *_dst, const uint8_t *_src,
25 ptrdiff_t stride_dst, ptrdiff_t stride_src,
26 const int16_t *sao_offset_val, int sao_left_class,
27 int width, int height)
28 {
29 109459 pixel *dst = (pixel *)_dst;
30 109459 const pixel *src = (const pixel *)_src;
31 109459 int offset_table[32] = { 0 };
32 int k, y, x;
33 109459 int shift = BIT_DEPTH - 5;
34
35 109459 stride_dst /= sizeof(pixel);
36 109459 stride_src /= sizeof(pixel);
37
38
6/8
sao_band_filter_10:
✓ Branch 4 → 3 taken 31020 times.
✓ Branch 4 → 5 taken 7755 times.
sao_band_filter_12:
✓ Branch 4 → 3 taken 4812 times.
✓ Branch 4 → 5 taken 1203 times.
sao_band_filter_8:
✓ Branch 4 → 3 taken 402004 times.
✓ Branch 4 → 5 taken 100501 times.
sao_band_filter_9:
✗ Branch 4 → 3 not taken.
✗ Branch 4 → 5 not taken.
547295 for (k = 0; k < 4; k++)
39 437836 offset_table[(k + sao_left_class) & 31] = sao_offset_val[k + 1];
40
6/8
sao_band_filter_10:
✓ Branch 10 → 6 taken 780256 times.
✓ Branch 10 → 11 taken 7755 times.
sao_band_filter_12:
✓ Branch 10 → 6 taken 76368 times.
✓ Branch 10 → 11 taken 1203 times.
sao_band_filter_8:
✓ Branch 10 → 6 taken 3702880 times.
✓ Branch 10 → 11 taken 100501 times.
sao_band_filter_9:
✗ Branch 10 → 6 not taken.
✗ Branch 10 → 11 not taken.
4668963 for (y = 0; y < height; y++) {
41
6/8
sao_band_filter_10:
✓ Branch 8 → 7 taken 87025728 times.
✓ Branch 8 → 9 taken 780256 times.
sao_band_filter_12:
✓ Branch 8 → 7 taken 5005632 times.
✓ Branch 8 → 9 taken 76368 times.
sao_band_filter_8:
✓ Branch 8 → 7 taken 181946176 times.
✓ Branch 8 → 9 taken 3702880 times.
sao_band_filter_9:
✗ Branch 8 → 7 not taken.
✗ Branch 8 → 9 not taken.
278537040 for (x = 0; x < width; x++)
42 273977536 dst[x] = av_clip_pixel(src[x] + offset_table[(src[x] >> shift) & 31]);
43 4559504 dst += stride_dst;
44 4559504 src += stride_src;
45 }
46 109459 }
47
48 #define CMP(a, b) (((a) > (b)) - ((a) < (b)))
49
50 581760 static void FUNC(sao_edge_filter)(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, const int16_t *sao_offset_val,
51 int eo, int width, int height) {
52
53 static const uint8_t edge_idx[] = { 1, 2, 0, 3, 4 };
54 static const int8_t pos[4][2][2] = {
55 { { -1, 0 }, { 1, 0 } }, // horizontal
56 { { 0, -1 }, { 0, 1 } }, // vertical
57 { { -1, -1 }, { 1, 1 } }, // 135 degree
58 { { 1, -1 }, { -1, 1 } }, // 45 degree
59 };
60 581760 pixel *dst = (pixel *)_dst;
61 581760 const pixel *src = (const pixel *)_src;
62 int a_stride, b_stride;
63 int x, y;
64 581760 ptrdiff_t stride_src = (2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE) / sizeof(pixel);
65 581760 stride_dst /= sizeof(pixel);
66
67 581760 a_stride = pos[eo][0][0] + pos[eo][0][1] * stride_src;
68 581760 b_stride = pos[eo][1][0] + pos[eo][1][1] * stride_src;
69
6/8
sao_edge_filter_10:
✓ Branch 7 → 3 taken 3507664 times.
✓ Branch 7 → 8 taken 49849 times.
sao_edge_filter_12:
✓ Branch 7 → 3 taken 771728 times.
✓ Branch 7 → 8 taken 12068 times.
sao_edge_filter_8:
✓ Branch 7 → 3 taken 22285760 times.
✓ Branch 7 → 8 taken 519843 times.
sao_edge_filter_9:
✗ Branch 7 → 3 not taken.
✗ Branch 7 → 8 not taken.
27146912 for (y = 0; y < height; y++) {
70
6/8
sao_edge_filter_10:
✓ Branch 5 → 4 taken 231951936 times.
✓ Branch 5 → 6 taken 3507664 times.
sao_edge_filter_12:
✓ Branch 5 → 4 taken 49434944 times.
✓ Branch 5 → 6 taken 771728 times.
sao_edge_filter_8:
✓ Branch 5 → 4 taken 1098387264 times.
✓ Branch 5 → 6 taken 22285760 times.
sao_edge_filter_9:
✗ Branch 5 → 4 not taken.
✗ Branch 5 → 6 not taken.
1406339296 for (x = 0; x < width; x++) {
71 1379774144 int diff0 = CMP(src[x], src[x + a_stride]);
72 1379774144 int diff1 = CMP(src[x], src[x + b_stride]);
73 1379774144 int offset_val = edge_idx[2 + diff0 + diff1];
74 1379774144 dst[x] = av_clip_pixel(src[x] + sao_offset_val[offset_val]);
75 }
76 26565152 src += stride_src;
77 26565152 dst += stride_dst;
78 }
79 581760 }
80
81 552999 static void FUNC(sao_edge_restore_0)(uint8_t *_dst, const uint8_t *_src,
82 ptrdiff_t stride_dst, ptrdiff_t stride_src, const SAOParams *sao,
83 const int *borders, int _width, int _height,
84 int c_idx, const uint8_t *vert_edge,
85 const uint8_t *horiz_edge, const uint8_t *diag_edge)
86 {
87 int x, y;
88 552999 pixel *dst = (pixel *)_dst;
89 552999 const pixel *src = (const pixel *)_src;
90 552999 const int16_t *sao_offset_val = sao->offset_val[c_idx];
91 552999 int sao_eo_class = sao->eo_class[c_idx];
92 552999 int init_x = 0, width = _width, height = _height;
93
94 552999 stride_dst /= sizeof(pixel);
95 552999 stride_src /= sizeof(pixel);
96
97
6/8
sao_edge_restore_0_10:
✓ Branch 2 → 3 taken 23703 times.
✓ Branch 2 → 13 taken 16171 times.
sao_edge_restore_0_12:
✓ Branch 2 → 3 taken 9543 times.
✓ Branch 2 → 13 taken 2367 times.
sao_edge_restore_0_8:
✓ Branch 2 → 3 taken 420299 times.
✓ Branch 2 → 13 taken 80916 times.
sao_edge_restore_0_9:
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 13 not taken.
552999 if (sao_eo_class != SAO_EO_VERT) {
98
6/8
sao_edge_restore_0_10:
✓ Branch 3 → 4 taken 850 times.
✓ Branch 3 → 8 taken 22853 times.
sao_edge_restore_0_12:
✓ Branch 3 → 4 taken 267 times.
✓ Branch 3 → 8 taken 9276 times.
sao_edge_restore_0_8:
✓ Branch 3 → 4 taken 13333 times.
✓ Branch 3 → 8 taken 406966 times.
sao_edge_restore_0_9:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 8 not taken.
453545 if (borders[0]) {
99 14450 int offset_val = sao_offset_val[0];
100
6/8
sao_edge_restore_0_10:
✓ Branch 6 → 5 taken 50904 times.
✓ Branch 6 → 7 taken 850 times.
sao_edge_restore_0_12:
✓ Branch 6 → 5 taken 17088 times.
✓ Branch 6 → 7 taken 267 times.
sao_edge_restore_0_8:
✓ Branch 6 → 5 taken 624656 times.
✓ Branch 6 → 7 taken 13333 times.
sao_edge_restore_0_9:
✗ Branch 6 → 5 not taken.
✗ Branch 6 → 7 not taken.
707098 for (y = 0; y < height; y++) {
101 692648 dst[y * stride_dst] = av_clip_pixel(src[y * stride_src] + offset_val);
102 }
103 14450 init_x = 1;
104 }
105
6/8
sao_edge_restore_0_10:
✓ Branch 8 → 9 taken 690 times.
✓ Branch 8 → 13 taken 23013 times.
sao_edge_restore_0_12:
✓ Branch 8 → 9 taken 190 times.
✓ Branch 8 → 13 taken 9353 times.
sao_edge_restore_0_8:
✓ Branch 8 → 9 taken 15782 times.
✓ Branch 8 → 13 taken 404517 times.
sao_edge_restore_0_9:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 13 not taken.
453545 if (borders[2]) {
106 16662 int offset_val = sao_offset_val[0];
107 16662 int offset = width - 1;
108
6/8
sao_edge_restore_0_10:
✓ Branch 11 → 10 taken 40320 times.
✓ Branch 11 → 12 taken 690 times.
sao_edge_restore_0_12:
✓ Branch 11 → 10 taken 12160 times.
✓ Branch 11 → 12 taken 190 times.
sao_edge_restore_0_8:
✓ Branch 11 → 10 taken 718936 times.
✓ Branch 11 → 12 taken 15782 times.
sao_edge_restore_0_9:
✗ Branch 11 → 10 not taken.
✗ Branch 11 → 12 not taken.
788078 for (x = 0; x < height; x++) {
109 771416 dst[x * stride_dst + offset] = av_clip_pixel(src[x * stride_src + offset] + offset_val);
110 }
111 16662 width--;
112 }
113 }
114
6/8
sao_edge_restore_0_10:
✓ Branch 13 → 14 taken 31187 times.
✓ Branch 13 → 23 taken 8687 times.
sao_edge_restore_0_12:
✓ Branch 13 → 14 taken 5978 times.
✓ Branch 13 → 23 taken 5932 times.
sao_edge_restore_0_8:
✓ Branch 13 → 14 taken 421115 times.
✓ Branch 13 → 23 taken 80100 times.
sao_edge_restore_0_9:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 23 not taken.
552999 if (sao_eo_class != SAO_EO_HORIZ) {
115
6/8
sao_edge_restore_0_10:
✓ Branch 14 → 15 taken 1560 times.
✓ Branch 14 → 18 taken 29627 times.
sao_edge_restore_0_12:
✓ Branch 14 → 15 taken 368 times.
✓ Branch 14 → 18 taken 5610 times.
sao_edge_restore_0_8:
✓ Branch 14 → 15 taken 16940 times.
✓ Branch 14 → 18 taken 404175 times.
sao_edge_restore_0_9:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 18 not taken.
458280 if (borders[1]) {
116 18868 int offset_val = sao_offset_val[0];
117
6/8
sao_edge_restore_0_10:
✓ Branch 17 → 16 taken 78841 times.
✓ Branch 17 → 18 taken 1560 times.
sao_edge_restore_0_12:
✓ Branch 17 → 16 taken 22947 times.
✓ Branch 17 → 18 taken 368 times.
sao_edge_restore_0_8:
✓ Branch 17 → 16 taken 813223 times.
✓ Branch 17 → 18 taken 16940 times.
sao_edge_restore_0_9:
✗ Branch 17 → 16 not taken.
✗ Branch 17 → 18 not taken.
933879 for (x = init_x; x < width; x++)
118 915011 dst[x] = av_clip_pixel(src[x] + offset_val);
119 }
120
6/8
sao_edge_restore_0_10:
✓ Branch 18 → 19 taken 1554 times.
✓ Branch 18 → 23 taken 29633 times.
sao_edge_restore_0_12:
✓ Branch 18 → 19 taken 308 times.
✓ Branch 18 → 23 taken 5670 times.
sao_edge_restore_0_8:
✓ Branch 18 → 19 taken 22994 times.
✓ Branch 18 → 23 taken 398121 times.
sao_edge_restore_0_9:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 23 not taken.
458280 if (borders[3]) {
121 24856 int offset_val = sao_offset_val[0];
122 24856 ptrdiff_t y_stride_dst = stride_dst * (height - 1);
123 24856 ptrdiff_t y_stride_src = stride_src * (height - 1);
124
6/8
sao_edge_restore_0_10:
✓ Branch 21 → 20 taken 71720 times.
✓ Branch 21 → 22 taken 1554 times.
sao_edge_restore_0_12:
✓ Branch 21 → 20 taken 19102 times.
✓ Branch 21 → 22 taken 308 times.
sao_edge_restore_0_8:
✓ Branch 21 → 20 taken 1088662 times.
✓ Branch 21 → 22 taken 22994 times.
sao_edge_restore_0_9:
✗ Branch 21 → 20 not taken.
✗ Branch 21 → 22 not taken.
1204340 for (x = init_x; x < width; x++)
125 1179484 dst[x + y_stride_dst] = av_clip_pixel(src[x + y_stride_src] + offset_val);
126 24856 height--;
127 }
128 }
129 552999 }
130
131 34444 static void FUNC(sao_edge_restore_1)(uint8_t *_dst, const uint8_t *_src,
132 ptrdiff_t stride_dst, ptrdiff_t stride_src, const SAOParams *sao,
133 const int *borders, int _width, int _height,
134 int c_idx, const uint8_t *vert_edge,
135 const uint8_t *horiz_edge, const uint8_t *diag_edge)
136 {
137 int x, y;
138 34444 pixel *dst = (pixel *)_dst;
139 34444 const pixel *src = (const pixel *)_src;
140 34444 const int16_t *sao_offset_val = sao->offset_val[c_idx];
141 34444 int sao_eo_class = sao->eo_class[c_idx];
142 34444 int init_x = 0, init_y = 0, width = _width, height = _height;
143
144 34444 stride_dst /= sizeof(pixel);
145 34444 stride_src /= sizeof(pixel);
146
147
4/8
sao_edge_restore_1_10:
✓ Branch 2 → 3 taken 8440 times.
✓ Branch 2 → 13 taken 3576 times.
sao_edge_restore_1_12:
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 13 not taken.
sao_edge_restore_1_8:
✓ Branch 2 → 3 taken 14395 times.
✓ Branch 2 → 13 taken 8033 times.
sao_edge_restore_1_9:
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 13 not taken.
34444 if (sao_eo_class != SAO_EO_VERT) {
148
4/8
sao_edge_restore_1_10:
✓ Branch 3 → 4 taken 834 times.
✓ Branch 3 → 8 taken 7606 times.
sao_edge_restore_1_12:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 8 not taken.
sao_edge_restore_1_8:
✓ Branch 3 → 4 taken 1155 times.
✓ Branch 3 → 8 taken 13240 times.
sao_edge_restore_1_9:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 8 not taken.
22835 if (borders[0]) {
149 1989 int offset_val = sao_offset_val[0];
150
4/8
sao_edge_restore_1_10:
✓ Branch 6 → 5 taken 77848 times.
✓ Branch 6 → 7 taken 834 times.
sao_edge_restore_1_12:
✗ Branch 6 → 5 not taken.
✗ Branch 6 → 7 not taken.
sao_edge_restore_1_8:
✓ Branch 6 → 5 taken 57424 times.
✓ Branch 6 → 7 taken 1155 times.
sao_edge_restore_1_9:
✗ Branch 6 → 5 not taken.
✗ Branch 6 → 7 not taken.
137261 for (y = 0; y < height; y++) {
151 135272 dst[y * stride_dst] = av_clip_pixel(src[y * stride_src] + offset_val);
152 }
153 1989 init_x = 1;
154 }
155
4/8
sao_edge_restore_1_10:
✓ Branch 8 → 9 taken 778 times.
✓ Branch 8 → 13 taken 7662 times.
sao_edge_restore_1_12:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 13 not taken.
sao_edge_restore_1_8:
✓ Branch 8 → 9 taken 691 times.
✓ Branch 8 → 13 taken 13704 times.
sao_edge_restore_1_9:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 13 not taken.
22835 if (borders[2]) {
156 1469 int offset_val = sao_offset_val[0];
157 1469 int offset = width - 1;
158
4/8
sao_edge_restore_1_10:
✓ Branch 11 → 10 taken 69072 times.
✓ Branch 11 → 12 taken 778 times.
sao_edge_restore_1_12:
✗ Branch 11 → 10 not taken.
✗ Branch 11 → 12 not taken.
sao_edge_restore_1_8:
✓ Branch 11 → 10 taken 32832 times.
✓ Branch 11 → 12 taken 691 times.
sao_edge_restore_1_9:
✗ Branch 11 → 10 not taken.
✗ Branch 11 → 12 not taken.
103373 for (x = 0; x < height; x++) {
159 101904 dst[x * stride_dst + offset] = av_clip_pixel(src[x * stride_src + offset] + offset_val);
160 }
161 1469 width--;
162 }
163 }
164
4/8
sao_edge_restore_1_10:
✓ Branch 13 → 14 taken 9695 times.
✓ Branch 13 → 24 taken 2321 times.
sao_edge_restore_1_12:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 24 not taken.
sao_edge_restore_1_8:
✓ Branch 13 → 14 taken 14968 times.
✓ Branch 13 → 24 taken 7460 times.
sao_edge_restore_1_9:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 24 not taken.
34444 if (sao_eo_class != SAO_EO_HORIZ) {
165
4/8
sao_edge_restore_1_10:
✓ Branch 14 → 15 taken 1706 times.
✓ Branch 14 → 19 taken 7989 times.
sao_edge_restore_1_12:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 19 not taken.
sao_edge_restore_1_8:
✓ Branch 14 → 15 taken 1704 times.
✓ Branch 14 → 19 taken 13264 times.
sao_edge_restore_1_9:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 19 not taken.
24663 if (borders[1]) {
166 3410 int offset_val = sao_offset_val[0];
167
4/8
sao_edge_restore_1_10:
✓ Branch 17 → 16 taken 147495 times.
✓ Branch 17 → 18 taken 1706 times.
sao_edge_restore_1_12:
✗ Branch 17 → 16 not taken.
✗ Branch 17 → 18 not taken.
sao_edge_restore_1_8:
✓ Branch 17 → 16 taken 83214 times.
✓ Branch 17 → 18 taken 1704 times.
sao_edge_restore_1_9:
✗ Branch 17 → 16 not taken.
✗ Branch 17 → 18 not taken.
234119 for (x = init_x; x < width; x++)
168 230709 dst[x] = av_clip_pixel(src[x] + offset_val);
169 3410 init_y = 1;
170 }
171
4/8
sao_edge_restore_1_10:
✓ Branch 19 → 20 taken 1659 times.
✓ Branch 19 → 24 taken 8036 times.
sao_edge_restore_1_12:
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 24 not taken.
sao_edge_restore_1_8:
✓ Branch 19 → 20 taken 1538 times.
✓ Branch 19 → 24 taken 13430 times.
sao_edge_restore_1_9:
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 24 not taken.
24663 if (borders[3]) {
172 3197 int offset_val = sao_offset_val[0];
173 3197 ptrdiff_t y_stride_dst = stride_dst * (height - 1);
174 3197 ptrdiff_t y_stride_src = stride_src * (height - 1);
175
4/8
sao_edge_restore_1_10:
✓ Branch 22 → 21 taken 149394 times.
✓ Branch 22 → 23 taken 1659 times.
sao_edge_restore_1_12:
✗ Branch 22 → 21 not taken.
✗ Branch 22 → 23 not taken.
sao_edge_restore_1_8:
✓ Branch 22 → 21 taken 71014 times.
✓ Branch 22 → 23 taken 1538 times.
sao_edge_restore_1_9:
✗ Branch 22 → 21 not taken.
✗ Branch 22 → 23 not taken.
223605 for (x = init_x; x < width; x++)
176 220408 dst[x + y_stride_dst] = av_clip_pixel(src[x + y_stride_src] + offset_val);
177 3197 height--;
178 }
179 }
180
181 {
182
16/32
sao_edge_restore_1_10:
✓ Branch 24 → 25 taken 11483 times.
✓ Branch 24 → 29 taken 533 times.
✓ Branch 25 → 26 taken 2266 times.
✓ Branch 25 → 29 taken 9217 times.
✓ Branch 26 → 27 taken 2051 times.
✓ Branch 26 → 29 taken 215 times.
✓ Branch 27 → 28 taken 1747 times.
✓ Branch 27 → 29 taken 304 times.
sao_edge_restore_1_12:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 29 not taken.
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 29 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 29 not taken.
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
sao_edge_restore_1_8:
✓ Branch 24 → 25 taken 22345 times.
✓ Branch 24 → 29 taken 83 times.
✓ Branch 25 → 26 taken 3126 times.
✓ Branch 25 → 29 taken 19219 times.
✓ Branch 26 → 27 taken 2869 times.
✓ Branch 26 → 29 taken 257 times.
✓ Branch 27 → 28 taken 2642 times.
✓ Branch 27 → 29 taken 227 times.
sao_edge_restore_1_9:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 29 not taken.
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 29 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 29 not taken.
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
34444 int save_upper_left = !diag_edge[0] && sao_eo_class == SAO_EO_135D && !borders[0] && !borders[1];
183
16/32
sao_edge_restore_1_10:
✓ Branch 30 → 31 taken 11416 times.
✓ Branch 30 → 35 taken 600 times.
✓ Branch 31 → 32 taken 3563 times.
✓ Branch 31 → 35 taken 7853 times.
✓ Branch 32 → 33 taken 2852 times.
✓ Branch 32 → 35 taken 711 times.
✓ Branch 33 → 34 taken 2605 times.
✓ Branch 33 → 35 taken 247 times.
sao_edge_restore_1_12:
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 35 not taken.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 35 not taken.
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 35 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
sao_edge_restore_1_8:
✓ Branch 30 → 31 taken 22321 times.
✓ Branch 30 → 35 taken 107 times.
✓ Branch 31 → 32 taken 3727 times.
✓ Branch 31 → 35 taken 18594 times.
✓ Branch 32 → 33 taken 3181 times.
✓ Branch 32 → 35 taken 546 times.
✓ Branch 33 → 34 taken 3033 times.
✓ Branch 33 → 35 taken 148 times.
sao_edge_restore_1_9:
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 35 not taken.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 35 not taken.
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 35 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
34444 int save_upper_right = !diag_edge[1] && sao_eo_class == SAO_EO_45D && !borders[1] && !borders[2];
184
16/32
sao_edge_restore_1_10:
✓ Branch 36 → 37 taken 11323 times.
✓ Branch 36 → 41 taken 693 times.
✓ Branch 37 → 38 taken 2249 times.
✓ Branch 37 → 41 taken 9074 times.
✓ Branch 38 → 39 taken 2040 times.
✓ Branch 38 → 41 taken 209 times.
✓ Branch 39 → 40 taken 1640 times.
✓ Branch 39 → 41 taken 400 times.
sao_edge_restore_1_12:
✗ Branch 36 → 37 not taken.
✗ Branch 36 → 41 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 41 not taken.
✗ Branch 38 → 39 not taken.
✗ Branch 38 → 41 not taken.
✗ Branch 39 → 40 not taken.
✗ Branch 39 → 41 not taken.
sao_edge_restore_1_8:
✓ Branch 36 → 37 taken 22271 times.
✓ Branch 36 → 41 taken 157 times.
✓ Branch 37 → 38 taken 3100 times.
✓ Branch 37 → 41 taken 19171 times.
✓ Branch 38 → 39 taken 2919 times.
✓ Branch 38 → 41 taken 181 times.
✓ Branch 39 → 40 taken 2558 times.
✓ Branch 39 → 41 taken 361 times.
sao_edge_restore_1_9:
✗ Branch 36 → 37 not taken.
✗ Branch 36 → 41 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 41 not taken.
✗ Branch 38 → 39 not taken.
✗ Branch 38 → 41 not taken.
✗ Branch 39 → 40 not taken.
✗ Branch 39 → 41 not taken.
34444 int save_lower_right = !diag_edge[2] && sao_eo_class == SAO_EO_135D && !borders[2] && !borders[3];
185
16/32
sao_edge_restore_1_10:
✓ Branch 42 → 43 taken 11348 times.
✓ Branch 42 → 47 taken 668 times.
✓ Branch 43 → 44 taken 3567 times.
✓ Branch 43 → 47 taken 7781 times.
✓ Branch 44 → 45 taken 3193 times.
✓ Branch 44 → 47 taken 374 times.
✓ Branch 45 → 46 taken 2658 times.
✓ Branch 45 → 47 taken 535 times.
sao_edge_restore_1_12:
✗ Branch 42 → 43 not taken.
✗ Branch 42 → 47 not taken.
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 47 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 47 not taken.
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 47 not taken.
sao_edge_restore_1_8:
✓ Branch 42 → 43 taken 22297 times.
✓ Branch 42 → 47 taken 131 times.
✓ Branch 43 → 44 taken 3739 times.
✓ Branch 43 → 47 taken 18558 times.
✓ Branch 44 → 45 taken 3282 times.
✓ Branch 44 → 47 taken 457 times.
✓ Branch 45 → 46 taken 2913 times.
✓ Branch 45 → 47 taken 369 times.
sao_edge_restore_1_9:
✗ Branch 42 → 43 not taken.
✗ Branch 42 → 47 not taken.
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 47 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 47 not taken.
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 47 not taken.
34444 int save_lower_left = !diag_edge[3] && sao_eo_class == SAO_EO_45D && !borders[0] && !borders[3];
186
187 // Restore pixels that can't be modified
188
8/16
sao_edge_restore_1_10:
✓ Branch 48 → 49 taken 388 times.
✓ Branch 48 → 53 taken 11628 times.
✓ Branch 49 → 50 taken 282 times.
✓ Branch 49 → 53 taken 106 times.
sao_edge_restore_1_12:
✗ Branch 48 → 49 not taken.
✗ Branch 48 → 53 not taken.
✗ Branch 49 → 50 not taken.
✗ Branch 49 → 53 not taken.
sao_edge_restore_1_8:
✓ Branch 48 → 49 taken 23 times.
✓ Branch 48 → 53 taken 22405 times.
✓ Branch 49 → 50 taken 19 times.
✓ Branch 49 → 53 taken 4 times.
sao_edge_restore_1_9:
✗ Branch 48 → 49 not taken.
✗ Branch 48 → 53 not taken.
✗ Branch 49 → 50 not taken.
✗ Branch 49 → 53 not taken.
34444 if(vert_edge[0] && sao_eo_class != SAO_EO_VERT) {
189
4/8
sao_edge_restore_1_10:
✓ Branch 52 → 51 taken 25267 times.
✓ Branch 52 → 53 taken 282 times.
sao_edge_restore_1_12:
✗ Branch 52 → 51 not taken.
✗ Branch 52 → 53 not taken.
sao_edge_restore_1_8:
✓ Branch 52 → 51 taken 608 times.
✓ Branch 52 → 53 taken 19 times.
sao_edge_restore_1_9:
✗ Branch 52 → 51 not taken.
✗ Branch 52 → 53 not taken.
26176 for(y = init_y+save_upper_left; y< height-save_lower_left; y++)
190 25875 dst[y*stride_dst] = src[y*stride_src];
191 }
192
7/16
sao_edge_restore_1_10:
✓ Branch 53 → 54 taken 450 times.
✓ Branch 53 → 58 taken 11566 times.
✓ Branch 54 → 55 taken 331 times.
✓ Branch 54 → 58 taken 119 times.
sao_edge_restore_1_12:
✗ Branch 53 → 54 not taken.
✗ Branch 53 → 58 not taken.
✗ Branch 54 → 55 not taken.
✗ Branch 54 → 58 not taken.
sao_edge_restore_1_8:
✓ Branch 53 → 54 taken 46 times.
✓ Branch 53 → 58 taken 22382 times.
✓ Branch 54 → 55 taken 46 times.
✗ Branch 54 → 58 not taken.
sao_edge_restore_1_9:
✗ Branch 53 → 54 not taken.
✗ Branch 53 → 58 not taken.
✗ Branch 54 → 55 not taken.
✗ Branch 54 → 58 not taken.
34444 if(vert_edge[1] && sao_eo_class != SAO_EO_VERT) {
193
4/8
sao_edge_restore_1_10:
✓ Branch 57 → 56 taken 30054 times.
✓ Branch 57 → 58 taken 331 times.
sao_edge_restore_1_12:
✗ Branch 57 → 56 not taken.
✗ Branch 57 → 58 not taken.
sao_edge_restore_1_8:
✓ Branch 57 → 56 taken 1406 times.
✓ Branch 57 → 58 taken 46 times.
sao_edge_restore_1_9:
✗ Branch 57 → 56 not taken.
✗ Branch 57 → 58 not taken.
31837 for(y = init_y+save_upper_right; y< height-save_lower_right; y++)
194 31460 dst[y*stride_dst+width-1] = src[y*stride_src+width-1];
195 }
196
197
8/16
sao_edge_restore_1_10:
✓ Branch 58 → 59 taken 416 times.
✓ Branch 58 → 63 taken 11600 times.
✓ Branch 59 → 60 taken 283 times.
✓ Branch 59 → 63 taken 133 times.
sao_edge_restore_1_12:
✗ Branch 58 → 59 not taken.
✗ Branch 58 → 63 not taken.
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 63 not taken.
sao_edge_restore_1_8:
✓ Branch 58 → 59 taken 66 times.
✓ Branch 58 → 63 taken 22362 times.
✓ Branch 59 → 60 taken 59 times.
✓ Branch 59 → 63 taken 7 times.
sao_edge_restore_1_9:
✗ Branch 58 → 59 not taken.
✗ Branch 58 → 63 not taken.
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 63 not taken.
34444 if(horiz_edge[0] && sao_eo_class != SAO_EO_HORIZ) {
198
4/8
sao_edge_restore_1_10:
✓ Branch 62 → 61 taken 23768 times.
✓ Branch 62 → 63 taken 283 times.
sao_edge_restore_1_12:
✗ Branch 62 → 61 not taken.
✗ Branch 62 → 63 not taken.
sao_edge_restore_1_8:
✓ Branch 62 → 61 taken 1882 times.
✓ Branch 62 → 63 taken 59 times.
sao_edge_restore_1_9:
✗ Branch 62 → 61 not taken.
✗ Branch 62 → 63 not taken.
25992 for(x = init_x+save_upper_left; x < width-save_upper_right; x++)
199 25650 dst[x] = src[x];
200 }
201
8/16
sao_edge_restore_1_10:
✓ Branch 63 → 64 taken 548 times.
✓ Branch 63 → 68 taken 11468 times.
✓ Branch 64 → 65 taken 399 times.
✓ Branch 64 → 68 taken 149 times.
sao_edge_restore_1_12:
✗ Branch 63 → 64 not taken.
✗ Branch 63 → 68 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 68 not taken.
sao_edge_restore_1_8:
✓ Branch 63 → 64 taken 117 times.
✓ Branch 63 → 68 taken 22311 times.
✓ Branch 64 → 65 taken 90 times.
✓ Branch 64 → 68 taken 27 times.
sao_edge_restore_1_9:
✗ Branch 63 → 64 not taken.
✗ Branch 63 → 68 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 68 not taken.
34444 if(horiz_edge[1] && sao_eo_class != SAO_EO_HORIZ) {
202
4/8
sao_edge_restore_1_10:
✓ Branch 67 → 66 taken 34996 times.
✓ Branch 67 → 68 taken 399 times.
sao_edge_restore_1_12:
✗ Branch 67 → 66 not taken.
✗ Branch 67 → 68 not taken.
sao_edge_restore_1_8:
✓ Branch 67 → 66 taken 2871 times.
✓ Branch 67 → 68 taken 90 times.
sao_edge_restore_1_9:
✗ Branch 67 → 66 not taken.
✗ Branch 67 → 68 not taken.
38356 for(x = init_x+save_lower_left; x < width-save_lower_right; x++)
203 37867 dst[(height-1)*stride_dst+x] = src[(height-1)*stride_src+x];
204 }
205
8/16
sao_edge_restore_1_10:
✓ Branch 68 → 69 taken 533 times.
✓ Branch 68 → 71 taken 11483 times.
✓ Branch 69 → 70 taken 115 times.
✓ Branch 69 → 71 taken 418 times.
sao_edge_restore_1_12:
✗ Branch 68 → 69 not taken.
✗ Branch 68 → 71 not taken.
✗ Branch 69 → 70 not taken.
✗ Branch 69 → 71 not taken.
sao_edge_restore_1_8:
✓ Branch 68 → 69 taken 83 times.
✓ Branch 68 → 71 taken 22345 times.
✓ Branch 69 → 70 taken 28 times.
✓ Branch 69 → 71 taken 55 times.
sao_edge_restore_1_9:
✗ Branch 68 → 69 not taken.
✗ Branch 68 → 71 not taken.
✗ Branch 69 → 70 not taken.
✗ Branch 69 → 71 not taken.
34444 if(diag_edge[0] && sao_eo_class == SAO_EO_135D)
206 143 dst[0] = src[0];
207
8/16
sao_edge_restore_1_10:
✓ Branch 71 → 72 taken 600 times.
✓ Branch 71 → 74 taken 11416 times.
✓ Branch 72 → 73 taken 175 times.
✓ Branch 72 → 74 taken 425 times.
sao_edge_restore_1_12:
✗ Branch 71 → 72 not taken.
✗ Branch 71 → 74 not taken.
✗ Branch 72 → 73 not taken.
✗ Branch 72 → 74 not taken.
sao_edge_restore_1_8:
✓ Branch 71 → 72 taken 107 times.
✓ Branch 71 → 74 taken 22321 times.
✓ Branch 72 → 73 taken 54 times.
✓ Branch 72 → 74 taken 53 times.
sao_edge_restore_1_9:
✗ Branch 71 → 72 not taken.
✗ Branch 71 → 74 not taken.
✗ Branch 72 → 73 not taken.
✗ Branch 72 → 74 not taken.
34444 if(diag_edge[1] && sao_eo_class == SAO_EO_45D)
208 229 dst[width-1] = src[width-1];
209
8/16
sao_edge_restore_1_10:
✓ Branch 74 → 75 taken 693 times.
✓ Branch 74 → 77 taken 11323 times.
✓ Branch 75 → 76 taken 132 times.
✓ Branch 75 → 77 taken 561 times.
sao_edge_restore_1_12:
✗ Branch 74 → 75 not taken.
✗ Branch 74 → 77 not taken.
✗ Branch 75 → 76 not taken.
✗ Branch 75 → 77 not taken.
sao_edge_restore_1_8:
✓ Branch 74 → 75 taken 157 times.
✓ Branch 74 → 77 taken 22271 times.
✓ Branch 75 → 76 taken 54 times.
✓ Branch 75 → 77 taken 103 times.
sao_edge_restore_1_9:
✗ Branch 74 → 75 not taken.
✗ Branch 74 → 77 not taken.
✗ Branch 75 → 76 not taken.
✗ Branch 75 → 77 not taken.
34444 if(diag_edge[2] && sao_eo_class == SAO_EO_135D)
210 186 dst[stride_dst*(height-1)+width-1] = src[stride_src*(height-1)+width-1];
211
8/16
sao_edge_restore_1_10:
✓ Branch 77 → 78 taken 668 times.
✓ Branch 77 → 80 taken 11348 times.
✓ Branch 78 → 79 taken 171 times.
✓ Branch 78 → 80 taken 497 times.
sao_edge_restore_1_12:
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 80 not taken.
✗ Branch 78 → 79 not taken.
✗ Branch 78 → 80 not taken.
sao_edge_restore_1_8:
✓ Branch 77 → 78 taken 131 times.
✓ Branch 77 → 80 taken 22297 times.
✓ Branch 78 → 79 taken 42 times.
✓ Branch 78 → 80 taken 89 times.
sao_edge_restore_1_9:
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 80 not taken.
✗ Branch 78 → 79 not taken.
✗ Branch 78 → 80 not taken.
34444 if(diag_edge[3] && sao_eo_class == SAO_EO_45D)
212 213 dst[stride_dst*(height-1)] = src[stride_src*(height-1)];
213
214 }
215 34444 }
216
217 #undef CMP
218