From be8af188d025eb24426757952ca8756a9b6353ea Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Thu, 12 Jan 2012 16:55:44 -0800 Subject: [PATCH] RTCD: add block subtraction functions This commit continues the process of converting to the new RTCD system. Change-Id: Id8a287fdd4bd050ea4452e1582ad85520f3081be --- vp8/common/rtcd_defs.sh | 27 ++++++++ vp8/encoder/arm/arm_csystemdependent.c | 23 ------- vp8/encoder/arm/encodemb_arm.h | 64 ------------------- vp8/encoder/encodeintra.c | 6 +- vp8/encoder/encodemb.c | 6 +- vp8/encoder/encodemb.h | 82 ------------------------- vp8/encoder/generic/csystemdependent.c | 7 --- vp8/encoder/onyx_int.h | 1 - vp8/encoder/rdopt.c | 39 ++++++------ vp8/encoder/x86/encodemb_x86.h | 85 -------------------------- vp8/encoder/x86/x86_csystemdependent.c | 20 ------ vp8/vp8cx.mk | 1 - vp8/vp8cx_arm.mk | 1 - 13 files changed, 52 insertions(+), 310 deletions(-) delete mode 100644 vp8/encoder/arm/encodemb_arm.h delete mode 100644 vp8/encoder/x86/encodemb_x86.h diff --git a/vp8/common/rtcd_defs.sh b/vp8/common/rtcd_defs.sh index 952f3b58a..1bdddc14d 100644 --- a/vp8/common/rtcd_defs.sh +++ b/vp8/common/rtcd_defs.sh @@ -437,5 +437,32 @@ specialize vp8_quantize_mby neon prototype void vp8_quantize_mbuv "struct macroblock *" specialize vp8_quantize_mbuv neon +# +# Block subtraction +# +prototype int vp8_block_error "short *coeff, short *dqcoeff" +specialize vp8_block_error mmx sse2 +vp8_block_error_sse2=vp8_block_error_xmm + +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_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 media neon +vp8_subtract_b_media=vp8_subtract_b_armv6 + +prototype void vp8_subtract_mby "short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride" +specialize vp8_subtract_mby mmx sse2 media neon +vp8_subtract_mby_media=vp8_subtract_mby_armv6 + +prototype void vp8_subtract_mbuv "short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride" +specialize vp8_subtract_mbuv mmx sse2 media neon +vp8_subtract_mbuv_media=vp8_subtract_mbuv_armv6 + # End of encoder only functions fi diff --git a/vp8/encoder/arm/arm_csystemdependent.c b/vp8/encoder/arm/arm_csystemdependent.c index 2d7c959a6..963b9fd08 100644 --- a/vp8/encoder/arm/arm_csystemdependent.c +++ b/vp8/encoder/arm/arm_csystemdependent.c @@ -29,29 +29,6 @@ void vp8_arch_arm_encoder_init(VP8_COMP *cpi) } #endif -#if HAVE_MEDIA - if (flags & HAS_MEDIA) - { - /*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_armv6; - cpi->rtcd.encodemb.submby = vp8_subtract_mby_armv6; - cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_armv6; - } -#endif /* HAVE_MEDIA */ - -#if HAVE_NEON - if (flags & HAS_NEON) - { - /*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_neon; - cpi->rtcd.encodemb.submby = vp8_subtract_mby_neon; - cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_neon; - } -#endif /* HAVE_NEON */ #endif /* CONFIG_RUNTIME_CPU_DETECT */ #if HAVE_NEON diff --git a/vp8/encoder/arm/encodemb_arm.h b/vp8/encoder/arm/encodemb_arm.h deleted file mode 100644 index 55ffdb32e..000000000 --- a/vp8/encoder/arm/encodemb_arm.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2010 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 - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef ENCODEMB_ARM_H -#define ENCODEMB_ARM_H - -#if HAVE_MEDIA -extern prototype_subb(vp8_subtract_b_armv6); -extern prototype_submby(vp8_subtract_mby_armv6); -extern prototype_submbuv(vp8_subtract_mbuv_armv6); - -#if !CONFIG_RUNTIME_CPU_DETECT -#undef vp8_encodemb_subb -#define vp8_encodemb_subb vp8_subtract_b_armv6 - -#undef vp8_encodemb_submby -#define vp8_encodemb_submby vp8_subtract_mby_armv6 - -#undef vp8_encodemb_submbuv -#define vp8_encodemb_submbuv vp8_subtract_mbuv_armv6 -#endif - -#endif /* HAVE_MEDIA */ - -#if HAVE_NEON -//extern prototype_berr(vp8_block_error_c); -//extern prototype_mberr(vp8_mbblock_error_c); -//extern prototype_mbuverr(vp8_mbuverror_c); - -extern prototype_subb(vp8_subtract_b_neon); -extern prototype_submby(vp8_subtract_mby_neon); -extern prototype_submbuv(vp8_subtract_mbuv_neon); - -//#undef vp8_encodemb_berr -//#define vp8_encodemb_berr vp8_block_error_c - -//#undef vp8_encodemb_mberr -//#define vp8_encodemb_mberr vp8_mbblock_error_c - -//#undef vp8_encodemb_mbuverr -//#define vp8_encodemb_mbuverr vp8_mbuverror_c - -#if !CONFIG_RUNTIME_CPU_DETECT -#undef vp8_encodemb_subb -#define vp8_encodemb_subb vp8_subtract_b_neon - -#undef vp8_encodemb_submby -#define vp8_encodemb_submby vp8_subtract_mby_neon - -#undef vp8_encodemb_submbuv -#define vp8_encodemb_submbuv vp8_subtract_mbuv_neon -#endif - -#endif /* HAVE_NEON */ - -#endif diff --git a/vp8/encoder/encodeintra.c b/vp8/encoder/encodeintra.c index a1cc87c8b..c457906f6 100644 --- a/vp8/encoder/encodeintra.c +++ b/vp8/encoder/encodeintra.c @@ -67,7 +67,7 @@ void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd, (*(b->base_dst) + b->dst, b->dst_stride, b->bmi.as_mode, b->predictor, 16); - ENCODEMB_INVOKE(&rtcd->encodemb, subb)(be, b, 16); + vp8_subtract_b(be, b, 16); x->short_fdct4x4(be->src_diff, be->coeff, 32); @@ -105,7 +105,7 @@ void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) vp8_build_intra_predictors_mby_s(&x->e_mbd); - ENCODEMB_INVOKE(&rtcd->encodemb, submby) (x->src_diff, *(b->base_src), + vp8_subtract_mby(x->src_diff, *(b->base_src), b->src_stride, xd->dst.y_buffer, xd->dst.y_stride); vp8_transform_intra_mby(x); @@ -122,7 +122,7 @@ void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) vp8_build_intra_predictors_mbuv_s(&x->e_mbd); - ENCODEMB_INVOKE(&rtcd->encodemb, submbuv)(x->src_diff, x->src.u_buffer, + vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->src.uv_stride, xd->dst.u_buffer, xd->dst.v_buffer, xd->dst.uv_stride); diff --git a/vp8/encoder/encodemb.c b/vp8/encoder/encodemb.c index 353eeb6fc..8e139400b 100644 --- a/vp8/encoder/encodemb.c +++ b/vp8/encoder/encodemb.c @@ -102,9 +102,9 @@ static void vp8_subtract_mb(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) { BLOCK *b = &x->block[0]; - ENCODEMB_INVOKE(&rtcd->encodemb, submby)(x->src_diff, *(b->base_src), + vp8_subtract_mby(x->src_diff, *(b->base_src), b->src_stride, x->e_mbd.dst.y_buffer, x->e_mbd.dst.y_stride); - ENCODEMB_INVOKE(&rtcd->encodemb, submbuv)(x->src_diff, x->src.u_buffer, + vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->src.uv_stride, x->e_mbd.dst.u_buffer, x->e_mbd.dst.v_buffer, x->e_mbd.dst.uv_stride); } @@ -643,7 +643,7 @@ void vp8_encode_inter16x16y(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) vp8_build_inter16x16_predictors_mby(&x->e_mbd, x->e_mbd.dst.y_buffer, x->e_mbd.dst.y_stride); - ENCODEMB_INVOKE(&rtcd->encodemb, submby)(x->src_diff, *(b->base_src), + vp8_subtract_mby(x->src_diff, *(b->base_src), b->src_stride, x->e_mbd.dst.y_buffer, x->e_mbd.dst.y_stride); transform_mby(x); diff --git a/vp8/encoder/encodemb.h b/vp8/encoder/encodemb.h index 0fa87cf68..df3ac2f6f 100644 --- a/vp8/encoder/encodemb.h +++ b/vp8/encoder/encodemb.h @@ -12,88 +12,6 @@ #ifndef __INC_ENCODEMB_H #define __INC_ENCODEMB_H - -#include "vpx_config.h" -#include "block.h" - -#define prototype_mberr(sym) \ - int (sym)(MACROBLOCK *mb, int dc) - -#define prototype_berr(sym) \ - int (sym)(short *coeff, short *dqcoeff) - -#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, int src_stride, \ - unsigned char *pred, int pred_stride) - -#define prototype_submbuv(sym) \ - void (sym)(short *diff, unsigned char *usrc, unsigned char *vsrc,\ - int src_stride, unsigned char *upred, unsigned char *vpred,\ - int pred_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; - -#if CONFIG_RUNTIME_CPU_DETECT -#define ENCODEMB_INVOKE(ctx,fn) (ctx)->fn -#else -#define ENCODEMB_INVOKE(ctx,fn) vp8_encodemb_##fn -#endif - - - #include "onyx_int.h" struct VP8_ENCODER_RTCD; void vp8_encode_inter16x16(const struct VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x); diff --git a/vp8/encoder/generic/csystemdependent.c b/vp8/encoder/generic/csystemdependent.c index 749bcc32b..7425dc246 100644 --- a/vp8/encoder/generic/csystemdependent.c +++ b/vp8/encoder/generic/csystemdependent.c @@ -25,13 +25,6 @@ extern void vp8_yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc, void vp8_cmachine_specific_config(VP8_COMP *cpi) { #if CONFIG_RUNTIME_CPU_DETECT - 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.refining_search = vp8_refining_search_sad; cpi->rtcd.search.diamond_search = vp8_diamond_search_sad; diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index 8e7f99bda..d514d75aa 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -223,7 +223,6 @@ typedef struct typedef struct VP8_ENCODER_RTCD { - vp8_encodemb_rtcd_vtable_t encodemb; vp8_search_rtcd_vtable_t search; vp8_temporal_rtcd_vtable_t temporal; } VP8_ENCODER_RTCD; diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 5ec24902a..786138f3f 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -562,8 +562,7 @@ static int vp8_rdcost_mby(MACROBLOCK *mb) static void macro_block_yrd( MACROBLOCK *mb, int *Rate, - int *Distortion, - const vp8_encodemb_rtcd_vtable_t *rtcd) + int *Distortion) { int b; MACROBLOCKD *const x = &mb->e_mbd; @@ -573,7 +572,7 @@ static void macro_block_yrd( MACROBLOCK *mb, BLOCK *beptr; int d; - ENCODEMB_INVOKE(rtcd, submby)( mb->src_diff, *(mb->block[0].base_src), + vp8_subtract_mby( mb->src_diff, *(mb->block[0].base_src), mb->block[0].src_stride, mb->e_mbd.predictor, 16); // Fdct and building the 2nd order block @@ -597,8 +596,8 @@ static void macro_block_yrd( MACROBLOCK *mb, mb->quantize_b(mb_y2, x_y2); // Distortion - d = ENCODEMB_INVOKE(rtcd, mberr)(mb, 1) << 2; - d += ENCODEMB_INVOKE(rtcd, berr)(mb_y2->coeff, x_y2->dqcoeff); + d = vp8_mbblock_error(mb, 1) << 2; + d += vp8_block_error(mb_y2->coeff, x_y2->dqcoeff); *Distortion = (d >> 4); @@ -654,7 +653,7 @@ static int rd_pick_intra4x4block( vp8_intra4x4_predict (*(b->base_dst) + b->dst, b->dst_stride, mode, b->predictor, 16); - ENCODEMB_INVOKE(IF_RTCD(&cpi->rtcd.encodemb), subb)(be, b, 16); + vp8_subtract_b(be, b, 16); x->short_fdct4x4(be->src_diff, be->coeff, 32); x->quantize_b(be, b); @@ -663,7 +662,7 @@ static int rd_pick_intra4x4block( ratey = cost_coeffs(x, b, PLANE_TYPE_Y_WITH_DC, &tempa, &templ); rate += ratey; - distortion = ENCODEMB_INVOKE(IF_RTCD(&cpi->rtcd.encodemb), berr)(be->coeff, b->dqcoeff) >> 2; + distortion = vp8_block_error(be->coeff, b->dqcoeff) >> 2; this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); @@ -774,7 +773,7 @@ static int rd_pick_intra16x16mby_mode(VP8_COMP *cpi, vp8_build_intra_predictors_mby (&x->e_mbd); - macro_block_yrd(x, &ratey, &distortion, IF_RTCD(&cpi->rtcd.encodemb)); + macro_block_yrd(x, &ratey, &distortion); rate = ratey + x->mbmode_cost[x->e_mbd.frame_type] [x->e_mbd.mode_info_context->mbmi.mode]; @@ -821,7 +820,7 @@ static int rd_inter16x16_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, int *distortion, int fullpixel) { vp8_build_inter16x16_predictors_mbuv(&x->e_mbd); - ENCODEMB_INVOKE(IF_RTCD(&cpi->rtcd.encodemb), submbuv)(x->src_diff, + vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->src.uv_stride, &x->e_mbd.predictor[256], &x->e_mbd.predictor[320], 8); @@ -829,7 +828,7 @@ static int rd_inter16x16_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, vp8_quantize_mbuv(x); *rate = rd_cost_mbuv(x); - *distortion = ENCODEMB_INVOKE(&cpi->rtcd.encodemb, mbuverr)(x) / 4; + *distortion = vp8_mbuverror(x) / 4; return RDCOST(x->rdmult, x->rddiv, *rate, *distortion); } @@ -838,7 +837,7 @@ static int rd_inter4x4_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, int *distortion, int fullpixel) { vp8_build_inter4x4_predictors_mbuv(&x->e_mbd); - ENCODEMB_INVOKE(IF_RTCD(&cpi->rtcd.encodemb), submbuv)(x->src_diff, + vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->src.uv_stride, &x->e_mbd.predictor[256], &x->e_mbd.predictor[320], 8); @@ -846,7 +845,7 @@ static int rd_inter4x4_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, vp8_quantize_mbuv(x); *rate = rd_cost_mbuv(x); - *distortion = ENCODEMB_INVOKE(&cpi->rtcd.encodemb, mbuverr)(x) / 4; + *distortion = vp8_mbuverror(x) / 4; return RDCOST(x->rdmult, x->rddiv, *rate, *distortion); } @@ -868,7 +867,7 @@ static void rd_pick_intra_mbuv_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate, int x->e_mbd.mode_info_context->mbmi.uv_mode = mode; vp8_build_intra_predictors_mbuv (&x->e_mbd); - ENCODEMB_INVOKE(IF_RTCD(&cpi->rtcd.encodemb), submbuv)(x->src_diff, + vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->src.uv_stride, &x->e_mbd.predictor[256], &x->e_mbd.predictor[320], 8); vp8_transform_mbuv(x); @@ -877,7 +876,7 @@ static void rd_pick_intra_mbuv_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate, int rate_to = rd_cost_mbuv(x); rate = rate_to + x->intra_uv_mode_cost[x->e_mbd.frame_type][x->e_mbd.mode_info_context->mbmi.uv_mode]; - distortion = ENCODEMB_INVOKE(&cpi->rtcd.encodemb, mbuverr)(x) / 4; + distortion = vp8_mbuverror(x) / 4; this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); @@ -1012,7 +1011,7 @@ static int rdcost_mbsegment_y(MACROBLOCK *mb, const int *labels, return cost; } -static unsigned int vp8_encode_inter_mb_segment(MACROBLOCK *x, int const *labels, int which_label, const vp8_encodemb_rtcd_vtable_t *rtcd) +static unsigned int vp8_encode_inter_mb_segment(MACROBLOCK *x, int const *labels, int which_label) { int i; unsigned int distortion = 0; @@ -1026,14 +1025,14 @@ static unsigned int vp8_encode_inter_mb_segment(MACROBLOCK *x, int const *labels vp8_build_inter_predictors_b(bd, 16, x->e_mbd.subpixel_predict); - ENCODEMB_INVOKE(rtcd, subb)(be, bd, 16); + vp8_subtract_b(be, bd, 16); x->short_fdct4x4(be->src_diff, be->coeff, 32); // set to 0 no way to account for 2nd order DC so discount //be->coeff[0] = 0; x->quantize_b(be, bd); - distortion += ENCODEMB_INVOKE(rtcd, berr)(be->coeff, bd->dqcoeff); + distortion += vp8_block_error(be->coeff, bd->dqcoeff); } } @@ -1275,7 +1274,7 @@ static void rd_check_segment(VP8_COMP *cpi, MACROBLOCK *x, continue; } - distortion = vp8_encode_inter_mb_segment(x, labels, i, IF_RTCD(&cpi->rtcd.encodemb)) / 4; + distortion = vp8_encode_inter_mb_segment(x, labels, i) / 4; labelyrate = rdcost_mbsegment_y(x, labels, i, ta_s, tl_s); rate += labelyrate; @@ -1948,7 +1947,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME; vp8_build_intra_predictors_mby (&x->e_mbd); - macro_block_yrd(x, &rate_y, &distortion, IF_RTCD(&cpi->rtcd.encodemb)) ; + macro_block_yrd(x, &rate_y, &distortion) ; rate2 += rate_y; distortion2 += distortion; rate2 += x->mbmode_cost[x->e_mbd.frame_type][x->e_mbd.mode_info_context->mbmi.mode]; @@ -2176,7 +2175,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, rate2 += vp8_cost_mv_ref(this_mode, mdcounts); // Y cost and distortion - macro_block_yrd(x, &rate_y, &distortion, IF_RTCD(&cpi->rtcd.encodemb)); + macro_block_yrd(x, &rate_y, &distortion); rate2 += rate_y; distortion2 += distortion; diff --git a/vp8/encoder/x86/encodemb_x86.h b/vp8/encoder/x86/encodemb_x86.h deleted file mode 100644 index 69b3edd66..000000000 --- a/vp8/encoder/x86/encodemb_x86.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2010 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 - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef ENCODEMB_X86_H -#define ENCODEMB_X86_H - - -/* Note: - * - * This platform is commonly built for runtime CPU detection. If you modify - * any of the function mappings present in this file, be sure to also update - * them in the function pointer initialization code - */ -#if HAVE_MMX -extern prototype_berr(vp8_block_error_mmx); -extern prototype_mberr(vp8_mbblock_error_mmx); -extern prototype_mbuverr(vp8_mbuverror_mmx); -extern prototype_subb(vp8_subtract_b_mmx); -extern prototype_submby(vp8_subtract_mby_mmx); -extern prototype_submbuv(vp8_subtract_mbuv_mmx); - - -#if !CONFIG_RUNTIME_CPU_DETECT -#undef vp8_encodemb_berr -#define vp8_encodemb_berr vp8_block_error_mmx - -#undef vp8_encodemb_mberr -#define vp8_encodemb_mberr vp8_mbblock_error_mmx - -#undef vp8_encodemb_mbuverr -#define vp8_encodemb_mbuverr vp8_mbuverror_mmx - -#undef vp8_encodemb_subb -#define vp8_encodemb_subb vp8_subtract_b_mmx - -#undef vp8_encodemb_submby -#define vp8_encodemb_submby vp8_subtract_mby_mmx - -#undef vp8_encodemb_submbuv -#define vp8_encodemb_submbuv vp8_subtract_mbuv_mmx - -#endif -#endif - - -#if HAVE_SSE2 -extern prototype_berr(vp8_block_error_xmm); -extern prototype_mberr(vp8_mbblock_error_xmm); -extern prototype_mbuverr(vp8_mbuverror_xmm); -extern prototype_subb(vp8_subtract_b_sse2); -extern prototype_submby(vp8_subtract_mby_sse2); -extern prototype_submbuv(vp8_subtract_mbuv_sse2); - -#if !CONFIG_RUNTIME_CPU_DETECT -#undef vp8_encodemb_berr -#define vp8_encodemb_berr vp8_block_error_xmm - -#undef vp8_encodemb_mberr -#define vp8_encodemb_mberr vp8_mbblock_error_xmm - -#undef vp8_encodemb_mbuverr -#define vp8_encodemb_mbuverr vp8_mbuverror_xmm - -#undef vp8_encodemb_subb -#define vp8_encodemb_subb vp8_subtract_b_sse2 - -#undef vp8_encodemb_submby -#define vp8_encodemb_submby vp8_subtract_mby_sse2 - -#undef vp8_encodemb_submbuv -#define vp8_encodemb_submbuv vp8_subtract_mbuv_sse2 - -#endif -#endif - - -#endif diff --git a/vp8/encoder/x86/x86_csystemdependent.c b/vp8/encoder/x86/x86_csystemdependent.c index 9011ddfa3..fa628fa81 100644 --- a/vp8/encoder/x86/x86_csystemdependent.c +++ b/vp8/encoder/x86/x86_csystemdependent.c @@ -125,29 +125,9 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi) */ /* Override default functions with fastest ones for this CPU. */ -#if HAVE_MMX - if (flags & HAS_MMX) - { - cpi->rtcd.encodemb.berr = vp8_block_error_mmx; - cpi->rtcd.encodemb.mberr = vp8_mbblock_error_mmx; - cpi->rtcd.encodemb.mbuverr = vp8_mbuverror_mmx; - cpi->rtcd.encodemb.subb = vp8_subtract_b_mmx; - cpi->rtcd.encodemb.submby = vp8_subtract_mby_mmx; - cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_mmx; - - /*cpi->rtcd.quantize.fastquantb = vp8_fast_quantize_b_mmx;*/ - } -#endif - #if HAVE_SSE2 if (flags & HAS_SSE2) { - cpi->rtcd.encodemb.berr = vp8_block_error_xmm; - cpi->rtcd.encodemb.mberr = vp8_mbblock_error_xmm; - cpi->rtcd.encodemb.mbuverr = vp8_mbuverror_xmm; - cpi->rtcd.encodemb.subb = vp8_subtract_b_sse2; - cpi->rtcd.encodemb.submby = vp8_subtract_mby_sse2; - cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_sse2; #if !(CONFIG_REALTIME_ONLY) cpi->rtcd.temporal.apply = vp8_temporal_filter_apply_sse2; #endif diff --git a/vp8/vp8cx.mk b/vp8/vp8cx.mk index 1760e4b88..febb7eff3 100644 --- a/vp8/vp8cx.mk +++ b/vp8/vp8cx.mk @@ -93,7 +93,6 @@ VP8_CX_SRCS_REMOVE-yes += encoder/firstpass.c VP8_CX_SRCS_REMOVE-yes += encoder/temporal_filter.c endif -VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/encodemb_x86.h VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/mcomp_x86.h VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/temporal_filter_x86.h VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/x86_csystemdependent.c diff --git a/vp8/vp8cx_arm.mk b/vp8/vp8cx_arm.mk index 1fdb49377..0d37f4bfe 100644 --- a/vp8/vp8cx_arm.mk +++ b/vp8/vp8cx_arm.mk @@ -16,7 +16,6 @@ VP8_CX_SRCS-$(ARCH_ARM) += encoder/arm/arm_csystemdependent.c VP8_CX_SRCS-$(ARCH_ARM) += encoder/arm/dct_arm.c -VP8_CX_SRCS-$(ARCH_ARM) += encoder/arm/encodemb_arm.h VP8_CX_SRCS-$(ARCH_ARM) += encoder/arm/quantize_arm.c VP8_CX_SRCS-$(ARCH_ARM) += encoder/arm/variance_arm.c -- 2.40.0