Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
d0bf20a4
Commit
d0bf20a4
authored
May 12, 2015
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc: vsx: Implement diff_pixels and get_pixels
Use a macro to abstract the endianness.
parent
eecd29b3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
pixblockdsp.c
libavcodec/ppc/pixblockdsp.c
+44
-0
util_altivec.h
libavutil/ppc/util_altivec.h
+12
-0
No files found.
libavcodec/ppc/pixblockdsp.c
View file @
d0bf20a4
...
...
@@ -133,6 +133,40 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
#endif
/* HAVE_ALTIVEC */
#if HAVE_VSX
static
void
get_pixels_vsx
(
int16_t
*
restrict
block
,
const
uint8_t
*
pixels
,
int
line_size
)
{
int
i
;
for
(
i
=
0
;
i
<
8
;
i
++
)
{
vec_s16
shorts
=
vsx_ld_u8_s16
(
0
,
pixels
);
vec_vsx_st
(
shorts
,
i
*
16
,
block
);
pixels
+=
line_size
;
}
}
static
void
diff_pixels_vsx
(
int16_t
*
restrict
block
,
const
uint8_t
*
s1
,
const
uint8_t
*
s2
,
int
stride
)
{
int
i
;
vec_s16
shorts1
,
shorts2
;
for
(
i
=
0
;
i
<
8
;
i
++
)
{
shorts1
=
vsx_ld_u8_s16
(
0
,
s1
);
shorts2
=
vsx_ld_u8_s16
(
0
,
s2
);
shorts1
=
vec_sub
(
shorts1
,
shorts2
);
vec_vsx_st
(
shorts1
,
0
,
block
);
s1
+=
stride
;
s2
+=
stride
;
block
+=
8
;
}
}
#endif
/* HAVE_VSX */
av_cold
void
ff_pixblockdsp_init_ppc
(
PixblockDSPContext
*
c
,
AVCodecContext
*
avctx
,
unsigned
high_bit_depth
)
...
...
@@ -147,4 +181,14 @@ av_cold void ff_pixblockdsp_init_ppc(PixblockDSPContext *c,
c
->
get_pixels
=
get_pixels_altivec
;
}
#endif
/* HAVE_ALTIVEC */
#if HAVE_VSX
if
(
!
PPC_VSX
(
av_get_cpu_flags
()))
return
;
c
->
diff_pixels
=
diff_pixels_vsx
;
if
(
!
high_bit_depth
)
c
->
get_pixels
=
get_pixels_vsx
;
#endif
/* HAVE_VSX */
}
libavutil/ppc/util_altivec.h
View file @
d0bf20a4
...
...
@@ -111,4 +111,16 @@ static inline vec_u8 load_with_perm_vec(int offset, uint8_t *src, vec_u8 perm_ve
#endif
/* HAVE_ALTIVEC */
#if HAVE_VSX
#if HAVE_BIGENDIAN
#define vsx_ld_u8_s16(off, p) \
((vec_s16)vec_mergeh((vec_u8)vec_splat_u8(0), \
(vec_u8)vec_vsx_ld((off), (p))))
#else
#define vsx_ld_u8_s16(off, p) \
((vec_s16)vec_mergeh((vec_u8)vec_vsx_ld((off), (p)), \
(vec_u8)vec_splat_u8(0)))
#endif
/* HAVE_BIGENDIAN */
#endif
/* HAVE_VSX */
#endif
/* AVUTIL_PPC_UTIL_ALTIVEC_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment