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
dfde8a34
Commit
dfde8a34
authored
Oct 26, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu: add av_ctz() for trailing zero bit count
parent
6a744d26
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
2 deletions
+65
-2
APIchanges
doc/APIchanges
+3
-0
Makefile
libavutil/Makefile
+1
-1
intmath.c
libavutil/intmath.c
+5
-0
intmath.h
libavutil/intmath.h
+55
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
dfde8a34
...
...
@@ -13,6 +13,9 @@ libavutil: 2012-10-22
API changes, most recent first:
2012-xx-xx - xxxxxxx - lavu 52.1.0 - intmath.h
Add av_ctz() for trailing zero bit count
2012-10-18 - xxxxxxx - lavu 51.45.0 - error.h
Add AVERROR_EXPERIMENTAL
...
...
libavutil/Makefile
View file @
dfde8a34
...
...
@@ -67,10 +67,10 @@ OBJS = adler32.o \
float_dsp.o
\
imgutils.o
\
intfloat_readwrite.o
\
intmath.o
\
lfg.o
\
lls.o
\
log.o
\
log2.o
\
log2_tab.o
\
mathematics.o
\
md5.o
\
...
...
libavutil/
log2
.c
→
libavutil/
intmath
.c
View file @
dfde8a34
...
...
@@ -32,3 +32,8 @@ int av_log2_16bit(unsigned v)
{
return
ff_log2_16bit
(
v
);
}
int
av_ctz
(
int
v
)
{
return
ff_ctz
(
v
);
}
libavutil/intmath.h
View file @
dfde8a34
...
...
@@ -85,6 +85,61 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
#define av_log2 ff_log2
#define av_log2_16bit ff_log2_16bit
/**
* @}
*/
/**
* @addtogroup lavu_math
* @{
*/
#if HAVE_FAST_CLZ && AV_GCC_VERSION_AT_LEAST(3,4)
#ifndef ff_ctz
#define ff_ctz(v) __builtin_ctz(v)
#endif
#endif
#ifndef ff_ctz
#define ff_ctz ff_ctz_c
static
av_always_inline
av_const
int
ff_ctz_c
(
int
v
)
{
int
c
;
if
(
v
&
0x1
)
return
0
;
c
=
1
;
if
(
!
(
v
&
0xffff
))
{
v
>>=
16
;
c
+=
16
;
}
if
(
!
(
v
&
0xff
))
{
v
>>=
8
;
c
+=
8
;
}
if
(
!
(
v
&
0xf
))
{
v
>>=
4
;
c
+=
4
;
}
if
(
!
(
v
&
0x3
))
{
v
>>=
2
;
c
+=
2
;
}
c
-=
v
&
0x1
;
return
c
;
}
#endif
/**
* Trailing zero bit count.
*
* @param v input value. If v is 0, the result is undefined.
* @return the number of trailing 0-bits
*/
int
av_ctz
(
int
v
);
/**
* @}
*/
...
...
libavutil/version.h
View file @
dfde8a34
...
...
@@ -37,7 +37,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR
0
#define LIBAVUTIL_VERSION_MINOR
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