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

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

Issue 1124333011: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: only update to last nights LKGR Created 5 years, 7 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
« no previous file with comments | « source/libvpx/vp9/common/vp9_debugmodes.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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 struct VP9Common; 136 struct VP9Common;
137 void vp9_default_coef_probs(struct VP9Common *cm); 137 void vp9_default_coef_probs(struct VP9Common *cm);
138 void vp9_adapt_coef_probs(struct VP9Common *cm); 138 void vp9_adapt_coef_probs(struct VP9Common *cm);
139 139
140 static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE bsize) { 140 static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE bsize) {
141 int i; 141 int i;
142 for (i = 0; i < MAX_MB_PLANE; i++) { 142 for (i = 0; i < MAX_MB_PLANE; i++) {
143 struct macroblockd_plane *const pd = &xd->plane[i]; 143 struct macroblockd_plane *const pd = &xd->plane[i];
144 const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd); 144 const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
145 vpx_memset(pd->above_context, 0, sizeof(ENTROPY_CONTEXT) * 145 memset(pd->above_context, 0,
146 num_4x4_blocks_wide_lookup[plane_bsize]); 146 sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_wide_lookup[plane_bsize]);
147 vpx_memset(pd->left_context, 0, sizeof(ENTROPY_CONTEXT) * 147 memset(pd->left_context, 0,
148 num_4x4_blocks_high_lookup[plane_bsize]); 148 sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high_lookup[plane_bsize]);
149 } 149 }
150 } 150 }
151 151
152 // This is the index in the scan order beyond which all coefficients for 152 // This is the index in the scan order beyond which all coefficients for
153 // 8x8 transform and above are in the top band. 153 // 8x8 transform and above are in the top band.
154 // This macro is currently unused but may be used by certain implementations 154 // This macro is currently unused but may be used by certain implementations
155 #define MAXBAND_INDEX 21 155 #define MAXBAND_INDEX 21
156 156
157 DECLARE_ALIGNED(16, extern const uint8_t, vp9_coefband_trans_8x8plus[1024]); 157 DECLARE_ALIGNED(16, extern const uint8_t, vp9_coefband_trans_8x8plus[1024]);
158 DECLARE_ALIGNED(16, extern const uint8_t, vp9_coefband_trans_4x4[16]); 158 DECLARE_ALIGNED(16, extern const uint8_t, vp9_coefband_trans_4x4[16]);
159 159
160 static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) { 160 static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) {
161 return tx_size == TX_4X4 ? vp9_coefband_trans_4x4 161 return tx_size == TX_4X4 ? vp9_coefband_trans_4x4
162 : vp9_coefband_trans_8x8plus; 162 : vp9_coefband_trans_8x8plus;
163 } 163 }
164 164
165 // 128 lists of probabilities are stored for the following ONE node probs: 165 // 128 lists of probabilities are stored for the following ONE node probs:
166 // 1, 3, 5, 7, ..., 253, 255 166 // 1, 3, 5, 7, ..., 253, 255
167 // In between probabilities are interpolated linearly 167 // In between probabilities are interpolated linearly
168 168
169 #define COEFF_PROB_MODELS 256 169 #define COEFF_PROB_MODELS 256
170 170
171 #define UNCONSTRAINED_NODES 3 171 #define UNCONSTRAINED_NODES 3
172 172
173 #define PIVOT_NODE 2 // which node is pivot 173 #define PIVOT_NODE 2 // which node is pivot
174 174
175 #define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES) 175 #define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES)
176 extern const vp9_tree_index vp9_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)];
176 extern const vp9_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES]; 177 extern const vp9_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES];
177 178
178 typedef vp9_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS] 179 typedef vp9_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS]
179 [COEFF_CONTEXTS][UNCONSTRAINED_NODES]; 180 [COEFF_CONTEXTS][UNCONSTRAINED_NODES];
180 181
181 typedef unsigned int vp9_coeff_count_model[REF_TYPES][COEF_BANDS] 182 typedef unsigned int vp9_coeff_count_model[REF_TYPES][COEF_BANDS]
182 [COEFF_CONTEXTS] 183 [COEFF_CONTEXTS]
183 [UNCONSTRAINED_NODES + 1]; 184 [UNCONSTRAINED_NODES + 1];
184 185
185 void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full); 186 void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full);
(...skipping 22 matching lines...) Expand all
208 default: 209 default:
209 assert(0 && "Invalid transform size."); 210 assert(0 && "Invalid transform size.");
210 break; 211 break;
211 } 212 }
212 213
213 return combine_entropy_contexts(above_ec, left_ec); 214 return combine_entropy_contexts(above_ec, left_ec);
214 } 215 }
215 216
216 static INLINE const scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size, 217 static INLINE const scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
217 PLANE_TYPE type, int block_idx) { 218 PLANE_TYPE type, int block_idx) {
218 const MODE_INFO *const mi = xd->mi[0].src_mi; 219 const MODE_INFO *const mi = xd->mi[0];
219 220
220 if (is_inter_block(&mi->mbmi) || type != PLANE_TYPE_Y || xd->lossless) { 221 if (is_inter_block(&mi->mbmi) || type != PLANE_TYPE_Y || xd->lossless) {
221 return &vp9_default_scan_orders[tx_size]; 222 return &vp9_default_scan_orders[tx_size];
222 } else { 223 } else {
223 const PREDICTION_MODE mode = get_y_mode(mi, block_idx); 224 const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
224 return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]]; 225 return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
225 } 226 }
226 } 227 }
227 228
228 #ifdef __cplusplus 229 #ifdef __cplusplus
229 } // extern "C" 230 } // extern "C"
230 #endif 231 #endif
231 232
232 #endif // VP9_COMMON_VP9_ENTROPY_H_ 233 #endif // VP9_COMMON_VP9_ENTROPY_H_
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_debugmodes.c ('k') | source/libvpx/vp9/common/vp9_entropy.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698