OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 #ifndef VP9_ENCODER_VP9_TOKENIZE_H_ | 11 #ifndef VP9_ENCODER_VP9_TOKENIZE_H_ |
12 #define VP9_ENCODER_VP9_TOKENIZE_H_ | 12 #define VP9_ENCODER_VP9_TOKENIZE_H_ |
13 | 13 |
14 #include "vp9/common/vp9_entropy.h" | 14 #include "vp9/common/vp9_entropy.h" |
| 15 |
15 #include "vp9/encoder/vp9_block.h" | 16 #include "vp9/encoder/vp9_block.h" |
| 17 #include "vp9/encoder/vp9_treewriter.h" |
16 | 18 |
17 void vp9_tokenize_initialize(); | 19 void vp9_tokenize_initialize(); |
18 | 20 |
| 21 #define EOSB_TOKEN 127 // Not signalled, encoder only |
| 22 |
19 typedef struct { | 23 typedef struct { |
20 int16_t token; | 24 int16_t token; |
21 int16_t extra; | 25 int16_t extra; |
22 } TOKENVALUE; | 26 } TOKENVALUE; |
23 | 27 |
24 typedef struct { | 28 typedef struct { |
25 const vp9_prob *context_tree; | 29 const vp9_prob *context_tree; |
26 int16_t extra; | 30 int16_t extra; |
27 uint8_t token; | 31 uint8_t token; |
28 uint8_t skip_eob_node; | 32 uint8_t skip_eob_node; |
29 } TOKENEXTRA; | 33 } TOKENEXTRA; |
30 | 34 |
31 typedef int64_t vp9_coeff_accum[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS] | 35 extern const vp9_tree_index vp9_coef_tree[]; |
32 [MAX_ENTROPY_TOKENS + 1]; | 36 extern const vp9_tree_index vp9_coef_con_tree[]; |
| 37 extern struct vp9_token vp9_coef_encodings[]; |
33 | 38 |
34 int vp9_sb_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE bsize); | 39 int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane); |
35 int vp9_is_skippable_in_plane(MACROBLOCKD *xd, BLOCK_SIZE bsize, | 40 |
36 int plane); | |
37 struct VP9_COMP; | 41 struct VP9_COMP; |
38 | 42 |
39 void vp9_tokenize_sb(struct VP9_COMP *cpi, TOKENEXTRA **t, int dry_run, | 43 void vp9_tokenize_sb(struct VP9_COMP *cpi, TOKENEXTRA **t, int dry_run, |
40 BLOCK_SIZE bsize); | 44 BLOCK_SIZE bsize); |
41 | 45 |
42 #ifdef ENTROPY_STATS | |
43 void init_context_counters(); | |
44 void print_context_counters(); | |
45 | |
46 extern vp9_coeff_accum context_counters[TX_SIZES][BLOCK_TYPES]; | |
47 #endif | |
48 | |
49 extern const int *vp9_dct_value_cost_ptr; | 46 extern const int *vp9_dct_value_cost_ptr; |
50 /* TODO: The Token field should be broken out into a separate char array to | 47 /* TODO: The Token field should be broken out into a separate char array to |
51 * improve cache locality, since it's needed for costing when the rest of the | 48 * improve cache locality, since it's needed for costing when the rest of the |
52 * fields are not. | 49 * fields are not. |
53 */ | 50 */ |
54 extern const TOKENVALUE *vp9_dct_value_tokens_ptr; | 51 extern const TOKENVALUE *vp9_dct_value_tokens_ptr; |
55 | 52 |
56 #endif // VP9_ENCODER_VP9_TOKENIZE_H_ | 53 #endif // VP9_ENCODER_VP9_TOKENIZE_H_ |
OLD | NEW |