Merge "Making get_tx_counts() similar to get_tx_probs()."

This commit is contained in:
Dmitry Kovalev
2013-10-29 10:48:50 -07:00
committed by Gerrit Code Review
3 changed files with 9 additions and 9 deletions

View File

@@ -127,14 +127,14 @@ static const vp9_prob *get_tx_probs2(const MACROBLOCKD *xd,
return get_tx_probs(bsize, context, tx_probs); return get_tx_probs(bsize, context, tx_probs);
} }
static void update_tx_counts(BLOCK_SIZE bsize, uint8_t context, static unsigned int *get_tx_counts(BLOCK_SIZE bsize, uint8_t context,
TX_SIZE tx_size, struct tx_counts *tx_counts) { struct tx_counts *tx_counts) {
if (bsize >= BLOCK_32X32) if (bsize < BLOCK_16X16)
tx_counts->p32x32[context][tx_size]++; return tx_counts->p8x8[context];
else if (bsize >= BLOCK_16X16) else if (bsize < BLOCK_32X32)
tx_counts->p16x16[context][tx_size]++; return tx_counts->p16x16[context];
else else
tx_counts->p8x8[context][tx_size]++; return tx_counts->p32x32[context];
} }
#endif // VP9_COMMON_VP9_PRED_COMMON_H_ #endif // VP9_COMMON_VP9_PRED_COMMON_H_

View File

@@ -72,7 +72,7 @@ static TX_SIZE read_selected_tx_size(VP9_COMMON *cm, MACROBLOCKD *xd,
} }
if (!cm->frame_parallel_decoding_mode) if (!cm->frame_parallel_decoding_mode)
update_tx_counts(bsize, context, tx_size, &cm->counts.tx); ++get_tx_counts(bsize, context, &cm->counts.tx)[tx_size];
return tx_size; return tx_size;
} }

View File

@@ -2493,7 +2493,7 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
(mbmi->skip_coeff || (mbmi->skip_coeff ||
vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)))) { vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)))) {
const uint8_t context = vp9_get_pred_context_tx_size(xd); const uint8_t context = vp9_get_pred_context_tx_size(xd);
update_tx_counts(bsize, context, mbmi->tx_size, &cm->counts.tx); ++get_tx_counts(bsize, context, &cm->counts.tx)[mbmi->tx_size];
} else { } else {
int x, y; int x, y;
TX_SIZE sz = tx_mode_to_biggest_tx_size[cm->tx_mode]; TX_SIZE sz = tx_mode_to_biggest_tx_size[cm->tx_mode];