aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2011-12-12 10:23:51 -0800
committerAlex Converse <alex.converse@gmail.com>2011-12-12 21:36:54 -0800
commit5cd56e193fd3c9f04075ef95be2d4eade87ca870 (patch)
treeb7ecc7e65773344de6a1845ef8b25162acc8f5ea
parent58c42af722cebecd86e340dc3ed9ec44b1fe4a55 (diff)
downloadffmpeg-5cd56e193fd3c9f04075ef95be2d4eade87ca870.tar.gz
aacdec: Use intfloat.h rather than local punning union.
-rw-r--r--libavcodec/aacdec.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 8e4b510354..70396b63fa 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -98,6 +98,7 @@
#include "aacsbr.h"
#include "mpeg4audio.h"
#include "aacadtsdec.h"
+#include "libavutil/intfloat.h"
#include <assert.h>
#include <errno.h>
@@ -108,11 +109,6 @@
# include "arm/aac.h"
#endif
-union float754 {
- float f;
- uint32_t i;
-};
-
static VLC vlc_scalefactors;
static VLC vlc_spectral[11];
@@ -1004,7 +1000,7 @@ static inline float *VMUL4(float *dst, const float *v, unsigned idx,
static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
- union float754 s0, s1;
+ union av_intfloat32 s0, s1;
s0.f = s1.f = *scale;
s0.i ^= sign >> 1 << 31;
@@ -1022,8 +1018,8 @@ static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
unsigned nz = idx >> 12;
- union float754 s = { .f = *scale };
- union float754 t;
+ union av_intfloat32 s = { .f = *scale };
+ union av_intfloat32 t;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx & 3] * t.f;
@@ -1272,7 +1268,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
static av_always_inline float flt16_round(float pf)
{
- union float754 tmp;
+ union av_intfloat32 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
return tmp.f;
@@ -1280,7 +1276,7 @@ static av_always_inline float flt16_round(float pf)
static av_always_inline float flt16_even(float pf)
{
- union float754 tmp;
+ union av_intfloat32 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
return tmp.f;
@@ -1288,7 +1284,7 @@ static av_always_inline float flt16_even(float pf)
static av_always_inline float flt16_trunc(float pf)
{
- union float754 pun;
+ union av_intfloat32 pun;
pun.f = pf;
pun.i &= 0xFFFF0000U;
return pun.f;