int i8x8mode;
BLOCKD *b;
-#if CONFIG_HYBRIDTRANSFORM8X8
int idx = (ib & 0x02) ? (ib + 2) : ib;
short *q = xd->block[idx].qcoeff;
unsigned char *pre = xd->block[ib].predictor;
unsigned char *dst = *(xd->block[ib].base_dst) + xd->block[ib].dst;
int stride = xd->dst.y_stride;
-#endif
b = &xd->block[ib];
i8x8mode = b->bmi.as_mode.first;
q, dq, pre, dst, 16, stride);
q += 64;
#else
- for (j = 0; j < 4; j++) {
- b = &xd->block[ib + iblock[j]];
- if (xd->eobs[ib + iblock[j]] > 1) {
- DEQUANT_INVOKE(&pbi->dequant, idct_add)
- (b->qcoeff, b->dequant, b->predictor,
- *(b->base_dst) + b->dst, 16, b->dst_stride);
- } else {
- IDCT_INVOKE(RTCD_VTABLE(idct), idct1_scalar_add)
- (b->qcoeff[0] * b->dequant[0], b->predictor,
- *(b->base_dst) + b->dst, 16, b->dst_stride);
- ((int *)b->qcoeff)[0] = 0;
- }
- }
+ vp8_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride);
+ q += 64;
#endif
b = &xd->block[16 + i];
#else
if (xd->eobs[i] > 1)
{
- DEQUANT_INVOKE(&pbi->dequant, idct_add)
- (b->qcoeff, b->dequant, b->predictor,
- *(b->base_dst) + b->dst, 16, b->dst_stride);
- }
- else
- {
- IDCT_INVOKE(RTCD_VTABLE(idct), idct1_scalar_add)
- (b->qcoeff[0] * b->dequant[0], b->predictor,
- *(b->base_dst) + b->dst, 16, b->dst_stride);
- ((int *)b->qcoeff)[0] = 0;
+ DEQUANT_INVOKE(&pbi->dequant, idct_add)
+ (b->qcoeff, b->dequant, b->predictor,
+ *(b->base_dst) + b->dst, 16, b->dst_stride);
+ } else {
+ IDCT_INVOKE(RTCD_VTABLE(idct), idct1_scalar_add)
+ (b->qcoeff[0] * b->dequant[0], b->predictor,
+ *(b->base_dst) + b->dst, 16, b->dst_stride);
+ ((int *)b->qcoeff)[0] = 0;
}
#endif
}
}
#if CONFIG_SUPERBLOCKS
- if (!xd->mode_info_context->mbmi.encoded_as_sb) {
+ if (!xd->mode_info_context->mbmi.encoded_as_sb) {
#endif
- if ((tx_type == TX_8X8 &&
- xd->mode_info_context->mbmi.mode != I8X8_PRED)
+ if ((tx_type == TX_8X8 &&
+ xd->mode_info_context->mbmi.mode != I8X8_PRED)
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
- || tx_type == TX_16X16
+ || tx_type == TX_16X16
#endif
- )
- DEQUANT_INVOKE(&pbi->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); //
- else if (xd->mode_info_context->mbmi.mode != I8X8_PRED)
- DEQUANT_INVOKE(&pbi->dequant, idct_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);
+ )
+ DEQUANT_INVOKE(&pbi->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); //
+ else if (xd->mode_info_context->mbmi.mode != I8X8_PRED)
+ DEQUANT_INVOKE(&pbi->dequant, idct_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);
#if CONFIG_SUPERBLOCKS
}
#endif
TX_TYPE tx_type = DCT_DCT;
#endif
-#if CONFIG_HYBRIDTRANSFORM8X8
int bufthred = (xd->mode_info_context->mbmi.mode == I8X8_PRED) ? 16 : 24;
if (xd->mode_info_context->mbmi.mode != B_PRED &&
xd->mode_info_context->mbmi.mode != SPLITMV &&
xd->mode_info_context->mbmi.mode != I8X8_PRED) {
-#else
- if (xd->mode_info_context->mbmi.mode != B_PRED &&
- xd->mode_info_context->mbmi.mode != SPLITMV) {
-#endif
ENTROPY_CONTEXT *const a = A + vp8_block2above_8x8[24];
ENTROPY_CONTEXT *const l = L + vp8_block2left_8x8[24];
const int *const scan = vp8_default_zig_zag1d;
else
seg_eob = 64;
-#if CONFIG_HYBRIDTRANSFORM8X8
for (i = 0; i < bufthred ; i += 4) {
-#else
- for (i = 0; i < 24; i += 4) {
-#endif
ENTROPY_CONTEXT *const a = A + vp8_block2above_8x8[i];
ENTROPY_CONTEXT *const l = L + vp8_block2left_8x8[i];
const int *const scan = vp8_default_zig_zag1d_8x8;
}
#endif
- //printf("8: %d\n", tx_type);
c = vp8_decode_coefs(pbi, xd, a, l, type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
tx_type,
qcoeff_ptr += 64;
}
-#if CONFIG_HYBRIDTRANSFORM8X8
- if (xd->mode_info_context->mbmi.mode == I8X8_PRED) {
+ if (bufthred == 16) {
type = PLANE_TYPE_UV;
+#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
tx_type = DCT_DCT;
+#endif
seg_eob = 16;
// use 4x4 transform for U, V components in I8X8 prediction mode
qcoeff_ptr += 16;
}
}
-#endif
return eobtotal;
}
t->context_tree = cpi->common.fc.coef_probs_8x8 [type] [band] [pt];
t->skip_eob_node = pt == 0 && ((band > 0 && type > 0) || (band > 1 && type == 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts_8x8 [type] [band] [pt] [x];
t->context_tree = cpi->common.fc.coef_probs [1] [band] [pt];
t->skip_eob_node = ((pt == 0) && (band > 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts [1] [band] [pt] [token];
t->context_tree = cpi->common.fc.coef_probs [1] [band] [pt];
t->skip_eob_node = ((pt == 0) && (band > 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts [1] [band] [pt] [DCT_EOB_TOKEN];
TOKENEXTRA *t = *tp; /* store tokens starting here */
const short *qcoeff_ptr = b->qcoeff;
#if CONFIG_HYBRIDTRANSFORM8X8
- TX_TYPE tx_type = type == 3 ? get_tx_type(xd, b) : DCT_DCT;
+ TX_TYPE tx_type = xd->mode_info_context->mbmi.mode == I8X8_PRED ?
+ get_tx_type(xd, b) : DCT_DCT;
#endif
int seg_eob = 64;
t->context_tree = cpi->common.fc.coef_probs_8x8[type][band][pt];
t->skip_eob_node = pt == 0 && ((band > 0 && type > 0) || (band > 1 && type == 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run) {
#if CONFIG_HYBRIDTRANSFORM8X8
t->context_tree = cpi->common.fc.coef_probs_8x8 [type] [band] [pt];
t->skip_eob_node = pt == 0 && ((band > 0 && type > 0) || (band > 1 && type == 0));
+ if (vp8_coef_encodings[t->Token].Len - t->skip_eob_node <= 0) {
+ printf("type %d, seg-eob %d, eob %d, pt %d, c %d band %d\n", type, seg_eob, b->eob, pt, c, band);
+ fflush(stdout);
+ }
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run) {
#if CONFIG_HYBRIDTRANSFORM8X8
b_mode = b->bmi.as_mode.first;
tx_type = get_tx_type(xd, b);
}
- //if (!dry_run) printf("4: %d\n", tx_type);
// assign scanning order for luma components coded in intra4x4 mode
if( (xd->mode_info_context->mbmi.mode == B_PRED) &&
t->skip_eob_node = pt == 0 &&
((band > 0 && type > 0) || (band > 1 && type == 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run) {
if (tx_type != DCT_DCT)
t->skip_eob_node = pt == 0 &&
((band > 0 && type > 0) || (band > 1 && type == 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run) {
if (tx_type != DCT_DCT)
++cpi->hybrid_coef_counts[type] [band] [pt] [DCT_EOB_TOKEN];
t->context_tree = cpi->common.fc.coef_probs [2] [band] [pt];
t->skip_eob_node = ((pt == 0) && (band > 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts [2] [band] [pt] [token];
t->context_tree = cpi->common.fc.coef_probs [2] [band] [pt];
t->skip_eob_node = ((pt == 0) && (band > 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts [2] [band] [pt] [DCT_EOB_TOKEN];
t++;
#endif
-#if CONFIG_HYBRIDTRANSFORM8X8
static void tokenize1st_order_chroma
(
MACROBLOCKD *xd,
t->context_tree = cpi->common.fc.coef_probs [2] [band] [pt];
t->skip_eob_node = ((pt == 0) && (band > 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts [2] [band] [pt] [token];
t->context_tree = cpi->common.fc.coef_probs [2] [band] [pt];
t->skip_eob_node = ((pt == 0) && (band > 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts [2] [band] [pt] [DCT_EOB_TOKEN];
*a = *l = pt;
}
}
-#endif
static void tokenize1st_order_b
(
c = type ? 0 : 1;
+ assert(b->eob <= 16);
+
for (; c < b->eob; c++) {
rc = vp8_default_zig_zag1d[c];
band = vp8_coef_bands[c];
t->skip_eob_node = pt == 0 &&
((band > 0 && type > 0) || (band > 1 && type == 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts [type] [band] [pt] [token];
t->skip_eob_node = pt == 0 &&
((band > 0 && type > 0) || (band > 1 && type == 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts [type] [band] [pt] [DCT_EOB_TOKEN];
VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l);
+ assert(b->eob <= 16);
for (c = 0; c < b->eob; c++) {
rc = vp8_default_zig_zag1d[c];
band = vp8_coef_bands[c];
t->context_tree = cpi->common.fc.coef_probs [2] [band] [pt];
t->skip_eob_node = ((pt == 0) && (band > 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts [2] [band] [pt] [token];
t->context_tree = cpi->common.fc.coef_probs [2] [band] [pt];
t->skip_eob_node = ((pt == 0) && (band > 0));
+ assert(vp8_coef_encodings[t->Token].Len - t->skip_eob_node > 0);
if (!dry_run)
++cpi->coef_counts [2] [band] [pt] [DCT_EOB_TOKEN];
break;
#endif
case TX_8X8:
-#if CONFIG_HYBRIDTRANSFORM8X8
if (xd->mode_info_context->mbmi.mode == I8X8_PRED)
xd->mode_info_context->mbmi.mb_skip_coeff = mb_is_skippable_8x8_4x4uv(xd, 0);
else
-#endif
- xd->mode_info_context->mbmi.mb_skip_coeff = mb_is_skippable_8x8(xd, has_y2_block);
+ xd->mode_info_context->mbmi.mb_skip_coeff = mb_is_skippable_8x8(xd, has_y2_block);
break;
default:
else
#endif
if (tx_size == TX_8X8) {
-#if CONFIG_HYBRIDTRANSFORM8X8
if (xd->mode_info_context->mbmi.mode == I8X8_PRED)
vp8_stuff_mb_8x8_4x4uv(cpi, xd, t, dry_run);
else
-#endif
vp8_stuff_mb_8x8(cpi, xd, t, dry_run);
} else
vp8_stuff_mb(cpi, xd, t, dry_run);
if (tx_size == TX_8X8) {
ENTROPY_CONTEXT *A = (ENTROPY_CONTEXT *)xd->above_context;
ENTROPY_CONTEXT *L = (ENTROPY_CONTEXT *)xd->left_context;
-#if CONFIG_HYBRIDTRANSFORM8X8
if (xd->mode_info_context->mbmi.mode == I8X8_PRED) {
plane_type = PLANE_TYPE_Y_WITH_DC;
}
-#endif
for (b = 0; b < 16; b += 4) {
tokenize1st_order_b_8x8(xd,
xd->block + b,
*(A + vp8_block2above_8x8[b] + 1) = *(A + vp8_block2above_8x8[b]);
*(L + vp8_block2left_8x8[b] + 1) = *(L + vp8_block2left_8x8[b]);
}
-#if CONFIG_HYBRIDTRANSFORM8X8
if (xd->mode_info_context->mbmi.mode == I8X8_PRED) {
tokenize1st_order_chroma(xd, t, PLANE_TYPE_UV, cpi, dry_run);
- } else
-#endif
- {
+ } else {
for (b = 16; b < 24; b += 4) {
tokenize1st_order_b_8x8(xd,
xd->block + b, t, 2, xd->frame_type,
int pt; /* near block/prev token context index */
TOKENEXTRA *t = *tp; /* store tokens starting here */
#if CONFIG_HYBRIDTRANSFORM8X8
- TX_TYPE tx_type = type == 3 ? get_tx_type(xd, b) : DCT_DCT;
+ TX_TYPE tx_type = xd->mode_info_context->mbmi.mode == I8X8_PRED ?
+ get_tx_type(xd, b) : DCT_DCT;
#endif
VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l);