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
a257811b
Commit
a257811b
authored
Aug 01, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cpu: do not define capabilities on platforms that do not have them
Also update avcodec encoder and switcher x86 checks.
parent
c9be56de
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
100 additions
and
115 deletions
+100
-115
include/vlc_cpu.h
include/vlc_cpu.h
+12
-36
modules/codec/avcodec/avcodec.c
modules/codec/avcodec/avcodec.c
+10
-18
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+20
-9
modules/codec/libmpeg2.c
modules/codec/libmpeg2.c
+8
-16
modules/codec/x264.c
modules/codec/x264.c
+2
-9
modules/stream_out/switcher.c
modules/stream_out/switcher.c
+38
-22
modules/video_filter/postproc.c
modules/video_filter/postproc.c
+5
-2
modules/video_filter/swscale.c
modules/video_filter/swscale.c
+5
-3
No files found.
include/vlc_cpu.h
View file @
a257811b
...
@@ -20,13 +20,16 @@
...
@@ -20,13 +20,16 @@
/**
/**
* \file
* \file
* This file provides CPU
-specific optimization flags
.
* This file provides CPU
features detection
.
*/
*/
#ifndef VLC_CPU_H
#ifndef VLC_CPU_H
# define VLC_CPU_H 1
# define VLC_CPU_H 1
VLC_API
unsigned
vlc_CPU
(
void
);
# if defined (__i386__) || defined (__x86_64__)
# if defined (__i386__) || defined (__x86_64__)
# define HAVE_FPU 1
# define CPU_CAPABILITY_MMX (1<<3)
# define CPU_CAPABILITY_MMX (1<<3)
# define CPU_CAPABILITY_3DNOW (1<<4)
# define CPU_CAPABILITY_3DNOW (1<<4)
# define CPU_CAPABILITY_MMXEXT (1<<5)
# define CPU_CAPABILITY_MMXEXT (1<<5)
...
@@ -54,41 +57,9 @@
...
@@ -54,41 +57,9 @@
# define VLC_SSE VLC_SSE_is_not_implemented_on_this_compiler
# define VLC_SSE VLC_SSE_is_not_implemented_on_this_compiler
# endif
# endif
# else
# elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
# define CPU_CAPABILITY_MMX (0)
# define CPU_CAPABILITY_3DNOW (0)
# define CPU_CAPABILITY_MMXEXT (0)
# define CPU_CAPABILITY_SSE (0)
# define CPU_CAPABILITY_SSE2 (0)
# define CPU_CAPABILITY_SSE3 (0)
# define CPU_CAPABILITY_SSSE3 (0)
# define CPU_CAPABILITY_SSE4_1 (0)
# define CPU_CAPABILITY_SSE4_2 (0)
# define CPU_CAPABILITY_SSE4A (0)
# endif
# if defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
# define CPU_CAPABILITY_ALTIVEC (1<<16)
# else
# define CPU_CAPABILITY_ALTIVEC (0)
# endif
# if defined (__arm__)
# define CPU_CAPABILITY_NEON (1<<24)
# else
# define CPU_CAPABILITY_NEON (0)
# endif
VLC_API
unsigned
vlc_CPU
(
void
);
/** Are floating point operations fast?
* If this bit is not set, you should try to use fixed-point instead.
*/
# if defined (__i386__) || defined (__x86_64__)
# define HAVE_FPU 1
# elif defined (__powerpc__) || defined (__ppc__) || defined (__ppc64__)
# define HAVE_FPU 1
# define HAVE_FPU 1
# define CPU_CAPABILITY_ALTIVEC (1<<16)
# elif defined (__arm__)
# elif defined (__arm__)
# if defined (__VFP_FP__) && !defined (__SOFTFP__)
# if defined (__VFP_FP__) && !defined (__SOFTFP__)
...
@@ -96,14 +67,19 @@ VLC_API unsigned vlc_CPU( void );
...
@@ -96,14 +67,19 @@ VLC_API unsigned vlc_CPU( void );
# else
# else
# define HAVE_FPU 0
# define HAVE_FPU 0
# endif
# endif
# define CPU_CAPABILITY_NEON (1<<24)
# elif defined (__sparc__)
# elif defined (__sparc__)
# define HAVE_FPU 1
# define HAVE_FPU 1
# else
# else
/**
* Are single precision floating point operations "fast"?
* If this preprocessor constant is zero, floating point should be avoided
* (especially relevant for audio codecs).
*/
# define HAVE_FPU 0
# define HAVE_FPU 0
# endif
# endif
#endif
/* !VLC_CPU_H */
#endif
/* !VLC_CPU_H */
modules/codec/avcodec/avcodec.c
View file @
a257811b
...
@@ -329,43 +329,35 @@ static int OpenDecoder( vlc_object_t *p_this )
...
@@ -329,43 +329,35 @@ static int OpenDecoder( vlc_object_t *p_this )
p_context
->
opaque
=
(
void
*
)
p_this
;
p_context
->
opaque
=
(
void
*
)
p_this
;
/* Set CPU capabilities */
/* Set CPU capabilities */
unsigned
i_cpu
=
vlc_CPU
();
p_context
->
dsp_mask
=
0
;
p_context
->
dsp_mask
=
0
;
#if defined (__i386__) || defined (__x86_64__)
unsigned
i_cpu
=
vlc_CPU
();
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMX
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMX
)
)
{
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
{
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
{
p_context
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE
)
)
{
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE2
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE2
)
)
{
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE2
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE2
;
}
# ifdef AV_CPU_FLAG_SSE3
#ifdef AV_CPU_FLAG_SSE3
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE3
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE3
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE3
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE3
;
#endif
#
endif
#ifdef AV_CPU_FLAG_SSSE3
#
ifdef AV_CPU_FLAG_SSSE3
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSSE3
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSSE3
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSSE3
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSSE3
;
#endif
#
endif
#ifdef AV_CPU_FLAG_SSE4
#
ifdef AV_CPU_FLAG_SSE4
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE4_1
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE4_1
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE4
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE4
;
#endif
#
endif
#ifdef AV_CPU_FLAG_SSE42
#
ifdef AV_CPU_FLAG_SSE42
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE4_2
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE4_2
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE42
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE42
;
# endif
#endif
#endif
p_dec
->
b_need_packetized
=
true
;
p_dec
->
b_need_packetized
=
true
;
...
...
modules/codec/avcodec/encoder.c
View file @
a257811b
...
@@ -323,25 +323,36 @@ int OpenEncoder( vlc_object_t *p_this )
...
@@ -323,25 +323,36 @@ int OpenEncoder( vlc_object_t *p_this )
p_context
->
opaque
=
(
void
*
)
p_this
;
p_context
->
opaque
=
(
void
*
)
p_this
;
/* Set CPU capabilities */
/* Set CPU capabilities */
unsigned
i_cpu
=
vlc_CPU
();
p_context
->
dsp_mask
=
0
;
p_context
->
dsp_mask
=
0
;
#if defined (__i386__) || defined (__x86_64__)
unsigned
i_cpu
=
vlc_CPU
();
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMX
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMX
)
)
{
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
{
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
{
p_context
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE
)
)
{
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE2
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE2
;
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE2
;
}
# ifdef AV_CPU_FLAG_SSE3
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE3
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE3
;
# endif
# ifdef AV_CPU_FLAG_SSSE3
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSSE3
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSSE3
;
# endif
# ifdef AV_CPU_FLAG_SSE4
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE4_1
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE4
;
# endif
# ifdef AV_CPU_FLAG_SSE42
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE4_2
)
)
p_context
->
dsp_mask
|=
AV_CPU_FLAG_SSE42
;
# endif
#endif
p_sys
->
i_key_int
=
var_GetInteger
(
p_enc
,
ENC_CFG_PREFIX
"keyint"
);
p_sys
->
i_key_int
=
var_GetInteger
(
p_enc
,
ENC_CFG_PREFIX
"keyint"
);
p_sys
->
i_b_frames
=
var_GetInteger
(
p_enc
,
ENC_CFG_PREFIX
"bframes"
);
p_sys
->
i_b_frames
=
var_GetInteger
(
p_enc
,
ENC_CFG_PREFIX
"bframes"
);
...
...
modules/codec/libmpeg2.c
View file @
a257811b
...
@@ -192,35 +192,27 @@ static int OpenDecoder( vlc_object_t *p_this )
...
@@ -192,35 +192,27 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys
->
i_gop_user_data
=
0
;
p_sys
->
i_gop_user_data
=
0
;
#if defined( __i386__ ) || defined( __x86_64__ )
#if defined( __i386__ ) || defined( __x86_64__ )
if
(
vlc_CPU
()
&
CPU_CAPABILITY_MMX
)
unsigned
cpu
=
vlc_CPU
();
{
if
(
cpu
&
CPU_CAPABILITY_MMX
)
i_accel
|=
MPEG2_ACCEL_X86_MMX
;
i_accel
|=
MPEG2_ACCEL_X86_MMX
;
}
if
(
cpu
&
CPU_CAPABILITY_3DNOW
)
if
(
vlc_CPU
()
&
CPU_CAPABILITY_3DNOW
)
{
i_accel
|=
MPEG2_ACCEL_X86_3DNOW
;
i_accel
|=
MPEG2_ACCEL_X86_3DNOW
;
}
if
(
cpu
&
CPU_CAPABILITY_MMXEXT
)
if
(
vlc_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
()
&
CPU_CAPABILITY_ALTIVEC
)
{
i_accel
|=
MPEG2_ACCEL_PPC_ALTIVEC
;
i_accel
|=
MPEG2_ACCEL_PPC_ALTIVEC
;
}
#elif defined(__arm__) && defined(MPEG2_ACCEL_ARM)
#elif defined(__arm__)
# ifdef MPEG2_ACCEL_ARM
i_accel
|=
MPEG2_ACCEL_ARM
;
i_accel
|=
MPEG2_ACCEL_ARM
;
# endif
# ifdef MPEG2_ACCEL_ARM_NEON
# ifdef MPEG2_ACCEL_ARM_NEON
if
(
vlc_CPU
()
&
CPU_CAPABILITY_NEON
)
if
(
vlc_CPU
()
&
CPU_CAPABILITY_NEON
)
i_accel
|=
MPEG2_ACCEL_ARM_NEON
;
i_accel
|=
MPEG2_ACCEL_ARM_NEON
;
# endif
# endif
/* TODO: sparc */
#else
#else
/* If we do not know this CPU, trust libmpeg2's feature detection */
/* If we do not know this CPU, trust libmpeg2's feature detection */
i_accel
=
MPEG2_ACCEL_DETECT
;
i_accel
=
MPEG2_ACCEL_DETECT
;
...
...
modules/codec/x264.c
View file @
a257811b
...
@@ -1259,24 +1259,17 @@ static int Open ( vlc_object_t *p_this )
...
@@ -1259,24 +1259,17 @@ static int Open ( vlc_object_t *p_this )
x264_param_apply_profile
(
&
p_sys
->
param
,
psz_val
);
x264_param_apply_profile
(
&
p_sys
->
param
,
psz_val
);
free
(
psz_val
);
free
(
psz_val
);
#if defined (__i386__) || defined (__x86_64__)
unsigned
i_cpu
=
vlc_CPU
();
unsigned
i_cpu
=
vlc_CPU
();
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMX
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMX
)
)
{
p_sys
->
param
.
cpu
&=
~
X264_CPU_MMX
;
p_sys
->
param
.
cpu
&=
~
X264_CPU_MMX
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
{
p_sys
->
param
.
cpu
&=
~
X264_CPU_MMXEXT
;
p_sys
->
param
.
cpu
&=
~
X264_CPU_MMXEXT
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE
)
)
{
p_sys
->
param
.
cpu
&=
~
X264_CPU_SSE
;
p_sys
->
param
.
cpu
&=
~
X264_CPU_SSE
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE2
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE2
)
)
{
p_sys
->
param
.
cpu
&=
~
X264_CPU_SSE2
;
p_sys
->
param
.
cpu
&=
~
X264_CPU_SSE2
;
}
#endif
/* BUILD 29 adds support for multi-threaded encoding while BUILD 49 (r543)
/* BUILD 29 adds support for multi-threaded encoding while BUILD 49 (r543)
also adds support for threads = 0 for automatically selecting an optimal
also adds support for threads = 0 for automatically selecting an optimal
...
...
modules/stream_out/switcher.c
View file @
a257811b
...
@@ -378,28 +378,36 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
...
@@ -378,28 +378,36 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
#endif
#endif
/* Set CPU capabilities */
/* Set CPU capabilities */
unsigned
i_cpu
=
vlc_CPU
();
id
->
ff_enc_c
->
dsp_mask
=
0
;
id
->
ff_enc_c
->
dsp_mask
=
0
;
#if defined (__i386__) || defined (__x86_64__)
unsigned
i_cpu
=
vlc_CPU
();
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMX
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMX
)
)
{
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
{
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
{
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE
)
)
{
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE2
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE2
)
)
{
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE2
;
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE2
;
}
# ifdef AV_CPU_FLAG_SSE3
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE3
)
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE3
;
# endif
# ifdef AV_CPU_FLAG_SSSE3
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSSE3
)
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSSE3
;
# endif
# ifdef AV_CPU_FLAG_SSE4
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE4_1
)
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE4
;
# endif
# ifdef AV_CPU_FLAG_SSE42
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE4_2
)
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE42
;
# endif
#endif
id
->
ff_enc_c
->
sample_rate
=
p_fmt
->
audio
.
i_rate
;
id
->
ff_enc_c
->
sample_rate
=
p_fmt
->
audio
.
i_rate
;
id
->
ff_enc_c
->
time_base
.
num
=
1
;
id
->
ff_enc_c
->
time_base
.
num
=
1
;
...
@@ -791,28 +799,36 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
...
@@ -791,28 +799,36 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
#endif
#endif
/* Set CPU capabilities */
/* Set CPU capabilities */
unsigned
i_cpu
=
vlc_CPU
();
id
->
ff_enc_c
->
dsp_mask
=
0
;
id
->
ff_enc_c
->
dsp_mask
=
0
;
#if defined (__i386__) || defined (__x86_64__)
unsigned
i_cpu
=
vlc_CPU
();
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMX
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMX
)
)
{
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
{
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_MMX2
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
{
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_3DNOW
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE
)
)
{
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE
;
}
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE2
)
)
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE2
)
)
{
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE2
;
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE2
;
}
# ifdef AV_CPU_FLAG_SSE3
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE3
)
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE3
;
# endif
# ifdef AV_CPU_FLAG_SSSE3
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSSE3
)
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSSE3
;
# endif
# ifdef AV_CPU_FLAG_SSE4
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE4_1
)
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE4
;
# endif
# ifdef AV_CPU_FLAG_SSE42
if
(
!
(
i_cpu
&
CPU_CAPABILITY_SSE4_2
)
)
id
->
ff_enc_c
->
dsp_mask
|=
AV_CPU_FLAG_SSE42
;
# endif
#endif
id
->
ff_enc_c
->
width
=
p_sys
->
p_pictures
[
p_sys
->
i_cmd
-
1
].
format
.
i_width
;
id
->
ff_enc_c
->
width
=
p_sys
->
p_pictures
[
p_sys
->
i_cmd
-
1
].
format
.
i_width
;
id
->
ff_enc_c
->
height
=
p_sys
->
p_pictures
[
p_sys
->
i_cmd
-
1
].
format
.
i_height
;
id
->
ff_enc_c
->
height
=
p_sys
->
p_pictures
[
p_sys
->
i_cmd
-
1
].
format
.
i_height
;
...
...
modules/video_filter/postproc.c
View file @
a257811b
...
@@ -122,7 +122,6 @@ static int OpenPostproc( vlc_object_t *p_this )
...
@@ -122,7 +122,6 @@ static int OpenPostproc( vlc_object_t *p_this )
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_sys_t
*
p_sys
;
filter_sys_t
*
p_sys
;
vlc_value_t
val
,
val_orig
,
text
;
vlc_value_t
val
,
val_orig
,
text
;
unsigned
i_cpu
=
vlc_CPU
();
int
i_flags
=
0
;
int
i_flags
=
0
;
if
(
p_filter
->
fmt_in
.
video
.
i_chroma
!=
p_filter
->
fmt_out
.
video
.
i_chroma
||
if
(
p_filter
->
fmt_in
.
video
.
i_chroma
!=
p_filter
->
fmt_out
.
video
.
i_chroma
||
...
@@ -134,14 +133,18 @@ static int OpenPostproc( vlc_object_t *p_this )
...
@@ -134,14 +133,18 @@ static int OpenPostproc( vlc_object_t *p_this )
}
}
/* Set CPU capabilities */
/* Set CPU capabilities */
#if defined(__i386__) || defined(__x86_64__)
unsigned
i_cpu
=
vlc_CPU
();
if
(
i_cpu
&
CPU_CAPABILITY_MMX
)
if
(
i_cpu
&
CPU_CAPABILITY_MMX
)
i_flags
|=
PP_CPU_CAPS_MMX
;
i_flags
|=
PP_CPU_CAPS_MMX
;
if
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
if
(
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
i_flags
|=
PP_CPU_CAPS_MMX2
;
i_flags
|=
PP_CPU_CAPS_MMX2
;
if
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
if
(
i_cpu
&
CPU_CAPABILITY_3DNOW
)
i_flags
|=
PP_CPU_CAPS_3DNOW
;
i_flags
|=
PP_CPU_CAPS_3DNOW
;
if
(
i_cpu
&
CPU_CAPABILITY_ALTIVEC
)
#elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
if
(
vlc_CPU
()
&
CPU_CAPABILITY_ALTIVEC
)
i_flags
|=
PP_CPU_CAPS_ALTIVEC
;
i_flags
|=
PP_CPU_CAPS_ALTIVEC
;
#endif
switch
(
p_filter
->
fmt_in
.
video
.
i_chroma
)
switch
(
p_filter
->
fmt_in
.
video
.
i_chroma
)
{
{
...
...
modules/video_filter/swscale.c
View file @
a257811b
...
@@ -229,9 +229,10 @@ static void CloseScaler( vlc_object_t *p_this )
...
@@ -229,9 +229,10 @@ static void CloseScaler( vlc_object_t *p_this )
*****************************************************************************/
*****************************************************************************/
static
int
GetSwsCpuMask
(
void
)
static
int
GetSwsCpuMask
(
void
)
{
{
const
unsigned
int
i_cpu
=
vlc_CPU
();
int
i_sws_cpu
=
0
;
int
i_sws_cpu
=
0
;
#if defined(__i386__) || defined(__x86_64__)
const
unsigned
int
i_cpu
=
vlc_CPU
();
if
(
i_cpu
&
CPU_CAPABILITY_MMX
)
if
(
i_cpu
&
CPU_CAPABILITY_MMX
)
i_sws_cpu
|=
SWS_CPU_CAPS_MMX
;
i_sws_cpu
|=
SWS_CPU_CAPS_MMX
;
#if (LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0))
#if (LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0))
...
@@ -240,9 +241,10 @@ static int GetSwsCpuMask(void)
...
@@ -240,9 +241,10 @@ static int GetSwsCpuMask(void)
#endif
#endif
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__)
if
(
i_cpu
&
CPU_CAPABILITY_ALTIVEC
)
if
(
vlc_CPU
()
&
CPU_CAPABILITY_ALTIVEC
)
i_sws_cpu
|=
SWS_CPU_CAPS_ALTIVEC
;
i_sws_cpu
|=
SWS_CPU_CAPS_ALTIVEC
;
#endif
return
i_sws_cpu
;
return
i_sws_cpu
;
}
}
...
...
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