Mercurial > libavcodec.hg
comparison ppc/dsputil_altivec.c @ 3543:6aabb2bec46c libavcodec
vorbis_inverse_coupling_altivec
author | lu_zero |
---|---|
date | Thu, 03 Aug 2006 13:19:32 +0000 |
parents | 0937cc91b574 |
children | e2a589e55906 |
comparison
equal
deleted
inserted
replaced
3542:bdbe52f38868 | 3543:6aabb2bec46c |
---|---|
1696 #endif /* CONFIG_DARWIN */ | 1696 #endif /* CONFIG_DARWIN */ |
1697 return 0; | 1697 return 0; |
1698 #endif /* __AMIGAOS4__ */ | 1698 #endif /* __AMIGAOS4__ */ |
1699 } | 1699 } |
1700 | 1700 |
1701 static void vorbis_inverse_coupling_altivec(float *mag, float *ang, | |
1702 int blocksize) | |
1703 { | |
1704 int i; | |
1705 vector float m, a; | |
1706 vector bool int t0, t1; | |
1707 const vector unsigned int v_31 = //XXX | |
1708 vec_add(vec_add(vec_splat_u32(15),vec_splat_u32(15)),vec_splat_u32(1)); | |
1709 for(i=0; i<blocksize; i+=4) { | |
1710 m = vec_ld(0, mag+i); | |
1711 a = vec_ld(0, ang+i); | |
1712 t0 = vec_cmple(m, (vector float)vec_splat_u32(0)); | |
1713 t1 = vec_cmple(a, (vector float)vec_splat_u32(0)); | |
1714 a = vec_xor(a, vec_sl((vector unsigned int)t0, v_31)); // (a ^ sign(m)) | |
1715 t0 = vec_and(a, t1); | |
1716 t1 = vec_andc(a, t1); | |
1717 a = vec_add(m, t0); | |
1718 m = vec_sub(m, t1); | |
1719 vec_ste(a, 0, ang+i); | |
1720 vec_ste(m, 0, mag+i); | |
1721 } | |
1722 } | |
1723 | |
1701 /* next one assumes that ((line_size % 8) == 0) */ | 1724 /* next one assumes that ((line_size % 8) == 0) */ |
1702 void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) | 1725 void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
1703 { | 1726 { |
1704 POWERPC_PERF_DECLARE(altivec_avg_pixels8_xy2_num, 1); | 1727 POWERPC_PERF_DECLARE(altivec_avg_pixels8_xy2_num, 1); |
1705 #ifdef ALTIVEC_USE_REFERENCE_C_CODE | 1728 #ifdef ALTIVEC_USE_REFERENCE_C_CODE |