summaryrefslogtreecommitdiff
path: root/vp9/decoder/vp9_decodframe.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/decoder/vp9_decodframe.c')
-rw-r--r--vp9/decoder/vp9_decodframe.c61
1 files changed, 35 insertions, 26 deletions
diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c
index b17ba290e..f6f87efae 100644
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -353,7 +353,7 @@ static void decode_8x8(VP9D_COMP *pbi, MACROBLOCKD *xd,
static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
BOOL_DECODER* const bc) {
TX_TYPE tx_type;
- int i;
+ int i = 0;
MB_PREDICTION_MODE mode = xd->mode_info_context->mbmi.mode;
#if 0 // def DEC_DEBUG
if (dec_debug) {
@@ -404,6 +404,8 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
#if CONFIG_NEWBINTRAMODES
xd->mode_info_context->bmi[i].as_mode.context = b->bmi.as_mode.context =
vp9_find_bpred_context(xd, b);
+ if (!xd->mode_info_context->mbmi.mb_skip_coeff)
+ vp9_decode_coefs_4x4(pbi, xd, bc, PLANE_TYPE_Y_WITH_DC, i);
#endif
vp9_intra4x4_predict(xd, b, b_mode, b->predictor);
tx_type = get_tx_type_4x4(xd, i);
@@ -417,6 +419,10 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
*(b->base_dst) + b->dst, 16, b->dst_stride, xd->eobs[i]);
}
}
+#if CONFIG_NEWBINTRAMODES
+ if (!xd->mode_info_context->mbmi.mb_skip_coeff)
+ vp9_decode_mb_tokens_4x4_uv(pbi, xd, bc);
+#endif
vp9_build_intra_predictors_mbuv(xd);
xd->itxm_add_uv_block(xd->qcoeff + 16 * 16,
xd->block[16].dequant,
@@ -480,7 +486,7 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
}
}
-static INLINE void decode_sb_16x16(MACROBLOCKD *mb, int y_size) {
+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;
@@ -495,8 +501,8 @@ static INLINE void decode_sb_16x16(MACROBLOCKD *mb, int y_size) {
const int x_idx = n % y_size;
const int y_idx = n / y_size;
const int y_offset = (y_idx * 16) * mb->dst.y_stride + (x_idx * 16);
- const TX_TYPE tx_type = get_tx_type_16x16(mb, (y_idx * (4 * y_size) +
- x_idx) * 4);
+ const TX_TYPE tx_type = get_tx_type_16x16(mb,
+ (y_idx * (4 * y_size) + x_idx) * 4);
if (tx_type == DCT_DCT) {
vp9_dequant_idct_add_16x16(mb->qcoeff + n * 16 * 16,
mb->block[0].dequant ,
@@ -534,13 +540,13 @@ static INLINE void decode_sb_16x16(MACROBLOCKD *mb, int y_size) {
}
}
-static INLINE void decode_sb_8x8(MACROBLOCKD *mb, int y_size) {
+static void decode_sb_8x8(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_qcoeff_offset = 64 * y_count;
- const int v_qcoeff_offset = u_qcoeff_offset + 64 * uv_count;
+ const int u_qcoeff_offset = (8 * 8) * y_count;
+ const int v_qcoeff_offset = u_qcoeff_offset + (8 * 8) * uv_count;
const int u_eob_offset = 4 * y_count;
const int v_eob_offset = u_eob_offset + 4 * uv_count;
int n;
@@ -560,7 +566,8 @@ static INLINE void decode_sb_8x8(MACROBLOCKD *mb, int y_size) {
mb->dst.y_stride, mb->dst.y_stride,
mb->eobs[n * 4]);
} else {
- vp9_ht_dequant_idct_add_8x8_c(tx_type, mb->qcoeff + n * 8 * 8,
+ vp9_ht_dequant_idct_add_8x8_c(tx_type,
+ mb->qcoeff + n * 8 * 8,
mb->block[0].dequant,
mb->dst.y_buffer + y_offset,
mb->dst.y_buffer + y_offset,
@@ -595,18 +602,17 @@ static void decode_sb_4x4(MACROBLOCKD *mb, int y_size) {
const int uv_size = y_size / 2;
const int uv_count = uv_size * uv_size;
- const int u_qcoeff_offset = y_count * 4 * 4;
- const int v_qcoeff_offset = u_qcoeff_offset + uv_count * 4 * 4;
+ const int u_qcoeff_offset = (4 * 4) * y_count;
+ const int v_qcoeff_offset = u_qcoeff_offset + (4 * 4) * uv_count;
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++) {
const int x_idx = n % y_size;
const int y_idx = n / y_size;
const int y_offset = (y_idx * 4) * mb->dst.y_stride + (x_idx * 4);
- const TX_TYPE tx_type = get_tx_type_4x4(mb, y_idx * (2 * y_size) + x_idx);
+ const TX_TYPE tx_type = get_tx_type_4x4(mb, y_idx * y_size + x_idx);
if (tx_type == DCT_DCT) {
mb->itxm_add(mb->qcoeff + n * 4 * 4,
mb->block[0].dequant,
@@ -615,12 +621,12 @@ static void decode_sb_4x4(MACROBLOCKD *mb, int y_size) {
mb->dst.y_stride, mb->dst.y_stride,
mb->eobs[n]);
} else {
- vp9_ht_dequant_idct_add_c(tx_type, mb->qcoeff + n * 4 * 4,
+ vp9_ht_dequant_idct_add_c(tx_type,
+ mb->qcoeff + n * 4 * 4,
mb->block[0].dequant,
mb->dst.y_buffer + y_offset,
mb->dst.y_buffer + y_offset,
- mb->dst.y_stride,
- mb->dst.y_stride,
+ mb->dst.y_stride, mb->dst.y_stride,
mb->eobs[n]);
}
}
@@ -630,17 +636,17 @@ static void decode_sb_4x4(MACROBLOCKD *mb, int y_size) {
const int y_idx = n / uv_size;
const int uv_offset = (y_idx * 4) * mb->dst.uv_stride + (x_idx * 4);
mb->itxm_add(mb->qcoeff + u_qcoeff_offset + n * 4 * 4,
- mb->block[16].dequant,
- 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]);
+ mb->block[16].dequant,
+ 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]);
mb->itxm_add(mb->qcoeff + v_qcoeff_offset + n * 4 * 4,
- 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]);
+ 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]);
}
}
@@ -813,7 +819,10 @@ static void decode_mb(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)) {
- eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
+#if CONFIG_NEWBINTRAMODES
+ if (mode != B_PRED)
+#endif
+ eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
}
//mode = xd->mode_info_context->mbmi.mode;