Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
x264
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
x264
Commits
6df41d50
Commit
6df41d50
authored
Apr 20, 2008
by
Loren Merritt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--asm to allow testing of different versions of asm without recompile
parent
87132ed6
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
14 deletions
+56
-14
common/common.c
common/common.c
+20
-1
common/cpu.c
common/cpu.c
+19
-0
common/cpu.h
common/cpu.h
+5
-0
common/osdep.h
common/osdep.h
+1
-0
encoder/encoder.c
encoder/encoder.c
+9
-13
x264.c
x264.c
+2
-0
No files found.
common/common.c
View file @
6df41d50
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
*****************************************************************************/
*****************************************************************************/
#include <stdarg.h>
#include <stdarg.h>
#include <ctype.h>
#ifdef HAVE_MALLOC_H
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#include <malloc.h>
...
@@ -239,7 +240,25 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
...
@@ -239,7 +240,25 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
#define OPT2(STR0, STR1) else if( !strcmp( name, STR0 ) || !strcmp( name, STR1 ) )
#define OPT2(STR0, STR1) else if( !strcmp( name, STR0 ) || !strcmp( name, STR1 ) )
if
(
0
);
if
(
0
);
OPT
(
"asm"
)
OPT
(
"asm"
)
p
->
cpu
=
atobool
(
value
)
?
x264_cpu_detect
()
:
0
;
{
p
->
cpu
=
isdigit
(
value
[
0
])
?
atoi
(
value
)
:
!
strcmp
(
value
,
"auto"
)
||
atobool
(
value
)
?
x264_cpu_detect
()
:
0
;
if
(
b_error
)
{
char
*
buf
=
strdup
(
value
);
char
*
tok
,
*
saveptr
,
*
init
;
b_error
=
0
;
p
->
cpu
=
0
;
for
(
init
=
buf
;
(
tok
=
strtok_r
(
init
,
","
,
&
saveptr
));
init
=
NULL
)
{
for
(
i
=
0
;
x264_cpu_names
[
i
].
flags
&&
strcasecmp
(
tok
,
x264_cpu_names
[
i
].
name
);
i
++
);
p
->
cpu
|=
x264_cpu_names
[
i
].
flags
;
if
(
!
x264_cpu_names
[
i
].
flags
)
b_error
=
1
;
}
free
(
buf
);
}
}
OPT
(
"threads"
)
OPT
(
"threads"
)
{
{
if
(
!
strcmp
(
value
,
"auto"
)
)
if
(
!
strcmp
(
value
,
"auto"
)
)
...
...
common/cpu.c
View file @
6df41d50
...
@@ -35,6 +35,25 @@
...
@@ -35,6 +35,25 @@
#include "common.h"
#include "common.h"
const
struct
{
const
char
name
[
8
];
int
flags
;
}
x264_cpu_names
[]
=
{
{
"MMX"
,
X264_CPU_MMX
},
{
"MMX2"
,
X264_CPU_MMX
|
X264_CPU_MMXEXT
},
{
"MMXEXT"
,
X264_CPU_MMX
|
X264_CPU_MMXEXT
},
{
"SSE"
,
X264_CPU_MMX
|
X264_CPU_MMXEXT
|
X264_CPU_SSE
},
{
"SSE1"
,
X264_CPU_MMX
|
X264_CPU_MMXEXT
|
X264_CPU_SSE
},
{
"SSE2"
,
X264_CPU_MMX
|
X264_CPU_MMXEXT
|
X264_CPU_SSE
|
X264_CPU_SSE2
},
{
"SSE3"
,
X264_CPU_MMX
|
X264_CPU_MMXEXT
|
X264_CPU_SSE
|
X264_CPU_SSE2
|
X264_CPU_SSE3
},
{
"SSSE3"
,
X264_CPU_MMX
|
X264_CPU_MMXEXT
|
X264_CPU_SSE
|
X264_CPU_SSE2
|
X264_CPU_SSE3
|
X264_CPU_SSSE3
},
{
"3DNow"
,
X264_CPU_3DNOW
},
{
"Altivec"
,
X264_CPU_ALTIVEC
},
{
"Cache32"
,
X264_CPU_CACHELINE_SPLIT
|
X264_CPU_CACHELINE_32
},
{
"Cache64"
,
X264_CPU_CACHELINE_SPLIT
|
X264_CPU_CACHELINE_64
},
{
""
,
0
},
};
#ifdef HAVE_MMX
#ifdef HAVE_MMX
extern
int
x264_cpu_cpuid_test
(
void
);
extern
int
x264_cpu_cpuid_test
(
void
);
extern
uint32_t
x264_cpu_cpuid
(
uint32_t
op
,
uint32_t
*
eax
,
uint32_t
*
ebx
,
uint32_t
*
ecx
,
uint32_t
*
edx
);
extern
uint32_t
x264_cpu_cpuid
(
uint32_t
op
,
uint32_t
*
eax
,
uint32_t
*
ebx
,
uint32_t
*
ecx
,
uint32_t
*
edx
);
...
...
common/cpu.h
View file @
6df41d50
...
@@ -44,4 +44,9 @@ void x264_stack_align( void (*func)(x264_t*), x264_t *arg );
...
@@ -44,4 +44,9 @@ void x264_stack_align( void (*func)(x264_t*), x264_t *arg );
#define x264_stack_align(func,arg) func(arg)
#define x264_stack_align(func,arg) func(arg)
#endif
#endif
extern
const
struct
{
const
char
name
[
8
];
int
flags
;
}
x264_cpu_names
[];
#endif
#endif
common/osdep.h
View file @
6df41d50
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include <io.h> // _setmode()
#include <io.h> // _setmode()
#include <fcntl.h> // _O_BINARY
#include <fcntl.h> // _O_BINARY
#define inline __inline
#define inline __inline
#define strcasecmp stricmp
#define strncasecmp strnicmp
#define strncasecmp strnicmp
#define snprintf _snprintf
#define snprintf _snprintf
#define fseek _fseeki64
#define fseek _fseeki64
...
...
encoder/encoder.c
View file @
6df41d50
...
@@ -570,6 +570,7 @@ static void mbcmp_init( x264_t *h )
...
@@ -570,6 +570,7 @@ static void mbcmp_init( x264_t *h )
x264_t
*
x264_encoder_open
(
x264_param_t
*
param
)
x264_t
*
x264_encoder_open
(
x264_param_t
*
param
)
{
{
x264_t
*
h
=
x264_malloc
(
sizeof
(
x264_t
)
);
x264_t
*
h
=
x264_malloc
(
sizeof
(
x264_t
)
);
char
buf
[
1000
],
*
p
;
int
i
;
int
i
;
memset
(
h
,
0
,
sizeof
(
x264_t
)
);
memset
(
h
,
0
,
sizeof
(
x264_t
)
);
...
@@ -684,19 +685,14 @@ x264_t *x264_encoder_open ( x264_param_t *param )
...
@@ -684,19 +685,14 @@ x264_t *x264_encoder_open ( x264_param_t *param )
mbcmp_init
(
h
);
mbcmp_init
(
h
);
x264_log
(
h
,
X264_LOG_INFO
,
"using cpu capabilities: %s%s%s%s%s%s%s%s%s%s
\n
"
,
p
=
buf
+
sprintf
(
buf
,
"using cpu capabilities:"
);
param
->
cpu
&
X264_CPU_MMX
?
"MMX "
:
""
,
for
(
i
=
0
;
x264_cpu_names
[
i
].
flags
;
i
++
)
param
->
cpu
&
X264_CPU_MMXEXT
?
"MMXEXT "
:
""
,
if
(
(
param
->
cpu
&
x264_cpu_names
[
i
].
flags
)
==
x264_cpu_names
[
i
].
flags
param
->
cpu
&
X264_CPU_SSE
?
"SSE "
:
""
,
&&
(
!
i
||
x264_cpu_names
[
i
].
flags
!=
x264_cpu_names
[
i
-
1
].
flags
)
)
param
->
cpu
&
X264_CPU_SSE2
?
"SSE2 "
:
""
,
p
+=
sprintf
(
p
,
" %s"
,
x264_cpu_names
[
i
].
name
);
param
->
cpu
&
X264_CPU_SSE3
?
"SSE3 "
:
""
,
if
(
!
param
->
cpu
)
param
->
cpu
&
X264_CPU_SSSE3
?
"SSSE3 "
:
""
,
p
+=
sprintf
(
p
,
" none!"
);
param
->
cpu
&
X264_CPU_3DNOW
?
"3DNow! "
:
""
,
x264_log
(
h
,
X264_LOG_INFO
,
"%s
\n
"
,
buf
);
param
->
cpu
&
X264_CPU_ALTIVEC
?
"Altivec "
:
""
,
param
->
cpu
&
X264_CPU_CACHELINE_SPLIT
?
param
->
cpu
&
X264_CPU_CACHELINE_32
?
"Cache32 "
:
param
->
cpu
&
X264_CPU_CACHELINE_64
?
"Cache64 "
:
"Cache? "
:
""
,
param
->
cpu
?
""
:
"none!"
);
h
->
out
.
i_nal
=
0
;
h
->
out
.
i_nal
=
0
;
h
->
out
.
i_bitstream
=
X264_MAX
(
1000000
,
h
->
param
.
i_width
*
h
->
param
.
i_height
*
4
h
->
out
.
i_bitstream
=
X264_MAX
(
1000000
,
h
->
param
.
i_width
*
h
->
param
.
i_height
*
4
...
...
x264.c
View file @
6df41d50
...
@@ -316,6 +316,7 @@ static void Help( x264_param_t *defaults, int b_longhelp )
...
@@ -316,6 +316,7 @@ static void Help( x264_param_t *defaults, int b_longhelp )
H0
(
" --threads <integer> Parallel encoding
\n
"
);
H0
(
" --threads <integer> Parallel encoding
\n
"
);
H0
(
" --thread-input Run Avisynth in its own thread
\n
"
);
H0
(
" --thread-input Run Avisynth in its own thread
\n
"
);
H1
(
" --non-deterministic Slightly improve quality of SMP, at the cost of repeatability
\n
"
);
H1
(
" --non-deterministic Slightly improve quality of SMP, at the cost of repeatability
\n
"
);
H1
(
" --asm <integer> Override CPU detection
\n
"
);
H1
(
" --no-asm Disable all CPU optimizations
\n
"
);
H1
(
" --no-asm Disable all CPU optimizations
\n
"
);
H1
(
" --visualize Show MB types overlayed on the encoded video
\n
"
);
H1
(
" --visualize Show MB types overlayed on the encoded video
\n
"
);
H1
(
" --sps-id <integer> Set SPS and PPS id numbers [%d]
\n
"
,
defaults
->
i_sps_id
);
H1
(
" --sps-id <integer> Set SPS and PPS id numbers [%d]
\n
"
,
defaults
->
i_sps_id
);
...
@@ -392,6 +393,7 @@ static int Parse( int argc, char **argv,
...
@@ -392,6 +393,7 @@ static int Parse( int argc, char **argv,
{
"qpstep"
,
required_argument
,
NULL
,
0
},
{
"qpstep"
,
required_argument
,
NULL
,
0
},
{
"crf"
,
required_argument
,
NULL
,
0
},
{
"crf"
,
required_argument
,
NULL
,
0
},
{
"ref"
,
required_argument
,
NULL
,
'r'
},
{
"ref"
,
required_argument
,
NULL
,
'r'
},
{
"asm"
,
required_argument
,
NULL
,
0
},
{
"no-asm"
,
no_argument
,
NULL
,
0
},
{
"no-asm"
,
no_argument
,
NULL
,
0
},
{
"sar"
,
required_argument
,
NULL
,
0
},
{
"sar"
,
required_argument
,
NULL
,
0
},
{
"fps"
,
required_argument
,
NULL
,
0
},
{
"fps"
,
required_argument
,
NULL
,
0
},
...
...
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