void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation)

{

  union {

  	signed short tmp[8] __attribute__ ((aligned(16)));

	vector signed short vec;

	} buf;



  buf.tmp[0] =  ( (0xffffLL) * contrast>>8 )>>9;			//cy

  buf.tmp[1] =  -256*brightness;					//oy

  buf.tmp[2] =  (inv_table[0]>>3) *(contrast>>16)*(saturation>>16);	//crv

  buf.tmp[3] =  (inv_table[1]>>3) *(contrast>>16)*(saturation>>16);	//cbu

  buf.tmp[4] = -((inv_table[2]>>1)*(contrast>>16)*(saturation>>16));	//cgu

  buf.tmp[5] = -((inv_table[3]>>1)*(contrast>>16)*(saturation>>16));	//cgv





  c->CSHIFT = (vector unsigned short)vec_splat_u16(2);

  c->CY  = vec_splat ((vector signed short)buf.vec, 0);

  c->OY  = vec_splat ((vector signed short)buf.vec, 1);

  c->CRV  = vec_splat ((vector signed short)buf.vec, 2);

  c->CBU  = vec_splat ((vector signed short)buf.vec, 3);

  c->CGU  = vec_splat ((vector signed short)buf.vec, 4);

  c->CGV  = vec_splat ((vector signed short)buf.vec, 5);

#if 0

{

int i;

char *v[6]={"cy","oy","crv","cbu","cgu","cgv"};

for (i=0; i<6;i++)

  printf("%s %d ", v[i],buf.tmp[i] );

  printf("\n");

}

#endif

 return;

}

void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation)

{

  union {

  	signed short tmp[8] __attribute__ ((aligned(16)));

	vector signed short vec;

	} buf;



  buf.tmp[0] =  ( (0xffffLL) * contrast>>8 )>>9;			

  buf.tmp[1] =  -256*brightness;					

  buf.tmp[2] =  (inv_table[0]>>3) *(contrast>>16)*(saturation>>16);	

  buf.tmp[3] =  (inv_table[1]>>3) *(contrast>>16)*(saturation>>16);	

  buf.tmp[4] = -((inv_table[2]>>1)*(contrast>>16)*(saturation>>16));	

  buf.tmp[5] = -((inv_table[3]>>1)*(contrast>>16)*(saturation>>16));	





  c->CSHIFT = (vector unsigned short)vec_splat_u16(2);

  c->CY  = vec_splat ((vector signed short)buf.vec, 0);

  c->OY  = vec_splat ((vector signed short)buf.vec, 1);

  c->CRV  = vec_splat ((vector signed short)buf.vec, 2);

  c->CBU  = vec_splat ((vector signed short)buf.vec, 3);

  c->CGU  = vec_splat ((vector signed short)buf.vec, 4);

  c->CGV  = vec_splat ((vector signed short)buf.vec, 5);

#if 0

{

int i;

char *v[6]={"cy","oy","crv","cbu","cgu","cgv"};

for (i=0; i<6;i++)

  printf("%s %d ", v[i],buf.tmp[i] );

  printf("\n");

}

#endif

 return;

}

  union {   	signed short tmp[8] __attribute__ ((aligned(16))); 	vector signed short vec; 	} buf;   c->CSHIFT = (vector unsigned short)vec_splat_u16(2);   c->CY  = vec_splat ((vector signed short)buf.vec, 0);   c->OY  = vec_splat ((vector signed short)buf.vec, 1);   c->CRV  = vec_splat ((vector signed short)buf.vec, 2);   c->CBU  = vec_splat ((vector signed short)buf.vec, 3);   c->CGU  = vec_splat ((vector signed short)buf.vec, 4);   c->CGV  = vec_splat ((vector signed short)buf.vec, 5); int i; char *v[6]={"cy","oy","crv","cbu","cgu","cgv"}; for (i=0; i<6;i++)   printf("%s %d ", v[i],buf.tmp[i] );   printf("\n");
void FUNC_0 (SwsContext *VAR_0, const int VAR_1[4],int VAR_2,int VAR_3, int VAR_4)

{

  union {

  	signed short tmp[8] __attribute__ ((aligned(16)));

	vector signed short vec;

	} VAR_5;



  VAR_5.tmp[0] =  ( (0xffffLL) * VAR_3>>8 )>>9;			

  VAR_5.tmp[1] =  -256*VAR_2;					

  VAR_5.tmp[2] =  (VAR_1[0]>>3) *(VAR_3>>16)*(VAR_4>>16);	

  VAR_5.tmp[3] =  (VAR_1[1]>>3) *(VAR_3>>16)*(VAR_4>>16);	

  VAR_5.tmp[4] = -((VAR_1[2]>>1)*(VAR_3>>16)*(VAR_4>>16));	

  VAR_5.tmp[5] = -((VAR_1[3]>>1)*(VAR_3>>16)*(VAR_4>>16));	





  VAR_0->CSHIFT = (vector unsigned short)vec_splat_u16(2);

  VAR_0->CY  = vec_splat ((vector signed short)VAR_5.vec, 0);

  VAR_0->OY  = vec_splat ((vector signed short)VAR_5.vec, 1);

  VAR_0->CRV  = vec_splat ((vector signed short)VAR_5.vec, 2);

  VAR_0->CBU  = vec_splat ((vector signed short)VAR_5.vec, 3);

  VAR_0->CGU  = vec_splat ((vector signed short)VAR_5.vec, 4);

  VAR_0->CGV  = vec_splat ((vector signed short)VAR_5.vec, 5);

#if 0

{

int i;

char *v[6]={"cy","oy","crv","cbu","cgu","cgv"};

for (i=0; i<6;i++)

  printf("%s %d ", v[i],VAR_5.tmp[i] );

  printf("\n");

}

#endif

 return;

}

void FUNC_0 (SwsContext *VAR_0, const int VAR_1[4],int VAR_2,int VAR_3, int VAR_4)
{ union { signed short tmp[8] __attribute__ ((aligned(16))); vector signed short vec; } VAR_5; VAR_5.tmp[0] =  ( (0xffffLL) * VAR_3>>8 )>>9; VAR_5.tmp[1] =  -256*VAR_2; VAR_5.tmp[2] =  (VAR_1[0]>>3) *(VAR_3>>16)*(VAR_4>>16); VAR_5.tmp[3] =  (VAR_1[1]>>3) *(VAR_3>>16)*(VAR_4>>16); VAR_5.tmp[4] = -((VAR_1[2]>>1)*(VAR_3>>16)*(VAR_4>>16)); VAR_5.tmp[5] = -((VAR_1[3]>>1)*(VAR_3>>16)*(VAR_4>>16)); VAR_0->CSHIFT = (vector unsigned short)vec_splat_u16(2); VAR_0->CY  = vec_splat ((vector signed short)VAR_5.vec, 0); VAR_0->OY  = vec_splat ((vector signed short)VAR_5.vec, 1); VAR_0->CRV  = vec_splat ((vector signed short)VAR_5.vec, 2); VAR_0->CBU  = vec_splat ((vector signed short)VAR_5.vec, 3); VAR_0->CGU  = vec_splat ((vector signed short)VAR_5.vec, 4); VAR_0->CGV  = vec_splat ((vector signed short)VAR_5.vec, 5); #if 0
{ int i; char *v[6]={"cy","oy","crv","cbu","cgu","cgv"}; for (i=0; i<6;i++) printf("%s %d ", v[i],VAR_5.tmp[i] ); printf("\n"); } #endif
return; }