mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
simplify the init
Originally committed as revision 12838 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
This commit is contained in:
parent
84fdd6421f
commit
95d45b1e64
@ -564,58 +564,28 @@ SwsFunc yuv2rgb_init_altivec (SwsContext *c)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4])
|
void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4])
|
||||||
{
|
{
|
||||||
vector signed short
|
vector signed short CY, CRV, CBU, CGU, CGV, OY, Y0;
|
||||||
CY = (vector signed short)(0x7fff),
|
int64_t crv __attribute__ ((aligned(16))) = inv_table[0];
|
||||||
CRV = (vector signed short)(22972),
|
int64_t cbu __attribute__ ((aligned(16))) = inv_table[1];
|
||||||
CBU = (vector signed short)(29029),
|
int64_t cgu __attribute__ ((aligned(16))) = inv_table[2];
|
||||||
CGU = (vector signed short)(-11276),
|
int64_t cgv __attribute__ ((aligned(16))) = inv_table[3];
|
||||||
CGV = (vector signed short)(-23400),
|
int64_t cy = (1<<16)-1;
|
||||||
OY;
|
int64_t oy = 0;
|
||||||
|
|
||||||
vector signed short Y0;
|
|
||||||
int brightness = c->brightness, contrast = c->contrast, saturation = c->saturation;
|
|
||||||
int64_t crv __attribute__ ((aligned(16)));
|
|
||||||
int64_t cbu __attribute__ ((aligned(16)));
|
|
||||||
int64_t cgu __attribute__ ((aligned(16)));
|
|
||||||
int64_t cgv __attribute__ ((aligned(16)));
|
|
||||||
short tmp __attribute__ ((aligned(16)));
|
short tmp __attribute__ ((aligned(16)));
|
||||||
|
|
||||||
int64_t cy = (1<<16)-1;
|
|
||||||
int64_t oy = 0;
|
|
||||||
|
|
||||||
if ((c->flags & SWS_CPU_CAPS_ALTIVEC) == 0)
|
if ((c->flags & SWS_CPU_CAPS_ALTIVEC) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
crv = inv_table[0];
|
cy = (cy *c->contrast )>>17;
|
||||||
cbu = inv_table[1];
|
crv= (crv*c->contrast * c->saturation)>>32;
|
||||||
cgu = inv_table[2];
|
cbu= (cbu*c->contrast * c->saturation)>>32;
|
||||||
cgv = inv_table[3];
|
cgu= (cgu*c->contrast * c->saturation)>>32;
|
||||||
|
cgv= (cgv*c->contrast * c->saturation)>>32;
|
||||||
|
|
||||||
#if 0
|
oy -= 256*c->brightness;
|
||||||
printf ("crv: %hvx\n", CRV);
|
|
||||||
printf ("cbu: %hvx\n", CBU);
|
|
||||||
printf ("cgv: %hvx\n", CGV);
|
|
||||||
printf ("cgu: %hvx\n", CGU);
|
|
||||||
|
|
||||||
printf ("contrast: %d, brightness: %d, saturation: %d\n", contrast, brightness, saturation);
|
|
||||||
|
|
||||||
printf("%lld %lld %lld %lld %lld\n", cy, crv, cbu, cgu, cgv);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cy = (cy *contrast )>>17;
|
|
||||||
crv= (crv*contrast * saturation)>>32;
|
|
||||||
cbu= (cbu*contrast * saturation)>>32;
|
|
||||||
cgu= (cgu*contrast * saturation)>>32;
|
|
||||||
cgv= (cgv*contrast * saturation)>>32;
|
|
||||||
|
|
||||||
oy -= 256*brightness;
|
|
||||||
|
|
||||||
//printf("%llx %llx %llx %llx %llx\n", cy, crv, cbu, cgu, cgv);
|
|
||||||
|
|
||||||
// vector signed short CBU,CRV,CGU,CGY,CY;
|
|
||||||
tmp = cy;
|
tmp = cy;
|
||||||
CY = vec_lde (0, &tmp);
|
CY = vec_lde (0, &tmp);
|
||||||
CY = vec_splat (CY, 0);
|
CY = vec_splat (CY, 0);
|
||||||
@ -827,5 +797,3 @@ altivec_yuv2packedX (SwsContext *c,
|
|||||||
if (vCCoeffsBank) free (vCCoeffsBank);
|
if (vCCoeffsBank) free (vCCoeffsBank);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user