35 static int pix_norm1_altivec(
uint8_t *pix,
int line_size)
38 const vector
unsigned int zero =
39 (
const vector
unsigned int) vec_splat_u32(0);
40 vector
unsigned int sv = (vector
unsigned int) vec_splat_u32(0);
41 vector
signed int sum;
43 for (i = 0; i < 16; i++) {
48 vector
unsigned char pixv = vec_vsx_ld(0, pix);
51 sv = vec_msum(pixv, pixv, sv);
56 sum = vec_sums((vector
signed int) sv, (vector
signed int) zero);
57 sum = vec_splat(sum, 3);
62 static int pix_norm1_altivec(
uint8_t *pix,
int line_size)
65 const vector
unsigned int zero =
66 (
const vector
unsigned int) vec_splat_u32(0);
67 vector
unsigned char perm = vec_lvsl(0, pix);
68 vector
unsigned int sv = (vector
unsigned int) vec_splat_u32(0);
69 vector
signed int sum;
71 for (i = 0; i < 16; i++) {
73 vector
unsigned char pixl = vec_ld(0, pix);
74 vector
unsigned char pixr = vec_ld(15, pix);
75 vector
unsigned char pixv = vec_perm(pixl, pixr, perm);
78 sv = vec_msum(pixv, pixv, sv);
83 sum = vec_sums((vector
signed int) sv, (vector
signed int) zero);
84 sum = vec_splat(sum, 3);
92 static int pix_sum_altivec(
uint8_t *pix,
int line_size)
95 const vector
unsigned int zero =
96 (
const vector
unsigned int) vec_splat_u32(0);
97 vector
unsigned int sad = (vector
unsigned int) vec_splat_u32(0);
98 vector
signed int sumdiffs;
100 for (i = 0; i < 16; i++) {
105 vector
unsigned char t1 = vec_vsx_ld(0, pix);
108 sad = vec_sum4s(t1, sad);
114 sumdiffs = vec_sums((vector
signed int) sad, (vector
signed int) zero);
115 sumdiffs = vec_splat(sumdiffs, 3);
116 vec_ste(sumdiffs, 0, &s);
120 static int pix_sum_altivec(
uint8_t *pix,
int line_size)
123 const vector
unsigned int zero =
124 (
const vector
unsigned int) vec_splat_u32(0);
125 vector
unsigned char perm = vec_lvsl(0, pix);
126 vector
unsigned int sad = (vector
unsigned int) vec_splat_u32(0);
127 vector
signed int sumdiffs;
129 for (i = 0; i < 16; i++) {
131 vector
unsigned char pixl = vec_ld(0, pix);
132 vector
unsigned char pixr = vec_ld(15, pix);
133 vector
unsigned char t1 = vec_perm(pixl, pixr, perm);
136 sad = vec_sum4s(t1, sad);
142 sumdiffs = vec_sums((vector
signed int) sad, (vector
signed int) zero);
143 sumdiffs = vec_splat(sumdiffs, 3);
144 vec_ste(sumdiffs, 0, &s);
av_cold void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
Macro definitions for various function/variable attributes.
#define PPC_ALTIVEC(flags)
int(* pix_sum)(uint8_t *pix, int line_size)
main external API structure.
int(* pix_norm1)(uint8_t *pix, int line_size)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Contains misc utility macros and inline functions.