Line data Source code
1 : /*
2 : * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 : *
4 : * Use of this source code is governed by a BSD-style license
5 : * that can be found in the LICENSE file in the root of the source
6 : * 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.
9 : */
10 :
11 : #include <string.h>
12 :
13 : #include "vpx_config.h"
14 : #include "./vpx_dsp_rtcd.h"
15 : #include "vp8_rtcd.h"
16 : #include "blockd.h"
17 : #include "reconintra4x4.h"
18 : #include "vp8/common/common.h"
19 : #include "vpx_ports/mem.h"
20 :
21 : typedef void (*intra_pred_fn)(uint8_t *dst, ptrdiff_t stride,
22 : const uint8_t *above, const uint8_t *left);
23 :
24 : static intra_pred_fn pred[10];
25 :
26 0 : void vp8_init_intra4x4_predictors_internal(void) {
27 0 : pred[B_DC_PRED] = vpx_dc_predictor_4x4;
28 0 : pred[B_TM_PRED] = vpx_tm_predictor_4x4;
29 0 : pred[B_VE_PRED] = vpx_ve_predictor_4x4;
30 0 : pred[B_HE_PRED] = vpx_he_predictor_4x4;
31 0 : pred[B_LD_PRED] = vpx_d45e_predictor_4x4;
32 0 : pred[B_RD_PRED] = vpx_d135_predictor_4x4;
33 0 : pred[B_VR_PRED] = vpx_d117_predictor_4x4;
34 0 : pred[B_VL_PRED] = vpx_d63f_predictor_4x4;
35 0 : pred[B_HD_PRED] = vpx_d153_predictor_4x4;
36 0 : pred[B_HU_PRED] = vpx_d207_predictor_4x4;
37 0 : }
38 :
39 0 : void vp8_intra4x4_predict(unsigned char *above, unsigned char *yleft,
40 : int left_stride, B_PREDICTION_MODE b_mode,
41 : unsigned char *dst, int dst_stride,
42 : unsigned char top_left) {
43 0 : unsigned char Aboveb[12], *Above = Aboveb + 4;
44 : #if HAVE_NEON
45 : // Neon intrinsics are unable to load 32 bits, or 4 8 bit values. Instead, it
46 : // over reads but does not use the extra 4 values.
47 : unsigned char Left[8];
48 : #if VPX_WITH_ASAN
49 : // Silence an 'uninitialized read' warning. Although uninitialized values are
50 : // indeed read, they are not used.
51 : vp8_zero_array(Left, 8);
52 : #endif // VPX_WITH_ASAN
53 : #else
54 : unsigned char Left[4];
55 : #endif // HAVE_NEON
56 :
57 0 : Left[0] = yleft[0];
58 0 : Left[1] = yleft[left_stride];
59 0 : Left[2] = yleft[2 * left_stride];
60 0 : Left[3] = yleft[3 * left_stride];
61 0 : memcpy(Above, above, 8);
62 0 : Above[-1] = top_left;
63 :
64 0 : pred[b_mode](dst, dst_stride, Above, Left);
65 0 : }
|