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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 : 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 : 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.skip_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 } |
68 | 68 |
69 int vp9_get_reference_mode_context(const VP9_COMMON *cm, const MACROBLOCKD *xd); | 69 int vp9_get_reference_mode_context(const VP9_COMMON *cm, const MACROBLOCKD *xd); |
70 | 70 |
71 static INLINE vp9_prob vp9_get_reference_mode_prob(const VP9_COMMON *cm, | 71 static INLINE vp9_prob vp9_get_reference_mode_prob(const VP9_COMMON *cm, |
72 const MACROBLOCKD *xd) { | 72 const MACROBLOCKD *xd) { |
73 return cm->fc.comp_inter_prob[vp9_get_reference_mode_context(cm, xd)]; | 73 return cm->fc->comp_inter_prob[vp9_get_reference_mode_context(cm, xd)]; |
74 } | 74 } |
75 | 75 |
76 int vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm, | 76 int vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm, |
77 const MACROBLOCKD *xd); | 77 const MACROBLOCKD *xd); |
78 | 78 |
79 static INLINE vp9_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm, | 79 static INLINE vp9_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm, |
80 const MACROBLOCKD *xd) { | 80 const MACROBLOCKD *xd) { |
81 const int pred_context = vp9_get_pred_context_comp_ref_p(cm, xd); | 81 const int pred_context = vp9_get_pred_context_comp_ref_p(cm, xd); |
82 return cm->fc.comp_ref_prob[pred_context]; | 82 return cm->fc->comp_ref_prob[pred_context]; |
83 } | 83 } |
84 | 84 |
85 int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd); | 85 int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd); |
86 | 86 |
87 static INLINE vp9_prob vp9_get_pred_prob_single_ref_p1(const VP9_COMMON *cm, | 87 static INLINE vp9_prob vp9_get_pred_prob_single_ref_p1(const VP9_COMMON *cm, |
88 const MACROBLOCKD *xd) { | 88 const MACROBLOCKD *xd) { |
89 return cm->fc.single_ref_prob[vp9_get_pred_context_single_ref_p1(xd)][0]; | 89 return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p1(xd)][0]; |
90 } | 90 } |
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 INLINE 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: |
(...skipping 25 matching lines...) Expand all Loading... |
132 assert(0 && "Invalid max_tx_size."); | 132 assert(0 && "Invalid max_tx_size."); |
133 return NULL; | 133 return NULL; |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 #ifdef __cplusplus | 137 #ifdef __cplusplus |
138 } // extern "C" | 138 } // extern "C" |
139 #endif | 139 #endif |
140 | 140 |
141 #endif // VP9_COMMON_VP9_PRED_COMMON_H_ | 141 #endif // VP9_COMMON_VP9_PRED_COMMON_H_ |
OLD | NEW |