Commit 5d7cb590 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Assign above/left context in decode_coefs() instead of in caller.

this prevents duplicating the same line of code in each caller of
decode_coefs().

Change-Id: Id7996ad394828bf77ef3d5e03002f577c9f79609
parent 3bdf302c
......@@ -241,6 +241,8 @@ SKIP_START:
if (c < seg_eob)
coef_counts[coef_bands[c]][pt][DCT_EOB_TOKEN]++;
a[0] = l[0] = (c != !type);
return c;
}
......@@ -274,11 +276,9 @@ int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
// Luma block
{
const int* const scan = vp9_default_zig_zag1d_16x16;
c = decode_coefs(pbi, xd, bc, A, L, type,
eobs[0] = c = decode_coefs(pbi, xd, bc, A, L, type,
tx_type, seg_eob, qcoeff_ptr,
scan, TX_16X16, vp9_coef_bands_16x16);
eobs[0] = c;
A[0] = L[0] = (c != !type);
A[1] = A[2] = A[3] = A[0];
L[1] = L[2] = L[3] = L[0];
eobtotal += c;
......@@ -294,10 +294,9 @@ int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
ENTROPY_CONTEXT* const l = L + vp9_block2left_8x8[i];
const int* const scan = vp9_default_zig_zag1d_8x8;
c = decode_coefs(pbi, xd, bc, a, l, type,
eobs[i] = c = decode_coefs(pbi, xd, bc, a, l, type,
tx_type, seg_eob, qcoeff_ptr,
scan, TX_8X8, vp9_coef_bands_8x8);
a[0] = l[0] = ((eobs[i] = c) != !type);
a[1] = a[0];
l[1] = l[0];
......@@ -333,10 +332,9 @@ int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
type = PLANE_TYPE_Y2;
seg_eob = get_eob(xd, segment_id, 4);
c = decode_coefs(pbi, xd, bc, a, l, type,
eobs[24] = c = decode_coefs(pbi, xd, bc, a, l, type,
tx_type, seg_eob, qcoeff_ptr + 24 * 16,
scan, TX_8X8, vp9_coef_bands);
a[0] = l[0] = ((eobs[24] = c) != !type);
eobtotal += c - 4;
......@@ -358,10 +356,9 @@ int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
tx_type = get_tx_type(xd, xd->block + i);
}
c = decode_coefs(pbi, xd, bc, a, l, type,
eobs[i] = c = decode_coefs(pbi, xd, bc, a, l, type,
tx_type, seg_eob, qcoeff_ptr,
scan, TX_8X8, vp9_coef_bands_8x8);
a[0] = l[0] = ((eobs[i] = c) != !type);
a[1] = a[0];
l[1] = l[0];
......@@ -380,10 +377,9 @@ int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
ENTROPY_CONTEXT *const l = L + vp9_block2left[i];
const int *scan = vp9_default_zig_zag1d;
c = decode_coefs(pbi, xd, bc, a, l, type,
eobs[i] = c = decode_coefs(pbi, xd, bc, a, l, type,
tx_type, seg_eob, qcoeff_ptr,
scan, TX_4X4, vp9_coef_bands);
a[0] = l[0] = ((eobs[i] = c) != !type);
eobtotal += c;
qcoeff_ptr += 16;
......@@ -422,10 +418,9 @@ static int decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
scan = vp9_default_zig_zag1d;
break;
}
c = decode_coefs(dx, xd, bc, a, l, type,
eobs[i] = c = decode_coefs(dx, xd, bc, a, l, type,
tx_type, seg_eob, qcoeff_ptr + i * 16,
scan, TX_4X4, vp9_coef_bands);
a[0] = l[0] = ((eobs[i] = c) != !type);
return c;
}
......
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