Commit 4c05a051 authored by John Koleszar's avatar John Koleszar
Browse files

Move qcoeff, dqcoeff from BLOCKD to per-plane data

Start grouping data per-plane, as part of refactoring to support
additional planes, and chroma planes with other-than 4:2:0
subsampling.

Change-Id: Idb76a0e23ab239180c818025bae1f36f1608bb23
parent ffc92da4
......@@ -260,8 +260,6 @@ typedef struct {
} MODE_INFO;
typedef struct blockd {
int16_t *qcoeff;
int16_t *dqcoeff;
uint8_t *predictor;
int16_t *diff;
int16_t *dequant;
......@@ -295,15 +293,28 @@ struct scale_factors {
#endif
};
enum { MAX_MB_PLANE = 3 };
struct mb_plane {
DECLARE_ALIGNED(16, int16_t, qcoeff[64 * 64]);
DECLARE_ALIGNED(16, int16_t, dqcoeff[64 * 64]);
};
#define BLOCK_OFFSET(x, i, n) ((x) + (i) * (n))
#define MB_SUBBLOCK_FIELD(x, field, i) (\
((i) < 16) ? BLOCK_OFFSET((x)->plane[0].field, (i), 16) : \
((i) < 20) ? BLOCK_OFFSET((x)->plane[1].field, ((i) - 16), 16) : \
BLOCK_OFFSET((x)->plane[2].field, ((i) - 20), 16))
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, int16_t, qcoeff[64*64+32*32*2]);
DECLARE_ALIGNED(16, int16_t, dqcoeff[64*64+32*32*2]);
DECLARE_ALIGNED(16, uint16_t, eobs[256+64*2]);
#if CONFIG_CODE_NONZEROCOUNT
DECLARE_ALIGNED(16, uint16_t, nzcs[256+64*2]);
#endif
struct mb_plane plane[MAX_MB_PLANE];
/* 16 Y blocks, 4 U, 4 V, each with 16 entries. */
BLOCKD block[24];
......@@ -384,8 +395,8 @@ typedef struct macroblockd {
void (*itxm_add_y_block)(int16_t *q, const int16_t *dq,
uint8_t *pre, uint8_t *dst, int stride, struct macroblockd *xd);
void (*itxm_add_uv_block)(int16_t *q, const int16_t *dq,
uint8_t *pre, uint8_t *dst_u, uint8_t *dst_v, int stride,
struct macroblockd *xd);
uint8_t *pre, uint8_t *dst, int stride,
uint16_t *eobs);
struct subpix_fn_table subpix;
......@@ -681,4 +692,34 @@ static int get_nzc_used(TX_SIZE tx_size) {
return (tx_size >= TX_16X16);
}
#endif
struct plane_block_idx {
int plane;
int block;
};
// 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);
struct plane_block_idx res;
if (b_idx < u_offset) {
res.plane = 0;
res.block = b_idx;
} else if (b_idx < v_offset) {
res.plane = 1;
res.block = b_idx - u_offset;
} else {
assert(b_idx < (24 << (sb_type * 2)));
res.plane = 2;
res.block = b_idx - v_offset;
}
return res;
}
#endif // VP9_COMMON_VP9_BLOCKD_H_
......@@ -26,9 +26,11 @@ void vp9_inverse_transform_mby_4x4(MACROBLOCKD *xd) {
for (i = 0; i < 16; i++) {
TX_TYPE tx_type = get_tx_type_4x4(xd, i);
if (tx_type != DCT_DCT) {
vp9_short_iht4x4(xd->block[i].dqcoeff, xd->block[i].diff, 16, tx_type);
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], xd->block[i].dqcoeff,
vp9_inverse_transform_b_4x4(xd, xd->eobs[i],
BLOCK_OFFSET(xd->plane[0].dqcoeff, i, 16),
xd->block[i].diff, 32);
}
}
......@@ -37,8 +39,14 @@ void vp9_inverse_transform_mby_4x4(MACROBLOCKD *xd) {
void vp9_inverse_transform_mbuv_4x4(MACROBLOCKD *xd) {
int i;
for (i = 16; i < 24; i++) {
vp9_inverse_transform_b_4x4(xd, xd->eobs[i], xd->block[i].dqcoeff,
for (i = 16; i < 20; i++) {
vp9_inverse_transform_b_4x4(xd, xd->eobs[i],
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],
BLOCK_OFFSET(xd->plane[2].dqcoeff, i - 20, 16),
xd->block[i].diff, 16);
}
}
......@@ -60,19 +68,20 @@ void vp9_inverse_transform_mby_8x8(MACROBLOCKD *xd) {
for (i = 0; i < 9; i += 8) {
TX_TYPE tx_type = get_tx_type_8x8(xd, i);
if (tx_type != DCT_DCT) {
vp9_short_iht8x8(xd->block[i].dqcoeff, xd->block[i].diff, 16, tx_type);
vp9_short_iht8x8(BLOCK_OFFSET(xd->plane[0].dqcoeff, i, 16),
xd->block[i].diff, 16, tx_type);
} else {
vp9_inverse_transform_b_8x8(&blockd[i].dqcoeff[0],
vp9_inverse_transform_b_8x8(BLOCK_OFFSET(xd->plane[0].dqcoeff, i, 16),
&blockd[i].diff[0], 32);
}
}
for (i = 2; i < 11; i += 8) {
TX_TYPE tx_type = get_tx_type_8x8(xd, i);
if (tx_type != DCT_DCT) {
vp9_short_iht8x8(xd->block[i + 2].dqcoeff, xd->block[i].diff,
16, tx_type);
vp9_short_iht8x8(BLOCK_OFFSET(xd->plane[0].dqcoeff, i + 2, 16),
xd->block[i].diff, 16, tx_type);
} else {
vp9_inverse_transform_b_8x8(&blockd[i + 2].dqcoeff[0],
vp9_inverse_transform_b_8x8(BLOCK_OFFSET(xd->plane[0].dqcoeff, i + 2, 16),
&blockd[i].diff[0], 32);
}
}
......@@ -82,8 +91,12 @@ void vp9_inverse_transform_mbuv_8x8(MACROBLOCKD *xd) {
int i;
BLOCKD *blockd = xd->block;
for (i = 16; i < 24; i += 4) {
vp9_inverse_transform_b_8x8(&blockd[i].dqcoeff[0],
for (i = 16; i < 20; i += 4) {
vp9_inverse_transform_b_8x8(BLOCK_OFFSET(xd->plane[1].dqcoeff, i - 16, 16),
&blockd[i].diff[0], 16);
}
for (i = 20; i < 24; i += 4) {
vp9_inverse_transform_b_8x8(BLOCK_OFFSET(xd->plane[2].dqcoeff, i - 20, 16),
&blockd[i].diff[0], 16);
}
}
......@@ -102,9 +115,10 @@ void vp9_inverse_transform_mby_16x16(MACROBLOCKD *xd) {
BLOCKD *bd = &xd->block[0];
TX_TYPE tx_type = get_tx_type_16x16(xd, 0);
if (tx_type != DCT_DCT) {
vp9_short_iht16x16(bd->dqcoeff, bd->diff, 16, tx_type);
vp9_short_iht16x16(BLOCK_OFFSET(xd->plane[0].dqcoeff, 0, 16),
bd->diff, 16, tx_type);
} else {
vp9_inverse_transform_b_16x16(&xd->block[0].dqcoeff[0],
vp9_inverse_transform_b_16x16(BLOCK_OFFSET(xd->plane[0].dqcoeff, 0, 16),
&xd->block[0].diff[0], 32);
}
}
......@@ -115,7 +129,7 @@ void vp9_inverse_transform_mb_16x16(MACROBLOCKD *xd) {
}
void vp9_inverse_transform_sby_32x32(MACROBLOCKD *xd) {
vp9_short_idct32x32(xd->dqcoeff, xd->diff, 64);
vp9_short_idct32x32(BLOCK_OFFSET(xd->plane[0].dqcoeff, 0, 16), xd->diff, 64);
}
void vp9_inverse_transform_sby_16x16(MACROBLOCKD *xd) {
......@@ -126,11 +140,11 @@ void vp9_inverse_transform_sby_16x16(MACROBLOCKD *xd) {
const TX_TYPE tx_type = get_tx_type_16x16(xd, (y_idx * 8 + x_idx) * 4);
if (tx_type == DCT_DCT) {
vp9_inverse_transform_b_16x16(xd->dqcoeff + n * 256,
vp9_inverse_transform_b_16x16(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 256),
xd->diff + x_idx * 16 + y_idx * 32 * 16,
64);
} else {
vp9_short_iht16x16(xd->dqcoeff + n * 256,
vp9_short_iht16x16(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 256),
xd->diff + x_idx * 16 + y_idx * 32 * 16, 32, tx_type);
}
}
......@@ -144,10 +158,10 @@ void vp9_inverse_transform_sby_8x8(MACROBLOCKD *xd) {
const TX_TYPE tx_type = get_tx_type_8x8(xd, (y_idx * 8 + x_idx) * 2);
if (tx_type == DCT_DCT) {
vp9_inverse_transform_b_8x8(xd->dqcoeff + n * 64,
vp9_inverse_transform_b_8x8(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 64),
xd->diff + x_idx * 8 + y_idx * 32 * 8, 64);
} else {
vp9_short_iht8x8(xd->dqcoeff + n * 64,
vp9_short_iht8x8(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 64),
xd->diff + x_idx * 8 + y_idx * 32 * 8, 32, tx_type);
}
}
......@@ -161,19 +175,20 @@ 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], xd->dqcoeff + n * 16,
vp9_inverse_transform_b_4x4(xd, xd->eobs[n],
BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 16),
xd->diff + x_idx * 4 + y_idx * 4 * 32, 64);
} else {
vp9_short_iht4x4(xd->dqcoeff + n * 16,
vp9_short_iht4x4(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 16),
xd->diff + x_idx * 4 + y_idx * 4 * 32, 32, tx_type);
}
}
}
void vp9_inverse_transform_sbuv_16x16(MACROBLOCKD *xd) {
vp9_inverse_transform_b_16x16(xd->dqcoeff + 1024,
vp9_inverse_transform_b_16x16(xd->plane[1].dqcoeff,
xd->diff + 1024, 32);
vp9_inverse_transform_b_16x16(xd->dqcoeff + 1280,
vp9_inverse_transform_b_16x16(xd->plane[2].dqcoeff,
xd->diff + 1280, 32);
}
......@@ -183,10 +198,10 @@ void vp9_inverse_transform_sbuv_8x8(MACROBLOCKD *xd) {
for (n = 0; n < 4; n++) {
const int x_idx = n & 1, y_idx = n >> 1;
vp9_inverse_transform_b_8x8(xd->dqcoeff + 1024 + n * 64,
vp9_inverse_transform_b_8x8(BLOCK_OFFSET(xd->plane[1].dqcoeff, n, 64),
xd->diff + 1024 + x_idx * 8 + y_idx * 16 * 8,
32);
vp9_inverse_transform_b_8x8(xd->dqcoeff + 1280 + n * 64,
vp9_inverse_transform_b_8x8(BLOCK_OFFSET(xd->plane[2].dqcoeff, n, 64),
xd->diff + 1280 + x_idx * 8 + y_idx * 16 * 8,
32);
}
......@@ -199,11 +214,11 @@ void vp9_inverse_transform_sbuv_4x4(MACROBLOCKD *xd) {
const int x_idx = n & 3, y_idx = n >> 2;
vp9_inverse_transform_b_4x4(xd, xd->eobs[64 + n],
xd->dqcoeff + 1024 + n * 16,
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],
xd->dqcoeff + 1280 + n * 16,
BLOCK_OFFSET(xd->plane[2].dqcoeff, n, 16),
xd->diff + 1280 + x_idx * 4 + y_idx * 16 * 4,
32);
}
......@@ -215,7 +230,7 @@ void vp9_inverse_transform_sb64y_32x32(MACROBLOCKD *xd) {
for (n = 0; n < 4; n++) {
const int x_idx = n & 1, y_idx = n >> 1;
vp9_short_idct32x32(xd->dqcoeff + n * 1024,
vp9_short_idct32x32(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 1024),
xd->diff + x_idx * 32 + y_idx * 32 * 64, 128);
}
}
......@@ -228,11 +243,11 @@ void vp9_inverse_transform_sb64y_16x16(MACROBLOCKD *xd) {
const TX_TYPE tx_type = get_tx_type_16x16(xd, (y_idx * 16 + x_idx) * 4);
if (tx_type == DCT_DCT) {
vp9_inverse_transform_b_16x16(xd->dqcoeff + n * 256,
vp9_inverse_transform_b_16x16(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 256),
xd->diff + x_idx * 16 + y_idx * 64 * 16,
128);
} else {
vp9_short_iht16x16(xd->dqcoeff + n * 256,
vp9_short_iht16x16(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 256),
xd->diff + x_idx * 16 + y_idx * 64 * 16, 64, tx_type);
}
}
......@@ -246,10 +261,10 @@ void vp9_inverse_transform_sb64y_8x8(MACROBLOCKD *xd) {
const TX_TYPE tx_type = get_tx_type_8x8(xd, (y_idx * 16 + x_idx) * 2);
if (tx_type == DCT_DCT) {
vp9_inverse_transform_b_8x8(xd->dqcoeff + n * 64,
vp9_inverse_transform_b_8x8(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 64),
xd->diff + x_idx * 8 + y_idx * 64 * 8, 128);
} else {
vp9_short_iht8x8(xd->dqcoeff + n * 64,
vp9_short_iht8x8(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 64),
xd->diff + x_idx * 8 + y_idx * 64 * 8, 64, tx_type);
}
}
......@@ -263,19 +278,20 @@ 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], xd->dqcoeff + n * 16,
vp9_inverse_transform_b_4x4(xd, xd->eobs[n],
BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 16),
xd->diff + x_idx * 4 + y_idx * 4 * 64, 128);
} else {
vp9_short_iht4x4(xd->dqcoeff + n * 16,
vp9_short_iht4x4(BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 16),
xd->diff + x_idx * 4 + y_idx * 4 * 64, 64, tx_type);
}
}
}
void vp9_inverse_transform_sb64uv_32x32(MACROBLOCKD *xd) {
vp9_short_idct32x32(xd->dqcoeff + 4096,
vp9_short_idct32x32(xd->plane[1].dqcoeff,
xd->diff + 4096, 64);
vp9_short_idct32x32(xd->dqcoeff + 4096 + 1024,
vp9_short_idct32x32(xd->plane[2].dqcoeff,
xd->diff + 4096 + 1024, 64);
}
......@@ -285,9 +301,9 @@ void vp9_inverse_transform_sb64uv_16x16(MACROBLOCKD *xd) {
for (n = 0; n < 4; n++) {
const int x_idx = n & 1, y_idx = n >> 1, off = x_idx * 16 + y_idx * 32 * 16;
vp9_inverse_transform_b_16x16(xd->dqcoeff + 4096 + n * 256,
vp9_inverse_transform_b_16x16(BLOCK_OFFSET(xd->plane[1].dqcoeff, n, 256),
xd->diff + 4096 + off, 64);
vp9_inverse_transform_b_16x16(xd->dqcoeff + 4096 + 1024 + n * 256,
vp9_inverse_transform_b_16x16(BLOCK_OFFSET(xd->plane[2].dqcoeff, n, 256),
xd->diff + 4096 + 1024 + off, 64);
}
}
......@@ -298,9 +314,9 @@ void vp9_inverse_transform_sb64uv_8x8(MACROBLOCKD *xd) {
for (n = 0; n < 16; n++) {
const int x_idx = n & 3, y_idx = n >> 2, off = x_idx * 8 + y_idx * 32 * 8;
vp9_inverse_transform_b_8x8(xd->dqcoeff + 4096 + n * 64,
vp9_inverse_transform_b_8x8(BLOCK_OFFSET(xd->plane[1].dqcoeff, n, 64),
xd->diff + 4096 + off, 64);
vp9_inverse_transform_b_8x8(xd->dqcoeff + 4096 + 1024 + n * 64,
vp9_inverse_transform_b_8x8(BLOCK_OFFSET(xd->plane[2].dqcoeff, n, 64),
xd->diff + 4096 + 1024 + off, 64);
}
}
......@@ -312,10 +328,10 @@ void vp9_inverse_transform_sb64uv_4x4(MACROBLOCKD *xd) {
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],
xd->dqcoeff + 4096 + n * 16,
BLOCK_OFFSET(xd->plane[1].dqcoeff, n, 16),
xd->diff + 4096 + off, 64);
vp9_inverse_transform_b_4x4(xd, xd->eobs[256 + 64 + n],
xd->dqcoeff + 4096 + 1024 + n * 16,
BLOCK_OFFSET(xd->plane[2].dqcoeff, n, 16),
xd->diff + 4096 + 1024 + off, 64);
}
}
......@@ -99,11 +99,6 @@ void vp9_setup_block_dptrs(MACROBLOCKD *mb) {
blockd[to].predictor = &mb->predictor[from];
}
}
for (r = 0; r < 24; r++) {
blockd[r].qcoeff = &mb->qcoeff[r * 16];
blockd[r].dqcoeff = &mb->dqcoeff[r * 16];
}
}
void vp9_build_block_doffsets(MACROBLOCKD *mb) {
......
......@@ -29,9 +29,6 @@ forward_decls vp9_common_forward_decls
prototype void vp9_dequant_idct_add_y_block_8x8 "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dst, int stride, struct macroblockd *xd"
specialize vp9_dequant_idct_add_y_block_8x8
prototype void vp9_dequant_idct_add_uv_block_8x8 "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dstu, uint8_t *dstv, int stride, struct macroblockd *xd"
specialize vp9_dequant_idct_add_uv_block_8x8
prototype void vp9_dequant_idct_add_16x16 "int16_t *input, const int16_t *dq, uint8_t *pred, uint8_t *dest, int pitch, int stride, int eob"
specialize vp9_dequant_idct_add_16x16
......@@ -44,15 +41,12 @@ specialize vp9_dequant_idct_add
prototype void vp9_dequant_idct_add_y_block "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dst, int stride, struct macroblockd *xd"
specialize vp9_dequant_idct_add_y_block
prototype void vp9_dequant_idct_add_uv_block "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dstu, uint8_t *dstv, int stride, struct macroblockd *xd"
prototype void vp9_dequant_idct_add_uv_block "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dst, int stride, uint16_t *eobs"
specialize vp9_dequant_idct_add_uv_block
prototype void vp9_dequant_idct_add_32x32 "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dst, int pitch, int stride, int eob"
specialize vp9_dequant_idct_add_32x32
prototype void vp9_dequant_idct_add_uv_block_16x16 "int16_t *q, const int16_t *dq, uint8_t *dstu, uint8_t *dstv, int stride, struct macroblockd *xd"
specialize vp9_dequant_idct_add_uv_block_16x16
#
# RECON
#
......@@ -606,8 +600,7 @@ prototype void vp9_subtract_b "struct block *be, struct blockd *bd, int pitch"
specialize vp9_subtract_b mmx sse2
prototype int vp9_mbuverror "struct macroblock *mb"
specialize vp9_mbuverror mmx sse2
vp9_mbuverror_sse2=vp9_mbuverror_xmm
specialize vp9_mbuverror
prototype void vp9_subtract_b "struct block *be, struct blockd *bd, int pitch"
specialize vp9_subtract_b mmx sse2
......
This diff is collapsed.
......@@ -388,14 +388,3 @@ void vp9_dequant_idct_add_32x32_c(int16_t *input, const int16_t *dq,
}
}
}
void vp9_dequant_idct_add_uv_block_16x16_c(int16_t *q, const int16_t *dq,
uint8_t *dstu,
uint8_t *dstv,
int stride,
MACROBLOCKD *xd) {
vp9_dequant_idct_add_16x16_c(q, dq, dstu, dstu, stride, stride,
xd->eobs[64]);
vp9_dequant_idct_add_16x16_c(q + 256, dq, dstv, dstv, stride, stride,
xd->eobs[80]);
}
......@@ -40,10 +40,9 @@ void vp9_dequant_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
void vp9_dequant_idct_add_uv_block_lossless_c(int16_t *q, const int16_t *dq,
unsigned char *pre,
unsigned char *dst_u,
unsigned char *dst_v,
unsigned char *dst,
int stride,
struct macroblockd *xd);
uint16_t *eobs);
void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input, const int16_t *dq,
unsigned char *pred, unsigned char *dest,
......
......@@ -389,18 +389,31 @@ static INLINE int decode_sb(VP9D_COMP* const pbi,
const int seg_eob = get_eob(xd, segment_id, eob_max);
int i, eobtotal = 0;
assert(count == offset * 3 / 2);
// luma blocks
for (i = 0; i < offset; i += inc) {
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_Y_WITH_DC, seg_eob,
xd->qcoeff + i * 16, tx_size);
BLOCK_OFFSET(xd->plane[0].qcoeff, i, 16),
tx_size);
xd->eobs[i] = c;
eobtotal += c;
}
// chroma blocks
for (i = offset; i < count; i += inc) {
for (i = offset; i < offset * 5 / 4; i += inc) {
const int b = i - offset;
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;
eobtotal += c;
}
for (i = offset * 5 / 4; i < count; i += inc) {
const int b = i - offset * 5 / 4;
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, seg_eob,
xd->qcoeff + i * 16, tx_size);
BLOCK_OFFSET(xd->plane[2].qcoeff, b, 16),
tx_size);
xd->eobs[i] = c;
eobtotal += c;
}
......@@ -415,20 +428,24 @@ int vp9_decode_sb_tokens(VP9D_COMP* const pbi,
case TX_32X32: {
// 32x32 luma block
const int segment_id = xd->mode_info_context->mbmi.segment_id;
int i, eobtotal = 0, seg_eob;
int eobtotal = 0, seg_eob;
int c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
get_eob(xd, segment_id, 1024), xd->qcoeff, TX_32X32);
get_eob(xd, segment_id, 1024),
xd->plane[0].qcoeff, TX_32X32);
xd->eobs[0] = c;
eobtotal += c;
// 16x16 chroma blocks
seg_eob = get_eob(xd, segment_id, 256);
for (i = 64; i < 96; i += 16) {
c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, seg_eob,
xd->qcoeff + i * 16, TX_16X16);
xd->eobs[i] = c;
eobtotal += c;
}
c = decode_coefs(pbi, xd, bc, 64, PLANE_TYPE_UV, seg_eob,
xd->plane[1].qcoeff, TX_16X16);
xd->eobs[64] = 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;
eobtotal += c;
return eobtotal;
}
case TX_16X16:
......@@ -465,22 +482,26 @@ static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
MACROBLOCKD* const xd,
BOOL_DECODER* const bc) {
const int segment_id = xd->mode_info_context->mbmi.segment_id;
int i, eobtotal = 0, seg_eob;
int eobtotal = 0, seg_eob;
// Luma block
int c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
get_eob(xd, segment_id, 256), xd->qcoeff, TX_16X16);
get_eob(xd, segment_id, 256),
xd->plane[0].qcoeff, TX_16X16);
xd->eobs[0] = c;
eobtotal += c;
// 8x8 chroma blocks
seg_eob = get_eob(xd, segment_id, 64);
for (i = 16; i < 24; i += 4) {
c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
seg_eob, xd->block[i].qcoeff, TX_8X8);
xd->eobs[i] = c;
eobtotal += c;
}
c = decode_coefs(pbi, xd, bc, 16, PLANE_TYPE_UV,
seg_eob, xd->plane[1].qcoeff, TX_8X8);
xd->eobs[16] = 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;
eobtotal += c;
return eobtotal;
}
......@@ -493,8 +514,9 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
// luma blocks
int seg_eob = get_eob(xd, segment_id, 64);
for (i = 0; i < 16; i += 4) {
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_Y_WITH_DC,
seg_eob, xd->block[i].qcoeff, TX_8X8);
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;
eobtotal += c;
}
......@@ -504,19 +526,31 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
xd->mode_info_context->mbmi.mode == SPLITMV) {
// use 4x4 transform for U, V components in I8X8/splitmv prediction mode
seg_eob = get_eob(xd, segment_id, 16);
for (i = 16; i < 24; i++) {
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
seg_eob, xd->block[i].qcoeff, TX_4X4);
for (i = 16; i < 20; i++) {
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;
eobtotal += c;
}
} else {
for (i = 16; i < 24; i += 4) {
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
seg_eob, xd->block[i].qcoeff, TX_8X8);
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;
eobtotal += c;
}
} else {
int c;
c = decode_coefs(pbi, xd, bc, 16, PLANE_TYPE_UV, seg_eob,
xd->plane[1].qcoeff, TX_8X8);
xd->eobs[16] = c;
eobtotal += c;