From 818ee904a99288aabf4c8524c6e6777fb600ee8b Mon Sep 17 00:00:00 2001 From: Jim Bankoski Date: Mon, 29 Oct 2012 11:25:56 -0700 Subject: [PATCH] remove fdct invoke macros Remove the fdct invoke macro calls Change-Id: Ica2431c655819fa012133ee7abc75a16761e5fd6 --- vp8/common/rtcd_defs.sh | 28 ++++++++ vp8/encoder/arm/dct_arm.c | 2 +- vp8/encoder/dct.h | 97 -------------------------- vp8/encoder/encodeintra.c | 1 - vp8/encoder/encodemb.c | 1 - vp8/encoder/generic/csystemdependent.c | 13 ---- vp8/encoder/onyx_if.c | 35 ++++------ vp8/encoder/onyx_int.h | 2 - vp8/encoder/rdopt.c | 1 - vp8/encoder/satd_c.c | 3 +- vp8/encoder/x86/dct_x86.h | 73 ------------------- 11 files changed, 45 insertions(+), 211 deletions(-) delete mode 100644 vp8/encoder/dct.h delete mode 100644 vp8/encoder/x86/dct_x86.h diff --git a/vp8/common/rtcd_defs.sh b/vp8/common/rtcd_defs.sh index 5e7a0e5d8..0feb441f0 100644 --- a/vp8/common/rtcd_defs.sh +++ b/vp8/common/rtcd_defs.sh @@ -412,5 +412,33 @@ if [ "$CONFIG_INTERNAL_STATS" = "yes" ]; then specialize vp8_ssim_parms_16x16 $sse2_on_x86_64 fi +# fdct functions +prototype void vp8_short_fdct8x8 "short *InputData, short *OutputData, int pitch" +specialize vp8_short_fdct8x8 + +prototype void vp8_short_fhaar2x2 "short *InputData, short *OutputData, int pitch" +specialize vp8_short_fhaar2x2 + +prototype void vp8_short_fdct4x4 "short *InputData, short *OutputData, int pitch" +specialize vp8_short_fdct4x4 + +prototype void vp8_short_fdct8x4 "short *InputData, short *OutputData, int pitch" +specialize vp8_short_fdct8x4 + +prototype void vp8_short_walsh4x4 "short *InputData, short *OutputData, int pitch" +specialize vp8_short_walsh4x4 + +prototype void vp8_short_fdct16x16 "short *InputData, short *OutputData, int pitch" +specialize vp8_short_fdct16x16 + +prototype void vp8_short_walsh4x4_lossless "short *InputData, short *OutputData, int pitch" +specialize vp8_short_walsh4x4_lossless + +prototype void vp8_short_walsh4x4_x8 "short *InputData, short *OutputData, int pitch" +specialize vp8_short_walsh4x4_x8 + +prototype void vp8_short_walsh8x4_x8 "short *InputData, short *OutputData, int pitch" +specialize vp8_short_walsh8x4_x8 + fi # end encoder functions diff --git a/vp8/encoder/arm/dct_arm.c b/vp8/encoder/arm/dct_arm.c index 913d5c0f0..97376de32 100644 --- a/vp8/encoder/arm/dct_arm.c +++ b/vp8/encoder/arm/dct_arm.c @@ -9,7 +9,7 @@ */ #include "vpx_config.h" -#include "vp8/encoder/dct.h" +#include "./vpx_rtcd.h" #if HAVE_ARMV6 diff --git a/vp8/encoder/dct.h b/vp8/encoder/dct.h deleted file mode 100644 index 4ad1fe85d..000000000 --- a/vp8/encoder/dct.h +++ /dev/null @@ -1,97 +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 __INC_DCT_H -#define __INC_DCT_H - -#include "vpx_config.h" -#include "vp8/common/blockd.h" - -#define prototype_fdct(sym) void (sym)(short *input, short *output, int pitch) - -#if ARCH_X86 || ARCH_X86_64 -#include "x86/dct_x86.h" -#endif - -#if ARCH_ARM -#include "arm/dct_arm.h" -#endif - - -void vp8_fht_c(short *input, short *output, int pitch, - TX_TYPE tx_type, int tx_dim); - -#ifndef vp8_fdct_short16x16 -#define vp8_fdct_short16x16 vp8_short_fdct16x16_c -#endif -extern prototype_fdct(vp8_fdct_short16x16); - -#ifndef vp8_fdct_short8x8 -#define vp8_fdct_short8x8 vp8_short_fdct8x8_c -#endif -extern prototype_fdct(vp8_fdct_short8x8); - -#ifndef vp8_fhaar_short2x2 -#define vp8_fdct_haar_short2x2 vp8_fhaar_short2x2 -#define vp8_fhaar_short2x2 vp8_short_fhaar2x2_c -#endif -extern prototype_fdct(vp8_fhaar_short2x2); - - -#ifndef vp8_fdct_short4x4 -#define vp8_fdct_short4x4 vp8_short_fdct4x4_c -#endif -extern prototype_fdct(vp8_fdct_short4x4); - -#ifndef vp8_fdct_short8x4 -#define vp8_fdct_short8x4 vp8_short_fdct8x4_c -#endif -extern prototype_fdct(vp8_fdct_short8x4); - -// There is no fast4x4 (for now) -#ifndef vp8_fdct_fast4x4 -#define vp8_fdct_fast4x4 vp8_short_fdct4x4_c -#endif - -#ifndef vp8_fdct_fast8x4 -#define vp8_fdct_fast8x4 vp8_short_fdct8x4_c -#endif - -#ifndef vp8_fdct_walsh_short4x4 -#define vp8_fdct_walsh_short4x4 vp8_short_walsh4x4_c -#endif -extern prototype_fdct(vp8_fdct_walsh_short4x4); - -#if CONFIG_LOSSLESS -extern prototype_fdct(vp8_short_walsh4x4_x8_c); -extern prototype_fdct(vp8_short_walsh8x4_x8_c); -extern prototype_fdct(vp8_short_walsh4x4_lossless_c); -#endif - -typedef prototype_fdct(*vp8_fdct_fn_t); -typedef struct { - vp8_fdct_fn_t short16x16; - vp8_fdct_fn_t short8x8; - vp8_fdct_fn_t haar_short2x2; - vp8_fdct_fn_t short4x4; - vp8_fdct_fn_t short8x4; - vp8_fdct_fn_t fast4x4; - vp8_fdct_fn_t fast8x4; - vp8_fdct_fn_t walsh_short4x4; -} vp8_fdct_rtcd_vtable_t; - -#if CONFIG_RUNTIME_CPU_DETECT -#define FDCT_INVOKE(ctx,fn) (ctx)->fn -#else -#define FDCT_INVOKE(ctx,fn) vp8_fdct_##fn -#endif - -#endif diff --git a/vp8/encoder/encodeintra.c b/vp8/encoder/encodeintra.c index e0f198734..508e5aaa5 100644 --- a/vp8/encoder/encodeintra.c +++ b/vp8/encoder/encodeintra.c @@ -16,7 +16,6 @@ #include "vp8/common/reconintra4x4.h" #include "encodemb.h" #include "vp8/common/invtrans.h" -#include "dct.h" #include "vp8/common/g_common.h" #include "encodeintra.h" diff --git a/vp8/encoder/encodemb.c b/vp8/encoder/encodemb.c index aaf0819b8..ee9c56ae5 100644 --- a/vp8/encoder/encodemb.c +++ b/vp8/encoder/encodemb.c @@ -15,7 +15,6 @@ #include "tokenize.h" #include "vp8/common/invtrans.h" #include "vp8/common/reconintra.h" -#include "dct.h" #include "vpx_mem/vpx_mem.h" #include "rdopt.h" #include "vp8/common/systemdependent.h" diff --git a/vp8/encoder/generic/csystemdependent.c b/vp8/encoder/generic/csystemdependent.c index 71f8780d4..dbe36249d 100644 --- a/vp8/encoder/generic/csystemdependent.c +++ b/vp8/encoder/generic/csystemdependent.c @@ -24,23 +24,10 @@ void vp8_cmachine_specific_config(VP8_COMP *cpi) { #if CONFIG_RUNTIME_CPU_DETECT cpi->rtcd.common = &cpi->common.rtcd; - cpi->rtcd.fdct.short8x8 = vp8_short_fdct8x8_c; - cpi->rtcd.fdct.short16x16 = vp8_short_fdct16x16_c; - cpi->rtcd.fdct.haar_short2x2 = vp8_short_fhaar2x2_c; - cpi->rtcd.fdct.short4x4 = vp8_short_fdct4x4_c; - cpi->rtcd.fdct.short8x4 = vp8_short_fdct8x4_c; - cpi->rtcd.fdct.fast4x4 = vp8_short_fdct4x4_c; - cpi->rtcd.fdct.fast8x4 = vp8_short_fdct8x4_c; - cpi->rtcd.fdct.walsh_short4x4 = vp8_short_walsh4x4_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; cpi->rtcd.temporal.apply = vp8_temporal_filter_apply_c; - cpi->rtcd.fdct.short4x4 = vp8_short_fdct4x4_c; - cpi->rtcd.fdct.short8x4 = vp8_short_fdct8x4_c; - cpi->rtcd.fdct.fast4x4 = vp8_short_fdct4x4_c; - cpi->rtcd.fdct.fast8x4 = vp8_short_fdct8x4_c; - cpi->rtcd.fdct.walsh_short4x4 = vp8_short_walsh4x4_c; #endif vp8_yv12_copy_partial_frame_ptr = vp8_yv12_copy_partial_frame; diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 25d865484..1c37eb133 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -167,9 +167,6 @@ extern unsigned int inter_uv_modes[VP8_UV_MODES]; extern unsigned int inter_b_modes[B_MODE_COUNT]; #endif -extern void (*vp8_short_fdct4x4)(short *input, short *output, int pitch); -extern void (*vp8_short_fdct8x4)(short *input, short *output, int pitch); - extern void vp8cx_init_quantizer(VP8_COMP *cpi); int vp8cx_base_skip_false_prob[QINDEX_RANGE][3]; @@ -1190,20 +1187,23 @@ void vp8_set_speed_features(VP8_COMP *cpi) { vp8_init_dsmotion_compensation(&cpi->mb, cm->yv12_fb[cm->lst_fb_idx].y_stride); } - if (cpi->sf.improved_dct) { - cpi->mb.vp8_short_fdct16x16 = FDCT_INVOKE(&cpi->rtcd.fdct, short16x16); - cpi->mb.vp8_short_fdct8x8 = FDCT_INVOKE(&cpi->rtcd.fdct, short8x8); - cpi->mb.vp8_short_fdct8x4 = FDCT_INVOKE(&cpi->rtcd.fdct, short8x4); - cpi->mb.vp8_short_fdct4x4 = FDCT_INVOKE(&cpi->rtcd.fdct, short4x4); - } else { - cpi->mb.vp8_short_fdct16x16 = FDCT_INVOKE(&cpi->rtcd.fdct, short16x16); - cpi->mb.vp8_short_fdct8x8 = FDCT_INVOKE(&cpi->rtcd.fdct, short8x8); - cpi->mb.vp8_short_fdct8x4 = FDCT_INVOKE(&cpi->rtcd.fdct, fast8x4); - cpi->mb.vp8_short_fdct4x4 = FDCT_INVOKE(&cpi->rtcd.fdct, fast4x4); + cpi->mb.vp8_short_fdct16x16 = vp8_short_fdct16x16; + cpi->mb.vp8_short_fdct8x8 = vp8_short_fdct8x8; + cpi->mb.vp8_short_fdct8x4 = vp8_short_fdct8x4; + cpi->mb.vp8_short_fdct4x4 = vp8_short_fdct4x4; + cpi->mb.short_walsh4x4 = vp8_short_walsh4x4; + cpi->mb.short_fhaar2x2 = vp8_short_fhaar2x2; + +#if CONFIG_LOSSLESS + if (cpi->oxcf.lossless) { + cpi->mb.vp8_short_fdct8x4 = vp8_short_walsh8x4_x8; + cpi->mb.vp8_short_fdct4x4 = vp8_short_walsh4x4_x8; + cpi->mb.short_walsh4x4 = vp8_short_walsh4x4; + cpi->mb.short_fhaar2x2 = vp8_short_fhaar2x2; + cpi->mb.short_walsh4x4 = vp8_short_walsh4x4_lossless; } +#endif - cpi->mb.short_walsh4x4 = FDCT_INVOKE(&cpi->rtcd.fdct, walsh_short4x4); - cpi->mb.short_fhaar2x2 = FDCT_INVOKE(&cpi->rtcd.fdct, haar_short2x2); cpi->mb.quantize_b_4x4 = vp8_regular_quantize_b_4x4; @@ -1524,11 +1524,6 @@ void vp8_change_config(VP8_PTR ptr, VP8_CONFIG *oxcf) { #if CONFIG_LOSSLESS cpi->oxcf.lossless = oxcf->lossless; if (cpi->oxcf.lossless) { - cpi->rtcd.fdct.short4x4 = vp8_short_walsh4x4_x8_c; - cpi->rtcd.fdct.fast4x4 = vp8_short_walsh4x4_x8_c; - cpi->rtcd.fdct.short8x4 = vp8_short_walsh8x4_x8_c; - cpi->rtcd.fdct.fast8x4 = vp8_short_walsh8x4_x8_c; - cpi->rtcd.fdct.walsh_short4x4 = vp8_short_walsh4x4_lossless_c; cpi->common.rtcd.idct.idct1 = vp8_short_inv_walsh4x4_1_x8_c; cpi->common.rtcd.idct.idct16 = vp8_short_inv_walsh4x4_x8_c; cpi->common.rtcd.idct.idct1_scalar_add = vp8_dc_only_inv_walsh_add_c; diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index fbf18443b..b94b736bc 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -19,7 +19,6 @@ #include "tokenize.h" #include "vp8/common/onyxc_int.h" #include "variance.h" -#include "dct.h" #include "encodemb.h" #include "quantize.h" #include "vp8/common/entropy.h" @@ -350,7 +349,6 @@ typedef struct { typedef struct VP8_ENCODER_RTCD { VP8_COMMON_RTCD *common; - vp8_fdct_rtcd_vtable_t fdct; 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 199f7bcb9..c111d6184 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -35,7 +35,6 @@ #include "rdopt.h" #include "ratectrl.h" #include "vpx_mem/vpx_mem.h" -#include "dct.h" #include "vp8/common/systemdependent.h" #include "vp8/encoder/encodemv.h" diff --git a/vp8/encoder/satd_c.c b/vp8/encoder/satd_c.c index 2ce1b9937..4a76de36b 100644 --- a/vp8/encoder/satd_c.c +++ b/vp8/encoder/satd_c.c @@ -9,9 +9,8 @@ */ #include -#include "dct.h" #include "vpx_ports/mem.h" - +#include "./vpx_rtcd.h" unsigned int vp8_satd16x16_c(const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, diff --git a/vp8/encoder/x86/dct_x86.h b/vp8/encoder/x86/dct_x86.h deleted file mode 100644 index 19f6c1686..000000000 --- a/vp8/encoder/x86/dct_x86.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 DCT_X86_H -#define DCT_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_fdct(vp8_short_fdct4x4_mmx); -extern prototype_fdct(vp8_short_fdct8x4_mmx); - -#if !CONFIG_RUNTIME_CPU_DETECT - -#undef vp8_fdct_short4x4 -#define vp8_fdct_short4x4 vp8_short_fdct4x4_mmx - -#undef vp8_fdct_short8x4 -#define vp8_fdct_short8x4 vp8_short_fdct8x4_mmx - -#undef vp8_fdct_fast4x4 -#define vp8_fdct_fast4x4 vp8_short_fdct4x4_mmx - -#undef vp8_fdct_fast8x4 -#define vp8_fdct_fast8x4 vp8_short_fdct8x4_mmx - -#endif - -#endif - - -#if HAVE_SSE2 -extern prototype_fdct(vp8_short_fdct8x4_sse2); -extern prototype_fdct(vp8_short_walsh4x4_sse2); - -extern prototype_fdct(vp8_short_fdct4x4_sse2); - -#if !CONFIG_RUNTIME_CPU_DETECT - -#undef vp8_fdct_short4x4 -#define vp8_fdct_short4x4 vp8_short_fdct4x4_sse2 - -#undef vp8_fdct_short8x4 -#define vp8_fdct_short8x4 vp8_short_fdct8x4_sse2 - -#undef vp8_fdct_fast4x4 -#define vp8_fdct_fast4x4 vp8_short_fdct4x4_sse2 - -#undef vp8_fdct_fast8x4 -#define vp8_fdct_fast8x4 vp8_short_fdct8x4_sse2 - -#undef vp8_fdct_walsh_short4x4 -#define vp8_fdct_walsh_short4x4 vp8_short_walsh4x4_sse2 - -#endif - - -#endif - -#endif -- 2.40.0