iOS/buildlibs/armv7/allegro-4.4.2/addons/jpgalleg/src/decode.c
/* _jpeg_c_idct:
 *  Applies the inverse discrete cosine transform to the given input data,
 *  in the form of a vector of 64 coefficients.
 *  This uses integer fixed point math and is based on code by the IJG.
 */
Applies the inverse discrete cosine transform to the given input data,
in the form of a vector of 64 coefficients.
This uses integer fixed point math and is based on code by the IJG.
Applies the inverse discrete cosine transform to the given input data in the form of a vector of 64 coefficients . This uses integer fixed point math and is based on code by the IJG .
static void
_jpeg_c_idct(short *data, short *output, short *dequant, short *workspace)
{
	int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
	int tmp10, tmp11, tmp12, tmp13;
	int z5, z10, z11, z12, z13;
	short *inptr, *dqptr, *outptr;
	int *wsptr;
	int i, temp;
	inptr = data;
	dqptr = dequant;
	wsptr = (int *)workspace;
	for (i = 8; i; i--) {
		if ((inptr[8] | inptr[16] | inptr[24] | inptr[32] | inptr[40] | inptr[48] | inptr[56]) == 0) {
			temp = inptr[0] * dqptr[0];
			wsptr[0] = temp;
			wsptr[8] = temp;
			wsptr[16] = temp;
			wsptr[24] = temp;
			wsptr[32] = temp;
			wsptr[40] = temp;
			wsptr[48] = temp;
			wsptr[56] = temp;
			inptr++;
			dqptr++;
			wsptr++;
			continue;
		}
		tmp0 = inptr[0] * dqptr[0];
		tmp1 = inptr[16] * dqptr[16];
		tmp2 = inptr[32] * dqptr[32];
		tmp3 = inptr[48] * dqptr[48];
		tmp10 = tmp0 + tmp2;
		tmp11 = tmp0 - tmp2;
		tmp13 = tmp1 + tmp3;
		tmp12 = (((tmp1 - tmp3) * IFIX_1_414213562) >> 8) - tmp13;
		tmp0 = tmp10 + tmp13;
		tmp3 = tmp10 - tmp13;
		tmp1 = tmp11 + tmp12;
		tmp2 = tmp11 - tmp12;
		tmp4 = inptr[8] * dqptr[8];
		tmp5 = inptr[24] * dqptr[24];
		tmp6 = inptr[40] * dqptr[40];
		tmp7 = inptr[56] * dqptr[56];
		z13 = tmp6 + tmp5;
		z10 = tmp6 - tmp5;
		z11 = tmp4 + tmp7;
		z12 = tmp4 - tmp7;
		tmp7 = z11 + z13;
		tmp11 = ((z11 - z13) * IFIX_1_414213562) >> 8;
		z5 = ((z10 + z12) * IFIX_1_847759065) >> 8;
		tmp10 = ((z12 * IFIX_1_082392200) >> 8) - z5;
		tmp12 = ((z10 * -IFIX_2_613125930) >> 8) + z5;
		tmp6 = tmp12 - tmp7;
		tmp5 = tmp11 - tmp6;
		tmp4 = tmp10 + tmp5;
		wsptr[0] = tmp0 + tmp7;
		wsptr[56] = tmp0 - tmp7;
		wsptr[8] = tmp1 + tmp6;
		wsptr[48] = tmp1 - tmp6;
		wsptr[16] = tmp2 + tmp5;
		wsptr[40] = tmp2 - tmp5;
		wsptr[32] = tmp3 + tmp4;
		wsptr[24] = tmp3 - tmp4;
		inptr++;
		dqptr++;
		wsptr++;
	}
	wsptr = (int *)workspace;
	outptr = output;
	for (i = 8; i; i--) {
		tmp10 = wsptr[0] + wsptr[4];
		tmp11 = wsptr[0] - wsptr[4];
		tmp13 = wsptr[2] + wsptr[6];
		tmp12 = (((wsptr[2] - wsptr[6]) * IFIX_1_414213562) >> 8) - tmp13;
		tmp0 = tmp10 + tmp13;
		tmp3 = tmp10 - tmp13;
		tmp1 = tmp11 + tmp12;
		tmp2 = tmp11 - tmp12;
		z13 = wsptr[5] + wsptr[3];
		z10 = wsptr[5] - wsptr[3];
		z11 = wsptr[1] + wsptr[7];
		z12 = wsptr[1] - wsptr[7];
		tmp7 = z11 + z13;
		tmp11 = ((z11 - z13) * IFIX_1_414213562) >> 8;
		z5 = ((z10 + z12) * IFIX_1_847759065) >> 8;
		tmp10 = ((z12 * IFIX_1_082392200) >> 8) - z5;
		tmp12 = ((z10 * -IFIX_2_613125930) >> 8) + z5;
		tmp6 = tmp12 - tmp7;
		tmp5 = tmp11 - tmp6;
		tmp4 = tmp10 + tmp5;
		outptr[0] = ((tmp0 + tmp7) >> 5) + 128;
		outptr[7] = ((tmp0 - tmp7) >> 5) + 128;
		outptr[1] = ((tmp1 + tmp6) >> 5) + 128;
		outptr[6] = ((tmp1 - tmp6) >> 5) + 128;
		outptr[2] = ((tmp2 + tmp5) >> 5) + 128;
		outptr[5] = ((tmp2 - tmp5) >> 5) + 128;
		outptr[4] = ((tmp3 + tmp4) >> 5) + 128;
		outptr[3] = ((tmp3 - tmp4) >> 5) + 128;
		wsptr += 8;
		outptr += 8;
	}
}
static void _jpeg_c_idct ( short * data , short * output , short * dequant , short * workspace ) { int tmp0 , tmp1 , tmp2 , tmp3 , tmp4 , tmp5 , tmp6 , tmp7 ; int tmp10 , tmp11 , tmp12 , tmp13 ; int z5 , z10 , z11 , z12 , z13 ; short * inptr , * dqptr , * outptr ; int * wsptr ; int i , temp ; inptr = data ; dqptr = dequant ; wsptr = ( int * ) workspace ; for ( i = 8 ; i ; i -- ) { if ( ( inptr [ 8 ] | inptr [ 16 ] | inptr [ 24 ] | inptr [ 32 ] | inptr [ 40 ] | inptr [ 48 ] | inptr [ 56 ] ) == 0 ) { temp = inptr [ 0 ] * dqptr [ 0 ] ; wsptr [ 0 ] = temp ; wsptr [ 8 ] = temp ; wsptr [ 16 ] = temp ; wsptr [ 24 ] = temp ; wsptr [ 32 ] = temp ; wsptr [ 40 ] = temp ; wsptr [ 48 ] = temp ; wsptr [ 56 ] = temp ; inptr ++ ; dqptr ++ ; wsptr ++ ; continue ; } tmp0 = inptr [ 0 ] * dqptr [ 0 ] ; tmp1 = inptr [ 16 ] * dqptr [ 16 ] ; tmp2 = inptr [ 32 ] * dqptr [ 32 ] ; tmp3 = inptr [ 48 ] * dqptr [ 48 ] ; tmp10 = tmp0 + tmp2 ; tmp11 = tmp0 - tmp2 ; tmp13 = tmp1 + tmp3 ; tmp12 = ( ( ( tmp1 - tmp3 ) * IFIX_1_414213562 ) >> 8 ) - tmp13 ; tmp0 = tmp10 + tmp13 ; tmp3 = tmp10 - tmp13 ; tmp1 = tmp11 + tmp12 ; tmp2 = tmp11 - tmp12 ; tmp4 = inptr [ 8 ] * dqptr [ 8 ] ; tmp5 = inptr [ 24 ] * dqptr [ 24 ] ; tmp6 = inptr [ 40 ] * dqptr [ 40 ] ; tmp7 = inptr [ 56 ] * dqptr [ 56 ] ; z13 = tmp6 + tmp5 ; z10 = tmp6 - tmp5 ; z11 = tmp4 + tmp7 ; z12 = tmp4 - tmp7 ; tmp7 = z11 + z13 ; tmp11 = ( ( z11 - z13 ) * IFIX_1_414213562 ) >> 8 ; z5 = ( ( z10 + z12 ) * IFIX_1_847759065 ) >> 8 ; tmp10 = ( ( z12 * IFIX_1_082392200 ) >> 8 ) - z5 ; tmp12 = ( ( z10 * - IFIX_2_613125930 ) >> 8 ) + z5 ; tmp6 = tmp12 - tmp7 ; tmp5 = tmp11 - tmp6 ; tmp4 = tmp10 + tmp5 ; wsptr [ 0 ] = tmp0 + tmp7 ; wsptr [ 56 ] = tmp0 - tmp7 ; wsptr [ 8 ] = tmp1 + tmp6 ; wsptr [ 48 ] = tmp1 - tmp6 ; wsptr [ 16 ] = tmp2 + tmp5 ; wsptr [ 40 ] = tmp2 - tmp5 ; wsptr [ 32 ] = tmp3 + tmp4 ; wsptr [ 24 ] = tmp3 - tmp4 ; inptr ++ ; dqptr ++ ; wsptr ++ ; } wsptr = ( int * ) workspace ; outptr = output ; for ( i = 8 ; i ; i -- ) { tmp10 = wsptr [ 0 ] + wsptr [ 4 ] ; tmp11 = wsptr [ 0 ] - wsptr [ 4 ] ; tmp13 = wsptr [ 2 ] + wsptr [ 6 ] ; tmp12 = ( ( ( wsptr [ 2 ] - wsptr [ 6 ] ) * IFIX_1_414213562 ) >> 8 ) - tmp13 ; tmp0 = tmp10 + tmp13 ; tmp3 = tmp10 - tmp13 ; tmp1 = tmp11 + tmp12 ; tmp2 = tmp11 - tmp12 ; z13 = wsptr [ 5 ] + wsptr [ 3 ] ; z10 = wsptr [ 5 ] - wsptr [ 3 ] ; z11 = wsptr [ 1 ] + wsptr [ 7 ] ; z12 = wsptr [ 1 ] - wsptr [ 7 ] ; tmp7 = z11 + z13 ; tmp11 = ( ( z11 - z13 ) * IFIX_1_414213562 ) >> 8 ; z5 = ( ( z10 + z12 ) * IFIX_1_847759065 ) >> 8 ; tmp10 = ( ( z12 * IFIX_1_082392200 ) >> 8 ) - z5 ; tmp12 = ( ( z10 * - IFIX_2_613125930 ) >> 8 ) + z5 ; tmp6 = tmp12 - tmp7 ; tmp5 = tmp11 - tmp6 ; tmp4 = tmp10 + tmp5 ; outptr [ 0 ] = ( ( tmp0 + tmp7 ) >> 5 ) + 128 ; outptr [ 7 ] = ( ( tmp0 - tmp7 ) >> 5 ) + 128 ; outptr [ 1 ] = ( ( tmp1 + tmp6 ) >> 5 ) + 128 ; outptr [ 6 ] = ( ( tmp1 - tmp6 ) >> 5 ) + 128 ; outptr [ 2 ] = ( ( tmp2 + tmp5 ) >> 5 ) + 128 ; outptr [ 5 ] = ( ( tmp2 - tmp5 ) >> 5 ) + 128 ; outptr [ 4 ] = ( ( tmp3 + tmp4 ) >> 5 ) + 128 ; outptr [ 3 ] = ( ( tmp3 - tmp4 ) >> 5 ) + 128 ; wsptr += 8 ; outptr += 8 ; } }
_jpeg_c_idct:
  Applies the inverse discrete cosine transform to the given input data,
  in the form of a vector of 64 coefficients.
_jpeg_c_idct : Applies the inverse discrete cosine transform to the given input data in the form of a vector of 64 coefficients .