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 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 235 |
236 ENTROPY_CONTEXT *above_context[MAX_MB_PLANE]; | 236 ENTROPY_CONTEXT *above_context[MAX_MB_PLANE]; |
237 ENTROPY_CONTEXT left_context[MAX_MB_PLANE][16]; | 237 ENTROPY_CONTEXT left_context[MAX_MB_PLANE][16]; |
238 | 238 |
239 PARTITION_CONTEXT *above_seg_context; | 239 PARTITION_CONTEXT *above_seg_context; |
240 PARTITION_CONTEXT left_seg_context[8]; | 240 PARTITION_CONTEXT left_seg_context[8]; |
241 } MACROBLOCKD; | 241 } MACROBLOCKD; |
242 | 242 |
243 static INLINE BLOCK_SIZE get_subsize(BLOCK_SIZE bsize, | 243 static INLINE BLOCK_SIZE get_subsize(BLOCK_SIZE bsize, |
244 PARTITION_TYPE partition) { | 244 PARTITION_TYPE partition) { |
245 const BLOCK_SIZE subsize = subsize_lookup[partition][bsize]; | 245 return subsize_lookup[partition][bsize]; |
246 assert(subsize < BLOCK_SIZES); | |
247 return subsize; | |
248 } | 246 } |
249 | 247 |
250 extern const TX_TYPE intra_mode_to_tx_type_lookup[INTRA_MODES]; | 248 extern const TX_TYPE intra_mode_to_tx_type_lookup[INTRA_MODES]; |
251 | 249 |
252 static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type, | 250 static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type, |
253 const MACROBLOCKD *xd) { | 251 const MACROBLOCKD *xd) { |
254 const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; | 252 const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; |
255 | 253 |
256 if (plane_type != PLANE_TYPE_Y || is_inter_block(mbmi)) | 254 if (plane_type != PLANE_TYPE_Y || is_inter_block(mbmi)) |
257 return DCT_DCT; | 255 return DCT_DCT; |
(...skipping 23 matching lines...) Expand all Loading... |
281 } | 279 } |
282 | 280 |
283 static INLINE TX_SIZE get_uv_tx_size(const MB_MODE_INFO *mbmi, | 281 static INLINE TX_SIZE get_uv_tx_size(const MB_MODE_INFO *mbmi, |
284 const struct macroblockd_plane *pd) { | 282 const struct macroblockd_plane *pd) { |
285 return get_uv_tx_size_impl(mbmi->tx_size, mbmi->sb_type, pd->subsampling_x, | 283 return get_uv_tx_size_impl(mbmi->tx_size, mbmi->sb_type, pd->subsampling_x, |
286 pd->subsampling_y); | 284 pd->subsampling_y); |
287 } | 285 } |
288 | 286 |
289 static INLINE BLOCK_SIZE get_plane_block_size(BLOCK_SIZE bsize, | 287 static INLINE BLOCK_SIZE get_plane_block_size(BLOCK_SIZE bsize, |
290 const struct macroblockd_plane *pd) { | 288 const struct macroblockd_plane *pd) { |
291 BLOCK_SIZE bs = ss_size_lookup[bsize][pd->subsampling_x][pd->subsampling_y]; | 289 return ss_size_lookup[bsize][pd->subsampling_x][pd->subsampling_y]; |
292 assert(bs < BLOCK_SIZES); | |
293 return bs; | |
294 } | 290 } |
295 | 291 |
296 typedef void (*foreach_transformed_block_visitor)(int plane, int block, | 292 typedef void (*foreach_transformed_block_visitor)(int plane, int block, |
297 BLOCK_SIZE plane_bsize, | 293 BLOCK_SIZE plane_bsize, |
298 TX_SIZE tx_size, | 294 TX_SIZE tx_size, |
299 void *arg); | 295 void *arg); |
300 | 296 |
301 void vp9_foreach_transformed_block_in_plane( | 297 void vp9_foreach_transformed_block_in_plane( |
302 const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane, | 298 const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane, |
303 foreach_transformed_block_visitor visit, void *arg); | 299 foreach_transformed_block_visitor visit, void *arg); |
(...skipping 16 matching lines...) Expand all Loading... |
320 | 316 |
321 void vp9_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, | 317 void vp9_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, |
322 BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, | 318 BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, |
323 int aoff, int loff); | 319 int aoff, int loff); |
324 | 320 |
325 #ifdef __cplusplus | 321 #ifdef __cplusplus |
326 } // extern "C" | 322 } // extern "C" |
327 #endif | 323 #endif |
328 | 324 |
329 #endif // VP9_COMMON_VP9_BLOCKD_H_ | 325 #endif // VP9_COMMON_VP9_BLOCKD_H_ |
OLD | NEW |