vp9_reconintra4x4.c 15.1 KB
Newer Older
John Koleszar's avatar
John Koleszar committed
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar's avatar
John Koleszar committed
3
 *
4
 *  Use of this source code is governed by a BSD-style license
5
6
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
7
 *  in the file PATENTS.  All contributing project authors may
8
 *  be found in the AUTHORS file in the root of the source tree.
John Koleszar's avatar
John Koleszar committed
9
10
11
 */


12
#include "./vpx_config.h"
John Koleszar's avatar
John Koleszar committed
13
#include "vpx_mem/vpx_mem.h"
14
#include "vp9/common/vp9_reconintra.h"
15
#include "vp9_rtcd.h"
John Koleszar's avatar
John Koleszar committed
16

17
#if CONFIG_NEWBINTRAMODES
18
static int find_grad_measure(uint8_t *x, int stride, int n, int tx, int ty,
19
20
21
22
                             int dx, int dy) {
  int i, j;
  int count = 0, gsum = 0, gdiv;
  /* TODO: Make this code more efficient by breaking up into two loops */
23
24
  for (i = -ty; i < n; ++i)
    for (j = -tx; j < n; ++j) {
25
26
27
      int g;
      if (i >= 0 && j >= 0) continue;
      if (i + dy >= 0 && j + dx >= 0) continue;
28
      if (i + dy < -ty || i + dy >= n || j + dx < -tx || j + dx >= n) continue;
29
30
31
32
33
34
35
36
37
      g = abs(x[(i + dy) * stride + j + dx] - x[i * stride + j]);
      gsum += g * g;
      count++;
    }
  gdiv = (dx * dx + dy * dy) * count;
  return ((gsum << 8) + (gdiv >> 1)) / gdiv;
}

#if CONTEXT_PRED_REPLACEMENTS == 6
38
B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr,
39
40
                                              int stride, int n,
                                              int tx, int ty) {
41
  int g[8], i, imin, imax;
42
43
44
45
46
47
  g[1] = find_grad_measure(ptr, stride, n, tx, ty,  2, 1);
  g[2] = find_grad_measure(ptr, stride, n, tx, ty,  1, 1);
  g[3] = find_grad_measure(ptr, stride, n, tx, ty,  1, 2);
  g[5] = find_grad_measure(ptr, stride, n, tx, ty, -1, 2);
  g[6] = find_grad_measure(ptr, stride, n, tx, ty, -1, 1);
  g[7] = find_grad_measure(ptr, stride, n, tx, ty, -2, 1);
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  imin = 1;
  for (i = 2; i < 8; i += 1 + (i == 3))
    imin = (g[i] < g[imin] ? i : imin);
  imax = 1;
  for (i = 2; i < 8; i += 1 + (i == 3))
    imax = (g[i] > g[imax] ? i : imax);
  /*
  printf("%d %d %d %d %d %d = %d %d\n",
         g[1], g[2], g[3], g[5], g[6], g[7], imin, imax);
         */
  switch (imin) {
    case 1:
      return B_HD_PRED;
    case 2:
      return B_RD_PRED;
    case 3:
      return B_VR_PRED;
    case 5:
      return B_VL_PRED;
    case 6:
      return B_LD_PRED;
    case 7:
      return B_HU_PRED;
    default:
      assert(0);
  }
}
#elif CONTEXT_PRED_REPLACEMENTS == 4
76
B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr,
77
78
                                              int stride, int n,
                                              int tx, int ty) {
79
  int g[8], i, imin, imax;
80
81
82
83
  g[1] = find_grad_measure(ptr, stride, n, tx, ty,  2, 1);
  g[3] = find_grad_measure(ptr, stride, n, tx, ty,  1, 2);
  g[5] = find_grad_measure(ptr, stride, n, tx, ty, -1, 2);
  g[7] = find_grad_measure(ptr, stride, n, tx, ty, -2, 1);
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
  imin = 1;
  for (i = 3; i < 8; i+=2)
    imin = (g[i] < g[imin] ? i : imin);
  imax = 1;
  for (i = 3; i < 8; i+=2)
    imax = (g[i] > g[imax] ? i : imax);
  /*
  printf("%d %d %d %d = %d %d\n",
         g[1], g[3], g[5], g[7], imin, imax);
         */
  switch (imin) {
    case 1:
      return B_HD_PRED;
    case 3:
      return B_VR_PRED;
    case 5:
      return B_VL_PRED;
    case 7:
      return B_HU_PRED;
    default:
      assert(0);
  }
}
#elif CONTEXT_PRED_REPLACEMENTS == 0
108
B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr,
109
110
                                              int stride, int n,
                                              int tx, int ty) {
Jim Bankoski's avatar
Jim Bankoski committed
111
  int g[8], i, imin, imax;
112
113
114
115
116
117
118
119
  g[0] = find_grad_measure(ptr, stride, n, tx, ty,  1, 0);
  g[1] = find_grad_measure(ptr, stride, n, tx, ty,  2, 1);
  g[2] = find_grad_measure(ptr, stride, n, tx, ty,  1, 1);
  g[3] = find_grad_measure(ptr, stride, n, tx, ty,  1, 2);
  g[4] = find_grad_measure(ptr, stride, n, tx, ty,  0, 1);
  g[5] = find_grad_measure(ptr, stride, n, tx, ty, -1, 2);
  g[6] = find_grad_measure(ptr, stride, n, tx, ty, -1, 1);
  g[7] = find_grad_measure(ptr, stride, n, tx, ty, -2, 1);
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
  imax = 0;
  for (i = 1; i < 8; i++)
    imax = (g[i] > g[imax] ? i : imax);
  imin = 0;
  for (i = 1; i < 8; i++)
    imin = (g[i] < g[imin] ? i : imin);

  switch (imin) {
    case 0:
      return B_HE_PRED;
    case 1:
      return B_HD_PRED;
    case 2:
      return B_RD_PRED;
    case 3:
      return B_VR_PRED;
    case 4:
      return B_VE_PRED;
    case 5:
      return B_VL_PRED;
    case 6:
      return B_LD_PRED;
    case 7:
      return B_HU_PRED;
    default:
      assert(0);
  }
}
#endif

