Merge "Remove "eobs" array in MACROBLOCKD." into experimental

This commit is contained in:
Ronald S. Bultje 2013-02-21 11:30:29 -08:00 committed by Gerrit Code Review
commit 8c16dee4f2
7 changed files with 110 additions and 126 deletions

View File

@ -293,7 +293,6 @@ typedef struct macroblockd {
DECLARE_ALIGNED(16, uint8_t, predictor[384]);
DECLARE_ALIGNED(16, int16_t, qcoeff[384]);
DECLARE_ALIGNED(16, int16_t, dqcoeff[384]);
DECLARE_ALIGNED(16, uint16_t, eobs[24]);
SUPERBLOCKD sb_coeff_data;
@ -374,10 +373,10 @@ typedef struct macroblockd {
void (*dc_only_itxm_add)(int input_dc, uint8_t *pred_ptr,
uint8_t *dst_ptr, int pitch, int stride);
void (*itxm_add_y_block)(int16_t *q, const int16_t *dq,
uint8_t *pre, uint8_t *dst, int stride, uint16_t *eobs);
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,
uint16_t *eobs);
struct macroblockd *xd);
struct subpix_fn_table subpix;

View File

@ -29,10 +29,10 @@ forward_decls vp9_common_forward_decls
prototype void vp9_dequantize_b "struct blockd *x"
specialize vp9_dequantize_b
prototype void vp9_dequant_idct_add_y_block_8x8 "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dst, int stride, uint16_t *eobs, struct macroblockd *xd"
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, uint16_t *eobs, struct macroblockd *xd"
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"
@ -44,16 +44,16 @@ specialize vp9_dequant_idct_add_8x8
prototype void vp9_dequant_idct_add "int16_t *input, const int16_t *dq, uint8_t *pred, uint8_t *dest, int pitch, int stride"
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, uint16_t *eobs"
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, uint16_t *eobs"
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"
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, uint16_t *eobs"
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
#
@ -299,7 +299,7 @@ prototype void vp9_short_iht16x16 "int16_t *input, int16_t *output, int pitch, i
specialize vp9_short_iht16x16
#endif
prototype void vp9_ihtllm "const int16_t *input, int16_t *output, int pitch, int tx_type, int tx_dim, int16_t eobs"
prototype void vp9_ihtllm "const int16_t *input, int16_t *output, int pitch, int tx_type, int tx_dim, int eob"
specialize vp9_ihtllm

View File

