Commit dd9d4f9e authored by Ronald S. Bultje's avatar Ronald S. Bultje

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
parent 73987d14
...@@ -76,7 +76,8 @@ void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(short *q, short *dq, ...@@ -76,7 +76,8 @@ void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(short *q, short *dq,
void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, short *dq, void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, short *dq,
unsigned char *dst, unsigned char *dst,
int stride, char *eobs, int stride,
unsigned short *eobs,
short *dc, MACROBLOCKD *xd); short *dc, MACROBLOCKD *xd);
void vp9_dequant_idct_add_uv_block_8x8_inplace_c(short *q, short *dq, 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_8x8_inplace_c(short *q, short *dq, ...@@ -89,7 +90,8 @@ void vp9_dequant_idct_add_uv_block_8x8_inplace_c(short *q, short *dq,
void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, short *dq, void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, short *dq,
unsigned char *dstu, unsigned char *dstu,
unsigned char *dstv, unsigned char *dstv,
int stride, char *eobs, int stride,
unsigned short *eobs,
MACROBLOCKD *xd); MACROBLOCKD *xd);
#endif #endif
......
...@@ -39,7 +39,8 @@ void vp9_dequant_dc_idct_add_y_block_c(short *q, short *dq, ...@@ -39,7 +39,8 @@ void vp9_dequant_dc_idct_add_y_block_c(short *q, short *dq,
#if CONFIG_SUPERBLOCKS #if CONFIG_SUPERBLOCKS
void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, short *dq, void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, short *dq,
unsigned char *dst, unsigned char *dst,
int stride, char *eobs, int stride,
unsigned short *eobs,
short *dc, MACROBLOCKD *xd) { short *dc, MACROBLOCKD *xd) {
int i, j; int i, j;
...@@ -131,7 +132,8 @@ void vp9_dequant_idct_add_uv_block_c(short *q, short *dq, unsigned char *pre, ...@@ -131,7 +132,8 @@ void vp9_dequant_idct_add_uv_block_c(short *q, short *dq, unsigned char *pre,
void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, short *dq, void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, short *dq,
unsigned char *dstu, unsigned char *dstu,
unsigned char *dstv, unsigned char *dstv,
int stride, char *eobs, int stride,
unsigned short *eobs,
MACROBLOCKD *xd) { MACROBLOCKD *xd) {
int i, j; int i, j;
......
...@@ -2318,6 +2318,13 @@ static void encode_inter_superblock(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2318,6 +2318,13 @@ static void encode_inter_superblock(VP9_COMP *cpi, MACROBLOCK *x,
for (n = 0; n < 4; n++) { for (n = 0; n < 4; n++) {
int x_idx = n & 1, y_idx = n >> 1; 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, vp9_subtract_mby_s_c(x->src_diff,
src + x_idx * 16 + y_idx * 16 * src_y_stride, src + x_idx * 16 + y_idx * 16 * src_y_stride,
src_y_stride, src_y_stride,
...@@ -2339,12 +2346,6 @@ static void encode_inter_superblock(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2339,12 +2346,6 @@ static void encode_inter_superblock(VP9_COMP *cpi, MACROBLOCK *x,
if (!x->skip) { if (!x->skip) {
if (output_enabled) { 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); vp9_tokenize_mb(cpi, &x->e_mbd, t, 0);
skip[n] = xd->mode_info_context->mbmi.mb_skip_coeff; skip[n] = xd->mode_info_context->mbmi.mb_skip_coeff;
} }
...@@ -2354,18 +2355,14 @@ static void encode_inter_superblock(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2354,18 +2355,14 @@ static void encode_inter_superblock(VP9_COMP *cpi, MACROBLOCK *x,
(x->e_mbd.mode_info_context - 1)->mbmi.mb_skip_coeff + (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 : (x->e_mbd.mode_info_context - cpi->common.mode_info_stride)->mbmi.mb_skip_coeff :
0; 0;
xd->mode_info_context->mbmi.mb_skip_coeff = skip[n] = 1;
if (cpi->common.mb_no_coeff_skip) { if (cpi->common.mb_no_coeff_skip) {
skip[n] = xd->mode_info_context->mbmi.mb_skip_coeff = 1; // TODO(rbultje) this should be done per-sb instead of per-mb?
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;
cpi->skip_true_count[mb_skip_context]++; cpi->skip_true_count[mb_skip_context]++;
vp9_fix_contexts(xd); vp9_fix_contexts(xd);
} else { } else {
vp9_stuff_mb(cpi, xd, t, 0); 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]++; cpi->skip_false_count[mb_skip_context]++;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment