36 #if HAVE_ALTIVEC && HAVE_BIGENDIAN 42 vec_u8 perm = vec_lvsl(0, pixels);
45 for (i = 0; i < 8; i++) {
49 vec_u8 pixl = vec_ld(0, pixels);
50 vec_u8 pixr = vec_ld(7, pixels);
51 vec_u8 bytes = vec_perm(pixl, pixr, perm);
57 vec_st(shorts, i * 16, (
vec_s16 *)block);
63 static void diff_pixels_altivec(int16_t *
restrict block,
const uint8_t *s1,
67 vec_u8 perm1 = vec_lvsl(0, s1);
68 vec_u8 perm2 = vec_lvsl(0, s2);
72 for (i = 0; i < 4; i++) {
76 vec_u8 pixl = vec_ld(0, s1);
77 vec_u8 pixr = vec_ld(15, s1);
78 vec_u8 bytes = vec_perm(pixl, pixr, perm1);
81 shorts1 = (
vec_s16)vec_mergeh(zero, bytes);
85 pixr = vec_ld(15, s2);
86 bytes = vec_perm(pixl, pixr, perm2);
89 shorts2 = (
vec_s16)vec_mergeh(zero, bytes);
92 shorts1 = vec_sub(shorts1, shorts2);
95 vec_st(shorts1, 0, (
vec_s16 *)block);
107 pixl = vec_ld(0, s1);
108 pixr = vec_ld(15, s1);
109 bytes = vec_perm(pixl, pixr, perm1);
112 shorts1 = (
vec_s16)vec_mergeh(zero, bytes);
115 pixl = vec_ld(0, s2);
116 pixr = vec_ld(15, s2);
117 bytes = vec_perm(pixl, pixr, perm2);
120 shorts2 = (
vec_s16)vec_mergeh(zero, bytes);
123 shorts1 = vec_sub(shorts1, shorts2);
126 vec_st(shorts1, 0, (
vec_s16 *)block);
137 static void get_pixels_vsx(int16_t *
restrict block,
const uint8_t *pixels,
141 for (i = 0; i < 8; i++) {
142 vec_s16 shorts = vsx_ld_u8_s16(0, pixels);
144 vec_vsx_st(shorts, i * 16, block);
150 static void diff_pixels_vsx(int16_t *
restrict block,
const uint8_t *s1,
155 for (i = 0; i < 8; i++) {
156 shorts1 = vsx_ld_u8_s16(0, s1);
157 shorts2 = vsx_ld_u8_s16(0, s2);
159 shorts1 = vec_sub(shorts1, shorts2);
161 vec_vsx_st(shorts1, 0, block);
172 unsigned high_bit_depth)
174 #if HAVE_ALTIVEC && HAVE_BIGENDIAN 180 if (!high_bit_depth) {
Macro definitions for various function/variable attributes.
av_cold void ff_pixblockdsp_init_ppc(PixblockDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
void(* diff_pixels)(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride)
void(* get_pixels)(int16_t *block, const uint8_t *pixels, int line_size)
#define PPC_ALTIVEC(flags)
Libavcodec external API header.
main external API structure.
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Contains misc utility macros and inline functions.