Commit 95dcfb9d authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

Change entropy context assignment style from *(x + y) = z to x[y] = z.

Change-Id: Ibc4425bb6e01606751021e57c93106c365a2da21
parent 12c1b180
......@@ -443,11 +443,9 @@ int vp8_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd,
seg_eob, qcoeff_ptr,
0, scan, TX_16X16, coef_bands_x_16x16);
eobs[0] = c;
*A = *L = (c != !type);
for (i = 1; i < 16; i++) {
*(A + vp8_block2above[i]) = *(A);
*(L + vp8_block2left[i]) = *(L);
}
A[0] = L[0] = (c != !type);
A[1] = A[2] = A[3] = A[0];
L[1] = L[2] = L[3] = L[0];
eobtotal += c;
}
......
......@@ -651,8 +651,8 @@ void vp8_optimize_mby_8x8(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) {
optimize_b(x, b, type,
ta + vp8_block2above_8x8[b], tl + vp8_block2left_8x8[b],
rtcd, TX_8X8);
*(ta + vp8_block2above_8x8[b] + 1) = *(ta + vp8_block2above_8x8[b]);
*(tl + vp8_block2left_8x8[b] + 1) = *(tl + vp8_block2left_8x8[b]);
ta[vp8_block2above_8x8[b] + 1] = ta[vp8_block2above_8x8[b]];
tl[vp8_block2left_8x8[b] + 1] = tl[vp8_block2left_8x8[b]];
}
// 8x8 always have 2nd roder haar block
......@@ -682,8 +682,8 @@ void vp8_optimize_mbuv_8x8(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd) {
optimize_b(x, b, PLANE_TYPE_UV,
ta + vp8_block2above_8x8[b], tl + vp8_block2left_8x8[b],
rtcd, TX_8X8);
*(ta + vp8_block2above_8x8[b] + 1) = *(ta + vp8_block2above_8x8[b]);
*(tl + vp8_block2left_8x8[b] + 1) = *(tl + vp8_block2left_8x8[b]);
ta[vp8_block2above_8x8[b] + 1] = ta[vp8_block2above_8x8[b]];
tl[vp8_block2left_8x8[b] + 1] = tl[vp8_block2left_8x8[b]];
}
}
......
......@@ -1504,8 +1504,8 @@ static int64_t rd_pick_intra8x8block(VP8_COMP *cpi, MACROBLOCK *x, int ib,
// compute quantization mse of 8x8 block
distortion = vp8_block_error_c((x->block + idx)->coeff,
(xd->block + idx)->dqcoeff, 64);
ta0 = *(a + vp8_block2above_8x8[idx]);
tl0 = *(l + vp8_block2left_8x8 [idx]);
ta0 = a[vp8_block2above_8x8[idx]];
tl0 = l[vp8_block2left_8x8[idx]];
rate_t = cost_coeffs(x, xd->block + idx, PLANE_TYPE_Y_WITH_DC,
&ta0, &tl0, TX_8X8);
......@@ -1531,10 +1531,10 @@ static int64_t rd_pick_intra8x8block(VP8_COMP *cpi, MACROBLOCK *x, int ib,
distortion += vp8_block_error_c((x->block + ib + 5)->coeff,
(xd->block + ib + 5)->dqcoeff, 16);
ta0 = *(a + vp8_block2above[ib]);
ta1 = *(a + vp8_block2above[ib + 1]);
tl0 = *(l + vp8_block2left[ib]);
tl1 = *(l + vp8_block2left[ib + 4]);
ta0 = a[vp8_block2above[ib]];
ta1 = a[vp8_block2above[ib + 1]];
tl0 = l[vp8_block2left[ib]];
tl1 = l[vp8_block2left[ib + 4]];
rate_t = cost_coeffs(x, xd->block + ib, PLANE_TYPE_Y_WITH_DC,
&ta0, &tl0, TX_4X4);
rate_t += cost_coeffs(x, xd->block + ib + 1, PLANE_TYPE_Y_WITH_DC,
......@@ -1576,15 +1576,15 @@ static int64_t rd_pick_intra8x8block(VP8_COMP *cpi, MACROBLOCK *x, int ib,
vp8_encode_intra8x8(IF_RTCD(&cpi->rtcd), x, ib);
if (xd->mode_info_context->mbmi.txfm_size == TX_8X8) {
*(a + vp8_block2above_8x8[idx]) = besta0;
*(a + vp8_block2above_8x8[idx] + 1) = besta1;
*(l + vp8_block2left_8x8 [idx]) = bestl0;
*(l + vp8_block2left_8x8 [idx] + 1) = bestl1;
a[vp8_block2above_8x8[idx]] = besta0;
a[vp8_block2above_8x8[idx] + 1] = besta1;
l[vp8_block2left_8x8[idx]] = bestl0;
l[vp8_block2left_8x8[idx] + 1] = bestl1;
} else {
*(a + vp8_block2above[ib]) = besta0;
*(a + vp8_block2above[ib + 1]) = besta1;
*(l + vp8_block2left[ib]) = bestl0;
*(l + vp8_block2left[ib + 4]) = bestl1;
a[vp8_block2above[ib]] = besta0;
a[vp8_block2above[ib + 1]] = besta1;
l[vp8_block2left[ib]] = bestl0;
l[vp8_block2left[ib + 4]] = bestl1;
}
return best_rd;
......
......@@ -639,17 +639,15 @@ void vp8_tokenize_mb(VP8_COMP *cpi,
tokenize1st_order_b_16x16(xd, xd->block, t, PLANE_TYPE_Y_WITH_DC,
A, L, cpi, dry_run);
A[1] = A[2] = A[3] = A[0];
L[1] = L[2] = L[3] = L[0];
for (b = 1; b < 16; b++) {
*(A + vp8_block2above[b]) = *(A);
*(L + vp8_block2left[b] ) = *(L);
}
for (b = 16; b < 24; b += 4) {
tokenize1st_order_b_8x8(xd, xd->block + b, t, PLANE_TYPE_UV,
A + vp8_block2above_8x8[b],
L + vp8_block2left_8x8[b], cpi, dry_run);
*(A + vp8_block2above_8x8[b]+1) = *(A + vp8_block2above_8x8[b]);
*(L + vp8_block2left_8x8[b]+1 ) = *(L + vp8_block2left_8x8[b]);
A[vp8_block2above_8x8[b] + 1] = A[vp8_block2above_8x8[b]];
L[vp8_block2left_8x8[b] + 1] = L[vp8_block2left_8x8[b]];
}
vpx_memset(&A[8], 0, sizeof(A[8]));
vpx_memset(&L[8], 0, sizeof(L[8]));
......@@ -663,8 +661,8 @@ void vp8_tokenize_mb(VP8_COMP *cpi,
A + vp8_block2above_8x8[b],
L + vp8_block2left_8x8[b],
cpi, dry_run);
*(A + vp8_block2above_8x8[b] + 1) = *(A + vp8_block2above_8x8[b]);
*(L + vp8_block2left_8x8[b] + 1) = *(L + vp8_block2left_8x8[b]);
A[vp8_block2above_8x8[b] + 1] = A[vp8_block2above_8x8[b]];
L[vp8_block2left_8x8[b] + 1] = L[vp8_block2left_8x8[b]];
}
if (xd->mode_info_context->mbmi.mode == I8X8_PRED ||
xd->mode_info_context->mbmi.mode == SPLITMV) {
......@@ -674,8 +672,8 @@ void vp8_tokenize_mb(VP8_COMP *cpi,
tokenize1st_order_b_8x8(xd, xd->block + b, t, PLANE_TYPE_UV,
A + vp8_block2above_8x8[b],
L + vp8_block2left_8x8[b], cpi, dry_run);
*(A + vp8_block2above_8x8[b] + 1) = *(A + vp8_block2above_8x8[b]);
*(L + vp8_block2left_8x8[b] + 1) = *(L + vp8_block2left_8x8[b]);
A[vp8_block2above_8x8[b] + 1] = A[vp8_block2above_8x8[b]];
L[vp8_block2left_8x8[b] + 1] = L[vp8_block2left_8x8[b]];
}
}
} else {
......@@ -1040,8 +1038,8 @@ static void vp8_stuff_mb_8x8(VP8_COMP *cpi, MACROBLOCKD *xd,
A + vp8_block2above_8x8[b],
L + vp8_block2left_8x8[b],
cpi, dry_run);
*(A + vp8_block2above_8x8[b] + 1) = *(A + vp8_block2above_8x8[b]);
*(L + vp8_block2left_8x8[b] + 1) = *(L + vp8_block2left_8x8[b]);
A[vp8_block2above_8x8[b] + 1] = A[vp8_block2above_8x8[b]];
L[vp8_block2left_8x8[b] + 1] = L[vp8_block2left_8x8[b]];
}
for (b = 16; b < 24; b += 4) {
......@@ -1049,8 +1047,8 @@ static void vp8_stuff_mb_8x8(VP8_COMP *cpi, MACROBLOCKD *xd,
A + vp8_block2above[b],
L + vp8_block2left[b],
cpi, dry_run);
*(A + vp8_block2above_8x8[b] + 1) = *(A + vp8_block2above_8x8[b]);
*(L + vp8_block2left_8x8[b] + 1) = *(L + vp8_block2left_8x8[b]);
A[vp8_block2above_8x8[b] + 1] = A[vp8_block2above_8x8[b]];
L[vp8_block2left_8x8[b] + 1] = L[vp8_block2left_8x8[b]];
}
if (dry_run)
*t = t_backup;
......@@ -1098,17 +1096,15 @@ static void vp8_stuff_mb_16x16(VP8_COMP *cpi, MACROBLOCKD *xd,
stuff1st_order_b_16x16(xd, xd->block, t, PLANE_TYPE_Y_WITH_DC,
A, L, cpi, dry_run);
for (i = 1; i < 16; i++) {
*(A + vp8_block2above[i]) = *(A);
*(L + vp8_block2left[i]) = *(L);
}
A[1] = A[2] = A[3] = A[0];
L[1] = L[2] = L[3] = L[0];
for (b = 16; b < 24; b += 4) {
stuff1st_order_buv_8x8(xd, xd->block + b, t,
A + vp8_block2above[b],
L + vp8_block2left[b],
cpi, dry_run);
*(A + vp8_block2above_8x8[b]+1) = *(A + vp8_block2above_8x8[b]);
*(L + vp8_block2left_8x8[b]+1 ) = *(L + vp8_block2left_8x8[b]);
A[vp8_block2above_8x8[b] + 1] = A[vp8_block2above_8x8[b]];
L[vp8_block2left_8x8[b] + 1] = L[vp8_block2left_8x8[b]];
}
vpx_memset(&A[8], 0, sizeof(A[8]));
vpx_memset(&L[8], 0, sizeof(L[8]));
......@@ -1242,8 +1238,8 @@ static void vp8_stuff_mb_8x8_4x4uv(VP8_COMP *cpi, MACROBLOCKD *xd,
A + vp8_block2above_8x8[b],
L + vp8_block2left_8x8[b],
cpi, dry_run);
*(A + vp8_block2above_8x8[b] + 1) = *(A + vp8_block2above_8x8[b]);
*(L + vp8_block2left_8x8[b] + 1) = *(L + vp8_block2left_8x8[b]);
A[vp8_block2above_8x8[b] + 1] = A[vp8_block2above_8x8[b]];
L[vp8_block2left_8x8[b] + 1] = L[vp8_block2left_8x8[b]];
}
for (b = 16; b < 24; b++)
......
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