You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

556 lines
22KB

  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. #include "libavutil/pixdesc.h"
  23. #include "bit_depth_template.c"
  24. #include "hevcpred.h"
  25. #define POS(x, y) src[(x) + stride * (y)]
  26. static av_always_inline void FUNC(intra_pred)(HEVCContext *s, int x0, int y0,
  27. int log2_size, int c_idx)
  28. {
  29. #define PU(x) \
  30. ((x) >> s->sps->log2_min_pu_size)
  31. #define MVF(x, y) \
  32. (s->ref->tab_mvf[(x) + (y) * min_pu_width])
  33. #define MVF_PU(x, y) \
  34. MVF(PU(x0 + ((x) << hshift)), PU(y0 + ((y) << vshift)))
  35. #define IS_INTRA(x, y) \
  36. (MVF_PU(x, y).pred_flag == PF_INTRA)
  37. #define MIN_TB_ADDR_ZS(x, y) \
  38. s->pps->min_tb_addr_zs[(y) * s->sps->min_tb_width + (x)]
  39. #define EXTEND(ptr, val, len) \
  40. do { \
  41. pixel4 pix = PIXEL_SPLAT_X4(val); \
  42. for (i = 0; i < (len); i += 4) \
  43. AV_WN4P(ptr + i, pix); \
  44. } while (0)
  45. #define EXTEND_RIGHT_CIP(ptr, start, length) \
  46. for (i = start; i < (start) + (length); i += 4) \
  47. if (!IS_INTRA(i, -1)) \
  48. AV_WN4P(&ptr[i], a); \
  49. else \
  50. a = PIXEL_SPLAT_X4(ptr[i+3])
  51. #define EXTEND_LEFT_CIP(ptr, start, length) \
  52. for (i = start; i > (start) - (length); i--) \
  53. if (!IS_INTRA(i - 1, -1)) \
  54. ptr[i - 1] = ptr[i]
  55. #define EXTEND_UP_CIP(ptr, start, length) \
  56. for (i = (start); i > (start) - (length); i -= 4) \
  57. if (!IS_INTRA(-1, i - 3)) \
  58. AV_WN4P(&ptr[i - 3], a); \
  59. else \
  60. a = PIXEL_SPLAT_X4(ptr[i - 3])
  61. #define EXTEND_DOWN_CIP(ptr, start, length) \
  62. for (i = start; i < (start) + (length); i += 4) \
  63. if (!IS_INTRA(-1, i)) \
  64. AV_WN4P(&ptr[i], a); \
  65. else \
  66. a = PIXEL_SPLAT_X4(ptr[i + 3])
  67. HEVCLocalContext *lc = s->HEVClc;
  68. int i;
  69. int hshift = s->sps->hshift[c_idx];
  70. int vshift = s->sps->vshift[c_idx];
  71. int size = (1 << log2_size);
  72. int size_in_luma_h = size << hshift;
  73. int size_in_tbs_h = size_in_luma_h >> s->sps->log2_min_tb_size;
  74. int size_in_luma_v = size << vshift;
  75. int size_in_tbs_v = size_in_luma_v >> s->sps->log2_min_tb_size;
  76. int x = x0 >> hshift;
  77. int y = y0 >> vshift;
  78. int x_tb = x0 >> s->sps->log2_min_tb_size;
  79. int y_tb = y0 >> s->sps->log2_min_tb_size;
  80. int cur_tb_addr = MIN_TB_ADDR_ZS(x_tb, y_tb);
  81. ptrdiff_t stride = s->frame->linesize[c_idx] / sizeof(pixel);
  82. pixel *src = (pixel*)s->frame->data[c_idx] + x + y * stride;
  83. int min_pu_width = s->sps->min_pu_width;
  84. enum IntraPredMode mode = c_idx ? lc->pu.intra_pred_mode_c :
  85. lc->tu.cur_intra_pred_mode;
  86. pixel4 a;
  87. pixel left_array[2 * MAX_TB_SIZE + 1];
  88. pixel filtered_left_array[2 * MAX_TB_SIZE + 1];
  89. pixel top_array[2 * MAX_TB_SIZE + 1];
  90. pixel filtered_top_array[2 * MAX_TB_SIZE + 1];
  91. pixel *left = left_array + 1;
  92. pixel *top = top_array + 1;
  93. pixel *filtered_left = filtered_left_array + 1;
  94. pixel *filtered_top = filtered_top_array + 1;
  95. int cand_bottom_left = lc->na.cand_bottom_left && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb - 1, y_tb + size_in_tbs_v);
  96. int cand_left = lc->na.cand_left;
  97. int cand_up_left = lc->na.cand_up_left;
  98. int cand_up = lc->na.cand_up;
  99. int cand_up_right = lc->na.cand_up_right && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb + size_in_tbs_h, y_tb - 1);
  100. int bottom_left_size = (FFMIN(y0 + 2 * size_in_luma_v, s->sps->height) -
  101. (y0 + size_in_luma_v)) >> vshift;
  102. int top_right_size = (FFMIN(x0 + 2 * size_in_luma_h, s->sps->width) -
  103. (x0 + size_in_luma_h)) >> hshift;
  104. if (s->pps->constrained_intra_pred_flag == 1) {
  105. int size_in_luma_pu_v = PU(size_in_luma_v);
  106. int size_in_luma_pu_h = PU(size_in_luma_h);
  107. int on_pu_edge_x = !(x0 & ((1 << s->sps->log2_min_pu_size) - 1));
  108. int on_pu_edge_y = !(y0 & ((1 << s->sps->log2_min_pu_size) - 1));
  109. if (!size_in_luma_pu_h)
  110. size_in_luma_pu_h++;
  111. if (cand_bottom_left == 1 && on_pu_edge_x) {
  112. int x_left_pu = PU(x0 - 1);
  113. int y_bottom_pu = PU(y0 + size_in_luma_v);
  114. int max = FFMIN(size_in_luma_pu_v, s->sps->min_pu_height - y_bottom_pu);
  115. cand_bottom_left = 0;
  116. for (i = 0; i < max; i += 2)
  117. cand_bottom_left |= (MVF(x_left_pu, y_bottom_pu + i).pred_flag == PF_INTRA);
  118. }
  119. if (cand_left == 1 && on_pu_edge_x) {
  120. int x_left_pu = PU(x0 - 1);
  121. int y_left_pu = PU(y0);
  122. int max = FFMIN(size_in_luma_pu_v, s->sps->min_pu_height - y_left_pu);
  123. cand_left = 0;
  124. for (i = 0; i < max; i += 2)
  125. cand_left |= (MVF(x_left_pu, y_left_pu + i).pred_flag == PF_INTRA);
  126. }
  127. if (cand_up_left == 1) {
  128. int x_left_pu = PU(x0 - 1);
  129. int y_top_pu = PU(y0 - 1);
  130. cand_up_left = MVF(x_left_pu, y_top_pu).pred_flag == PF_INTRA;
  131. }
  132. if (cand_up == 1 && on_pu_edge_y) {
  133. int x_top_pu = PU(x0);
  134. int y_top_pu = PU(y0 - 1);
  135. int max = FFMIN(size_in_luma_pu_h, s->sps->min_pu_width - x_top_pu);
  136. cand_up = 0;
  137. for (i = 0; i < max; i += 2)
  138. cand_up |= (MVF(x_top_pu + i, y_top_pu).pred_flag == PF_INTRA);
  139. }
  140. if (cand_up_right == 1 && on_pu_edge_y) {
  141. int y_top_pu = PU(y0 - 1);
  142. int x_right_pu = PU(x0 + size_in_luma_h);
  143. int max = FFMIN(size_in_luma_pu_h, s->sps->min_pu_width - x_right_pu);
  144. cand_up_right = 0;
  145. for (i = 0; i < max; i += 2)
  146. cand_up_right |= (MVF(x_right_pu + i, y_top_pu).pred_flag == PF_INTRA);
  147. }
  148. memset(left, 128, 2 * MAX_TB_SIZE*sizeof(pixel));
  149. memset(top , 128, 2 * MAX_TB_SIZE*sizeof(pixel));
  150. top[-1] = 128;
  151. }
  152. if (cand_up_left) {
  153. left[-1] = POS(-1, -1);
  154. top[-1] = left[-1];
  155. }
  156. if (cand_up)
  157. memcpy(top, src - stride, size * sizeof(pixel));
  158. if (cand_up_right) {
  159. memcpy(top + size, src - stride + size, size * sizeof(pixel));
  160. EXTEND(top + size + top_right_size, POS(size + top_right_size - 1, -1),
  161. size - top_right_size);
  162. }
  163. if (cand_left)
  164. for (i = 0; i < size; i++)
  165. left[i] = POS(-1, i);
  166. if (cand_bottom_left) {
  167. for (i = size; i < size + bottom_left_size; i++)
  168. left[i] = POS(-1, i);
  169. EXTEND(left + size + bottom_left_size, POS(-1, size + bottom_left_size - 1),
  170. size - bottom_left_size);
  171. }
  172. if (s->pps->constrained_intra_pred_flag == 1) {
  173. if (cand_bottom_left || cand_left || cand_up_left || cand_up || cand_up_right) {
  174. int size_max_x = x0 + ((2 * size) << hshift) < s->sps->width ?
  175. 2 * size : (s->sps->width - x0) >> hshift;
  176. int size_max_y = y0 + ((2 * size) << vshift) < s->sps->height ?
  177. 2 * size : (s->sps->height - y0) >> vshift;
  178. int j = size + (cand_bottom_left? bottom_left_size: 0) -1;
  179. if (!cand_up_right) {
  180. size_max_x = x0 + ((size) << hshift) < s->sps->width ?
  181. size : (s->sps->width - x0) >> hshift;
  182. }
  183. if (!cand_bottom_left) {
  184. size_max_y = y0 + (( size) << vshift) < s->sps->height ?
  185. size : (s->sps->height - y0) >> vshift;
  186. }
  187. if (cand_bottom_left || cand_left || cand_up_left) {
  188. while (j > -1 && !IS_INTRA(-1, j))
  189. j--;
  190. if (!IS_INTRA(-1, j)) {
  191. j = 0;
  192. while (j < size_max_x && !IS_INTRA(j, -1))
  193. j++;
  194. EXTEND_LEFT_CIP(top, j, j + 1);
  195. left[-1] = top[-1];
  196. j = 0;
  197. }
  198. } else {
  199. j = 0;
  200. while (j < size_max_x && !IS_INTRA(j, -1))
  201. j++;
  202. if (j > 0)
  203. if (x0 > 0) {
  204. EXTEND_LEFT_CIP(top, j, j + 1);
  205. } else {
  206. EXTEND_LEFT_CIP(top, j, j);
  207. top[-1] = top[0];
  208. }
  209. left[-1] = top[-1];
  210. j = 0;
  211. }
  212. left[-1] = top[-1];
  213. if (cand_bottom_left || cand_left) {
  214. a = PIXEL_SPLAT_X4(left[-1]);
  215. EXTEND_DOWN_CIP(left, 0, size_max_y);
  216. }
  217. if (!cand_left)
  218. EXTEND(left, left[-1], size);
  219. if (!cand_bottom_left)
  220. EXTEND(left + size, left[size - 1], size);
  221. if (x0 != 0 && y0 != 0) {
  222. a = PIXEL_SPLAT_X4(left[size_max_y - 1]);
  223. EXTEND_UP_CIP(left, size_max_y - 1, size_max_y);
  224. if (!IS_INTRA(-1, - 1))
  225. left[-1] = left[0];
  226. } else if (x0 == 0) {
  227. a = PIXEL_SPLAT_X4(left[size_max_y - 1]);
  228. EXTEND(left, 0, size_max_y);
  229. } else {
  230. a = PIXEL_SPLAT_X4(left[size_max_y - 1]);
  231. EXTEND_UP_CIP(left, size_max_y - 1, size_max_y);
  232. }
  233. top[-1] = left[-1];
  234. if (y0 != 0) {
  235. a = PIXEL_SPLAT_X4(left[-1]);
  236. EXTEND_RIGHT_CIP(top, 0, size_max_x);
  237. }
  238. }
  239. }
  240. // Infer the unavailable samples
  241. if (!cand_bottom_left) {
  242. if (cand_left) {
  243. EXTEND(left + size, left[size - 1], size);
  244. } else if (cand_up_left) {
  245. EXTEND(left, left[-1], 2 * size);
  246. cand_left = 1;
  247. } else if (cand_up) {
  248. left[-1] = top[0];
  249. EXTEND(left, left[-1], 2 * size);
  250. cand_up_left = 1;
  251. cand_left = 1;
  252. } else if (cand_up_right) {
  253. EXTEND(top, top[size], size);
  254. left[-1] = top[size];
  255. EXTEND(left, left[-1], 2 * size);
  256. cand_up = 1;
  257. cand_up_left = 1;
  258. cand_left = 1;
  259. } else { // No samples available
  260. left[-1] = (1 << (BIT_DEPTH - 1));
  261. EXTEND(top, left[-1], 2 * size);
  262. EXTEND(left, left[-1], 2 * size);
  263. }
  264. }
  265. if (!cand_left)
  266. EXTEND(left, left[size], size);
  267. if (!cand_up_left) {
  268. left[-1] = left[0];
  269. }
  270. if (!cand_up)
  271. EXTEND(top, left[-1], size);
  272. if (!cand_up_right)
  273. EXTEND(top + size, top[size - 1], size);
  274. top[-1] = left[-1];
  275. // Filtering process
  276. if (c_idx == 0) {
  277. if (mode != INTRA_DC && size != 4){
  278. int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
  279. int min_dist_vert_hor = FFMIN(FFABS((int)(mode - 26U)),
  280. FFABS((int)(mode - 10U)));
  281. if (min_dist_vert_hor > intra_hor_ver_dist_thresh[log2_size - 3]) {
  282. int threshold = 1 << (BIT_DEPTH - 5);
  283. if (s->sps->sps_strong_intra_smoothing_enable_flag && c_idx == 0 &&
  284. log2_size == 5 &&
  285. FFABS(top[-1] + top[63] - 2 * top[31]) < threshold &&
  286. FFABS(left[-1] + left[63] - 2 * left[31]) < threshold) {
  287. // We can't just overwrite values in top because it could be
  288. // a pointer into src
  289. filtered_top[-1] = top[-1];
  290. filtered_top[63] = top[63];
  291. for (i = 0; i < 63; i++)
  292. filtered_top[i] = ((64 - (i + 1)) * top[-1] +
  293. (i + 1) * top[63] + 32) >> 6;
  294. for (i = 0; i < 63; i++)
  295. left[i] = ((64 - (i + 1)) * left[-1] +
  296. (i + 1) * left[63] + 32) >> 6;
  297. top = filtered_top;
  298. } else {
  299. filtered_left[2 * size - 1] = left[2 * size - 1];
  300. filtered_top[2 * size - 1] = top[2 * size - 1];
  301. for (i = 2 * size - 2; i >= 0; i--)
  302. filtered_left[i] = (left[i + 1] + 2 * left[i] +
  303. left[i - 1] + 2) >> 2;
  304. filtered_top[-1] =
  305. filtered_left[-1] = (left[0] + 2 * left[-1] + top[0] + 2) >> 2;
  306. for (i = 2 * size - 2; i >= 0; i--)
  307. filtered_top[i] = (top[i + 1] + 2 * top[i] +
  308. top[i - 1] + 2) >> 2;
  309. left = filtered_left;
  310. top = filtered_top;
  311. }
  312. }
  313. }
  314. }
  315. switch (mode) {
  316. case INTRA_PLANAR:
  317. s->hpc.pred_planar[log2_size - 2]((uint8_t *)src, (uint8_t *)top,
  318. (uint8_t *)left, stride);
  319. break;
  320. case INTRA_DC:
  321. s->hpc.pred_dc((uint8_t *)src, (uint8_t *)top,
  322. (uint8_t *)left, stride, log2_size, c_idx);
  323. break;
  324. default:
  325. s->hpc.pred_angular[log2_size - 2]((uint8_t *)src, (uint8_t *)top,
  326. (uint8_t *)left, stride, c_idx,
  327. mode);
  328. break;
  329. }
  330. }
  331. #define INTRA_PRED(size) \
  332. static void FUNC(intra_pred_ ## size)(HEVCContext *s, int x0, int y0, int c_idx) \
  333. { \
  334. FUNC(intra_pred)(s, x0, y0, size, c_idx); \
  335. }
  336. INTRA_PRED(2)
  337. INTRA_PRED(3)
  338. INTRA_PRED(4)
  339. INTRA_PRED(5)
  340. #undef INTRA_PRED
  341. static av_always_inline void FUNC(pred_planar)(uint8_t *_src, const uint8_t *_top,
  342. const uint8_t *_left, ptrdiff_t stride,
  343. int trafo_size)
  344. {
  345. int x, y;
  346. pixel *src = (pixel *)_src;
  347. const pixel *top = (const pixel *)_top;
  348. const pixel *left = (const pixel *)_left;
  349. int size = 1 << trafo_size;
  350. for (y = 0; y < size; y++)
  351. for (x = 0; x < size; x++)
  352. POS(x, y) = ((size - 1 - x) * left[y] + (x + 1) * top[size] +
  353. (size - 1 - y) * top[x] + (y + 1) * left[size] + size) >> (trafo_size + 1);
  354. }
  355. #define PRED_PLANAR(size)\
  356. static void FUNC(pred_planar_ ## size)(uint8_t *src, const uint8_t *top, \
  357. const uint8_t *left, ptrdiff_t stride) \
  358. { \
  359. FUNC(pred_planar)(src, top, left, stride, size + 2); \
  360. }
  361. PRED_PLANAR(0)
  362. PRED_PLANAR(1)
  363. PRED_PLANAR(2)
  364. PRED_PLANAR(3)
  365. #undef PRED_PLANAR
  366. static void FUNC(pred_dc)(uint8_t *_src, const uint8_t *_top,
  367. const uint8_t *_left,
  368. ptrdiff_t stride, int log2_size, int c_idx)
  369. {
  370. int i, j, x, y;
  371. int size = (1 << log2_size);
  372. pixel *src = (pixel *)_src;
  373. const pixel *top = (const pixel *)_top;
  374. const pixel *left = (const pixel *)_left;
  375. int dc = size;
  376. pixel4 a;
  377. for (i = 0; i < size; i++)
  378. dc += left[i] + top[i];
  379. dc >>= log2_size + 1;
  380. a = PIXEL_SPLAT_X4(dc);
  381. for (i = 0; i < size; i++)
  382. for (j = 0; j < size; j+=4)
  383. AV_WN4P(&POS(j, i), a);
  384. if (c_idx == 0 && size < 32) {
  385. POS(0, 0) = (left[0] + 2 * dc + top[0] + 2) >> 2;
  386. for (x = 1; x < size; x++)
  387. POS(x, 0) = (top[x] + 3 * dc + 2) >> 2;
  388. for (y = 1; y < size; y++)
  389. POS(0, y) = (left[y] + 3 * dc + 2) >> 2;
  390. }
  391. }
  392. static av_always_inline void FUNC(pred_angular)(uint8_t *_src,
  393. const uint8_t *_top,
  394. const uint8_t *_left,
  395. ptrdiff_t stride, int c_idx,
  396. int mode, int size)
  397. {
  398. int x, y;
  399. pixel *src = (pixel *)_src;
  400. const pixel *top = (const pixel *)_top;
  401. const pixel *left = (const pixel *)_left;
  402. static const int intra_pred_angle[] = {
  403. 32, 26, 21, 17, 13, 9, 5, 2, 0, -2, -5, -9, -13, -17, -21, -26, -32,
  404. -26, -21, -17, -13, -9, -5, -2, 0, 2, 5, 9, 13, 17, 21, 26, 32
  405. };
  406. static const int inv_angle[] = {
  407. -4096, -1638, -910, -630, -482, -390, -315, -256, -315, -390, -482,
  408. -630, -910, -1638, -4096
  409. };
  410. int angle = intra_pred_angle[mode - 2];
  411. pixel ref_array[3 * MAX_TB_SIZE + 4];
  412. pixel *ref_tmp = ref_array + size;
  413. const pixel *ref;
  414. int last = (size * angle) >> 5;
  415. if (mode >= 18) {
  416. ref = top - 1;
  417. if (angle < 0 && last < -1) {
  418. for (x = 0; x <= size; x += 4)
  419. AV_WN4P(&ref_tmp[x], AV_RN4P(&top[x - 1]));
  420. for (x = last; x <= -1; x++)
  421. ref_tmp[x] = left[-1 + ((x * inv_angle[mode - 11] + 128) >> 8)];
  422. ref = ref_tmp;
  423. }
  424. for (y = 0; y < size; y++) {
  425. int idx = ((y + 1) * angle) >> 5;
  426. int fact = ((y + 1) * angle) & 31;
  427. if (fact) {
  428. for (x = 0; x < size; x += 4) {
  429. POS(x , y) = ((32 - fact) * ref[x + idx + 1] +
  430. fact * ref[x + idx + 2] + 16) >> 5;
  431. POS(x + 1, y) = ((32 - fact) * ref[x + 1 + idx + 1] +
  432. fact * ref[x + 1 + idx + 2] + 16) >> 5;
  433. POS(x + 2, y) = ((32 - fact) * ref[x + 2 + idx + 1] +
  434. fact * ref[x + 2 + idx + 2] + 16) >> 5;
  435. POS(x + 3, y) = ((32 - fact) * ref[x + 3 + idx + 1] +
  436. fact * ref[x + 3 + idx + 2] + 16) >> 5;
  437. }
  438. } else {
  439. for (x = 0; x < size; x += 4)
  440. AV_WN4P(&POS(x, y), AV_RN4P(&ref[x + idx + 1]));
  441. }
  442. }
  443. if (mode == 26 && c_idx == 0 && size < 32) {
  444. for (y = 0; y < size; y++)
  445. POS(0, y) = av_clip_pixel(top[0] + ((left[y] - left[-1]) >> 1));
  446. }
  447. } else {
  448. ref = left - 1;
  449. if (angle < 0 && last < -1) {
  450. for (x = 0; x <= size; x += 4)
  451. AV_WN4P(&ref_tmp[x], AV_RN4P(&left[x - 1]));
  452. for (x = last; x <= -1; x++)
  453. ref_tmp[x] = top[-1 + ((x * inv_angle[mode - 11] + 128) >> 8)];
  454. ref = ref_tmp;
  455. }
  456. for (x = 0; x < size; x++) {
  457. int idx = ((x + 1) * angle) >> 5;
  458. int fact = ((x + 1) * angle) & 31;
  459. if (fact) {
  460. for (y = 0; y < size; y++) {
  461. POS(x, y) = ((32 - fact) * ref[y + idx + 1] +
  462. fact * ref[y + idx + 2] + 16) >> 5;
  463. }
  464. } else {
  465. for (y = 0; y < size; y++)
  466. POS(x, y) = ref[y + idx + 1];
  467. }
  468. }
  469. if (mode == 10 && c_idx == 0 && size < 32) {
  470. for (x = 0; x < size; x += 4) {
  471. POS(x, 0) = av_clip_pixel(left[0] + ((top[x ] - top[-1]) >> 1));
  472. POS(x + 1, 0) = av_clip_pixel(left[0] + ((top[x + 1] - top[-1]) >> 1));
  473. POS(x + 2, 0) = av_clip_pixel(left[0] + ((top[x + 2] - top[-1]) >> 1));
  474. POS(x + 3, 0) = av_clip_pixel(left[0] + ((top[x + 3] - top[-1]) >> 1));
  475. }
  476. }
  477. }
  478. }
  479. static void FUNC(pred_angular_0)(uint8_t *src, const uint8_t *top,
  480. const uint8_t *left,
  481. ptrdiff_t stride, int c_idx, int mode)
  482. {
  483. FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 2);
  484. }
  485. static void FUNC(pred_angular_1)(uint8_t *src, const uint8_t *top,
  486. const uint8_t *left,
  487. ptrdiff_t stride, int c_idx, int mode)
  488. {
  489. FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 3);
  490. }
  491. static void FUNC(pred_angular_2)(uint8_t *src, const uint8_t *top,
  492. const uint8_t *left,
  493. ptrdiff_t stride, int c_idx, int mode)
  494. {
  495. FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 4);
  496. }
  497. static void FUNC(pred_angular_3)(uint8_t *src, const uint8_t *top,
  498. const uint8_t *left,
  499. ptrdiff_t stride, int c_idx, int mode)
  500. {
  501. FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 5);
  502. }
  503. #undef EXTEND_LEFT_CIP
  504. #undef EXTEND_RIGHT_CIP
  505. #undef EXTEND_UP_CIP
  506. #undef EXTEND_DOWN_CIP
  507. #undef IS_INTRA
  508. #undef MVF_PU
  509. #undef MVF
  510. #undef PU
  511. #undef EXTEND
  512. #undef MIN_TB_ADDR_ZS
  513. #undef POS