OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 extern const scan_order vp9_default_scan_orders[TX_SIZES]; | 32 extern const scan_order vp9_default_scan_orders[TX_SIZES]; |
33 extern const scan_order vp9_scan_orders[TX_SIZES][TX_TYPES]; | 33 extern const scan_order vp9_scan_orders[TX_SIZES][TX_TYPES]; |
34 | 34 |
35 static INLINE int get_coef_context(const int16_t *neighbors, | 35 static INLINE int get_coef_context(const int16_t *neighbors, |
36 const uint8_t *token_cache, int c) { | 36 const uint8_t *token_cache, int c) { |
37 return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] + | 37 return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] + |
38 token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >> 1; | 38 token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >> 1; |
39 } | 39 } |
40 | 40 |
| 41 static INLINE const scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size, |
| 42 PLANE_TYPE type, int block_idx) { |
| 43 const MODE_INFO *const mi = xd->mi[0]; |
| 44 |
| 45 if (is_inter_block(&mi->mbmi) || type != PLANE_TYPE_Y || xd->lossless) { |
| 46 return &vp9_default_scan_orders[tx_size]; |
| 47 } else { |
| 48 const PREDICTION_MODE mode = get_y_mode(mi, block_idx); |
| 49 return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]]; |
| 50 } |
| 51 } |
| 52 |
41 #ifdef __cplusplus | 53 #ifdef __cplusplus |
42 } // extern "C" | 54 } // extern "C" |
43 #endif | 55 #endif |
44 | 56 |
45 #endif // VP9_COMMON_VP9_SCAN_H_ | 57 #endif // VP9_COMMON_VP9_SCAN_H_ |
OLD | NEW |