Commit f9d9b2b7 authored by Paul Wilkins's avatar Paul Wilkins Committed by Gerrit Code Review
Browse files

Merge "invoke macro removal encodemb" into experimental

parents 23f038a1 1838d877
...@@ -253,7 +253,7 @@ typedef struct { ...@@ -253,7 +253,7 @@ typedef struct {
union b_mode_info bmi[16]; union b_mode_info bmi[16];
} MODE_INFO; } MODE_INFO;
typedef struct { typedef struct blockd {
short *qcoeff; short *qcoeff;
short *dqcoeff; short *dqcoeff;
unsigned char *predictor; unsigned char *predictor;
...@@ -275,7 +275,7 @@ typedef struct { ...@@ -275,7 +275,7 @@ typedef struct {
union b_mode_info bmi; union b_mode_info bmi;
} BLOCKD; } BLOCKD;
typedef struct MacroBlockD { typedef struct macroblockd {
DECLARE_ALIGNED(16, short, diff[400]); /* from idct diff */ DECLARE_ALIGNED(16, short, diff[400]); /* from idct diff */
DECLARE_ALIGNED(16, unsigned char, predictor[384]); DECLARE_ALIGNED(16, unsigned char, predictor[384]);
DECLARE_ALIGNED(16, short, qcoeff[400]); DECLARE_ALIGNED(16, short, qcoeff[400]);
......
...@@ -81,22 +81,22 @@ typedef void loop_filter_uvfunction ...@@ -81,22 +81,22 @@ typedef void loop_filter_uvfunction
/* assorted loopfilter functions which get used elsewhere */ /* assorted loopfilter functions which get used elsewhere */
struct VP8Common; struct VP8Common;
struct MacroBlockD; struct macroblockd;
void vp8_loop_filter_init(struct VP8Common *cm); void vp8_loop_filter_init(struct VP8Common *cm);
void vp8_loop_filter_frame_init(struct VP8Common *cm, void vp8_loop_filter_frame_init(struct VP8Common *cm,
struct MacroBlockD *mbd, struct macroblockd *mbd,
int default_filt_lvl); int default_filt_lvl);
void vp8_loop_filter_frame(struct VP8Common *cm, struct MacroBlockD *mbd); void vp8_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd);
void vp8_loop_filter_partial_frame(struct VP8Common *cm, void vp8_loop_filter_partial_frame(struct VP8Common *cm,
struct MacroBlockD *mbd, struct macroblockd *mbd,
int default_filt_lvl); int default_filt_lvl);
void vp8_loop_filter_frame_yonly(struct VP8Common *cm, void vp8_loop_filter_frame_yonly(struct VP8Common *cm,
struct MacroBlockD *mbd, struct macroblockd *mbd,
int default_filt_lvl); int default_filt_lvl);
void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi, void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi,
......
common_forward_decls() { common_forward_decls() {
cat <<EOF cat <<EOF
#include "vp8/common/blockd.h"
struct loop_filter_info;
struct blockd;
struct macroblockd;
struct loop_filter_info; struct loop_filter_info;
/* Encoder forward decls */
struct block;
struct macroblock;
struct variance_vtable;
/* Encoder forward decls */ /* Encoder forward decls */
struct variance_vtable; struct variance_vtable;
union int_mv; union int_mv;
...@@ -70,55 +77,55 @@ specialize vp8_recon2b sse2 ...@@ -70,55 +77,55 @@ specialize vp8_recon2b sse2
prototype void vp8_recon4b "unsigned char *pred_ptr, short *diff_ptr, unsigned char *dst_ptr, int stride" prototype void vp8_recon4b "unsigned char *pred_ptr, short *diff_ptr, unsigned char *dst_ptr, int stride"
specialize vp8_recon4b sse2 specialize vp8_recon4b sse2
prototype void vp8_recon_mb "MACROBLOCKD *x" prototype void vp8_recon_mb "struct macroblockd *x"
specialize vp8_recon_mb specialize vp8_recon_mb
prototype void vp8_recon_mby "MACROBLOCKD *x" prototype void vp8_recon_mby "struct macroblockd *x"
specialize vp8_recon_mby specialize vp8_recon_mby
prototype void vp8_build_intra_predictors_mby_s "MACROBLOCKD *x" prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_mby_s specialize vp8_build_intra_predictors_mby_s
prototype void vp8_build_intra_predictors_sby_s "MACROBLOCKD *x" prototype void vp8_build_intra_predictors_sby_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_sby_s; specialize vp8_build_intra_predictors_sby_s;
prototype void vp8_build_intra_predictors_sbuv_s "MACROBLOCKD *x" prototype void vp8_build_intra_predictors_sbuv_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_sbuv_s; specialize vp8_build_intra_predictors_sbuv_s;
prototype void vp8_build_intra_predictors_mby "MACROBLOCKD *x" prototype void vp8_build_intra_predictors_mby "struct macroblockd *x"
specialize vp8_build_intra_predictors_mby; specialize vp8_build_intra_predictors_mby;
prototype void vp8_build_comp_intra_predictors_mby "MACROBLOCKD *x" prototype void vp8_build_comp_intra_predictors_mby "struct macroblockd *x"
specialize vp8_build_comp_intra_predictors_mby; specialize vp8_build_comp_intra_predictors_mby;
prototype void vp8_build_intra_predictors_mby_s "MACROBLOCKD *x" prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_mby_s; specialize vp8_build_intra_predictors_mby_s;
prototype void vp8_build_intra_predictors_mbuv "MACROBLOCKD *x" prototype void vp8_build_intra_predictors_mbuv "struct macroblockd *x"
specialize vp8_build_intra_predictors_mbuv; specialize vp8_build_intra_predictors_mbuv;
prototype void vp8_build_intra_predictors_mbuv_s "MACROBLOCKD *x" prototype void vp8_build_intra_predictors_mbuv_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_mbuv_s; specialize vp8_build_intra_predictors_mbuv_s;
prototype void vp8_build_comp_intra_predictors_mbuv "MACROBLOCKD *x" prototype void vp8_build_comp_intra_predictors_mbuv "struct macroblockd *x"
specialize vp8_build_comp_intra_predictors_mbuv; specialize vp8_build_comp_intra_predictors_mbuv;
prototype void vp8_intra4x4_predict "BLOCKD *x, int b_mode, unsigned char *predictor" prototype void vp8_intra4x4_predict "struct blockd *x, int b_mode, unsigned char *predictor"
specialize vp8_intra4x4_predict; specialize vp8_intra4x4_predict;
prototype void vp8_comp_intra4x4_predict "BLOCKD *x, int b_mode, int second_mode, unsigned char *predictor" prototype void vp8_comp_intra4x4_predict "struct blockd *x, int b_mode, int second_mode, unsigned char *predictor"
specialize vp8_comp_intra4x4_predict; specialize vp8_comp_intra4x4_predict;
prototype void vp8_intra8x8_predict "BLOCKD *x, int b_mode, unsigned char *predictor" prototype void vp8_intra8x8_predict "struct blockd *x, int b_mode, unsigned char *predictor"
specialize vp8_intra8x8_predict; specialize vp8_intra8x8_predict;
prototype void vp8_comp_intra8x8_predict "BLOCKD *x, int b_mode, int second_mode, unsigned char *predictor" prototype void vp8_comp_intra8x8_predict "struct blockd *x, int b_mode, int second_mode, unsigned char *predictor"
specialize vp8_comp_intra8x8_predict; specialize vp8_comp_intra8x8_predict;
prototype void vp8_intra_uv4x4_predict "BLOCKD *x, int b_mode, unsigned char *predictor" prototype void vp8_intra_uv4x4_predict "struct blockd *x, int b_mode, unsigned char *predictor"
specialize vp8_intra_uv4x4_predict; specialize vp8_intra_uv4x4_predict;
prototype void vp8_comp_intra_uv4x4_predict "BLOCKD *x, int b_mode, int second_mode, unsigned char *predictor" prototype void vp8_comp_intra_uv4x4_predict "struct blockd *x, int b_mode, int second_mode, unsigned char *predictor"
specialize vp8_comp_intra_uv4x4_predict; specialize vp8_comp_intra_uv4x4_predict;
# #
...@@ -367,6 +374,30 @@ specialize vp8_sub_pixel_mse32x32 ...@@ -367,6 +374,30 @@ specialize vp8_sub_pixel_mse32x32
prototype unsigned int vp8_get_mb_ss "const short *" prototype unsigned int vp8_get_mb_ss "const short *"
specialize vp8_get_mb_ss mmx sse2 specialize vp8_get_mb_ss mmx sse2
# ENCODEMB INVOKE
prototype int vp8_mbblock_error "struct macroblock *mb, int dc"
specialize vp8_mbblock_error mmx sse2
vp8_mbblock_error_sse2=vp8_mbblock_error_xmm
prototype int vp8_block_error "short *coeff, short *dqcoeff, int block_size"
specialize vp8_block_error mmx sse2
vp8_block_error_sse2=vp8_block_error_xmm
prototype void vp8_subtract_b "struct block *be, struct blockd *bd, int pitch"
specialize vp8_subtract_b mmx sse2
prototype int vp8_mbuverror "struct macroblock *mb"
specialize vp8_mbuverror mmx sse2
vp8_mbuverror_sse2=vp8_mbuverror_xmm
prototype void vp8_subtract_b "struct block *be, struct blockd *bd, int pitch"
specialize vp8_subtract_b mmx sse2
prototype void vp8_subtract_mby "short *diff, unsigned char *src, unsigned char *pred, int stride"
specialize vp8_subtract_mby mmx sse2
prototype void vp8_subtract_mbuv "short *diff, unsigned char *usrc, unsigned char *vsrc, unsigned char *pred, int stride"
specialize vp8_subtract_mbuv mmx sse2
# #
# Structured Similarity (SSIM) # Structured Similarity (SSIM)
......
...@@ -24,7 +24,7 @@ typedef struct { ...@@ -24,7 +24,7 @@ typedef struct {
int offset; int offset;
} search_site; } search_site;
typedef struct { typedef struct block {
// 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries // 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries
short *src_diff; short *src_diff;
short *coeff; short *coeff;
...@@ -85,7 +85,7 @@ typedef struct { ...@@ -85,7 +85,7 @@ typedef struct {
int64_t txfm_rd_diff[NB_TXFM_MODES]; int64_t txfm_rd_diff[NB_TXFM_MODES];
} PICK_MODE_CONTEXT; } PICK_MODE_CONTEXT;
typedef struct { typedef struct macroblock {
DECLARE_ALIGNED(16, short, src_diff[400]); // 16x16 Y 8x8 U 8x8 V 4x4 2nd Y DECLARE_ALIGNED(16, short, src_diff[400]); // 16x16 Y 8x8 U 8x8 V 4x4 2nd Y
DECLARE_ALIGNED(16, short, coeff[400]); // 16x16 Y 8x8 U 8x8 V 4x4 2nd Y DECLARE_ALIGNED(16, short, coeff[400]); // 16x16 Y 8x8 U 8x8 V 4x4 2nd Y
DECLARE_ALIGNED(16, unsigned char, thismb[256]); // 16x16 Y DECLARE_ALIGNED(16, unsigned char, thismb[256]); // 16x16 Y
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include "vpx_ports/config.h" #include "vpx_ports/config.h"
#include "vpx_rtcd.h"
#include "vp8/common/idct.h" #include "vp8/common/idct.h"
#include "quantize.h" #include "quantize.h"
#include "vp8/common/reconintra.h" #include "vp8/common/reconintra.h"
...@@ -18,7 +19,6 @@ ...@@ -18,7 +19,6 @@
#include "dct.h" #include "dct.h"
#include "vp8/common/g_common.h" #include "vp8/common/g_common.h"
#include "encodeintra.h" #include "encodeintra.h"
#include "vpx_rtcd.h"
#if CONFIG_RUNTIME_CPU_DETECT #if CONFIG_RUNTIME_CPU_DETECT
#define IF_RTCD(x) (x) #define IF_RTCD(x) (x)
...@@ -70,7 +70,7 @@ void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd, ...@@ -70,7 +70,7 @@ void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd,
} }
#endif #endif
ENCODEMB_INVOKE(&rtcd->encodemb, subb)(be, b, 16); vp8_subtract_b(be, b, 16);
tx_type = get_tx_type(&x->e_mbd, b); tx_type = get_tx_type(&x->e_mbd, b);
if (tx_type != DCT_DCT) { if (tx_type != DCT_DCT) {
...@@ -109,8 +109,7 @@ void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) { ...@@ -109,8 +109,7 @@ void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
vp8_build_comp_intra_predictors_mby(xd); vp8_build_comp_intra_predictors_mby(xd);
#endif #endif
ENCODEMB_INVOKE(&rtcd->encodemb, submby)(x->src_diff, *(b->base_src), vp8_subtract_mby(x->src_diff, *(b->base_src), xd->predictor, b->src_stride);
xd->predictor, b->src_stride);
if (tx_size == TX_16X16) { if (tx_size == TX_16X16) {
BLOCKD *bd = &xd->block[0]; BLOCKD *bd = &xd->block[0];
...@@ -159,9 +158,9 @@ void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) { ...@@ -159,9 +158,9 @@ void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
} }
#endif #endif
ENCODEMB_INVOKE(&rtcd->encodemb, submbuv)(x->src_diff, vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer,
x->src.u_buffer, x->src.v_buffer, xd->predictor, x->src.uv_stride);
xd->predictor, x->src.uv_stride);
if (tx_size == TX_4X4) { if (tx_size == TX_4X4) {
vp8_transform_mbuv_4x4(x); vp8_transform_mbuv_4x4(x);
vp8_quantize_mbuv_4x4(x); vp8_quantize_mbuv_4x4(x);
...@@ -221,7 +220,7 @@ void vp8_encode_intra8x8(const VP8_ENCODER_RTCD *rtcd, ...@@ -221,7 +220,7 @@ void vp8_encode_intra8x8(const VP8_ENCODER_RTCD *rtcd,
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
b = &xd->block[ib + iblock[i]]; b = &xd->block[ib + iblock[i]];
be = &x->block[ib + iblock[i]]; be = &x->block[ib + iblock[i]];
ENCODEMB_INVOKE(&rtcd->encodemb, subb)(be, b, 16); vp8_subtract_b(be, b, 16);
x->vp8_short_fdct4x4(be->src_diff, be->coeff, 32); x->vp8_short_fdct4x4(be->src_diff, be->coeff, 32);
x->quantize_b_4x4(be, b); x->quantize_b_4x4(be, b);
vp8_inverse_transform_b_4x4(IF_RTCD(&rtcd->common->idct), b, 32); vp8_inverse_transform_b_4x4(IF_RTCD(&rtcd->common->idct), b, 32);
...@@ -261,7 +260,7 @@ void vp8_encode_intra_uv4x4(const VP8_ENCODER_RTCD *rtcd, ...@@ -261,7 +260,7 @@ void vp8_encode_intra_uv4x4(const VP8_ENCODER_RTCD *rtcd,
} }
#endif #endif
ENCODEMB_INVOKE(&rtcd->encodemb, subb)(be, b, 8); vp8_subtract_b(be, b, 8);
x->vp8_short_fdct4x4(be->src_diff, be->coeff, 16); x->vp8_short_fdct4x4(be->src_diff, be->coeff, 16);
x->quantize_b_4x4(be, b); x->quantize_b_4x4(be, b);
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "vpx_mem/vpx_mem.h" #include "vpx_mem/vpx_mem.h"
#include "rdopt.h" #include "rdopt.h"
#include "vp8/common/systemdependent.h" #include "vp8/common/systemdependent.h"
#include "vpx_rtcd.h"
#if CONFIG_RUNTIME_CPU_DETECT #if CONFIG_RUNTIME_CPU_DETECT
#define IF_RTCD(x) (x) #define IF_RTCD(x) (x)
...@@ -126,8 +127,10 @@ void vp8_subtract_mby_c(short *diff, unsigned char *src, ...@@ -126,8 +127,10 @@ void vp8_subtract_mby_c(short *diff, unsigned char *src,
static void vp8_subtract_mb(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) { static void vp8_subtract_mb(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
BLOCK *b = &x->block[0]; BLOCK *b = &x->block[0];
ENCODEMB_INVOKE(&rtcd->encodemb, submby)(x->src_diff, *(b->base_src), x->e_mbd.predictor, b->src_stride); vp8_subtract_mby(x->src_diff, *(b->base_src), x->e_mbd.predictor,
ENCODEMB_INVOKE(&rtcd->encodemb, submbuv)(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->e_mbd.predictor, x->src.uv_stride); b->src_stride);
vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer,
x->e_mbd.predictor, x->src.uv_stride);
} }
static void build_dcblock_4x4(MACROBLOCK *x) { static void build_dcblock_4x4(MACROBLOCK *x) {
...@@ -942,8 +945,7 @@ void vp8_encode_inter16x16y(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) { ...@@ -942,8 +945,7 @@ void vp8_encode_inter16x16y(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
vp8_build_1st_inter16x16_predictors_mby(xd, xd->predictor, 16, 0); vp8_build_1st_inter16x16_predictors_mby(xd, xd->predictor, 16, 0);
ENCODEMB_INVOKE(&rtcd->encodemb, submby)(x->src_diff, *(b->base_src), vp8_subtract_mby(x->src_diff, *(b->base_src), xd->predictor, b->src_stride);
xd->predictor, b->src_stride);
vp8_transform_mby_4x4(x); vp8_transform_mby_4x4(x);
vp8_quantize_mby_4x4(x); vp8_quantize_mby_4x4(x);
......
...@@ -15,73 +15,6 @@ ...@@ -15,73 +15,6 @@
#include "vpx_ports/config.h" #include "vpx_ports/config.h"
#include "block.h" #include "block.h"
#define prototype_mberr(sym) \
int (sym)(MACROBLOCK *mb, int dc)
#define prototype_berr(sym) \
int (sym)(short *coeff, short *dqcoeff, int block_size)
#define prototype_mbuverr(sym) \
int (sym)(MACROBLOCK *mb)
#define prototype_subb(sym) \
void (sym)(BLOCK *be,BLOCKD *bd, int pitch)
#define prototype_submby(sym) \
void (sym)(short *diff, unsigned char *src, unsigned char *pred, int stride)
#define prototype_submbuv(sym) \
void (sym)(short *diff, unsigned char *usrc, unsigned char *vsrc,\
unsigned char *pred, int stride)
#if ARCH_X86 || ARCH_X86_64
#include "x86/encodemb_x86.h"
#endif
#if ARCH_ARM
#include "arm/encodemb_arm.h"
#endif
#ifndef vp8_encodemb_berr
#define vp8_encodemb_berr vp8_block_error_c
#endif
extern prototype_berr(vp8_encodemb_berr);
#ifndef vp8_encodemb_mberr
#define vp8_encodemb_mberr vp8_mbblock_error_c
#endif
extern prototype_mberr(vp8_encodemb_mberr);
#ifndef vp8_encodemb_mbuverr
#define vp8_encodemb_mbuverr vp8_mbuverror_c
#endif
extern prototype_mbuverr(vp8_encodemb_mbuverr);
#ifndef vp8_encodemb_subb
#define vp8_encodemb_subb vp8_subtract_b_c
#endif
extern prototype_subb(vp8_encodemb_subb);
#ifndef vp8_encodemb_submby
#define vp8_encodemb_submby vp8_subtract_mby_c
#endif
extern prototype_submby(vp8_encodemb_submby);
#ifndef vp8_encodemb_submbuv
#define vp8_encodemb_submbuv vp8_subtract_mbuv_c
#endif
extern prototype_submbuv(vp8_encodemb_submbuv);
typedef struct {
prototype_berr(*berr);
prototype_mberr(*mberr);
prototype_mbuverr(*mbuverr);
prototype_subb(*subb);
prototype_submby(*submby);
prototype_submbuv(*submbuv);
} vp8_encodemb_rtcd_vtable_t;
typedef struct { typedef struct {
MB_PREDICTION_MODE mode; MB_PREDICTION_MODE mode;
MV_REFERENCE_FRAME ref_frame; MV_REFERENCE_FRAME ref_frame;
......
...@@ -32,14 +32,6 @@ void vp8_cmachine_specific_config(VP8_COMP *cpi) { ...@@ -32,14 +32,6 @@ void vp8_cmachine_specific_config(VP8_COMP *cpi) {
cpi->rtcd.fdct.fast4x4 = vp8_short_fdct4x4_c; cpi->rtcd.fdct.fast4x4 = vp8_short_fdct4x4_c;
cpi->rtcd.fdct.fast8x4 = vp8_short_fdct8x4_c; cpi->rtcd.fdct.fast8x4 = vp8_short_fdct8x4_c;
cpi->rtcd.fdct.walsh_short4x4 = vp8_short_walsh4x4_c; cpi->rtcd.fdct.walsh_short4x4 = vp8_short_walsh4x4_c;
cpi->rtcd.encodemb.berr = vp8_block_error_c;
cpi->rtcd.encodemb.mberr = vp8_mbblock_error_c;
cpi->rtcd.encodemb.mbuverr = vp8_mbuverror_c;
cpi->rtcd.encodemb.subb = vp8_subtract_b_c;
cpi->rtcd.encodemb.submby = vp8_subtract_mby_c;
cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_c;
cpi->rtcd.search.full_search = vp8_full_search_sad; cpi->rtcd.search.full_search = vp8_full_search_sad;
cpi->rtcd.search.refining_search = vp8_refining_search_sad; cpi->rtcd.search.refining_search = vp8_refining_search_sad;
cpi->rtcd.search.diamond_search = vp8_diamond_search_sad; cpi->rtcd.search.diamond_search = vp8_diamond_search_sad;
......
...@@ -351,7 +351,6 @@ typedef struct { ...@@ -351,7 +351,6 @@ typedef struct {
typedef struct VP8_ENCODER_RTCD { typedef struct VP8_ENCODER_RTCD {
VP8_COMMON_RTCD *common; VP8_COMMON_RTCD *common;
vp8_fdct_rtcd_vtable_t fdct; vp8_fdct_rtcd_vtable_t fdct;
vp8_encodemb_rtcd_vtable_t encodemb;
vp8_search_rtcd_vtable_t search; vp8_search_rtcd_vtable_t search;
vp8_temporal_rtcd_vtable_t temporal; vp8_temporal_rtcd_vtable_t temporal;
} VP8_ENCODER_RTCD; } VP8_ENCODER_RTCD;
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "vp8/common/seg_common.h" #include "vp8/common/seg_common.h"
#include "vp8/common/pred_common.h" #include "vp8/common/pred_common.h"
#include "vp8/common/entropy.h" #include "vp8/common/entropy.h"
#include "vpx_rtcd.h"
#if CONFIG_NEWBESTREFMV #if CONFIG_NEWBESTREFMV
#include "vp8/common/mvref_common.h" #include "vp8/common/mvref_common.h"
#endif #endif
...@@ -710,11 +710,8 @@ static void macro_block_yrd_4x4(MACROBLOCK *mb, ...@@ -710,11 +710,8 @@ static void macro_block_yrd_4x4(MACROBLOCK *mb,
BLOCK *beptr; BLOCK *beptr;
int d; int d;
ENCODEMB_INVOKE(&rtcd->encodemb, submby)( vp8_subtract_mby(mb->src_diff, *(mb->block[0].base_src), xd->predictor,
mb->src_diff, mb->block[0].src_stride);
*(mb->block[0].base_src),
xd->predictor,
mb->block[0].src_stride);
// Fdct and building the 2nd order block // Fdct and building the 2nd order block
for (beptr = mb->block; beptr < mb->block + 16; beptr += 2) { for (beptr = mb->block; beptr < mb->block + 16; beptr += 2) {
...@@ -735,9 +732,9 @@ static void macro_block_yrd_4x4(MACROBLOCK *mb, ...@@ -735,9 +732,9 @@ static void macro_block_yrd_4x4(MACROBLOCK *mb,
mb->quantize_b_4x4(mb_y2, x_y2); mb->quantize_b_4x4(mb_y2, x_y2);
// Distortion // Distortion
d = ENCODEMB_INVOKE(&rtcd->encodemb, mberr)(mb, 1); vp8_mbblock_error(mb, 1);
d += ENCODEMB_INVOKE(&rtcd->encodemb, berr)(mb_y2->coeff, x_y2->dqcoeff, 16); d += vp8_block_error(mb_y2->coeff, x_y2->dqcoeff, 16);
*Distortion = (d >> 2); *Distortion = (d >> 2);
// rate // rate
...@@ -784,11 +781,8 @@ static void macro_block_yrd_8x8(MACROBLOCK *mb, ...@@ -784,11 +781,8 @@ static void macro_block_yrd_8x8(MACROBLOCK *mb,
BLOCKD *const x_y2 = xd->block + 24; BLOCKD *const x_y2 = xd->block + 24;
int d; int d;
ENCODEMB_INVOKE(&rtcd->encodemb, submby)( vp8_subtract_mby(mb->src_diff, *(mb->block[0].base_src), xd->predictor,
mb->src_diff, mb->block[0].src_stride);
*(mb->block[0].base_src),
xd->predictor,
mb->block[0].src_stride);
vp8_transform_mby_8x8(mb); vp8_transform_mby_8x8(mb);
vp8_quantize_mby_8x8(mb); vp8_quantize_mby_8x8(mb);
...@@ -803,8 +797,8 @@ static void macro_block_yrd_8x8(MACROBLOCK *mb, ...@@ -803,8 +797,8 @@ static void macro_block_yrd_8x8(MACROBLOCK *mb,
xd->dqcoeff[128] = 0; xd->dqcoeff[128] = 0;
xd->dqcoeff[192] = 0; xd->dqcoeff[192] = 0;
d = ENCODEMB_INVOKE(&rtcd->encodemb, mberr)(mb, 0); d = vp8_mbblock_error(mb, 0);
d += ENCODEMB_INVOKE(&rtcd->encodemb, berr)(mb_y2->coeff, x_y2->dqcoeff, 16); d += vp8_block_error(mb_y2->coeff, x_y2->dqcoeff, 16);
*Distortion = (d >> 2); *Distortion = (d >> 2);
// rate // rate
...@@ -836,11 +830,8 @@ static void macro_block_yrd_16x16(MACROBLOCK *mb, int *Rate, int *Distortion, ...@@ -836,11 +830,8 @@ static void macro_block_yrd_16x16(MACROBLOCK *mb, int *Rate, int *Distortion,
BLOCK *be = &mb->block[0]; BLOCK *be = &mb->block[0];
TX_TYPE tx_type; TX_TYPE tx_type;
ENCODEMB_INVOKE(&rtcd->encodemb, submby)( vp8_subtract_mby(mb->src_diff, *(mb->block[0].base_src), mb->e_mbd.predictor,
mb->src_diff, mb->block[0].src_stride);
*(mb->block[0].base_src),
mb->e_mbd.predictor,
mb->block[0].src_stride);
tx_type = get_tx_type_16x16(xd, b); tx_type = get_tx_type_16x16(xd, b);
if (tx_type != DCT_DCT) { if (tx_type != DCT_DCT) {
...@@ -855,7 +846,7 @@ static void macro_block_yrd_16x16(MACROBLOCK *mb, int *Rate, int *Distortion, ...@@ -855,7 +846,7 @@ static void macro_block_yrd_16x16(MACROBLOCK *mb, int *Rate, int *Distortion,
if (mb->e_mbd.mode_info_context->mbmi.mode < I8X8_PRED) if (mb->e_mbd.mode_info_context->mbmi.mode < I8X8_PRED)
vp8_optimize_mby_16x16(mb, rtcd); vp8_optimize_mby_16x16(mb, rtcd);
d = ENCODEMB_INVOKE(&rtcd->encodemb, mberr)(mb, 0);