From 8edaf6e2f232f00de3e3aac1657a31a3effe9a11 Mon Sep 17 00:00:00 2001 From: Johann Date: Thu, 10 Feb 2011 14:57:43 -0500 Subject: use asm_offsets with vp8_regular_quantize_b_sse2 remove helper function and avoid shadowing all the arguments to the stack on 64bit systems when running with --good --cpu-used=0: ~2% on linux x86 and x86_64 ~2% on win32 x86 msys and visual studio more on darwin10 x86_64 significantly more on x86_64-win64-vs9 Change-Id: Ib7be12edf511fbf2922f191afd5b33b19a0c4ae6 --- vp8/encoder/asm_enc_offsets.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'vp8/encoder/asm_enc_offsets.c') diff --git a/vp8/encoder/asm_enc_offsets.c b/vp8/encoder/asm_enc_offsets.c index fcf77756a..c7983c1b0 100644 --- a/vp8/encoder/asm_enc_offsets.c +++ b/vp8/encoder/asm_enc_offsets.c @@ -12,9 +12,11 @@ #include "vpx_ports/config.h" #include +#include "block.h" +#include "vp8/common/blockd.h" +#include "onyx_int.h" #include "treewriter.h" #include "tokenize.h" -#include "onyx_int.h" #define ct_assert(name,cond) \ static void assert_##name(void) UNUSED;\ @@ -31,6 +33,21 @@ * { */ +//regular quantize +DEFINE(vp8_block_coeff, offsetof(BLOCK, coeff)); +DEFINE(vp8_block_zbin, offsetof(BLOCK, zbin)); +DEFINE(vp8_block_round, offsetof(BLOCK, round)); +DEFINE(vp8_block_quant, offsetof(BLOCK, quant)); +DEFINE(vp8_block_quant_fast, offsetof(BLOCK, quant_fast)); +DEFINE(vp8_block_zbin_extra, offsetof(BLOCK, zbin_extra)); +DEFINE(vp8_block_zrun_zbin_boost, offsetof(BLOCK, zrun_zbin_boost)); +DEFINE(vp8_block_quant_shift, offsetof(BLOCK, quant_shift)); + +DEFINE(vp8_blockd_qcoeff, offsetof(BLOCKD, qcoeff)); +DEFINE(vp8_blockd_dequant, offsetof(BLOCKD, dequant)); +DEFINE(vp8_blockd_dqcoeff, offsetof(BLOCKD, dqcoeff)); +DEFINE(vp8_blockd_eob, offsetof(BLOCKD, eob)); + //pack tokens DEFINE(vp8_writer_lowvalue, offsetof(vp8_writer, lowvalue)); DEFINE(vp8_writer_range, offsetof(vp8_writer, range)); @@ -65,17 +82,6 @@ DEFINE(TOKENLIST_SZ, sizeof(TOKENLIST)); DEFINE(vp8_common_mb_rows, offsetof(VP8_COMMON, mb_rows)); -// offsets from BLOCK structure -DEFINE(vp8_block_coeff, offsetof(BLOCK, coeff)); -DEFINE(vp8_block_quant_fast, offsetof(BLOCK, quant_fast)); -DEFINE(vp8_block_round, offsetof(BLOCK, round)); - -// offsets from BLOCKD structure -DEFINE(vp8_blockd_qcoeff, offsetof(BLOCKD, qcoeff)); -DEFINE(vp8_blockd_dqcoeff, offsetof(BLOCKD, dqcoeff)); -DEFINE(vp8_blockd_dequant, offsetof(BLOCKD, dequant)); -DEFINE(vp8_blockd_eob, offsetof(BLOCKD, eob)); - // These two sizes are used in vp8cx_pack_tokens. They are hard coded // so if the size changes this will have to be adjusted. #if HAVE_ARMV5TE -- cgit v1.2.3