Fix transform size coding mismatch

This commit fixes a transform size enc/dec mismatch issue in the
key frame coding.

Change-Id: I0c4f40464a367b33dd91ace84506650b1aec2873
This commit is contained in:
Jingning Han 2013-05-24 11:11:06 -07:00
Родитель a2db88fc26
Коммит d093027791
4 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -155,8 +155,7 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m,
m->mbmi.uv_mode = read_uv_mode(r, cm->kf_uv_mode_prob[m->mbmi.mode]);
if (cm->txfm_mode == TX_MODE_SELECT &&
!(m->mbmi.mb_skip_coeff && m->mbmi.ref_frame != INTRA_FRAME)
&& m->mbmi.sb_type >= BLOCK_SIZE_SB8X8) {
m->mbmi.sb_type >= BLOCK_SIZE_SB8X8) {
const int allow_16x16 = m->mbmi.sb_type >= BLOCK_SIZE_MB16X16;
const int allow_32x32 = m->mbmi.sb_type >= BLOCK_SIZE_SB32X32;
m->mbmi.txfm_size = select_txfm_size(cm, r, allow_16x16, allow_32x32);

Просмотреть файл

@ -887,8 +887,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
write_uv_mode(bc, m->mbmi.uv_mode, c->kf_uv_mode_prob[ym]);
if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8 && c->txfm_mode == TX_MODE_SELECT &&
!((skip_coeff || vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)))) {
if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8 && c->txfm_mode == TX_MODE_SELECT) {
TX_SIZE sz = m->mbmi.txfm_size;
// FIXME(rbultje) code ternary symbol once all experiments are merged
vp9_write(bc, sz != TX_4X4, c->prob_tx[0]);
@ -1032,7 +1031,7 @@ static void write_modes(VP9_COMP *cpi, vp9_writer* const bc,
vpx_memset(c->left_seg_context, 0, sizeof(c->left_seg_context));
for (mi_col = c->cur_tile_mi_col_start;
mi_col < c->cur_tile_mi_col_end;
mi_col += 8, m += 8)
mi_col += 64 / MI_SIZE, m += 64 / MI_SIZE)
write_modes_sb(cpi, m, bc, tok, tok_end, mi_row, mi_col,
BLOCK_SIZE_SB64X64);
}

Просмотреть файл

@ -1202,6 +1202,7 @@ static void encode_frame_internal(VP9_COMP *cpi) {
vpx_memset(cpi->txfm_count_8x8p, 0, sizeof(cpi->txfm_count_8x8p));
vpx_memset(cpi->rd_tx_select_diff, 0, sizeof(cpi->rd_tx_select_diff));
vpx_memset(cpi->rd_tx_select_threshes, 0, sizeof(cpi->rd_tx_select_threshes));
{
struct vpx_usec_timer emr_timer;
vpx_usec_timer_start(&emr_timer);
@ -1456,7 +1457,7 @@ void vp9_encode_frame(VP9_COMP *cpi) {
} else
txfm_type = ALLOW_8X8;
#else
txfm_type = cpi->rd_tx_select_threshes[frame_type][ALLOW_32X32] >=
txfm_type = cpi->rd_tx_select_threshes[frame_type][ALLOW_32X32] >
cpi->rd_tx_select_threshes[frame_type][TX_MODE_SELECT] ?
ALLOW_32X32 : TX_MODE_SELECT;
#endif
@ -1711,7 +1712,7 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t,
sz = TX_8X8;
if (sz == TX_8X8 && bsize < BLOCK_SIZE_SB8X8)
sz = TX_4X4;
} else if (mbmi->mode != I4X4_PRED) {
} else if (bsize >= BLOCK_SIZE_SB8X8) {
sz = mbmi->txfm_size;
} else {
sz = TX_4X4;

Просмотреть файл

@ -2810,6 +2810,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
}
#endif
loop_count = 0;
vpx_memset(cpi->rd_tx_select_threshes, 0, sizeof(cpi->rd_tx_select_threshes));
if (cm->frame_type != KEY_FRAME) {
/* TODO: Decide this more intelligently */