Fix pickmode for intra DC blocks

Change-Id: I4906043ec1e3577ba37622a235c54adacb66125a
This commit is contained in:
Alex Converse 2014-08-11 16:58:45 -07:00
parent 1d9e2b5003
commit f55f68c13a

View File

@ -673,7 +673,6 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
int i, j;
const int width = num_4x4_blocks_wide_lookup[bsize];
const int height = num_4x4_blocks_high_lookup[bsize];
const BLOCK_SIZE bsize_tx = txsize_to_bsize[mbmi->tx_size];
int rate2 = 0;
int64_t dist2 = 0;
@ -683,28 +682,36 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
TX_SIZE tmp_tx_size = MIN(max_txsize_lookup[bsize],
tx_mode_to_biggest_tx_size[cpi->common.tx_mode]);
const BLOCK_SIZE bsize_tx = txsize_to_bsize[tmp_tx_size];
const int step = 1 << tmp_tx_size;
for (this_mode = DC_PRED; this_mode <= DC_PRED; ++this_mode) {
if (cpi->sf.reuse_inter_pred_sby) {
pd->dst.buf = tmp[0].data;
pd->dst.stride = bw;
}
if (cpi->sf.reuse_inter_pred_sby) {
pd->dst.buf = tmp[0].data;
pd->dst.stride = bw;
}
for (this_mode = DC_PRED; this_mode <= DC_PRED; ++this_mode) {
uint8_t *const src_buf_base = p->src.buf;
uint8_t *const dst_buf_base = pd->dst.buf;
for (j = 0; j < height; j += step) {
for (i = 0; i < width; i += step) {
p->src.buf = &src_buf_base[4 * (j * src_stride + i)];
pd->dst.buf = &dst_buf_base[4 * (j * dst_stride + i)];
// Use source buffer as an approximation for the fully reconstructed
// buffer
vp9_predict_intra_block(xd, block_idx, b_width_log2(bsize),
tmp_tx_size, this_mode,
&p->src.buf[4 * (j * dst_stride + i)],
src_stride,
&pd->dst.buf[4 * (j * dst_stride + i)],
dst_stride, i, j, 0);
p->src.buf, src_stride,
pd->dst.buf, dst_stride,
i, j, 0);
model_rd_for_sb_y(cpi, bsize_tx, x, xd, &rate, &dist, &var_y, &sse_y);
rate2 += rate;
dist2 += dist;
++block_idx;
}
}
p->src.buf = src_buf_base;
pd->dst.buf = dst_buf_base;
rate = rate2;
dist = dist2;