FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hevcpred_template.c
Go to the documentation of this file.
1 /*
2  * HEVC video Decoder
3  *
4  * Copyright (C) 2012 - 2013 Guillaume Martres
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include "libavutil/pixdesc.h"
24 #include "bit_depth_template.c"
25 #include "hevcpred.h"
26 
27 #define POS(x, y) src[(x) + stride * (y)]
28 
29 static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int c_idx)
30 {
31 #define PU(x) \
32  ((x) >> s->sps->log2_min_pu_size)
33 #define MVF(x, y) \
34  (s->ref->tab_mvf[(x) + (y) * min_pu_width])
35 #define MVF_PU(x, y) \
36  MVF(PU(x0 + ((x) << hshift)), PU(y0 + ((y) << vshift)))
37 #define IS_INTRA(x, y) \
38  MVF_PU(x, y).is_intra
39 #define MIN_TB_ADDR_ZS(x, y) \
40  s->pps->min_tb_addr_zs[(y) * s->sps->min_tb_width + (x)]
41 #define EXTEND_LEFT(ptr, start, length) \
42  for (i = (start); i > (start) - (length); i--) \
43  ptr[i - 1] = ptr[i]
44 #define EXTEND_RIGHT(ptr, start, length) \
45  for (i = (start); i < (start) + (length); i++) \
46  ptr[i] = ptr[i - 1]
47 #define EXTEND_UP(ptr, start, length) EXTEND_LEFT(ptr, start, length)
48 #define EXTEND_DOWN(ptr, start, length) EXTEND_RIGHT(ptr, start, length)
49 #define EXTEND_LEFT_CIP(ptr, start, length) \
50  for (i = (start); i > (start) - (length); i--) \
51  if (!IS_INTRA(i - 1, -1)) \
52  ptr[i - 1] = ptr[i]
53 #define EXTEND_RIGHT_CIP(ptr, start, length) \
54  for (i = (start); i < (start) + (length); i++) \
55  if (!IS_INTRA(i, -1)) \
56  ptr[i] = ptr[i - 1]
57 #define EXTEND_UP_CIP(ptr, start, length) \
58  for (i = (start); i > (start) - (length); i--) \
59  if (!IS_INTRA(-1, i - 1)) \
60  ptr[i - 1] = ptr[i]
61 #define EXTEND_UP_CIP_0(ptr, start, length) \
62  for (i = (start); i > (start) - (length); i--) \
63  ptr[i - 1] = ptr[i]
64 #define EXTEND_DOWN_CIP(ptr, start, length) \
65  for (i = (start); i < (start) + (length); i++) \
66  if (!IS_INTRA(-1, i)) \
67  ptr[i] = ptr[i - 1]
68  HEVCLocalContext *lc = s->HEVClc;
69  int i;
70  int hshift = s->sps->hshift[c_idx];
71  int vshift = s->sps->vshift[c_idx];
72  int size = (1 << log2_size);
73  int size_in_luma = size << hshift;
74  int size_in_tbs = size_in_luma >> s->sps->log2_min_tb_size;
75  int x = x0 >> hshift;
76  int y = y0 >> vshift;
77  int x_tb = x0 >> s->sps->log2_min_tb_size;
78  int y_tb = y0 >> s->sps->log2_min_tb_size;
79  int cur_tb_addr = MIN_TB_ADDR_ZS(x_tb, y_tb);
80 
81  ptrdiff_t stride = s->frame->linesize[c_idx] / sizeof(pixel);
82  pixel *src = (pixel*)s->frame->data[c_idx] + x + y * stride;
83 
84  int min_pu_width = s->sps->min_pu_width;
85 
86  enum IntraPredMode mode = c_idx ? lc->pu.intra_pred_mode_c :
88 
89  pixel left_array[2 * MAX_TB_SIZE + 1];
90  pixel filtered_left_array[2 * MAX_TB_SIZE + 1];
91  pixel top_array[2 * MAX_TB_SIZE + 1];
92  pixel filtered_top_array[2 * MAX_TB_SIZE + 1];
93 
94  pixel *left = left_array + 1;
95  pixel *top = top_array + 1;
96  pixel *filtered_left = filtered_left_array + 1;
97  pixel *filtered_top = filtered_top_array + 1;
98 
99  int cand_bottom_left = lc->na.cand_bottom_left && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb - 1, y_tb + size_in_tbs);
100  int cand_left = lc->na.cand_left;
101  int cand_up_left = lc->na.cand_up_left;
102  int cand_up = lc->na.cand_up;
103  int cand_up_right = lc->na.cand_up_right && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb + size_in_tbs, y_tb - 1);
104 
105  int bottom_left_size = (FFMIN(y0 + 2 * size_in_luma, s->sps->height) -
106  (y0 + size_in_luma)) >> vshift;
107  int top_right_size = (FFMIN(x0 + 2 * size_in_luma, s->sps->width) -
108  (x0 + size_in_luma)) >> hshift;
109 
110  if (s->pps->constrained_intra_pred_flag == 1) {
111  int size_in_luma_pu = PU(size_in_luma);
112  int on_pu_edge_x = !(x0 & ((1 << s->sps->log2_min_pu_size) - 1));
113  int on_pu_edge_y = !(y0 & ((1 << s->sps->log2_min_pu_size) - 1));
114  if(!size_in_luma_pu)
115  size_in_luma_pu++;
116  if (cand_bottom_left == 1 && on_pu_edge_x) {
117  int x_left_pu = PU(x0 - 1);
118  int y_bottom_pu = PU(y0 + size_in_luma);
119  int max = FFMIN(size_in_luma_pu, s->sps->min_pu_height - y_bottom_pu);
120  cand_bottom_left = 0;
121  for (i = 0; i < max; i++)
122  cand_bottom_left |= MVF(x_left_pu, y_bottom_pu + i).is_intra;
123  }
124  if (cand_left == 1 && on_pu_edge_x) {
125  int x_left_pu = PU(x0 - 1);
126  int y_left_pu = PU(y0);
127  int max = FFMIN(size_in_luma_pu, s->sps->min_pu_height - y_left_pu);
128  cand_left = 0;
129  for (i = 0; i < max; i++)
130  cand_left |= MVF(x_left_pu, y_left_pu + i).is_intra;
131  }
132  if (cand_up_left == 1) {
133  int x_left_pu = PU(x0 - 1);
134  int y_top_pu = PU(y0 - 1);
135  cand_up_left = MVF(x_left_pu, y_top_pu).is_intra;
136  }
137  if (cand_up == 1 && on_pu_edge_y) {
138  int x_top_pu = PU(x0);
139  int y_top_pu = PU(y0 - 1);
140  int max = FFMIN(size_in_luma_pu, s->sps->min_pu_width - x_top_pu);
141  cand_up = 0;
142  for (i = 0; i < max; i++)
143  cand_up |= MVF(x_top_pu + i, y_top_pu).is_intra;
144  }
145  if (cand_up_right == 1 && on_pu_edge_y) {
146  int y_top_pu = PU(y0 - 1);
147  int x_right_pu = PU(x0 + size_in_luma);
148  int max = FFMIN(size_in_luma_pu, s->sps->min_pu_width - x_right_pu);
149  cand_up_right = 0;
150  for (i = 0; i < max; i++)
151  cand_up_right |= MVF(x_right_pu + i, y_top_pu).is_intra;
152  }
153  for (i = 0; i < 2 * MAX_TB_SIZE; i++) {
154  left[i] = 128;
155  top[i] = 128;
156  }
157  }
158  if (cand_bottom_left) {
159  for (i = size + bottom_left_size; i < (size << 1); i++)
160  if (IS_INTRA(-1, size + bottom_left_size - 1) || !s->pps->constrained_intra_pred_flag)
161  left[i] = POS(-1, size + bottom_left_size - 1);
162  for (i = size + bottom_left_size - 1; i >= size; i--)
163  if (IS_INTRA(-1, i) || !s->pps->constrained_intra_pred_flag)
164  left[i] = POS(-1, i);
165  }
166  if (cand_left)
167  for (i = size - 1; i >= 0; i--)
168  if (IS_INTRA(-1, i) || !s->pps->constrained_intra_pred_flag)
169  left[i] = POS(-1, i);
170  if (cand_up_left)
171  if (IS_INTRA(-1, -1) || !s->pps->constrained_intra_pred_flag) {
172  left[-1] = POS(-1, -1);
173  top[-1] = left[-1];
174  }
175  if (cand_up)
176  for (i = size - 1; i >= 0; i--)
177  if (IS_INTRA(i, -1) || !s->pps->constrained_intra_pred_flag)
178  top[i] = POS(i, -1);
179  if (cand_up_right) {
180  for (i = size + top_right_size; i < (size << 1); i++)
181  if (IS_INTRA(size + top_right_size - 1, -1) || !s->pps->constrained_intra_pred_flag)
182  top[i] = POS(size + top_right_size - 1, -1);
183  for (i = size + top_right_size - 1; i >= size; i--)
184  if (IS_INTRA(i, -1) || !s->pps->constrained_intra_pred_flag)
185  top[i] = POS(i, -1);
186  }
187 
188  if (s->pps->constrained_intra_pred_flag == 1) {
189  if (cand_bottom_left || cand_left || cand_up_left || cand_up || cand_up_right) {
190  int size_max_x = x0 + ((2 * size) << hshift) < s->sps->width ?
191  2 * size : (s->sps->width - x0) >> hshift;
192  int size_max_y = y0 + ((2 * size) << vshift) < s->sps->height ?
193  2 * size : (s->sps->height - y0) >> vshift;
194  int j = size + (cand_bottom_left? bottom_left_size: 0) -1;
195  if (!cand_up_right) {
196  size_max_x = x0 + ((size) << hshift) < s->sps->width ?
197  size : (s->sps->width - x0) >> hshift;
198  }
199  if (!cand_bottom_left) {
200  size_max_y = y0 + (( size) << vshift) < s->sps->height ?
201  size : (s->sps->height - y0) >> vshift;
202  }
203  if (cand_bottom_left || cand_left || cand_up_left) {
204  while (j>-1 && !IS_INTRA(-1, j)) j--;
205  if (!IS_INTRA(-1, j)) {
206  j = 0;
207  while(j < size_max_x && !IS_INTRA(j, -1)) j++;
208  EXTEND_LEFT_CIP(top, j, j+1);
209  left[-1] = top[-1];
210  j = 0;
211  }
212  } else {
213  j = 0;
214  while (j < size_max_x && !IS_INTRA(j, -1)) j++;
215  if (j > 0)
216  if (x0 > 0) {
217  EXTEND_LEFT_CIP(top, j, j+1);
218  } else {
219  EXTEND_LEFT_CIP(top, j, j);
220  top[-1] = top[0];
221  }
222  left[-1] = top[-1];
223  j = 0;
224  }
225  if (cand_bottom_left || cand_left) {
226  EXTEND_DOWN_CIP(left, j, size_max_y-j);
227  }
228  if (!cand_left) {
229  EXTEND_DOWN(left, 0, size);
230  }
231  if (!cand_bottom_left) {
232  EXTEND_DOWN(left, size, size);
233  }
234  if (x0 != 0 && y0 != 0) {
235  EXTEND_UP_CIP(left, size_max_y - 1, size_max_y);
236  } else if( x0 == 0) {
237  EXTEND_UP_CIP_0(left, size_max_y - 1, size_max_y);
238  } else{
239  EXTEND_UP_CIP(left, size_max_y - 1, size_max_y-1);
240  }
241  top[-1] = left[-1];
242  if (y0 != 0) {
243  EXTEND_RIGHT_CIP(top, 0, size_max_x);
244  }
245  }
246  }
247  // Infer the unavailable samples
248  if (!cand_bottom_left) {
249  if (cand_left) {
250  EXTEND_DOWN(left, size, size);
251  } else if (cand_up_left) {
252  EXTEND_DOWN(left, 0, 2 * size);
253  cand_left = 1;
254  } else if (cand_up) {
255  left[-1] = top[0];
256  EXTEND_DOWN(left, 0, 2 * size);
257  cand_up_left = 1;
258  cand_left = 1;
259  } else if (cand_up_right) {
260  EXTEND_LEFT(top, size, size);
261  left[-1] = top[0];
262  EXTEND_DOWN(left ,0 , 2 * size);
263  cand_up = 1;
264  cand_up_left = 1;
265  cand_left = 1;
266  } else { // No samples available
267  top[0] = left[-1] = (1 << (BIT_DEPTH - 1));
268  EXTEND_RIGHT(top, 1, 2 * size - 1);
269  EXTEND_DOWN(left, 0, 2 * size);
270  }
271  }
272 
273  if (!cand_left) {
274  EXTEND_UP(left, size, size);
275  }
276  if (!cand_up_left) {
277  left[-1] = left[0];
278  }
279  if (!cand_up) {
280  top[0] = left[-1];
281  EXTEND_RIGHT(top, 1, size-1);
282  }
283  if (!cand_up_right) {
284  EXTEND_RIGHT(top, size, size);
285  }
286 
287  top[-1] = left[-1];
288 
289 #undef EXTEND_LEFT_CIP
290 #undef EXTEND_RIGHT_CIP
291 #undef EXTEND_UP_CIP
292 #undef EXTEND_DOWN_CIP
293 #undef IS_INTRA
294 #undef MVF_PU
295 #undef MVF
296 #undef PU
297 #undef EXTEND_LEFT
298 #undef EXTEND_RIGHT
299 #undef EXTEND_UP
300 #undef EXTEND_DOWN
301 #undef MIN_TB_ADDR_ZS
302 
303  // Filtering process
304  if (c_idx == 0 && mode != INTRA_DC && size != 4) {
305  int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
306  int min_dist_vert_hor = FFMIN(FFABS((int)(mode - 26U)),
307  FFABS((int)(mode - 10U)));
308  if (min_dist_vert_hor > intra_hor_ver_dist_thresh[log2_size - 3]) {
309  int threshold = 1 << (BIT_DEPTH - 5);
310  if (s->sps->sps_strong_intra_smoothing_enable_flag &&
311  log2_size == 5 &&
312  FFABS(top[-1] + top[63] - 2 * top[31]) < threshold &&
313  FFABS(left[-1] + left[63] - 2 * left[31]) < threshold) {
314  // We can't just overwrite values in top because it could be
315  // a pointer into src
316  filtered_top[-1] = top[-1];
317  filtered_top[63] = top[63];
318  for (i = 0; i < 63; i++)
319  filtered_top[i] = ((64 - (i + 1)) * top[-1] +
320  (i + 1) * top[63] + 32) >> 6;
321  for (i = 0; i < 63; i++)
322  left[i] = ((64 - (i + 1)) * left[-1] +
323  (i + 1) * left[63] + 32) >> 6;
324  top = filtered_top;
325  } else {
326  filtered_left[2 * size - 1] = left[2 * size - 1];
327  filtered_top[2 * size - 1] = top[2 * size - 1];
328  for (i = 2 * size - 2; i >= 0; i--)
329  filtered_left[i] = (left[i + 1] + 2 * left[i] +
330  left[i - 1] + 2) >> 2;
331  filtered_top[-1] =
332  filtered_left[-1] = (left[0] + 2 * left[-1] +
333  top[0] + 2) >> 2;
334  for (i = 2 * size - 2; i >= 0; i--)
335  filtered_top[i] = (top[i + 1] + 2 * top[i] +
336  top[i - 1] + 2) >> 2;
337  left = filtered_left;
338  top = filtered_top;
339  }
340  }
341  }
342 
343  switch (mode) {
344  case INTRA_PLANAR:
345  s->hpc.pred_planar[log2_size - 2]((uint8_t*)src, (uint8_t*)top,
346  (uint8_t*)left, stride);
347  break;
348  case INTRA_DC:
349  s->hpc.pred_dc((uint8_t*)src, (uint8_t*)top,
350  (uint8_t*)left, stride, log2_size, c_idx);
351  break;
352  default:
353  s->hpc.pred_angular[log2_size - 2]((uint8_t*)src, (uint8_t*)top,
354  (uint8_t*)left, stride, c_idx, mode);
355  break;
356  }
357 }
358 
359 static void FUNC(pred_planar_0)(uint8_t *_src, const uint8_t *_top,
360  const uint8_t *_left,
361  ptrdiff_t stride)
362 {
363  int x, y;
364  pixel *src = (pixel*)_src;
365  const pixel *top = (const pixel*)_top;
366  const pixel *left = (const pixel*)_left;
367  for (y = 0; y < 4; y++)
368  for (x = 0; x < 4; x++)
369  POS(x, y) = ((3 - x) * left[y] + (x + 1) * top[4] +
370  (3 - y) * top[x] + (y + 1) * left[4] + 4) >> 3;
371 }
372 
373 static void FUNC(pred_planar_1)(uint8_t *_src, const uint8_t *_top,
374  const uint8_t *_left, ptrdiff_t stride)
375 {
376  int x, y;
377  pixel *src = (pixel*)_src;
378  const pixel *top = (const pixel*)_top;
379  const pixel *left = (const pixel*)_left;
380  for (y = 0; y < 8; y++)
381  for (x = 0; x < 8; x++)
382  POS(x, y) = ((7 - x) * left[y] + (x + 1) * top[8] +
383  (7 - y) * top[x] + (y + 1) * left[8] + 8) >> 4;
384 }
385 
386 static void FUNC(pred_planar_2)(uint8_t *_src, const uint8_t *_top,
387  const uint8_t *_left, ptrdiff_t stride)
388 {
389  int x, y;
390  pixel *src = (pixel*)_src;
391  const pixel *top = (const pixel*)_top;
392  const pixel *left = (const pixel*)_left;
393  for (y = 0; y < 16; y++)
394  for (x = 0; x < 16; x++)
395  POS(x, y) = ((15 - x) * left[y] + (x + 1) * top[16] +
396  (15 - y) * top[x] + (y + 1) * left[16] + 16) >> 5;
397 }
398 
399 static void FUNC(pred_planar_3)(uint8_t *_src, const uint8_t *_top,
400  const uint8_t *_left, ptrdiff_t stride)
401 {
402  int x, y;
403  pixel *src = (pixel*)_src;
404  const pixel *top = (const pixel*)_top;
405  const pixel *left = (const pixel*)_left;
406  for (y = 0; y < 32; y++)
407  for (x = 0; x < 32; x++)
408  POS(x, y) = ((31 - x) * left[y] + (x + 1) * top[32] +
409  (31 - y) * top[x] + (y + 1) * left[32] + 32) >> 6;
410 }
411 
412 static void FUNC(pred_dc)(uint8_t *_src, const uint8_t *_top,
413  const uint8_t *_left,
414  ptrdiff_t stride, int log2_size, int c_idx)
415 {
416  int i, j, x, y;
417  int size = (1 << log2_size);
418  pixel *src = (pixel*)_src;
419  const pixel *top = (const pixel*)_top;
420  const pixel *left = (const pixel*)_left;
421  int dc = size;
422  pixel4 a;
423  for (i = 0; i < size; i++)
424  dc += left[i] + top[i];
425 
426  dc >>= log2_size + 1;
427 
428  a = PIXEL_SPLAT_X4(dc);
429 
430  for (i = 0; i < size; i++)
431  for (j = 0; j < size / 4; j++)
432  AV_WN4PA(&POS(j * 4, i), a);
433 
434  if (c_idx == 0 && size < 32) {
435  POS(0, 0) = (left[0] + 2 * dc + top[0] + 2) >> 2;
436  for (x = 1; x < size; x++)
437  POS(x, 0) = (top[x] + 3 * dc + 2) >> 2;
438  for (y = 1; y < size; y++)
439  POS(0, y) = (left[y] + 3 * dc + 2) >> 2;
440  }
441 }
442 
444  const uint8_t *_top,
445  const uint8_t *_left,
446  ptrdiff_t stride, int c_idx,
447  int mode, int size)
448 {
449  int x, y;
450  pixel *src = (pixel*)_src;
451  const pixel *top = (const pixel*)_top;
452  const pixel *left = (const pixel*)_left;
453 
454  static const int intra_pred_angle[] = {
455  32, 26, 21, 17, 13, 9, 5, 2, 0, -2, -5, -9, -13, -17, -21, -26, -32,
456  -26, -21, -17, -13, -9, -5, -2, 0, 2, 5, 9, 13, 17, 21, 26, 32
457  };
458  static const int inv_angle[] = {
459  -4096, -1638, -910, -630, -482, -390, -315, -256, -315, -390, -482,
460  -630, -910, -1638, -4096
461  };
462 
463  int angle = intra_pred_angle[mode - 2];
464  pixel ref_array[3 * MAX_TB_SIZE + 1];
465  pixel *ref_tmp = ref_array + size;
466  const pixel *ref;
467  int last = (size * angle) >> 5;
468 
469  if (mode >= 18) {
470  ref = top - 1;
471  if (angle < 0 && last < -1) {
472  for (x = 0; x <= size; x++)
473  ref_tmp[x] = top[x - 1];
474  for (x = last; x <= -1; x++)
475  ref_tmp[x] = left[-1 + ((x * inv_angle[mode-11] + 128) >> 8)];
476  ref = ref_tmp;
477  }
478 
479  for (y = 0; y < size; y++) {
480  int idx = ((y + 1) * angle) >> 5;
481  int fact = ((y + 1) * angle) & 31;
482  if (fact) {
483  for (x = 0; x < size; x++) {
484  POS(x, y) = ((32 - fact) * ref[x + idx + 1] +
485  fact * ref[x + idx + 2] + 16) >> 5;
486  }
487  } else {
488  for (x = 0; x < size; x++) {
489  POS(x, y) = ref[x + idx + 1];
490  }
491  }
492  }
493  if (mode == 26 && c_idx == 0 && size < 32) {
494  for (y = 0; y < size; y++)
495  POS(0, y) = av_clip_pixel(top[0] + ((left[y] - left[-1]) >> 1));
496  }
497  } else {
498  ref = left - 1;
499  if (angle < 0 && last < -1) {
500  for (x = 0; x <= size; x++)
501  ref_tmp[x] = left[x - 1];
502  for (x = last; x <= -1; x++)
503  ref_tmp[x] = top[-1 + ((x * inv_angle[mode-11] + 128) >> 8)];
504  ref = ref_tmp;
505  }
506 
507  for (x = 0; x < size; x++) {
508  int idx = ((x + 1) * angle) >> 5;
509  int fact = ((x + 1) * angle) & 31;
510  if (fact) {
511  for (y = 0; y < size; y++) {
512  POS(x, y) = ((32 - fact) * ref[y + idx + 1] +
513  fact * ref[y + idx + 2] + 16) >> 5;
514  }
515  } else {
516  for (y = 0; y < size; y++) {
517  POS(x, y) = ref[y + idx + 1];
518  }
519  }
520  }
521  if (mode == 10 && c_idx == 0 && size < 32) {
522  for (x = 0; x < size; x++)
523  POS(x, 0) = av_clip_pixel(left[0] + ((top[x] - top[-1]) >> 1));
524  }
525  }
526 }
527 
528 static void FUNC(pred_angular_0)(uint8_t *src, const uint8_t *top,
529  const uint8_t *left,
530  ptrdiff_t stride, int c_idx, int mode)
531 {
532  FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 2);
533 }
534 
535 static void FUNC(pred_angular_1)(uint8_t *src, const uint8_t *top,
536  const uint8_t *left,
537  ptrdiff_t stride, int c_idx, int mode)
538 {
539  FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 3);
540 }
541 
542 static void FUNC(pred_angular_2)(uint8_t *src, const uint8_t *top,
543  const uint8_t *left,
544  ptrdiff_t stride, int c_idx, int mode)
545 {
546  FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 4);
547 }
548 
549 static void FUNC(pred_angular_3)(uint8_t *src, const uint8_t *top,
550  const uint8_t *left,
551  ptrdiff_t stride, int c_idx, int mode)
552 {
553  FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 5);
554 }
555 #undef POS