150
151
152
153
B_PREDICTION_MODE vp9_find_bpred_context(MACROBLOCKD *xd, BLOCKD *x) {
  const int block_idx = x - xd->block;
  const int have_top = (block_idx >> 2) || xd->up_available;
  const int have_left = (block_idx & 3)  || xd->left_available;
154
  uint8_t *ptr = *(x->base_dst) + x->dst;
155
  int stride = x->dst_stride;
156
157
158
159
160
  int tx = have_left ? 4 : 0;
  int ty = have_top ? 4 : 0;
  if (!have_left && !have_top)
    return B_DC_PRED;
  return vp9_find_dominant_direction(ptr, stride, 4, tx, ty);
161
162
163
}
#endif

164
165
void vp9_intra4x4_predict(MACROBLOCKD *xd,
                          BLOCKD *x,
166
                          int b_mode,
167
                          uint8_t *predictor) {
John Koleszar's avatar
John Koleszar committed
168
  int i, r, c;
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
  const int block_idx = x - xd->block;
  const int have_top = (block_idx >> 2) || xd->up_available;
  const int have_left = (block_idx & 3)  || xd->left_available;
  const int have_right = (block_idx & 3) != 3 || xd->right_available;
  uint8_t left[4], above[8], top_left;
  /*
   * 127 127 127 .. 127 127 127 127 127 127
   * 129  A   B  ..  Y   Z
   * 129  C   D  ..  W   X
   * 129  E   F  ..  U   V
   * 129  G   H  ..  S   T   T   T   T   T
   *  ..
   */

  if (have_left) {
    uint8_t *left_ptr = *(x->base_dst) + x->dst - 1;
    const int stride = x->dst_stride;

    left[0] = left_ptr[0 * stride];
    left[1] = left_ptr[1 * stride];
    left[2] = left_ptr[2 * stride];
    left[3] = left_ptr[3 * stride];
  } else {
    left[0] = left[1] = left[2] = left[3] = 129;
  }

  if (have_top) {
    uint8_t *above_ptr = *(x->base_dst) + x->dst - x->dst_stride;
John Koleszar's avatar
John Koleszar committed
197

198
199
200
201
202
    if (have_left) {
      top_left = above_ptr[-1];
    } else {
      top_left = 127;
    }
John Koleszar's avatar
John Koleszar committed
203

204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
    above[0] = above_ptr[0];
    above[1] = above_ptr[1];
    above[2] = above_ptr[2];
    above[3] = above_ptr[3];
    if (((block_idx & 3) != 3) ||
        (have_right && block_idx == 3 &&
         ((xd->mb_index != 3 && xd->sb_index != 3) ||
          ((xd->mb_index & 1) == 0 && xd->sb_index == 3)))) {
      above[4] = above_ptr[4];
      above[5] = above_ptr[5];
      above[6] = above_ptr[6];
      above[7] = above_ptr[7];
    } else if (have_right) {
      uint8_t *above_right = above_ptr + 4;

      if (xd->sb_index == 3 && (xd->mb_index & 1))
        above_right -= 32 * x->dst_stride;
      if (xd->mb_index == 3)
        above_right -= 16 * x->dst_stride;
      above_right -= (block_idx & ~3) * x->dst_stride;

      /* use a more distant above-right (from closest available top-right
       * corner), but with a "localized DC" (similar'ish to TM-pred):
       *
       *  A   B   C   D   E   F   G   H
       *  I   J   K   L
       *  M   N   O   P
       *  Q   R   S   T
       *  U   V   W   X   x1  x2  x3  x4
       *
       * Where:
       * x1 = clip_pixel(E + X - D)
       * x2 = clip_pixel(F + X - D)
       * x3 = clip_pixel(G + X - D)
       * x4 = clip_pixel(H + X - D)
       *
       * This is applied anytime when we use a "distant" above-right edge
       * that is not immediately top-right to the block that we're going
       * to do intra prediction for.
       */
      above[4] = clip_pixel(above_right[0] + above_ptr[3] - above_right[-1]);
      above[5] = clip_pixel(above_right[1] + above_ptr[3] - above_right[-1]);
      above[6] = clip_pixel(above_right[2] + above_ptr[3] - above_right[-1]);
      above[7] = clip_pixel(above_right[3] + above_ptr[3] - above_right[-1]);
    } else {
      // extend edge
      above[4] = above[5] = above[6] = above[7] = above[3];
    }
  } else {
    above[0] = above[1] = above[2] = above[3] = 127;
    above[4] = above[5] = above[6] = above[7] = 127;
    top_left = 127;
  }
John Koleszar's avatar
John Koleszar committed
257

258
259
260
261
262
#if CONFIG_NEWBINTRAMODES
  if (b_mode == B_CONTEXT_PRED)
    b_mode = x->bmi.as_mode.context;
#endif

John Koleszar's avatar
John Koleszar committed
263
264
265
  switch (b_mode) {
    case B_DC_PRED: {
      int expected_dc = 0;
John Koleszar's avatar
John Koleszar committed
266

John Koleszar's avatar
John Koleszar committed
267
      for (i = 0; i < 4; i++) {
268
269
        expected_dc += above[i];
        expected_dc += left[i];
John Koleszar's avatar
John Koleszar committed
270
      }
John Koleszar's avatar
John Koleszar committed
271

John Koleszar's avatar
John Koleszar committed
272
273
274
275
276
      expected_dc = (expected_dc + 4) >> 3;

      for (r = 0; r < 4; r++) {
        for (c = 0; c < 4; c++) {
          predictor[c] = expected_dc;
John Koleszar's avatar
John Koleszar committed
277
        }
John Koleszar's avatar
John Koleszar committed
278
279
280

        predictor += 16;
      }
John Koleszar's avatar
John Koleszar committed
281
282
    }
    break;
John Koleszar's avatar
John Koleszar committed
283
284
285
286
    case B_TM_PRED: {
      /* prediction similar to true_motion prediction */
      for (r = 0; r < 4; r++) {
        for (c = 0; c < 4; c++) {
287
          predictor[c] = clip_pixel(above[c] - top_left + left[r]);
John Koleszar's avatar
John Koleszar committed
288
        }
John Koleszar's avatar
John Koleszar committed
289
290
291

        predictor += 16;
      }
John Koleszar's avatar
John Koleszar committed
292
293
294
    }
    break;

John Koleszar's avatar
John Koleszar committed
295
296
    case B_VE_PRED: {
      unsigned int ap[4];
297

298
299
300
301
      ap[0] = above[0];
      ap[1] = above[1];
      ap[2] = above[2];
      ap[3] = above[3];
John Koleszar's avatar
John Koleszar committed
302

John Koleszar's avatar
John Koleszar committed
303
304
305
      for (r = 0; r < 4; r++) {
        for (c = 0; c < 4; c++) {
          predictor[c] = ap[c];
John Koleszar's avatar
John Koleszar committed
306
307
        }

John Koleszar's avatar
John Koleszar committed
308
309
        predictor += 16;
      }
John Koleszar's avatar
John Koleszar committed
310
311
312
    }
    break;

John Koleszar's avatar
John Koleszar committed
313
314
    case B_HE_PRED: {
      unsigned int lp[4];
315

316
317
318
319
      lp[0] = left[0];
      lp[1] = left[1];
      lp[2] = left[2];
      lp[3] = left[3];
John Koleszar's avatar
John Koleszar committed
320

John Koleszar's avatar
John Koleszar committed
321
322
323
      for (r = 0; r < 4; r++) {
        for (c = 0; c < 4; c++) {
          predictor[c] = lp[r];
John Koleszar's avatar
John Koleszar committed
324
325
        }

John Koleszar's avatar
John Koleszar committed
326
327
        predictor += 16;
      }
John Koleszar's avatar
John Koleszar committed
328
329
    }
    break;
John Koleszar's avatar
John Koleszar committed
330
    case B_LD_PRED: {
331
332
      uint8_t *ptr = above;

John Koleszar's avatar
John Koleszar committed
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
      predictor[0 * 16 + 0] = (ptr[0] + ptr[1] * 2 + ptr[2] + 2) >> 2;
      predictor[0 * 16 + 1] =
        predictor[1 * 16 + 0] = (ptr[1] + ptr[2] * 2 + ptr[3] + 2) >> 2;
      predictor[0 * 16 + 2] =
        predictor[1 * 16 + 1] =
          predictor[2 * 16 + 0] = (ptr[2] + ptr[3] * 2 + ptr[4] + 2) >> 2;
      predictor[0 * 16 + 3] =
        predictor[1 * 16 + 2] =
          predictor[2 * 16 + 1] =
            predictor[3 * 16 + 0] = (ptr[3] + ptr[4] * 2 + ptr[5] + 2) >> 2;
      predictor[1 * 16 + 3] =
        predictor[2 * 16 + 2] =
          predictor[3 * 16 + 1] = (ptr[4] + ptr[5] * 2 + ptr[6] + 2) >> 2;
      predictor[2 * 16 + 3] =
        predictor[3 * 16 + 2] = (ptr[5] + ptr[6] * 2 + ptr[7] + 2) >> 2;
      predictor[3 * 16 + 3] = (ptr[6] + ptr[7] * 2 + ptr[7] + 2) >> 2;
John Koleszar's avatar
John Koleszar committed
349
350
351

    }
    break;
John Koleszar's avatar
John Koleszar committed
352
    case B_RD_PRED: {
353
      uint8_t pp[9];
John Koleszar's avatar
John Koleszar committed
354

355
356
357
358
      pp[0] = left[3];
      pp[1] = left[2];
      pp[2] = left[1];
      pp[3] = left[0];
John Koleszar's avatar
John Koleszar committed
359
      pp[4] = top_left;
360
361
362
363
      pp[5] = above[0];
      pp[6] = above[1];
      pp[7] = above[2];
      pp[8] = above[3];
John Koleszar's avatar
John Koleszar committed
364
365
366
367
368

      predictor[3 * 16 + 0] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;
      predictor[3 * 16 + 1] =
        predictor[2 * 16 + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
      predictor[3 * 16 + 2] =
John Koleszar's avatar
John Koleszar committed
369
        predictor[2 * 16 + 1] =
John Koleszar's avatar
John Koleszar committed
370
371
          predictor[1 * 16 + 0] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
      predictor[3 * 16 + 3] =
John Koleszar's avatar
John Koleszar committed
372
        predictor[2 * 16 + 2] =
John Koleszar's avatar
John Koleszar committed
373
374
375
376
377
378
379
380
          predictor[1 * 16 + 1] =
            predictor[0 * 16 + 0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
      predictor[2 * 16 + 3] =
        predictor[1 * 16 + 2] =
          predictor[0 * 16 + 1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
      predictor[1 * 16 + 3] =
        predictor[0 * 16 + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
      predictor[0 * 16 + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2;
John Koleszar's avatar
John Koleszar committed
381
382
383

    }
    break;
John Koleszar's avatar
John Koleszar committed
384
    case B_VR_PRED: {
385
      uint8_t pp[9];
John Koleszar's avatar
John Koleszar committed
386

387
388
389
390
      pp[0] = left[3];
      pp[1] = left[2];
      pp[2] = left[1];
      pp[3] = left[0];
John Koleszar's avatar
John Koleszar committed
391
      pp[4] = top_left;
392
393
394
395
      pp[5] = above[0];
      pp[6] = above[1];
      pp[7] = above[2];
      pp[8] = above[3];
John Koleszar's avatar
John Koleszar committed
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412

      predictor[3 * 16 + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
      predictor[2 * 16 + 0] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
      predictor[3 * 16 + 1] =
        predictor[1 * 16 + 0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
      predictor[2 * 16 + 1] =
        predictor[0 * 16 + 0] = (pp[4] + pp[5] + 1) >> 1;
      predictor[3 * 16 + 2] =
        predictor[1 * 16 + 1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
      predictor[2 * 16 + 2] =
        predictor[0 * 16 + 1] = (pp[5] + pp[6] + 1) >> 1;
      predictor[3 * 16 + 3] =
        predictor[1 * 16 + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
      predictor[2 * 16 + 3] =
        predictor[0 * 16 + 2] = (pp[6] + pp[7] + 1) >> 1;
      predictor[1 * 16 + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2;
      predictor[0 * 16 + 3] = (pp[7] + pp[8] + 1) >> 1;
John Koleszar's avatar
John Koleszar committed
413

John Koleszar's avatar
John Koleszar committed
414
415
416
    }
    break;
    case B_VL_PRED: {
417
      uint8_t *pp = above;
John Koleszar's avatar
John Koleszar committed
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434

      predictor[0 * 16 + 0] = (pp[0] + pp[1] + 1) >> 1;
      predictor[1 * 16 + 0] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;
      predictor[2 * 16 + 0] =
        predictor[0 * 16 + 1] = (pp[1] + pp[2] + 1) >> 1;
      predictor[1 * 16 + 1] =
        predictor[3 * 16 + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
      predictor[2 * 16 + 1] =
        predictor[0 * 16 + 2] = (pp[2] + pp[3] + 1) >> 1;
      predictor[3 * 16 + 1] =
        predictor[1 * 16 + 2] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
      predictor[0 * 16 + 3] =
        predictor[2 * 16 + 2] = (pp[3] + pp[4] + 1) >> 1;
      predictor[1 * 16 + 3] =
        predictor[3 * 16 + 2] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
      predictor[2 * 16 + 3] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
      predictor[3 * 16 + 3] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
John Koleszar's avatar
John Koleszar committed
435
436
437
    }
    break;

John Koleszar's avatar
John Koleszar committed
438
    case B_HD_PRED: {
439
440
      uint8_t pp[9];

441
442
443
444
      pp[0] = left[3];
      pp[1] = left[2];
      pp[2] = left[1];
      pp[3] = left[0];
John Koleszar's avatar
John Koleszar committed
445
      pp[4] = top_left;
446
447
448
449
      pp[5] = above[0];
      pp[6] = above[1];
      pp[7] = above[2];
      pp[8] = above[3];
John Koleszar's avatar
John Koleszar committed
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467


      predictor[3 * 16 + 0] = (pp[0] + pp[1] + 1) >> 1;
      predictor[3 * 16 + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;
      predictor[2 * 16 + 0] =
        predictor[3 * 16 + 2] = (pp[1] + pp[2] + 1) >> 1;
      predictor[2 * 16 + 1] =
        predictor[3 * 16 + 3] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
      predictor[2 * 16 + 2] =
        predictor[1 * 16 + 0] = (pp[2] + pp[3] + 1) >> 1;
      predictor[2 * 16 + 3] =
        predictor[1 * 16 + 1] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
      predictor[1 * 16 + 2] =
        predictor[0 * 16 + 0] = (pp[3] + pp[4] + 1) >> 1;
      predictor[1 * 16 + 3] =
        predictor[0 * 16 + 1] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
      predictor[0 * 16 + 2] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
      predictor[0 * 16 + 3] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
John Koleszar's avatar
John Koleszar committed
468
469
470
471
    }
    break;


John Koleszar's avatar
John Koleszar committed
472
    case B_HU_PRED: {
473
      uint8_t *pp = left;
John Koleszar's avatar
John Koleszar committed
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
      predictor[0 * 16 + 0] = (pp[0] + pp[1] + 1) >> 1;
      predictor[0 * 16 + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;
      predictor[0 * 16 + 2] =
        predictor[1 * 16 + 0] = (pp[1] + pp[2] + 1) >> 1;
      predictor[0 * 16 + 3] =
        predictor[1 * 16 + 1] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
      predictor[1 * 16 + 2] =
        predictor[2 * 16 + 0] = (pp[2] + pp[3] + 1) >> 1;
      predictor[1 * 16 + 3] =
        predictor[2 * 16 + 1] = (pp[2] + pp[3] * 2 + pp[3] + 2) >> 2;
      predictor[2 * 16 + 2] =
        predictor[2 * 16 + 3] =
          predictor[3 * 16 + 0] =
            predictor[3 * 16 + 1] =
              predictor[3 * 16 + 2] =
                predictor[3 * 16 + 3] = pp[3];
John Koleszar's avatar
John Koleszar committed
490
491
492
    }
    break;

493
494
495
496
497
#if CONFIG_NEWBINTRAMODES
    case B_CONTEXT_PRED:
    break;
    /*
    case B_CORNER_PRED:
498
    corner_predictor(predictor, 16, 4, above, left);
499
500
501
    break;
    */
#endif
John Koleszar's avatar
John Koleszar committed
502
  }
John Koleszar's avatar
John Koleszar committed
503
}