| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 | 11 |
| 12 #include "vpx_ports/config.h" | 12 #include "vpx_ports/asm_offsets.h" |
| 13 #include <stddef.h> | 13 #include "vpx_config.h" |
| 14 | |
| 15 #include "block.h" | 14 #include "block.h" |
| 16 #include "vp8/common/blockd.h" | 15 #include "vp8/common/blockd.h" |
| 17 #include "onyx_int.h" | 16 #include "onyx_int.h" |
| 18 #include "treewriter.h" | 17 #include "treewriter.h" |
| 19 #include "tokenize.h" | 18 #include "tokenize.h" |
| 20 | 19 |
| 21 #define ct_assert(name,cond) \ | 20 BEGIN |
| 22 static void assert_##name(void) UNUSED;\ | |
| 23 static void assert_##name(void) {switch(0){case 0:case !!(cond):;}} | |
| 24 | 21 |
| 25 #define DEFINE(sym, val) int sym = val; | 22 /* regular quantize */ |
| 26 | |
| 27 /* | |
| 28 #define BLANK() asm volatile("\n->" : : ) | |
| 29 */ | |
| 30 | |
| 31 /* | |
| 32 * int main(void) | |
| 33 * { | |
| 34 */ | |
| 35 | |
| 36 //regular quantize | |
| 37 DEFINE(vp8_block_coeff, offsetof(BLOCK, coeff)); | 23 DEFINE(vp8_block_coeff, offsetof(BLOCK, coeff)); |
| 38 DEFINE(vp8_block_zbin, offsetof(BLOCK, zbin)); | 24 DEFINE(vp8_block_zbin, offsetof(BLOCK, zbin)); |
| 39 DEFINE(vp8_block_round, offsetof(BLOCK, round)); | 25 DEFINE(vp8_block_round, offsetof(BLOCK, round)); |
| 40 DEFINE(vp8_block_quant, offsetof(BLOCK, quant)); | 26 DEFINE(vp8_block_quant, offsetof(BLOCK, quant)); |
| 41 DEFINE(vp8_block_quant_fast, offsetof(BLOCK, quant_fast)); | 27 DEFINE(vp8_block_quant_fast, offsetof(BLOCK, quant_fast)); |
| 42 DEFINE(vp8_block_zbin_extra, offsetof(BLOCK, zbin_extra)); | 28 DEFINE(vp8_block_zbin_extra, offsetof(BLOCK, zbin_extra)); |
| 43 DEFINE(vp8_block_zrun_zbin_boost, offsetof(BLOCK, zrun_zbin_boost)
); | 29 DEFINE(vp8_block_zrun_zbin_boost, offsetof(BLOCK, zrun_zbin_boost)
); |
| 44 DEFINE(vp8_block_quant_shift, offsetof(BLOCK, quant_shift)); | 30 DEFINE(vp8_block_quant_shift, offsetof(BLOCK, quant_shift)); |
| 45 | 31 |
| 46 DEFINE(vp8_blockd_qcoeff, offsetof(BLOCKD, qcoeff)); | 32 DEFINE(vp8_blockd_qcoeff, offsetof(BLOCKD, qcoeff)); |
| 47 DEFINE(vp8_blockd_dequant, offsetof(BLOCKD, dequant)); | 33 DEFINE(vp8_blockd_dequant, offsetof(BLOCKD, dequant)); |
| 48 DEFINE(vp8_blockd_dqcoeff, offsetof(BLOCKD, dqcoeff)); | 34 DEFINE(vp8_blockd_dqcoeff, offsetof(BLOCKD, dqcoeff)); |
| 49 DEFINE(vp8_blockd_eob, offsetof(BLOCKD, eob)); | 35 DEFINE(vp8_blockd_eob, offsetof(BLOCKD, eob)); |
| 50 | 36 |
| 51 // subtract | 37 /* subtract */ |
| 52 DEFINE(vp8_block_base_src, offsetof(BLOCK, base_src)); | 38 DEFINE(vp8_block_base_src, offsetof(BLOCK, base_src)); |
| 53 DEFINE(vp8_block_src, offsetof(BLOCK, src)); | 39 DEFINE(vp8_block_src, offsetof(BLOCK, src)); |
| 54 DEFINE(vp8_block_src_diff, offsetof(BLOCK, src_diff)); | 40 DEFINE(vp8_block_src_diff, offsetof(BLOCK, src_diff)); |
| 55 DEFINE(vp8_block_src_stride, offsetof(BLOCK, src_stride)); | 41 DEFINE(vp8_block_src_stride, offsetof(BLOCK, src_stride)); |
| 56 | 42 |
| 57 DEFINE(vp8_blockd_predictor, offsetof(BLOCKD, predictor)); | 43 DEFINE(vp8_blockd_predictor, offsetof(BLOCKD, predictor)); |
| 58 | 44 |
| 59 //pack tokens | 45 /* pack tokens */ |
| 60 DEFINE(vp8_writer_lowvalue, offsetof(vp8_writer, lowvalue)); | 46 DEFINE(vp8_writer_lowvalue, offsetof(vp8_writer, lowvalue)); |
| 61 DEFINE(vp8_writer_range, offsetof(vp8_writer, range)); | 47 DEFINE(vp8_writer_range, offsetof(vp8_writer, range)); |
| 62 DEFINE(vp8_writer_value, offsetof(vp8_writer, value)); | 48 DEFINE(vp8_writer_value, offsetof(vp8_writer, value)); |
| 63 DEFINE(vp8_writer_count, offsetof(vp8_writer, count)); | 49 DEFINE(vp8_writer_count, offsetof(vp8_writer, count)); |
| 64 DEFINE(vp8_writer_pos, offsetof(vp8_writer, pos)); | 50 DEFINE(vp8_writer_pos, offsetof(vp8_writer, pos)); |
| 65 DEFINE(vp8_writer_buffer, offsetof(vp8_writer, buffer)); | 51 DEFINE(vp8_writer_buffer, offsetof(vp8_writer, buffer)); |
| 66 | 52 |
| 67 DEFINE(tokenextra_token, offsetof(TOKENEXTRA, Token)); | 53 DEFINE(tokenextra_token, offsetof(TOKENEXTRA, Token)); |
| 68 DEFINE(tokenextra_extra, offsetof(TOKENEXTRA, Extra)); | 54 DEFINE(tokenextra_extra, offsetof(TOKENEXTRA, Extra)); |
| 69 DEFINE(tokenextra_context_tree, offsetof(TOKENEXTRA, context_tre
e)); | 55 DEFINE(tokenextra_context_tree, offsetof(TOKENEXTRA, context_tre
e)); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 83 DEFINE(vp8_comp_tplist, offsetof(VP8_COMP, tplist)); | 69 DEFINE(vp8_comp_tplist, offsetof(VP8_COMP, tplist)); |
| 84 DEFINE(vp8_comp_common, offsetof(VP8_COMP, common)); | 70 DEFINE(vp8_comp_common, offsetof(VP8_COMP, common)); |
| 85 DEFINE(vp8_comp_bc2, offsetof(VP8_COMP, bc2)); | 71 DEFINE(vp8_comp_bc2, offsetof(VP8_COMP, bc2)); |
| 86 | 72 |
| 87 DEFINE(tokenlist_start, offsetof(TOKENLIST, start)); | 73 DEFINE(tokenlist_start, offsetof(TOKENLIST, start)); |
| 88 DEFINE(tokenlist_stop, offsetof(TOKENLIST, stop)); | 74 DEFINE(tokenlist_stop, offsetof(TOKENLIST, stop)); |
| 89 DEFINE(TOKENLIST_SZ, sizeof(TOKENLIST)); | 75 DEFINE(TOKENLIST_SZ, sizeof(TOKENLIST)); |
| 90 | 76 |
| 91 DEFINE(vp8_common_mb_rows, offsetof(VP8_COMMON, mb_rows)); | 77 DEFINE(vp8_common_mb_rows, offsetof(VP8_COMMON, mb_rows)); |
| 92 | 78 |
| 93 // These two sizes are used in vp8cx_pack_tokens. They are hard coded | 79 END |
| 94 // so if the size changes this will have to be adjusted. | 80 |
| 81 /* add asserts for any offset that is not supported by assembly code |
| 82 * add asserts for any size that is not supported by assembly code |
| 83 |
| 84 * These are used in vp8cx_pack_tokens. They are hard coded so if their sizes |
| 85 * change they will have to be adjusted. |
| 86 */ |
| 87 |
| 95 #if HAVE_ARMV5TE | 88 #if HAVE_ARMV5TE |
| 96 ct_assert(TOKENEXTRA_SZ, sizeof(TOKENEXTRA) == 8) | 89 ct_assert(TOKENEXTRA_SZ, sizeof(TOKENEXTRA) == 8) |
| 97 ct_assert(vp8_extra_bit_struct_sz, sizeof(vp8_extra_bit_struct) == 16) | 90 ct_assert(vp8_extra_bit_struct_sz, sizeof(vp8_extra_bit_struct) == 16) |
| 98 #endif | 91 #endif |
| 99 | |
| 100 //add asserts for any offset that is not supported by assembly code | |
| 101 //add asserts for any size that is not supported by assembly code | |
| 102 /* | |
| 103 * return 0; | |
| 104 * } | |
| 105 */ | |
| OLD | NEW |