1
0
mirror of https://github.com/nu774/fdkaac.git synced 2025-06-05 23:29:14 +02:00

2 Commits

Author SHA1 Message Date
f333a45f78 update version.h 2013-01-05 14:04:44 +09:00
6da14aaeb7 fixed to clip before converting float to int 2013-01-05 10:47:21 +09:00
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ inline int lrint(double x)
# endif # endif
#endif #endif
inline int pcm_clip(int n, int min_value, int max_value) inline double pcm_clip(double n, double min_value, double max_value)
{ {
if (n < min_value) if (n < min_value)
return min_value; return min_value;
@ -67,7 +67,7 @@ inline int16_t pcm_quantize_s32(int32_t n)
} }
inline int16_t pcm_quantize_f64(double v) inline int16_t pcm_quantize_f64(double v)
{ {
return pcm_clip(lrint(v * 32768.0), -32768, 32767); return (int16_t)lrint(pcm_clip(v * 32768.0, -32768.0, 32767.0));
} }
inline int16_t pcm_s8_to_s16(int8_t n) inline int16_t pcm_s8_to_s16(int8_t n)
{ {

View File

@ -1,4 +1,4 @@
#ifndef VERSION_H #ifndef VERSION_H
#define VERSION_H #define VERSION_H
const char *fdkaac_version = "0.0.1"; const char *fdkaac_version = "0.0.2";
#endif #endif