../../../ffmpeg/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
272 / 408
66.7%
Branches:
200 / 328
61.0%
Functions:
3 / 4
75.0%

libavcodec/vp9_mc_template.c
Line Branch Exec Source
1 /*
2 * VP9 compatible video decoder
3 *
4 * Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
5 * Copyright (C) 2013 Clément Bœsch <u pkh me>
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 #define ROUNDED_DIV_MVx2(a, b) \
25 (VP9mv) { .x = ROUNDED_DIV(a.x + b.x, 2), .y = ROUNDED_DIV(a.y + b.y, 2) }
26 #define ROUNDED_DIV_MVx4(a, b, c, d) \
27 (VP9mv) { .x = ROUNDED_DIV(a.x + b.x + c.x + d.x, 4), \
28 .y = ROUNDED_DIV(a.y + b.y + c.y + d.y, 4) }
29
30 533188 static void FN(inter_pred)(VP9TileData *td)
31 {
32 static const uint8_t bwlog_tab[2][N_BS_SIZES] = {
33 { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
34 { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 },
35 };
36 533188 const VP9Context *s = td->s;
37 533188 VP9Block *b = td->b;
38 533188 int row = td->row, col = td->col;
39 533188 const ProgressFrame *tref1 = &s->s.refs[s->s.h.refidx[b->ref[0]]], *tref2;
40 533188 const AVFrame *ref1 = tref1->f, *ref2;
41 533188 int w1 = ref1->width, h1 = ref1->height, w2, h2;
42 533188 ptrdiff_t ls_y = td->y_stride, ls_uv = td->uv_stride;
43 533188 int bytesperpixel = BYTES_PER_PIXEL;
44
45
5/8
inter_pred_16bpp:
✓ Branch 2 → 3 taken 2075 times.
✓ Branch 2 → 4 taken 13712 times.
inter_pred_8bpp:
✓ Branch 2 → 3 taken 25176 times.
✓ Branch 2 → 4 taken 491536 times.
inter_pred_scaled_16bpp:
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
inter_pred_scaled_8bpp:
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 4 taken 689 times.
533188 if (b->comp) {
46 27251 tref2 = &s->s.refs[s->s.h.refidx[b->ref[1]]];
47 27251 ref2 = tref2->f;
48 27251 w2 = ref2->width;
49 27251 h2 = ref2->height;
50 }
51
52 // y inter pred
53
5/8
inter_pred_16bpp:
✓ Branch 4 → 5 taken 3775 times.
✓ Branch 4 → 179 taken 12012 times.
inter_pred_8bpp:
✓ Branch 4 → 5 taken 46378 times.
✓ Branch 4 → 179 taken 470334 times.
inter_pred_scaled_16bpp:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 105 not taken.
inter_pred_scaled_8bpp:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 105 taken 689 times.
533188 if (b->bs > BS_8x8) {
54 VP9mv uvmv;
55
56 #if SCALED == 0
57
4/4
inter_pred_16bpp:
✓ Branch 5 → 6 taken 579 times.
✓ Branch 5 → 51 taken 3196 times.
inter_pred_8bpp:
✓ Branch 5 → 6 taken 16808 times.
✓ Branch 5 → 51 taken 29570 times.
50153 if (b->bs == BS_8x4) {
58 17387 mc_luma_dir(td, mc[3][b->filter][0], td->dst[0], ls_y,
59 ref1->data[0], ref1->linesize[0], tref1,
60 row << 3, col << 3, &b->mv[0][0],,,,, 8, 4, w1, h1, 0);
61 17387 mc_luma_dir(td, mc[3][b->filter][0],
62 td->dst[0] + 4 * ls_y, ls_y,
63 ref1->data[0], ref1->linesize[0], tref1,
64 (row << 3) + 4, col << 3, &b->mv[2][0],,,,, 8, 4, w1, h1, 0);
65 17387 w1 = (w1 + s->ss_h) >> s->ss_h;
66
4/4
inter_pred_16bpp:
✓ Branch 8 → 9 taken 130 times.
✓ Branch 8 → 17 taken 449 times.
inter_pred_8bpp:
✓ Branch 8 → 9 taken 16669 times.
✓ Branch 8 → 17 taken 139 times.
17387 if (s->ss_v) {
67 16799 h1 = (h1 + 1) >> 1;
68
8/8
inter_pred_16bpp:
✓ Branch 9 → 10 taken 115 times.
✓ Branch 9 → 11 taken 15 times.
✓ Branch 12 → 13 taken 97 times.
✓ Branch 12 → 14 taken 33 times.
inter_pred_8bpp:
✓ Branch 9 → 10 taken 14726 times.
✓ Branch 9 → 11 taken 1943 times.
✓ Branch 12 → 13 taken 9242 times.
✓ Branch 12 → 14 taken 7427 times.
16799 uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[2][0]);
69 16799 mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][0],
70 td->dst[1], td->dst[2], ls_uv,
71 ref1->data[1], ref1->linesize[1],
72 ref1->data[2], ref1->linesize[2], tref1,
73 row << 2, col << (3 - s->ss_h),
74 &uvmv,,,,, 8 >> s->ss_h, 4, w1, h1, 0);
75 } else {
76 588 mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][0],
77 td->dst[1], td->dst[2], ls_uv,
78 ref1->data[1], ref1->linesize[1],
79 ref1->data[2], ref1->linesize[2], tref1,
80 row << 3, col << (3 - s->ss_h),
81 &b->mv[0][0],,,,, 8 >> s->ss_h, 4, w1, h1, 0);
82 // BUG for 4:2:2 bs=8x4, libvpx uses the wrong block index
83 // to get the motion vector for the bottom 4x4 block
84 // https://code.google.com/p/webm/issues/detail?id=993
85
4/4
inter_pred_16bpp:
✓ Branch 18 → 19 taken 185 times.
✓ Branch 18 → 20 taken 264 times.
inter_pred_8bpp:
✓ Branch 18 → 19 taken 58 times.
✓ Branch 18 → 20 taken 81 times.
588 if (s->ss_h == 0) {
86 243 uvmv = b->mv[2][0];
87 } else {
88
8/8
inter_pred_16bpp:
✓ Branch 20 → 21 taken 223 times.
✓ Branch 20 → 22 taken 41 times.
✓ Branch 23 → 24 taken 201 times.
✓ Branch 23 → 25 taken 63 times.
inter_pred_8bpp:
✓ Branch 20 → 21 taken 71 times.
✓ Branch 20 → 22 taken 10 times.
✓ Branch 23 → 24 taken 64 times.
✓ Branch 23 → 25 taken 17 times.
345 uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[2][0]);
89 }
90 588 mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][0],
91 td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv,
92 ref1->data[1], ref1->linesize[1],
93 ref1->data[2], ref1->linesize[2], tref1,
94 (row << 3) + 4, col << (3 - s->ss_h),
95 &uvmv,,,,, 8 >> s->ss_h, 4, w1, h1, 0);
96 }
97
98
4/4
inter_pred_16bpp:
✓ Branch 28 → 29 taken 122 times.
✓ Branch 28 → 178 taken 457 times.
inter_pred_8bpp:
✓ Branch 28 → 29 taken 167 times.
✓ Branch 28 → 178 taken 16641 times.
17387 if (b->comp) {
99 289 mc_luma_dir(td, mc[3][b->filter][1], td->dst[0], ls_y,
100 ref2->data[0], ref2->linesize[0], tref2,
101 row << 3, col << 3, &b->mv[0][1],,,,, 8, 4, w2, h2, 1);
102 289 mc_luma_dir(td, mc[3][b->filter][1],
103 td->dst[0] + 4 * ls_y, ls_y,
104 ref2->data[0], ref2->linesize[0], tref2,
105 (row << 3) + 4, col << 3, &b->mv[2][1],,,,, 8, 4, w2, h2, 1);
106 289 w2 = (w2 + s->ss_h) >> s->ss_h;
107
4/4
inter_pred_16bpp:
✓ Branch 31 → 32 taken 28 times.
✓ Branch 31 → 40 taken 94 times.
inter_pred_8bpp:
✓ Branch 31 → 32 taken 140 times.
✓ Branch 31 → 40 taken 27 times.
289 if (s->ss_v) {
108 168 h2 = (h2 + 1) >> 1;
109
7/8
inter_pred_16bpp:
✗ Branch 32 → 33 not taken.
✓ Branch 32 → 34 taken 28 times.
✓ Branch 35 → 36 taken 27 times.
✓ Branch 35 → 37 taken 1 time.
inter_pred_8bpp:
✓ Branch 32 → 33 taken 117 times.
✓ Branch 32 → 34 taken 23 times.
✓ Branch 35 → 36 taken 44 times.
✓ Branch 35 → 37 taken 96 times.
168 uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[2][1]);
110 168 mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][1],
111 td->dst[1], td->dst[2], ls_uv,
112 ref2->data[1], ref2->linesize[1],
113 ref2->data[2], ref2->linesize[2], tref2,
114 row << 2, col << (3 - s->ss_h),
115 &uvmv,,,,, 8 >> s->ss_h, 4, w2, h2, 1);
116 } else {
117 121 mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][1],
118 td->dst[1], td->dst[2], ls_uv,
119 ref2->data[1], ref2->linesize[1],
120 ref2->data[2], ref2->linesize[2], tref2,
121 row << 3, col << (3 - s->ss_h),
122 &b->mv[0][1],,,,, 8 >> s->ss_h, 4, w2, h2, 1);
123 // BUG for 4:2:2 bs=8x4, libvpx uses the wrong block index
124 // to get the motion vector for the bottom 4x4 block
125 // https://code.google.com/p/webm/issues/detail?id=993
126
4/4
inter_pred_16bpp:
✓ Branch 41 → 42 taken 42 times.
✓ Branch 41 → 43 taken 52 times.
inter_pred_8bpp:
✓ Branch 41 → 42 taken 5 times.
✓ Branch 41 → 43 taken 22 times.
121 if (s->ss_h == 0) {
127 47 uvmv = b->mv[2][1];
128 } else {
129
5/8
inter_pred_16bpp:
✗ Branch 43 → 44 not taken.
✓ Branch 43 → 45 taken 52 times.
✓ Branch 46 → 47 taken 50 times.
✓ Branch 46 → 48 taken 2 times.
inter_pred_8bpp:
✗ Branch 43 → 44 not taken.
✓ Branch 43 → 45 taken 22 times.
✓ Branch 46 → 47 taken 22 times.
✗ Branch 46 → 48 not taken.
74 uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[2][1]);
130 }
131 121 mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][1],
132 td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv,
133 ref2->data[1], ref2->linesize[1],
134 ref2->data[2], ref2->linesize[2], tref2,
135 (row << 3) + 4, col << (3 - s->ss_h),
136 &uvmv,,,,, 8 >> s->ss_h, 4, w2, h2, 1);
137 }
138 }
139
4/4
inter_pred_16bpp:
✓ Branch 51 → 52 taken 1798 times.
✓ Branch 51 → 79 taken 1398 times.
inter_pred_8bpp:
✓ Branch 51 → 52 taken 13929 times.
✓ Branch 51 → 79 taken 15641 times.
32766 } else if (b->bs == BS_4x8) {
140 15727 mc_luma_dir(td, mc[4][b->filter][0], td->dst[0], ls_y,
141 ref1->data[0], ref1->linesize[0], tref1,
142 row << 3, col << 3, &b->mv[0][0],,,,, 4, 8, w1, h1, 0);
143 15727 mc_luma_dir(td, mc[4][b->filter][0], td->dst[0] + 4 * bytesperpixel, ls_y,
144 ref1->data[0], ref1->linesize[0], tref1,
145 row << 3, (col << 3) + 4, &b->mv[1][0],,,,, 4, 8, w1, h1, 0);
146 15727 h1 = (h1 + s->ss_v) >> s->ss_v;
147
4/4
inter_pred_16bpp:
✓ Branch 54 → 55 taken 324 times.
✓ Branch 54 → 63 taken 1474 times.
inter_pred_8bpp:
✓ Branch 54 → 55 taken 13601 times.
✓ Branch 54 → 63 taken 328 times.
15727 if (s->ss_h) {
148 13925 w1 = (w1 + 1) >> 1;
149
8/8
inter_pred_16bpp:
✓ Branch 55 → 56 taken 257 times.
✓ Branch 55 → 57 taken 67 times.
✓ Branch 58 → 59 taken 251 times.
✓ Branch 58 → 60 taken 73 times.
inter_pred_8bpp:
✓ Branch 55 → 56 taken 11128 times.
✓ Branch 55 → 57 taken 2473 times.
✓ Branch 58 → 59 taken 9129 times.
✓ Branch 58 → 60 taken 4472 times.
13925 uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[1][0]);
150 13925 mc_chroma_dir(td, mc[4][b->filter][0],
151 td->dst[1], td->dst[2], ls_uv,
152 ref1->data[1], ref1->linesize[1],
153 ref1->data[2], ref1->linesize[2], tref1,
154 row << (3 - s->ss_v), col << 2,
155 &uvmv,,,,, 4, 8 >> s->ss_v, w1, h1, 0);
156 } else {
157 1802 mc_chroma_dir(td, mc[4][b->filter][0],
158 td->dst[1], td->dst[2], ls_uv,
159 ref1->data[1], ref1->linesize[1],
160 ref1->data[2], ref1->linesize[2], tref1,
161 row << (3 - s->ss_v), col << 3,
162 &b->mv[0][0],,,,, 4, 8 >> s->ss_v, w1, h1, 0);
163 1802 mc_chroma_dir(td, mc[4][b->filter][0],
164 td->dst[1] + 4 * bytesperpixel,
165 td->dst[2] + 4 * bytesperpixel, ls_uv,
166 ref1->data[1], ref1->linesize[1],
167 ref1->data[2], ref1->linesize[2], tref1,
168 row << (3 - s->ss_v), (col << 3) + 4,
169 &b->mv[1][0],,,,, 4, 8 >> s->ss_v, w1, h1, 0);
170 }
171
172
4/4
inter_pred_16bpp:
✓ Branch 65 → 66 taken 226 times.
✓ Branch 65 → 178 taken 1572 times.
inter_pred_8bpp:
✓ Branch 65 → 66 taken 187 times.
✓ Branch 65 → 178 taken 13742 times.
15727 if (b->comp) {
173 413 mc_luma_dir(td, mc[4][b->filter][1], td->dst[0], ls_y,
174 ref2->data[0], ref2->linesize[0], tref2,
175 row << 3, col << 3, &b->mv[0][1],,,,, 4, 8, w2, h2, 1);
176 413 mc_luma_dir(td, mc[4][b->filter][1], td->dst[0] + 4 * bytesperpixel, ls_y,
177 ref2->data[0], ref2->linesize[0], tref2,
178 row << 3, (col << 3) + 4, &b->mv[1][1],,,,, 4, 8, w2, h2, 1);
179 413 h2 = (h2 + s->ss_v) >> s->ss_v;
180
4/4
inter_pred_16bpp:
✓ Branch 68 → 69 taken 30 times.
✓ Branch 68 → 77 taken 196 times.
inter_pred_8bpp:
✓ Branch 68 → 69 taken 158 times.
✓ Branch 68 → 77 taken 29 times.
413 if (s->ss_h) {
181 188 w2 = (w2 + 1) >> 1;
182
7/8
inter_pred_16bpp:
✗ Branch 69 → 70 not taken.
✓ Branch 69 → 71 taken 30 times.
✓ Branch 72 → 73 taken 25 times.
✓ Branch 72 → 74 taken 5 times.
inter_pred_8bpp:
✓ Branch 69 → 70 taken 141 times.
✓ Branch 69 → 71 taken 17 times.
✓ Branch 72 → 73 taken 41 times.
✓ Branch 72 → 74 taken 117 times.
188 uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[1][1]);
183 188 mc_chroma_dir(td, mc[4][b->filter][1],
184 td->dst[1], td->dst[2], ls_uv,
185 ref2->data[1], ref2->linesize[1],
186 ref2->data[2], ref2->linesize[2], tref2,
187 row << (3 - s->ss_v), col << 2,
188 &uvmv,,,,, 4, 8 >> s->ss_v, w2, h2, 1);
189 } else {
190 225 mc_chroma_dir(td, mc[4][b->filter][1],
191 td->dst[1], td->dst[2], ls_uv,
192 ref2->data[1], ref2->linesize[1],
193 ref2->data[2], ref2->linesize[2], tref2,
194 row << (3 - s->ss_v), col << 3,
195 &b->mv[0][1],,,,, 4, 8 >> s->ss_v, w2, h2, 1);
196 225 mc_chroma_dir(td, mc[4][b->filter][1],
197 td->dst[1] + 4 * bytesperpixel,
198 td->dst[2] + 4 * bytesperpixel, ls_uv,
199 ref2->data[1], ref2->linesize[1],
200 ref2->data[2], ref2->linesize[2], tref2,
201 row << (3 - s->ss_v), (col << 3) + 4,
202 &b->mv[1][1],,,,, 4, 8 >> s->ss_v, w2, h2, 1);
203 }
204 }
205 } else
206 #endif
207 {
208 #if SCALED == 0
209 av_assert2(b->bs == BS_4x4);
210 #endif
211
212 // FIXME if two horizontally adjacent blocks have the same MV,
213 // do a w8 instead of a w4 call
214 17039 mc_luma_dir(td, mc[4][b->filter][0], td->dst[0], ls_y,
215 ref1->data[0], ref1->linesize[0], tref1,
216 row << 3, col << 3, &b->mv[0][0],
217 0, 0, 8, 8, 4, 4, w1, h1, 0);
218 17039 mc_luma_dir(td, mc[4][b->filter][0], td->dst[0] + 4 * bytesperpixel, ls_y,
219 ref1->data[0], ref1->linesize[0], tref1,
220 row << 3, (col << 3) + 4, &b->mv[1][0],
221 4, 0, 8, 8, 4, 4, w1, h1, 0);
222 17039 mc_luma_dir(td, mc[4][b->filter][0],
223 td->dst[0] + 4 * ls_y, ls_y,
224 ref1->data[0], ref1->linesize[0], tref1,
225 (row << 3) + 4, col << 3, &b->mv[2][0],
226 0, 4, 8, 8, 4, 4, w1, h1, 0);
227 17039 mc_luma_dir(td, mc[4][b->filter][0],
228 td->dst[0] + 4 * ls_y + 4 * bytesperpixel, ls_y,
229 ref1->data[0], ref1->linesize[0], tref1,
230 (row << 3) + 4, (col << 3) + 4, &b->mv[3][0],
231 4, 4, 8, 8, 4, 4, w1, h1, 0);
232
4/8
inter_pred_16bpp:
✓ Branch 83 → 84 taken 670 times.
✓ Branch 83 → 108 taken 728 times.
inter_pred_8bpp:
✓ Branch 83 → 84 taken 15405 times.
✓ Branch 83 → 108 taken 236 times.
inter_pred_scaled_16bpp:
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 34 not taken.
inter_pred_scaled_8bpp:
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 34 not taken.
17039 if (s->ss_v) {
233 16075 h1 = (h1 + 1) >> 1;
234
4/8
inter_pred_16bpp:
✓ Branch 84 → 85 taken 137 times.
✓ Branch 84 → 93 taken 533 times.
inter_pred_8bpp:
✓ Branch 84 → 85 taken 15311 times.
✓ Branch 84 → 93 taken 94 times.
inter_pred_scaled_16bpp:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 19 not taken.
inter_pred_scaled_8bpp:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 19 not taken.
16075 if (s->ss_h) {
235 15448 w1 = (w1 + 1) >> 1;
236
8/16
inter_pred_16bpp:
✓ Branch 85 → 86 taken 114 times.
✓ Branch 85 → 87 taken 23 times.
✓ Branch 88 → 89 taken 100 times.
✓ Branch 88 → 90 taken 37 times.
inter_pred_8bpp:
✓ Branch 85 → 86 taken 11067 times.
✓ Branch 85 → 87 taken 4244 times.
✓ Branch 88 → 89 taken 9852 times.
✓ Branch 88 → 90 taken 5459 times.
inter_pred_scaled_16bpp:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 16 not taken.
inter_pred_scaled_8bpp:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 16 not taken.
15448 uvmv = ROUNDED_DIV_MVx4(b->mv[0][0], b->mv[1][0],
237 b->mv[2][0], b->mv[3][0]);
238 15448 mc_chroma_dir(td, mc[4][b->filter][0],
239 td->dst[1], td->dst[2], ls_uv,
240 ref1->data[1], ref1->linesize[1],
241 ref1->data[2], ref1->linesize[2], tref1,
242 row << 2, col << 2,
243 &uvmv, 0, 0, 4, 4, 4, 4, w1, h1, 0);
244 } else {
245
8/16
inter_pred_16bpp:
✓ Branch 93 → 94 taken 425 times.
✓ Branch 93 → 95 taken 108 times.
✓ Branch 96 → 97 taken 366 times.
✓ Branch 96 → 98 taken 167 times.
inter_pred_8bpp:
✓ Branch 93 → 94 taken 79 times.
✓ Branch 93 → 95 taken 15 times.
✓ Branch 96 → 97 taken 75 times.
✓ Branch 96 → 98 taken 19 times.
inter_pred_scaled_16bpp:
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 21 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
inter_pred_scaled_8bpp:
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 21 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
627 uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[2][0]);
246 627 mc_chroma_dir(td, mc[4][b->filter][0],
247 td->dst[1], td->dst[2], ls_uv,
248 ref1->data[1], ref1->linesize[1],
249 ref1->data[2], ref1->linesize[2], tref1,
250 row << 2, col << 3,
251 &uvmv, 0, 0, 8, 4, 4, 4, w1, h1, 0);
252
8/16
inter_pred_16bpp:
✓ Branch 100 → 101 taken 400 times.
✓ Branch 100 → 102 taken 133 times.
✓ Branch 103 → 104 taken 360 times.
✓ Branch 103 → 105 taken 173 times.
inter_pred_8bpp:
✓ Branch 100 → 101 taken 80 times.
✓ Branch 100 → 102 taken 14 times.
✓ Branch 103 → 104 taken 79 times.
✓ Branch 103 → 105 taken 15 times.
inter_pred_scaled_16bpp:
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 28 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
inter_pred_scaled_8bpp:
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 28 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
627 uvmv = ROUNDED_DIV_MVx2(b->mv[1][0], b->mv[3][0]);
253 627 mc_chroma_dir(td, mc[4][b->filter][0],
254 td->dst[1] + 4 * bytesperpixel,
255 td->dst[2] + 4 * bytesperpixel, ls_uv,
256 ref1->data[1], ref1->linesize[1],
257 ref1->data[2], ref1->linesize[2], tref1,
258 row << 2, (col << 3) + 4,
259 &uvmv, 4, 0, 8, 4, 4, 4, w1, h1, 0);
260 }
261 } else {
262
4/8
inter_pred_16bpp:
✓ Branch 108 → 109 taken 534 times.
✓ Branch 108 → 124 taken 194 times.
inter_pred_8bpp:
✓ Branch 108 → 109 taken 155 times.
✓ Branch 108 → 124 taken 81 times.
inter_pred_scaled_16bpp:
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 50 not taken.
inter_pred_scaled_8bpp:
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 50 not taken.
964 if (s->ss_h) {
263 689 w1 = (w1 + 1) >> 1;
264
8/16
inter_pred_16bpp:
✓ Branch 109 → 110 taken 435 times.
✓ Branch 109 → 111 taken 99 times.
✓ Branch 112 → 113 taken 421 times.
✓ Branch 112 → 114 taken 113 times.
inter_pred_8bpp:
✓ Branch 109 → 110 taken 128 times.
✓ Branch 109 → 111 taken 27 times.
✓ Branch 112 → 113 taken 111 times.
✓ Branch 112 → 114 taken 44 times.
inter_pred_scaled_16bpp:
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 37 not taken.
✗ Branch 38 → 39 not taken.
✗ Branch 38 → 40 not taken.
inter_pred_scaled_8bpp:
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 37 not taken.
✗ Branch 38 → 39 not taken.
✗ Branch 38 → 40 not taken.
689 uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[1][0]);
265 689 mc_chroma_dir(td, mc[4][b->filter][0],
266 td->dst[1], td->dst[2], ls_uv,
267 ref1->data[1], ref1->linesize[1],
268 ref1->data[2], ref1->linesize[2], tref1,
269 row << 3, col << 2,
270 &uvmv, 0, 0, 4, 8, 4, 4, w1, h1, 0);
271 // BUG libvpx uses wrong block index for 4:2:2 bs=4x4
272 // bottom block
273 // https://code.google.com/p/webm/issues/detail?id=993
274
8/16
inter_pred_16bpp:
✓ Branch 116 → 117 taken 435 times.
✓ Branch 116 → 118 taken 99 times.
✓ Branch 119 → 120 taken 410 times.
✓ Branch 119 → 121 taken 124 times.
inter_pred_8bpp:
✓ Branch 116 → 117 taken 128 times.
✓ Branch 116 → 118 taken 27 times.
✓ Branch 119 → 120 taken 105 times.
✓ Branch 119 → 121 taken 50 times.
inter_pred_scaled_16bpp:
✗ Branch 42 → 43 not taken.
✗ Branch 42 → 44 not taken.
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 47 not taken.
inter_pred_scaled_8bpp:
✗ Branch 42 → 43 not taken.
✗ Branch 42 → 44 not taken.
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 47 not taken.
689 uvmv = ROUNDED_DIV_MVx2(b->mv[1][0], b->mv[2][0]);
275 689 mc_chroma_dir(td, mc[4][b->filter][0],
276 td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv,
277 ref1->data[1], ref1->linesize[1],
278 ref1->data[2], ref1->linesize[2], tref1,
279 (row << 3) + 4, col << 2,
280 &uvmv, 0, 4, 4, 8, 4, 4, w1, h1, 0);
281 } else {
282 275 mc_chroma_dir(td, mc[4][b->filter][0],
283 td->dst[1], td->dst[2], ls_uv,
284 ref1->data[1], ref1->linesize[1],
285 ref1->data[2], ref1->linesize[2], tref1,
286 row << 3, col << 3,
287 &b->mv[0][0], 0, 0, 8, 8, 4, 4, w1, h1, 0);
288 275 mc_chroma_dir(td, mc[4][b->filter][0],
289 td->dst[1] + 4 * bytesperpixel,
290 td->dst[2] + 4 * bytesperpixel, ls_uv,
291 ref1->data[1], ref1->linesize[1],
292 ref1->data[2], ref1->linesize[2], tref1,
293 row << 3, (col << 3) + 4,
294 &b->mv[1][0], 4, 0, 8, 8, 4, 4, w1, h1, 0);
295 275 mc_chroma_dir(td, mc[4][b->filter][0],
296 td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv,
297 ref1->data[1], ref1->linesize[1],
298 ref1->data[2], ref1->linesize[2], tref1,
299 (row << 3) + 4, col << 3,
300 &b->mv[2][0], 0, 4, 8, 8, 4, 4, w1, h1, 0);
301 275 mc_chroma_dir(td, mc[4][b->filter][0],
302 td->dst[1] + 4 * ls_uv + 4 * bytesperpixel,
303 td->dst[2] + 4 * ls_uv + 4 * bytesperpixel, ls_uv,
304 ref1->data[1], ref1->linesize[1],
305 ref1->data[2], ref1->linesize[2], tref1,
306 (row << 3) + 4, (col << 3) + 4,
307 &b->mv[3][0], 4, 4, 8, 8, 4, 4, w1, h1, 0);
308 }
309 }
310
311
4/8
inter_pred_16bpp:
✓ Branch 128 → 129 taken 128 times.
✓ Branch 128 → 178 taken 1270 times.
inter_pred_8bpp:
✓ Branch 128 → 129 taken 93 times.
✓ Branch 128 → 178 taken 15548 times.
inter_pred_scaled_16bpp:
✗ Branch 54 → 55 not taken.
✗ Branch 54 → 104 not taken.
inter_pred_scaled_8bpp:
✗ Branch 54 → 55 not taken.
✗ Branch 54 → 104 not taken.
17039 if (b->comp) {
312 221 mc_luma_dir(td, mc[4][b->filter][1], td->dst[0], ls_y,
313 ref2->data[0], ref2->linesize[0], tref2,
314 row << 3, col << 3, &b->mv[0][1], 0, 0, 8, 8, 4, 4, w2, h2, 1);
315 221 mc_luma_dir(td, mc[4][b->filter][1], td->dst[0] + 4 * bytesperpixel, ls_y,
316 ref2->data[0], ref2->linesize[0], tref2,
317 row << 3, (col << 3) + 4, &b->mv[1][1], 4, 0, 8, 8, 4, 4, w2, h2, 1);
318 221 mc_luma_dir(td, mc[4][b->filter][1],
319 td->dst[0] + 4 * ls_y, ls_y,
320 ref2->data[0], ref2->linesize[0], tref2,
321 (row << 3) + 4, col << 3, &b->mv[2][1], 0, 4, 8, 8, 4, 4, w2, h2, 1);
322 221 mc_luma_dir(td, mc[4][b->filter][1],
323 td->dst[0] + 4 * ls_y + 4 * bytesperpixel, ls_y,
324 ref2->data[0], ref2->linesize[0], tref2,
325 (row << 3) + 4, (col << 3) + 4, &b->mv[3][1], 4, 4, 8, 8, 4, 4, w2, h2, 1);
326
4/8
inter_pred_16bpp:
✓ Branch 133 → 134 taken 79 times.
✓ Branch 133 → 158 taken 49 times.
inter_pred_8bpp:
✓ Branch 133 → 134 taken 75 times.
✓ Branch 133 → 158 taken 18 times.
inter_pred_scaled_16bpp:
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 84 not taken.
inter_pred_scaled_8bpp:
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 84 not taken.
221 if (s->ss_v) {
327 154 h2 = (h2 + 1) >> 1;
328
4/8
inter_pred_16bpp:
✓ Branch 134 → 135 taken 13 times.
✓ Branch 134 → 143 taken 66 times.
inter_pred_8bpp:
✓ Branch 134 → 135 taken 61 times.
✓ Branch 134 → 143 taken 14 times.
inter_pred_scaled_16bpp:
✗ Branch 60 → 61 not taken.
✗ Branch 60 → 69 not taken.
inter_pred_scaled_8bpp:
✗ Branch 60 → 61 not taken.
✗ Branch 60 → 69 not taken.
154 if (s->ss_h) {
329 74 w2 = (w2 + 1) >> 1;
330
7/16
inter_pred_16bpp:
✗ Branch 135 → 136 not taken.
✓ Branch 135 → 137 taken 13 times.
✓ Branch 138 → 139 taken 12 times.
✓ Branch 138 → 140 taken 1 time.
inter_pred_8bpp:
✓ Branch 135 → 136 taken 48 times.
✓ Branch 135 → 137 taken 13 times.
✓ Branch 138 → 139 taken 18 times.
✓ Branch 138 → 140 taken 43 times.
inter_pred_scaled_16bpp:
✗ Branch 61 → 62 not taken.
✗ Branch 61 → 63 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
inter_pred_scaled_8bpp:
✗ Branch 61 → 62 not taken.
✗ Branch 61 → 63 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
74 uvmv = ROUNDED_DIV_MVx4(b->mv[0][1], b->mv[1][1],
331 b->mv[2][1], b->mv[3][1]);
332 74 mc_chroma_dir(td, mc[4][b->filter][1],
333 td->dst[1], td->dst[2], ls_uv,
334 ref2->data[1], ref2->linesize[1],
335 ref2->data[2], ref2->linesize[2], tref2,
336 row << 2, col << 2,
337 &uvmv, 0, 0, 4, 4, 4, 4, w2, h2, 1);
338 } else {
339
7/16
inter_pred_16bpp:
✓ Branch 143 → 144 taken 25 times.
✓ Branch 143 → 145 taken 41 times.
✓ Branch 146 → 147 taken 47 times.
✓ Branch 146 → 148 taken 19 times.
inter_pred_8bpp:
✗ Branch 143 → 144 not taken.
✓ Branch 143 → 145 taken 14 times.
✓ Branch 146 → 147 taken 13 times.
✓ Branch 146 → 148 taken 1 time.
inter_pred_scaled_16bpp:
✗ Branch 69 → 70 not taken.
✗ Branch 69 → 71 not taken.
✗ Branch 72 → 73 not taken.
✗ Branch 72 → 74 not taken.
inter_pred_scaled_8bpp:
✗ Branch 69 → 70 not taken.
✗ Branch 69 → 71 not taken.
✗ Branch 72 → 73 not taken.
✗ Branch 72 → 74 not taken.
80 uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[2][1]);
340 80 mc_chroma_dir(td, mc[4][b->filter][1],
341 td->dst[1], td->dst[2], ls_uv,
342 ref2->data[1], ref2->linesize[1],
343 ref2->data[2], ref2->linesize[2], tref2,
344 row << 2, col << 3,
345 &uvmv, 0, 0, 8, 4, 4, 4, w2, h2, 1);
346
7/16
inter_pred_16bpp:
✓ Branch 150 → 151 taken 27 times.
✓ Branch 150 → 152 taken 39 times.
✓ Branch 153 → 154 taken 45 times.
✓ Branch 153 → 155 taken 21 times.
inter_pred_8bpp:
✓ Branch 150 → 151 taken 2 times.
✓ Branch 150 → 152 taken 12 times.
✓ Branch 153 → 154 taken 14 times.
✗ Branch 153 → 155 not taken.
inter_pred_scaled_16bpp:
✗ Branch 76 → 77 not taken.
✗ Branch 76 → 78 not taken.
✗ Branch 79 → 80 not taken.
✗ Branch 79 → 81 not taken.
inter_pred_scaled_8bpp:
✗ Branch 76 → 77 not taken.
✗ Branch 76 → 78 not taken.
✗ Branch 79 → 80 not taken.
✗ Branch 79 → 81 not taken.
80 uvmv = ROUNDED_DIV_MVx2(b->mv[1][1], b->mv[3][1]);
347 80 mc_chroma_dir(td, mc[4][b->filter][1],
348 td->dst[1] + 4 * bytesperpixel,
349 td->dst[2] + 4 * bytesperpixel, ls_uv,
350 ref2->data[1], ref2->linesize[1],
351 ref2->data[2], ref2->linesize[2], tref2,
352 row << 2, (col << 3) + 4,
353 &uvmv, 4, 0, 8, 4, 4, 4, w2, h2, 1);
354 }
355 } else {
356
4/8
inter_pred_16bpp:
✓ Branch 158 → 159 taken 34 times.
✓ Branch 158 → 174 taken 15 times.
inter_pred_8bpp:
✓ Branch 158 → 159 taken 8 times.
✓ Branch 158 → 174 taken 10 times.
inter_pred_scaled_16bpp:
✗ Branch 84 → 85 not taken.
✗ Branch 84 → 100 not taken.
inter_pred_scaled_8bpp:
✗ Branch 84 → 85 not taken.
✗ Branch 84 → 100 not taken.
67 if (s->ss_h) {
357 42 w2 = (w2 + 1) >> 1;
358
6/16
inter_pred_16bpp:
✗ Branch 159 → 160 not taken.
✓ Branch 159 → 161 taken 34 times.
✓ Branch 162 → 163 taken 32 times.
✓ Branch 162 → 164 taken 2 times.
inter_pred_8bpp:
✗ Branch 159 → 160 not taken.
✓ Branch 159 → 161 taken 8 times.
✓ Branch 162 → 163 taken 7 times.
✓ Branch 162 → 164 taken 1 time.
inter_pred_scaled_16bpp:
✗ Branch 85 → 86 not taken.
✗ Branch 85 → 87 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
inter_pred_scaled_8bpp:
✗ Branch 85 → 86 not taken.
✗ Branch 85 → 87 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
42 uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[1][1]);
359 42 mc_chroma_dir(td, mc[4][b->filter][1],
360 td->dst[1], td->dst[2], ls_uv,
361 ref2->data[1], ref2->linesize[1],
362 ref2->data[2], ref2->linesize[2], tref2,
363 row << 3, col << 2,
364 &uvmv, 0, 0, 4, 8, 4, 4, w2, h2, 1);
365 // BUG libvpx uses wrong block index for 4:2:2 bs=4x4
366 // bottom block
367 // https://code.google.com/p/webm/issues/detail?id=993
368
7/16
inter_pred_16bpp:
✓ Branch 166 → 167 taken 2 times.
✓ Branch 166 → 168 taken 32 times.
✓ Branch 169 → 170 taken 30 times.
✓ Branch 169 → 171 taken 4 times.
inter_pred_8bpp:
✗ Branch 166 → 167 not taken.
✓ Branch 166 → 168 taken 8 times.
✓ Branch 169 → 170 taken 7 times.
✓ Branch 169 → 171 taken 1 time.
inter_pred_scaled_16bpp:
✗ Branch 92 → 93 not taken.
✗ Branch 92 → 94 not taken.
✗ Branch 95 → 96 not taken.
✗ Branch 95 → 97 not taken.
inter_pred_scaled_8bpp:
✗ Branch 92 → 93 not taken.
✗ Branch 92 → 94 not taken.
✗ Branch 95 → 96 not taken.
✗ Branch 95 → 97 not taken.
42 uvmv = ROUNDED_DIV_MVx2(b->mv[1][1], b->mv[2][1]);
369 42 mc_chroma_dir(td, mc[4][b->filter][1],
370 td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv,
371 ref2->data[1], ref2->linesize[1],
372 ref2->data[2], ref2->linesize[2], tref2,
373 (row << 3) + 4, col << 2,
374 &uvmv, 0, 4, 4, 8, 4, 4, w2, h2, 1);
375 } else {
376 25 mc_chroma_dir(td, mc[4][b->filter][1],
377 td->dst[1], td->dst[2], ls_uv,
378 ref2->data[1], ref2->linesize[1],
379 ref2->data[2], ref2->linesize[2], tref2,
380 row << 3, col << 3,
381 &b->mv[0][1], 0, 0, 8, 8, 4, 4, w2, h2, 1);
382 25 mc_chroma_dir(td, mc[4][b->filter][1],
383 td->dst[1] + 4 * bytesperpixel,
384 td->dst[2] + 4 * bytesperpixel, ls_uv,
385 ref2->data[1], ref2->linesize[1],
386 ref2->data[2], ref2->linesize[2], tref2,
387 row << 3, (col << 3) + 4,
388 &b->mv[1][1], 4, 0, 8, 8, 4, 4, w2, h2, 1);
389 25 mc_chroma_dir(td, mc[4][b->filter][1],
390 td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv,
391 ref2->data[1], ref2->linesize[1],
392 ref2->data[2], ref2->linesize[2], tref2,
393 (row << 3) + 4, col << 3,
394 &b->mv[2][1], 0, 4, 8, 8, 4, 4, w2, h2, 1);
395 25 mc_chroma_dir(td, mc[4][b->filter][1],
396 td->dst[1] + 4 * ls_uv + 4 * bytesperpixel,
397 td->dst[2] + 4 * ls_uv + 4 * bytesperpixel, ls_uv,
398 ref2->data[1], ref2->linesize[1],
399 ref2->data[2], ref2->linesize[2], tref2,
400 (row << 3) + 4, (col << 3) + 4,
401 &b->mv[3][1], 4, 4, 8, 8, 4, 4, w2, h2, 1);
402 }
403 }
404 }
405 }
406 } else {
407 483035 int bwl = bwlog_tab[0][b->bs];
408 483035 int bw = ff_vp9_bwh_tab[0][b->bs][0] * 4;
409 483035 int bh = ff_vp9_bwh_tab[0][b->bs][1] * 4;
410 483035 int uvbw = ff_vp9_bwh_tab[s->ss_h][b->bs][0] * 4;
411 483035 int uvbh = ff_vp9_bwh_tab[s->ss_v][b->bs][1] * 4;
412
413 483035 mc_luma_dir(td, mc[bwl][b->filter][0], td->dst[0], ls_y,
414 ref1->data[0], ref1->linesize[0], tref1,
415 row << 3, col << 3, &b->mv[0][0], 0, 0, bw, bh, bw, bh, w1, h1, 0);
416 483035 w1 = (w1 + s->ss_h) >> s->ss_h;
417 483035 h1 = (h1 + s->ss_v) >> s->ss_v;
418 483035 mc_chroma_dir(td, mc[bwl + s->ss_h][b->filter][0],
419 td->dst[1], td->dst[2], ls_uv,
420 ref1->data[1], ref1->linesize[1],
421 ref1->data[2], ref1->linesize[2], tref1,
422 row << (3 - s->ss_v), col << (3 - s->ss_h),
423 &b->mv[0][0], 0, 0, uvbw, uvbh, uvbw, uvbh, w1, h1, 0);
424
425
5/8
inter_pred_16bpp:
✓ Branch 181 → 182 taken 1599 times.
✓ Branch 181 → 184 taken 10413 times.
inter_pred_8bpp:
✓ Branch 181 → 182 taken 24729 times.
✓ Branch 181 → 184 taken 445605 times.
inter_pred_scaled_16bpp:
✗ Branch 107 → 108 not taken.
✗ Branch 107 → 110 not taken.
inter_pred_scaled_8bpp:
✗ Branch 107 → 108 not taken.
✓ Branch 107 → 110 taken 689 times.
483035 if (b->comp) {
426 26328 mc_luma_dir(td, mc[bwl][b->filter][1], td->dst[0], ls_y,
427 ref2->data[0], ref2->linesize[0], tref2,
428 row << 3, col << 3, &b->mv[0][1], 0, 0, bw, bh, bw, bh, w2, h2, 1);
429 26328 w2 = (w2 + s->ss_h) >> s->ss_h;
430 26328 h2 = (h2 + s->ss_v) >> s->ss_v;
431 26328 mc_chroma_dir(td, mc[bwl + s->ss_h][b->filter][1],
432 td->dst[1], td->dst[2], ls_uv,
433 ref2->data[1], ref2->linesize[1],
434 ref2->data[2], ref2->linesize[2], tref2,
435 row << (3 - s->ss_v), col << (3 - s->ss_h),
436 &b->mv[0][1], 0, 0, uvbw, uvbh, uvbw, uvbh, w2, h2, 1);
437 }
438 }
439 533188 }
440