43 vector
unsigned char perm =
44 (vector
unsigned char) {0x00,0x10, 0x01,0x11,0x02,0x12,0x03,0x13,\
45 0x04,0x14,0x05,0x15,0x06,0x16,0x07,0x17};
46 const vector
unsigned char zero =
47 (
const vector
unsigned char) vec_splat_u8(0);
49 for (i = 0; i < 8; i++) {
53 vector
unsigned char bytes = vec_vsx_ld(0, pixels);
57 vector
signed short shorts = (vector
signed short) vec_perm(bytes, zero, perm);
60 vec_vsx_st(shorts, i * 16, (vector
signed short *) block);
66 static void get_pixels_altivec(int16_t *restrict block,
const uint8_t *pixels,
70 vec_u8 perm = vec_lvsl(0, pixels);
73 for (i = 0; i < 8; i++) {
77 vec_u8 pixl = vec_ld(0, pixels);
78 vec_u8 pixr = vec_ld(7, pixels);
79 vec_u8 bytes = vec_perm(pixl, pixr, perm);
85 vec_st(shorts, i * 16, (
vec_s16 *)block);
94 static void diff_pixels_altivec(int16_t *restrict block,
const uint8_t *
s1,
98 const vector
unsigned char zero =
99 (
const vector
unsigned char) vec_splat_u8(0);
100 vector
signed short shorts1, shorts2;
102 for (i = 0; i < 4; i++) {
106 vector
unsigned char bytes = vec_vsx_ld(0, s1);
109 shorts1 = (vector
signed short) vec_mergeh(bytes, zero);
112 bytes =vec_vsx_ld(0, s2);
115 shorts2 = (vector
signed short) vec_mergeh(bytes, zero);
118 shorts1 = vec_sub(shorts1, shorts2);
121 vec_vsx_st(shorts1, 0, (vector
signed short *) block);
133 bytes = vec_vsx_ld(0, s1);
136 shorts1 = (vector
signed short) vec_mergeh(bytes, zero);
139 bytes = vec_vsx_ld(0, s2);
142 shorts2 = (vector
signed short) vec_mergeh(bytes, zero);
145 shorts1 = vec_sub(shorts1, shorts2);
148 vec_vsx_st(shorts1, 0, (vector
signed short *) block);
156 static void diff_pixels_altivec(int16_t *restrict block,
const uint8_t *s1,
160 vec_u8 perm1 = vec_lvsl(0, s1);
161 vec_u8 perm2 = vec_lvsl(0, s2);
165 for (i = 0; i < 4; i++) {
169 vec_u8 pixl = vec_ld(0, s1);
170 vec_u8 pixr = vec_ld(15, s1);
171 vec_u8 bytes = vec_perm(pixl, pixr, perm1);
174 shorts1 = (
vec_s16)vec_mergeh(zero, bytes);
177 pixl = vec_ld(0, s2);
178 pixr = vec_ld(15, s2);
179 bytes = vec_perm(pixl, pixr, perm2);
182 shorts2 = (
vec_s16)vec_mergeh(zero, bytes);
185 shorts1 = vec_sub(shorts1, shorts2);
188 vec_st(shorts1, 0, (
vec_s16 *)block);
200 pixl = vec_ld(0, s1);
201 pixr = vec_ld(15, s1);
202 bytes = vec_perm(pixl, pixr, perm1);
205 shorts1 = (
vec_s16)vec_mergeh(zero, bytes);
208 pixl = vec_ld(0, s2);
209 pixr = vec_ld(15, s2);
210 bytes = vec_perm(pixl, pixr, perm2);
213 shorts2 = (
vec_s16)vec_mergeh(zero, bytes);
216 shorts1 = vec_sub(shorts1, shorts2);
219 vec_st(shorts1, 0, (
vec_s16 *)block);
232 static void get_pixels_vsx(int16_t *restrict block,
const uint8_t *pixels,
236 for (i = 0; i < 8; i++) {
237 vec_s16 shorts = vsx_ld_u8_s16(0, pixels);
239 vec_vsx_st(shorts, i * 16, block);
245 static void diff_pixels_vsx(int16_t *restrict block,
const uint8_t *s1,
250 for (i = 0; i < 8; i++) {
251 shorts1 = vsx_ld_u8_s16(0, s1);
252 shorts2 = vsx_ld_u8_s16(0, s2);
254 shorts1 = vec_sub(shorts1, shorts2);
256 vec_vsx_st(shorts1, 0, block);
267 unsigned high_bit_depth)
275 if (!high_bit_depth) {
Macro definitions for various function/variable attributes.
void(* get_pixels)(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size)
av_cold void ff_pixblockdsp_init_ppc(PixblockDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
#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.
GLint GLenum GLboolean GLsizei stride
void(* diff_pixels)(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride)