Commit 05a79f2f authored by John Koleszar's avatar John Koleszar

Move EOB to per-plane data

Continue migrating data from BLOCKD/MACROBLOCKD to the per-plane
structures.

Change-Id: Ibbfa68d6da438d32dcbe8df68245ee28b0a2fa2c
parent 4c05a051
......@@ -298,6 +298,7 @@ enum { MAX_MB_PLANE = 3 };
struct mb_plane {
DECLARE_ALIGNED(16, int16_t, qcoeff[64 * 64]);
DECLARE_ALIGNED(16, int16_t, dqcoeff[64 * 64]);
DECLARE_ALIGNED(16, uint16_t, eobs[256]);
};
#define BLOCK_OFFSET(x, i, n) ((x) + (i) * (n))
......@@ -310,7 +311,6 @@ struct mb_plane {
typedef struct macroblockd {
DECLARE_ALIGNED(16, int16_t, diff[64*64+32*32*2]); /* from idct diff */
DECLARE_ALIGNED(16, uint8_t, predictor[384]); // unused for superblocks
DECLARE_ALIGNED(16, uint16_t, eobs[256+64*2]);
#if CONFIG_CODE_NONZEROCOUNT
DECLARE_ALIGNED(16, uint16_t, nzcs[256+64*2]);
#endif
......@@ -700,21 +700,19 @@ struct plane_block_idx {
// TODO(jkoleszar): returning a struct so it can be used in a const context,
// expect to refactor this further later.
static INLINE struct plane_block_idx plane_block_idx(MACROBLOCKD *xd,
int b_idx) {
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type;
const int u_offset = 16 << (sb_type * 2);
const int v_offset = 20 << (sb_type * 2);
static INLINE struct plane_block_idx plane_block_idx(int y_blocks,
int b_idx) {
const int v_offset = y_blocks * 5 / 4;
struct plane_block_idx res;
if (b_idx < u_offset) {
if (b_idx < y_blocks) {
res.plane = 0;
res.block = b_idx;
} else if (b_idx < v_offset) {
res.plane = 1;
res.block = b_idx - u_offset;
res.block = b_idx - y_blocks;
} else {
assert(b_idx < (24 << (sb_type * 2)));
assert(b_idx < y_blocks * 3 / 2);
res.plane = 2;
res.block = b_idx - v_offset;
}
......
......@@ -29,7 +29,8 @@ void vp9_inverse_transform_mby_4x4(MACROBLOCKD *xd) {
vp9_short_iht4x4(BLOCK_OFFSET(xd->plane[0].dqcoeff, i, 16),
xd->block[i].diff, 16, tx_type);
} else {
vp9_inverse_transform_b_4x4(xd, xd->eobs[i],
vp9_inverse_transform_b_4x4(xd,
xd->plane[0].eobs[i],
BLOCK_OFFSET(xd->plane[0].dqcoeff, i, 16),
xd->block[i].diff, 32);
}
......@@ -40,12 +41,12 @@ void vp9_inverse_transform_mbuv_4x4(MACROBLOCKD *xd) {
int i;
for (i = 16; i < 20; i++) {
vp9_inverse_transform_b_4x4(xd, xd->eobs[i],
vp9_inverse_transform_b_4x4(xd, xd->plane[1].eobs[i - 16],
BLOCK_OFFSET(xd->plane[1].dqcoeff, i - 16, 16),
xd->block[i].diff, 16);
}
for (i = 20; i < 24; i++) {
vp9_inverse_transform_b_4x4(xd, xd->eobs[i],
vp9_inverse_transform_b_4x4(xd, xd->plane[2].eobs[i - 20],
BLOCK_OFFSET(xd->plane[2].dqcoeff, i - 20, 16),
xd->block[i].diff, 16);
}
......@@ -175,7 +176,7 @@ void vp9_inverse_transform_sby_4x4(MACROBLOCKD *xd) {
const TX_TYPE tx_type = get_tx_type_4x4(xd, y_idx * 8 + x_idx);
if (tx_type == DCT_DCT) {
vp9_inverse_transform_b_4x4(xd, xd->eobs[n],
vp9_inverse_transform_b_4x4(xd, xd->plane[0].eobs[n],
BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 16),
xd->diff + x_idx * 4 + y_idx * 4 * 32, 64);
} else {
......@@ -213,11 +214,11 @@ void vp9_inverse_transform_sbuv_4x4(MACROBLOCKD *xd) {
for (n = 0; n < 16; n++) {
const int x_idx = n & 3, y_idx = n >> 2;
vp9_inverse_transform_b_4x4(xd, xd->eobs[64 + n],
vp9_inverse_transform_b_4x4(xd, xd->plane[1].eobs[n],
BLOCK_OFFSET(xd->plane[1].dqcoeff, n, 16),
xd->diff + 1024 + x_idx * 4 + y_idx * 16 * 4,
32);
vp9_inverse_transform_b_4x4(xd, xd->eobs[64 + 16 + n],
vp9_inverse_transform_b_4x4(xd, xd->plane[2].eobs[n],
BLOCK_OFFSET(xd->plane[2].dqcoeff, n, 16),
xd->diff + 1280 + x_idx * 4 + y_idx * 16 * 4,
32);
......@@ -278,7 +279,7 @@ void vp9_inverse_transform_sb64y_4x4(MACROBLOCKD *xd) {
const TX_TYPE tx_type = get_tx_type_4x4(xd, y_idx * 16 + x_idx);
if (tx_type == DCT_DCT) {
vp9_inverse_transform_b_4x4(xd, xd->eobs[n],
vp9_inverse_transform_b_4x4(xd, xd->plane[0].eobs[n],
BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 16),
xd->diff + x_idx * 4 + y_idx * 4 * 64, 128);
} else {
......@@ -327,10 +328,10 @@ void vp9_inverse_transform_sb64uv_4x4(MACROBLOCKD *xd) {
for (n = 0; n < 64; n++) {
const int x_idx = n & 7, y_idx = n >> 3, off = x_idx * 4 + y_idx * 32 * 4;
vp9_inverse_transform_b_4x4(xd, xd->eobs[256 + n],
vp9_inverse_transform_b_4x4(xd, xd->plane[1].eobs[n],
BLOCK_OFFSET(xd->plane[1].dqcoeff, n, 16),
xd->diff + 4096 + off, 64);
vp9_inverse_transform_b_4x4(xd, xd->eobs[256 + 64 + n],
vp9_inverse_transform_b_4x4(xd, xd->plane[2].eobs[n],
BLOCK_OFFSET(xd->plane[2].dqcoeff, n, 16),
xd->diff + 4096 + 1024 + off, 64);
}
......
......@@ -248,20 +248,20 @@ static void decode_16x16(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_ht_dequant_idct_add_16x16_c(tx_type, xd->plane[0].qcoeff,
xd->block[0].dequant, xd->predictor,
xd->dst.y_buffer, 16, xd->dst.y_stride,
xd->eobs[0]);
xd->plane[0].eobs[0]);
} else {
vp9_dequant_idct_add_16x16(xd->plane[0].qcoeff, xd->block[0].dequant,
xd->predictor, xd->dst.y_buffer,
16, xd->dst.y_stride, xd->eobs[0]);
16, xd->dst.y_stride, xd->plane[0].eobs[0]);
}
vp9_dequant_idct_add_8x8(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16, xd->dst.u_buffer, 8,
xd->dst.uv_stride, xd->eobs[16]);
xd->dst.uv_stride, xd->plane[1].eobs[0]);
vp9_dequant_idct_add_8x8(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16 + 64, xd->dst.v_buffer, 8,
xd->dst.uv_stride, xd->eobs[20]);
xd->dst.uv_stride, xd->plane[2].eobs[0]);
}
static void decode_8x8(VP9D_COMP *pbi, MACROBLOCKD *xd,
......@@ -298,10 +298,10 @@ static void decode_8x8(VP9D_COMP *pbi, MACROBLOCKD *xd,
tx_type = get_tx_type_8x8(xd, ib);
if (tx_type != DCT_DCT) {
vp9_ht_dequant_idct_add_8x8_c(tx_type, q, dq, pre, dst, 16, stride,
xd->eobs[idx]);
xd->plane[0].eobs[idx]);
} else {
vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride,
xd->eobs[idx]);
xd->plane[0].eobs[idx]);
}
}
} else {
......@@ -325,29 +325,31 @@ static void decode_8x8(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_intra_uv4x4_predict(xd, b, i8x8mode, b->predictor);
xd->itxm_add(BLOCK_OFFSET(xd->plane[1].qcoeff, i, 16),
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 8, b->dst_stride, xd->eobs[16 + i]);
*(b->base_dst) + b->dst, 8, b->dst_stride,
xd->plane[1].eobs[i]);
b = &xd->block[20 + i];
vp9_intra_uv4x4_predict(xd, b, i8x8mode, b->predictor);
xd->itxm_add(BLOCK_OFFSET(xd->plane[2].qcoeff, i, 16),
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 8, b->dst_stride, xd->eobs[20 + i]);
*(b->base_dst) + b->dst, 8, b->dst_stride,
xd->plane[2].eobs[i]);
}
} else if (xd->mode_info_context->mbmi.mode == SPLITMV) {
xd->itxm_add_uv_block(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16, xd->dst.u_buffer,
xd->dst.uv_stride, xd->eobs + 16);
xd->dst.uv_stride, xd->plane[1].eobs);
xd->itxm_add_uv_block(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16 + 64, xd->dst.v_buffer,
xd->dst.uv_stride, xd->eobs + 20);
xd->dst.uv_stride, xd->plane[2].eobs);
} else {
vp9_dequant_idct_add_8x8(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16, xd->dst.u_buffer, 8,
xd->dst.uv_stride, xd->eobs[16]);
xd->dst.uv_stride, xd->plane[1].eobs[0]);
vp9_dequant_idct_add_8x8(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16 + 64, xd->dst.v_buffer, 8,
xd->dst.uv_stride, xd->eobs[20]);
xd->dst.uv_stride, xd->plane[2].eobs[0]);
}
#if 0 // def DEC_DEBUG
if (dec_debug) {
......@@ -394,24 +396,27 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
BLOCK_OFFSET(xd->plane[0].qcoeff, ib + iblock[j], 16),
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16,
b->dst_stride, xd->eobs[ib + iblock[j]]);
b->dst_stride,
xd->plane[0].eobs[ib + iblock[j]]);
} else {
xd->itxm_add(BLOCK_OFFSET(xd->plane[0].qcoeff, ib + iblock[j], 16),
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16, b->dst_stride,
xd->eobs[ib + iblock[j]]);
xd->plane[0].eobs[ib + iblock[j]]);
}
}
b = &xd->block[16 + i];
vp9_intra_uv4x4_predict(xd, b, i8x8mode, b->predictor);
xd->itxm_add(BLOCK_OFFSET(xd->plane[1].qcoeff, i, 16),
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 8, b->dst_stride, xd->eobs[16 + i]);
*(b->base_dst) + b->dst, 8, b->dst_stride,
xd->plane[1].eobs[i]);
b = &xd->block[20 + i];
vp9_intra_uv4x4_predict(xd, b, i8x8mode, b->predictor);
xd->itxm_add(BLOCK_OFFSET(xd->plane[2].qcoeff, i, 16),
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 8, b->dst_stride, xd->eobs[20 + i]);
*(b->base_dst) + b->dst, 8, b->dst_stride,
xd->plane[2].eobs[i]);
}
} else if (mode == B_PRED) {
for (i = 0; i < 16; i++) {
......@@ -430,11 +435,12 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
BLOCK_OFFSET(xd->plane[0].qcoeff, i, 16),
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16, b->dst_stride,
xd->eobs[i]);
xd->plane[0].eobs[i]);
} else {
xd->itxm_add(BLOCK_OFFSET(xd->plane[0].qcoeff, i, 16),
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16, b->dst_stride, xd->eobs[i]);
*(b->base_dst) + b->dst, 16, b->dst_stride,
xd->plane[0].eobs[i]);
}
}
#if CONFIG_NEWBINTRAMODES
......@@ -444,10 +450,10 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_build_intra_predictors_mbuv(xd);
xd->itxm_add_uv_block(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16, xd->dst.u_buffer,
xd->dst.uv_stride, xd->eobs + 16);
xd->dst.uv_stride, xd->plane[1].eobs);
xd->itxm_add_uv_block(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16 + 64, xd->dst.v_buffer,
xd->dst.uv_stride, xd->eobs + 20);
xd->dst.uv_stride, xd->plane[2].eobs);
} else if (mode == SPLITMV || get_tx_type_4x4(xd, 0) == DCT_DCT) {
xd->itxm_add_y_block(xd->plane[0].qcoeff,
xd->block[0].dequant,
......@@ -457,10 +463,10 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd);
xd->itxm_add_uv_block(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16, xd->dst.u_buffer,
xd->dst.uv_stride, xd->eobs + 16);
xd->dst.uv_stride, xd->plane[1].eobs);
xd->itxm_add_uv_block(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16 + 64, xd->dst.v_buffer,
xd->dst.uv_stride, xd->eobs + 20);
xd->dst.uv_stride, xd->plane[2].eobs);
} else {
#if 0 // def DEC_DEBUG
if (dec_debug) {
......@@ -487,19 +493,20 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
BLOCK_OFFSET(xd->plane[0].qcoeff, i, 16),
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16,
b->dst_stride, xd->eobs[i]);
b->dst_stride, xd->plane[0].eobs[i]);
} else {
xd->itxm_add(BLOCK_OFFSET(xd->plane[0].qcoeff, i, 16),
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16, b->dst_stride, xd->eobs[i]);
*(b->base_dst) + b->dst, 16, b->dst_stride,
xd->plane[0].eobs[i]);
}
}
xd->itxm_add_uv_block(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16, xd->dst.u_buffer,
xd->dst.uv_stride, xd->eobs + 16);
xd->dst.uv_stride, xd->plane[1].eobs);
xd->itxm_add_uv_block(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->predictor + 16 * 16 + 64, xd->dst.v_buffer,
xd->dst.uv_stride, xd->eobs + 20);
xd->dst.uv_stride, xd->plane[2].eobs);
}
}
......@@ -507,9 +514,6 @@ static void decode_sb_16x16(MACROBLOCKD *mb, int y_size) {
const int y_count = y_size * y_size;
const int uv_size = y_size / 2;
const int uv_count = uv_size * uv_size;
const int u_eob_offset = 16 * y_count;
const int v_eob_offset = u_eob_offset + 16 * uv_count;
int n;
for (n = 0; n < y_count; n++) {
......@@ -524,7 +528,7 @@ static void decode_sb_16x16(MACROBLOCKD *mb, int y_size) {
mb->dst.y_buffer + y_offset,
mb->dst.y_buffer + y_offset,
mb->dst.y_stride, mb->dst.y_stride,
mb->eobs[n * 16]);
mb->plane[0].eobs[n * 16]);
} else {
vp9_ht_dequant_idct_add_16x16_c(tx_type,
BLOCK_OFFSET(mb->plane[0].qcoeff, n, 256),
......@@ -532,7 +536,7 @@ static void decode_sb_16x16(MACROBLOCKD *mb, int y_size) {
mb->dst.y_buffer + y_offset,
mb->dst.y_buffer + y_offset,
mb->dst.y_stride, mb->dst.y_stride,
mb->eobs[n * 16]);
mb->plane[0].eobs[n * 16]);
}
}
......@@ -545,13 +549,13 @@ static void decode_sb_16x16(MACROBLOCKD *mb, int y_size) {
mb->dst.u_buffer + uv_offset,
mb->dst.u_buffer + uv_offset,
mb->dst.uv_stride, mb->dst.uv_stride,
mb->eobs[u_eob_offset + n * 16]);
mb->plane[1].eobs[n * 16]);
vp9_dequant_idct_add_16x16(BLOCK_OFFSET(mb->plane[2].qcoeff, n, 256),
mb->block[20].dequant,
mb->dst.v_buffer + uv_offset,
mb->dst.v_buffer + uv_offset,
mb->dst.uv_stride, mb->dst.uv_stride,
mb->eobs[v_eob_offset + n * 16]);
mb->plane[2].eobs[n * 16]);
}
}
......@@ -559,9 +563,6 @@ static INLINE void decode_sb_8x8(MACROBLOCKD *xd, int y_size) {
const int y_count = y_size * y_size;
const int uv_size = y_size / 2;
const int uv_count = uv_size * uv_size;
const int u_eob_offset = 4 * y_count;
const int v_eob_offset = u_eob_offset + 4 * uv_count;
int n;
// luma
......@@ -577,7 +578,7 @@ static INLINE void decode_sb_8x8(MACROBLOCKD *xd, int y_size) {
xd->dst.y_buffer + y_offset,
xd->dst.y_buffer + y_offset,
xd->dst.y_stride, xd->dst.y_stride,
xd->eobs[n * 4]);
xd->plane[0].eobs[n * 4]);
} else {
vp9_ht_dequant_idct_add_8x8_c(tx_type,
BLOCK_OFFSET(xd->plane[0].qcoeff, n, 64),
......@@ -585,7 +586,7 @@ static INLINE void decode_sb_8x8(MACROBLOCKD *xd, int y_size) {
xd->dst.y_buffer + y_offset,
xd->dst.y_buffer + y_offset,
xd->dst.y_stride, xd->dst.y_stride,
xd->eobs[n * 4]);
xd->plane[0].eobs[n * 4]);
}
}
......@@ -599,13 +600,13 @@ static INLINE void decode_sb_8x8(MACROBLOCKD *xd, int y_size) {
xd->dst.u_buffer + uv_offset,
xd->dst.u_buffer + uv_offset,
xd->dst.uv_stride, xd->dst.uv_stride,
xd->eobs[u_eob_offset + n * 4]);
xd->plane[1].eobs[n * 4]);
vp9_dequant_idct_add_8x8_c(BLOCK_OFFSET(xd->plane[2].qcoeff, n, 64),
xd->block[20].dequant,
xd->dst.v_buffer + uv_offset,
xd->dst.v_buffer + uv_offset,
xd->dst.uv_stride, xd->dst.uv_stride,
xd->eobs[v_eob_offset + n * 4]);
xd->plane[2].eobs[n * 4]);
}
}
......@@ -614,9 +615,6 @@ static void decode_sb_4x4(MACROBLOCKD *xd, int y_size) {
const int y_count = y_size * y_size;
const int uv_size = y_size / 2;
const int uv_count = uv_size * uv_size;
const int u_eob_offset = y_count;
const int v_eob_offset = u_eob_offset + uv_count;
int n;
for (n = 0; n < y_count; n++) {
......@@ -630,7 +628,7 @@ static void decode_sb_4x4(MACROBLOCKD *xd, int y_size) {
xd->dst.y_buffer + y_offset,
xd->dst.y_buffer + y_offset,
xd->dst.y_stride, xd->dst.y_stride,
xd->eobs[n]);
xd->plane[0].eobs[n]);
} else {
vp9_ht_dequant_idct_add_c(tx_type,
BLOCK_OFFSET(xd->plane[0].qcoeff, n, 16),
......@@ -639,7 +637,7 @@ static void decode_sb_4x4(MACROBLOCKD *xd, int y_size) {
xd->dst.y_buffer + y_offset,
xd->dst.y_stride,
xd->dst.y_stride,
xd->eobs[n]);
xd->plane[0].eobs[n]);
}
}
......@@ -651,12 +649,12 @@ static void decode_sb_4x4(MACROBLOCKD *xd, int y_size) {
xd->block[16].dequant,
xd->dst.u_buffer + uv_offset,
xd->dst.u_buffer + uv_offset,
xd->dst.uv_stride, xd->dst.uv_stride, xd->eobs[u_eob_offset + n]);
xd->dst.uv_stride, xd->dst.uv_stride, xd->plane[1].eobs[n]);
xd->itxm_add(BLOCK_OFFSET(xd->plane[2].qcoeff, n, 16),
xd->block[20].dequant,
xd->dst.v_buffer + uv_offset,
xd->dst.v_buffer + uv_offset,
xd->dst.uv_stride, xd->dst.uv_stride, xd->eobs[v_eob_offset + n]);
xd->dst.uv_stride, xd->dst.uv_stride, xd->plane[2].eobs[n]);
}
}
......@@ -712,14 +710,14 @@ static void decode_sb64(VP9D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col,
xd->block[0].dequant,
xd->dst.y_buffer + y_offset,
xd->dst.y_buffer + y_offset,
xd->dst.y_stride, xd->dst.y_stride, xd->eobs[n * 64]);
xd->dst.y_stride, xd->dst.y_stride, xd->plane[0].eobs[n * 64]);
}
vp9_dequant_idct_add_32x32(xd->plane[1].qcoeff,
xd->block[16].dequant, xd->dst.u_buffer, xd->dst.u_buffer,
xd->dst.uv_stride, xd->dst.uv_stride, xd->eobs[256]);
xd->dst.uv_stride, xd->dst.uv_stride, xd->plane[1].eobs[0]);
vp9_dequant_idct_add_32x32(xd->plane[2].qcoeff,
xd->block[20].dequant, xd->dst.v_buffer, xd->dst.v_buffer,
xd->dst.uv_stride, xd->dst.uv_stride, xd->eobs[320]);
xd->dst.uv_stride, xd->dst.uv_stride, xd->plane[2].eobs[0]);
break;
case TX_16X16:
decode_sb_16x16(xd, 4);
......@@ -789,15 +787,15 @@ static void decode_sb32(VP9D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col,
vp9_dequant_idct_add_32x32(xd->plane[0].qcoeff, xd->block[0].dequant,
xd->dst.y_buffer, xd->dst.y_buffer,
xd->dst.y_stride, xd->dst.y_stride,
xd->eobs[0]);
xd->plane[0].eobs[0]);
vp9_dequant_idct_add_16x16(xd->plane[1].qcoeff, xd->block[16].dequant,
xd->dst.u_buffer, xd->dst.u_buffer,
xd->dst.uv_stride, xd->dst.uv_stride,
xd->eobs[64]);
xd->plane[1].eobs[0]);
vp9_dequant_idct_add_16x16(xd->plane[2].qcoeff, xd->block[16].dequant,
xd->dst.v_buffer, xd->dst.v_buffer,
xd->dst.uv_stride, xd->dst.uv_stride,
xd->eobs[80]);
xd->plane[2].eobs[0]);
break;
case TX_16X16:
decode_sb_16x16(xd, 2);
......
......@@ -396,7 +396,7 @@ static INLINE int decode_sb(VP9D_COMP* const pbi,
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_Y_WITH_DC, seg_eob,
BLOCK_OFFSET(xd->plane[0].qcoeff, i, 16),
tx_size);
xd->eobs[i] = c;
xd->plane[0].eobs[i] = c;
eobtotal += c;
}
......@@ -406,7 +406,7 @@ static INLINE int decode_sb(VP9D_COMP* const pbi,
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, seg_eob,
BLOCK_OFFSET(xd->plane[1].qcoeff, b, 16),
tx_size);
xd->eobs[i] = c;
xd->plane[1].eobs[b] = c;
eobtotal += c;
}
for (i = offset * 5 / 4; i < count; i += inc) {
......@@ -414,7 +414,7 @@ static INLINE int decode_sb(VP9D_COMP* const pbi,
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, seg_eob,
BLOCK_OFFSET(xd->plane[2].qcoeff, b, 16),
tx_size);
xd->eobs[i] = c;
xd->plane[2].eobs[b] = c;
eobtotal += c;
}
......@@ -432,7 +432,7 @@ int vp9_decode_sb_tokens(VP9D_COMP* const pbi,
int c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
get_eob(xd, segment_id, 1024),
xd->plane[0].qcoeff, TX_32X32);
xd->eobs[0] = c;
xd->plane[0].eobs[0] = c;
eobtotal += c;
// 16x16 chroma blocks
......@@ -440,11 +440,11 @@ int vp9_decode_sb_tokens(VP9D_COMP* const pbi,
c = decode_coefs(pbi, xd, bc, 64, PLANE_TYPE_UV, seg_eob,
xd->plane[1].qcoeff, TX_16X16);
xd->eobs[64] = c;
xd->plane[1].eobs[0] = c;
eobtotal += c;
c = decode_coefs(pbi, xd, bc, 80, PLANE_TYPE_UV, seg_eob,
xd->plane[2].qcoeff, TX_16X16);
xd->eobs[80] = c;
xd->plane[2].eobs[0] = c;
eobtotal += c;
return eobtotal;
}
......@@ -488,7 +488,7 @@ static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
int c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
get_eob(xd, segment_id, 256),
xd->plane[0].qcoeff, TX_16X16);
xd->eobs[0] = c;
xd->plane[0].eobs[0] = c;
eobtotal += c;
// 8x8 chroma blocks
......@@ -496,11 +496,11 @@ static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
c = decode_coefs(pbi, xd, bc, 16, PLANE_TYPE_UV,
seg_eob, xd->plane[1].qcoeff, TX_8X8);
xd->eobs[16] = c;
xd->plane[1].eobs[0] = c;
eobtotal += c;
c = decode_coefs(pbi, xd, bc, 20, PLANE_TYPE_UV,
seg_eob, xd->plane[2].qcoeff, TX_8X8);
xd->eobs[20] = c;
xd->plane[2].eobs[0] = c;
eobtotal += c;
return eobtotal;
}
......@@ -517,7 +517,7 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_Y_WITH_DC, seg_eob,
BLOCK_OFFSET(xd->plane[0].qcoeff, i, 16),
TX_8X8);
xd->eobs[i] = c;
xd->plane[0].eobs[i] = c;
eobtotal += c;
}
......@@ -530,14 +530,14 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, seg_eob,
BLOCK_OFFSET(xd->plane[1].qcoeff, i - 16, 16),
TX_4X4);
xd->eobs[i] = c;
xd->plane[1].eobs[i - 16] = c;
eobtotal += c;
}
for (i = 20; i < 24; i++) {
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, seg_eob,
BLOCK_OFFSET(xd->plane[2].qcoeff, i - 20, 16),
TX_4X4);
xd->eobs[i] = c;
xd->plane[2].eobs[i - 20] = c;
eobtotal += c;
}
} else {
......@@ -545,11 +545,11 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
c = decode_coefs(pbi, xd, bc, 16, PLANE_TYPE_UV, seg_eob,
xd->plane[1].qcoeff, TX_8X8);
xd->eobs[16] = c;
xd->plane[1].eobs[0] = c;
eobtotal += c;
c = decode_coefs(pbi, xd, bc, 20, PLANE_TYPE_UV, seg_eob,
xd->plane[2].qcoeff, TX_8X8);
xd->eobs[20] = c;
xd->plane[2].eobs[0] = c;
eobtotal += c;
}
......@@ -559,9 +559,10 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
static int decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
BOOL_DECODER* const bc,
PLANE_TYPE type, int i, int seg_eob) {
const struct plane_block_idx pb_idx = plane_block_idx(16, i);
const int c = decode_coefs(dx, xd, bc, i, type, seg_eob,
MB_SUBBLOCK_FIELD(xd, qcoeff, i), TX_4X4);
xd->eobs[i] = c;
BLOCK_OFFSET(xd->plane[pb_idx.plane].qcoeff, pb_idx.block, 16), TX_4X4);
xd->plane[pb_idx.plane].eobs[pb_idx.block] = c;
return c;
}
......
......@@ -20,7 +20,8 @@ void vp9_dequant_idct_add_y_block_c(int16_t *q, const int16_t *dq,
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
vp9_dequant_idct_add(q, dq, pre, dst, 16, stride, xd->eobs[i * 4 + j]);
vp9_dequant_idct_add(q, dq, pre, dst, 16, stride,
xd->plane[0].eobs[i