Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
59d686f1
Commit
59d686f1
authored
12 years ago
by
Clément Bœsch
Browse files
Options
Downloads
Patches
Plain Diff
pp: add auto detection cpu flag.
parent
e034b07e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libpostproc/postprocess.c
+13
-5
13 additions, 5 deletions
libpostproc/postprocess.c
libpostproc/postprocess.h
+1
-0
1 addition, 0 deletions
libpostproc/postprocess.h
libpostproc/version.h
+1
-1
1 addition, 1 deletion
libpostproc/version.h
with
15 additions
and
6 deletions
libpostproc/postprocess.c
+
13
−
5
View file @
59d686f1
...
@@ -586,11 +586,11 @@ static inline void postProcess(const uint8_t src[], int srcStride, uint8_t dst[]
...
@@ -586,11 +586,11 @@ static inline void postProcess(const uint8_t src[], int srcStride, uint8_t dst[]
#if CONFIG_RUNTIME_CPUDETECT
#if CONFIG_RUNTIME_CPUDETECT
#if ARCH_X86 && HAVE_INLINE_ASM
#if ARCH_X86 && HAVE_INLINE_ASM
// ordered per speed fastest first
// ordered per speed fastest first
if
(
c
->
cpuCaps
&
PP
_CPU_
CAPS_MMX2
)
pp
=
postProcess_MMX2
;
if
(
c
->
cpuCaps
&
AV
_CPU_
FLAG_MMXEXT
)
pp
=
postProcess_MMX2
;
else
if
(
c
->
cpuCaps
&
PP
_CPU_
CAPS
_3DNOW
)
pp
=
postProcess_3DNow
;
else
if
(
c
->
cpuCaps
&
AV
_CPU_
FLAG
_3DNOW
)
pp
=
postProcess_3DNow
;
else
if
(
c
->
cpuCaps
&
PP
_CPU_
CAPS
_MMX
)
pp
=
postProcess_MMX
;
else
if
(
c
->
cpuCaps
&
AV
_CPU_
FLAG
_MMX
)
pp
=
postProcess_MMX
;
#elif HAVE_ALTIVEC
#elif HAVE_ALTIVEC
if
(
c
->
cpuCaps
&
PP
_CPU_
CAPS
_ALTIVEC
)
pp
=
postProcess_altivec
;
if
(
c
->
cpuCaps
&
AV
_CPU_
FLAG
_ALTIVEC
)
pp
=
postProcess_altivec
;
#endif
#endif
#else
/* CONFIG_RUNTIME_CPUDETECT */
#else
/* CONFIG_RUNTIME_CPUDETECT */
#if HAVE_MMXEXT_INLINE
#if HAVE_MMXEXT_INLINE
...
@@ -896,7 +896,6 @@ pp_context *pp_get_context(int width, int height, int cpuCaps){
...
@@ -896,7 +896,6 @@ pp_context *pp_get_context(int width, int height, int cpuCaps){
memset
(
c
,
0
,
sizeof
(
PPContext
));
memset
(
c
,
0
,
sizeof
(
PPContext
));
c
->
av_class
=
&
av_codec_context_class
;
c
->
av_class
=
&
av_codec_context_class
;
c
->
cpuCaps
=
cpuCaps
;
if
(
cpuCaps
&
PP_FORMAT
){
if
(
cpuCaps
&
PP_FORMAT
){
c
->
hChromaSubSample
=
cpuCaps
&
0x3
;
c
->
hChromaSubSample
=
cpuCaps
&
0x3
;
c
->
vChromaSubSample
=
(
cpuCaps
>>
4
)
&
0x3
;
c
->
vChromaSubSample
=
(
cpuCaps
>>
4
)
&
0x3
;
...
@@ -904,6 +903,15 @@ pp_context *pp_get_context(int width, int height, int cpuCaps){
...
@@ -904,6 +903,15 @@ pp_context *pp_get_context(int width, int height, int cpuCaps){
c
->
hChromaSubSample
=
1
;
c
->
hChromaSubSample
=
1
;
c
->
vChromaSubSample
=
1
;
c
->
vChromaSubSample
=
1
;
}
}
if
(
cpuCaps
&
PP_CPU_CAPS_AUTO
)
{
c
->
cpuCaps
=
av_get_cpu_flags
();
}
else
{
c
->
cpuCaps
=
0
;
if
(
cpuCaps
&
PP_CPU_CAPS_MMX
)
c
->
cpuCaps
|=
AV_CPU_FLAG_MMX
;
if
(
cpuCaps
&
PP_CPU_CAPS_MMX2
)
c
->
cpuCaps
|=
AV_CPU_FLAG_MMXEXT
;
if
(
cpuCaps
&
PP_CPU_CAPS_3DNOW
)
c
->
cpuCaps
|=
AV_CPU_FLAG_3DNOW
;
if
(
cpuCaps
&
PP_CPU_CAPS_ALTIVEC
)
c
->
cpuCaps
|=
AV_CPU_FLAG_ALTIVEC
;
}
reallocBuffers
(
c
,
width
,
height
,
stride
,
qpStride
);
reallocBuffers
(
c
,
width
,
height
,
stride
,
qpStride
);
...
...
This diff is collapsed.
Click to expand it.
libpostproc/postprocess.h
+
1
−
0
View file @
59d686f1
...
@@ -84,6 +84,7 @@ void pp_free_context(pp_context *ppContext);
...
@@ -84,6 +84,7 @@ void pp_free_context(pp_context *ppContext);
#define PP_CPU_CAPS_MMX2 0x20000000
#define PP_CPU_CAPS_MMX2 0x20000000
#define PP_CPU_CAPS_3DNOW 0x40000000
#define PP_CPU_CAPS_3DNOW 0x40000000
#define PP_CPU_CAPS_ALTIVEC 0x10000000
#define PP_CPU_CAPS_ALTIVEC 0x10000000
#define PP_CPU_CAPS_AUTO 0x00080000
#define PP_FORMAT 0x00000008
#define PP_FORMAT 0x00000008
#define PP_FORMAT_420 (0x00000011|PP_FORMAT)
#define PP_FORMAT_420 (0x00000011|PP_FORMAT)
...
...
This diff is collapsed.
Click to expand it.
libpostproc/version.h
+
1
−
1
View file @
59d686f1
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#ifndef LIBPOSTPROC_VERSION_MAJOR
#ifndef LIBPOSTPROC_VERSION_MAJOR
#define LIBPOSTPROC_VERSION_MAJOR 52
#define LIBPOSTPROC_VERSION_MAJOR 52
#define LIBPOSTPROC_VERSION_MINOR
1
#define LIBPOSTPROC_VERSION_MINOR
2
#define LIBPOSTPROC_VERSION_MICRO 100
#define LIBPOSTPROC_VERSION_MICRO 100
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment