Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e6bff23f
Commit
e6bff23f
authored
Feb 08, 2017
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cpu: add a function for querying maximum required data alignment
parent
5c8a5765
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
APIchanges
doc/APIchanges
+3
-0
cpu.c
libavutil/cpu.c
+13
-0
cpu.h
libavutil/cpu.h
+13
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
e6bff23f
...
...
@@ -13,6 +13,9 @@ libavutil: 2015-08-28
API changes, most recent first:
2017-02-xx - xxxxxxx - lavu 55.31.0 - cpu.h
Add av_cpu_max_align() for querying maximum required data alignment.
2016-xx-xx - xxxxxxx - lavf 57.11.0 - avio.h
Add avio_context_free(). From now on it must be used for freeing AVIOContext.
...
...
libavutil/cpu.c
View file @
e6bff23f
...
...
@@ -16,6 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stddef.h>
#include <stdint.h>
#include <stdatomic.h>
...
...
@@ -180,3 +181,15 @@ int av_cpu_count(void)
return
nb_cpus
;
}
size_t
av_cpu_max_align
(
void
)
{
int
flags
=
av_get_cpu_flags
();
if
(
flags
&
AV_CPU_FLAG_AVX
)
return
32
;
if
(
flags
&
(
AV_CPU_FLAG_ALTIVEC
|
AV_CPU_FLAG_SSE
|
AV_CPU_FLAG_NEON
))
return
16
;
return
8
;
}
libavutil/cpu.h
View file @
e6bff23f
...
...
@@ -21,6 +21,8 @@
#ifndef AVUTIL_CPU_H
#define AVUTIL_CPU_H
#include <stddef.h>
#include "version.h"
#define AV_CPU_FLAG_FORCE 0x80000000
/* force usage of selected flags (OR) */
...
...
@@ -88,4 +90,15 @@ int av_parse_cpu_flags(const char *s);
*/
int
av_cpu_count
(
void
);
/**
* Get the maximum data alignment that may be required by Libav.
*
* Note that this is affected by the build configuration and the CPU flags mask,
* so e.g. if the CPU supports AVX, but libavutil has been built with
* --disable-avx or the AV_CPU_FLAG_AVX flag has been disabled through
* av_set_cpu_flags_mask(), then this function will behave as if AVX is not
* present.
*/
size_t
av_cpu_max_align
(
void
);
#endif
/* AVUTIL_CPU_H */
libavutil/version.h
View file @
e6bff23f
...
...
@@ -54,7 +54,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 55
#define LIBAVUTIL_VERSION_MINOR 3
0
#define LIBAVUTIL_VERSION_MINOR 3
1
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
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