LCOV - code coverage report
Current view: top level - third_party/aom/aom_dsp - intrapred.c (source / functions) Hit Total Coverage
Test: output.info Lines: 0 451 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 172 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2016, Alliance for Open Media. All rights reserved
       3             :  *
       4             :  * This source code is subject to the terms of the BSD 2 Clause License and
       5             :  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
       6             :  * was not distributed with this source code in the LICENSE file, you can
       7             :  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
       8             :  * Media Patent License 1.0 was not distributed with this source code in the
       9             :  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
      10             :  */
      11             : 
      12             : #include <assert.h>
      13             : #include <math.h>
      14             : 
      15             : #include "./aom_config.h"
      16             : #include "./aom_dsp_rtcd.h"
      17             : 
      18             : #include "aom_dsp/aom_dsp_common.h"
      19             : #include "aom_mem/aom_mem.h"
      20             : #include "aom_ports/bitops.h"
      21             : 
      22             : #define DST(x, y) dst[(x) + (y)*stride]
      23             : #define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2)
      24             : #define AVG2(a, b) (((a) + (b) + 1) >> 1)
      25             : 
      26           0 : static INLINE void d207e_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
      27             :                                    const uint8_t *above, const uint8_t *left) {
      28             :   int r, c;
      29             :   (void)above;
      30             : 
      31           0 :   for (r = 0; r < bs; ++r) {
      32           0 :     for (c = 0; c < bs; ++c) {
      33           0 :       dst[c] = c & 1 ? AVG3(left[(c >> 1) + r], left[(c >> 1) + r + 1],
      34             :                             left[(c >> 1) + r + 2])
      35           0 :                      : AVG2(left[(c >> 1) + r], left[(c >> 1) + r + 1]);
      36             :     }
      37           0 :     dst += stride;
      38             :   }
      39           0 : }
      40             : 
      41           0 : static INLINE void d63e_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
      42             :                                   const uint8_t *above, const uint8_t *left) {
      43             :   int r, c;
      44             :   (void)left;
      45           0 :   for (r = 0; r < bs; ++r) {
      46           0 :     for (c = 0; c < bs; ++c) {
      47           0 :       dst[c] = r & 1 ? AVG3(above[(r >> 1) + c], above[(r >> 1) + c + 1],
      48             :                             above[(r >> 1) + c + 2])
      49           0 :                      : AVG2(above[(r >> 1) + c], above[(r >> 1) + c + 1]);
      50             :     }
      51           0 :     dst += stride;
      52             :   }
      53           0 : }
      54             : 
      55           0 : static INLINE void d45e_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
      56             :                                   const uint8_t *above, const uint8_t *left) {
      57             :   int r, c;
      58             :   (void)left;
      59           0 :   for (r = 0; r < bs; ++r) {
      60           0 :     for (c = 0; c < bs; ++c) {
      61           0 :       dst[c] = AVG3(above[r + c], above[r + c + 1],
      62             :                     above[r + c + 1 + (r + c + 2 < bs * 2)]);
      63             :     }
      64           0 :     dst += stride;
      65             :   }
      66           0 : }
      67             : 
      68           0 : static INLINE void d117_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
      69             :                                   const uint8_t *above, const uint8_t *left) {
      70             :   int r, c;
      71             : 
      72             :   // first row
      73           0 :   for (c = 0; c < bs; c++) dst[c] = AVG2(above[c - 1], above[c]);
      74           0 :   dst += stride;
      75             : 
      76             :   // second row
      77           0 :   dst[0] = AVG3(left[0], above[-1], above[0]);
      78           0 :   for (c = 1; c < bs; c++) dst[c] = AVG3(above[c - 2], above[c - 1], above[c]);
      79           0 :   dst += stride;
      80             : 
      81             :   // the rest of first col
      82           0 :   dst[0] = AVG3(above[-1], left[0], left[1]);
      83           0 :   for (r = 3; r < bs; ++r)
      84           0 :     dst[(r - 2) * stride] = AVG3(left[r - 3], left[r - 2], left[r - 1]);
      85             : 
      86             :   // the rest of the block
      87           0 :   for (r = 2; r < bs; ++r) {
      88           0 :     for (c = 1; c < bs; c++) dst[c] = dst[-2 * stride + c - 1];
      89           0 :     dst += stride;
      90             :   }
      91           0 : }
      92             : 
      93           0 : static INLINE void d135_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
      94             :                                   const uint8_t *above, const uint8_t *left) {
      95             :   int i;
      96             : #if CONFIG_TX64X64
      97             : #if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ > 7
      98             :   // silence a spurious -Warray-bounds warning, possibly related to:
      99             :   // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
     100             :   uint8_t border[133];
     101             : #else
     102             :   uint8_t border[64 + 64 - 1];  // outer border from bottom-left to top-right
     103             : #endif
     104             : #else
     105             : #if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ > 7
     106             :   // silence a spurious -Warray-bounds warning, possibly related to:
     107             :   // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
     108             :   uint8_t border[69];
     109             : #else
     110             :   uint8_t border[32 + 32 - 1];  // outer border from bottom-left to top-right
     111             : #endif
     112             : #endif  // CONFIG_TX64X64
     113             : 
     114             :   // dst(bs, bs - 2)[0], i.e., border starting at bottom-left
     115           0 :   for (i = 0; i < bs - 2; ++i) {
     116           0 :     border[i] = AVG3(left[bs - 3 - i], left[bs - 2 - i], left[bs - 1 - i]);
     117             :   }
     118           0 :   border[bs - 2] = AVG3(above[-1], left[0], left[1]);
     119           0 :   border[bs - 1] = AVG3(left[0], above[-1], above[0]);
     120           0 :   border[bs - 0] = AVG3(above[-1], above[0], above[1]);
     121             :   // dst[0][2, size), i.e., remaining top border ascending
     122           0 :   for (i = 0; i < bs - 2; ++i) {
     123           0 :     border[bs + 1 + i] = AVG3(above[i], above[i + 1], above[i + 2]);
     124             :   }
     125             : 
     126           0 :   for (i = 0; i < bs; ++i) {
     127           0 :     memcpy(dst + i * stride, border + bs - 1 - i, bs);
     128             :   }
     129           0 : }
     130             : 
     131           0 : static INLINE void d153_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     132             :                                   const uint8_t *above, const uint8_t *left) {
     133             :   int r, c;
     134           0 :   dst[0] = AVG2(above[-1], left[0]);
     135           0 :   for (r = 1; r < bs; r++) dst[r * stride] = AVG2(left[r - 1], left[r]);
     136           0 :   dst++;
     137             : 
     138           0 :   dst[0] = AVG3(left[0], above[-1], above[0]);
     139           0 :   dst[stride] = AVG3(above[-1], left[0], left[1]);
     140           0 :   for (r = 2; r < bs; r++)
     141           0 :     dst[r * stride] = AVG3(left[r - 2], left[r - 1], left[r]);
     142           0 :   dst++;
     143             : 
     144           0 :   for (c = 0; c < bs - 2; c++)
     145           0 :     dst[c] = AVG3(above[c - 1], above[c], above[c + 1]);
     146           0 :   dst += stride;
     147             : 
     148           0 :   for (r = 1; r < bs; ++r) {
     149           0 :     for (c = 0; c < bs - 2; c++) dst[c] = dst[-stride + c - 2];
     150           0 :     dst += stride;
     151             :   }
     152           0 : }
     153             : 
     154           0 : static INLINE void v_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     155             :                                const uint8_t *above, const uint8_t *left) {
     156             :   int r;
     157             :   (void)left;
     158             : 
     159           0 :   for (r = 0; r < bs; r++) {
     160           0 :     memcpy(dst, above, bs);
     161           0 :     dst += stride;
     162             :   }
     163           0 : }
     164             : 
     165           0 : static INLINE void h_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     166             :                                const uint8_t *above, const uint8_t *left) {
     167             :   int r;
     168             :   (void)above;
     169             : 
     170           0 :   for (r = 0; r < bs; r++) {
     171           0 :     memset(dst, left[r], bs);
     172           0 :     dst += stride;
     173             :   }
     174           0 : }
     175             : 
     176             : #if CONFIG_ALT_INTRA
     177           0 : static INLINE int abs_diff(int a, int b) { return (a > b) ? a - b : b - a; }
     178             : 
     179           0 : static INLINE uint16_t paeth_predictor_single(uint16_t left, uint16_t top,
     180             :                                               uint16_t top_left) {
     181           0 :   const int base = top + left - top_left;
     182           0 :   const int p_left = abs_diff(base, left);
     183           0 :   const int p_top = abs_diff(base, top);
     184           0 :   const int p_top_left = abs_diff(base, top_left);
     185             : 
     186             :   // Return nearest to base of left, top and top_left.
     187           0 :   return (p_left <= p_top && p_left <= p_top_left)
     188             :              ? left
     189           0 :              : (p_top <= p_top_left) ? top : top_left;
     190             : }
     191             : 
     192           0 : static INLINE void paeth_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     193             :                                    const uint8_t *above, const uint8_t *left) {
     194             :   int r, c;
     195           0 :   const uint8_t ytop_left = above[-1];
     196             : 
     197           0 :   for (r = 0; r < bs; r++) {
     198           0 :     for (c = 0; c < bs; c++)
     199           0 :       dst[c] = (uint8_t)paeth_predictor_single(left[r], above[c], ytop_left);
     200           0 :     dst += stride;
     201             :   }
     202           0 : }
     203             : 
     204             : // Weights are quadratic from '1' to '1 / block_size', scaled by
     205             : // 2^sm_weight_log2_scale.
     206             : static const int sm_weight_log2_scale = 8;
     207             : 
     208             : #if CONFIG_TX64X64
     209             : // max(block_size_wide[BLOCK_LARGEST], block_size_high[BLOCK_LARGEST])
     210             : #define MAX_BLOCK_DIM 64
     211             : #else
     212             : #define MAX_BLOCK_DIM 32
     213             : #endif  // CONFIG_TX64X64
     214             : 
     215             : static const uint8_t sm_weight_arrays[2 * MAX_BLOCK_DIM] = {
     216             :   // Unused, because we always offset by bs, which is at least 2.
     217             :   0, 0,
     218             :   // bs = 2
     219             :   255, 128,
     220             :   // bs = 4
     221             :   255, 149, 85, 64,
     222             :   // bs = 8
     223             :   255, 197, 146, 105, 73, 50, 37, 32,
     224             :   // bs = 16
     225             :   255, 225, 196, 170, 145, 123, 102, 84, 68, 54, 43, 33, 26, 20, 17, 16,
     226             :   // bs = 32
     227             :   255, 240, 225, 210, 196, 182, 169, 157, 145, 133, 122, 111, 101, 92, 83, 74,
     228             :   66, 59, 52, 45, 39, 34, 29, 25, 21, 17, 14, 12, 10, 9, 8, 8,
     229             : #if CONFIG_TX64X64
     230             :   // bs = 64
     231             :   255, 248, 240, 233, 225, 218, 210, 203, 196, 189, 182, 176, 169, 163, 156,
     232             :   150, 144, 138, 133, 127, 121, 116, 111, 106, 101, 96, 91, 86, 82, 77, 73, 69,
     233             :   65, 61, 57, 54, 50, 47, 44, 41, 38, 35, 32, 29, 27, 25, 22, 20, 18, 16, 15,
     234             :   13, 12, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4,
     235             : #endif  // CONFIG_TX64X64
     236             : };
     237             : 
     238             : // Some basic checks on weights for smooth predictor.
     239             : #define sm_weights_sanity_checks(weights, weights_scale, pred_scale) \
     240             :   assert(weights[0] < weights_scale);                                \
     241             :   assert(weights_scale - weights[bs - 1] < weights_scale);           \
     242             :   assert(pred_scale < 31)  // ensures no overflow when calculating predictor.
     243             : 
     244             : #define divide_round(value, bits) (((value) + (1 << ((bits)-1))) >> (bits))
     245             : 
     246           0 : static INLINE void smooth_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     247             :                                     const uint8_t *above, const uint8_t *left) {
     248           0 :   const uint8_t below_pred = left[bs - 1];   // estimated by bottom-left pixel
     249           0 :   const uint8_t right_pred = above[bs - 1];  // estimated by top-right pixel
     250           0 :   const uint8_t *const sm_weights = sm_weight_arrays + bs;
     251             :   // scale = 2 * 2^sm_weight_log2_scale
     252           0 :   const int log2_scale = 1 + sm_weight_log2_scale;
     253           0 :   const uint16_t scale = (1 << sm_weight_log2_scale);
     254           0 :   sm_weights_sanity_checks(sm_weights, scale, log2_scale + sizeof(*dst));
     255             :   int r;
     256           0 :   for (r = 0; r < bs; ++r) {
     257             :     int c;
     258           0 :     for (c = 0; c < bs; ++c) {
     259           0 :       const uint8_t pixels[] = { above[c], below_pred, left[r], right_pred };
     260           0 :       const uint8_t weights[] = { sm_weights[r], scale - sm_weights[r],
     261           0 :                                   sm_weights[c], scale - sm_weights[c] };
     262           0 :       uint32_t this_pred = 0;
     263             :       int i;
     264           0 :       assert(scale >= sm_weights[r] && scale >= sm_weights[c]);
     265           0 :       for (i = 0; i < 4; ++i) {
     266           0 :         this_pred += weights[i] * pixels[i];
     267             :       }
     268           0 :       dst[c] = clip_pixel(divide_round(this_pred, log2_scale));
     269             :     }
     270           0 :     dst += stride;
     271             :   }
     272           0 : }
     273             : 
     274             : #if CONFIG_SMOOTH_HV
     275             : static INLINE void smooth_v_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     276             :                                       const uint8_t *above,
     277             :                                       const uint8_t *left) {
     278             :   const uint8_t below_pred = left[bs - 1];  // estimated by bottom-left pixel
     279             :   const uint8_t *const sm_weights = sm_weight_arrays + bs;
     280             :   // scale = 2^sm_weight_log2_scale
     281             :   const int log2_scale = sm_weight_log2_scale;
     282             :   const uint16_t scale = (1 << sm_weight_log2_scale);
     283             :   sm_weights_sanity_checks(sm_weights, scale, log2_scale + sizeof(*dst));
     284             : 
     285             :   int r;
     286             :   for (r = 0; r < bs; r++) {
     287             :     int c;
     288             :     for (c = 0; c < bs; ++c) {
     289             :       const uint8_t pixels[] = { above[c], below_pred };
     290             :       const uint8_t weights[] = { sm_weights[r], scale - sm_weights[r] };
     291             :       uint32_t this_pred = 0;
     292             :       assert(scale >= sm_weights[r]);
     293             :       int i;
     294             :       for (i = 0; i < 2; ++i) {
     295             :         this_pred += weights[i] * pixels[i];
     296             :       }
     297             :       dst[c] = clip_pixel(divide_round(this_pred, log2_scale));
     298             :     }
     299             :     dst += stride;
     300             :   }
     301             : }
     302             : 
     303             : static INLINE void smooth_h_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     304             :                                       const uint8_t *above,
     305             :                                       const uint8_t *left) {
     306             :   const uint8_t right_pred = above[bs - 1];  // estimated by top-right pixel
     307             :   const uint8_t *const sm_weights = sm_weight_arrays + bs;
     308             :   // scale = 2^sm_weight_log2_scale
     309             :   const int log2_scale = sm_weight_log2_scale;
     310             :   const uint16_t scale = (1 << sm_weight_log2_scale);
     311             :   sm_weights_sanity_checks(sm_weights, scale, log2_scale + sizeof(*dst));
     312             : 
     313             :   int r;
     314             :   for (r = 0; r < bs; r++) {
     315             :     int c;
     316             :     for (c = 0; c < bs; ++c) {
     317             :       const uint8_t pixels[] = { left[r], right_pred };
     318             :       const uint8_t weights[] = { sm_weights[c], scale - sm_weights[c] };
     319             :       uint32_t this_pred = 0;
     320             :       assert(scale >= sm_weights[c]);
     321             :       int i;
     322             :       for (i = 0; i < 2; ++i) {
     323             :         this_pred += weights[i] * pixels[i];
     324             :       }
     325             :       dst[c] = clip_pixel(divide_round(this_pred, log2_scale));
     326             :     }
     327             :     dst += stride;
     328             :   }
     329             : }
     330             : #endif  // CONFIG_SMOOTH_HV
     331             : 
     332             : #else
     333             : 
     334             : static INLINE void tm_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     335             :                                 const uint8_t *above, const uint8_t *left) {
     336             :   int r, c;
     337             :   int ytop_left = above[-1];
     338             : 
     339             :   for (r = 0; r < bs; r++) {
     340             :     for (c = 0; c < bs; c++)
     341             :       dst[c] = clip_pixel(left[r] + above[c] - ytop_left);
     342             :     dst += stride;
     343             :   }
     344             : }
     345             : #endif  // CONFIG_ALT_INTRA
     346             : 
     347           0 : static INLINE void dc_128_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     348             :                                     const uint8_t *above, const uint8_t *left) {
     349             :   int r;
     350             :   (void)above;
     351             :   (void)left;
     352             : 
     353           0 :   for (r = 0; r < bs; r++) {
     354           0 :     memset(dst, 128, bs);
     355           0 :     dst += stride;
     356             :   }
     357           0 : }
     358             : 
     359           0 : static INLINE void dc_left_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     360             :                                      const uint8_t *above,
     361             :                                      const uint8_t *left) {
     362           0 :   int i, r, expected_dc, sum = 0;
     363             :   (void)above;
     364             : 
     365           0 :   for (i = 0; i < bs; i++) sum += left[i];
     366           0 :   expected_dc = (sum + (bs >> 1)) / bs;
     367             : 
     368           0 :   for (r = 0; r < bs; r++) {
     369           0 :     memset(dst, expected_dc, bs);
     370           0 :     dst += stride;
     371             :   }
     372           0 : }
     373             : 
     374           0 : static INLINE void dc_top_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     375             :                                     const uint8_t *above, const uint8_t *left) {
     376           0 :   int i, r, expected_dc, sum = 0;
     377             :   (void)left;
     378             : 
     379           0 :   for (i = 0; i < bs; i++) sum += above[i];
     380           0 :   expected_dc = (sum + (bs >> 1)) / bs;
     381             : 
     382           0 :   for (r = 0; r < bs; r++) {
     383           0 :     memset(dst, expected_dc, bs);
     384           0 :     dst += stride;
     385             :   }
     386           0 : }
     387             : 
     388           0 : static INLINE void dc_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
     389             :                                 const uint8_t *above, const uint8_t *left) {
     390           0 :   int i, r, expected_dc, sum = 0;
     391           0 :   const int count = 2 * bs;
     392             : 
     393           0 :   for (i = 0; i < bs; i++) {
     394           0 :     sum += above[i];
     395           0 :     sum += left[i];
     396             :   }
     397             : 
     398           0 :   expected_dc = (sum + (count >> 1)) / count;
     399             : 
     400           0 :   for (r = 0; r < bs; r++) {
     401           0 :     memset(dst, expected_dc, bs);
     402           0 :     dst += stride;
     403             :   }
     404           0 : }
     405             : 
     406           0 : void aom_d45e_predictor_2x2_c(uint8_t *dst, ptrdiff_t stride,
     407             :                               const uint8_t *above, const uint8_t *left) {
     408           0 :   const int A = above[0];
     409           0 :   const int B = above[1];
     410           0 :   const int C = above[2];
     411           0 :   const int D = above[3];
     412             :   (void)stride;
     413             :   (void)left;
     414             : 
     415           0 :   DST(0, 0) = AVG3(A, B, C);
     416           0 :   DST(1, 0) = DST(0, 1) = AVG3(B, C, D);
     417           0 :   DST(1, 1) = AVG3(C, D, D);
     418           0 : }
     419             : 
     420           0 : void aom_d117_predictor_2x2_c(uint8_t *dst, ptrdiff_t stride,
     421             :                               const uint8_t *above, const uint8_t *left) {
     422           0 :   const int I = left[0];
     423           0 :   const int X = above[-1];
     424           0 :   const int A = above[0];
     425           0 :   const int B = above[1];
     426           0 :   DST(0, 0) = AVG2(X, A);
     427           0 :   DST(1, 0) = AVG2(A, B);
     428           0 :   DST(0, 1) = AVG3(I, X, A);
     429           0 :   DST(1, 1) = AVG3(X, A, B);
     430           0 : }
     431             : 
     432           0 : void aom_d135_predictor_2x2_c(uint8_t *dst, ptrdiff_t stride,
     433             :                               const uint8_t *above, const uint8_t *left) {
     434           0 :   const int I = left[0];
     435           0 :   const int J = left[1];
     436           0 :   const int X = above[-1];
     437           0 :   const int A = above[0];
     438           0 :   const int B = above[1];
     439             :   (void)stride;
     440           0 :   DST(0, 1) = AVG3(X, I, J);
     441           0 :   DST(1, 1) = DST(0, 0) = AVG3(A, X, I);
     442           0 :   DST(1, 0) = AVG3(B, A, X);
     443           0 : }
     444             : 
     445           0 : void aom_d153_predictor_2x2_c(uint8_t *dst, ptrdiff_t stride,
     446             :                               const uint8_t *above, const uint8_t *left) {
     447           0 :   const int I = left[0];
     448           0 :   const int J = left[1];
     449           0 :   const int X = above[-1];
     450           0 :   const int A = above[0];
     451             : 
     452           0 :   DST(0, 0) = AVG2(I, X);
     453           0 :   DST(0, 1) = AVG2(J, I);
     454           0 :   DST(1, 0) = AVG3(I, X, A);
     455           0 :   DST(1, 1) = AVG3(J, I, X);
     456           0 : }
     457             : 
     458           0 : void aom_d45e_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride,
     459             :                               const uint8_t *above, const uint8_t *left) {
     460           0 :   const int A = above[0];
     461           0 :   const int B = above[1];
     462           0 :   const int C = above[2];
     463           0 :   const int D = above[3];
     464           0 :   const int E = above[4];
     465           0 :   const int F = above[5];
     466           0 :   const int G = above[6];
     467           0 :   const int H = above[7];
     468             :   (void)stride;
     469             :   (void)left;
     470           0 :   DST(0, 0) = AVG3(A, B, C);
     471           0 :   DST(1, 0) = DST(0, 1) = AVG3(B, C, D);
     472           0 :   DST(2, 0) = DST(1, 1) = DST(0, 2) = AVG3(C, D, E);
     473           0 :   DST(3, 0) = DST(2, 1) = DST(1, 2) = DST(0, 3) = AVG3(D, E, F);
     474           0 :   DST(3, 1) = DST(2, 2) = DST(1, 3) = AVG3(E, F, G);
     475           0 :   DST(3, 2) = DST(2, 3) = AVG3(F, G, H);
     476           0 :   DST(3, 3) = AVG3(G, H, H);
     477           0 : }
     478             : 
     479           0 : void aom_d117_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride,
     480             :                               const uint8_t *above, const uint8_t *left) {
     481           0 :   const int I = left[0];
     482           0 :   const int J = left[1];
     483           0 :   const int K = left[2];
     484           0 :   const int X = above[-1];
     485           0 :   const int A = above[0];
     486           0 :   const int B = above[1];
     487           0 :   const int C = above[2];
     488           0 :   const int D = above[3];
     489           0 :   DST(0, 0) = DST(1, 2) = AVG2(X, A);
     490           0 :   DST(1, 0) = DST(2, 2) = AVG2(A, B);
     491           0 :   DST(2, 0) = DST(3, 2) = AVG2(B, C);
     492           0 :   DST(3, 0) = AVG2(C, D);
     493             : 
     494           0 :   DST(0, 3) = AVG3(K, J, I);
     495           0 :   DST(0, 2) = AVG3(J, I, X);
     496           0 :   DST(0, 1) = DST(1, 3) = AVG3(I, X, A);
     497           0 :   DST(1, 1) = DST(2, 3) = AVG3(X, A, B);
     498           0 :   DST(2, 1) = DST(3, 3) = AVG3(A, B, C);
     499           0 :   DST(3, 1) = AVG3(B, C, D);
     500           0 : }
     501             : 
     502           0 : void aom_d135_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride,
     503             :                               const uint8_t *above, const uint8_t *left) {
     504           0 :   const int I = left[0];
     505           0 :   const int J = left[1];
     506           0 :   const int K = left[2];
     507           0 :   const int L = left[3];
     508           0 :   const int X = above[-1];
     509           0 :   const int A = above[0];
     510           0 :   const int B = above[1];
     511           0 :   const int C = above[2];
     512           0 :   const int D = above[3];
     513             :   (void)stride;
     514           0 :   DST(0, 3) = AVG3(J, K, L);
     515           0 :   DST(1, 3) = DST(0, 2) = AVG3(I, J, K);
     516           0 :   DST(2, 3) = DST(1, 2) = DST(0, 1) = AVG3(X, I, J);
     517           0 :   DST(3, 3) = DST(2, 2) = DST(1, 1) = DST(0, 0) = AVG3(A, X, I);
     518           0 :   DST(3, 2) = DST(2, 1) = DST(1, 0) = AVG3(B, A, X);
     519           0 :   DST(3, 1) = DST(2, 0) = AVG3(C, B, A);
     520           0 :   DST(3, 0) = AVG3(D, C, B);
     521           0 : }
     522             : 
     523           0 : void aom_d153_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride,
     524             :                               const uint8_t *above, const uint8_t *left) {
     525           0 :   const int I = left[0];
     526           0 :   const int J = left[1];
     527           0 :   const int K = left[2];
     528           0 :   const int L = left[3];
     529           0 :   const int X = above[-1];
     530           0 :   const int A = above[0];
     531           0 :   const int B = above[1];
     532           0 :   const int C = above[2];
     533             : 
     534           0 :   DST(0, 0) = DST(2, 1) = AVG2(I, X);
     535           0 :   DST(0, 1) = DST(2, 2) = AVG2(J, I);
     536           0 :   DST(0, 2) = DST(2, 3) = AVG2(K, J);
     537           0 :   DST(0, 3) = AVG2(L, K);
     538             : 
     539           0 :   DST(3, 0) = AVG3(A, B, C);
     540           0 :   DST(2, 0) = AVG3(X, A, B);
     541           0 :   DST(1, 0) = DST(3, 1) = AVG3(I, X, A);
     542           0 :   DST(1, 1) = DST(3, 2) = AVG3(J, I, X);
     543           0 :   DST(1, 2) = DST(3, 3) = AVG3(K, J, I);
     544           0 :   DST(1, 3) = AVG3(L, K, J);
     545           0 : }
     546             : 
     547             : #if CONFIG_HIGHBITDEPTH
     548           0 : static INLINE void highbd_d207e_predictor(uint16_t *dst, ptrdiff_t stride,
     549             :                                           int bs, const uint16_t *above,
     550             :                                           const uint16_t *left, int bd) {
     551             :   int r, c;
     552             :   (void)above;
     553             :   (void)bd;
     554             : 
     555           0 :   for (r = 0; r < bs; ++r) {
     556           0 :     for (c = 0; c < bs; ++c) {
     557           0 :       dst[c] = c & 1 ? AVG3(left[(c >> 1) + r], left[(c >> 1) + r + 1],
     558             :                             left[(c >> 1) + r + 2])
     559           0 :                      : AVG2(left[(c >> 1) + r], left[(c >> 1) + r + 1]);
     560             :     }
     561           0 :     dst += stride;
     562             :   }
     563           0 : }
     564             : 
     565           0 : static INLINE void highbd_d63e_predictor(uint16_t *dst, ptrdiff_t stride,
     566             :                                          int bs, const uint16_t *above,
     567             :                                          const uint16_t *left, int bd) {
     568             :   int r, c;
     569             :   (void)left;
     570             :   (void)bd;
     571           0 :   for (r = 0; r < bs; ++r) {
     572           0 :     for (c = 0; c < bs; ++c) {
     573           0 :       dst[c] = r & 1 ? AVG3(above[(r >> 1) + c], above[(r >> 1) + c + 1],
     574             :                             above[(r >> 1) + c + 2])
     575           0 :                      : AVG2(above[(r >> 1) + c], above[(r >> 1) + c + 1]);
     576             :     }
     577           0 :     dst += stride;
     578             :   }
     579           0 : }
     580             : 
     581           0 : static INLINE void highbd_d45e_predictor(uint16_t *dst, ptrdiff_t stride,
     582             :                                          int bs, const uint16_t *above,
     583             :                                          const uint16_t *left, int bd) {
     584             :   int r, c;
     585             :   (void)left;
     586             :   (void)bd;
     587           0 :   for (r = 0; r < bs; ++r) {
     588           0 :     for (c = 0; c < bs; ++c) {
     589           0 :       dst[c] = AVG3(above[r + c], above[r + c + 1],
     590             :                     above[r + c + 1 + (r + c + 2 < bs * 2)]);
     591             :     }
     592           0 :     dst += stride;
     593             :   }
     594           0 : }
     595             : 
     596           0 : static INLINE void highbd_d117_predictor(uint16_t *dst, ptrdiff_t stride,
     597             :                                          int bs, const uint16_t *above,
     598             :                                          const uint16_t *left, int bd) {
     599             :   int r, c;
     600             :   (void)bd;
     601             : 
     602             :   // first row
     603           0 :   for (c = 0; c < bs; c++) dst[c] = AVG2(above[c - 1], above[c]);
     604           0 :   dst += stride;
     605             : 
     606             :   // second row
     607           0 :   dst[0] = AVG3(left[0], above[-1], above[0]);
     608           0 :   for (c = 1; c < bs; c++) dst[c] = AVG3(above[c - 2], above[c - 1], above[c]);
     609           0 :   dst += stride;
     610             : 
     611             :   // the rest of first col
     612           0 :   dst[0] = AVG3(above[-1], left[0], left[1]);
     613           0 :   for (r = 3; r < bs; ++r)
     614           0 :     dst[(r - 2) * stride] = AVG3(left[r - 3], left[r - 2], left[r - 1]);
     615             : 
     616             :   // the rest of the block
     617           0 :   for (r = 2; r < bs; ++r) {
     618           0 :     for (c = 1; c < bs; c++) dst[c] = dst[-2 * stride + c - 1];
     619           0 :     dst += stride;
     620             :   }
     621           0 : }
     622             : 
     623           0 : static INLINE void highbd_d135_predictor(uint16_t *dst, ptrdiff_t stride,
     624             :                                          int bs, const uint16_t *above,
     625             :                                          const uint16_t *left, int bd) {
     626             :   int r, c;
     627             :   (void)bd;
     628           0 :   dst[0] = AVG3(left[0], above[-1], above[0]);
     629           0 :   for (c = 1; c < bs; c++) dst[c] = AVG3(above[c - 2], above[c - 1], above[c]);
     630             : 
     631           0 :   dst[stride] = AVG3(above[-1], left[0], left[1]);
     632           0 :   for (r = 2; r < bs; ++r)
     633           0 :     dst[r * stride] = AVG3(left[r - 2], left[r - 1], left[r]);
     634             : 
     635           0 :   dst += stride;
     636           0 :   for (r = 1; r < bs; ++r) {
     637           0 :     for (c = 1; c < bs; c++) dst[c] = dst[-stride + c - 1];
     638           0 :     dst += stride;
     639             :   }
     640           0 : }
     641             : 
     642           0 : static INLINE void highbd_d153_predictor(uint16_t *dst, ptrdiff_t stride,
     643             :                                          int bs, const uint16_t *above,
     644             :                                          const uint16_t *left, int bd) {
     645             :   int r, c;
     646             :   (void)bd;
     647           0 :   dst[0] = AVG2(above[-1], left[0]);
     648           0 :   for (r = 1; r < bs; r++) dst[r * stride] = AVG2(left[r - 1], left[r]);
     649           0 :   dst++;
     650             : 
     651           0 :   dst[0] = AVG3(left[0], above[-1], above[0]);
     652           0 :   dst[stride] = AVG3(above[-1], left[0], left[1]);
     653           0 :   for (r = 2; r < bs; r++)
     654           0 :     dst[r * stride] = AVG3(left[r - 2], left[r - 1], left[r]);
     655           0 :   dst++;
     656             : 
     657           0 :   for (c = 0; c < bs - 2; c++)
     658           0 :     dst[c] = AVG3(above[c - 1], above[c], above[c + 1]);
     659           0 :   dst += stride;
     660             : 
     661           0 :   for (r = 1; r < bs; ++r) {
     662           0 :     for (c = 0; c < bs - 2; c++) dst[c] = dst[-stride + c - 2];
     663           0 :     dst += stride;
     664             :   }
     665           0 : }
     666             : 
     667           0 : static INLINE void highbd_v_predictor(uint16_t *dst, ptrdiff_t stride, int bs,
     668             :                                       const uint16_t *above,
     669             :                                       const uint16_t *left, int bd) {
     670             :   int r;
     671             :   (void)left;
     672             :   (void)bd;
     673           0 :   for (r = 0; r < bs; r++) {
     674           0 :     memcpy(dst, above, bs * sizeof(uint16_t));
     675           0 :     dst += stride;
     676             :   }
     677           0 : }
     678             : 
     679           0 : static INLINE void highbd_h_predictor(uint16_t *dst, ptrdiff_t stride, int bs,
     680             :                                       const uint16_t *above,
     681             :                                       const uint16_t *left, int bd) {
     682             :   int r;
     683             :   (void)above;
     684             :   (void)bd;
     685           0 :   for (r = 0; r < bs; r++) {
     686           0 :     aom_memset16(dst, left[r], bs);
     687           0 :     dst += stride;
     688             :   }
     689           0 : }
     690             : 
     691           0 : void aom_highbd_d207_predictor_2x2_c(uint16_t *dst, ptrdiff_t stride,
     692             :                                      const uint16_t *above,
     693             :                                      const uint16_t *left, int bd) {
     694           0 :   const int I = left[0];
     695           0 :   const int J = left[1];
     696           0 :   const int K = left[2];
     697           0 :   const int L = left[3];
     698             :   (void)above;
     699             :   (void)bd;
     700           0 :   DST(0, 0) = AVG2(I, J);
     701           0 :   DST(0, 1) = AVG2(J, K);
     702           0 :   DST(1, 0) = AVG3(I, J, K);
     703           0 :   DST(1, 1) = AVG3(J, K, L);
     704           0 : }
     705             : 
     706           0 : void aom_highbd_d63_predictor_2x2_c(uint16_t *dst, ptrdiff_t stride,
     707             :                                     const uint16_t *above, const uint16_t *left,
     708             :                                     int bd) {
     709           0 :   const int A = above[0];
     710           0 :   const int B = above[1];
     711           0 :   const int C = above[2];
     712           0 :   const int D = above[3];
     713             :   (void)left;
     714             :   (void)bd;
     715           0 :   DST(0, 0) = AVG2(A, B);
     716           0 :   DST(1, 0) = AVG2(B, C);
     717           0 :   DST(0, 1) = AVG3(A, B, C);
     718           0 :   DST(1, 1) = AVG3(B, C, D);
     719           0 : }
     720             : 
     721           0 : void aom_highbd_d45e_predictor_2x2_c(uint16_t *dst, ptrdiff_t stride,
     722             :                                      const uint16_t *above,
     723             :                                      const uint16_t *left, int bd) {
     724           0 :   const int A = above[0];
     725           0 :   const int B = above[1];
     726           0 :   const int C = above[2];
     727           0 :   const int D = above[3];
     728             :   (void)stride;
     729             :   (void)left;
     730             :   (void)bd;
     731           0 :   DST(0, 0) = AVG3(A, B, C);
     732           0 :   DST(1, 0) = DST(0, 1) = AVG3(B, C, D);
     733           0 :   DST(1, 1) = AVG3(C, D, D);
     734           0 : }
     735             : 
     736           0 : void aom_highbd_d117_predictor_2x2_c(uint16_t *dst, ptrdiff_t stride,
     737             :                                      const uint16_t *above,
     738             :                                      const uint16_t *left, int bd) {
     739           0 :   const int I = left[0];
     740           0 :   const int X = above[-1];
     741           0 :   const int A = above[0];
     742           0 :   const int B = above[1];
     743             :   (void)bd;
     744           0 :   DST(0, 0) = AVG2(X, A);
     745           0 :   DST(1, 0) = AVG2(A, B);
     746           0 :   DST(0, 1) = AVG3(I, X, A);
     747           0 :   DST(1, 1) = AVG3(X, A, B);
     748           0 : }
     749             : 
     750           0 : void aom_highbd_d135_predictor_2x2_c(uint16_t *dst, ptrdiff_t stride,
     751             :                                      const uint16_t *above,
     752             :                                      const uint16_t *left, int bd) {
     753           0 :   const int I = left[0];
     754           0 :   const int J = left[1];
     755           0 :   const int X = above[-1];
     756           0 :   const int A = above[0];
     757           0 :   const int B = above[1];
     758             :   (void)bd;
     759           0 :   DST(0, 1) = AVG3(X, I, J);
     760           0 :   DST(1, 1) = DST(0, 0) = AVG3(A, X, I);
     761           0 :   DST(1, 0) = AVG3(B, A, X);
     762           0 : }
     763             : 
     764           0 : void aom_highbd_d153_predictor_2x2_c(uint16_t *dst, ptrdiff_t stride,
     765             :                                      const uint16_t *above,
     766             :                                      const uint16_t *left, int bd) {
     767           0 :   const int I = left[0];
     768           0 :   const int J = left[1];
     769           0 :   const int X = above[-1];
     770           0 :   const int A = above[0];
     771             :   (void)bd;
     772           0 :   DST(0, 0) = AVG2(I, X);
     773           0 :   DST(0, 1) = AVG2(J, I);
     774           0 :   DST(1, 0) = AVG3(I, X, A);
     775           0 :   DST(1, 1) = AVG3(J, I, X);
     776           0 : }
     777             : 
     778             : #if CONFIG_ALT_INTRA
     779           0 : static INLINE void highbd_paeth_predictor(uint16_t *dst, ptrdiff_t stride,
     780             :                                           int bs, const uint16_t *above,
     781             :                                           const uint16_t *left, int bd) {
     782             :   int r, c;
     783           0 :   const uint16_t ytop_left = above[-1];
     784             :   (void)bd;
     785             : 
     786           0 :   for (r = 0; r < bs; r++) {
     787           0 :     for (c = 0; c < bs; c++)
     788           0 :       dst[c] = paeth_predictor_single(left[r], above[c], ytop_left);
     789           0 :     dst += stride;
     790             :   }
     791           0 : }
     792             : 
     793           0 : static INLINE void highbd_smooth_predictor(uint16_t *dst, ptrdiff_t stride,
     794             :                                            int bs, const uint16_t *above,
     795             :                                            const uint16_t *left, int bd) {
     796           0 :   const uint16_t below_pred = left[bs - 1];   // estimated by bottom-left pixel
     797           0 :   const uint16_t right_pred = above[bs - 1];  // estimated by top-right pixel
     798           0 :   const uint8_t *const sm_weights = sm_weight_arrays + bs;
     799             :   // scale = 2 * 2^sm_weight_log2_scale
     800           0 :   const int log2_scale = 1 + sm_weight_log2_scale;
     801           0 :   const uint16_t scale = (1 << sm_weight_log2_scale);
     802           0 :   sm_weights_sanity_checks(sm_weights, scale, log2_scale + sizeof(*dst));
     803             :   int r;
     804           0 :   for (r = 0; r < bs; ++r) {
     805             :     int c;
     806           0 :     for (c = 0; c < bs; ++c) {
     807           0 :       const uint16_t pixels[] = { above[c], below_pred, left[r], right_pred };
     808           0 :       const uint8_t weights[] = { sm_weights[r], scale - sm_weights[r],
     809           0 :                                   sm_weights[c], scale - sm_weights[c] };
     810           0 :       uint32_t this_pred = 0;
     811             :       int i;
     812           0 :       assert(scale >= sm_weights[r] && scale >= sm_weights[c]);
     813           0 :       for (i = 0; i < 4; ++i) {
     814           0 :         this_pred += weights[i] * pixels[i];
     815             :       }
     816           0 :       dst[c] = clip_pixel_highbd(divide_round(this_pred, log2_scale), bd);
     817             :     }
     818           0 :     dst += stride;
     819             :   }
     820           0 : }
     821             : 
     822             : #if CONFIG_SMOOTH_HV
     823             : static INLINE void highbd_smooth_v_predictor(uint16_t *dst, ptrdiff_t stride,
     824             :                                              int bs, const uint16_t *above,
     825             :                                              const uint16_t *left, int bd) {
     826             :   const uint16_t below_pred = left[bs - 1];  // estimated by bottom-left pixel
     827             :   const uint8_t *const sm_weights = sm_weight_arrays + bs;
     828             :   // scale = 2^sm_weight_log2_scale
     829             :   const int log2_scale = sm_weight_log2_scale;
     830             :   const uint16_t scale = (1 << sm_weight_log2_scale);
     831             :   sm_weights_sanity_checks(sm_weights, scale, log2_scale + sizeof(*dst));
     832             : 
     833             :   int r;
     834             :   for (r = 0; r < bs; r++) {
     835             :     int c;
     836             :     for (c = 0; c < bs; ++c) {
     837             :       const uint16_t pixels[] = { above[c], below_pred };
     838             :       const uint8_t weights[] = { sm_weights[r], scale - sm_weights[r] };
     839             :       uint32_t this_pred = 0;
     840             :       assert(scale >= sm_weights[r]);
     841             :       int i;
     842             :       for (i = 0; i < 2; ++i) {
     843             :         this_pred += weights[i] * pixels[i];
     844             :       }
     845             :       dst[c] = clip_pixel_highbd(divide_round(this_pred, log2_scale), bd);
     846             :     }
     847             :     dst += stride;
     848             :   }
     849             : }
     850             : 
     851             : static INLINE void highbd_smooth_h_predictor(uint16_t *dst, ptrdiff_t stride,
     852             :                                              int bs, const uint16_t *above,
     853             :                                              const uint16_t *left, int bd) {
     854             :   const uint16_t right_pred = above[bs - 1];  // estimated by top-right pixel
     855             :   const uint8_t *const sm_weights = sm_weight_arrays + bs;
     856             :   // scale = 2^sm_weight_log2_scale
     857             :   const int log2_scale = sm_weight_log2_scale;
     858             :   const uint16_t scale = (1 << sm_weight_log2_scale);
     859             :   sm_weights_sanity_checks(sm_weights, scale, log2_scale + sizeof(*dst));
     860             : 
     861             :   int r;
     862             :   for (r = 0; r < bs; r++) {
     863             :     int c;
     864             :     for (c = 0; c < bs; ++c) {
     865             :       const uint16_t pixels[] = { left[r], right_pred };
     866             :       const uint8_t weights[] = { sm_weights[c], scale - sm_weights[c] };
     867             :       uint32_t this_pred = 0;
     868             :       assert(scale >= sm_weights[c]);
     869             :       int i;
     870             :       for (i = 0; i < 2; ++i) {
     871             :         this_pred += weights[i] * pixels[i];
     872             :       }
     873             :       dst[c] = clip_pixel_highbd(divide_round(this_pred, log2_scale), bd);
     874             :     }
     875             :     dst += stride;
     876             :   }
     877             : }
     878             : #endif
     879             : 
     880             : #else
     881             : static INLINE void highbd_tm_predictor(uint16_t *dst, ptrdiff_t stride, int bs,
     882             :                                        const uint16_t *above,
     883             :                                        const uint16_t *left, int bd) {
     884             :   int r, c;
     885             :   int ytop_left = above[-1];
     886             :   (void)bd;
     887             : 
     888             :   for (r = 0; r < bs; r++) {
     889             :     for (c = 0; c < bs; c++)
     890             :       dst[c] = clip_pixel_highbd(left[r] + above[c] - ytop_left, bd);
     891             :     dst += stride;
     892             :   }
     893             : }
     894             : #endif  // CONFIG_ALT_INTRA
     895             : 
     896           0 : static INLINE void highbd_dc_128_predictor(uint16_t *dst, ptrdiff_t stride,
     897             :                                            int bs, const uint16_t *above,
     898             :                                            const uint16_t *left, int bd) {
     899             :   int r;
     900             :   (void)above;
     901             :   (void)left;
     902             : 
     903           0 :   for (r = 0; r < bs; r++) {
     904           0 :     aom_memset16(dst, 128 << (bd - 8), bs);
     905           0 :     dst += stride;
     906             :   }
     907           0 : }
     908             : 
     909           0 : static INLINE void highbd_dc_left_predictor(uint16_t *dst, ptrdiff_t stride,
     910             :                                             int bs, const uint16_t *above,
     911             :                                             const uint16_t *left, int bd) {
     912           0 :   int i, r, expected_dc, sum = 0;
     913             :   (void)above;
     914             :   (void)bd;
     915             : 
     916           0 :   for (i = 0; i < bs; i++) sum += left[i];
     917           0 :   expected_dc = (sum + (bs >> 1)) / bs;
     918             : 
     919           0 :   for (r = 0; r < bs; r++) {
     920           0 :     aom_memset16(dst, expected_dc, bs);
     921           0 :     dst += stride;
     922             :   }
     923           0 : }
     924             : 
     925           0 : static INLINE void highbd_dc_top_predictor(uint16_t *dst, ptrdiff_t stride,
     926             :                                            int bs, const uint16_t *above,
     927             :                                            const uint16_t *left, int bd) {
     928           0 :   int i, r, expected_dc, sum = 0;
     929             :   (void)left;
     930             :   (void)bd;
     931             : 
     932           0 :   for (i = 0; i < bs; i++) sum += above[i];
     933           0 :   expected_dc = (sum + (bs >> 1)) / bs;
     934             : 
     935           0 :   for (r = 0; r < bs; r++) {
     936           0 :     aom_memset16(dst, expected_dc, bs);
     937           0 :     dst += stride;
     938             :   }
     939           0 : }
     940             : 
     941           0 : static INLINE void highbd_dc_predictor(uint16_t *dst, ptrdiff_t stride, int bs,
     942             :                                        const uint16_t *above,
     943             :                                        const uint16_t *left, int bd) {
     944           0 :   int i, r, expected_dc, sum = 0;
     945           0 :   const int count = 2 * bs;
     946             :   (void)bd;
     947             : 
     948           0 :   for (i = 0; i < bs; i++) {
     949           0 :     sum += above[i];
     950           0 :     sum += left[i];
     951             :   }
     952             : 
     953           0 :   expected_dc = (sum + (count >> 1)) / count;
     954             : 
     955           0 :   for (r = 0; r < bs; r++) {
     956           0 :     aom_memset16(dst, expected_dc, bs);
     957           0 :     dst += stride;
     958             :   }
     959           0 : }
     960             : #endif  // CONFIG_HIGHBITDEPTH
     961             : 
     962             : // This serves as a wrapper function, so that all the prediction functions
     963             : // can be unified and accessed as a pointer array. Note that the boundary
     964             : // above and left are not necessarily used all the time.
     965             : #define intra_pred_sized(type, size)                        \
     966             :   void aom_##type##_predictor_##size##x##size##_c(          \
     967             :       uint8_t *dst, ptrdiff_t stride, const uint8_t *above, \
     968             :       const uint8_t *left) {                                \
     969             :     type##_predictor(dst, stride, size, above, left);       \
     970             :   }
     971             : 
     972             : #if CONFIG_HIGHBITDEPTH
     973             : #define intra_pred_highbd_sized(type, size)                        \
     974             :   void aom_highbd_##type##_predictor_##size##x##size##_c(          \
     975             :       uint16_t *dst, ptrdiff_t stride, const uint16_t *above,      \
     976             :       const uint16_t *left, int bd) {                              \
     977             :     highbd_##type##_predictor(dst, stride, size, above, left, bd); \
     978             :   }
     979             : 
     980             : /* clang-format off */
     981             : #if CONFIG_TX64X64
     982             : #define intra_pred_allsizes(type) \
     983             :   intra_pred_sized(type, 2) \
     984             :   intra_pred_sized(type, 4) \
     985             :   intra_pred_sized(type, 8) \
     986             :   intra_pred_sized(type, 16) \
     987             :   intra_pred_sized(type, 32) \
     988             :   intra_pred_sized(type, 64) \
     989             :   intra_pred_highbd_sized(type, 2) \
     990             :   intra_pred_highbd_sized(type, 4) \
     991             :   intra_pred_highbd_sized(type, 8) \
     992             :   intra_pred_highbd_sized(type, 16) \
     993             :   intra_pred_highbd_sized(type, 32) \
     994             :   intra_pred_highbd_sized(type, 64)
     995             : 
     996             : #define intra_pred_above_4x4(type) \
     997             :   intra_pred_sized(type, 8) \
     998             :   intra_pred_sized(type, 16) \
     999             :   intra_pred_sized(type, 32) \
    1000             :   intra_pred_sized(type, 64) \
    1001             :   intra_pred_highbd_sized(type, 4) \
    1002             :   intra_pred_highbd_sized(type, 8) \
    1003             :   intra_pred_highbd_sized(type, 16) \
    1004             :   intra_pred_highbd_sized(type, 32) \
    1005             :   intra_pred_highbd_sized(type, 64)
    1006             : #else  // CONFIG_TX64X64
    1007             : #define intra_pred_allsizes(type) \
    1008             :   intra_pred_sized(type, 2) \
    1009             :   intra_pred_sized(type, 4) \
    1010             :   intra_pred_sized(type, 8) \
    1011             :   intra_pred_sized(type, 16) \
    1012             :   intra_pred_sized(type, 32) \
    1013             :   intra_pred_highbd_sized(type, 2) \
    1014             :   intra_pred_highbd_sized(type, 4) \
    1015             :   intra_pred_highbd_sized(type, 8) \
    1016             :   intra_pred_highbd_sized(type, 16) \
    1017             :   intra_pred_highbd_sized(type, 32)
    1018             : 
    1019             : #define intra_pred_above_4x4(type) \
    1020             :   intra_pred_sized(type, 8) \
    1021             :   intra_pred_sized(type, 16) \
    1022             :   intra_pred_sized(type, 32) \
    1023             :   intra_pred_highbd_sized(type, 4) \
    1024             :   intra_pred_highbd_sized(type, 8) \
    1025             :   intra_pred_highbd_sized(type, 16) \
    1026             :   intra_pred_highbd_sized(type, 32)
    1027             : #endif  // CONFIG_TX64X64
    1028             : 
    1029             : #else
    1030             : 
    1031             : #if CONFIG_TX64X64
    1032             : #define intra_pred_allsizes(type) \
    1033             :   intra_pred_sized(type, 2) \
    1034             :   intra_pred_sized(type, 4) \
    1035             :   intra_pred_sized(type, 8) \
    1036             :   intra_pred_sized(type, 16) \
    1037             :   intra_pred_sized(type, 32) \
    1038             :   intra_pred_sized(type, 64)
    1039             : 
    1040             : #define intra_pred_above_4x4(type) \
    1041             :   intra_pred_sized(type, 8) \
    1042             :   intra_pred_sized(type, 16) \
    1043             :   intra_pred_sized(type, 32) \
    1044             :   intra_pred_sized(type, 64)
    1045             : #else  // CONFIG_TX64X64
    1046             : #define intra_pred_allsizes(type) \
    1047             :   intra_pred_sized(type, 2) \
    1048             :   intra_pred_sized(type, 4) \
    1049             :   intra_pred_sized(type, 8) \
    1050             :   intra_pred_sized(type, 16) \
    1051             :   intra_pred_sized(type, 32)
    1052             : 
    1053             : #define intra_pred_above_4x4(type) \
    1054             :   intra_pred_sized(type, 8) \
    1055             :   intra_pred_sized(type, 16) \
    1056             :   intra_pred_sized(type, 32)
    1057             : #endif  // CONFIG_TX64X64
    1058             : #endif  // CONFIG_HIGHBITDEPTH
    1059             : 
    1060           0 : intra_pred_allsizes(d207e)
    1061           0 : intra_pred_allsizes(d63e)
    1062           0 : intra_pred_above_4x4(d45e)
    1063           0 : intra_pred_above_4x4(d117)
    1064           0 : intra_pred_above_4x4(d135)
    1065           0 : intra_pred_above_4x4(d153)
    1066           0 : intra_pred_allsizes(v)
    1067           0 : intra_pred_allsizes(h)
    1068             : #if CONFIG_ALT_INTRA
    1069           0 : intra_pred_allsizes(smooth)
    1070             : #if CONFIG_SMOOTH_HV
    1071             : intra_pred_allsizes(smooth_v)
    1072             : intra_pred_allsizes(smooth_h)
    1073             : #endif  // CONFIG_SMOOTH_HV
    1074           0 : intra_pred_allsizes(paeth)
    1075             : #else
    1076             : intra_pred_allsizes(tm)
    1077             : #endif  // CONFIG_ALT_INTRA
    1078           0 : intra_pred_allsizes(dc_128)
    1079           0 : intra_pred_allsizes(dc_left)
    1080           0 : intra_pred_allsizes(dc_top)
    1081           0 : intra_pred_allsizes(dc)
    1082             : /* clang-format on */
    1083             : #undef intra_pred_allsizes

Generated by: LCOV version 1.13