Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
b1a07894
Commit
b1a07894
authored
Aug 04, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for 3D Now! at build time
parent
0ed12fd6
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
18 additions
and
30 deletions
+18
-30
include/vlc_cpu.h
include/vlc_cpu.h
+7
-1
modules/codec/avcodec/avcodec.c
modules/codec/avcodec/avcodec.c
+1
-1
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+1
-1
modules/codec/libmpeg2.c
modules/codec/libmpeg2.c
+1
-1
modules/stream_out/switcher.c
modules/stream_out/switcher.c
+2
-4
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
+2
-9
src/posix/linux_cpu.c
src/posix/linux_cpu.c
+1
-10
No files found.
include/vlc_cpu.h
View file @
b1a07894
...
...
@@ -31,7 +31,7 @@ VLC_API unsigned vlc_CPU(void);
# if defined (__i386__) || defined (__x86_64__)
# define HAVE_FPU 1
# define VLC_CPU_MMX 8
# define
CPU_CAPABILITY_3DNOW (1<<4)
# define
VLC_CPU_3dNOW 16
# define VLC_CPU_MMXEXT 32
# define VLC_CPU_SSE 64
# define VLC_CPU_SSE2 128
...
...
@@ -103,6 +103,12 @@ VLC_API unsigned vlc_CPU(void);
# define vlc_CPU_SSE4A() ((vlc_CPU() & VLC_CPU_SSE4A) != 0)
# endif
# ifdef __3dNOW__
# define vlc_CPU_3dNOW() (1)
# else
# define vlc_CPU_3dNOW() ((vlc_CPU() & VLC_CPU_3dNOW) != 0)
# endif
# elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
# define HAVE_FPU 1
# define VLC_CPU_ALTIVEC 2
...
...
modules/codec/avcodec/avcodec.c
View file @
b1a07894
...
...
@@ -335,7 +335,7 @@ static int OpenDecoder( vlc_object_t *p_this )
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
if
(
!
vlc_CPU_MMXEXT
()
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
if
(
!
(
vlc_CPU
()
&
CPU_CAPABILITY_3DNOW
)
)
if
(
!
vlc_CPU_3dNOW
(
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
if
(
!
vlc_CPU_SSE
()
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
...
...
modules/codec/avcodec/encoder.c
View file @
b1a07894
...
...
@@ -329,7 +329,7 @@ int OpenEncoder( vlc_object_t *p_this )
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
if
(
!
vlc_CPU_MMXEXT
()
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
if
(
!
(
vlc_CPU
()
&
CPU_CAPABILITY_3DNOW
)
)
if
(
!
vlc_CPU_3dNOW
(
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
if
(
!
vlc_CPU_SSE
()
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
...
...
modules/codec/libmpeg2.c
View file @
b1a07894
...
...
@@ -195,7 +195,7 @@ static int OpenDecoder( vlc_object_t *p_this )
unsigned
cpu
=
vlc_CPU
();
if
(
vlc_CPU_MMX
()
)
i_accel
|=
MPEG2_ACCEL_X86_MMX
;
if
(
cpu
&
CPU_CAPABILITY_3DNOW
)
if
(
vlc_CPU_3dNOW
()
)
i_accel
|=
MPEG2_ACCEL_X86_3DNOW
;
if
(
vlc_CPU_MMXEXT
()
)
i_accel
|=
MPEG2_ACCEL_X86_MMXEXT
;
...
...
modules/stream_out/switcher.c
View file @
b1a07894
...
...
@@ -380,12 +380,11 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
/* Set CPU capabilities */
id
->
ff_enc_c
->
dsp_mask
=
0
;
#if defined (__i386__) || defined (__x86_64__)
unsigned
i_cpu
=
vlc_CPU
();
if
(
!
vlc_CPU_MMX
()
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
if
(
!
vlc_CPU_MMXEXT
()
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
if
(
!
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
if
(
!
vlc_CPU_3dNOW
(
)
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
if
(
!
vlc_CPU_SSE
()
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
...
...
@@ -801,12 +800,11 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
/* Set CPU capabilities */
id
->
ff_enc_c
->
dsp_mask
=
0
;
#if defined (__i386__) || defined (__x86_64__)
unsigned
i_cpu
=
vlc_CPU
();
if
(
!
vlc_CPU_MMX
()
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
if
(
!
vlc_CPU_MMXEXT
()
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
if
(
!
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
if
(
!
vlc_CPU_3dNOW
(
)
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
if
(
!
vlc_CPU_SSE
()
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
...
...
modules/video_filter/deinterlace/deinterlace.c
View file @
b1a07894
...
...
@@ -649,7 +649,7 @@ int Open( vlc_object_t *p_this )
else
#endif
#if defined(CAN_COMPILE_3DNOW)
if
(
chroma
->
pixel_size
==
1
&&
(
vlc_CPU
()
&
CPU_CAPABILITY_3DNOW
)
)
if
(
chroma
->
pixel_size
==
1
&&
vlc_CPU_3dNOW
(
)
)
{
p_sys
->
pf_merge
=
Merge3DNow
;
p_sys
->
pf_end_merge
=
End3DNow
;
...
...
modules/video_filter/postproc.c
View file @
b1a07894
...
...
@@ -138,7 +138,7 @@ static int OpenPostproc( vlc_object_t *p_this )
i_flags
|=
PP_CPU_CAPS_MMX
;
if
(
vlc_CPU_MMXEXT
()
)
i_flags
|=
PP_CPU_CAPS_MMX2
;
if
(
vlc_CPU
()
&
CPU_CAPABILITY_3DNOW
)
if
(
vlc_CPU
_3dNOW
()
)
i_flags
|=
PP_CPU_CAPS_3DNOW
;
#elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
if
(
vlc_CPU_ALTIVEC
()
)
...
...
modules/video_filter/swscale.c
View file @
b1a07894
...
...
@@ -238,7 +238,7 @@ static int GetSwsCpuMask(void)
if
(
vlc_CPU_MMXEXT
()
)
i_sws_cpu
|=
SWS_CPU_CAPS_MMX2
;
#endif
if
(
vlc_CPU
()
&
CPU_CAPABILITY_3DNOW
)
if
(
vlc_CPU
_3dNOW
()
)
i_sws_cpu
|=
SWS_CPU_CAPS_3DNOW
;
#elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
if
(
vlc_CPU_ALTIVEC
()
)
...
...
src/misc/cpu.c
View file @
b1a07894
...
...
@@ -266,9 +266,7 @@ void vlc_CPU_init (void)
/* list these additional capabilities */
cpuid
(
0x80000001
);
# if defined (__3dNOW__)
i_capabilities
|=
CPU_CAPABILITY_3DNOW
;
# elif defined (CAN_COMPILE_3DNOW)
# if defined (CAN_COMPILE_3DNOW)
if
((
i_edx
&
0x80000000
)
&&
vlc_CPU_check
(
"3D Now!"
,
ThreeD_Now_test
))
i_capabilities
|=
CPU_CAPABILITY_3DNOW
;
# endif
...
...
@@ -330,11 +328,6 @@ void vlc_CPU_dump (vlc_object_t *obj)
char
buf
[
200
],
*
p
=
buf
;
#if defined (__i386__) || defined (__x86_64__)
const
unsigned
flags
=
vlc_CPU
();
#define PRINT_CAPABILITY( capability, string ) \
if (flags & (capability)) \
p += sprintf (p, "%s ", (string) )
if
(
vlc_CPU_MMX
())
p
+=
sprintf
(
p
,
"MMX "
);
if
(
vlc_CPU_MMXEXT
())
p
+=
sprintf
(
p
,
"MMXEXT "
);
if
(
vlc_CPU_SSE
())
p
+=
sprintf
(
p
,
"SSE "
);;
...
...
@@ -344,7 +337,7 @@ void vlc_CPU_dump (vlc_object_t *obj)
if
(
vlc_CPU_SSE4_1
())
p
+=
sprintf
(
p
,
"SSE4.1 "
);;
if
(
vlc_CPU_SSE4_2
())
p
+=
sprintf
(
p
,
"SSE4.2 "
);;
if
(
vlc_CPU_SSE4A
())
p
+=
sprintf
(
p
,
"SSE4A "
);;
PRINT_CAPABILITY
(
CPU_CAPABILITY_3DNOW
,
"3DNow!"
)
;
if
(
vlc_CPU_3dNOW
())
p
+=
sprintf
(
p
,
"3DNow! "
);
;
#elif defined (__powerpc__) || defined (__ppc__) || defined (__ppc64__)
if
(
vlc_CPU_ALTIVEC
())
p
+=
sprintf
(
p
,
"AltiVec"
);
...
...
src/posix/linux_cpu.c
View file @
b1a07894
...
...
@@ -85,10 +85,8 @@ static void vlc_CPU_init (void)
core_caps
|=
VLC_CPU_SSE4_1
;
if
(
!
strcmp
(
cap
,
"sse4a"
))
core_caps
|=
VLC_CPU_SSE4A
;
# ifndef __3dNOW__
if
(
!
strcmp
(
cap
,
"3dnow"
))
core_caps
|=
CPU_CAPABILITY_3DNOW
;
# endif
core_caps
|=
VLC_CPU_3dNOW
;
#elif defined (__powerpc__) || defined (__powerpc64__)
if
(
!
strcmp
(
cap
,
"altivec supported"
))
...
...
@@ -105,13 +103,6 @@ static void vlc_CPU_init (void)
if
(
all_caps
==
0xFFFFFFFF
)
/* Error parsing of cpuinfo? */
all_caps
=
0
;
/* Do not assume any capability! */
/* Always enable capabilities that were forced during compilation */
#if defined (__i386__) || defined (__x86_64__)
# ifdef __3dNOW__
all_caps
|=
CPU_CAPABILITY_3DNOW
;
# endif
#endif
cpu_flags
=
all_caps
;
}
...
...
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