void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block)

{

POWERPC_TBL_DECLARE(altivec_idct_put_num, 1);

#ifdef ALTIVEC_USE_REFERENCE_C_CODE

POWERPC_TBL_START_COUNT(altivec_idct_put_num, 1);

    void simple_idct_put(uint8_t *dest, int line_size, int16_t *block);

    simple_idct_put(dest, stride, (int16_t*)block);

POWERPC_TBL_STOP_COUNT(altivec_idct_put_num, 1);

#else /* ALTIVEC_USE_REFERENCE_C_CODE */

    vector_u8_t tmp;



POWERPC_TBL_START_COUNT(altivec_idct_put_num, 1);



    IDCT



#define COPY(dest,src)						\

    tmp = vec_packsu (src, src);				\

    vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest);	\

    vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest);



    COPY (dest, vx0)	dest += stride;

    COPY (dest, vx1)	dest += stride;

    COPY (dest, vx2)	dest += stride;

    COPY (dest, vx3)	dest += stride;

    COPY (dest, vx4)	dest += stride;

    COPY (dest, vx5)	dest += stride;

    COPY (dest, vx6)	dest += stride;

    COPY (dest, vx7)



POWERPC_TBL_STOP_COUNT(altivec_idct_put_num, 1);

#endif /* ALTIVEC_USE_REFERENCE_C_CODE */

}

void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block)

{

POWERPC_TBL_DECLARE(altivec_idct_put_num, 1);

#ifdef ALTIVEC_USE_REFERENCE_C_CODE

POWERPC_TBL_START_COUNT(altivec_idct_put_num, 1);

    void simple_idct_put(uint8_t *dest, int line_size, int16_t *block);

    simple_idct_put(dest, stride, (int16_t*)block);

POWERPC_TBL_STOP_COUNT(altivec_idct_put_num, 1);

#else 

    vector_u8_t tmp;



POWERPC_TBL_START_COUNT(altivec_idct_put_num, 1);



    IDCT



#define COPY(dest,src)						\

    tmp = vec_packsu (src, src);				\

    vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest);	\

    vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest);



    COPY (dest, vx0)	dest += stride;

    COPY (dest, vx1)	dest += stride;

    COPY (dest, vx2)	dest += stride;

    COPY (dest, vx3)	dest += stride;

    COPY (dest, vx4)	dest += stride;

    COPY (dest, vx5)	dest += stride;

    COPY (dest, vx6)	dest += stride;

    COPY (dest, vx7)



POWERPC_TBL_STOP_COUNT(altivec_idct_put_num, 1);

#endif 

}

void FUNC_0(uint8_t* VAR_0, int VAR_1, vector_s16_t* VAR_2)

{

POWERPC_TBL_DECLARE(altivec_idct_put_num, 1);

#ifdef ALTIVEC_USE_REFERENCE_C_CODE

POWERPC_TBL_START_COUNT(altivec_idct_put_num, 1);

    void simple_idct_put(uint8_t *VAR_0, int line_size, int16_t *VAR_2);

    simple_idct_put(VAR_0, VAR_1, (int16_t*)VAR_2);

POWERPC_TBL_STOP_COUNT(altivec_idct_put_num, 1);

#else 

    vector_u8_t tmp;



POWERPC_TBL_START_COUNT(altivec_idct_put_num, 1);



    IDCT



#define COPY(VAR_0,src)						\

    tmp = vec_packsu (src, src);				\

    vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)VAR_0);	\

    vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)VAR_0);



    COPY (VAR_0, vx0)	VAR_0 += VAR_1;

    COPY (VAR_0, vx1)	VAR_0 += VAR_1;

    COPY (VAR_0, vx2)	VAR_0 += VAR_1;

    COPY (VAR_0, vx3)	VAR_0 += VAR_1;

    COPY (VAR_0, vx4)	VAR_0 += VAR_1;

    COPY (VAR_0, vx5)	VAR_0 += VAR_1;

    COPY (VAR_0, vx6)	VAR_0 += VAR_1;

    COPY (VAR_0, vx7)



POWERPC_TBL_STOP_COUNT(altivec_idct_put_num, 1);

#endif 

}

void FUNC_0(uint8_t* VAR_0, int VAR_1, vector_s16_t* VAR_2)
{ POWERPC_TBL_DECLARE(altivec_idct_put_num, 1); #ifdef ALTIVEC_USE_REFERENCE_C_CODE
POWERPC_TBL_START_COUNT(altivec_idct_put_num, 1); void simple_idct_put(uint8_t *VAR_0, int line_size, int16_t *VAR_2); simple_idct_put(VAR_0, VAR_1, (int16_t*)VAR_2); POWERPC_TBL_STOP_COUNT(altivec_idct_put_num, 1); #else
vector_u8_t tmp; POWERPC_TBL_START_COUNT(altivec_idct_put_num, 1); IDCT
#define COPY(VAR_0,src)						\
tmp = vec_packsu (src, src);				\ vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)VAR_0);	\ vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)VAR_0); COPY (VAR_0, vx0)	VAR_0 += VAR_1; COPY (VAR_0, vx1)	VAR_0 += VAR_1; COPY (VAR_0, vx2)	VAR_0 += VAR_1; COPY (VAR_0, vx3)	VAR_0 += VAR_1; COPY (VAR_0, vx4)	VAR_0 += VAR_1; COPY (VAR_0, vx5)	VAR_0 += VAR_1; COPY (VAR_0, vx6)	VAR_0 += VAR_1; COPY (VAR_0, vx7)
POWERPC_TBL_STOP_COUNT(altivec_idct_put_num, 1); #endif
}