FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/vp9recon.c
Date: 2021-09-23 20:34:37
Exec Total Coverage
Lines: 274 288 95.1%
Branches: 293 322 91.0%

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 #include "libavutil/avassert.h"
25 #include "libavutil/mem_internal.h"
26
27 #include "videodsp.h"
28 #include "vp9data.h"
29 #include "vp9dec.h"
30
31 1441736 static av_always_inline int check_intra_mode(VP9TileData *td, int mode, uint8_t **a,
32 uint8_t *dst_edge, ptrdiff_t stride_edge,
33 uint8_t *dst_inner, ptrdiff_t stride_inner,
34 uint8_t *l, int col, int x, int w,
35 int row, int y, enum TxfmMode tx,
36 int p, int ss_h, int ss_v, int bytesperpixel)
37 {
38 1441736 VP9Context *s = td->s;
39
4/4
✓ Branch 0 taken 57229 times.
✓ Branch 1 taken 1384507 times.
✓ Branch 2 taken 17023 times.
✓ Branch 3 taken 40206 times.
1441736 int have_top = row > 0 || y > 0;
40
4/4
✓ Branch 0 taken 48823 times.
✓ Branch 1 taken 1392913 times.
✓ Branch 2 taken 16420 times.
✓ Branch 3 taken 32403 times.
1441736 int have_left = col > td->tile_col_start || x > 0;
41 1441736 int have_right = x < w - 1;
42 1441736 int bpp = s->s.h.bpp;
43 static const uint8_t mode_conv[10][2 /* have_left */][2 /* have_top */] = {
44 [VERT_PRED] = { { DC_127_PRED, VERT_PRED },
45 { DC_127_PRED, VERT_PRED } },
46 [HOR_PRED] = { { DC_129_PRED, DC_129_PRED },
47 { HOR_PRED, HOR_PRED } },
48 [DC_PRED] = { { DC_128_PRED, TOP_DC_PRED },
49 { LEFT_DC_PRED, DC_PRED } },
50 [DIAG_DOWN_LEFT_PRED] = { { DC_127_PRED, DIAG_DOWN_LEFT_PRED },
51 { DC_127_PRED, DIAG_DOWN_LEFT_PRED } },
52 [DIAG_DOWN_RIGHT_PRED] = { { DIAG_DOWN_RIGHT_PRED, DIAG_DOWN_RIGHT_PRED },
53 { DIAG_DOWN_RIGHT_PRED, DIAG_DOWN_RIGHT_PRED } },
54 [VERT_RIGHT_PRED] = { { VERT_RIGHT_PRED, VERT_RIGHT_PRED },
55 { VERT_RIGHT_PRED, VERT_RIGHT_PRED } },
56 [HOR_DOWN_PRED] = { { HOR_DOWN_PRED, HOR_DOWN_PRED },
57 { HOR_DOWN_PRED, HOR_DOWN_PRED } },
58 [VERT_LEFT_PRED] = { { DC_127_PRED, VERT_LEFT_PRED },
59 { DC_127_PRED, VERT_LEFT_PRED } },
60 [HOR_UP_PRED] = { { DC_129_PRED, DC_129_PRED },
61 { HOR_UP_PRED, HOR_UP_PRED } },
62 [TM_VP8_PRED] = { { DC_129_PRED, VERT_PRED },
63 { HOR_PRED, TM_VP8_PRED } },
64 };
65 static const struct {
66 uint8_t needs_left:1;
67 uint8_t needs_top:1;
68 uint8_t needs_topleft:1;
69 uint8_t needs_topright:1;
70 uint8_t invert_left:1;
71 } edges[N_INTRA_PRED_MODES] = {
72 [VERT_PRED] = { .needs_top = 1 },
73 [HOR_PRED] = { .needs_left = 1 },
74 [DC_PRED] = { .needs_top = 1, .needs_left = 1 },
75 [DIAG_DOWN_LEFT_PRED] = { .needs_top = 1, .needs_topright = 1 },
76 [DIAG_DOWN_RIGHT_PRED] = { .needs_left = 1, .needs_top = 1,
77 .needs_topleft = 1 },
78 [VERT_RIGHT_PRED] = { .needs_left = 1, .needs_top = 1,
79 .needs_topleft = 1 },
80 [HOR_DOWN_PRED] = { .needs_left = 1, .needs_top = 1,
81 .needs_topleft = 1 },
82 [VERT_LEFT_PRED] = { .needs_top = 1, .needs_topright = 1 },
83 [HOR_UP_PRED] = { .needs_left = 1, .invert_left = 1 },
84 [TM_VP8_PRED] = { .needs_left = 1, .needs_top = 1,
85 .needs_topleft = 1 },
86 [LEFT_DC_PRED] = { .needs_left = 1 },
87 [TOP_DC_PRED] = { .needs_top = 1 },
88 [DC_128_PRED] = { 0 },
89 [DC_127_PRED] = { 0 },
90 [DC_129_PRED] = { 0 }
91 };
92
93 av_assert2(mode >= 0 && mode < 10);
94 1441736 mode = mode_conv[mode][have_left][have_top];
95
2/2
✓ Branch 0 taken 996755 times.
✓ Branch 1 taken 444981 times.
1441736 if (edges[mode].needs_top) {
96 uint8_t *top, *topleft;
97 996755 int n_px_need = 4 << tx, n_px_have = (((s->cols - col) << !ss_h) - x) * 4;
98 996755 int n_px_need_tr = 0;
99
100
6/6
✓ Branch 0 taken 746552 times.
✓ Branch 1 taken 250203 times.
✓ Branch 2 taken 56669 times.
✓ Branch 3 taken 689883 times.
✓ Branch 4 taken 22433 times.
✓ Branch 5 taken 34236 times.
996755 if (tx == TX_4X4 && edges[mode].needs_topright && have_right)
101 22433 n_px_need_tr = 4;
102
103 // if top of sb64-row, use s->intra_pred_data[] instead of
104 // dst[-stride] for intra prediction (it contains pre- instead of
105 // post-loopfilter data)
106
2/2
✓ Branch 0 taken 992432 times.
✓ Branch 1 taken 4323 times.
996755 if (have_top) {
107
2/2
✓ Branch 0 taken 99675 times.
✓ Branch 1 taken 98372 times.
198047 top = !(row & 7) && !y ?
108
2/2
✓ Branch 0 taken 198047 times.
✓ Branch 1 taken 794385 times.
1984864 s->intra_pred_data[p] + (col * (8 >> ss_h) + x * 4) * bytesperpixel :
109
2/2
✓ Branch 0 taken 593194 times.
✓ Branch 1 taken 299563 times.
892757 y == 0 ? &dst_edge[-stride_edge] : &dst_inner[-stride_inner];
110
2/2
✓ Branch 0 taken 964036 times.
✓ Branch 1 taken 28396 times.
992432 if (have_left)
111
2/2
✓ Branch 0 taken 95388 times.
✓ Branch 1 taken 96189 times.
1155613 topleft = !(row & 7) && !y ?
112
2/2
✓ Branch 0 taken 191577 times.
✓ Branch 1 taken 772459 times.
1928072 s->intra_pred_data[p] + (col * (8 >> ss_h) + x * 4) * bytesperpixel :
113
4/4
✓ Branch 0 taken 293141 times.
✓ Branch 1 taken 575507 times.
✓ Branch 2 taken 130724 times.
✓ Branch 3 taken 162417 times.
868648 y == 0 || x == 0 ? &dst_edge[-stride_edge] :
114 162417 &dst_inner[-stride_inner];
115 }
116
117
2/2
✓ Branch 0 taken 992432 times.
✓ Branch 1 taken 4323 times.
996755 if (have_top &&
118
8/8
✓ Branch 0 taken 260701 times.
✓ Branch 1 taken 731731 times.
✓ Branch 2 taken 257971 times.
✓ Branch 3 taken 2730 times.
✓ Branch 4 taken 257956 times.
✓ Branch 5 taken 15 times.
✓ Branch 6 taken 740327 times.
✓ Branch 7 taken 249360 times.
992432 (!edges[mode].needs_topleft || (have_left && top == topleft)) &&
119
4/4
✓ Branch 0 taken 56669 times.
✓ Branch 1 taken 683658 times.
✓ Branch 2 taken 22433 times.
✓ Branch 3 taken 34236 times.
740327 (tx != TX_4X4 || !edges[mode].needs_topright || have_right) &&
120
2/2
✓ Branch 0 taken 955297 times.
✓ Branch 1 taken 154 times.
955451 n_px_need + n_px_need_tr <= n_px_have) {
121 955297 *a = top;
122 } else {
123
2/2
✓ Branch 0 taken 37135 times.
✓ Branch 1 taken 4323 times.
41458 if (have_top) {
124
2/2
✓ Branch 0 taken 36997 times.
✓ Branch 1 taken 138 times.
37135 if (n_px_need <= n_px_have) {
125 36997 memcpy(*a, top, n_px_need * bytesperpixel);
126 } else {
127 #define memset_bpp(c, i1, v, i2, num) do { \
128 if (bytesperpixel == 1) { \
129 memset(&(c)[(i1)], (v)[(i2)], (num)); \
130 } else { \
131 int n, val = AV_RN16A(&(v)[(i2) * 2]); \
132 for (n = 0; n < (num); n++) { \
133 AV_WN16A(&(c)[((i1) + n) * 2], val); \
134 } \
135 } \
136 } while (0)
137 138 memcpy(*a, top, n_px_have * bytesperpixel);
138
1/4
✓ Branch 0 taken 138 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
138 memset_bpp(*a, n_px_have, (*a), n_px_have - 1, n_px_need - n_px_have);
139 }
140 } else {
141 #define memset_val(c, val, num) do { \
142 if (bytesperpixel == 1) { \
143 memset((c), (val), (num)); \
144 } else { \
145 int n; \
146 for (n = 0; n < (num); n++) { \
147 AV_WN16A(&(c)[n * 2], (val)); \
148 } \
149 } \
150 } while (0)
151
4/4
✓ Branch 0 taken 4115 times.
✓ Branch 1 taken 208 times.
✓ Branch 2 taken 848 times.
✓ Branch 3 taken 208 times.
5171 memset_val(*a, (128 << (bpp - 8)) - 1, n_px_need);
152 }
153
2/2
✓ Branch 0 taken 7104 times.
✓ Branch 1 taken 34354 times.
41458 if (edges[mode].needs_topleft) {
154
4/4
✓ Branch 0 taken 4125 times.
✓ Branch 1 taken 2979 times.
✓ Branch 2 taken 51 times.
✓ Branch 3 taken 4074 times.
7104 if (have_left && have_top) {
155 #define assign_bpp(c, i1, v, i2) do { \
156 if (bytesperpixel == 1) { \
157 (c)[(i1)] = (v)[(i2)]; \
158 } else { \
159 AV_COPY16(&(c)[(i1) * 2], &(v)[(i2) * 2]); \
160 } \
161 } while (0)
162
1/2
✓ Branch 0 taken 51 times.
✗ Branch 1 not taken.
51 assign_bpp(*a, -1, topleft, -1);
163 } else {
164 #define assign_val(c, i, v) do { \
165 if (bytesperpixel == 1) { \
166 (c)[(i)] = (v); \
167 } else { \
168 AV_WN16A(&(c)[(i) * 2], (v)); \
169 } \
170 } while (0)
171
6/6
✓ Branch 0 taken 6796 times.
✓ Branch 1 taken 257 times.
✓ Branch 2 taken 2681 times.
✓ Branch 3 taken 4115 times.
✓ Branch 4 taken 49 times.
✓ Branch 5 taken 208 times.
7053 assign_val((*a), -1, (128 << (bpp - 8)) + (have_top ? +1 : -1));
172 }
173 }
174
4/4
✓ Branch 0 taken 40477 times.
✓ Branch 1 taken 981 times.
✓ Branch 2 taken 34252 times.
✓ Branch 3 taken 6225 times.
41458 if (tx == TX_4X4 && edges[mode].needs_topright) {
175
3/4
✓ Branch 0 taken 34252 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 16 times.
✓ Branch 3 taken 34236 times.
34252 if (have_top && have_right &&
176
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
16 n_px_need + n_px_need_tr <= n_px_have) {
177 memcpy(&(*a)[4 * bytesperpixel], &top[4 * bytesperpixel], 4 * bytesperpixel);
178 } else {
179
4/4
✓ Branch 0 taken 32900 times.
✓ Branch 1 taken 1352 times.
✓ Branch 2 taken 5408 times.
✓ Branch 3 taken 1352 times.
39660 memset_bpp(*a, 4, *a, 3, 4);
180 }
181 }
182 }
183 }
184
2/2
✓ Branch 0 taken 1187387 times.
✓ Branch 1 taken 254349 times.
1441736 if (edges[mode].needs_left) {
185
2/2
✓ Branch 0 taken 1184408 times.
✓ Branch 1 taken 2979 times.
1187387 if (have_left) {
186 1184408 int n_px_need = 4 << tx, i, n_px_have = (((s->rows - row) << !ss_v) - y) * 4;
187
2/2
✓ Branch 0 taken 801120 times.
✓ Branch 1 taken 383288 times.
1184408 uint8_t *dst = x == 0 ? dst_edge : dst_inner;
188
2/2
✓ Branch 0 taken 801120 times.
✓ Branch 1 taken 383288 times.
1184408 ptrdiff_t stride = x == 0 ? stride_edge : stride_inner;
189
190
2/2
✓ Branch 0 taken 62304 times.
✓ Branch 1 taken 1122104 times.
1184408 if (edges[mode].invert_left) {
191
2/2
✓ Branch 0 taken 62296 times.
✓ Branch 1 taken 8 times.
62304 if (n_px_need <= n_px_have) {
192
2/2
✓ Branch 0 taken 312252 times.
✓ Branch 1 taken 62296 times.
374548 for (i = 0; i < n_px_need; i++)
193
2/2
✓ Branch 0 taken 304228 times.
✓ Branch 1 taken 8024 times.
312252 assign_bpp(l, i, &dst[i * stride], -1);
194 } else {
195
2/2
✓ Branch 0 taken 96 times.
✓ Branch 1 taken 8 times.
104 for (i = 0; i < n_px_have; i++)
196
1/2
✓ Branch 0 taken 96 times.
✗ Branch 1 not taken.
96 assign_bpp(l, i, &dst[i * stride], -1);
197
1/4
✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
8 memset_bpp(l, n_px_have, l, n_px_have - 1, n_px_need - n_px_have);
198 }
199 } else {
200
2/2
✓ Branch 0 taken 1120792 times.
✓ Branch 1 taken 1312 times.
1122104 if (n_px_need <= n_px_have) {
201
2/2
✓ Branch 0 taken 6070484 times.
✓ Branch 1 taken 1120792 times.
7191276 for (i = 0; i < n_px_need; i++)
202
2/2
✓ Branch 0 taken 5966684 times.
✓ Branch 1 taken 103800 times.
6070484 assign_bpp(l, n_px_need - 1 - i, &dst[i * stride], -1);
203 } else {
204
2/2
✓ Branch 0 taken 6648 times.
✓ Branch 1 taken 1312 times.
7960 for (i = 0; i < n_px_have; i++)
205
1/2
✓ Branch 0 taken 6648 times.
✗ Branch 1 not taken.
6648 assign_bpp(l, n_px_need - 1 - i, &dst[i * stride], -1);
206
1/4
✓ Branch 0 taken 1312 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
1312 memset_bpp(l, 0, l, n_px_need - n_px_have, n_px_need - n_px_have);
207 }
208 }
209 } else {
210
4/4
✓ Branch 0 taken 2920 times.
✓ Branch 1 taken 59 times.
✓ Branch 2 taken 252 times.
✓ Branch 3 taken 59 times.
3231 memset_val(l, (128 << (bpp - 8)) + 1, 4 << tx);
211 }
212 }
213
214 1441736 return mode;
215 }
216
217 264074 static av_always_inline void intra_recon(VP9TileData *td, ptrdiff_t y_off,
218 ptrdiff_t uv_off, int bytesperpixel)
219 {
220 264074 VP9Context *s = td->s;
221 264074 VP9Block *b = td->b;
222 264074 int row = td->row, col = td->col;
223 264074 int w4 = ff_vp9_bwh_tab[1][b->bs][0] << 1, step1d = 1 << b->tx, n;
224 264074 int h4 = ff_vp9_bwh_tab[1][b->bs][1] << 1, x, y, step = 1 << (b->tx * 2);
225 264074 int end_x = FFMIN(2 * (s->cols - col), w4);
226 264074 int end_y = FFMIN(2 * (s->rows - row), h4);
227 264074 int tx = 4 * s->s.h.lossless + b->tx, uvtx = b->uvtx + 4 * s->s.h.lossless;
228 264074 int uvstep1d = 1 << b->uvtx, p;
229 264074 uint8_t *dst = td->dst[0], *dst_r = s->s.frames[CUR_FRAME].tf.f->data[0] + y_off;
230 264074 LOCAL_ALIGNED_32(uint8_t, a_buf, [96]);
231 264074 LOCAL_ALIGNED_32(uint8_t, l, [64]);
232
233
2/2
✓ Branch 0 taken 417639 times.
✓ Branch 1 taken 264074 times.
681713 for (n = 0, y = 0; y < end_y; y += step1d) {
234 417639 uint8_t *ptr = dst, *ptr_r = dst_r;
235
2/2
✓ Branch 0 taken 789216 times.
✓ Branch 1 taken 417639 times.
1206855 for (x = 0; x < end_x; x += step1d, ptr += 4 * step1d * bytesperpixel,
236 789216 ptr_r += 4 * step1d * bytesperpixel, n += step) {
237
1/2
✓ Branch 0 taken 335172 times.
✗ Branch 1 not taken.
335172 int mode = b->mode[b->bs > BS_8x8 && b->tx == TX_4X4 ?
238
2/2
✓ Branch 0 taken 335172 times.
✓ Branch 1 taken 454044 times.
1124388 y * 2 + x : 0];
239 789216 uint8_t *a = &a_buf[32];
240 789216 enum TxfmType txtp = ff_vp9_intra_txfm_type[mode];
241
4/4
✓ Branch 0 taken 691994 times.
✓ Branch 1 taken 97222 times.
✓ Branch 2 taken 38168 times.
✓ Branch 3 taken 653826 times.
789216 int eob = b->skip ? 0 : b->tx > TX_8X8 ? AV_RN16A(&td->eob[n]) : td->eob[n];
242
243 789216 mode = check_intra_mode(td, mode, &a, ptr_r,
244 789216 s->s.frames[CUR_FRAME].tf.f->linesize[0],
245 ptr, td->y_stride, l,
246 col, x, w4, row, y, b->tx, 0, 0, 0, bytesperpixel);
247 789216 s->dsp.intra_pred[b->tx][mode](ptr, td->y_stride, l, a);
248
2/2
✓ Branch 0 taken 554852 times.
✓ Branch 1 taken 234364 times.
789216 if (eob)
249 554852 s->dsp.itxfm_add[tx][txtp](ptr, td->y_stride,
250 554852 td->block + 16 * n * bytesperpixel, eob);
251 }
252 417639 dst_r += 4 * step1d * s->s.frames[CUR_FRAME].tf.f->linesize[0];
253 417639 dst += 4 * step1d * td->y_stride;
254 }
255
256 // U/V
257 264074 w4 >>= s->ss_h;
258 264074 end_x >>= s->ss_h;
259 264074 end_y >>= s->ss_v;
260 264074 step = 1 << (b->uvtx * 2);
261
2/2
✓ Branch 0 taken 528148 times.
✓ Branch 1 taken 264074 times.
792222 for (p = 0; p < 2; p++) {
262 528148 dst = td->dst[1 + p];
263 528148 dst_r = s->s.frames[CUR_FRAME].tf.f->data[1 + p] + uv_off;
264
2/2
✓ Branch 0 taken 570812 times.
✓ Branch 1 taken 528148 times.
1098960 for (n = 0, y = 0; y < end_y; y += uvstep1d) {
265 570812 uint8_t *ptr = dst, *ptr_r = dst_r;
266
2/2
✓ Branch 0 taken 652520 times.
✓ Branch 1 taken 570812 times.
1223332 for (x = 0; x < end_x; x += uvstep1d, ptr += 4 * uvstep1d * bytesperpixel,
267 652520 ptr_r += 4 * uvstep1d * bytesperpixel, n += step) {
268 652520 int mode = b->uvmode;
269 652520 uint8_t *a = &a_buf[32];
270
4/4
✓ Branch 0 taken 551154 times.
✓ Branch 1 taken 101366 times.
✓ Branch 2 taken 13840 times.
✓ Branch 3 taken 537314 times.
652520 int eob = b->skip ? 0 : b->uvtx > TX_8X8 ? AV_RN16A(&td->uveob[p][n]) : td->uveob[p][n];
271
272 652520 mode = check_intra_mode(td, mode, &a, ptr_r,
273 652520 s->s.frames[CUR_FRAME].tf.f->linesize[1],
274 ptr, td->uv_stride, l, col, x, w4, row, y,
275 652520 b->uvtx, p + 1, s->ss_h, s->ss_v, bytesperpixel);
276 652520 s->dsp.intra_pred[b->uvtx][mode](ptr, td->uv_stride, l, a);
277
2/2
✓ Branch 0 taken 233022 times.
✓ Branch 1 taken 419498 times.
652520 if (eob)
278 233022 s->dsp.itxfm_add[uvtx][DCT_DCT](ptr, td->uv_stride,
279 233022 td->uvblock[p] + 16 * n * bytesperpixel, eob);
280 }
281 570812 dst_r += 4 * uvstep1d * s->s.frames[CUR_FRAME].tf.f->linesize[1];
282 570812 dst += 4 * uvstep1d * td->uv_stride;
283 }
284 }
285 264074 }
286
287 258939 void ff_vp9_intra_recon_8bpp(VP9TileData *td, ptrdiff_t y_off, ptrdiff_t uv_off)
288 {
289 258939 intra_recon(td, y_off, uv_off, 1);
290 258939 }
291
292 5135 void ff_vp9_intra_recon_16bpp(VP9TileData *td, ptrdiff_t y_off, ptrdiff_t uv_off)
293 {
294 5135 intra_recon(td, y_off, uv_off, 2);
295 5135 }
296
297 642439 static av_always_inline void mc_luma_unscaled(VP9TileData *td, vp9_mc_func (*mc)[2],
298 uint8_t *dst, ptrdiff_t dst_stride,
299 const uint8_t *ref, ptrdiff_t ref_stride,
300 ThreadFrame *ref_frame,
301 ptrdiff_t y, ptrdiff_t x, const VP56mv *mv,
302 int bw, int bh, int w, int h, int bytesperpixel)
303 {
304 642439 VP9Context *s = td->s;
305 642439 int mx = mv->x, my = mv->y, th;
306
307 642439 y += my >> 3;
308 642439 x += mx >> 3;
309 642439 ref += y * ref_stride + x * bytesperpixel;
310 642439 mx &= 7;
311 642439 my &= 7;
312 // FIXME bilinear filter only needs 0/1 pixels, not 3/4
313 // we use +7 because the last 7 pixels of each sbrow can be changed in
314 // the longest loopfilter of the next sbrow
315
2/2
✓ Branch 0 taken 439226 times.
✓ Branch 1 taken 203213 times.
642439 th = (y + bh + 4 * !!my + 7) >> 6;
316 642439 ff_thread_await_progress(ref_frame, FFMAX(th, 0), 0);
317 // The arm/aarch64 _hv filters read one more row than what actually is
318 // needed, so switch to emulated edge one pixel sooner vertically
319 // (!!my * 5) than horizontally (!!mx * 4).
320
8/8
✓ Branch 0 taken 467327 times.
✓ Branch 1 taken 175112 times.
✓ Branch 2 taken 637433 times.
✓ Branch 3 taken 5006 times.
✓ Branch 4 taken 436615 times.
✓ Branch 5 taken 200818 times.
✓ Branch 6 taken 620001 times.
✓ Branch 7 taken 17432 times.
642439 if (x < !!mx * 3 || y < !!my * 3 ||
321
8/8
✓ Branch 0 taken 448749 times.
✓ Branch 1 taken 171252 times.
✓ Branch 2 taken 593770 times.
✓ Branch 3 taken 26231 times.
✓ Branch 4 taken 404486 times.
✓ Branch 5 taken 189284 times.
✓ Branch 6 taken 20872 times.
✓ Branch 7 taken 572898 times.
620001 x + !!mx * 4 > w - bw || y + !!my * 5 > h - bh) {
322 417246 s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
323
4/4
✓ Branch 0 taken 48794 times.
✓ Branch 1 taken 20747 times.
✓ Branch 2 taken 50515 times.
✓ Branch 3 taken 19026 times.
69541 ref - !!my * 3 * ref_stride - !!mx * 3 * bytesperpixel,
324 160, ref_stride,
325
2/2
✓ Branch 0 taken 50515 times.
✓ Branch 1 taken 19026 times.
69541 bw + !!mx * 7, bh + !!my * 7,
326
6/6
✓ Branch 0 taken 48794 times.
✓ Branch 1 taken 20747 times.
✓ Branch 2 taken 50515 times.
✓ Branch 3 taken 19026 times.
✓ Branch 4 taken 48794 times.
✓ Branch 5 taken 20747 times.
69541 x - !!mx * 3, y - !!my * 3, w, h);
327
4/4
✓ Branch 0 taken 48794 times.
✓ Branch 1 taken 20747 times.
✓ Branch 2 taken 50515 times.
✓ Branch 3 taken 19026 times.
69541 ref = td->edge_emu_buffer + !!my * 3 * 160 + !!mx * 3 * bytesperpixel;
328 69541 ref_stride = 160;
329 }
330
2/2
✓ Branch 0 taken 467327 times.
✓ Branch 1 taken 175112 times.
642439 mc[!!mx][!!my](dst, dst_stride, ref, ref_stride, bh, mx << 1, my << 1);
331 642439 }
332
333 561917 static av_always_inline void mc_chroma_unscaled(VP9TileData *td, vp9_mc_func (*mc)[2],
334 uint8_t *dst_u, uint8_t *dst_v,
335 ptrdiff_t dst_stride,
336 const uint8_t *ref_u, ptrdiff_t src_stride_u,
337 const uint8_t *ref_v, ptrdiff_t src_stride_v,
338 ThreadFrame *ref_frame,
339 ptrdiff_t y, ptrdiff_t x, const VP56mv *mv,
340 int bw, int bh, int w, int h, int bytesperpixel)
341 {
342 561917 VP9Context *s = td->s;
343
4/4
✓ Branch 0 taken 20366 times.
✓ Branch 1 taken 541551 times.
✓ Branch 2 taken 16495 times.
✓ Branch 3 taken 545422 times.
561917 int mx = mv->x * (1 << !s->ss_h), my = mv->y * (1 << !s->ss_v), th;
344
345 561917 y += my >> 4;
346 561917 x += mx >> 4;
347 561917 ref_u += y * src_stride_u + x * bytesperpixel;
348 561917 ref_v += y * src_stride_v + x * bytesperpixel;
349 561917 mx &= 15;
350 561917 my &= 15;
351 // FIXME bilinear filter only needs 0/1 pixels, not 3/4
352 // we use +7 because the last 7 pixels of each sbrow can be changed in
353 // the longest loopfilter of the next sbrow
354
2/2
✓ Branch 0 taken 437482 times.
✓ Branch 1 taken 124435 times.
561917 th = (y + bh + 4 * !!my + 7) >> (6 - s->ss_v);
355 561917 ff_thread_await_progress(ref_frame, FFMAX(th, 0), 0);
356 // The arm/aarch64 _hv filters read one more row than what actually is
357 // needed, so switch to emulated edge one pixel sooner vertically
358 // (!!my * 5) than horizontally (!!mx * 4).
359
8/8
✓ Branch 0 taken 464134 times.
✓ Branch 1 taken 97783 times.
✓ Branch 2 taken 549715 times.
✓ Branch 3 taken 12202 times.
✓ Branch 4 taken 428439 times.
✓ Branch 5 taken 121276 times.
✓ Branch 6 taken 532220 times.
✓ Branch 7 taken 17495 times.
561917 if (x < !!mx * 3 || y < !!my * 3 ||
360
8/8
✓ Branch 0 taken 436501 times.
✓ Branch 1 taken 95719 times.
✓ Branch 2 taken 501373 times.
✓ Branch 3 taken 30847 times.
✓ Branch 4 taken 389197 times.
✓ Branch 5 taken 112176 times.
✓ Branch 6 taken 25025 times.
✓ Branch 7 taken 476348 times.
532220 x + !!mx * 4 > w - bw || y + !!my * 5 > h - bh) {
361 513414 s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
362
4/4
✓ Branch 0 taken 68164 times.
✓ Branch 1 taken 17405 times.
✓ Branch 2 taken 71537 times.
✓ Branch 3 taken 14032 times.
85569 ref_u - !!my * 3 * src_stride_u - !!mx * 3 * bytesperpixel,
363 160, src_stride_u,
364
2/2
✓ Branch 0 taken 71537 times.
✓ Branch 1 taken 14032 times.
85569 bw + !!mx * 7, bh + !!my * 7,
365
6/6
✓ Branch 0 taken 68164 times.
✓ Branch 1 taken 17405 times.
✓ Branch 2 taken 71537 times.
✓ Branch 3 taken 14032 times.
✓ Branch 4 taken 68164 times.
✓ Branch 5 taken 17405 times.
85569 x - !!mx * 3, y - !!my * 3, w, h);
366
4/4
✓ Branch 0 taken 68164 times.
✓ Branch 1 taken 17405 times.
✓ Branch 2 taken 71537 times.
✓ Branch 3 taken 14032 times.
85569 ref_u = td->edge_emu_buffer + !!my * 3 * 160 + !!mx * 3 * bytesperpixel;
367
2/2
✓ Branch 0 taken 71537 times.
✓ Branch 1 taken 14032 times.
85569 mc[!!mx][!!my](dst_u, dst_stride, ref_u, 160, bh, mx, my);
368
369 513414 s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
370
4/4
✓ Branch 0 taken 68164 times.
✓ Branch 1 taken 17405 times.
✓ Branch 2 taken 71537 times.
✓ Branch 3 taken 14032 times.
85569 ref_v - !!my * 3 * src_stride_v - !!mx * 3 * bytesperpixel,
371 160, src_stride_v,
372
2/2
✓ Branch 0 taken 71537 times.
✓ Branch 1 taken 14032 times.
85569 bw + !!mx * 7, bh + !!my * 7,
373
6/6
✓ Branch 0 taken 68164 times.
✓ Branch 1 taken 17405 times.
✓ Branch 2 taken 71537 times.
✓ Branch 3 taken 14032 times.
✓ Branch 4 taken 68164 times.
✓ Branch 5 taken 17405 times.
85569 x - !!mx * 3, y - !!my * 3, w, h);
374
4/4
✓ Branch 0 taken 68164 times.
✓ Branch 1 taken 17405 times.
✓ Branch 2 taken 71537 times.
✓ Branch 3 taken 14032 times.
85569 ref_v = td->edge_emu_buffer + !!my * 3 * 160 + !!mx * 3 * bytesperpixel;
375
2/2
✓ Branch 0 taken 71537 times.
✓ Branch 1 taken 14032 times.
85569 mc[!!mx][!!my](dst_v, dst_stride, ref_v, 160, bh, mx, my);
376 } else {
377
2/2
✓ Branch 0 taken 392597 times.
✓ Branch 1 taken 83751 times.
476348 mc[!!mx][!!my](dst_u, dst_stride, ref_u, src_stride_u, bh, mx, my);
378
2/2
✓ Branch 0 taken 392597 times.
✓ Branch 1 taken 83751 times.
476348 mc[!!mx][!!my](dst_v, dst_stride, ref_v, src_stride_v, bh, mx, my);
379 }
380 561917 }
381
382 #define mc_luma_dir(td, mc, dst, dst_ls, src, src_ls, tref, row, col, mv, \
383 px, py, pw, ph, bw, bh, w, h, i) \
384 mc_luma_unscaled(td, s->dsp.mc, dst, dst_ls, src, src_ls, tref, row, col, \
385 mv, bw, bh, w, h, bytesperpixel)
386 #define mc_chroma_dir(td, mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
387 row, col, mv, px, py, pw, ph, bw, bh, w, h, i) \
388 mc_chroma_unscaled(td, s->dsp.mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
389 row, col, mv, bw, bh, w, h, bytesperpixel)
390 #define SCALED 0
391 #define FN(x) x##_8bpp
392 #define BYTES_PER_PIXEL 1
393 #include "vp9_mc_template.c"
394 #undef FN
395 #undef BYTES_PER_PIXEL
396 #define FN(x) x##_16bpp
397 #define BYTES_PER_PIXEL 2
398 #include "vp9_mc_template.c"
399 #undef mc_luma_dir
400 #undef mc_chroma_dir
401 #undef FN
402 #undef BYTES_PER_PIXEL
403 #undef SCALED
404
405 689 static av_always_inline void mc_luma_scaled(VP9TileData *td, vp9_scaled_mc_func smc,
406 vp9_mc_func (*mc)[2],
407 uint8_t *dst, ptrdiff_t dst_stride,
408 const uint8_t *ref, ptrdiff_t ref_stride,
409 ThreadFrame *ref_frame,
410 ptrdiff_t y, ptrdiff_t x, const VP56mv *in_mv,
411 int px, int py, int pw, int ph,
412 int bw, int bh, int w, int h, int bytesperpixel,
413 const uint16_t *scale, const uint8_t *step)
414 {
415 689 VP9Context *s = td->s;
416
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 689 times.
689 if (s->s.frames[CUR_FRAME].tf.f->width == ref_frame->f->width &&
417 s->s.frames[CUR_FRAME].tf.f->height == ref_frame->f->height) {
418 mc_luma_unscaled(td, mc, dst, dst_stride, ref, ref_stride, ref_frame,
419 y, x, in_mv, bw, bh, w, h, bytesperpixel);
420 } else {
421 #define scale_mv(n, dim) (((int64_t)(n) * scale[dim]) >> 14)
422 int mx, my;
423 int refbw_m1, refbh_m1;
424 int th;
425 VP56mv mv;
426
427 689 mv.x = av_clip(in_mv->x, -(x + pw - px + 4) * 8, (s->cols * 8 - x + px + 3) * 8);
428 689 mv.y = av_clip(in_mv->y, -(y + ph - py + 4) * 8, (s->rows * 8 - y + py + 3) * 8);
429 // BUG libvpx seems to scale the two components separately. This introduces
430 // rounding errors but we have to reproduce them to be exactly compatible
431 // with the output from libvpx...
432 689 mx = scale_mv(mv.x * 2, 0) + scale_mv(x * 16, 0);
433 689 my = scale_mv(mv.y * 2, 1) + scale_mv(y * 16, 1);
434
435 689 y = my >> 4;
436 689 x = mx >> 4;
437 689 ref += y * ref_stride + x * bytesperpixel;
438 689 mx &= 15;
439 689 my &= 15;
440 689 refbw_m1 = ((bw - 1) * step[0] + mx) >> 4;
441 689 refbh_m1 = ((bh - 1) * step[1] + my) >> 4;
442 // FIXME bilinear filter only needs 0/1 pixels, not 3/4
443 // we use +7 because the last 7 pixels of each sbrow can be changed in
444 // the longest loopfilter of the next sbrow
445 689 th = (y + refbh_m1 + 4 + 7) >> 6;
446 689 ff_thread_await_progress(ref_frame, FFMAX(th, 0), 0);
447 // The arm/aarch64 _hv filters read one more row than what actually is
448 // needed, so switch to emulated edge one pixel sooner vertically
449 // (y + 5 >= h - refbh_m1) than horizontally (x + 4 >= w - refbw_m1).
450
8/8
✓ Branch 0 taken 649 times.
✓ Branch 1 taken 40 times.
✓ Branch 2 taken 607 times.
✓ Branch 3 taken 42 times.
✓ Branch 4 taken 586 times.
✓ Branch 5 taken 21 times.
✓ Branch 6 taken 31 times.
✓ Branch 7 taken 555 times.
689 if (x < 3 || y < 3 || x + 4 >= w - refbw_m1 || y + 5 >= h - refbh_m1) {
451 134 s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
452 134 ref - 3 * ref_stride - 3 * bytesperpixel,
453 288, ref_stride,
454 refbw_m1 + 8, refbh_m1 + 8,
455 134 x - 3, y - 3, w, h);
456 134 ref = td->edge_emu_buffer + 3 * 288 + 3 * bytesperpixel;
457 134 ref_stride = 288;
458 }
459 689 smc(dst, dst_stride, ref, ref_stride, bh, mx, my, step[0], step[1]);
460 }
461 689 }
462
463 689 static av_always_inline void mc_chroma_scaled(VP9TileData *td, vp9_scaled_mc_func smc,
464 vp9_mc_func (*mc)[2],
465 uint8_t *dst_u, uint8_t *dst_v,
466 ptrdiff_t dst_stride,
467 const uint8_t *ref_u, ptrdiff_t src_stride_u,
468 const uint8_t *ref_v, ptrdiff_t src_stride_v,
469 ThreadFrame *ref_frame,
470 ptrdiff_t y, ptrdiff_t x, const VP56mv *in_mv,
471 int px, int py, int pw, int ph,
472 int bw, int bh, int w, int h, int bytesperpixel,
473 const uint16_t *scale, const uint8_t *step)
474 {
475 689 VP9Context *s = td->s;
476
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 689 times.
689 if (s->s.frames[CUR_FRAME].tf.f->width == ref_frame->f->width &&
477 s->s.frames[CUR_FRAME].tf.f->height == ref_frame->f->height) {
478 mc_chroma_unscaled(td, mc, dst_u, dst_v, dst_stride, ref_u, src_stride_u,
479 ref_v, src_stride_v, ref_frame,
480 y, x, in_mv, bw, bh, w, h, bytesperpixel);
481 } else {
482 int mx, my;
483 int refbw_m1, refbh_m1;
484 int th;
485 VP56mv mv;
486
487
1/2
✓ Branch 0 taken 689 times.
✗ Branch 1 not taken.
689 if (s->ss_h) {
488 // BUG https://code.google.com/p/webm/issues/detail?id=820
489 689 mv.x = av_clip(in_mv->x, -(x + pw - px + 4) * 16, (s->cols * 4 - x + px + 3) * 16);
490 689 mx = scale_mv(mv.x, 0) + (scale_mv(x * 16, 0) & ~15) + (scale_mv(x * 32, 0) & 15);
491 } else {
492 mv.x = av_clip(in_mv->x, -(x + pw - px + 4) * 8, (s->cols * 8 - x + px + 3) * 8);
493 mx = scale_mv(mv.x * 2, 0) + scale_mv(x * 16, 0);
494 }
495
1/2
✓ Branch 0 taken 689 times.
✗ Branch 1 not taken.
689 if (s->ss_v) {
496 // BUG https://code.google.com/p/webm/issues/detail?id=820
497 689 mv.y = av_clip(in_mv->y, -(y + ph - py + 4) * 16, (s->rows * 4 - y + py + 3) * 16);
498 689 my = scale_mv(mv.y, 1) + (scale_mv(y * 16, 1) & ~15) + (scale_mv(y * 32, 1) & 15);
499 } else {
500 mv.y = av_clip(in_mv->y, -(y + ph - py + 4) * 8, (s->rows * 8 - y + py + 3) * 8);
501 my = scale_mv(mv.y * 2, 1) + scale_mv(y * 16, 1);
502 }
503 #undef scale_mv
504 689 y = my >> 4;
505 689 x = mx >> 4;
506 689 ref_u += y * src_stride_u + x * bytesperpixel;
507 689 ref_v += y * src_stride_v + x * bytesperpixel;
508 689 mx &= 15;
509 689 my &= 15;
510 689 refbw_m1 = ((bw - 1) * step[0] + mx) >> 4;
511 689 refbh_m1 = ((bh - 1) * step[1] + my) >> 4;
512 // FIXME bilinear filter only needs 0/1 pixels, not 3/4
513 // we use +7 because the last 7 pixels of each sbrow can be changed in
514 // the longest loopfilter of the next sbrow
515 689 th = (y + refbh_m1 + 4 + 7) >> (6 - s->ss_v);
516 689 ff_thread_await_progress(ref_frame, FFMAX(th, 0), 0);
517 // The arm/aarch64 _hv filters read one more row than what actually is
518 // needed, so switch to emulated edge one pixel sooner vertically
519 // (y + 5 >= h - refbh_m1) than horizontally (x + 4 >= w - refbw_m1).
520
8/8
✓ Branch 0 taken 633 times.
✓ Branch 1 taken 56 times.
✓ Branch 2 taken 583 times.
✓ Branch 3 taken 50 times.
✓ Branch 4 taken 553 times.
✓ Branch 5 taken 30 times.
✓ Branch 6 taken 41 times.
✓ Branch 7 taken 512 times.
689 if (x < 3 || y < 3 || x + 4 >= w - refbw_m1 || y + 5 >= h - refbh_m1) {
521 177 s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
522 177 ref_u - 3 * src_stride_u - 3 * bytesperpixel,
523 288, src_stride_u,
524 refbw_m1 + 8, refbh_m1 + 8,
525 177 x - 3, y - 3, w, h);
526 177 ref_u = td->edge_emu_buffer + 3 * 288 + 3 * bytesperpixel;
527 177 smc(dst_u, dst_stride, ref_u, 288, bh, mx, my, step[0], step[1]);
528
529 177 s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
530 177 ref_v - 3 * src_stride_v - 3 * bytesperpixel,
531 288, src_stride_v,
532 refbw_m1 + 8, refbh_m1 + 8,
533 177 x - 3, y - 3, w, h);
534 177 ref_v = td->edge_emu_buffer + 3 * 288 + 3 * bytesperpixel;
535 177 smc(dst_v, dst_stride, ref_v, 288, bh, mx, my, step[0], step[1]);
536 } else {
537 512 smc(dst_u, dst_stride, ref_u, src_stride_u, bh, mx, my, step[0], step[1]);
538 512 smc(dst_v, dst_stride, ref_v, src_stride_v, bh, mx, my, step[0], step[1]);
539 }
540 }
541 689 }
542
543 #define mc_luma_dir(td, mc, dst, dst_ls, src, src_ls, tref, row, col, mv, \
544 px, py, pw, ph, bw, bh, w, h, i) \
545 mc_luma_scaled(td, s->dsp.s##mc, s->dsp.mc, dst, dst_ls, src, src_ls, tref, row, col, \
546 mv, px, py, pw, ph, bw, bh, w, h, bytesperpixel, \
547 s->mvscale[b->ref[i]], s->mvstep[b->ref[i]])
548 #define mc_chroma_dir(td, mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
549 row, col, mv, px, py, pw, ph, bw, bh, w, h, i) \
550 mc_chroma_scaled(td, s->dsp.s##mc, s->dsp.mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
551 row, col, mv, px, py, pw, ph, bw, bh, w, h, bytesperpixel, \
552 s->mvscale[b->ref[i]], s->mvstep[b->ref[i]])
553 #define SCALED 1
554 #define FN(x) x##_scaled_8bpp
555 #define BYTES_PER_PIXEL 1
556 #include "vp9_mc_template.c"
557 #undef FN
558 #undef BYTES_PER_PIXEL
559 #define FN(x) x##_scaled_16bpp
560 #define BYTES_PER_PIXEL 2
561 #include "vp9_mc_template.c"
562 #undef mc_luma_dir
563 #undef mc_chroma_dir
564 #undef FN
565 #undef BYTES_PER_PIXEL
566 #undef SCALED
567
568 530281 static av_always_inline void inter_recon(VP9TileData *td, int bytesperpixel)
569 {
570 530281 VP9Context *s = td->s;
571 530281 VP9Block *b = td->b;
572 530281 int row = td->row, col = td->col;
573
574
1/2
✓ Branch 0 taken 530281 times.
✗ Branch 1 not taken.
530281 if (s->mvscale[b->ref[0]][0] == REF_INVALID_SCALE ||
575
3/4
✓ Branch 0 taken 27251 times.
✓ Branch 1 taken 503030 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 27251 times.
530281 (b->comp && s->mvscale[b->ref[1]][0] == REF_INVALID_SCALE)) {
576 if (!s->td->error_info) {
577 s->td->error_info = AVERROR_INVALIDDATA;
578 av_log(NULL, AV_LOG_ERROR, "Bitstream not supported, "
579 "reference frame has invalid dimensions\n");
580 }
581 return;
582 }
583
584
5/6
✓ Branch 0 taken 529592 times.
✓ Branch 1 taken 689 times.
✓ Branch 2 taken 27251 times.
✓ Branch 3 taken 502341 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 27251 times.
530281 if (s->mvscale[b->ref[0]][0] || (b->comp && s->mvscale[b->ref[1]][0])) {
585
1/2
✓ Branch 0 taken 689 times.
✗ Branch 1 not taken.
689 if (bytesperpixel == 1) {
586 689 inter_pred_scaled_8bpp(td);
587 } else {
588 inter_pred_scaled_16bpp(td);
589 }
590 } else {
591
2/2
✓ Branch 0 taken 513805 times.
✓ Branch 1 taken 15787 times.
529592 if (bytesperpixel == 1) {
592 513805 inter_pred_8bpp(td);
593 } else {
594 15787 inter_pred_16bpp(td);
595 }
596 }
597
598
2/2
✓ Branch 0 taken 137847 times.
✓ Branch 1 taken 392434 times.
530281 if (!b->skip) {
599 /* mostly copied intra_recon() */
600
601 137847 int w4 = ff_vp9_bwh_tab[1][b->bs][0] << 1, step1d = 1 << b->tx, n;
602 137847 int h4 = ff_vp9_bwh_tab[1][b->bs][1] << 1, x, y, step = 1 << (b->tx * 2);
603 137847 int end_x = FFMIN(2 * (s->cols - col), w4);
604 137847 int end_y = FFMIN(2 * (s->rows - row), h4);
605 137847 int tx = 4 * s->s.h.lossless + b->tx, uvtx = b->uvtx + 4 * s->s.h.lossless;
606 137847 int uvstep1d = 1 << b->uvtx, p;
607 137847 uint8_t *dst = td->dst[0];
608
609 // y itxfm add
610
2/2
✓ Branch 0 taken 227388 times.
✓ Branch 1 taken 137847 times.
365235 for (n = 0, y = 0; y < end_y; y += step1d) {
611 227388 uint8_t *ptr = dst;
612
2/2
✓ Branch 0 taken 422951 times.
✓ Branch 1 taken 227388 times.
650339 for (x = 0; x < end_x; x += step1d,
613 422951 ptr += 4 * step1d * bytesperpixel, n += step) {
614
2/2
✓ Branch 0 taken 17838 times.
✓ Branch 1 taken 405113 times.
422951 int eob = b->tx > TX_8X8 ? AV_RN16A(&td->eob[n]) : td->eob[n];
615
616
2/2
✓ Branch 0 taken 240652 times.
✓ Branch 1 taken 182299 times.
422951 if (eob)
617 240652 s->dsp.itxfm_add[tx][DCT_DCT](ptr, td->y_stride,
618 240652 td->block + 16 * n * bytesperpixel, eob);
619 }
620 227388 dst += 4 * td->y_stride * step1d;
621 }
622
623 // uv itxfm add
624 137847 end_x >>= s->ss_h;
625 137847 end_y >>= s->ss_v;
626 137847 step = 1 << (b->uvtx * 2);
627
2/2
✓ Branch 0 taken 275694 times.
✓ Branch 1 taken 137847 times.
413541 for (p = 0; p < 2; p++) {
628 275694 dst = td->dst[p + 1];
629
2/2
✓ Branch 0 taken 300834 times.
✓ Branch 1 taken 275694 times.
576528 for (n = 0, y = 0; y < end_y; y += uvstep1d) {
630 300834 uint8_t *ptr = dst;
631
2/2
✓ Branch 0 taken 342698 times.
✓ Branch 1 taken 300834 times.
643532 for (x = 0; x < end_x; x += uvstep1d,
632 342698 ptr += 4 * uvstep1d * bytesperpixel, n += step) {
633
2/2
✓ Branch 0 taken 7772 times.
✓ Branch 1 taken 334926 times.
342698 int eob = b->uvtx > TX_8X8 ? AV_RN16A(&td->uveob[p][n]) : td->uveob[p][n];
634
635
2/2
✓ Branch 0 taken 66756 times.
✓ Branch 1 taken 275942 times.
342698 if (eob)
636 66756 s->dsp.itxfm_add[uvtx][DCT_DCT](ptr, td->uv_stride,
637 66756 td->uvblock[p] + 16 * n * bytesperpixel, eob);
638 }
639 300834 dst += 4 * uvstep1d * td->uv_stride;
640 }
641 }
642 }
643 }
644
645 514494 void ff_vp9_inter_recon_8bpp(VP9TileData *td)
646 {
647 514494 inter_recon(td, 1);
648 514494 }
649
650 15787 void ff_vp9_inter_recon_16bpp(VP9TileData *td)
651 {
652 15787 inter_recon(td, 2);
653 15787 }
654