diff --git a/vp8/common/rtcd_defs.sh b/vp8/common/rtcd_defs.sh index 5e7a0e5d8025c9d1b62d9d89b1c3d5069cdff861..0feb441f0a006f0f86faf91f3a73a16a97d312c2 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 913d5c0f035d038947d56388739b4d34033a38e0..97376de32306ddfce9f232f7fd7839a53a1abecc 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 4ad1fe85d352b3acf1c390deabd0c6f437cd695f..0000000000000000000000000000000000000000 --- 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 e0f19873489c8093d880074afa19f27ff3a3f492..508e5aaa520d13b6de00c5cf65949ff90801a7f6 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 aaf0819b8dc3232f5218e9756b55b02a33cfabf8..ee9c56ae52fefc05dce544f77ccf9b0604793987 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 71f8780d4cee10ab00ef1288b476cb69d4583cac..dbe36249d0cbc6b20866e746e2a862c609431c51 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 25d8654843608f92e9ef94bf24fc5218c0c5924d..1c37eb1331c47a2355952bd39bbcec7ed908870c 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 fbf18443bc718846a73e60656c82815e7d5a93d9..b94b736bcd1a08ed07988f6bfa0905f7f571c82c 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 199f7bcb98204bd678eb15d943275eb0b37acfdd..c111d61849c92f7b13405533e26d2e782e82234e 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 2ce1b993792a686b3bd66d652b2d905e86c7c99f..4a76de36b5ced41c20058bbea0f2a916a1f2fa80 100644 --- a/vp8/encoder/satd_c.c +++ b/vp8/encoder/satd_c.c @@ -9,9 +9,8 @@ */ #include <stdlib.h> -#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 19f6c1686486a071d42907e17f8aaa0125b7f98f..0000000000000000000000000000000000000000 --- 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