diff options
author | Dmitry Kovalev <dkovalev@google.com> | 2013-11-05 17:36:43 -0800 |
---|---|---|
committer | Dmitry Kovalev <dkovalev@google.com> | 2013-11-05 17:36:43 -0800 |
commit | 4a96e64dc2f9d765c5b10179a2381b4f73f64bc7 (patch) | |
tree | 33738e98d978bca00dd71fa1cff4d72e6fbea7d9 /vp9/common | |
parent | 648e30bca6a58039a8d3ec6fa956e8124766c8a9 (diff) | |
download | libvpx-4a96e64dc2f9d765c5b10179a2381b4f73f64bc7.tar libvpx-4a96e64dc2f9d765c5b10179a2381b4f73f64bc7.tar.gz libvpx-4a96e64dc2f9d765c5b10179a2381b4f73f64bc7.tar.bz2 libvpx-4a96e64dc2f9d765c5b10179a2381b4f73f64bc7.zip |
Using max_tx_size instead of bsize when possible.
Change-Id: I246364bc4270ca13aefb4bc3445bcf102b3170dc
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_pred_common.h | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/vp9/common/vp9_pred_common.h b/vp9/common/vp9_pred_common.h index 19032bf62..919093080 100644 --- a/vp9/common/vp9_pred_common.h +++ b/vp9/common/vp9_pred_common.h @@ -109,32 +109,40 @@ static INLINE vp9_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm, unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd); -static const vp9_prob *get_tx_probs(BLOCK_SIZE bsize, uint8_t context, +static const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx, const struct tx_probs *tx_probs) { - if (bsize < BLOCK_16X16) - return tx_probs->p8x8[context]; - else if (bsize < BLOCK_32X32) - return tx_probs->p16x16[context]; - else - return tx_probs->p32x32[context]; + switch (max_tx_size) { + case TX_8X8: + return tx_probs->p8x8[ctx]; + case TX_16X16: + return tx_probs->p16x16[ctx]; + case TX_32X32: + return tx_probs->p32x32[ctx]; + default: + assert(!"Invalid max_tx_size."); + return NULL; + } } -static const vp9_prob *get_tx_probs2(const MACROBLOCKD *xd, - const struct tx_probs *tx_probs, - const MODE_INFO *m) { - const BLOCK_SIZE bsize = m->mbmi.sb_type; - const int context = vp9_get_pred_context_tx_size(xd); - return get_tx_probs(bsize, context, tx_probs); +static const vp9_prob *get_tx_probs2(TX_SIZE max_tx_size, const MACROBLOCKD *xd, + const struct tx_probs *tx_probs) { + const int ctx = vp9_get_pred_context_tx_size(xd); + return get_tx_probs(max_tx_size, ctx, tx_probs); } -static unsigned int *get_tx_counts(BLOCK_SIZE bsize, uint8_t context, +static unsigned int *get_tx_counts(TX_SIZE max_tx_size, int ctx, struct tx_counts *tx_counts) { - if (bsize < BLOCK_16X16) - return tx_counts->p8x8[context]; - else if (bsize < BLOCK_32X32) - return tx_counts->p16x16[context]; - else - return tx_counts->p32x32[context]; + switch (max_tx_size) { + case TX_8X8: + return tx_counts->p8x8[ctx]; + case TX_16X16: + return tx_counts->p16x16[ctx]; + case TX_32X32: + return tx_counts->p32x32[ctx]; + default: + assert(!"Invalid max_tx_size."); + return NULL; + } } #endif // VP9_COMMON_VP9_PRED_COMMON_H_ |