git.videolan.org
/
ffmpeg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avcodec/cbrt_tablegen: speed up dynamic table creation
[ffmpeg.git]
/
libavcodec
/
cbrt_tablegen.h
diff --git
a/libavcodec/cbrt_tablegen.h
b/libavcodec/cbrt_tablegen.h
index
27a3e3a
..
59b5a1d
100644
(file)
--- a/
libavcodec/cbrt_tablegen.h
+++ b/
libavcodec/cbrt_tablegen.h
@@
-29,7
+29,7
@@
#include "libavcodec/aac_defines.h"
#if USE_FIXED
#include "libavcodec/aac_defines.h"
#if USE_FIXED
-#define CBRT(x)
(int)floor((x).f * 8192 + 0.5
)
+#define CBRT(x)
lrint((x).f * 8192
)
#else
#define CBRT(x) x.i
#endif
#else
#define CBRT(x) x.i
#endif
@@
-49,13
+49,12
@@
static av_cold void AAC_RENAME(cbrt_tableinit)(void)
{
if (!cbrt_tab[(1<<13) - 1]) {
int i;
{
if (!cbrt_tab[(1<<13) - 1]) {
int i;
- /* cbrtf() isn't available on all systems, so we use powf(). */
for (i = 0; i < 1<<13; i++) {
union {
float f;
uint32_t i;
} f;
for (i = 0; i < 1<<13; i++) {
union {
float f;
uint32_t i;
} f;
- f.f =
pow(i, 1.0 / 3.0
) * i;
+ f.f =
cbrt(i
) * i;
cbrt_tab[i] = CBRT(f);
}
}
cbrt_tab[i] = CBRT(f);
}
}