summaryrefslogtreecommitdiff
path: root/vp9/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/decoder')
-rw-r--r--vp9/decoder/vp9_decodframe.c43
-rw-r--r--vp9/decoder/vp9_dequantize.c4
-rw-r--r--vp9/decoder/vp9_detokenize.c16
-rw-r--r--vp9/decoder/vp9_idct_blk.c42
4 files changed, 47 insertions, 58 deletions
diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c
index eefdbb92b..8e9e5ad7d 100644
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -226,11 +226,11 @@ static void decode_16x16(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_ht_dequant_idct_add_16x16_c(tx_type, xd->qcoeff,
xd->block[0].dequant, xd->predictor,
xd->dst.y_buffer, 16, xd->dst.y_stride,
- xd->block[0].eob);
+ xd->eobs[0]);
} else {
vp9_dequant_idct_add_16x16(xd->qcoeff, xd->block[0].dequant,
xd->predictor, xd->dst.y_buffer,
- 16, xd->dst.y_stride, xd->block[0].eob);
+ 16, xd->dst.y_stride, xd->eobs[0]);
}
vp9_dequant_idct_add_uv_block_8x8(
xd->qcoeff + 16 * 16, xd->block[16].dequant,
@@ -272,10 +272,10 @@ static void decode_8x8(VP9D_COMP *pbi, MACROBLOCKD *xd,
tx_type = get_tx_type_8x8(xd, &xd->block[ib]);
if (tx_type != DCT_DCT) {
vp9_ht_dequant_idct_add_8x8_c(tx_type, q, dq, pre, dst, 16, stride,
- xd->block[idx].eob);
+ xd->eobs[idx]);
} else {
vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride,
- xd->block[idx].eob);
+ xd->eobs[idx]);
}
}
} else {
@@ -348,7 +348,7 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_ht_dequant_idct_add_c(tx_type, b->qcoeff,
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16,
- b->dst_stride, b->eob);
+ b->dst_stride, xd->eobs[ib + iblock[j]]);
} else {
xd->itxm_add(b->qcoeff, b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16, b->dst_stride);
@@ -381,7 +381,7 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_ht_dequant_idct_add_c(tx_type, b->qcoeff,
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16, b->dst_stride,
- b->eob);
+ xd->eobs[i]);
} else {
xd->itxm_add(b->qcoeff, b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16, b->dst_stride);
@@ -437,7 +437,7 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_ht_dequant_idct_add_c(tx_type, b->qcoeff,
b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16,
- b->dst_stride, b->eob);
+ b->dst_stride, xd->eobs[i]);
} else {
xd->itxm_add(b->qcoeff, b->dequant, b->predictor,
*(b->base_dst) + b->dst, 16, b->dst_stride);
@@ -463,13 +463,13 @@ static void decode_16x16_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
tx_type, xd->qcoeff, xd->block[0].dequant,
xd->dst.y_buffer + y_idx * 16 * xd->dst.y_stride + x_idx * 16,
xd->dst.y_buffer + y_idx * 16 * xd->dst.y_stride + x_idx * 16,
- xd->dst.y_stride, xd->dst.y_stride, xd->block[0].eob);
+ xd->dst.y_stride, xd->dst.y_stride, xd->eobs[0]);
} else {
vp9_dequant_idct_add_16x16(
xd->qcoeff, xd->block[0].dequant,
xd->dst.y_buffer + y_idx * 16 * xd->dst.y_stride + x_idx * 16,
xd->dst.y_buffer + y_idx * 16 * xd->dst.y_stride + x_idx * 16,
- xd->dst.y_stride, xd->dst.y_stride, xd->block[0].eob);
+ xd->dst.y_stride, xd->dst.y_stride, xd->eobs[0]);
}
vp9_dequant_idct_add_uv_block_8x8_inplace_c(
xd->qcoeff + 16 * 16,
@@ -492,7 +492,6 @@ static void decode_8x8_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
int16_t *q = xd->block[idx].qcoeff;
int16_t *dq = xd->block[0].dequant;
int stride = xd->dst.y_stride;
- BLOCKD *b = &xd->block[ib];
tx_type = get_tx_type_8x8(xd, &xd->block[ib]);
if (tx_type != DCT_DCT) {
vp9_ht_dequant_idct_add_8x8_c(
@@ -501,7 +500,7 @@ static void decode_8x8_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
+ x_idx * 16 + (i & 1) * 8,
xd->dst.y_buffer + (y_idx * 16 + (i / 2) * 8) * xd->dst.y_stride
+ x_idx * 16 + (i & 1) * 8,
- stride, stride, b->eob);
+ stride, stride, xd->eobs[idx]);
} else {
vp9_dequant_idct_add_8x8_c(
q, dq,
@@ -509,7 +508,7 @@ static void decode_8x8_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
+ x_idx * 16 + (i & 1) * 8,
xd->dst.y_buffer + (y_idx * 16 + (i / 2) * 8) * xd->dst.y_stride
+ x_idx * 16 + (i & 1) * 8,
- stride, stride, b->eob);
+ stride, stride, xd->eobs[idx]);
}
}
} else {
@@ -542,7 +541,7 @@ static void decode_4x4_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
+ x_idx * 16 + (i & 3) * 4,
xd->dst.y_buffer + (y_idx * 16 + (i / 4) * 4) * xd->dst.y_stride
+ x_idx * 16 + (i & 3) * 4,
- xd->dst.y_stride, xd->dst.y_stride, b->eob);
+ xd->dst.y_stride, xd->dst.y_stride, xd->eobs[i]);
} else {
xd->itxm_add(
b->qcoeff, b->dequant,
@@ -569,7 +568,7 @@ static void decode_4x4_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
static void decode_superblock64(VP9D_COMP *pbi, MACROBLOCKD *xd,
int mb_row, unsigned int mb_col,
BOOL_DECODER* const bc) {
- int i, n, eobtotal;
+ int n, eobtotal;
TX_SIZE tx_size = xd->mode_info_context->mbmi.txfm_size;
VP9_COMMON *const pc = &pbi->common;
MODE_INFO *orig_mi = xd->mode_info_context;
@@ -647,7 +646,7 @@ static void decode_superblock64(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd->dst.y_buffer + x_idx * 32 +
xd->dst.y_stride * y_idx * 32,
xd->dst.y_stride, xd->dst.y_stride,
- xd->block[0].eob);
+ xd->eobs[0]);
vp9_dequant_idct_add_uv_block_16x16_c(xd->sb_coeff_data.qcoeff + 1024,
xd->block[16].dequant,
xd->dst.u_buffer + x_idx * 16 +
@@ -667,9 +666,6 @@ static void decode_superblock64(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd->above_context = pc->above_context + mb_col + x_idx;
xd->left_context = pc->left_context + y_idx;
xd->mode_info_context = orig_mi + x_idx + y_idx * mis;
- for (i = 0; i < 24; i++) {
- xd->block[i].eob = 0;
- }
eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
if (eobtotal == 0) { // skip loopfilter
@@ -695,7 +691,7 @@ static void decode_superblock64(VP9D_COMP *pbi, MACROBLOCKD *xd,
static void decode_superblock32(VP9D_COMP *pbi, MACROBLOCKD *xd,
int mb_row, unsigned int mb_col,
BOOL_DECODER* const bc) {
- int i, n, eobtotal;
+ int n, eobtotal;
TX_SIZE tx_size = xd->mode_info_context->mbmi.txfm_size;
VP9_COMMON *const pc = &pbi->common;
MODE_INFO *orig_mi = xd->mode_info_context;
@@ -756,7 +752,7 @@ static void decode_superblock32(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_dequant_idct_add_32x32(xd->sb_coeff_data.qcoeff, xd->block[0].dequant,
xd->dst.y_buffer, xd->dst.y_buffer,
xd->dst.y_stride, xd->dst.y_stride,
- xd->block[0].eob);
+ xd->eobs[0]);
vp9_dequant_idct_add_uv_block_16x16_c(xd->sb_coeff_data.qcoeff + 1024,
xd->block[16].dequant,
xd->dst.u_buffer, xd->dst.v_buffer,
@@ -772,9 +768,6 @@ static void decode_superblock32(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd->above_context = pc->above_context + mb_col + x_idx;
xd->left_context = pc->left_context + y_idx + (mb_row & 2);
xd->mode_info_context = orig_mi + x_idx + y_idx * mis;
- for (i = 0; i < 24; i++) {
- xd->block[i].eob = 0;
- }
eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
if (eobtotal == 0) { // skip loopfilter
@@ -802,7 +795,6 @@ static void decode_macroblock(VP9D_COMP *pbi, MACROBLOCKD *xd,
BOOL_DECODER* const bc) {
int eobtotal = 0;
MB_PREDICTION_MODE mode;
- int i;
int tx_size;
assert(!xd->mode_info_context->mbmi.sb_type);
@@ -817,9 +809,6 @@ static void decode_macroblock(VP9D_COMP *pbi, MACROBLOCKD *xd,
if (xd->mode_info_context->mbmi.mb_skip_coeff) {
vp9_reset_mb_tokens_context(xd);
} else if (!bool_error(bc)) {
- for (i = 0; i < 24; i++) {
- xd->block[i].eob = 0;
- }
if (mode != B_PRED) {
eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
}
diff --git a/vp9/decoder/vp9_dequantize.c b/vp9/decoder/vp9_dequantize.c
index 1d6c66afd..9485abf3a 100644
--- a/vp9/decoder/vp9_dequantize.c
+++ b/vp9/decoder/vp9_dequantize.c
@@ -345,7 +345,7 @@ void vp9_dequant_idct_add_uv_block_16x16_c(int16_t *q, const int16_t *dq,
int stride,
MACROBLOCKD *xd) {
vp9_dequant_idct_add_16x16_c(q, dq, dstu, dstu, stride, stride,
- xd->block[16].eob);
+ xd->eobs[16]);
vp9_dequant_idct_add_16x16_c(q + 256, dq, dstv, dstv, stride, stride,
- xd->block[20].eob);
+ xd->eobs[20]);
}
diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c
index 599c5bb57..d3fb25ace 100644
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -279,7 +279,7 @@ int vp9_decode_sb_tokens(VP9D_COMP* const pbi,
DCT_DCT, get_eob(xd, segment_id, 1024),
xd->sb_coeff_data.qcoeff,
vp9_default_zig_zag1d_32x32, TX_32X32);
- xd->block[0].eob = c;
+ xd->eobs[0] = c;
eobtotal += c;
// 16x16 chroma blocks
@@ -288,7 +288,7 @@ int vp9_decode_sb_tokens(VP9D_COMP* const pbi,
c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, DCT_DCT, seg_eob,
xd->sb_coeff_data.qcoeff + 1024 + (i - 16) * 64,
vp9_default_zig_zag1d_16x16, TX_16X16);
- xd->block[i].eob = c;
+ xd->eobs[i] = c;
eobtotal += c;
}
@@ -306,7 +306,7 @@ static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
get_tx_type(xd, &xd->block[0]),
get_eob(xd, segment_id, 256),
xd->qcoeff, vp9_default_zig_zag1d_16x16, TX_16X16);
- xd->block[0].eob = c;
+ xd->eobs[0] = c;
eobtotal += c;
// 8x8 chroma blocks
@@ -315,7 +315,7 @@ static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
DCT_DCT, seg_eob, xd->block[i].qcoeff,
vp9_default_zig_zag1d_8x8, TX_8X8);
- xd->block[i].eob = c;
+ xd->eobs[i] = c;
eobtotal += c;
}
return eobtotal;
@@ -334,7 +334,7 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
get_tx_type(xd, xd->block + i),
seg_eob, xd->block[i].qcoeff,
vp9_default_zig_zag1d_8x8, TX_8X8);
- xd->block[i].eob = c;
+ xd->eobs[i] = c;
eobtotal += c;
}
@@ -347,7 +347,7 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
DCT_DCT, seg_eob, xd->block[i].qcoeff,
vp9_default_zig_zag1d_4x4, TX_4X4);
- xd->block[i].eob = c;
+ xd->eobs[i] = c;
eobtotal += c;
}
} else {
@@ -355,7 +355,7 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
DCT_DCT, seg_eob, xd->block[i].qcoeff,
vp9_default_zig_zag1d_8x8, TX_8X8);
- xd->block[i].eob = c;
+ xd->eobs[i] = c;
eobtotal += c;
}
}
@@ -369,7 +369,7 @@ static int decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
TX_TYPE tx_type, const int *scan) {
int c = decode_coefs(dx, xd, bc, i, type, tx_type, seg_eob,
xd->block[i].qcoeff, scan, TX_4X4);
- xd->block[i].eob = c;
+ xd->eobs[i] = c;
return c;
}
diff --git a/vp9/decoder/vp9_idct_blk.c b/vp9/decoder/vp9_idct_blk.c
index 50d874470..0ec5036e4 100644
--- a/vp9/decoder/vp9_idct_blk.c
+++ b/vp9/decoder/vp9_idct_blk.c
@@ -21,7 +21,7 @@ void vp9_dequant_idct_add_y_block_4x4_inplace_c(int16_t *q,
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
- if (xd->block[i * 4 + j].eob > 1) {
+ if (xd->eobs[i * 4 + j] > 1) {
xd->itxm_add(q, dq, dst, dst, stride, stride);
} else {
xd->dc_only_itxm_add(q[0]*dq[0], dst, dst, stride, stride);
@@ -44,7 +44,7 @@ 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++) {
- if (xd->block[i * 4 + j].eob > 1)
+ if (xd->eobs[i * 4 + j] > 1)
vp9_dequant_idct_add_c(q, dq, pre, dst, 16, stride);
else {
vp9_dc_only_idct_add(q[0]*dq[0], pre, dst, 16, stride);
@@ -69,7 +69,7 @@ void vp9_dequant_idct_add_uv_block_c(int16_t *q, const int16_t *dq,
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
- if (xd->block[16 + i * 2 + j].eob > 1)
+ if (xd->eobs[16 + i * 2 + j] > 1)
vp9_dequant_idct_add_c(q, dq, pre, dstu, 8, stride);
else {
vp9_dc_only_idct_add(q[0]*dq[0], pre, dstu, 8, stride);
@@ -87,7 +87,7 @@ void vp9_dequant_idct_add_uv_block_c(int16_t *q, const int16_t *dq,
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
- if (xd->block[20 + i * 2 + j].eob > 1)
+ if (xd->eobs[20 + i * 2 + j] > 1)
vp9_dequant_idct_add_c(q, dq, pre, dstv, 8, stride);
else {
vp9_dc_only_idct_add(q[0]*dq[0], pre, dstv, 8, stride);
@@ -113,7 +113,7 @@ void vp9_dequant_idct_add_uv_block_4x4_inplace_c(int16_t *q, const int16_t *dq,
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
- if (xd->block[16 + i * 2 + j].eob > 1) {
+ if (xd->eobs[16 + i * 2 + j] > 1) {
xd->itxm_add(q, dq, dstu, dstu, stride, stride);
} else {
xd->dc_only_itxm_add(q[0]*dq[0], dstu, dstu, stride, stride);
@@ -129,7 +129,7 @@ void vp9_dequant_idct_add_uv_block_4x4_inplace_c(int16_t *q, const int16_t *dq,
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
- if (xd->block[20 + i * 2 + j].eob > 1) {
+ if (xd->eobs[20 + i * 2 + j] > 1) {
xd->itxm_add(q, dq, dstv, dstv, stride, stride);
} else {
xd->dc_only_itxm_add(q[0]*dq[0], dstv, dstv, stride, stride);
@@ -149,18 +149,18 @@ void vp9_dequant_idct_add_y_block_8x8_inplace_c(int16_t *q,
uint8_t *dst,
int stride,
MACROBLOCKD *xd) {
- vp9_dequant_idct_add_8x8_c(q, dq, dst, dst, stride, stride, xd->block[0].eob);
+ vp9_dequant_idct_add_8x8_c(q, dq, dst, dst, stride, stride, xd->eobs[0]);
vp9_dequant_idct_add_8x8_c(&q[64], dq, dst + 8,
- dst + 8, stride, stride, xd->block[4].eob);
+ dst + 8, stride, stride, xd->eobs[4]);
vp9_dequant_idct_add_8x8_c(&q[128], dq, dst + 8 * stride,
dst + 8 * stride, stride, stride,
- xd->block[8].eob);
+ xd->eobs[8]);
vp9_dequant_idct_add_8x8_c(&q[192], dq, dst + 8 * stride + 8,
dst + 8 * stride + 8, stride, stride,
- xd->block[12].eob);
+ xd->eobs[12]);
}
void vp9_dequant_idct_add_y_block_8x8_c(int16_t *q, const int16_t *dq,
@@ -170,15 +170,15 @@ void vp9_dequant_idct_add_y_block_8x8_c(int16_t *q, const int16_t *dq,
uint8_t *origdest = dst;
uint8_t *origpred = pre;
- vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, xd->block[0].eob);
+ vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, xd->eobs[0]);
vp9_dequant_idct_add_8x8_c(&q[64], dq, origpred + 8,
- origdest + 8, 16, stride, xd->block[4].eob);
+ origdest + 8, 16, stride, xd->eobs[4]);
vp9_dequant_idct_add_8x8_c(&q[128], dq, origpred + 8 * 16,
origdest + 8 * stride, 16, stride,
- xd->block[8].eob);
+ xd->eobs[8]);
vp9_dequant_idct_add_8x8_c(&q[192], dq, origpred + 8 * 16 + 8,
origdest + 8 * stride + 8, 16, stride,
- xd->block[12].eob);
+ xd->eobs[12]);
}
void vp9_dequant_idct_add_uv_block_8x8_c(int16_t *q, const int16_t *dq,
@@ -186,12 +186,12 @@ void vp9_dequant_idct_add_uv_block_8x8_c(int16_t *q, const int16_t *dq,
uint8_t *dstu,
uint8_t *dstv,
int stride, MACROBLOCKD *xd) {
- vp9_dequant_idct_add_8x8_c(q, dq, pre, dstu, 8, stride, xd->block[16].eob);
+ vp9_dequant_idct_add_8x8_c(q, dq, pre, dstu, 8, stride, xd->eobs[16]);
q += 64;
pre += 64;
- vp9_dequant_idct_add_8x8_c(q, dq, pre, dstv, 8, stride, xd->block[20].eob);
+ vp9_dequant_idct_add_8x8_c(q, dq, pre, dstv, 8, stride, xd->eobs[20]);
}
void vp9_dequant_idct_add_uv_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
@@ -200,11 +200,11 @@ void vp9_dequant_idct_add_uv_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
int stride,
MACROBLOCKD *xd) {
vp9_dequant_idct_add_8x8_c(q, dq, dstu, dstu, stride, stride,
- xd->block[16].eob);
+ xd->eobs[16]);
q += 64;
vp9_dequant_idct_add_8x8_c(q, dq, dstv, dstv, stride, stride,
- xd->block[20].eob);
+ xd->eobs[20]);
}
@@ -216,7 +216,7 @@ void vp9_dequant_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
- if (xd->block[i * 4 + j].eob > 1)
+ if (xd->eobs[i * 4 + j] > 1)
vp9_dequant_idct_add_lossless_c(q, dq, pre, dst, 16, stride);
else {
vp9_dc_only_inv_walsh_add_c(q[0]*dq[0], pre, dst, 16, stride);
@@ -243,7 +243,7 @@ void vp9_dequant_idct_add_uv_block_lossless_c(int16_t *q, const int16_t *dq,
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
- if (xd->block[16 + i * 2 + j].eob > 1)
+ if (xd->eobs[16 + i * 2 + j] > 1)
vp9_dequant_idct_add_lossless_c(q, dq, pre, dstu, 8, stride);
else {
vp9_dc_only_inv_walsh_add_c(q[0]*dq[0], pre, dstu, 8, stride);
@@ -261,7 +261,7 @@ void vp9_dequant_idct_add_uv_block_lossless_c(int16_t *q, const int16_t *dq,
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
- if (xd->block[20 + i * 2 + j].eob > 1)
+ if (xd->eobs[20 + i * 2 + j] > 1)
vp9_dequant_idct_add_lossless_c(q, dq, pre, dstv, 8, stride);
else {
vp9_dc_only_inv_walsh_add_c(q[0]*dq[0], pre, dstv, 8, stride);