Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / libvpx / source / libvpx / vp9 / encoder / vp9_tokenize.h
1 /*
2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10
11 #ifndef VP9_ENCODER_VP9_TOKENIZE_H_
12 #define VP9_ENCODER_VP9_TOKENIZE_H_
13
14 #include "vp9/common/vp9_entropy.h"
15
16 #include "vp9/encoder/vp9_block.h"
17 #include "vp9/encoder/vp9_treewriter.h"
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 void vp9_tokenize_initialize();
24
25 #define EOSB_TOKEN 127     // Not signalled, encoder only
26
27 typedef struct {
28   int16_t token;
29 #if CONFIG_VP9_HIGHBITDEPTH
30   int32_t extra;
31 #else
32   int16_t extra;
33 #endif
34 } TOKENVALUE;
35
36 typedef struct {
37   const vp9_prob *context_tree;
38 #if CONFIG_VP9_HIGHBITDEPTH
39   int32_t extra;
40 #else
41   int16_t         extra;
42 #endif
43   uint8_t         token;
44   uint8_t         skip_eob_node;
45 } TOKENEXTRA;
46
47 extern const vp9_tree_index vp9_coef_tree[];
48 extern const vp9_tree_index vp9_coef_con_tree[];
49 extern struct vp9_token vp9_coef_encodings[];
50
51 int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
52 int vp9_has_high_freq_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
53
54 struct VP9_COMP;
55
56 void vp9_tokenize_sb(struct VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
57                      BLOCK_SIZE bsize);
58
59 extern const int16_t *vp9_dct_value_cost_ptr;
60 /* TODO: The Token field should be broken out into a separate char array to
61  *  improve cache locality, since it's needed for costing when the rest of the
62  *  fields are not.
63  */
64 extern const TOKENVALUE *vp9_dct_value_tokens_ptr;
65 #if CONFIG_VP9_HIGHBITDEPTH
66 extern const int16_t *vp9_dct_value_cost_high10_ptr;
67 extern const TOKENVALUE *vp9_dct_value_tokens_high10_ptr;
68 extern const int16_t *vp9_dct_value_cost_high12_ptr;
69 extern const TOKENVALUE *vp9_dct_value_tokens_high12_ptr;
70 #endif  // CONFIG_VP9_HIGHBITDEPTH
71
72 #ifdef __cplusplus
73 }  // extern "C"
74 #endif
75
76 #endif  // VP9_ENCODER_VP9_TOKENIZE_H_