@ -228,16 +228,16 @@ 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->eobs[0]);
xd->block[0].eob);
} else {
vp9_dequant_idct_add_16x16(xd->qcoeff, xd->block[0].dequant,
xd->predictor, xd->dst.y_buffer,
16, xd->dst.y_stride, xd->eobs[0]);
16, xd->dst.y_stride, xd->block[0].eob);
}
vp9_dequant_idct_add_uv_block_8x8(
xd->qcoeff + 16 * 16, xd->block[16].dequant,
xd->predictor + 16 * 16, xd->dst.u_buffer, xd->dst.v_buffer,
xd->dst.uv_stride, xd->eobs + 16, xd);
xd->dst.uv_stride, xd);
}
static void decode_8x8(VP9D_COMP *pbi, MACROBLOCKD *xd,
@ -274,10 +274,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->eobs[idx]);
xd->block[idx].eob);
} else {
vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride,
xd->eobs[idx]);
xd->block[idx].eob);
}
}
} else {
@ -286,7 +286,7 @@ static void decode_8x8(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd->predictor,
xd->dst.y_buffer,
xd->dst.y_stride,
xd->eobs, xd);
xd);
}
// Now do UV
@ -308,12 +308,12 @@ static void decode_8x8(VP9D_COMP *pbi, MACROBLOCKD *xd,
} else if (xd->mode_info_context->mbmi.mode == SPLITMV) {
xd->itxm_add_uv_block(xd->qcoeff + 16 * 16, xd->block[16].dequant,
xd->predictor + 16 * 16, xd->dst.u_buffer, xd->dst.v_buffer,
xd->dst.uv_stride, xd->eobs + 16);
xd->dst.uv_stride, xd);
} else {
vp9_dequant_idct_add_uv_block_8x8
(xd->qcoeff + 16 * 16, xd->block[16].dequant,
xd->predictor + 16 * 16, xd->dst.u_buffer, xd->dst.v_buffer,
xd->dst.uv_stride, xd->eobs + 16, xd);
xd->dst.uv_stride, xd);
}
#ifdef DEC_DEBUG
if (dec_debug) {
@ -399,21 +399,21 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd->dst.u_buffer,
xd->dst.v_buffer,
xd->dst.uv_stride,
xd->eobs + 16);
xd);
} else if (mode == SPLITMV || get_tx_type_4x4(xd, &xd->block[0]) == DCT_DCT) {
xd->itxm_add_y_block(xd->qcoeff,
xd->block[0].dequant,
xd->predictor,
xd->dst.y_buffer,
xd->dst.y_stride,
xd->eobs);
xd);
xd->itxm_add_uv_block(xd->qcoeff + 16 * 16,
xd->block[16].dequant,
xd->predictor + 16 * 16,
xd->dst.u_buffer,
xd->dst.v_buffer,
xd->dst.uv_stride,
xd->eobs + 16);
xd);
} else {
#ifdef DEC_DEBUG
if (dec_debug) {
@ -451,7 +451,7 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd->dst.u_buffer,
xd->dst.v_buffer,
xd->dst.uv_stride,
xd->eobs + 16);
xd);
}
}
@ -471,14 +471,14 @@ static void decode_16x16_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
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->eobs[0]);
xd->dst.y_stride, xd->dst.y_stride, xd->block[0].eob);
}
vp9_dequant_idct_add_uv_block_8x8_inplace_c(
xd->qcoeff + 16 * 16,
xd->block[16].dequant,
xd->dst.u_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
xd->dst.v_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
xd->dst.uv_stride, xd->eobs + 16, xd);
xd->dst.uv_stride, xd);
};
static void decode_8x8_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
@ -518,13 +518,13 @@ static void decode_8x8_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_dequant_idct_add_y_block_8x8_inplace_c(
xd->qcoeff, xd->block[0].dequant,
xd->dst.y_buffer + y_idx * 16 * xd->dst.y_stride + x_idx * 16,
xd->dst.y_stride, xd->eobs, xd);
xd->dst.y_stride, xd);
}
vp9_dequant_idct_add_uv_block_8x8_inplace_c(
xd->qcoeff + 16 * 16, xd->block[16].dequant,
xd->dst.u_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
xd->dst.v_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
xd->dst.uv_stride, xd->eobs + 16, xd);
xd->dst.uv_stride, xd);
};
static void decode_4x4_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
@ -559,13 +559,13 @@ static void decode_4x4_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_dequant_idct_add_y_block_4x4_inplace_c(
xd->qcoeff, xd->block[0].dequant,
xd->dst.y_buffer + y_idx * 16 * xd->dst.y_stride + x_idx * 16,
xd->dst.y_stride, xd->eobs, xd);
xd->dst.y_stride, xd);
}
vp9_dequant_idct_add_uv_block_4x4_inplace_c(
xd->qcoeff + 16 * 16, xd->block[16].dequant,
xd->dst.u_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
xd->dst.v_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
xd->dst.uv_stride, xd->eobs + 16, xd);
xd->dst.uv_stride, xd);
};
static void decode_superblock64(VP9D_COMP *pbi, MACROBLOCKD *xd,
@ -648,14 +648,14 @@ 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->eobs[0]);
xd->block[0].eob);
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 +
xd->dst.uv_stride * y_idx * 16,
xd->dst.v_buffer + x_idx * 16 +
xd->dst.uv_stride * y_idx * 16,
xd->dst.uv_stride, xd->eobs + 16);
xd->dst.uv_stride, xd);
}
}
} else {
@ -670,7 +670,6 @@ static void decode_superblock64(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd->mode_info_context = orig_mi + x_idx + y_idx * mis;
for (i = 0; i < 24; i++) {
xd->block[i].eob = 0;
xd->eobs[i] = 0;
}
eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
@ -757,11 +756,11 @@ 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->eobs[0]);
xd->block[0].eob);
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,
xd->dst.uv_stride, xd->eobs + 16);
xd->dst.uv_stride, xd);
}
} else {
for (n = 0; n < 4; n++) {
@ -775,7 +774,6 @@ static void decode_superblock32(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd->mode_info_context = orig_mi + x_idx + y_idx * mis;
for (i = 0; i < 24; i++) {
xd->block[i].eob = 0;
xd->eobs[i] = 0;
}
eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
@ -821,7 +819,6 @@ static void decode_macroblock(VP9D_COMP *pbi, MACROBLOCKD *xd,
} else if (!bool_error(bc)) {
for (i = 0; i < 24; i++) {
xd->block[i].eob = 0;
xd->eobs[i] = 0;
}
if (mode != B_PRED) {
eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);

View File

@ -60,7 +60,7 @@ void vp9_dequantize_b_c(BLOCKD *d) {
void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input,
const int16_t *dq,
uint8_t *pred, uint8_t *dest,
int pitch, int stride, uint16_t eobs) {
int pitch, int stride, int eob) {
int16_t output[16];
int16_t *diff_ptr = output;
int i;
@ -72,7 +72,7 @@ void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input,
#if CONFIG_INTHT4X4
vp9_short_iht4x4(input, output, 8, tx_type);
#else
vp9_ihtllm(input, output, 4 << 1, tx_type, 4, eobs);
vp9_ihtllm(input, output, 4 << 1, tx_type, 4, eob);
#endif
vpx_memset(input, 0, 32);
@ -83,14 +83,14 @@ void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input,
void vp9_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, int16_t *input,
const int16_t *dq,
uint8_t *pred, uint8_t *dest,
int pitch, int stride, uint16_t eobs) {
int pitch, int stride, int eob) {
int16_t output[64];
int16_t *diff_ptr = output;
int i;
if (eobs == 0) {
if (eob == 0) {
/* All 0 DCT coefficient */
vp9_copy_mem8x8(pred, pitch, dest, stride);
} else if (eobs > 0) {
} else if (eob > 0) {
input[0] = dq[0] * input[0];
for (i = 1; i < 64; i++) {
input[i] = dq[1] * input[i];
@ -99,7 +99,7 @@ void vp9_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, int16_t *input,
#if CONFIG_INTHT
vp9_short_iht8x8(input, output, 16, tx_type);
#else
vp9_ihtllm(input, output, 16, tx_type, 8, eobs);
vp9_ihtllm(input, output, 16, tx_type, 8, eob);
#endif
vpx_memset(input, 0, 128);
@ -250,14 +250,14 @@ void vp9_dequant_idct_add_8x8_c(int16_t *input, const int16_t *dq,
void vp9_ht_dequant_idct_add_16x16_c(TX_TYPE tx_type, int16_t *input,
const int16_t *dq, uint8_t *pred,
uint8_t *dest, int pitch, int stride,
uint16_t eobs) {
int eob) {
int16_t output[256];
int16_t *diff_ptr = output;
int i;
if (eobs == 0) {
if (eob == 0) {
/* All 0 DCT coefficient */
vp9_copy_mem16x16(pred, pitch, dest, stride);
} else if (eobs > 0) {
} else if (eob > 0) {
input[0]= input[0] * dq[0];
// recover quantizer for 4 4x4 blocks
@ -268,7 +268,7 @@ void vp9_ht_dequant_idct_add_16x16_c(TX_TYPE tx_type, int16_t *input,
#if CONFIG_INTHT16X16
vp9_short_iht16x16(input, output, 32, tx_type);
#else
vp9_ihtllm(input, output, 32, tx_type, 16, eobs);
vp9_ihtllm(input, output, 32, tx_type, 16, eob);
#endif
// the idct halves ( >> 1) the pitch
@ -365,8 +365,9 @@ void vp9_dequant_idct_add_uv_block_16x16_c(int16_t *q, const int16_t *dq,
uint8_t *dstu,
uint8_t *dstv,
int stride,
uint16_t *eobs) {
vp9_dequant_idct_add_16x16_c(q, dq, dstu, dstu, stride, stride, eobs[0]);
vp9_dequant_idct_add_16x16_c(q + 256, dq,
dstv, dstv, stride, stride, eobs[4]);
MACROBLOCKD *xd) {
vp9_dequant_idct_add_16x16_c(q, dq, dstu, dstu, stride, stride,
xd->block[16].eob);
vp9_dequant_idct_add_16x16_c(q + 256, dq, dstv, dstv, stride, stride,
xd->block[20].eob);
}

View File

@ -27,72 +27,65 @@ extern void vp9_dequant_dc_idct_add_y_block_lossless_c(int16_t *q,
unsigned char *pre,
unsigned char *dst,
int stride,
uint16_t *eobs,
const int16_t *dc);
extern void vp9_dequant_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
unsigned char *pre,
unsigned char *dst,
int stride,
uint16_t *eobs);
struct macroblockd *xd);
extern 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,
int stride,
uint16_t *eobs);
struct macroblockd *xd);
void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input, const int16_t *dq,
unsigned char *pred, unsigned char *dest,
int pitch, int stride, uint16_t eobs);
int pitch, int stride, int eob);
void vp9_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, int16_t *input,
const int16_t *dq, unsigned char *pred,
unsigned char *dest, int pitch, int stride,
uint16_t eobs);
int eob);
void vp9_ht_dequant_idct_add_16x16_c(TX_TYPE tx_type, int16_t *input,
const int16_t *dq, unsigned char *pred,
unsigned char *dest,
int pitch, int stride, uint16_t eobs);
int pitch, int stride, int eob);
void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
unsigned char *dst,
int stride,
uint16_t *eobs,
const int16_t *dc,
MACROBLOCKD *xd);
void vp9_dequant_idct_add_y_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
unsigned char *dst,
int stride,
uint16_t *eobs,
MACROBLOCKD *xd);
void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(int16_t *q, const int16_t *dq,
unsigned char *dst,
int stride,
uint16_t *eobs,
const int16_t *dc,
MACROBLOCKD *xd);
void vp9_dequant_idct_add_y_block_4x4_inplace_c(int16_t *q, const int16_t *dq,
unsigned char *dst,
int stride,
uint16_t *eobs,
MACROBLOCKD *xd);
void vp9_dequant_idct_add_uv_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
unsigned char *dstu,
unsigned char *dstv,
int stride,
uint16_t *eobs,
MACROBLOCKD *xd);
void vp9_dequant_idct_add_uv_block_4x4_inplace_c(int16_t *q, const int16_t *dq,
unsigned char *dstu,
unsigned char *dstv,
int stride,
uint16_t *eobs,
MACROBLOCKD *xd);
#endif

View File

@ -295,25 +295,24 @@ static int get_eob(MACROBLOCKD* const xd, int segment_id, int eob_max) {
int vp9_decode_sb_tokens(VP9D_COMP* const pbi,
MACROBLOCKD* const xd,
BOOL_DECODER* const bc) {
uint16_t *const eobs = xd->eobs;
const int segment_id = xd->mode_info_context->mbmi.segment_id;
int c, i, eobtotal = 0, seg_eob;
// Luma block
eobs[0] = c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
DCT_DCT, get_eob(xd, segment_id, 1024),
xd->sb_coeff_data.qcoeff,
vp9_default_zig_zag1d_32x32,
TX_32X32);
c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
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;
eobtotal += c;
// 16x16 chroma blocks
seg_eob = get_eob(xd, segment_id, 256);
for (i = 16; i < 24; i += 4) {
eobs[i] = 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);
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;
eobtotal += c;
}
@ -323,25 +322,24 @@ int vp9_decode_sb_tokens(VP9D_COMP* const pbi,
static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
MACROBLOCKD* const xd,
BOOL_DECODER* const bc) {
uint16_t *const eobs = xd->eobs;
const int segment_id = xd->mode_info_context->mbmi.segment_id;
int c, i, eobtotal = 0, seg_eob;
// Luma block
eobs[0] = c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
get_tx_type(xd, &xd->block[0]),
get_eob(xd, segment_id, 256),
xd->qcoeff, vp9_default_zig_zag1d_16x16,
TX_16X16);
c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
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;
eobtotal += c;
// 8x8 chroma blocks
seg_eob = get_eob(xd, segment_id, 64);
for (i = 16; i < 24; i += 4) {
eobs[i] = 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);
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;
eobtotal += c;
}
return eobtotal;
@ -350,17 +348,17 @@ static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
MACROBLOCKD* const xd,
BOOL_DECODER* const bc) {
uint16_t *const eobs = xd->eobs;
int c, i, eobtotal = 0, seg_eob;
const int segment_id = xd->mode_info_context->mbmi.segment_id;
// luma blocks
seg_eob = get_eob(xd, segment_id, 64);
for (i = 0; i < 16; i += 4) {
eobs[i] = c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_Y_WITH_DC,
get_tx_type(xd, xd->block + i),
seg_eob, xd->block[i].qcoeff,
vp9_default_zig_zag1d_8x8, TX_8X8);
c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_Y_WITH_DC,
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;
eobtotal += c;
}
@ -370,16 +368,18 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
// 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++) {
eobs[i] = 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);
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;
eobtotal += c;
}
} else {
for (i = 16; i < 24; i += 4) {
eobs[i] = 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);
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;
eobtotal += c;
}
}
@ -391,12 +391,11 @@ static int decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
BOOL_DECODER* const bc,
PLANE_TYPE type, int i, int seg_eob,
TX_TYPE tx_type, const int *scan) {
uint16_t *const eobs = xd->eobs;
int c;
c = decode_coefs(dx, xd, bc, i, type, tx_type, seg_eob,
xd->block[i].qcoeff, scan, TX_4X4);
eobs[i] = c;
xd->block[i].eob = c;
return c;
}

