Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: source/libvpx/vp9/common/vp9_entropy.h

Issue 181493009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp9/common/vp9_blockd.c ('k') | source/libvpx/vp9/common/vp9_entropy.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 24 matching lines...) Expand all
35 #define CATEGORY3_TOKEN 7 // 11-18 Extra Bits 3+1 35 #define CATEGORY3_TOKEN 7 // 11-18 Extra Bits 3+1
36 #define CATEGORY4_TOKEN 8 // 19-34 Extra Bits 4+1 36 #define CATEGORY4_TOKEN 8 // 19-34 Extra Bits 4+1
37 #define CATEGORY5_TOKEN 9 // 35-66 Extra Bits 5+1 37 #define CATEGORY5_TOKEN 9 // 35-66 Extra Bits 5+1
38 #define CATEGORY6_TOKEN 10 // 67+ Extra Bits 14+1 38 #define CATEGORY6_TOKEN 10 // 67+ Extra Bits 14+1
39 #define EOB_TOKEN 11 // EOB Extra Bits 0+0 39 #define EOB_TOKEN 11 // EOB Extra Bits 0+0
40 40
41 #define ENTROPY_TOKENS 12 41 #define ENTROPY_TOKENS 12
42 42
43 #define ENTROPY_NODES 11 43 #define ENTROPY_NODES 11
44 44
45 extern DECLARE_ALIGNED(16, const uint8_t, vp9_pt_energy_class[ENTROPY_TOKENS]); 45 DECLARE_ALIGNED(16, extern const uint8_t, vp9_pt_energy_class[ENTROPY_TOKENS]);
46 46
47 #define EOB_MODEL_TOKEN 3 47 #define EOB_MODEL_TOKEN 3
48 extern const vp9_tree_index vp9_coefmodel_tree[]; 48 extern const vp9_tree_index vp9_coefmodel_tree[];
49 49
50 typedef struct { 50 typedef struct {
51 const vp9_tree_index *tree; 51 const vp9_tree_index *tree;
52 const vp9_prob *prob; 52 const vp9_prob *prob;
53 int len; 53 int len;
54 int base_val; 54 int base_val;
55 } vp9_extra_bit; 55 } vp9_extra_bit;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 vpx_memset(pd->left_context, 0, sizeof(ENTROPY_CONTEXT) * 109 vpx_memset(pd->left_context, 0, sizeof(ENTROPY_CONTEXT) *
110 num_4x4_blocks_high_lookup[plane_bsize]); 110 num_4x4_blocks_high_lookup[plane_bsize]);
111 } 111 }
112 } 112 }
113 113
114 // This is the index in the scan order beyond which all coefficients for 114 // This is the index in the scan order beyond which all coefficients for
115 // 8x8 transform and above are in the top band. 115 // 8x8 transform and above are in the top band.
116 // This macro is currently unused but may be used by certain implementations 116 // This macro is currently unused but may be used by certain implementations
117 #define MAXBAND_INDEX 21 117 #define MAXBAND_INDEX 21
118 118
119 extern DECLARE_ALIGNED(16, const uint8_t, vp9_coefband_trans_8x8plus[1024]); 119 DECLARE_ALIGNED(16, extern const uint8_t, vp9_coefband_trans_8x8plus[1024]);
120 extern DECLARE_ALIGNED(16, const uint8_t, vp9_coefband_trans_4x4[16]); 120 DECLARE_ALIGNED(16, extern const uint8_t, vp9_coefband_trans_4x4[16]);
121 121
122 static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) { 122 static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) {
123 return tx_size == TX_4X4 ? vp9_coefband_trans_4x4 123 return tx_size == TX_4X4 ? vp9_coefband_trans_4x4
124 : vp9_coefband_trans_8x8plus; 124 : vp9_coefband_trans_8x8plus;
125 } 125 }
126 126
127 // 128 lists of probabilities are stored for the following ONE node probs: 127 // 128 lists of probabilities are stored for the following ONE node probs:
128 // 1, 3, 5, 7, ..., 253, 255 128 // 1, 3, 5, 7, ..., 253, 255
129 // In between probabilities are interpolated linearly 129 // In between probabilities are interpolated linearly
130 130
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 default: 170 default:
171 assert(0 && "Invalid transform size."); 171 assert(0 && "Invalid transform size.");
172 } 172 }
173 173
174 return combine_entropy_contexts(above_ec, left_ec); 174 return combine_entropy_contexts(above_ec, left_ec);
175 } 175 }
176 176
177 static const INLINE scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size, 177 static const INLINE scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
178 PLANE_TYPE type, int block_idx) { 178 PLANE_TYPE type, int block_idx) {
179 const MODE_INFO *const mi = xd->mi_8x8[0]; 179 const MODE_INFO *const mi = xd->mi_8x8[0];
180 const MB_MODE_INFO *const mbmi = &mi->mbmi;
181 180
182 if (is_inter_block(mbmi) || type != PLANE_TYPE_Y || xd->lossless) { 181 if (is_inter_block(&mi->mbmi) || type != PLANE_TYPE_Y || xd->lossless) {
183 return &vp9_default_scan_orders[tx_size]; 182 return &vp9_default_scan_orders[tx_size];
184 } else { 183 } else {
185 const MB_PREDICTION_MODE mode = 184 const MB_PREDICTION_MODE mode = get_y_mode(mi, block_idx);
186 mbmi->sb_type < BLOCK_8X8 ? mi->bmi[block_idx].as_mode : mbmi->mode;
187 return &vp9_scan_orders[tx_size][mode2txfm_map[mode]]; 185 return &vp9_scan_orders[tx_size][mode2txfm_map[mode]];
188 } 186 }
189 } 187 }
190 188
191 #ifdef __cplusplus 189 #ifdef __cplusplus
192 } // extern "C" 190 } // extern "C"
193 #endif 191 #endif
194 192
195 #endif // VP9_COMMON_VP9_ENTROPY_H_ 193 #endif // VP9_COMMON_VP9_ENTROPY_H_
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_blockd.c ('k') | source/libvpx/vp9/common/vp9_entropy.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698