From df1b8f2f2325e21e8e1650604b65f6e9a13c67b5 Mon Sep 17 00:00:00 2001 From: Scott LaVarnway <slavarnway@google.com> Date: Tue, 30 Oct 2012 12:09:49 -0700 Subject: [PATCH] dequant invoke macro removal Change-Id: Ifa17e698149adc063476e7d16eb727f01e88b447 --- vp8/common/rtcd_defs.sh | 35 ++++ vp8/decoder/arm/arm_dsystemdependent.c | 52 ------ vp8/decoder/arm/dequantize_arm.h | 73 --------- vp8/decoder/decodframe.c | 70 ++++---- vp8/decoder/dequantize.h | 212 +++++-------------------- vp8/decoder/generic/dsystemdependent.c | 46 ------ vp8/decoder/onyxd_if.c | 1 - vp8/decoder/onyxd_int.h | 9 +- vp8/decoder/x86/dequantize_x86.h | 70 -------- vp8/decoder/x86/x86_dsystemdependent.c | 30 ---- vp8/encoder/onyx_if.c | 2 - vp8/vp8dx.mk | 2 - vp8/vp8dx_arm.mk | 2 - 13 files changed, 112 insertions(+), 492 deletions(-) delete mode 100644 vp8/decoder/arm/arm_dsystemdependent.c delete mode 100644 vp8/decoder/arm/dequantize_arm.h delete mode 100644 vp8/decoder/generic/dsystemdependent.c delete mode 100644 vp8/decoder/x86/dequantize_x86.h diff --git a/vp8/common/rtcd_defs.sh b/vp8/common/rtcd_defs.sh index 5d388ac574..9a9073697a 100644 --- a/vp8/common/rtcd_defs.sh +++ b/vp8/common/rtcd_defs.sh @@ -34,6 +34,41 @@ fi specialize vp8_filter_block2d_8x8_8 ssse3 #sse4_1 sse2 specialize vp8_filter_block2d_16x16_8 ssse3 #sse4_1 sse2 +# +# Dequant +# +prototype void vp8_dequantize_b "struct blockd *x" +specialize vp8_dequantize_b mmx + +prototype void vp8_dequantize_b_2x2 "struct blockd *x" +specialize vp8_dequantize_b_2x2 + +prototype void vp8_dequant_dc_idct_add_y_block_8x8 "short *q, short *dq, unsigned char *pre, unsigned char *dst, int stride, char *eobs, short *dc, struct macroblockd *xd" +specialize vp8_dequant_dc_idct_add_y_block_8x8 + +prototype void vp8_dequant_idct_add_y_block_8x8 "short *q, short *dq, unsigned char *pre, unsigned char *dst, int stride, char *eobs, struct macroblockd *xd" +specialize vp8_dequant_idct_add_y_block_8x8 + +prototype void vp8_dequant_idct_add_uv_block_8x8 "short *q, short *dq, unsigned char *pre, unsigned char *dstu, unsigned char *dstv, int stride, char *eobs, struct macroblockd *xd" +specialize vp8_dequant_idct_add_uv_block_8x8 + +prototype void vp8_dequant_idct_add_16x16 "short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride" +specialize vp8_dequant_idct_add_16x16 + +prototype void vp8_dequant_idct_add "short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride" +specialize vp8_dequant_idct_add + +prototype void vp8_dequant_dc_idct_add "short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride, int Dc" +specialize vp8_dequant_dc_idct_add + +prototype void vp8_dequant_dc_idct_add_y_block "short *q, short *dq, unsigned char *pre, unsigned char *dst, int stride, char *eobs, short *dc" +specialize vp8_dequant_dc_idct_add_y_block mmx + +prototype void vp8_dequant_idct_add_y_block "short *q, short *dq, unsigned char *pre, unsigned char *dst, int stride, char *eobs" +specialize vp8_dequant_idct_add_y_block mmx + +prototype void vp8_dequant_idct_add_uv_block "short *q, short *dq, unsigned char *pre, unsigned char *dstu, unsigned char *dstv, int stride, char *eobs" +specialize vp8_dequant_idct_add_uv_block mmx # # RECON diff --git a/vp8/decoder/arm/arm_dsystemdependent.c b/vp8/decoder/arm/arm_dsystemdependent.c deleted file mode 100644 index 31e8b1ab6e..0000000000 --- a/vp8/decoder/arm/arm_dsystemdependent.c +++ /dev/null @@ -1,52 +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. - */ - - -#include "vpx_ports/config.h" -#include "vpx_ports/arm.h" -#include "vp8/common/blockd.h" -#include "vp8/common/pragmas.h" -#include "vp8/decoder/dequantize.h" -#include "vp8/decoder/onyxd_int.h" - -void vp8_arch_arm_decode_init(VP8D_COMP *pbi) { -#if CONFIG_RUNTIME_CPU_DETECT - int flags = pbi->common.rtcd.flags; - -#if HAVE_ARMV5TE - if (flags & HAS_EDSP) { - } -#endif - -// The commented functions need to be re-written for vpx. -#if HAVE_ARMV6 - if (flags & HAS_MEDIA) { - pbi->dequant.block = vp8_dequantize_b_v6; - /*pbi->dequant.idct_add = vp8_dequant_idct_add_v6; - pbi->dequant.dc_idct_add = vp8_dequant_dc_idct_add_v6; - pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_v6; - pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_v6; - pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_v6;*/ - } -#endif - -#if HAVE_ARMV7 - if (flags & HAS_NEON) { - pbi->dequant.block = vp8_dequantize_b_neon; - // pbi->dequant.idct_add = vp8_dequant_idct_add_neon; - /*This is not used: NEON always dequants two blocks at once. - pbi->dequant.dc_idct_add = vp8_dequant_dc_idct_add_neon;*/ - /*pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_neon; - pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_neon; - pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_neon;*/ - } -#endif -#endif -} diff --git a/vp8/decoder/arm/dequantize_arm.h b/vp8/decoder/arm/dequantize_arm.h deleted file mode 100644 index b7d800d260..0000000000 --- a/vp8/decoder/arm/dequantize_arm.h +++ /dev/null @@ -1,73 +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 DEQUANTIZE_ARM_H -#define DEQUANTIZE_ARM_H - -#if HAVE_ARMV6 -extern prototype_dequant_block(vp8_dequantize_b_v6); -extern prototype_dequant_idct_add(vp8_dequant_idct_add_v6); -extern prototype_dequant_dc_idct_add(vp8_dequant_dc_idct_add_v6); -extern prototype_dequant_dc_idct_add_y_block(vp8_dequant_dc_idct_add_y_block_v6); -extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block_v6); -extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block_v6); - -#if !CONFIG_RUNTIME_CPU_DETECT -#undef vp8_dequant_block -#define vp8_dequant_block vp8_dequantize_b_v6 - -#undef vp8_dequant_idct_add -#define vp8_dequant_idct_add vp8_dequant_idct_add_v6 - -#undef vp8_dequant_dc_idct_add -#define vp8_dequant_dc_idct_add vp8_dequant_dc_idct_add_v6 - -#undef vp8_dequant_dc_idct_add_y_block -#define vp8_dequant_dc_idct_add_y_block vp8_dequant_dc_idct_add_y_block_v6 - -#undef vp8_dequant_idct_add_y_block -#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_v6 - -#undef vp8_dequant_idct_add_uv_block -#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_v6 -#endif -#endif - -#if HAVE_ARMV7 -extern prototype_dequant_block(vp8_dequantize_b_neon); -extern prototype_dequant_idct_add(vp8_dequant_idct_add_neon); -extern prototype_dequant_dc_idct_add(vp8_dequant_dc_idct_add_neon); -extern prototype_dequant_dc_idct_add_y_block(vp8_dequant_dc_idct_add_y_block_neon); -extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block_neon); -extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block_neon); - -#if !CONFIG_RUNTIME_CPU_DETECT -#undef vp8_dequant_block -#define vp8_dequant_block vp8_dequantize_b_neon - -#undef vp8_dequant_idct_add -#define vp8_dequant_idct_add vp8_dequant_idct_add_neon - -#undef vp8_dequant_dc_idct_add -#define vp8_dequant_dc_idct_add vp8_dequant_dc_idct_add_neon - -#undef vp8_dequant_dc_idct_add_y_block -#define vp8_dequant_dc_idct_add_y_block vp8_dequant_dc_idct_add_y_block_neon - -#undef vp8_dequant_idct_add_y_block -#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_neon - -#undef vp8_dequant_idct_add_uv_block -#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_neon -#endif -#endif - -#endif diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index 2f7621d3a1..c9d9855ed0 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -14,7 +14,6 @@ #include "vp8/common/reconintra.h" #include "vp8/common/reconintra4x4.h" #include "vp8/common/reconinter.h" -#include "dequantize.h" #include "detokenize.h" #include "vp8/common/invtrans.h" #include "vp8/common/alloccommon.h" @@ -29,7 +28,6 @@ #include "vp8/common/modecont.h" #include "vpx_mem/vpx_mem.h" #include "vp8/common/idct.h" -#include "dequantize.h" #include "dboolhuff.h" #include "vp8/common/seg_common.h" @@ -129,23 +127,29 @@ static void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd) { pbi->common.rtcd.idct.idct1_scalar_add = vp8_dc_only_inv_walsh_add_c; pbi->common.rtcd.idct.iwalsh1 = vp8_short_inv_walsh4x4_1_lossless_c; pbi->common.rtcd.idct.iwalsh16 = vp8_short_inv_walsh4x4_lossless_c; - pbi->dequant.idct_add = vp8_dequant_idct_add_lossless_c; - pbi->dequant.dc_idct_add = vp8_dequant_dc_idct_add_lossless_c; - pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_lossless_c; - pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_lossless_c; - pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_lossless_c; + pbi->idct_add = vp8_dequant_idct_add_lossless_c; + pbi->dc_idct_add = vp8_dequant_dc_idct_add_lossless_c; + pbi->dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_lossless_c; + pbi->idct_add_y_block = vp8_dequant_idct_add_y_block_lossless_c; + pbi->idct_add_uv_block = vp8_dequant_idct_add_uv_block_lossless_c; } else { pbi->common.rtcd.idct.idct1 = vp8_short_idct4x4llm_1_c; pbi->common.rtcd.idct.idct16 = vp8_short_idct4x4llm_c; pbi->common.rtcd.idct.idct1_scalar_add = vp8_dc_only_idct_add_c; pbi->common.rtcd.idct.iwalsh1 = vp8_short_inv_walsh4x4_1_c; pbi->common.rtcd.idct.iwalsh16 = vp8_short_inv_walsh4x4_c; - pbi->dequant.idct_add = vp8_dequant_idct_add_c; - pbi->dequant.dc_idct_add = vp8_dequant_dc_idct_add_c; - pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_c; - pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_c; - pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_c; + pbi->idct_add = vp8_dequant_idct_add; + pbi->dc_idct_add = vp8_dequant_dc_idct_add; + pbi->dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block; + pbi->idct_add_y_block = vp8_dequant_idct_add_y_block; + pbi->idct_add_uv_block = vp8_dequant_idct_add_uv_block; } +#else + pbi->idct_add = vp8_dequant_idct_add; + pbi->dc_idct_add = vp8_dequant_dc_idct_add; + pbi->dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block; + pbi->idct_add_y_block = vp8_dequant_idct_add_y_block; + pbi->idct_add_uv_block = vp8_dequant_idct_add_uv_block; #endif for (i = 16; i < 24; i++) { @@ -335,23 +339,18 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, } else { for (j = 0; j < 4; j++) { b = &xd->block[ib + iblock[j]]; - vp8_dequant_idct_add_c(b->qcoeff, b->dequant, b->predictor, + vp8_dequant_idct_add(b->qcoeff, b->dequant, b->predictor, *(b->base_dst) + b->dst, 16, b->dst_stride); } } - b = &xd->block[16 + i]; vp8_intra_uv4x4_predict(b, i8x8mode, b->predictor); - DEQUANT_INVOKE(&pbi->dequant, idct_add)(b->qcoeff, b->dequant, - b->predictor, - *(b->base_dst) + b->dst, 8, - b->dst_stride); + pbi->idct_add(b->qcoeff, b->dequant, b->predictor, + *(b->base_dst) + b->dst, 8, b->dst_stride); b = &xd->block[20 + i]; vp8_intra_uv4x4_predict(b, i8x8mode, b->predictor); - DEQUANT_INVOKE(&pbi->dequant, idct_add)(b->qcoeff, b->dequant, - b->predictor, - *(b->base_dst) + b->dst, 8, - b->dst_stride); + pbi->idct_add(b->qcoeff, b->dequant, b->predictor, + *(b->base_dst) + b->dst, 8, b->dst_stride); } } else if (mode == B_PRED) { for (i = 0; i < 16; i++) { @@ -375,18 +374,17 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, b->dequant, b->predictor, *(b->base_dst) + b->dst, 16, b->dst_stride); } else { - vp8_dequant_idct_add_c(b->qcoeff, b->dequant, b->predictor, + vp8_dequant_idct_add(b->qcoeff, b->dequant, b->predictor, *(b->base_dst) + b->dst, 16, b->dst_stride); } } } else if (mode == SPLITMV) { if (tx_size == TX_8X8) { - vp8_dequant_idct_add_y_block_8x8_c(xd->qcoeff, xd->block[0].dequant, + vp8_dequant_idct_add_y_block_8x8(xd->qcoeff, xd->block[0].dequant, xd->predictor, xd->dst.y_buffer, xd->dst.y_stride, xd->eobs, xd); } else { - DEQUANT_INVOKE(&pbi->dequant, - idct_add_y_block)(xd->qcoeff, xd->block[0].dequant, + pbi->idct_add_y_block(xd->qcoeff, xd->block[0].dequant, xd->predictor, xd->dst.y_buffer, xd->dst.y_stride, xd->eobs); } @@ -401,7 +399,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, xd->block[0].dequant, xd->predictor, xd->dst.y_buffer, 16, xd->dst.y_stride); } else { - vp8_dequant_idct_add_16x16_c(xd->qcoeff, xd->block[0].dequant, + vp8_dequant_idct_add_16x16(xd->qcoeff, xd->block[0].dequant, xd->predictor, xd->dst.y_buffer, 16, xd->dst.y_stride); } @@ -437,7 +435,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, if (xd->mode_info_context->mbmi.mb_skip_coeff) continue; // only happens for SBs, which are already in dest buffer #endif - DEQUANT_INVOKE(&pbi->dequant, block_2x2)(b); + vp8_dequantize_b_2x2(b); IDCT_INVOKE(RTCD_VTABLE(idct), ihaar2)(&b->dqcoeff[0], b->diff, 8); ((int *)b->qcoeff)[0] = 0;// 2nd order block are set to 0 after inverse transform ((int *)b->qcoeff)[1] = 0; @@ -461,7 +459,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, xd->dst.uv_stride, xd->eobs + 16, xd); } else #endif - DEQUANT_INVOKE(&pbi->dequant, dc_idct_add_y_block_8x8)(xd->qcoeff, + vp8_dequant_dc_idct_add_y_block_8x8(xd->qcoeff, xd->block[0].dequant, xd->predictor, xd->dst.y_buffer, xd->dst.y_stride, xd->eobs, xd->block[24].diff, xd); #if CONFIG_SUPERBLOCKS @@ -469,7 +467,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, xd->mode_info_context = orig; #endif } else { - DEQUANT_INVOKE(&pbi->dequant, block)(b); + vp8_dequantize_b(b); if (xd->eobs[24] > 1) { IDCT_INVOKE(RTCD_VTABLE(idct), iwalsh16)(&b->dqcoeff[0], b->diff); ((int *)b->qcoeff)[0] = 0; @@ -485,10 +483,9 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, ((int *)b->qcoeff)[0] = 0; } - DEQUANT_INVOKE(&pbi->dequant, dc_idct_add_y_block) - (xd->qcoeff, xd->block[0].dequant, - xd->predictor, xd->dst.y_buffer, - xd->dst.y_stride, xd->eobs, xd->block[24].diff); + pbi->dc_idct_add_y_block(xd->qcoeff, xd->block[0].dequant, xd->predictor, + xd->dst.y_buffer, xd->dst.y_stride, xd->eobs, + xd->block[24].diff); } } @@ -500,13 +497,12 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, xd->mode_info_context->mbmi.mode != SPLITMV) || tx_size == TX_16X16 ) - DEQUANT_INVOKE(&pbi->dequant, idct_add_uv_block_8x8) // + vp8_dequant_idct_add_uv_block_8x8 (xd->qcoeff + 16 * 16, xd->block[16].dequant, xd->predictor + 16 * 16, xd->dst.u_buffer, xd->dst.v_buffer, xd->dst.uv_stride, xd->eobs + 16, xd); // else if (xd->mode_info_context->mbmi.mode != I8X8_PRED) - DEQUANT_INVOKE(&pbi->dequant, idct_add_uv_block) - (xd->qcoeff + 16 * 16, xd->block[16].dequant, + pbi->idct_add_uv_block(xd->qcoeff + 16 * 16, xd->block[16].dequant, xd->predictor + 16 * 16, xd->dst.u_buffer, xd->dst.v_buffer, xd->dst.uv_stride, xd->eobs + 16); #if CONFIG_SUPERBLOCKS diff --git a/vp8/decoder/dequantize.h b/vp8/decoder/dequantize.h index 4ac710431b..2d9314c80a 100644 --- a/vp8/decoder/dequantize.h +++ b/vp8/decoder/dequantize.h @@ -13,182 +13,48 @@ #define DEQUANTIZE_H #include "vp8/common/blockd.h" -#define prototype_dequant_block(sym) \ - void sym(BLOCKD *x) - -#define prototype_dequant_idct_add(sym) \ - void sym(short *input, short *dq, \ - unsigned char *pred, unsigned char *output, \ - int pitch, int stride) - -#define prototype_dequant_dc_idct_add(sym) \ - void sym(short *input, short *dq, \ - unsigned char *pred, unsigned char *output, \ - int pitch, int stride, \ - int dc) - -#define prototype_dequant_dc_idct_add_y_block(sym) \ - void sym(short *q, short *dq, \ - unsigned char *pre, unsigned char *dst, \ - int stride, char *eobs, short *dc) - -#define prototype_dequant_idct_add_y_block(sym) \ - void sym(short *q, short *dq, \ - unsigned char *pre, unsigned char *dst, \ - int stride, char *eobs) - -#define prototype_dequant_idct_add_uv_block(sym) \ - void sym(short *q, short *dq, \ - unsigned char *pre, unsigned char *dst_u, \ - unsigned char *dst_v, int stride, char *eobs) - -#define prototype_dequant_dc_idct_add_y_block_8x8(sym) \ - void sym(short *q, short *dq, \ - unsigned char *pre, unsigned char *dst, \ - int stride, char *eobs, short *dc, MACROBLOCKD *xd) - -#define prototype_dequant_idct_add_y_block_8x8(sym) \ - void sym(short *q, short *dq, \ - unsigned char *pre, unsigned char *dst, \ - int stride, char *eobs, MACROBLOCKD *xd) - -#define prototype_dequant_idct_add_uv_block_8x8(sym) \ - void sym(short *q, short *dq, \ - unsigned char *pre, unsigned char *dst_u, \ - unsigned char *dst_v, int stride, char *eobs, \ - MACROBLOCKD *xd) - -#if ARCH_X86 || ARCH_X86_64 -#include "x86/dequantize_x86.h" -#endif - -#if ARCH_ARM -#include "arm/dequantize_arm.h" -#endif - -#ifndef vp8_dequant_block -#define vp8_dequant_block vp8_dequantize_b_c -#endif -extern prototype_dequant_block(vp8_dequant_block); - -#ifndef vp8_dequant_idct_add -#define vp8_dequant_idct_add vp8_dequant_idct_add_c -#endif -extern prototype_dequant_idct_add(vp8_dequant_idct_add); - -// declare dequantization and inverse transform module of hybrid transform decoder -#ifndef vp8_ht_dequant_idct_add -#define vp8_ht_dequant_idct_add vp8_ht_dequant_idct_add_c -#endif -extern void vp8_ht_dequant_idct_add(TX_TYPE tx_type, short *input, short *dq, +#if CONFIG_LOSSLESS +extern void vp8_dequant_idct_add_lossless_c(short *input, short *dq, + unsigned char *pred, + unsigned char *output, + int pitch, int stride); +extern void vp8_dequant_dc_idct_add_lossless_c(short *input, short *dq, + unsigned char *pred, + unsigned char *output, + int pitch, int stride, int dc); +extern void vp8_dequant_dc_idct_add_y_block_lossless_c(short *q, short *dq, + unsigned char *pre, + unsigned char *dst, + int stride, char *eobs, + short *dc); +extern void vp8_dequant_idct_add_y_block_lossless_c(short *q, short *dq, + unsigned char *pre, + unsigned char *dst, + int stride, char *eobs); +extern void vp8_dequant_idct_add_uv_block_lossless_c(short *q, short *dq, + unsigned char *pre, + unsigned char *dst_u, + unsigned char *dst_v, + int stride, char *eobs); +#endif + +typedef void (*vp8_dequant_idct_add_fn_t)(short *input, short *dq, + unsigned char *pred, unsigned char *output, int pitch, int stride); +typedef void(*vp8_dequant_dc_idct_add_fn_t)(short *input, short *dq, + unsigned char *pred, unsigned char *output, int pitch, int stride, int dc); + +typedef void(*vp8_dequant_dc_idct_add_y_block_fn_t)(short *q, short *dq, + unsigned char *pre, unsigned char *dst, int stride, char *eobs, short *dc); +typedef void(*vp8_dequant_idct_add_y_block_fn_t)(short *q, short *dq, + unsigned char *pre, unsigned char *dst, int stride, char *eobs); +typedef void(*vp8_dequant_idct_add_uv_block_fn_t)(short *q, short *dq, + unsigned char *pre, unsigned char *dst_u, unsigned char *dst_v, int stride, + char *eobs); + +void vp8_ht_dequant_idct_add_c(TX_TYPE tx_type, short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride); - -#ifndef vp8_dequant_dc_idct_add -#define vp8_dequant_dc_idct_add vp8_dequant_dc_idct_add_c -#endif -extern prototype_dequant_dc_idct_add(vp8_dequant_dc_idct_add); - -#ifndef vp8_dequant_dc_idct_add_y_block -#define vp8_dequant_dc_idct_add_y_block vp8_dequant_dc_idct_add_y_block_c -#endif -extern prototype_dequant_dc_idct_add_y_block(vp8_dequant_dc_idct_add_y_block); - -#ifndef vp8_dequant_idct_add_y_block -#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_c -#endif -extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block); - -#ifndef vp8_dequant_idct_add_uv_block -#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_c -#endif -extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block); - -#if CONFIG_LOSSLESS -extern prototype_dequant_idct_add(vp8_dequant_idct_add_lossless_c); -extern prototype_dequant_dc_idct_add(vp8_dequant_dc_idct_add_lossless_c); -extern prototype_dequant_dc_idct_add_y_block(vp8_dequant_dc_idct_add_y_block_lossless_c); -extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block_lossless_c); -extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block_lossless_c); -#endif - -#ifndef vp8_dequant_block_2x2 -#define vp8_dequant_block_2x2 vp8_dequantize_b_2x2_c -#endif -extern prototype_dequant_block(vp8_dequant_block_2x2); - -#ifndef vp8_dequant_idct_add_8x8 -#define vp8_dequant_idct_add_8x8 vp8_dequant_idct_add_8x8_c -#endif -extern prototype_dequant_idct_add(vp8_dequant_idct_add_8x8); - -#ifndef vp8_dequant_dc_idct_add_8x8 -#define vp8_dequant_dc_idct_add_8x8 vp8_dequant_dc_idct_add_8x8_c -#endif -extern prototype_dequant_dc_idct_add(vp8_dequant_dc_idct_add_8x8); - -#ifndef vp8_dequant_dc_idct_add_y_block_8x8 -#define vp8_dequant_dc_idct_add_y_block_8x8 vp8_dequant_dc_idct_add_y_block_8x8_c -#endif -extern prototype_dequant_dc_idct_add_y_block_8x8(vp8_dequant_dc_idct_add_y_block_8x8); - -#ifndef vp8_dequant_idct_add_y_block_8x8 -#define vp8_dequant_idct_add_y_block_8x8 vp8_dequant_idct_add_y_block_8x8_c -#endif -extern prototype_dequant_idct_add_y_block_8x8(vp8_dequant_idct_add_y_block_8x8); - -#ifndef vp8_dequant_idct_add_uv_block_8x8 -#define vp8_dequant_idct_add_uv_block_8x8 vp8_dequant_idct_add_uv_block_8x8_c -#endif -extern prototype_dequant_idct_add_uv_block_8x8(vp8_dequant_idct_add_uv_block_8x8); - -#ifndef vp8_dequant_idct_add_16x16 -#define vp8_dequant_idct_add_16x16 vp8_dequant_idct_add_16x16_c -#endif -extern prototype_dequant_idct_add(vp8_dequant_idct_add_16x16); - - -typedef prototype_dequant_block((*vp8_dequant_block_fn_t)); - -typedef prototype_dequant_idct_add((*vp8_dequant_idct_add_fn_t)); - -typedef prototype_dequant_dc_idct_add((*vp8_dequant_dc_idct_add_fn_t)); - -typedef prototype_dequant_dc_idct_add_y_block((*vp8_dequant_dc_idct_add_y_block_fn_t)); - -typedef prototype_dequant_idct_add_y_block((*vp8_dequant_idct_add_y_block_fn_t)); - -typedef prototype_dequant_idct_add_uv_block((*vp8_dequant_idct_add_uv_block_fn_t)); - -typedef prototype_dequant_dc_idct_add_y_block_8x8((*vp8_dequant_dc_idct_add_y_block_fn_t_8x8)); - -typedef prototype_dequant_idct_add_y_block_8x8((*vp8_dequant_idct_add_y_block_fn_t_8x8)); - -typedef prototype_dequant_idct_add_uv_block_8x8((*vp8_dequant_idct_add_uv_block_fn_t_8x8)); - -typedef struct { - vp8_dequant_block_fn_t block; - vp8_dequant_idct_add_fn_t idct_add; - vp8_dequant_dc_idct_add_fn_t dc_idct_add; - vp8_dequant_dc_idct_add_y_block_fn_t dc_idct_add_y_block; - vp8_dequant_idct_add_y_block_fn_t idct_add_y_block; - vp8_dequant_idct_add_uv_block_fn_t idct_add_uv_block; - vp8_dequant_block_fn_t block_2x2; - vp8_dequant_idct_add_fn_t idct_add_8x8; - vp8_dequant_dc_idct_add_fn_t dc_idct_add_8x8; - vp8_dequant_dc_idct_add_y_block_fn_t_8x8 dc_idct_add_y_block_8x8; - vp8_dequant_idct_add_y_block_fn_t_8x8 idct_add_y_block_8x8; - vp8_dequant_idct_add_uv_block_fn_t_8x8 idct_add_uv_block_8x8; - vp8_dequant_idct_add_fn_t idct_add_16x16; -} vp8_dequant_rtcd_vtable_t; - -#if CONFIG_RUNTIME_CPU_DETECT -#define DEQUANT_INVOKE(ctx,fn) (ctx)->fn -#else -#define DEQUANT_INVOKE(ctx,fn) vp8_dequant_##fn -#endif - void vp8_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride); diff --git a/vp8/decoder/generic/dsystemdependent.c b/vp8/decoder/generic/dsystemdependent.c deleted file mode 100644 index b7b65d9028..0000000000 --- a/vp8/decoder/generic/dsystemdependent.c +++ /dev/null @@ -1,46 +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. - */ - - -#include "vpx_ports/config.h" -#include "vp8/decoder/dequantize.h" -#include "vp8/decoder/onyxd_int.h" - -extern void vp8_arch_x86_decode_init(VP8D_COMP *pbi); -extern void vp8_arch_arm_decode_init(VP8D_COMP *pbi); - -void vp8_dmachine_specific_config(VP8D_COMP *pbi) { - /* Pure C: */ -#if CONFIG_RUNTIME_CPU_DETECT - pbi->mb.rtcd = &pbi->common.rtcd; - pbi->dequant.block_2x2 = vp8_dequantize_b_2x2_c; - pbi->dequant.idct_add_8x8 = vp8_dequant_idct_add_8x8_c; - pbi->dequant.idct_add_16x16 = vp8_dequant_idct_add_16x16_c; - pbi->dequant.dc_idct_add_8x8 = vp8_dequant_dc_idct_add_8x8_c; - pbi->dequant.dc_idct_add_y_block_8x8 = vp8_dequant_dc_idct_add_y_block_8x8_c; - pbi->dequant.idct_add_y_block_8x8 = vp8_dequant_idct_add_y_block_8x8_c; - pbi->dequant.idct_add_uv_block_8x8 = vp8_dequant_idct_add_uv_block_8x8_c; - pbi->dequant.block = vp8_dequantize_b_c; - pbi->dequant.idct_add = vp8_dequant_idct_add_c; - pbi->dequant.dc_idct_add = vp8_dequant_dc_idct_add_c; - pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_c; - pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_c; - pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_c; -#endif - -#if ARCH_X86 || ARCH_X86_64 - vp8_arch_x86_decode_init(pbi); -#endif - - -#if ARCH_ARM - vp8_arch_arm_decode_init(pbi); -#endif -} diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c index 2e7751325d..20fad9f46d 100644 --- a/vp8/decoder/onyxd_if.c +++ b/vp8/decoder/onyxd_if.c @@ -133,7 +133,6 @@ VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf) { vp8dx_initialize(); vp8_create_common(&pbi->common); - vp8_dmachine_specific_config(pbi); pbi->common.current_video_frame = 0; pbi->ready_for_new_data = 1; diff --git a/vp8/decoder/onyxd_int.h b/vp8/decoder/onyxd_int.h index 0a84256e29..7d70a0dd8f 100644 --- a/vp8/decoder/onyxd_int.h +++ b/vp8/decoder/onyxd_int.h @@ -71,9 +71,11 @@ typedef struct VP8Decompressor { DETOK detoken; -#if CONFIG_RUNTIME_CPU_DETECT - vp8_dequant_rtcd_vtable_t dequant; -#endif + vp8_dequant_idct_add_fn_t idct_add; + vp8_dequant_dc_idct_add_fn_t dc_idct_add; + vp8_dequant_dc_idct_add_y_block_fn_t dc_idct_add_y_block; + vp8_dequant_idct_add_y_block_fn_t idct_add_y_block; + vp8_dequant_idct_add_uv_block_fn_t idct_add_uv_block; vp8_prob prob_skip_false; @@ -82,7 +84,6 @@ typedef struct VP8Decompressor { } VP8D_COMP; int vp8_decode_frame(VP8D_COMP *cpi); -void vp8_dmachine_specific_config(VP8D_COMP *pbi); #if CONFIG_DEBUG diff --git a/vp8/decoder/x86/dequantize_x86.h b/vp8/decoder/x86/dequantize_x86.h deleted file mode 100644 index 32f25cced0..0000000000 --- a/vp8/decoder/x86/dequantize_x86.h +++ /dev/null @@ -1,70 +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 DEQUANTIZE_X86_H -#define DEQUANTIZE_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_dequant_block(vp8_dequantize_b_mmx); -extern prototype_dequant_idct_add(vpx_dequant_idct_add_mmx); -extern prototype_dequant_dc_idct_add(vpx_dequant_dc_idct_add_mmx); -extern prototype_dequant_dc_idct_add_y_block(vp8_dequant_dc_idct_add_y_block_mmx); -extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block_mmx); -extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block_mmx); - -#if !CONFIG_RUNTIME_CPU_DETECT -#undef vp8_dequant_block -#define vp8_dequant_block vp8_dequantize_b_mmx - -#undef vp8_dequant_idct_add -#define vp8_dequant_idct_add vpx_dequant_idct_add_mmx - -#undef vp8_dequant_dc_idct_add -#define vp8_dequant_dc_idct_add vp8_dequant_dc_idct_add_mmx - -#undef vp8_dequant_dc_idct_add_y_block -#define vp8_dequant_dc_idct_add_y_block vp8_dequant_dc_idct_add_y_block_mmx - -#undef vp8_dequant_idct_add_y_block -#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_mmx - -#undef vp8_dequant_idct_add_uv_block -#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_mmx - -#endif -#endif - -#if HAVE_SSE2 -extern prototype_dequant_dc_idct_add_y_block(vp8_dequant_dc_idct_add_y_block_sse2); -extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block_sse2); -extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block_sse2); - -#if !CONFIG_RUNTIME_CPU_DETECT -#undef vp8_dequant_dc_idct_add_y_block -#define vp8_dequant_dc_idct_add_y_block vp8_dequant_dc_idct_add_y_block_sse2 - -#undef vp8_dequant_idct_add_y_block -#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_sse2 - -#undef vp8_dequant_idct_add_uv_block -#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_sse2 - -#endif -#endif - -#endif diff --git a/vp8/decoder/x86/x86_dsystemdependent.c b/vp8/decoder/x86/x86_dsystemdependent.c index ec70897526..430fc946ce 100644 --- a/vp8/decoder/x86/x86_dsystemdependent.c +++ b/vp8/decoder/x86/x86_dsystemdependent.c @@ -25,34 +25,4 @@ void vp8_dequantize_b_mmx(BLOCKD *d) { } #endif -void vp8_arch_x86_decode_init(VP8D_COMP *pbi) { -#if CONFIG_RUNTIME_CPU_DETECT - int flags = x86_simd_caps(); - /* Note: - * - * This platform can be built without runtime CPU detection as well. If - * you modify any of the function mappings present in this file, be sure - * to also update them in static mapings (<arch>/filename_<arch>.h) - */ - /* Override default functions with fastest ones for this CPU. */ -#if HAVE_MMX - if (flags & HAS_MMX) { - pbi->dequant.block = vp8_dequantize_b_mmx; - pbi->dequant.idct_add = vpx_dequant_idct_add_mmx; - pbi->dequant.dc_idct_add = vpx_dequant_dc_idct_add_mmx; - pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_mmx; - pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_mmx; - pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_mmx; - } -#endif -#if HAVE_SSE2 - if (flags & HAS_SSE2) { - // pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_sse2; - // pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_sse2; - // pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_sse2; - } -#endif - -#endif -} diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 3ff033719e..4e7123cd33 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -64,7 +64,6 @@ extern void vp8cx_pick_filter_level_fast(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi); extern void vp8cx_set_alt_lf_level(VP8_COMP *cpi, int filt_val); extern void vp8cx_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi); -extern void vp8_dmachine_specific_config(VP8_COMP *cpi); extern void vp8_cmachine_specific_config(VP8_COMP *cpi); extern void vp8_deblock_frame(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *post, int filt_lvl, int low_var_thresh, int flag); extern void print_parms(VP8_CONFIG *ocf, char *filenam); @@ -313,7 +312,6 @@ void vp8_initialize() { if (!init_done) { vp8_scale_machine_specific_config(); vp8_initialize_common(); - // vp8_dmachine_specific_config(); vp8_tokenize_initialize(); vp8_init_quant_tables(); vp8_init_me_luts(); diff --git a/vp8/vp8dx.mk b/vp8/vp8dx.mk index 5de493ddc0..15895c5293 100644 --- a/vp8/vp8dx.mk +++ b/vp8/vp8dx.mk @@ -54,7 +54,6 @@ VP8_DX_SRCS-yes += decoder/decodemv.c VP8_DX_SRCS-yes += decoder/decodframe.c VP8_DX_SRCS-yes += decoder/dequantize.c VP8_DX_SRCS-yes += decoder/detokenize.c -VP8_DX_SRCS-yes += decoder/generic/dsystemdependent.c VP8_DX_SRCS-yes += decoder/dboolhuff.h VP8_DX_SRCS-yes += decoder/decodemv.h VP8_DX_SRCS-yes += decoder/dequantize.h @@ -66,7 +65,6 @@ VP8_DX_SRCS-yes += decoder/idct_blk.c VP8_DX_SRCS-yes := $(filter-out $(VP8_DX_SRCS_REMOVE-yes),$(VP8_DX_SRCS-yes)) -VP8_DX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += decoder/x86/dequantize_x86.h VP8_DX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += decoder/x86/x86_dsystemdependent.c VP8_DX_SRCS-$(HAVE_MMX) += decoder/x86/dequantize_mmx.asm VP8_DX_SRCS-$(HAVE_MMX) += decoder/x86/idct_blk_mmx.c diff --git a/vp8/vp8dx_arm.mk b/vp8/vp8dx_arm.mk index 6bde42f4c3..8020c3d610 100644 --- a/vp8/vp8dx_arm.mk +++ b/vp8/vp8dx_arm.mk @@ -11,9 +11,7 @@ #VP8_DX_SRCS list is modified according to different platforms. -VP8_DX_SRCS-$(ARCH_ARM) += decoder/arm/arm_dsystemdependent.c VP8_DX_SRCS-$(ARCH_ARM) += decoder/arm/dequantize_arm.c -VP8_DX_SRCS-$(ARCH_ARM) += decoder/arm/dequantize_arm.h #File list for armv6 VP8_DX_SRCS-$(HAVE_ARMV6) += decoder/arm/armv6/dequant_dc_idct_v6$(ASM) -- GitLab