Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
b0bb1dc6
Commit
b0bb1dc6
authored
Oct 16, 2015
by
Matt Oliver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu/intmath.h: Move x86 only msvc/icl functions to x86 specific header.
Signed-off-by:
Matt Oliver
<
protogonoi@gmail.com
>
parent
216cc1f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
32 deletions
+22
-32
intmath.h
libavutil/intmath.h
+2
-32
intmath.h
libavutil/x86/intmath.h
+20
-0
No files found.
libavutil/intmath.h
View file @
b0bb1dc6
...
@@ -34,14 +34,7 @@
...
@@ -34,14 +34,7 @@
#endif
#endif
#if HAVE_FAST_CLZ
#if HAVE_FAST_CLZ
#if defined( __INTEL_COMPILER )
#if AV_GCC_VERSION_AT_LEAST(3,4)
#ifndef ff_log2
# define ff_log2(x) (_bit_scan_reverse((x)|1))
# ifndef ff_log2_16bit
# define ff_log2_16bit av_log2
# endif
#endif
/* ff_log2 */
#elif AV_GCC_VERSION_AT_LEAST(3,4)
#ifndef ff_log2
#ifndef ff_log2
# define ff_log2(x) (31 - __builtin_clz((x)|1))
# define ff_log2(x) (31 - __builtin_clz((x)|1))
# ifndef ff_log2_16bit
# ifndef ff_log2_16bit
...
@@ -55,7 +48,6 @@ extern const uint8_t ff_log2_tab[256];
...
@@ -55,7 +48,6 @@ extern const uint8_t ff_log2_tab[256];
#ifndef ff_log2
#ifndef ff_log2
#define ff_log2 ff_log2_c
#define ff_log2 ff_log2_c
#if !defined( _MSC_VER )
static
av_always_inline
av_const
int
ff_log2_c
(
unsigned
int
v
)
static
av_always_inline
av_const
int
ff_log2_c
(
unsigned
int
v
)
{
{
int
n
=
0
;
int
n
=
0
;
...
@@ -71,15 +63,6 @@ static av_always_inline av_const int ff_log2_c(unsigned int v)
...
@@ -71,15 +63,6 @@ static av_always_inline av_const int ff_log2_c(unsigned int v)
return
n
;
return
n
;
}
}
#else
static
av_always_inline
av_const
int
ff_log2_c
(
unsigned
int
v
)
{
unsigned
long
n
;
_BitScanReverse
(
&
n
,
v
|
1
);
return
n
;
}
#define ff_log2_16bit av_log2
#endif
#endif
#endif
#ifndef ff_log2_16bit
#ifndef ff_log2_16bit
...
@@ -106,11 +89,7 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
...
@@ -106,11 +89,7 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
*/
*/
#if HAVE_FAST_CLZ
#if HAVE_FAST_CLZ
#if defined( __INTEL_COMPILER )
#if AV_GCC_VERSION_AT_LEAST(3,4)
#ifndef ff_ctz
#define ff_ctz(v) _bit_scan_forward(v)
#endif
#elif AV_GCC_VERSION_AT_LEAST(3,4)
#ifndef ff_ctz
#ifndef ff_ctz
#define ff_ctz(v) __builtin_ctz(v)
#define ff_ctz(v) __builtin_ctz(v)
#endif
#endif
...
@@ -128,7 +107,6 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
...
@@ -128,7 +107,6 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
* @param v input value. If v is 0, the result is undefined.
* @param v input value. If v is 0, the result is undefined.
* @return the number of trailing 0-bits
* @return the number of trailing 0-bits
*/
*/
#if !defined( _MSC_VER )
/* We use the De-Bruijn method outlined in:
/* We use the De-Bruijn method outlined in:
* http://supertech.csail.mit.edu/papers/debruijn.pdf. */
* http://supertech.csail.mit.edu/papers/debruijn.pdf. */
static
av_always_inline
av_const
int
ff_ctz_c
(
int
v
)
static
av_always_inline
av_const
int
ff_ctz_c
(
int
v
)
...
@@ -139,14 +117,6 @@ static av_always_inline av_const int ff_ctz_c(int v)
...
@@ -139,14 +117,6 @@ static av_always_inline av_const int ff_ctz_c(int v)
};
};
return
debruijn_ctz32
[(
uint32_t
)((
v
&
-
v
)
*
0x077CB531U
)
>>
27
];
return
debruijn_ctz32
[(
uint32_t
)((
v
&
-
v
)
*
0x077CB531U
)
>>
27
];
}
}
#else
static
av_always_inline
av_const
int
ff_ctz_c
(
int
v
)
{
unsigned
long
c
;
_BitScanForward
(
&
c
,
v
);
return
c
;
}
#endif
#endif
#endif
#ifndef ff_ctzll
#ifndef ff_ctzll
...
...
libavutil/x86/intmath.h
View file @
b0bb1dc6
...
@@ -26,6 +26,11 @@
...
@@ -26,6 +26,11 @@
#if HAVE_FAST_CLZ
#if HAVE_FAST_CLZ
#if defined(__INTEL_COMPILER)
#if defined(__INTEL_COMPILER)
# define ff_log2(x) (_bit_scan_reverse((x)|1))
# define ff_log2_16bit av_log2
# define ff_ctz(v) _bit_scan_forward(v)
# define ff_ctzll ff_ctzll_x86
# define ff_ctzll ff_ctzll_x86
static
av_always_inline
av_const
int
ff_ctzll_x86
(
long
long
v
)
static
av_always_inline
av_const
int
ff_ctzll_x86
(
long
long
v
)
{
{
...
@@ -38,6 +43,21 @@ static av_always_inline av_const int ff_ctzll_x86(long long v)
...
@@ -38,6 +43,21 @@ static av_always_inline av_const int ff_ctzll_x86(long long v)
# endif
# endif
}
}
#elif defined(_MSC_VER)
#elif defined(_MSC_VER)
# define ff_log2 ff_log2_x86
static
av_always_inline
av_const
int
ff_log2_x86
(
unsigned
int
v
)
{
unsigned
long
n
;
_BitScanReverse
(
&
n
,
v
|
1
);
return
n
;
}
# define ff_log2_16bit av_log2
# define ff_ctz ff_ctz_x86
static
av_always_inline
av_const
int
ff_ctz_x86
(
int
v
)
{
unsigned
long
c
;
_BitScanForward
(
&
c
,
v
);
return
c
;
}
# define ff_ctzll ff_ctzll_x86
# define ff_ctzll ff_ctzll_x86
static
av_always_inline
av_const
int
ff_ctzll_x86
(
long
long
v
)
static
av_always_inline
av_const
int
ff_ctzll_x86
(
long
long
v
)
{
{
...
...
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