From 109b69a70696701f5d886a21719cf62d75782fa1 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Thu, 12 Jan 2012 16:55:44 -0800 Subject: [PATCH] RTCD: add arnr functions This commit continues the process of converting to the new RTCD system. It removes the last of the VP8_ENCODER_RTCD struct references. Change-Id: I2a44f52d7cccf5177e1ca98a028ead570d045395 --- vp8/common/blockd.h | 4 --- vp8/common/rtcd_defs.sh | 7 ++++ vp8/decoder/decodframe.c | 5 --- vp8/decoder/threading.c | 9 ----- vp8/encoder/encodeframe.c | 21 ++++------- vp8/encoder/encodeintra.c | 27 +++++---------- vp8/encoder/encodeintra.h | 9 +++-- vp8/encoder/encodemb.c | 36 ++++++++----------- vp8/encoder/encodemb.h | 9 +++-- vp8/encoder/ethreading.c | 3 -- vp8/encoder/firstpass.c | 8 +---- vp8/encoder/generic/csystemdependent.c | 6 ---- vp8/encoder/onyx_if.c | 9 ----- vp8/encoder/onyx_int.h | 10 ------ vp8/encoder/pickinter.c | 16 +++------ vp8/encoder/picklpf.c | 6 ---- vp8/encoder/rdopt.c | 7 ---- vp8/encoder/temporal_filter.c | 6 ++-- vp8/encoder/temporal_filter.h | 48 -------------------------- vp8/encoder/x86/temporal_filter_x86.h | 27 --------------- vp8/encoder/x86/x86_csystemdependent.c | 22 ------------ vp8/vp8cx.mk | 2 -- 22 files changed, 54 insertions(+), 243 deletions(-) delete mode 100644 vp8/encoder/temporal_filter.h delete mode 100644 vp8/encoder/x86/temporal_filter_x86.h diff --git a/vp8/common/blockd.h b/vp8/common/blockd.h index 82c55a9e9..d8df42b48 100644 --- a/vp8/common/blockd.h +++ b/vp8/common/blockd.h @@ -287,10 +287,6 @@ typedef struct macroblockd */ DECLARE_ALIGNED(32, unsigned char, y_buf[22*32]); #endif - -#if CONFIG_RUNTIME_CPU_DETECT - struct VP8_COMMON_RTCD *rtcd; -#endif } MACROBLOCKD; diff --git a/vp8/common/rtcd_defs.sh b/vp8/common/rtcd_defs.sh index e18ca97da..13fe8ecdd 100644 --- a/vp8/common/rtcd_defs.sh +++ b/vp8/common/rtcd_defs.sh @@ -481,6 +481,13 @@ vp8_refining_search_sad_sse3=vp8_refining_search_sadx4 prototype int vp8_diamond_search_sad "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv" vp8_diamond_search_sad_sse3=vp8_diamond_search_sadx4 +# +# Alt-ref Noise Reduction (ARNR) +# +if [ "$CONFIG_REALTIME_ONLY" != "yes" ]; then + prototype void vp8_temporal_filter_apply "unsigned char *frame1, unsigned int stride, unsigned char *frame2, unsigned int block_size, int strength, int filter_weight, unsigned int *accumulator, unsigned short *count" + specialize vp8_temporal_filter_apply sse2 +fi # End of encoder only functions fi diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index ed0e3250d..7ba573123 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -93,11 +93,6 @@ void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd) } } -#if CONFIG_RUNTIME_CPU_DETECT -#define RTCD_VTABLE(x) (&(pbi)->common.rtcd.x) -#else -#define RTCD_VTABLE(x) NULL -#endif static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, unsigned int mb_idx) diff --git a/vp8/decoder/threading.c b/vp8/decoder/threading.c index bb7734013..c2b15cf18 100644 --- a/vp8/decoder/threading.c +++ b/vp8/decoder/threading.c @@ -30,12 +30,6 @@ extern void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd); -#if CONFIG_RUNTIME_CPU_DETECT -#define RTCD_VTABLE(x) (&(pbi)->common.rtcd.x) -#else -#define RTCD_VTABLE(x) NULL -#endif - static void setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_DEC *mbrd, int count) { VP8_COMMON *const pc = & pbi->common; @@ -44,9 +38,6 @@ static void setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_D for (i = 0; i < count; i++) { MACROBLOCKD *mbd = &mbrd[i].mbd; -#if CONFIG_RUNTIME_CPU_DETECT - mbd->rtcd = xd->rtcd; -#endif mbd->subpixel_predict = xd->subpixel_predict; mbd->subpixel_predict8x4 = xd->subpixel_predict8x4; mbd->subpixel_predict8x8 = xd->subpixel_predict8x8; diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index 2392f0220..8fb05843e 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -29,13 +29,6 @@ #include "vp8/common/invtrans.h" #include "vpx_ports/vpx_timer.h" -#if CONFIG_RUNTIME_CPU_DETECT -#define RTCD(x) &cpi->common.rtcd.x -#define IF_RTCD(x) (x) -#else -#define RTCD(x) NULL -#define IF_RTCD(x) NULL -#endif extern void vp8_stuff_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t) ; extern void vp8_calc_ref_frame_costs(int *ref_frame_cost, int prob_intra, @@ -1097,11 +1090,11 @@ int vp8cx_encode_intra_macro_block(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, } if (x->e_mbd.mode_info_context->mbmi.mode == B_PRED) - vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x); + vp8_encode_intra4x4mby(x); else - vp8_encode_intra16x16mby(IF_RTCD(&cpi->rtcd), x); + vp8_encode_intra16x16mby(x); - vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x); + vp8_encode_intra16x16mbuv(x); sum_intra_stats(cpi, x); vp8_tokenize_mb(cpi, &x->e_mbd, t); @@ -1239,15 +1232,15 @@ int vp8cx_encode_inter_macroblock if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) { - vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x); + vp8_encode_intra16x16mbuv(x); if (xd->mode_info_context->mbmi.mode == B_PRED) { - vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x); + vp8_encode_intra4x4mby(x); } else { - vp8_encode_intra16x16mby(IF_RTCD(&cpi->rtcd), x); + vp8_encode_intra16x16mby(x); } sum_intra_stats(cpi, x); @@ -1269,7 +1262,7 @@ int vp8cx_encode_inter_macroblock if (!x->skip) { - vp8_encode_inter16x16(IF_RTCD(&cpi->rtcd), x); + vp8_encode_inter16x16(x); // Clear mb_skip_coeff if mb_no_coeff_skip is not set if (!cpi->common.mb_no_coeff_skip) diff --git a/vp8/encoder/encodeintra.c b/vp8/encoder/encodeintra.c index c457906f6..1f83d2a49 100644 --- a/vp8/encoder/encodeintra.c +++ b/vp8/encoder/encodeintra.c @@ -18,12 +18,6 @@ #include "encodeintra.h" -#if CONFIG_RUNTIME_CPU_DETECT -#define IF_RTCD(x) (x) -#else -#define IF_RTCD(x) NULL -#endif - int vp8_encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_dc_pred) { @@ -33,13 +27,11 @@ int vp8_encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_dc_pred) if (use_dc_pred) { - const VP8_ENCODER_RTCD *rtcd = IF_RTCD(&cpi->rtcd); - x->e_mbd.mode_info_context->mbmi.mode = DC_PRED; x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED; x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME; - vp8_encode_intra16x16mby(rtcd, x); + vp8_encode_intra16x16mby(x); vp8_inverse_transform_mby(&x->e_mbd); } @@ -48,7 +40,7 @@ int vp8_encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_dc_pred) for (i = 0; i < 16; i++) { x->e_mbd.block[i].bmi.as_mode = B_DC_PRED; - vp8_encode_intra4x4block(IF_RTCD(&cpi->rtcd), x, i); + vp8_encode_intra4x4block(x, i); } } @@ -57,8 +49,7 @@ int vp8_encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_dc_pred) return intra_pred_var; } -void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd, - MACROBLOCK *x, int ib) +void vp8_encode_intra4x4block(MACROBLOCK *x, int ib) { BLOCKD *b = &x->e_mbd.block[ib]; BLOCK *be = &x->block[ib]; @@ -86,7 +77,7 @@ void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd, } } -void vp8_encode_intra4x4mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *mb) +void vp8_encode_intra4x4mby(MACROBLOCK *mb) { int i; @@ -94,11 +85,11 @@ void vp8_encode_intra4x4mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *mb) vp8_intra_prediction_down_copy(x); for (i = 0; i < 16; i++) - vp8_encode_intra4x4block(rtcd, mb, i); + vp8_encode_intra4x4block(mb, i); return; } -void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) +void vp8_encode_intra16x16mby(MACROBLOCK *x) { BLOCK *b = &x->block[0]; MACROBLOCKD *xd = &x->e_mbd; @@ -113,10 +104,10 @@ void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) vp8_quantize_mby(x); if (x->optimize) - vp8_optimize_mby(x, rtcd); + vp8_optimize_mby(x); } -void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) +void vp8_encode_intra16x16mbuv(MACROBLOCK *x) { MACROBLOCKD *xd = &x->e_mbd; @@ -131,5 +122,5 @@ void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) vp8_quantize_mbuv(x); if (x->optimize) - vp8_optimize_mbuv(x, rtcd); + vp8_optimize_mbuv(x); } diff --git a/vp8/encoder/encodeintra.h b/vp8/encoder/encodeintra.h index 9c1fa5684..be2141f2c 100644 --- a/vp8/encoder/encodeintra.h +++ b/vp8/encoder/encodeintra.h @@ -14,9 +14,8 @@ #include "onyx_int.h" int vp8_encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_dc_pred); -void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *, MACROBLOCK *x); -void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *, MACROBLOCK *x); -void vp8_encode_intra4x4mby(const VP8_ENCODER_RTCD *, MACROBLOCK *mb); -void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd, - MACROBLOCK *x, int ib); +void vp8_encode_intra16x16mby(MACROBLOCK *x); +void vp8_encode_intra16x16mbuv(MACROBLOCK *x); +void vp8_encode_intra4x4mby(MACROBLOCK *mb); +void vp8_encode_intra4x4block(MACROBLOCK *x, int ib); #endif diff --git a/vp8/encoder/encodemb.c b/vp8/encoder/encodemb.c index 8e139400b..f89e4f7a4 100644 --- a/vp8/encoder/encodemb.c +++ b/vp8/encoder/encodemb.c @@ -19,11 +19,6 @@ #include "vpx_mem/vpx_mem.h" #include "rdopt.h" -#if CONFIG_RUNTIME_CPU_DETECT -#define IF_RTCD(x) (x) -#else -#define IF_RTCD(x) NULL -#endif void vp8_subtract_b_c(BLOCK *be, BLOCKD *bd, int pitch) { unsigned char *src_ptr = (*(be->base_src) + be->src); @@ -98,7 +93,7 @@ void vp8_subtract_mby_c(short *diff, unsigned char *src, int src_stride, } } -static void vp8_subtract_mb(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) +static void vp8_subtract_mb(MACROBLOCK *x) { BLOCK *b = &x->block[0]; @@ -227,8 +222,7 @@ static const int plane_rd_mult[4]= }; static void optimize_b(MACROBLOCK *mb, int ib, int type, - ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l, - const VP8_ENCODER_RTCD *rtcd) + ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l) { BLOCK *b; BLOCKD *d; @@ -509,7 +503,7 @@ static void check_reset_2nd_coeffs(MACROBLOCKD *x, int type, } } -static void optimize_mb(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) +static void optimize_mb(MACROBLOCK *x) { int b; int type; @@ -532,27 +526,27 @@ static void optimize_mb(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) for (b = 0; b < 16; b++) { optimize_b(x, b, type, - ta + vp8_block2above[b], tl + vp8_block2left[b], rtcd); + ta + vp8_block2above[b], tl + vp8_block2left[b]); } for (b = 16; b < 24; b++) { optimize_b(x, b, PLANE_TYPE_UV, - ta + vp8_block2above[b], tl + vp8_block2left[b], rtcd); + ta + vp8_block2above[b], tl + vp8_block2left[b]); } if (has_2nd_order) { b=24; optimize_b(x, b, PLANE_TYPE_Y2, - ta + vp8_block2above[b], tl + vp8_block2left[b], rtcd); + ta + vp8_block2above[b], tl + vp8_block2left[b]); check_reset_2nd_coeffs(&x->e_mbd, PLANE_TYPE_Y2, ta + vp8_block2above[b], tl + vp8_block2left[b]); } } -void vp8_optimize_mby(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) +void vp8_optimize_mby(MACROBLOCK *x) { int b; int type; @@ -581,7 +575,7 @@ void vp8_optimize_mby(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) for (b = 0; b < 16; b++) { optimize_b(x, b, type, - ta + vp8_block2above[b], tl + vp8_block2left[b], rtcd); + ta + vp8_block2above[b], tl + vp8_block2left[b]); } @@ -589,13 +583,13 @@ void vp8_optimize_mby(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) { b=24; optimize_b(x, b, PLANE_TYPE_Y2, - ta + vp8_block2above[b], tl + vp8_block2left[b], rtcd); + ta + vp8_block2above[b], tl + vp8_block2left[b]); check_reset_2nd_coeffs(&x->e_mbd, PLANE_TYPE_Y2, ta + vp8_block2above[b], tl + vp8_block2left[b]); } } -void vp8_optimize_mbuv(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) +void vp8_optimize_mbuv(MACROBLOCK *x) { int b; ENTROPY_CONTEXT_PLANES t_above, t_left; @@ -617,26 +611,26 @@ void vp8_optimize_mbuv(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) for (b = 16; b < 24; b++) { optimize_b(x, b, PLANE_TYPE_UV, - ta + vp8_block2above[b], tl + vp8_block2left[b], rtcd); + ta + vp8_block2above[b], tl + vp8_block2left[b]); } } -void vp8_encode_inter16x16(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) +void vp8_encode_inter16x16(MACROBLOCK *x) { vp8_build_inter_predictors_mb(&x->e_mbd); - vp8_subtract_mb(rtcd, x); + vp8_subtract_mb(x); transform_mb(x); vp8_quantize_mb(x); if (x->optimize) - optimize_mb(x, rtcd); + optimize_mb(x); } /* this funciton is used by first pass only */ -void vp8_encode_inter16x16y(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) +void vp8_encode_inter16x16y(MACROBLOCK *x) { BLOCK *b = &x->block[0]; diff --git a/vp8/encoder/encodemb.h b/vp8/encoder/encodemb.h index df3ac2f6f..6badf7d90 100644 --- a/vp8/encoder/encodemb.h +++ b/vp8/encoder/encodemb.h @@ -13,15 +13,14 @@ #define __INC_ENCODEMB_H #include "onyx_int.h" -struct VP8_ENCODER_RTCD; -void vp8_encode_inter16x16(const struct VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x); +void vp8_encode_inter16x16(MACROBLOCK *x); void vp8_build_dcblock(MACROBLOCK *b); void vp8_transform_mb(MACROBLOCK *mb); void vp8_transform_mbuv(MACROBLOCK *x); void vp8_transform_intra_mby(MACROBLOCK *x); -void vp8_optimize_mby(MACROBLOCK *x, const struct VP8_ENCODER_RTCD *rtcd); -void vp8_optimize_mbuv(MACROBLOCK *x, const struct VP8_ENCODER_RTCD *rtcd); -void vp8_encode_inter16x16y(const struct VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x); +void vp8_optimize_mby(MACROBLOCK *x); +void vp8_optimize_mbuv(MACROBLOCK *x); +void vp8_encode_inter16x16y(MACROBLOCK *x); #endif diff --git a/vp8/encoder/ethreading.c b/vp8/encoder/ethreading.c index 9dfb426c7..bb6b2846c 100644 --- a/vp8/encoder/ethreading.c +++ b/vp8/encoder/ethreading.c @@ -425,9 +425,6 @@ void vp8cx_init_mbrthread_data(VP8_COMP *cpi, mbd->subpixel_predict8x4 = xd->subpixel_predict8x4; mbd->subpixel_predict8x8 = xd->subpixel_predict8x8; mbd->subpixel_predict16x16 = xd->subpixel_predict16x16; -#if CONFIG_RUNTIME_CPU_DETECT - mbd->rtcd = xd->rtcd; -#endif mb->gf_active_ptr = x->gf_active_ptr; vpx_memset(mbr_ei[i].segment_counts, 0, sizeof(mbr_ei[i].segment_counts)); diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c index 09f184c6b..6e5532c01 100644 --- a/vp8/encoder/firstpass.c +++ b/vp8/encoder/firstpass.c @@ -31,12 +31,6 @@ //#define OUTPUT_FPF 1 -#if CONFIG_RUNTIME_CPU_DETECT -#define IF_RTCD(x) (x) -#else -#define IF_RTCD(x) NULL -#endif - extern void vp8_build_block_offsets(MACROBLOCK *x); extern void vp8_setup_block_ptrs(MACROBLOCK *x); extern void vp8cx_frame_init_quantizer(VP8_COMP *cpi); @@ -674,7 +668,7 @@ void vp8_first_pass(VP8_COMP *cpi) d->bmi.mv.as_mv.col <<= 3; this_error = motion_error; vp8_set_mbmode_and_mvs(x, NEWMV, &d->bmi.mv); - vp8_encode_inter16x16y(IF_RTCD(&cpi->rtcd), x); + vp8_encode_inter16x16y(x); sum_mvr += d->bmi.mv.as_mv.row; sum_mvr_abs += abs(d->bmi.mv.as_mv.row); sum_mvc += d->bmi.mv.as_mv.col; diff --git a/vp8/encoder/generic/csystemdependent.c b/vp8/encoder/generic/csystemdependent.c index 1d6acca14..673a8050d 100644 --- a/vp8/encoder/generic/csystemdependent.c +++ b/vp8/encoder/generic/csystemdependent.c @@ -24,12 +24,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 -#if !(CONFIG_REALTIME_ONLY) - cpi->rtcd.temporal.apply = vp8_temporal_filter_apply_c; -#endif -#endif - // Pure C: 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 b02d378e0..b03b33953 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -31,7 +31,6 @@ #include "vp8/common/swapyv12buffer.h" #include "vp8/common/threading.h" #include "vpx_ports/vpx_timer.h" -#include "temporal_filter.h" #if ARCH_ARM #include "vpx_ports/arm.h" #endif @@ -43,14 +42,6 @@ #include #include -#if CONFIG_RUNTIME_CPU_DETECT -#define IF_RTCD(x) (x) -#define RTCD(x) &cpi->common.rtcd.x -#else -#define IF_RTCD(x) NULL -#define RTCD(x) NULL -#endif - 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); diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index f91e6df14..6920fc316 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -26,7 +26,6 @@ #include "vpx_ports/mem.h" #include "vpx/internal/vpx_codec_internal.h" #include "mcomp.h" -#include "temporal_filter.h" #include "vp8/common/findnearmv.h" #include "lookahead.h" @@ -220,12 +219,6 @@ typedef struct void *ptr1; } LPFTHREAD_DATA; - -typedef struct VP8_ENCODER_RTCD -{ - vp8_temporal_rtcd_vtable_t temporal; -} VP8_ENCODER_RTCD; - enum { BLOCK_16X8, @@ -609,9 +602,6 @@ typedef struct VP8_COMP double est_max_qcorrection_factor; } twopass; -#if CONFIG_RUNTIME_CPU_DETECT - VP8_ENCODER_RTCD rtcd; -#endif #if VP8_TEMPORAL_ALT_REF YV12_BUFFER_CONFIG alt_ref_buffer; YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS]; diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c index 4f69a5a89..732701126 100644 --- a/vp8/encoder/pickinter.c +++ b/vp8/encoder/pickinter.c @@ -25,12 +25,6 @@ #include "rdopt.h" #include "vpx_mem/vpx_mem.h" -#if CONFIG_RUNTIME_CPU_DETECT -#define IF_RTCD(x) (x) -#else -#define IF_RTCD(x) NULL -#endif - extern int VP8_UVSSE(MACROBLOCK *x); #ifdef SPEEDSTATS @@ -131,7 +125,6 @@ static int get_prediction_error(BLOCK *be, BLOCKD *b) } static int pick_intra4x4block( - const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x, int ib, B_PREDICTION_MODE *best_mode, @@ -169,14 +162,13 @@ static int pick_intra4x4block( } b->bmi.as_mode = (B_PREDICTION_MODE)(*best_mode); - vp8_encode_intra4x4block(rtcd, x, ib); + vp8_encode_intra4x4block(x, ib); return best_rd; } static int pick_intra4x4mby_modes ( - const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *mb, int *Rate, int *best_dist @@ -210,7 +202,7 @@ static int pick_intra4x4mby_modes } - pick_intra4x4block(rtcd, mb, i, &best_mode, bmode_costs, &r, &d); + pick_intra4x4block(mb, i, &best_mode, bmode_costs, &r, &d); cost += r; distortion += d; @@ -664,7 +656,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, case B_PRED: /* Pass best so far to pick_intra4x4mby_modes to use as breakout */ distortion2 = best_sse; - pick_intra4x4mby_modes(IF_RTCD(&cpi->rtcd), x, &rate, &distortion2); + pick_intra4x4mby_modes(x, &rate, &distortion2); if (distortion2 == INT_MAX) { @@ -1084,7 +1076,7 @@ void vp8_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate_) } x->e_mbd.mode_info_context->mbmi.mode = best_mode; - error4x4 = pick_intra4x4mby_modes(IF_RTCD(&cpi->rtcd), x, &rate, + error4x4 = pick_intra4x4mby_modes(x, &rate, &best_sse); if (error4x4 < error16x16) { diff --git a/vp8/encoder/picklpf.c b/vp8/encoder/picklpf.c index 09e45bea6..441514d91 100644 --- a/vp8/encoder/picklpf.c +++ b/vp8/encoder/picklpf.c @@ -23,12 +23,6 @@ extern int vp8_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest); -#if CONFIG_RUNTIME_CPU_DETECT -#define IF_RTCD(x) (x) -#else -#define IF_RTCD(x) NULL -#endif - extern void (*vp8_yv12_copy_partial_frame_ptr)(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc); diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 786138f3f..76c764844 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -34,13 +34,6 @@ #include "vpx_mem/vpx_mem.h" #include "vp8/common/systemdependent.h" -#if CONFIG_RUNTIME_CPU_DETECT -#define IF_RTCD(x) (x) -#else -#define IF_RTCD(x) NULL -#endif - - extern void vp8_update_zbin_extra(VP8_COMP *cpi, MACROBLOCK *x); #define MAXF(a,b) (((a) > (b)) ? (a) : (b)) diff --git a/vp8/encoder/temporal_filter.c b/vp8/encoder/temporal_filter.c index 62a7ec3ae..57caccf24 100644 --- a/vp8/encoder/temporal_filter.c +++ b/vp8/encoder/temporal_filter.c @@ -332,7 +332,7 @@ static void vp8_temporal_filter_iterate_c predictor); // Apply the filter (YUV) - TEMPORAL_INVOKE(&cpi->rtcd.temporal, apply) + vp8_temporal_filter_apply (f->y_buffer + mb_y_offset, f->y_stride, predictor, @@ -342,7 +342,7 @@ static void vp8_temporal_filter_iterate_c accumulator, count); - TEMPORAL_INVOKE(&cpi->rtcd.temporal, apply) + vp8_temporal_filter_apply (f->u_buffer + mb_uv_offset, f->uv_stride, predictor + 256, @@ -352,7 +352,7 @@ static void vp8_temporal_filter_iterate_c accumulator + 256, count + 256); - TEMPORAL_INVOKE(&cpi->rtcd.temporal, apply) + vp8_temporal_filter_apply (f->v_buffer + mb_uv_offset, f->uv_stride, predictor + 320, diff --git a/vp8/encoder/temporal_filter.h b/vp8/encoder/temporal_filter.h deleted file mode 100644 index 740037a85..000000000 --- a/vp8/encoder/temporal_filter.h +++ /dev/null @@ -1,48 +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_VP8_TEMPORAL_FILTER_H -#define __INC_VP8_TEMPORAL_FILTER_H - -#define prototype_apply(sym)\ - void (sym) \ - ( \ - unsigned char *frame1, \ - unsigned int stride, \ - unsigned char *frame2, \ - unsigned int block_size, \ - int strength, \ - int filter_weight, \ - unsigned int *accumulator, \ - unsigned short *count \ - ) - -#if ARCH_X86 || ARCH_X86_64 -#include "x86/temporal_filter_x86.h" -#endif - -#ifndef vp8_temporal_filter_apply -#define vp8_temporal_filter_apply vp8_temporal_filter_apply_c -#endif -extern prototype_apply(vp8_temporal_filter_apply); - -typedef struct -{ - prototype_apply(*apply); -} vp8_temporal_rtcd_vtable_t; - -#if CONFIG_RUNTIME_CPU_DETECT -#define TEMPORAL_INVOKE(ctx,fn) (ctx)->fn -#else -#define TEMPORAL_INVOKE(ctx,fn) vp8_temporal_filter_##fn -#endif - -#endif // __INC_VP8_TEMPORAL_FILTER_H diff --git a/vp8/encoder/x86/temporal_filter_x86.h b/vp8/encoder/x86/temporal_filter_x86.h deleted file mode 100644 index 2daa14018..000000000 --- a/vp8/encoder/x86/temporal_filter_x86.h +++ /dev/null @@ -1,27 +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_VP8_TEMPORAL_FILTER_X86_H -#define __INC_VP8_TEMPORAL_FILTER_X86_H - -#if HAVE_SSE2 -extern prototype_apply(vp8_temporal_filter_apply_sse2); - -#if !CONFIG_RUNTIME_CPU_DETECT - -#undef vp8_temporal_filter_apply -#define vp8_temporal_filter_apply vp8_temporal_filter_apply_sse2 - -#endif - -#endif - -#endif // __INC_VP8_TEMPORAL_FILTER_X86_H diff --git a/vp8/encoder/x86/x86_csystemdependent.c b/vp8/encoder/x86/x86_csystemdependent.c index 4d27d5cf7..8aa2e1fa3 100644 --- a/vp8/encoder/x86/x86_csystemdependent.c +++ b/vp8/encoder/x86/x86_csystemdependent.c @@ -114,26 +114,4 @@ void vp8_subtract_b_sse2(BLOCK *be, BLOCKD *bd, int pitch) void vp8_arch_x86_encoder_init(VP8_COMP *cpi) { -#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 (/filename_.h) - */ - - /* Override default functions with fastest ones for this CPU. */ -#if HAVE_SSE2 - if (flags & HAS_SSE2) - { -#if !(CONFIG_REALTIME_ONLY) - cpi->rtcd.temporal.apply = vp8_temporal_filter_apply_sse2; -#endif - - } -#endif - -#endif } diff --git a/vp8/vp8cx.mk b/vp8/vp8cx.mk index 8de4066e3..0d7120aed 100644 --- a/vp8/vp8cx.mk +++ b/vp8/vp8cx.mk @@ -84,7 +84,6 @@ VP8_CX_SRCS-yes += encoder/variance_c.c VP8_CX_SRCS-$(CONFIG_INTERNAL_STATS) += common/postproc.h VP8_CX_SRCS-$(CONFIG_INTERNAL_STATS) += common/postproc.c VP8_CX_SRCS-yes += encoder/temporal_filter.c -VP8_CX_SRCS-yes += encoder/temporal_filter.h VP8_CX_SRCS-$(CONFIG_MULTI_RES_ENCODING) += encoder/mr_dissim.c VP8_CX_SRCS-$(CONFIG_MULTI_RES_ENCODING) += encoder/mr_dissim.h @@ -93,7 +92,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/temporal_filter_x86.h VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/x86_csystemdependent.c VP8_CX_SRCS-$(HAVE_MMX) += encoder/x86/variance_mmx.c VP8_CX_SRCS-$(HAVE_MMX) += encoder/x86/variance_impl_mmx.asm -- 2.40.0