Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright (c) 2011 The WebM project authors. All Rights Reserved. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license |
michael@0 | 5 | * that can be found in the LICENSE file in the root of the source |
michael@0 | 6 | * tree. An additional intellectual property rights grant can be found |
michael@0 | 7 | * in the file PATENTS. All contributing project authors may |
michael@0 | 8 | * be found in the AUTHORS file in the root of the source tree. |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | |
michael@0 | 12 | #include "vpx_ports/asm_offsets.h" |
michael@0 | 13 | #include "vpx_config.h" |
michael@0 | 14 | #include "block.h" |
michael@0 | 15 | #include "vp8/common/blockd.h" |
michael@0 | 16 | #include "onyx_int.h" |
michael@0 | 17 | #include "treewriter.h" |
michael@0 | 18 | #include "tokenize.h" |
michael@0 | 19 | |
michael@0 | 20 | BEGIN |
michael@0 | 21 | |
michael@0 | 22 | /* regular quantize */ |
michael@0 | 23 | DEFINE(vp8_block_coeff, offsetof(BLOCK, coeff)); |
michael@0 | 24 | DEFINE(vp8_block_zbin, offsetof(BLOCK, zbin)); |
michael@0 | 25 | DEFINE(vp8_block_round, offsetof(BLOCK, round)); |
michael@0 | 26 | DEFINE(vp8_block_quant, offsetof(BLOCK, quant)); |
michael@0 | 27 | DEFINE(vp8_block_quant_fast, offsetof(BLOCK, quant_fast)); |
michael@0 | 28 | DEFINE(vp8_block_zbin_extra, offsetof(BLOCK, zbin_extra)); |
michael@0 | 29 | DEFINE(vp8_block_zrun_zbin_boost, offsetof(BLOCK, zrun_zbin_boost)); |
michael@0 | 30 | DEFINE(vp8_block_quant_shift, offsetof(BLOCK, quant_shift)); |
michael@0 | 31 | |
michael@0 | 32 | DEFINE(vp8_blockd_qcoeff, offsetof(BLOCKD, qcoeff)); |
michael@0 | 33 | DEFINE(vp8_blockd_dequant, offsetof(BLOCKD, dequant)); |
michael@0 | 34 | DEFINE(vp8_blockd_dqcoeff, offsetof(BLOCKD, dqcoeff)); |
michael@0 | 35 | DEFINE(vp8_blockd_eob, offsetof(BLOCKD, eob)); |
michael@0 | 36 | |
michael@0 | 37 | /* subtract */ |
michael@0 | 38 | DEFINE(vp8_block_base_src, offsetof(BLOCK, base_src)); |
michael@0 | 39 | DEFINE(vp8_block_src, offsetof(BLOCK, src)); |
michael@0 | 40 | DEFINE(vp8_block_src_diff, offsetof(BLOCK, src_diff)); |
michael@0 | 41 | DEFINE(vp8_block_src_stride, offsetof(BLOCK, src_stride)); |
michael@0 | 42 | |
michael@0 | 43 | DEFINE(vp8_blockd_predictor, offsetof(BLOCKD, predictor)); |
michael@0 | 44 | |
michael@0 | 45 | /* pack tokens */ |
michael@0 | 46 | DEFINE(vp8_writer_lowvalue, offsetof(vp8_writer, lowvalue)); |
michael@0 | 47 | DEFINE(vp8_writer_range, offsetof(vp8_writer, range)); |
michael@0 | 48 | DEFINE(vp8_writer_count, offsetof(vp8_writer, count)); |
michael@0 | 49 | DEFINE(vp8_writer_pos, offsetof(vp8_writer, pos)); |
michael@0 | 50 | DEFINE(vp8_writer_buffer, offsetof(vp8_writer, buffer)); |
michael@0 | 51 | DEFINE(vp8_writer_buffer_end, offsetof(vp8_writer, buffer_end)); |
michael@0 | 52 | DEFINE(vp8_writer_error, offsetof(vp8_writer, error)); |
michael@0 | 53 | |
michael@0 | 54 | DEFINE(tokenextra_token, offsetof(TOKENEXTRA, Token)); |
michael@0 | 55 | DEFINE(tokenextra_extra, offsetof(TOKENEXTRA, Extra)); |
michael@0 | 56 | DEFINE(tokenextra_context_tree, offsetof(TOKENEXTRA, context_tree)); |
michael@0 | 57 | DEFINE(tokenextra_skip_eob_node, offsetof(TOKENEXTRA, skip_eob_node)); |
michael@0 | 58 | DEFINE(TOKENEXTRA_SZ, sizeof(TOKENEXTRA)); |
michael@0 | 59 | |
michael@0 | 60 | DEFINE(vp8_extra_bit_struct_sz, sizeof(vp8_extra_bit_struct)); |
michael@0 | 61 | |
michael@0 | 62 | DEFINE(vp8_token_value, offsetof(vp8_token, value)); |
michael@0 | 63 | DEFINE(vp8_token_len, offsetof(vp8_token, Len)); |
michael@0 | 64 | |
michael@0 | 65 | DEFINE(vp8_extra_bit_struct_tree, offsetof(vp8_extra_bit_struct, tree)); |
michael@0 | 66 | DEFINE(vp8_extra_bit_struct_prob, offsetof(vp8_extra_bit_struct, prob)); |
michael@0 | 67 | DEFINE(vp8_extra_bit_struct_len, offsetof(vp8_extra_bit_struct, Len)); |
michael@0 | 68 | DEFINE(vp8_extra_bit_struct_base_val, offsetof(vp8_extra_bit_struct, base_val)); |
michael@0 | 69 | |
michael@0 | 70 | DEFINE(vp8_comp_tplist, offsetof(VP8_COMP, tplist)); |
michael@0 | 71 | DEFINE(vp8_comp_common, offsetof(VP8_COMP, common)); |
michael@0 | 72 | DEFINE(vp8_comp_bc , offsetof(VP8_COMP, bc)); |
michael@0 | 73 | DEFINE(vp8_writer_sz , sizeof(vp8_writer)); |
michael@0 | 74 | |
michael@0 | 75 | DEFINE(tokenlist_start, offsetof(TOKENLIST, start)); |
michael@0 | 76 | DEFINE(tokenlist_stop, offsetof(TOKENLIST, stop)); |
michael@0 | 77 | DEFINE(TOKENLIST_SZ, sizeof(TOKENLIST)); |
michael@0 | 78 | |
michael@0 | 79 | DEFINE(vp8_common_mb_rows, offsetof(VP8_COMMON, mb_rows)); |
michael@0 | 80 | |
michael@0 | 81 | END |
michael@0 | 82 | |
michael@0 | 83 | /* add asserts for any offset that is not supported by assembly code |
michael@0 | 84 | * add asserts for any size that is not supported by assembly code |
michael@0 | 85 | |
michael@0 | 86 | * These are used in vp8cx_pack_tokens. They are hard coded so if their sizes |
michael@0 | 87 | * change they will have to be adjusted. |
michael@0 | 88 | */ |
michael@0 | 89 | |
michael@0 | 90 | #if HAVE_EDSP |
michael@0 | 91 | ct_assert(TOKENEXTRA_SZ, sizeof(TOKENEXTRA) == 8) |
michael@0 | 92 | ct_assert(vp8_extra_bit_struct_sz, sizeof(vp8_extra_bit_struct) == 16) |
michael@0 | 93 | #endif |