| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
| 11 #ifndef VP9_COMMON_VP9_PRED_COMMON_H_ | 11 #ifndef VP9_COMMON_VP9_PRED_COMMON_H_ |
| 12 #define VP9_COMMON_VP9_PRED_COMMON_H_ | 12 #define VP9_COMMON_VP9_PRED_COMMON_H_ |
| 13 | 13 |
| 14 #include "vp9/common/vp9_blockd.h" | 14 #include "vp9/common/vp9_blockd.h" |
| 15 #include "vp9/common/vp9_onyxc_int.h" | 15 #include "vp9/common/vp9_onyxc_int.h" |
| 16 | 16 |
| 17 #ifdef __cplusplus | 17 #ifdef __cplusplus |
| 18 extern "C" { | 18 extern "C" { |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 static INLINE int get_segment_id(const VP9_COMMON *cm, | 21 static INLINE int get_segment_id(const VP9_COMMON *cm, |
| 22 const uint8_t *segment_ids, | 22 const uint8_t *segment_ids, |
| 23 BLOCK_SIZE bsize, int mi_row, int mi_col) { | 23 BLOCK_SIZE bsize, int mi_row, int mi_col) { |
| 24 const int mi_offset = mi_row * cm->mi_cols + mi_col; | 24 const int mi_offset = mi_row * cm->mi_cols + mi_col; |
| 25 const int bw = num_8x8_blocks_wide_lookup[bsize]; | 25 const int bw = num_8x8_blocks_wide_lookup[bsize]; |
| 26 const int bh = num_8x8_blocks_high_lookup[bsize]; | 26 const int bh = num_8x8_blocks_high_lookup[bsize]; |
| 27 const int xmis = MIN(cm->mi_cols - mi_col, bw); | 27 const int xmis = VPXMIN(cm->mi_cols - mi_col, bw); |
| 28 const int ymis = MIN(cm->mi_rows - mi_row, bh); | 28 const int ymis = VPXMIN(cm->mi_rows - mi_row, bh); |
| 29 int x, y, segment_id = MAX_SEGMENTS; | 29 int x, y, segment_id = MAX_SEGMENTS; |
| 30 | 30 |
| 31 for (y = 0; y < ymis; ++y) | 31 for (y = 0; y < ymis; ++y) |
| 32 for (x = 0; x < xmis; ++x) | 32 for (x = 0; x < xmis; ++x) |
| 33 segment_id = MIN(segment_id, | 33 segment_id = |
| 34 segment_ids[mi_offset + y * cm->mi_cols + x]); | 34 VPXMIN(segment_id, segment_ids[mi_offset + y * cm->mi_cols + x]); |
| 35 | 35 |
| 36 assert(segment_id >= 0 && segment_id < MAX_SEGMENTS); | 36 assert(segment_id >= 0 && segment_id < MAX_SEGMENTS); |
| 37 return segment_id; | 37 return segment_id; |
| 38 } | 38 } |
| 39 | 39 |
| 40 static INLINE int vp9_get_pred_context_seg_id(const MACROBLOCKD *xd) { | 40 static INLINE int vp9_get_pred_context_seg_id(const MACROBLOCKD *xd) { |
| 41 const MODE_INFO *const above_mi = xd->above_mi; | 41 const MODE_INFO *const above_mi = xd->above_mi; |
| 42 const MODE_INFO *const left_mi = xd->left_mi; | 42 const MODE_INFO *const left_mi = xd->left_mi; |
| 43 const int above_sip = (above_mi != NULL) ? | 43 const int above_sip = (above_mi != NULL) ? |
| 44 above_mi->mbmi.seg_id_predicted : 0; | 44 above_mi->mbmi.seg_id_predicted : 0; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 assert(0 && "Invalid max_tx_size."); | 161 assert(0 && "Invalid max_tx_size."); |
| 162 return NULL; | 162 return NULL; |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 #ifdef __cplusplus | 166 #ifdef __cplusplus |
| 167 } // extern "C" | 167 } // extern "C" |
| 168 #endif | 168 #endif |
| 169 | 169 |
| 170 #endif // VP9_COMMON_VP9_PRED_COMMON_H_ | 170 #endif // VP9_COMMON_VP9_PRED_COMMON_H_ |
| OLD | NEW |