ref: dd9d4f9e1ad0bcc5f46fbd81ec00f2127cc18dcc
parent: 73987d140a961c6644261491bec023b5e3b074c1
author: Ronald S. Bultje <rbultje@google.com>
date: Sat Nov 10 07:08:27 EST 2012
Fix data type for eobs[] array in SB 4x4 IDCT code. This fixes encoder/decoder mismatches with the superblock experiment turned on whenever a superblock is encoded using the 4x4 transform. Change-Id: Iefec7055e8d25f8efdbba66c4261bbd322d335a3
--- a/vp9/decoder/dequantize.h
+++ b/vp9/decoder/dequantize.h
@@ -76,7 +76,8 @@
void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, short *dq,
unsigned char *dst,
- int stride, char *eobs,
+ int stride,
+ unsigned short *eobs,
short *dc, MACROBLOCKD *xd);
void vp9_dequant_idct_add_uv_block_8x8_inplace_c(short *q, short *dq,
@@ -89,7 +90,8 @@
void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, short *dq,
unsigned char *dstu,
unsigned char *dstv,
- int stride, char *eobs,
+ int stride,
+ unsigned short *eobs,
MACROBLOCKD *xd);
#endif
--- a/vp9/decoder/idct_blk.c
+++ b/vp9/decoder/idct_blk.c
@@ -39,7 +39,8 @@
#if CONFIG_SUPERBLOCKS
void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, short *dq,
unsigned char *dst,
- int stride, char *eobs,
+ int stride,
+ unsigned short *eobs,
short *dc, MACROBLOCKD *xd) {
int i, j;
@@ -131,7 +132,8 @@
void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, short *dq,
unsigned char *dstu,
unsigned char *dstv,
- int stride, char *eobs,
+ int stride,
+ unsigned short *eobs,
MACROBLOCKD *xd) {
int i, j;
--- a/vp9/encoder/encodeframe.c
+++ b/vp9/encoder/encodeframe.c
@@ -2318,6 +2318,13 @@
for (n = 0; n < 4; n++) {
int x_idx = n & 1, y_idx = n >> 1;
+ xd->left_context = cm->left_context + y_idx;
+ xd->above_context = cm->above_context + mb_col + x_idx;
+ memcpy(&ta[n], xd->above_context, sizeof(ta[n]));
+ memcpy(&tl[n], xd->left_context, sizeof(tl[n]));
+ tp[n] = *t;
+ xd->mode_info_context = mi + x_idx + y_idx * cm->mode_info_stride;
+
vp9_subtract_mby_s_c(x->src_diff,
src + x_idx * 16 + y_idx * 16 * src_y_stride,
src_y_stride,
@@ -2339,12 +2346,6 @@
if (!x->skip) {
if (output_enabled) {
- xd->left_context = cm->left_context + (n >> 1);
- xd->above_context = cm->above_context + mb_col + (n & 1);
- memcpy(&ta[n], xd->above_context, sizeof(ta[n]));
- memcpy(&tl[n], xd->left_context, sizeof(tl[n]));
- tp[n] = *t;
- xd->mode_info_context = mi + x_idx + y_idx * cm->mode_info_stride;
vp9_tokenize_mb(cpi, &x->e_mbd, t, 0);
skip[n] = xd->mode_info_context->mbmi.mb_skip_coeff;
}
@@ -2354,18 +2355,14 @@
(x->e_mbd.mode_info_context - 1)->mbmi.mb_skip_coeff +
(x->e_mbd.mode_info_context - cpi->common.mode_info_stride)->mbmi.mb_skip_coeff :
0;
+ xd->mode_info_context->mbmi.mb_skip_coeff = skip[n] = 1;
if (cpi->common.mb_no_coeff_skip) {
- skip[n] = xd->mode_info_context->mbmi.mb_skip_coeff = 1;
- xd->left_context = cm->left_context + (n >> 1);
- xd->above_context = cm->above_context + mb_col + (n & 1);
- memcpy(&ta[n], xd->above_context, sizeof(ta[n]));
- memcpy(&tl[n], xd->left_context, sizeof(tl[n]));
- tp[n] = *t;
+ // TODO(rbultje) this should be done per-sb instead of per-mb?
cpi->skip_true_count[mb_skip_context]++;
vp9_fix_contexts(xd);
} else {
vp9_stuff_mb(cpi, xd, t, 0);
- xd->mode_info_context->mbmi.mb_skip_coeff = 0;
+ // TODO(rbultje) this should be done per-sb instead of per-mb?
cpi->skip_false_count[mb_skip_context]++;
}
}