2010-05-18 17:58:33 +02:00
|
|
|
/*
|
2010-09-09 14:16:39 +02:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 17:58:33 +02:00
|
|
|
*
|
2010-06-18 18:39:21 +02:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-04 22:19:40 +02:00
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
2010-06-18 18:39:21 +02:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-04 22:19:40 +02:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 17:58:33 +02:00
|
|
|
*/
|
|
|
|
|
2015-10-01 00:44:37 +02:00
|
|
|
#include <string.h>
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-01-13 01:55:44 +01:00
|
|
|
#include "vpx_config.h"
|
2015-10-01 00:44:37 +02:00
|
|
|
#include "./vpx_dsp_rtcd.h"
|
2012-11-09 02:09:30 +01:00
|
|
|
#include "vp8_rtcd.h"
|
2012-01-13 01:55:44 +01:00
|
|
|
#include "blockd.h"
|
2016-07-02 01:17:04 +02:00
|
|
|
#include "reconintra4x4.h"
|
2016-07-27 23:19:20 +02:00
|
|
|
#include "vp8/common/common.h"
|
|
|
|
#include "vpx_ports/mem.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2015-10-01 00:44:37 +02:00
|
|
|
typedef void (*intra_pred_fn)(uint8_t *dst, ptrdiff_t stride,
|
|
|
|
const uint8_t *above, const uint8_t *left);
|
|
|
|
|
|
|
|
static intra_pred_fn pred[10];
|
|
|
|
|
2016-07-14 07:26:28 +02:00
|
|
|
void vp8_init_intra4x4_predictors_internal(void) {
|
|
|
|
pred[B_DC_PRED] = vpx_dc_predictor_4x4;
|
|
|
|
pred[B_TM_PRED] = vpx_tm_predictor_4x4;
|
|
|
|
pred[B_VE_PRED] = vpx_ve_predictor_4x4;
|
|
|
|
pred[B_HE_PRED] = vpx_he_predictor_4x4;
|
|
|
|
pred[B_LD_PRED] = vpx_d45e_predictor_4x4;
|
|
|
|
pred[B_RD_PRED] = vpx_d135_predictor_4x4;
|
|
|
|
pred[B_VR_PRED] = vpx_d117_predictor_4x4;
|
2017-03-25 03:22:41 +01:00
|
|
|
pred[B_VL_PRED] = vpx_d63e_predictor_4x4;
|
2016-07-14 07:26:28 +02:00
|
|
|
pred[B_HD_PRED] = vpx_d153_predictor_4x4;
|
|
|
|
pred[B_HU_PRED] = vpx_d207_predictor_4x4;
|
2015-10-01 00:44:37 +02:00
|
|
|
}
|
|
|
|
|
2016-07-14 07:26:28 +02:00
|
|
|
void vp8_intra4x4_predict(unsigned char *above, unsigned char *yleft,
|
|
|
|
int left_stride, B_PREDICTION_MODE b_mode,
|
2015-10-01 00:44:37 +02:00
|
|
|
unsigned char *dst, int dst_stride,
|
2016-07-14 07:26:28 +02:00
|
|
|
unsigned char top_left) {
|
|
|
|
unsigned char Aboveb[12], *Above = Aboveb + 4;
|
2016-07-27 23:19:20 +02:00
|
|
|
#if HAVE_NEON
|
|
|
|
// Neon intrinsics are unable to load 32 bits, or 4 8 bit values. Instead, it
|
|
|
|
// over reads but does not use the extra 4 values.
|
|
|
|
unsigned char Left[8];
|
|
|
|
#if VPX_WITH_ASAN
|
|
|
|
// Silence an 'uninitialized read' warning. Although uninitialized values are
|
|
|
|
// indeed read, they are not used.
|
|
|
|
vp8_zero_array(Left, 8);
|
|
|
|
#endif // VPX_WITH_ASAN
|
|
|
|
#else
|
|
|
|
unsigned char Left[4];
|
|
|
|
#endif // HAVE_NEON
|
2016-07-14 07:26:28 +02:00
|
|
|
|
|
|
|
Left[0] = yleft[0];
|
|
|
|
Left[1] = yleft[left_stride];
|
|
|
|
Left[2] = yleft[2 * left_stride];
|
|
|
|
Left[3] = yleft[3 * left_stride];
|
|
|
|
memcpy(Above, above, 8);
|
|
|
|
Above[-1] = top_left;
|
|
|
|
|
|
|
|
pred[b_mode](dst, dst_stride, Above, Left);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|