package com.alibaba.simpleimage.codec.convertor;
public static final int ONE = 1;
public Object calculate(int[] input, int inPos, int[] quant, int[] output, int outPos, int width, int height) {
if (width == 16 && height == 16) {
} else if (width == 16 && height == 8) {
} else if (width == 8 && height == 16) {
} else if (width == 8 && height == 8) {
public static int FIX(double x) {
private int DESCALE(int x, int n) {
return (x + (ONE << (n - 1))) >> n;
int tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
int tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
int[] outptr = (output != null ? output : new int[DCTSIZE2 * 4]);
int workspace[] = new int[8 * 16];
int inputOffset = inPos, quantOffset = 0, wsOffset = 0, outputOffset1 = 0, outputOffset2 = 0;
for (ctr = 0; ctr < 8; ctr++, inputOffset++, quantOffset++, wsOffset++) {
tmp0 = inptr[inputOffset] * quantptr[quantOffset];
z1 = inptr[inputOffset + DCTSIZE * 4] * quantptr[quantOffset + DCTSIZE * 4];
z1 = inptr[inputOffset + DCTSIZE * 2] * quantptr[quantOffset + DCTSIZE * 2];
z2 = inptr[inputOffset + DCTSIZE * 6] * quantptr[quantOffset + DCTSIZE * 6];
z1 = inptr[inputOffset + DCTSIZE * 1] * quantptr[quantOffset + DCTSIZE * 1];
z2 = inptr[inputOffset + DCTSIZE * 3] * quantptr[quantOffset + DCTSIZE * 3];
z3 = inptr[inputOffset + DCTSIZE * 5] * quantptr[quantOffset + DCTSIZE * 5];
z4 = inptr[inputOffset + DCTSIZE * 7] * quantptr[quantOffset + DCTSIZE * 7];
for (ctr = 0; ctr < 16; ctr++) {
outputOffset1 = outPos + ctr * 8;
outputOffset2 = outPos + DCTSIZE2 + ctr * 8;
outputOffset1 = outPos + DCTSIZE2 + ctr * 8;
outputOffset2 = outPos + DCTSIZE2 * 2 + ctr * 8;
z1 = wsptr[wsOffset + 4];
z1 = wsptr[wsOffset + 2];
z2 = wsptr[wsOffset + 6];
z1 = wsptr[wsOffset + 1];
z2 = wsptr[wsOffset + 3];
z3 = wsptr[wsOffset + 5];
z4 = wsptr[wsOffset + 7];
outptr[outputOffset1 + 0] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 7] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 1] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 6] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 2] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 5] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 3] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 4] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 4] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 3] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 5] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 2] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 6] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 1] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 7] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 0] = rangeLimitMap[rangeLimitOffset
protected Object calculate16x8(int[] inptr, int inPos, int[] quant, int[] output, int outPos) {
int tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
int tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
int[] outptr = (output != null ? output : new int[DCTSIZE2 * 2]);
int inputOffset = inPos, outputOffset1 = 0, outputOffset2 = 0, quantOffset = 0, wsOffset = 0;
for (ctr = DCTSIZE; ctr > 0; ctr--) {
if (inptr[inputOffset + DCTSIZE * 1] == 0 && inptr[inputOffset + DCTSIZE * 2] == 0
&& inptr[inputOffset + DCTSIZE * 3] == 0 && inptr[inputOffset + DCTSIZE * 4] == 0
&& inptr[inputOffset + DCTSIZE * 5] == 0 && inptr[inputOffset + DCTSIZE * 6] == 0
&& inptr[inputOffset + DCTSIZE * 7] == 0) {
int dcval = (inptr[inputOffset] * quant[quantOffset]) << PASS1_BITS;
wsptr[wsOffset + DCTSIZE * 0] = dcval;
wsptr[wsOffset + DCTSIZE * 1] = dcval;
wsptr[wsOffset + DCTSIZE * 2] = dcval;
wsptr[wsOffset + DCTSIZE * 3] = dcval;
wsptr[wsOffset + DCTSIZE * 4] = dcval;
wsptr[wsOffset + DCTSIZE * 5] = dcval;
wsptr[wsOffset + DCTSIZE * 6] = dcval;
wsptr[wsOffset + DCTSIZE * 7] = dcval;
z2 = inptr[inputOffset + DCTSIZE * 2] * quant[quantOffset + DCTSIZE * 2];
z3 = inptr[inputOffset + DCTSIZE * 6] * quant[quantOffset + DCTSIZE * 6];
z2 = inptr[inputOffset + DCTSIZE * 0] * quant[quantOffset + DCTSIZE * 0];
z3 = inptr[inputOffset + DCTSIZE * 4] * quant[quantOffset + DCTSIZE * 4];
tmp0 = inptr[inputOffset + DCTSIZE * 7] * quant[quantOffset + DCTSIZE * 7];
tmp1 = inptr[inputOffset + DCTSIZE * 5] * quant[quantOffset + DCTSIZE * 5];
tmp2 = inptr[inputOffset + DCTSIZE * 3] * quant[quantOffset + DCTSIZE * 3];
tmp3 = inptr[inputOffset + DCTSIZE * 1] * quant[quantOffset + DCTSIZE * 1];
for (ctr = 0; ctr < DCTSIZE; ctr++) {
outputOffset1 = outPos + ctr * DCTSIZE;
z1 = wsptr[wsOffset + 4];
z1 = wsptr[wsOffset + 2];
z2 = wsptr[wsOffset + 6];
z1 = wsptr[wsOffset + 1];
z2 = wsptr[wsOffset + 3];
z3 = wsptr[wsOffset + 5];
z4 = wsptr[wsOffset + 7];
outptr[outputOffset1 + 0] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 7] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 1] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 6] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 2] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 5] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 3] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 4] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 4] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 3] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 5] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 2] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 6] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 1] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset1 + 7] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset2 + 0] = rangeLimitMap[rangeLimitOffset
protected Object calculate8x16(int[] inptr, int inPos, int[] quant, int[] output, int outPos) {
int tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
int tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
int[] outptr = (output != null ? output : new int[DCTSIZE2 * 2]);
int[] workspace = new int[8 * 16];
int inputOffset = inPos, quantOffset = 0, outputOffset = 0, wsOffset = 0;
for (ctr = 0; ctr < 8; ctr++, inputOffset++, quantOffset++, wsOffset++) {
tmp0 = inptr[inputOffset] * quant[quantOffset];
z1 = inptr[inputOffset + DCTSIZE * 4] * quant[quantOffset + DCTSIZE * 4];
z1 = inptr[inputOffset + DCTSIZE * 2] * quant[quantOffset + DCTSIZE * 2];
z2 = inptr[inputOffset + DCTSIZE * 6] * quant[quantOffset + DCTSIZE * 6];
z1 = inptr[inputOffset + DCTSIZE * 1] * quant[quantOffset + DCTSIZE * 1];
z2 = inptr[inputOffset + DCTSIZE * 3] * quant[quantOffset + DCTSIZE * 3];
z3 = inptr[inputOffset + DCTSIZE * 5] * quant[quantOffset + DCTSIZE * 5];
z4 = inptr[inputOffset + DCTSIZE * 7] * quant[quantOffset + DCTSIZE * 7];
for (ctr = 0; ctr < 16; ctr++) {
outputOffset = outPos + ctr * 8;
z2 = wsptr[wsOffset + 2];
z3 = wsptr[wsOffset + 6];
z3 = wsptr[wsOffset + 4];
tmp0 = wsptr[wsOffset + 7];
tmp1 = wsptr[wsOffset + 5];
tmp2 = wsptr[wsOffset + 3];
tmp3 = wsptr[wsOffset + 1];
outptr[outputOffset + 0] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset + 7] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset + 1] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset + 6] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset + 2] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset + 5] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset + 3] = rangeLimitMap[rangeLimitOffset
outptr[outputOffset + 4] = rangeLimitMap[rangeLimitOffset
protected Object calculate8x8(int[] inptr, int inPos, int[] quant, int[] output, int outPos) {
int tmp0, tmp1, tmp2, tmp3;
int tmp10, tmp11, tmp12, tmp13;
int[] outptr = (output != null ? output : new int[DCTSIZE2]);
int inputOffset = inPos, wsOffset = 0, quantOffset = 0, outputOffset = 0;
for (ctr = DCTSIZE; ctr > 0; ctr--) {
if (inptr[inputOffset + DCTSIZE * 1] == 0 && inptr[inputOffset + DCTSIZE * 2] == 0
&& inptr[inputOffset + DCTSIZE * 3] == 0 && inptr[inputOffset + DCTSIZE * 4] == 0
&& inptr[inputOffset + DCTSIZE * 5] == 0 && inptr[inputOffset + DCTSIZE * 6] == 0
&& inptr[inputOffset + DCTSIZE * 7] == 0) {
int dcval = (inptr[inputOffset] * quant[quantOffset]) << PASS1_BITS;
wsptr[wsOffset + DCTSIZE * 0] = dcval;
wsptr[wsOffset + DCTSIZE * 1] = dcval;
wsptr[wsOffset + DCTSIZE * 2] = dcval;
wsptr[wsOffset + DCTSIZE * 3] = dcval;
wsptr[wsOffset + DCTSIZE * 4] = dcval;
wsptr[wsOffset + DCTSIZE * 5] = dcval;
wsptr[wsOffset + DCTSIZE * 6] = dcval;
wsptr[wsOffset + DCTSIZE * 7] = dcval;
z2 = inptr[inputOffset + DCTSIZE * 2] * quant[quantOffset + DCTSIZE * 2];
z3 = inptr[inputOffset + DCTSIZE * 6] * quant[quantOffset + DCTSIZE * 6];
z2 = inptr[inputOffset + DCTSIZE * 0] * quant[quantOffset + DCTSIZE * 0];
z3 = inptr[inputOffset + DCTSIZE * 4] * quant[quantOffset + DCTSIZE * 4];
tmp0 = inptr[inputOffset + DCTSIZE * 7] * quant[quantOffset + DCTSIZE * 7];
tmp1 = inptr[inputOffset + DCTSIZE * 5] * quant[quantOffset + DCTSIZE * 5];
tmp2 = inptr[inputOffset + DCTSIZE * 3] * quant[quantOffset + DCTSIZE * 3];
tmp3 = inptr[inputOffset + DCTSIZE * 1] * quant[quantOffset + DCTSIZE * 1];