View File

@ -16,13 +16,12 @@ void vp9_dequant_idct_add_y_block_4x4_inplace_c(int16_t *q,
const int16_t *dq,
uint8_t *dst,
int stride,
uint16_t *eobs,
MACROBLOCKD *xd) {
int i, j;
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
if (*eobs++ > 1) {
if (xd->block[i * 4 + j].eob > 1) {
xd->itxm_add(q, dq, dst, dst, stride, stride);
} else {
xd->dc_only_itxm_add(q[0]*dq[0], dst, dst, stride, stride);
@ -40,12 +39,12 @@ void vp9_dequant_idct_add_y_block_4x4_inplace_c(int16_t *q,
void vp9_dequant_idct_add_y_block_c(int16_t *q, const int16_t *dq,
uint8_t *pre,
uint8_t *dst,
int stride, uint16_t *eobs) {
int stride, MACROBLOCKD *xd) {
int i, j;
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
if (*eobs++ > 1)
if (xd->block[i * 4 + j].eob > 1)
vp9_dequant_idct_add_c(q, dq, pre, dst, 16, stride);
else {
vp9_dc_only_idct_add_c(q[0]*dq[0], pre, dst, 16, stride);
@ -65,12 +64,12 @@ void vp9_dequant_idct_add_y_block_c(int16_t *q, const int16_t *dq,
void vp9_dequant_idct_add_uv_block_c(int16_t *q, const int16_t *dq,
uint8_t *pre, uint8_t *dstu,
uint8_t *dstv, int stride,
uint16_t *eobs) {
MACROBLOCKD *xd) {
int i, j;
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
if (*eobs++ > 1)
if (xd->block[16 + i * 2 + j].eob > 1)
vp9_dequant_idct_add_c(q, dq, pre, dstu, 8, stride);
else {
vp9_dc_only_idct_add_c(q[0]*dq[0], pre, dstu, 8, stride);
@ -88,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 (*eobs++ > 1)
if (xd->block[20 + i * 2 + j].eob > 1)
vp9_dequant_idct_add_c(q, dq, pre, dstv, 8, stride);
else {
vp9_dc_only_idct_add_c(q[0]*dq[0], pre, dstv, 8, stride);
@ -109,13 +108,12 @@ void vp9_dequant_idct_add_uv_block_4x4_inplace_c(int16_t *q, const int16_t *dq,
uint8_t *dstu,
uint8_t *dstv,
int stride,
uint16_t *eobs,
MACROBLOCKD *xd) {
int i, j;
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
if (*eobs++ > 1) {
if (xd->block[16 + i * 2 + j].eob > 1) {
xd->itxm_add(q, dq, dstu, dstu, stride, stride);
} else {
xd->dc_only_itxm_add(q[0]*dq[0], dstu, dstu, stride, stride);
@ -131,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 (*eobs++ > 1) {
if (xd->block[20 + i * 2 + j].eob > 1) {
xd->itxm_add(q, dq, dstv, dstv, stride, stride);
} else {
xd->dc_only_itxm_add(q[0]*dq[0], dstv, dstv, stride, stride);
@ -150,78 +148,75 @@ void vp9_dequant_idct_add_y_block_8x8_inplace_c(int16_t *q,
const int16_t *dq,
uint8_t *dst,
int stride,
uint16_t *eobs,
MACROBLOCKD *xd) {
vp9_dequant_idct_add_8x8_c(q, dq, dst, dst, stride, stride, xd->eobs[0]);
vp9_dequant_idct_add_8x8_c(q, dq, dst, dst, stride, stride, xd->block[0].eob);
vp9_dequant_idct_add_8x8_c(&q[64], dq, dst + 8,
dst + 8, stride, stride, xd->eobs[4]);
dst + 8, stride, stride, xd->block[4].eob);
vp9_dequant_idct_add_8x8_c(&q[128], dq, dst + 8 * stride,
dst + 8 * stride, stride, stride,
xd->eobs[8]);
xd->block[8].eob);
vp9_dequant_idct_add_8x8_c(&q[192], dq, dst + 8 * stride + 8,
dst + 8 * stride + 8, stride, stride,
xd->eobs[12]);
xd->block[12].eob);
}
void vp9_dequant_idct_add_y_block_8x8_c(int16_t *q, const int16_t *dq,
uint8_t *pre,
uint8_t *dst,
int stride, uint16_t *eobs,
MACROBLOCKD *xd) {
int stride, MACROBLOCKD *xd) {
uint8_t *origdest = dst;
uint8_t *origpred = pre;
vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, xd->eobs[0]);
vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, xd->block[0].eob);
vp9_dequant_idct_add_8x8_c(&q[64], dq, origpred + 8,
origdest + 8, 16, stride, xd->eobs[4]);
origdest + 8, 16, stride, xd->block[4].eob);
vp9_dequant_idct_add_8x8_c(&q[128], dq, origpred + 8 * 16,
origdest + 8 * stride, 16, stride, xd->eobs[8]);
origdest + 8 * stride, 16, stride,
xd->block[8].eob);
vp9_dequant_idct_add_8x8_c(&q[192], dq, origpred + 8 * 16 + 8,
origdest + 8 * stride + 8, 16, stride,
xd->eobs[12]);
xd->block[12].eob);
}
void vp9_dequant_idct_add_uv_block_8x8_c(int16_t *q, const int16_t *dq,
uint8_t *pre,
uint8_t *dstu,
uint8_t *dstv,
int stride, uint16_t *eobs,
MACROBLOCKD *xd) {
vp9_dequant_idct_add_8x8_c(q, dq, pre, dstu, 8, stride, xd->eobs[16]);
int stride, MACROBLOCKD *xd) {
vp9_dequant_idct_add_8x8_c(q, dq, pre, dstu, 8, stride, xd->block[16].eob);
q += 64;
pre += 64;
vp9_dequant_idct_add_8x8_c(q, dq, pre, dstv, 8, stride, xd->eobs[20]);
vp9_dequant_idct_add_8x8_c(q, dq, pre, dstv, 8, stride, xd->block[20].eob);
}
void vp9_dequant_idct_add_uv_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
uint8_t *dstu,
uint8_t *dstv,
int stride,
uint16_t *eobs,
MACROBLOCKD *xd) {
vp9_dequant_idct_add_8x8_c(q, dq, dstu, dstu, stride, stride,
xd->eobs[16]);
xd->block[16].eob);
q += 64;
vp9_dequant_idct_add_8x8_c(q, dq, dstv, dstv, stride, stride,
xd->eobs[20]);
xd->block[20].eob);
}
void vp9_dequant_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
uint8_t *pre,
uint8_t *dst,
int stride, uint16_t *eobs) {
int stride, MACROBLOCKD *xd) {
int i, j;
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
if (*eobs++ > 1)
if (xd->block[i * 4 + j].eob > 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,12 +238,12 @@ void vp9_dequant_idct_add_uv_block_lossless_c(int16_t *q, const int16_t *dq,
uint8_t *dstu,
uint8_t *dstv,
int stride,
uint16_t *eobs) {
MACROBLOCKD *xd) {
int i, j;
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
if (*eobs++ > 1)
if (xd->block[16 + i * 2 + j].eob > 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);
@ -266,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 (*eobs++ > 1)
if (xd->block[20 + i * 2 + j].eob > 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);