Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
7bdcbe8a
Commit
7bdcbe8a
authored
Aug 02, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for AltiVec at build-time if possible (untested)
parent
b830aae4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
17 deletions
+20
-17
include/vlc_cpu.h
include/vlc_cpu.h
+7
-1
modules/codec/libmpeg2.c
modules/codec/libmpeg2.c
+1
-1
modules/video_chroma/i420_yuy2.c
modules/video_chroma/i420_yuy2.c
+5
-7
modules/video_filter/deinterlace/deinterlace.c
modules/video_filter/deinterlace/deinterlace.c
+1
-1
modules/video_filter/postproc.c
modules/video_filter/postproc.c
+1
-1
modules/video_filter/swscale.c
modules/video_filter/swscale.c
+1
-1
src/misc/cpu.c
src/misc/cpu.c
+3
-4
src/posix/linux_cpu.c
src/posix/linux_cpu.c
+1
-1
No files found.
include/vlc_cpu.h
View file @
7bdcbe8a
...
@@ -59,7 +59,13 @@ VLC_API unsigned vlc_CPU(void);
...
@@ -59,7 +59,13 @@ VLC_API unsigned vlc_CPU(void);
# elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
# elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
# define HAVE_FPU 1
# define HAVE_FPU 1
# define CPU_CAPABILITY_ALTIVEC (1<<16)
# define VLC_CPU_ALTIVEC 2
# ifdef ALTIVEC
# define vlc_CPU_ALTIVEC() (1)
# else
# define vlc_CPU_ALTIVEC() ((vlc_CPU() & VLC_CPU_ALTIVEC) != 0)
# endif
# elif defined (__arm__)
# elif defined (__arm__)
# if defined (__VFP_FP__) && !defined (__SOFTFP__)
# if defined (__VFP_FP__) && !defined (__SOFTFP__)
...
...
modules/codec/libmpeg2.c
View file @
7bdcbe8a
...
@@ -200,7 +200,7 @@ static int OpenDecoder( vlc_object_t *p_this )
...
@@ -200,7 +200,7 @@ static int OpenDecoder( vlc_object_t *p_this )
if
(
cpu
&
CPU_CAPABILITY_MMXEXT
)
if
(
cpu
&
CPU_CAPABILITY_MMXEXT
)
i_accel
|=
MPEG2_ACCEL_X86_MMXEXT
;
i_accel
|=
MPEG2_ACCEL_X86_MMXEXT
;
#elif defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc64__ )
#elif defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc64__ )
if
(
vlc_CPU
()
&
CPU_CAPABILITY_ALTIVEC
)
if
(
vlc_CPU
_ALTIVEC
()
)
i_accel
|=
MPEG2_ACCEL_PPC_ALTIVEC
;
i_accel
|=
MPEG2_ACCEL_PPC_ALTIVEC
;
#elif defined(__arm__)
#elif defined(__arm__)
...
...
modules/video_chroma/i420_yuy2.c
View file @
7bdcbe8a
...
@@ -88,20 +88,20 @@ vlc_module_begin ()
...
@@ -88,20 +88,20 @@ vlc_module_begin ()
#if defined (MODULE_NAME_IS_i420_yuy2)
#if defined (MODULE_NAME_IS_i420_yuy2)
set_description
(
N_
(
"Conversions from "
SRC_FOURCC
" to "
DEST_FOURCC
)
)
set_description
(
N_
(
"Conversions from "
SRC_FOURCC
" to "
DEST_FOURCC
)
)
set_capability
(
"video filter2"
,
80
)
set_capability
(
"video filter2"
,
80
)
# define
CPU_CAPABILITY 0
# define
vlc_CPU_capable() (1)
#elif defined (MODULE_NAME_IS_i420_yuy2_mmx)
#elif defined (MODULE_NAME_IS_i420_yuy2_mmx)
set_description
(
N_
(
"MMX conversions from "
SRC_FOURCC
" to "
DEST_FOURCC
)
)
set_description
(
N_
(
"MMX conversions from "
SRC_FOURCC
" to "
DEST_FOURCC
)
)
set_capability
(
"video filter2"
,
160
)
set_capability
(
"video filter2"
,
160
)
# define
CPU_CAPABILITY CPU_CAPABILITY_MMX
# define
vlc_CPU_capable() (vlc_CPU() & CPU_CAPABILITY_MMX)
#elif defined (MODULE_NAME_IS_i420_yuy2_sse2)
#elif defined (MODULE_NAME_IS_i420_yuy2_sse2)
set_description
(
N_
(
"SSE2 conversions from "
SRC_FOURCC
" to "
DEST_FOURCC
)
)
set_description
(
N_
(
"SSE2 conversions from "
SRC_FOURCC
" to "
DEST_FOURCC
)
)
set_capability
(
"video filter2"
,
250
)
set_capability
(
"video filter2"
,
250
)
# define
CPU_CAPABILITY CPU_CAPABILITY_SSE2
# define
vlc_CPU_capable() (vlc_CPU() & CPU_CAPABILITY_SSE2)
#elif defined (MODULE_NAME_IS_i420_yuy2_altivec)
#elif defined (MODULE_NAME_IS_i420_yuy2_altivec)
set_description
(
set_description
(
_
(
"AltiVec conversions from "
SRC_FOURCC
" to "
DEST_FOURCC
)
);
_
(
"AltiVec conversions from "
SRC_FOURCC
" to "
DEST_FOURCC
)
);
set_capability
(
"video filter2"
,
250
)
set_capability
(
"video filter2"
,
250
)
# define
CPU_CAPABILITY CPU_CAPABILITY_ALTIVEC
# define
vlc_CPU_capable() (vlc_CPU_ALTIVEC())
#endif
#endif
set_callbacks
(
Activate
,
NULL
)
set_callbacks
(
Activate
,
NULL
)
vlc_module_end
()
vlc_module_end
()
...
@@ -115,10 +115,8 @@ static int Activate( vlc_object_t *p_this )
...
@@ -115,10 +115,8 @@ static int Activate( vlc_object_t *p_this )
{
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
#if CPU_CAPABILITY
if
(
!
vlc_CPU_capable
()
)
if
(
!
(
vlc_CPU
()
&
CPU_CAPABILITY
)
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
#endif
if
(
p_filter
->
fmt_in
.
video
.
i_width
&
1
if
(
p_filter
->
fmt_in
.
video
.
i_width
&
1
||
p_filter
->
fmt_in
.
video
.
i_height
&
1
)
||
p_filter
->
fmt_in
.
video
.
i_height
&
1
)
{
{
...
...
modules/video_filter/deinterlace/deinterlace.c
View file @
7bdcbe8a
...
@@ -628,7 +628,7 @@ int Open( vlc_object_t *p_this )
...
@@ -628,7 +628,7 @@ int Open( vlc_object_t *p_this )
IVTCClearState
(
p_filter
);
IVTCClearState
(
p_filter
);
#if defined(CAN_COMPILE_C_ALTIVEC)
#if defined(CAN_COMPILE_C_ALTIVEC)
if
(
chroma
->
pixel_size
==
1
&&
(
vlc_CPU
()
&
CPU_CAPABILITY_ALTIVEC
)
)
if
(
chroma
->
pixel_size
==
1
&&
vlc_CPU_ALTIVEC
(
)
)
{
{
p_sys
->
pf_merge
=
MergeAltivec
;
p_sys
->
pf_merge
=
MergeAltivec
;
p_sys
->
pf_end_merge
=
NULL
;
p_sys
->
pf_end_merge
=
NULL
;
...
...
modules/video_filter/postproc.c
View file @
7bdcbe8a
...
@@ -142,7 +142,7 @@ static int OpenPostproc( vlc_object_t *p_this )
...
@@ -142,7 +142,7 @@ static int OpenPostproc( vlc_object_t *p_this )
if
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
if
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
i_flags
|=
PP_CPU_CAPS_3DNOW
;
i_flags
|=
PP_CPU_CAPS_3DNOW
;
#elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
#elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
if
(
vlc_CPU
()
&
CPU_CAPABILITY_ALTIVEC
)
if
(
vlc_CPU
_ALTIVEC
()
)
i_flags
|=
PP_CPU_CAPS_ALTIVEC
;
i_flags
|=
PP_CPU_CAPS_ALTIVEC
;
#endif
#endif
...
...
modules/video_filter/swscale.c
View file @
7bdcbe8a
...
@@ -242,7 +242,7 @@ static int GetSwsCpuMask(void)
...
@@ -242,7 +242,7 @@ static int GetSwsCpuMask(void)
if
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
if
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
i_sws_cpu
|=
SWS_CPU_CAPS_3DNOW
;
i_sws_cpu
|=
SWS_CPU_CAPS_3DNOW
;
#elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
#elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
if
(
vlc_CPU
()
&
CPU_CAPABILITY_ALTIVEC
)
if
(
vlc_CPU
_ALTIVEC
()
)
i_sws_cpu
|=
SWS_CPU_CAPS_ALTIVEC
;
i_sws_cpu
|=
SWS_CPU_CAPS_ALTIVEC
;
#endif
#endif
...
...
src/misc/cpu.c
View file @
7bdcbe8a
...
@@ -308,11 +308,11 @@ out:
...
@@ -308,11 +308,11 @@ out:
int
i_error
=
sysctl
(
selectors
,
2
,
&
i_has_altivec
,
&
i_length
,
NULL
,
0
);
int
i_error
=
sysctl
(
selectors
,
2
,
&
i_has_altivec
,
&
i_length
,
NULL
,
0
);
if
(
i_error
==
0
&&
i_has_altivec
!=
0
)
if
(
i_error
==
0
&&
i_has_altivec
!=
0
)
i_capabilities
|=
CPU_CAPABILITY
_ALTIVEC
;
i_capabilities
|=
VLC_CPU
_ALTIVEC
;
# elif defined( CAN_COMPILE_ALTIVEC )
# elif defined( CAN_COMPILE_ALTIVEC )
if
(
vlc_CPU_check
(
"Altivec"
,
Altivec_test
))
if
(
vlc_CPU_check
(
"Altivec"
,
Altivec_test
))
i_capabilities
|=
CPU_CAPABILITY
_ALTIVEC
;
i_capabilities
|=
VLC_CPU
_ALTIVEC
;
# endif
# endif
...
@@ -364,8 +364,7 @@ void vlc_CPU_dump (vlc_object_t *obj)
...
@@ -364,8 +364,7 @@ void vlc_CPU_dump (vlc_object_t *obj)
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE4A
,
"SSE4A"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE4A
,
"SSE4A"
);
#elif defined (__powerpc__) || defined (__ppc__) || defined (__ppc64__)
#elif defined (__powerpc__) || defined (__ppc__) || defined (__ppc64__)
if
(
vlc_CPU
()
&
CPU_CAPABILITY_ALTIVEC
)
if
(
vlc_CPU_ALTIVEC
())
p
+=
sprintf
(
p
,
"AltiVec"
);
p
+=
sprintf
(
p
,
"AltiVec"
);
#elif defined (__arm__)
#elif defined (__arm__)
if
(
vlc_CPU_ARM_NEON
())
p
+=
sprintf
(
p
,
"ARM_NEON "
);
if
(
vlc_CPU_ARM_NEON
())
p
+=
sprintf
(
p
,
"ARM_NEON "
);
...
...
src/posix/linux_cpu.c
View file @
7bdcbe8a
...
@@ -106,7 +106,7 @@ static void vlc_CPU_init (void)
...
@@ -106,7 +106,7 @@ static void vlc_CPU_init (void)
#elif defined (__powerpc__) || defined (__powerpc64__)
#elif defined (__powerpc__) || defined (__powerpc64__)
if
(
!
strcmp
(
cap
,
"altivec supported"
))
if
(
!
strcmp
(
cap
,
"altivec supported"
))
core_caps
|=
CPU_CAPABILITY
_ALTIVEC
;
core_caps
|=
VLC_CPU
_ALTIVEC
;
#endif
#endif
}
}
...
...
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