| 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 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 static INLINE vp9_prob vp9_get_pred_prob_seg_id(struct segmentation *seg, | 42 static INLINE vp9_prob vp9_get_pred_prob_seg_id(struct segmentation *seg, |
| 43 const MACROBLOCKD *xd) { | 43 const MACROBLOCKD *xd) { |
| 44 return seg->pred_probs[vp9_get_pred_context_seg_id(xd)]; | 44 return seg->pred_probs[vp9_get_pred_context_seg_id(xd)]; |
| 45 } | 45 } |
| 46 | 46 |
| 47 static INLINE int vp9_get_skip_context(const MACROBLOCKD *xd) { | 47 static INLINE int vp9_get_skip_context(const MACROBLOCKD *xd) { |
| 48 const MODE_INFO *const above_mi = get_above_mi(xd); | 48 const MODE_INFO *const above_mi = get_above_mi(xd); |
| 49 const MODE_INFO *const left_mi = get_left_mi(xd); | 49 const MODE_INFO *const left_mi = get_left_mi(xd); |
| 50 const int above_skip = (above_mi != NULL) ? above_mi->mbmi.skip_coeff : 0; | 50 const int above_skip = (above_mi != NULL) ? above_mi->mbmi.skip : 0; |
| 51 const int left_skip = (left_mi != NULL) ? left_mi->mbmi.skip_coeff : 0; | 51 const int left_skip = (left_mi != NULL) ? left_mi->mbmi.skip : 0; |
| 52 return above_skip + left_skip; | 52 return above_skip + left_skip; |
| 53 } | 53 } |
| 54 | 54 |
| 55 static INLINE vp9_prob vp9_get_skip_prob(const VP9_COMMON *cm, | 55 static INLINE vp9_prob vp9_get_skip_prob(const VP9_COMMON *cm, |
| 56 const MACROBLOCKD *xd) { | 56 const MACROBLOCKD *xd) { |
| 57 return cm->fc.mbskip_probs[vp9_get_skip_context(xd)]; | 57 return cm->fc.skip_probs[vp9_get_skip_context(xd)]; |
| 58 } | 58 } |
| 59 | 59 |
| 60 int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd); | 60 int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd); |
| 61 | 61 |
| 62 int vp9_get_intra_inter_context(const MACROBLOCKD *xd); | 62 int vp9_get_intra_inter_context(const MACROBLOCKD *xd); |
| 63 | 63 |
| 64 static INLINE vp9_prob vp9_get_intra_inter_prob(const VP9_COMMON *cm, | 64 static INLINE vp9_prob vp9_get_intra_inter_prob(const VP9_COMMON *cm, |
| 65 const MACROBLOCKD *xd) { | 65 const MACROBLOCKD *xd) { |
| 66 return cm->fc.intra_inter_prob[vp9_get_intra_inter_context(xd)]; | 66 return cm->fc.intra_inter_prob[vp9_get_intra_inter_context(xd)]; |
| 67 } | 67 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 91 | 91 |
| 92 int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd); | 92 int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd); |
| 93 | 93 |
| 94 static INLINE vp9_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm, | 94 static INLINE vp9_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm, |
| 95 const MACROBLOCKD *xd) { | 95 const MACROBLOCKD *xd) { |
| 96 return cm->fc.single_ref_prob[vp9_get_pred_context_single_ref_p2(xd)][1]; | 96 return cm->fc.single_ref_prob[vp9_get_pred_context_single_ref_p2(xd)][1]; |
| 97 } | 97 } |
| 98 | 98 |
| 99 int vp9_get_tx_size_context(const MACROBLOCKD *xd); | 99 int vp9_get_tx_size_context(const MACROBLOCKD *xd); |
| 100 | 100 |
| 101 static const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx, | 101 static INLINE const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx, |
| 102 const struct tx_probs *tx_probs) { | 102 const struct tx_probs *tx_probs) { |
| 103 switch (max_tx_size) { | 103 switch (max_tx_size) { |
| 104 case TX_8X8: | 104 case TX_8X8: |
| 105 return tx_probs->p8x8[ctx]; | 105 return tx_probs->p8x8[ctx]; |
| 106 case TX_16X16: | 106 case TX_16X16: |
| 107 return tx_probs->p16x16[ctx]; | 107 return tx_probs->p16x16[ctx]; |
| 108 case TX_32X32: | 108 case TX_32X32: |
| 109 return tx_probs->p32x32[ctx]; | 109 return tx_probs->p32x32[ctx]; |
| 110 default: | 110 default: |
| 111 assert(0 && "Invalid max_tx_size."); | 111 assert(0 && "Invalid max_tx_size."); |
| 112 return NULL; | 112 return NULL; |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 static const vp9_prob *get_tx_probs2(TX_SIZE max_tx_size, const MACROBLOCKD *xd, | 116 static INLINE const vp9_prob *get_tx_probs2(TX_SIZE max_tx_size, |
| 117 const struct tx_probs *tx_probs) { | 117 const MACROBLOCKD *xd, |
| 118 const struct tx_probs *tx_probs) { |
| 118 return get_tx_probs(max_tx_size, vp9_get_tx_size_context(xd), tx_probs); | 119 return get_tx_probs(max_tx_size, vp9_get_tx_size_context(xd), tx_probs); |
| 119 } | 120 } |
| 120 | 121 |
| 121 static unsigned int *get_tx_counts(TX_SIZE max_tx_size, int ctx, | 122 static INLINE unsigned int *get_tx_counts(TX_SIZE max_tx_size, int ctx, |
| 122 struct tx_counts *tx_counts) { | 123 struct tx_counts *tx_counts) { |
| 123 switch (max_tx_size) { | 124 switch (max_tx_size) { |
| 124 case TX_8X8: | 125 case TX_8X8: |
| 125 return tx_counts->p8x8[ctx]; | 126 return tx_counts->p8x8[ctx]; |
| 126 case TX_16X16: | 127 case TX_16X16: |
| 127 return tx_counts->p16x16[ctx]; | 128 return tx_counts->p16x16[ctx]; |
| 128 case TX_32X32: | 129 case TX_32X32: |
| 129 return tx_counts->p32x32[ctx]; | 130 return tx_counts->p32x32[ctx]; |
| 130 default: | 131 default: |
| 131 assert(0 && "Invalid max_tx_size."); | 132 assert(0 && "Invalid max_tx_size."); |
| 132 return NULL; | 133 return NULL; |
| 133 } | 134 } |
| 134 } | 135 } |
| 135 | 136 |
| 136 #ifdef __cplusplus | 137 #ifdef __cplusplus |
| 137 } // extern "C" | 138 } // extern "C" |
| 138 #endif | 139 #endif |
| 139 | 140 |
| 140 #endif // VP9_COMMON_VP9_PRED_COMMON_H_ | 141 #endif // VP9_COMMON_VP9_PRED_COMMON_H_ |
| OLD | NEW |