Commit 7971846a authored by hui su's avatar hui su

Move intra prediction functions from vp9/common/ to vpx_dsp/

Change-Id: I64edc26cf4aab050c83f2d393df6250628ad43b8
parent 55c6a74b
......@@ -319,6 +319,8 @@ EOF
print <<EOF;
#if HAVE_DSPR2
void vpx_dsputil_static_init();
vpx_dsputil_static_init();
#if CONFIG_VP8
void dsputil_static_init();
dsputil_static_init();
......
......@@ -14,7 +14,7 @@
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/md5_helper.h"
......
......@@ -16,7 +16,7 @@
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#include "./vp9_rtcd.h"
#include "./vpx_dsp_rtcd.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_pred_common.h"
#include "vpx_mem/vpx_mem.h"
......
......@@ -44,20 +44,6 @@ static INLINE int get_unsigned_bits(unsigned int num_values) {
return num_values > 0 ? get_msb(num_values) + 1 : 0;
}
#if CONFIG_VP9_HIGHBITDEPTH
static INLINE uint16_t clip_pixel_highbd(int val, int bd) {
switch (bd) {
case 8:
default:
return (uint16_t)clamp(val, 0, 255);
case 10:
return (uint16_t)clamp(val, 0, 1023);
case 12:
return (uint16_t)clamp(val, 0, 4095);
}
}
#endif // CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_DEBUG
#define CHECK_MEM_ERROR(cm, lval, expr) do { \
lval = (expr); \
......
This diff is collapsed.
This diff is collapsed.
......@@ -84,16 +84,11 @@ endif
ifeq ($(CONFIG_USE_X86INC),yes)
VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_copy_sse2.asm
VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_intrapred_sse2.asm
VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_intrapred_ssse3.asm
endif
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_high_subpixel_8t_sse2.asm
VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_high_subpixel_bilinear_sse2.asm
ifeq ($(CONFIG_USE_X86INC),yes)
VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_high_intrapred_sse2.asm
endif
endif
# common (c)
......@@ -108,9 +103,6 @@ VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_avg_horiz_dspr
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_horiz_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_vert_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_intrapred4_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_intrapred8_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_intrapred16_dspr2.c
ifneq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_itrans4_dspr2.c
......@@ -135,7 +127,6 @@ VP9_COMMON_SRCS-$(HAVE_MSA) += common/mips/msa/vp9_idct8x8_msa.c
VP9_COMMON_SRCS-$(HAVE_MSA) += common/mips/msa/vp9_idct16x16_msa.c
VP9_COMMON_SRCS-$(HAVE_MSA) += common/mips/msa/vp9_idct32x32_msa.c
VP9_COMMON_SRCS-$(HAVE_MSA) += common/mips/msa/vp9_idct_msa.h
VP9_COMMON_SRCS-$(HAVE_MSA) += common/mips/msa/vp9_intra_predict_msa.c
ifeq ($(CONFIG_VP9_POSTPROC),yes)
VP9_COMMON_SRCS-$(HAVE_MSA) += common/mips/msa/vp9_mfqe_msa.c
......@@ -174,7 +165,6 @@ VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct4x4_1_add_neon_asm$(ASM)
VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct4x4_add_neon_asm$(ASM)
VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct8x8_1_add_neon_asm$(ASM)
VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct8x8_add_neon_asm$(ASM)
VP9_COMMON_SRCS-yes += common/arm/neon/vp9_reconintra_neon_asm$(ASM)
else
ifeq ($(HAVE_NEON), yes)
VP9_COMMON_SRCS-yes += common/arm/neon/vp9_convolve8_avg_neon.c
......@@ -194,6 +184,4 @@ VP9_COMMON_SRCS-yes += common/arm/neon/vp9_idct8x8_add_neon.c
endif # HAVE_NEON
endif # HAVE_NEON_ASM
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_reconintra_neon.c
$(eval $(call rtcd_h_template,vp9_rtcd,vp9/common/vp9_rtcd_defs.pl))
......@@ -10,8 +10,8 @@
#include <arm_neon.h>
#include "./vp9_rtcd.h"
#include "./vpx_config.h"
#include "./vpx_dsp_rtcd.h"
#include "vpx/vpx_integer.h"
//------------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -21,6 +21,8 @@ extern "C" {
#if HAVE_DSPR2
#define CROP_WIDTH 512
extern uint8_t *vpx_ff_cropTbl; // From "vpx_dsp/mips/intrapred4_dspr2.c"
static INLINE void prefetch_load(const unsigned char *src) {
__asm__ __volatile__ (
"pref 0, 0(%[src]) \n\t"
......
/*
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
* Copyright (c) 2015 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
......@@ -7,11 +7,8 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <stdlib.h>
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_common.h"
#include "vp9/common/mips/dspr2/vp9_common_dspr2.h"
#include "vpx_dsp/mips/common_dspr2.h"
#if HAVE_DSPR2
void vp9_h_predictor_16x16_dspr2(uint8_t *dst, ptrdiff_t stride,
......
/*
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
* Copyright (c) 2015 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
......@@ -7,13 +7,26 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <stdlib.h>
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_common.h"
#include "vp9/common/mips/dspr2/vp9_common_dspr2.h"
#include "vpx_dsp/mips/common_dspr2.h"
#if HAVE_DSPR2
uint8_t vpx_ff_cropTbl_a[256 + 2 * CROP_WIDTH];
uint8_t *vpx_ff_cropTbl;
void vpx_dsputil_static_init(void) {
int i;
for (i = 0; i < 256; i++) vpx_ff_cropTbl_a[i + CROP_WIDTH] = i;
for (i = 0; i < CROP_WIDTH; i++) {
vpx_ff_cropTbl_a[i] = 0;
vpx_ff_cropTbl_a[i + CROP_WIDTH + 256] = 255;
}
vpx_ff_cropTbl = &vpx_ff_cropTbl_a[CROP_WIDTH];
}
void vp9_h_predictor_4x4_dspr2(uint8_t *dst, ptrdiff_t stride,
const uint8_t *above, const uint8_t *left) {
int32_t tmp1, tmp2, tmp3, tmp4;
......@@ -91,7 +104,7 @@ void vp9_tm_predictor_4x4_dspr2(uint8_t *dst, ptrdiff_t stride,
int32_t resl;
int32_t resr;
int32_t top_left;
uint8_t *cm = vp9_ff_cropTbl;
uint8_t *cm = vpx_ff_cropTbl;
__asm__ __volatile__ (
"ulw %[resl], (%[above]) \n\t"
......
/*
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
* Copyright (c) 2015 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
......@@ -7,11 +7,8 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <stdlib.h>
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_common.h"
#include "vp9/common/mips/dspr2/vp9_common_dspr2.h"
#include "vpx_dsp/mips/common_dspr2.h"
#if HAVE_DSPR2
void vp9_h_predictor_8x8_dspr2(uint8_t *dst, ptrdiff_t stride,
......@@ -161,7 +158,7 @@ void vp9_tm_predictor_8x8_dspr2(uint8_t *dst, ptrdiff_t stride,
int32_t res0, res1, res2, res3;
int32_t reshw;
int32_t top_left;
uint8_t *cm = vp9_ff_cropTbl;
uint8_t *cm = vpx_ff_cropTbl;
__asm__ __volatile__ (
"ulw %[reshw], (%[above]) \n\t"
......
......@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "./vp9_rtcd.h"
#include "./vpx_dsp_rtcd.h"
#include "vpx_dsp/mips/macros_msa.h"
#define IPRED_SUBS_UH2_UH(in0, in1, out0, out1) { \
......
......@@ -31,6 +31,27 @@ DSP_SRCS-yes += bitreader_buffer.c
DSP_SRCS-yes += bitreader_buffer.h
endif
# intra predictions
DSP_SRCS-yes += intrapred.c
ifeq ($(CONFIG_USE_X86INC),yes)
DSP_SRCS-$(HAVE_SSE2) += x86/intrapred_sse2.asm
DSP_SRCS-$(HAVE_SSSE3) += x86/intrapred_ssse3.asm
endif
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
ifeq ($(CONFIG_USE_X86INC),yes)
DSP_SRCS-$(HAVE_SSE2) += x86/highbd_intrapred_sse2.asm
endif
endif
DSP_SRCS-$(HAVE_NEON_ASM) += arm/intrapred_neon_asm$(ASM)
DSP_SRCS-$(HAVE_NEON) += arm/intrapred_neon.c
DSP_SRCS-$(HAVE_MSA) += mips/intrapred_msa.c
DSP_SRCS-$(HAVE_DSPR2) += mips/intrapred4_dspr2.c
DSP_SRCS-$(HAVE_DSPR2) += mips/intrapred8_dspr2.c
DSP_SRCS-$(HAVE_DSPR2) += mips/intrapred16_dspr2.c
# loop filters
DSP_SRCS-yes += loopfilter.c
......
......@@ -50,6 +50,20 @@ static INLINE double fclamp(double value, double low, double high) {
return value < low ? low : (value > high ? high : value);
}
#if CONFIG_VP9_HIGHBITDEPTH
static INLINE uint16_t clip_pixel_highbd(int val, int bd) {
switch (bd) {
case 8:
default:
return (uint16_t)clamp(val, 0, 255);
case 10:
return (uint16_t)clamp(val, 0, 1023);
case 12:
return (uint16_t)clamp(val, 0, 4095);
}
}
#endif // CONFIG_VP9_HIGHBITDEPTH
#ifdef __cplusplus
} // extern "C"
#endif
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment