diff --git a/vp8/common/arm/vpx_asm_offsets.c b/vp8/common/arm/vpx_asm_offsets.c index 5baf8ccf5..074d3506d 100644 --- a/vp8/common/arm/vpx_asm_offsets.c +++ b/vp8/common/arm/vpx_asm_offsets.c @@ -45,15 +45,6 @@ DEFINE(yv12_buffer_config_border, offsetof(YV12_BUFFER_CONFIG, bor #endif #if CONFIG_VP8_DECODER -DEFINE(mb_diff, offsetof(MACROBLOCKD, diff)); -DEFINE(mb_predictor, offsetof(MACROBLOCKD, predictor)); -DEFINE(mb_dst_y_stride, offsetof(MACROBLOCKD, dst.y_stride)); -DEFINE(mb_dst_y_buffer, offsetof(MACROBLOCKD, dst.y_buffer)); -DEFINE(mb_dst_u_buffer, offsetof(MACROBLOCKD, dst.u_buffer)); -DEFINE(mb_dst_v_buffer, offsetof(MACROBLOCKD, dst.v_buffer)); -DEFINE(mb_up_available, offsetof(MACROBLOCKD, up_available)); -DEFINE(mb_left_available, offsetof(MACROBLOCKD, left_available)); - DEFINE(detok_scan, offsetof(DETOK, scan)); DEFINE(detok_ptr_block2leftabove, offsetof(DETOK, ptr_block2leftabove)); DEFINE(detok_coef_tree_ptr, offsetof(DETOK, vp8_coef_tree_ptr)); diff --git a/vp8/decoder/arm/arm_dsystemdependent.c b/vp8/decoder/arm/arm_dsystemdependent.c index e9741e286..02e45d170 100644 --- a/vp8/decoder/arm/arm_dsystemdependent.c +++ b/vp8/decoder/arm/arm_dsystemdependent.c @@ -14,7 +14,6 @@ #include "blockd.h" #include "pragmas.h" #include "postproc.h" -#include "dboolhuff.h" #include "dequantize.h" #include "onyxd_int.h" @@ -35,12 +34,6 @@ void vp8_arch_arm_decode_init(VP8D_COMP *pbi) 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; -#if 0 /*For use with RTCD, when implemented*/ - pbi->dboolhuff.start = vp8dx_start_decode_c; - pbi->dboolhuff.fill = vp8dx_bool_decoder_fill_c; - pbi->dboolhuff.debool = vp8dx_decode_bool_c; - pbi->dboolhuff.devalue = vp8dx_decode_value_c; -#endif } #endif @@ -54,12 +47,6 @@ void vp8_arch_arm_decode_init(VP8D_COMP *pbi) 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; -#if 0 /*For use with RTCD, when implemented*/ - pbi->dboolhuff.start = vp8dx_start_decode_c; - pbi->dboolhuff.fill = vp8dx_bool_decoder_fill_c; - pbi->dboolhuff.debool = vp8dx_decode_bool_c; - pbi->dboolhuff.devalue = vp8dx_decode_value_c; -#endif } #endif #endif diff --git a/vp8/decoder/arm/armv6/dboolhuff_v6.asm b/vp8/decoder/arm/armv6/dboolhuff_v6.asm deleted file mode 100644 index 6515804bb..000000000 --- a/vp8/decoder/arm/armv6/dboolhuff_v6.asm +++ /dev/null @@ -1,163 +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. -; - - - EXPORT |vp8_decode_value_v6| - EXPORT |vp8dx_start_decode_v6| - EXPORT |vp8dx_stop_decode_v6| - EXPORT |vp8dx_decode_bool_v6| - - ARM - REQUIRE8 - PRESERVE8 - - INCLUDE vpx_asm_offsets.asm - -br RN r0 -prob RN r1 -bits RN r1 - AREA |.text|, CODE, READONLY ; name this block of code - -; int z = 0; -; int bit; -; for ( bit=bits-1; bit>=0; bit-- ) -; { -; z |= (vp8dx_decode_bool(br, 0x80)<> 8) - mov r12, #1 - smlawb r6, r6, prob, r12 - - mov lr, #0 - subs r5, r3, r6, lsl #24 - - ;cmp r3, r1 - movhs lr, #1 - movhs r3, r5 - subhs r2, r2, r6 - movlo r2, r6 - - cmp r2, #0x80 - blt range_less_0x80 - ;strd r2, r3, [br, #bool_decoder_range] - str r2, [br, #bool_decoder_range] - str r3, [br, #bool_decoder_value] - mov r0, lr - ldmia sp!, {r4 - r6, pc} - -range_less_0x80 - ldr r5, [br, #bool_decoder_pos] - ldr r1, [br, #bool_decoder_buffer] - ldr r4, [br, #bool_decoder_count] - add r1, r1, r5 - - clz r12, r2 - sub r12, r12, #24 - subs r4, r4, r12 - ldrleb r6, [r1], #1 - mov r2, r2, lsl r12 - mov r3, r3, lsl r12 - addle r4, r4, #8 - rsble r12, r4, #8 - addle r5, r5, #1 - orrle r3, r3, r6, lsl r12 - - ;strd r2, r3, [br, #bool_decoder_range] - ;strd r4, r5, [br, #bool_decoder_count] - str r2, [br, #bool_decoder_range] - str r3, [br, #bool_decoder_value] - str r4, [br, #bool_decoder_count] - str r5, [br, #bool_decoder_pos] - - mov r0, lr - - ldmia sp!, {r4 - r6, pc} - ENDP ; |vp8dx_decode_bool_v6| - - END diff --git a/vp8/decoder/arm/dboolhuff_arm.h b/vp8/decoder/arm/dboolhuff_arm.h deleted file mode 100644 index 985951c7c..000000000 --- a/vp8/decoder/arm/dboolhuff_arm.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef DBOOLHUFF_ARM_H -#define DBOOLHUFF_ARM_H - -/* JLK - * There are currently no arm-optimized versions of - * these functions. As they are implemented, they - * can be uncommented below and added to - * arm/dsystemdependent.c - * - * The existing asm code is likely so different as - * to be useless. However, its been left (for now) - * for reference. - */ -#if 0 -#if HAVE_ARMV6 -#undef vp8_dbool_start -#define vp8_dbool_start vp8dx_start_decode_v6 - -#undef vp8_dbool_fill -#define vp8_dbool_fill vp8_bool_decoder_fill_v6 - -#undef vp8_dbool_debool -#define vp8_dbool_debool vp8_decode_bool_v6 - -#undef vp8_dbool_devalue -#define vp8_dbool_devalue vp8_decode_value_v6 -#endif /* HAVE_ARMV6 */ - -#if HAVE_ARMV7 -#undef vp8_dbool_start -#define vp8_dbool_start vp8dx_start_decode_neon - -#undef vp8_dbool_fill -#define vp8_dbool_fill vp8_bool_decoder_fill_neon - -#undef vp8_dbool_debool -#define vp8_dbool_debool vp8_decode_bool_neon - -#undef vp8_dbool_devalue -#define vp8_dbool_devalue vp8_decode_value_neon -#endif /* HAVE_ARMV7 */ -#endif -#endif /* DBOOLHUFF_ARM_H */ diff --git a/vp8/decoder/arm/neon/dboolhuff_neon.asm b/vp8/decoder/arm/neon/dboolhuff_neon.asm deleted file mode 100644 index ff3ffda97..000000000 --- a/vp8/decoder/arm/neon/dboolhuff_neon.asm +++ /dev/null @@ -1,160 +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. -; - - - EXPORT |vp8_decode_value_neon| - EXPORT |vp8dx_start_decode_neon| - EXPORT |vp8dx_stop_decode_neon| - EXPORT |vp8dx_decode_bool_neon| - - ARM - REQUIRE8 - PRESERVE8 - - INCLUDE vpx_asm_offsets.asm - - AREA |.text|, CODE, READONLY ; name this block of code - -; int z = 0; -; int bit; -; for ( bit=bits-1; bit>=0; bit-- ) -; { -; z |= (vp8dx_decode_bool(br, 0x80)<> 8) - - mov lr, r0 - mov r0, #0 ;bit = 0 - ; - subs r5, r3, r4, lsl #24 - - subhs r2, r2, r4 ;range = br->range-split - movlo r2, r4 ;range = split - movhs r0, #1 ;bit = 1 - movhs r3, r5 ;value = value-bigsplit - - cmp r2, #0x80 - blt range_less_0x80 - strd r2, r3, [lr, #bool_decoder_range] ;store result - - ldmia sp!, {r4 - r5, pc} - -range_less_0x80 - - ldrd r4, r5, [lr, #bool_decoder_count] ;load count, pos, buffer - ldr r1, [lr, #bool_decoder_buffer] - - clz r12, r2 - add r1, r1, r5 - - sub r12, r12, #24 - subs r4, r4, r12 ;count -= shift - mov r2, r2, lsl r12 ;range <<= shift - mov r3, r3, lsl r12 ;value <<= shift - addle r4, r4, #8 ;count += 8 - ldrleb r12, [r1], #1 ;br->buffer[br->pos] - - rsble r1, r4, #8 ;-count - addle r5, r5, #1 ;br->pos++ - orrle r3, r3, r12, lsl r1 ;value |= (br->buffer[br->pos]) << (-count) - - strd r2, r3, [lr, #bool_decoder_range] ;store result - strd r4, r5, [lr, #bool_decoder_count] - - ldmia sp!, {r4 - r5, pc} - ENDP ; |vp8dx_decode_bool_neon| - - END diff --git a/vp8/decoder/dboolhuff.c b/vp8/decoder/dboolhuff.c index 57cba16a3..8527d51e8 100644 --- a/vp8/decoder/dboolhuff.c +++ b/vp8/decoder/dboolhuff.c @@ -26,8 +26,9 @@ DECLARE_ALIGNED(16, const unsigned char, vp8dx_bitreader_norm[256]) = }; -int vp8dx_start_decode_c(BOOL_DECODER *br, const unsigned char *source, - unsigned int source_sz) +int vp8dx_start_decode(BOOL_DECODER *br, + const unsigned char *source, + unsigned int source_sz) { br->user_buffer_end = source+source_sz; br->user_buffer = source; @@ -39,13 +40,13 @@ int vp8dx_start_decode_c(BOOL_DECODER *br, const unsigned char *source, return 1; /* Populate the buffer */ - vp8dx_bool_decoder_fill_c(br); + vp8dx_bool_decoder_fill(br); return 0; } -void vp8dx_bool_decoder_fill_c(BOOL_DECODER *br) +void vp8dx_bool_decoder_fill(BOOL_DECODER *br) { const unsigned char *bufptr; const unsigned char *bufend; @@ -62,69 +63,3 @@ void vp8dx_bool_decoder_fill_c(BOOL_DECODER *br) br->value = value; br->count = count; } - -#if 0 -/* - * Until optimized versions of these functions are available, we - * keep the implementation in the header to allow inlining. - * - * The RTCD-style invocations are still in place so this can - * be switched by just uncommenting these functions here and - * the DBOOLHUFF_INVOKE calls in the header. - */ -int vp8dx_decode_bool_c(BOOL_DECODER *br, int probability) -{ - unsigned int bit=0; - VP8_BD_VALUE value; - unsigned int split; - VP8_BD_VALUE bigsplit; - int count; - unsigned int range; - - value = br->value; - count = br->count; - range = br->range; - - split = 1 + (((range-1) * probability) >> 8); - bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); - - range = split; - if(value >= bigsplit) - { - range = br->range-split; - value = value-bigsplit; - bit = 1; - } - - /*if(range>=0x80) - { - br->value = value; - br->range = range; - return bit; - }*/ - - { - register unsigned int shift = vp8dx_bitreader_norm[range]; - range <<= shift; - value <<= shift; - count -= shift; - } - br->value = value; - br->count = count; - br->range = range; - if (count < 0) - vp8dx_bool_decoder_fill_c(br); - return bit; -} - -int vp8dx_decode_value_c(BOOL_DECODER *br, int bits) -{ - int z = 0; - int bit; - for ( bit=bits-1; bit>=0; bit-- ) - { - z |= (vp8dx_decode_bool(br, 0x80)<fn -#define IF_RTCD(x) (x) -#else*/ -#define DBOOLHUFF_INVOKE(ctx,fn) vp8_dbool_##fn -#define IF_RTCD(x) NULL -/*#endif*/ - DECLARE_ALIGNED(16, extern const unsigned char, vp8dx_bitreader_norm[256]); -/* wrapper functions to hide RTCD. static means inline means hopefully no - * penalty - */ -static int vp8dx_start_decode(BOOL_DECODER *br, - struct vp8_dboolhuff_rtcd_vtable *rtcd, - const unsigned char *source, unsigned int source_sz) { -#if CONFIG_RUNTIME_CPU_DETECT - br->rtcd = rtcd; -#endif - return DBOOLHUFF_INVOKE(rtcd, start)(br, source, source_sz); -} -static void vp8dx_bool_decoder_fill(BOOL_DECODER *br) { - DBOOLHUFF_INVOKE(br->rtcd, fill)(br); -} +int vp8dx_start_decode(BOOL_DECODER *br, + const unsigned char *source, + unsigned int source_sz); + +void vp8dx_bool_decoder_fill(BOOL_DECODER *br); /*The refill loop is used in several places, so define it in a macro to make sure they're all consistent. @@ -138,12 +67,6 @@ static void vp8dx_bool_decoder_fill(BOOL_DECODER *br) { static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) { - /* - * Until optimized versions of this function are available, we - * keep the implementation in the header to allow inlining. - * - *return DBOOLHUFF_INVOKE(br->rtcd, debool)(br, probability); - */ unsigned int bit = 0; VP8_BD_VALUE value; unsigned int split; @@ -167,13 +90,6 @@ static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) { bit = 1; } - /*if(range>=0x80) - { - br->value = value; - br->range = range; - return bit - }*/ - { register unsigned int shift = vp8dx_bitreader_norm[range]; range <<= shift; @@ -190,12 +106,6 @@ static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) { static int vp8_decode_value(BOOL_DECODER *br, int bits) { - /* - * Until optimized versions of this function are available, we - * keep the implementation in the header to allow inlining. - * - *return DBOOLHUFF_INVOKE(br->rtcd, devalue)(br, bits); - */ int z = 0; int bit; diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index d3972b324..bf79b3180 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -475,8 +475,7 @@ static void setup_token_decoder(VP8D_COMP *pbi, "Truncated packet or corrupt partition " "%d length", i + 1); - if (vp8dx_start_decode(bool_decoder, IF_RTCD(&pbi->dboolhuff), - partition, partition_size)) + if (vp8dx_start_decode(bool_decoder, partition, partition_size)) vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR, "Failed to allocate bool decoder %d", i + 1); @@ -651,8 +650,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) init_frame(pbi); - if (vp8dx_start_decode(bc, IF_RTCD(&pbi->dboolhuff), - data, data_end - data)) + if (vp8dx_start_decode(bc, data, data_end - data)) vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR, "Failed to allocate bool decoder 0"); if (pc->frame_type == KEY_FRAME) { diff --git a/vp8/decoder/generic/dsystemdependent.c b/vp8/decoder/generic/dsystemdependent.c index 2e284729b..709ec59c4 100644 --- a/vp8/decoder/generic/dsystemdependent.c +++ b/vp8/decoder/generic/dsystemdependent.c @@ -27,12 +27,6 @@ void vp8_dmachine_specific_config(VP8D_COMP *pbi) 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->dboolhuff.start = vp8dx_start_decode_c; - pbi->dboolhuff.fill = vp8dx_bool_decoder_fill_c; -#if 0 /*For use with RTCD, when implemented*/ - pbi->dboolhuff.debool = vp8dx_decode_bool_c; - pbi->dboolhuff.devalue = vp8dx_decode_value_c; -#endif #endif #if ARCH_X86 || ARCH_X86_64 diff --git a/vp8/decoder/onyxd_int.h b/vp8/decoder/onyxd_int.h index 7593edf27..2f0fe702e 100644 --- a/vp8/decoder/onyxd_int.h +++ b/vp8/decoder/onyxd_int.h @@ -125,7 +125,6 @@ typedef struct VP8Decompressor #if CONFIG_RUNTIME_CPU_DETECT vp8_dequant_rtcd_vtable_t dequant; - struct vp8_dboolhuff_rtcd_vtable dboolhuff; #endif