[FFmpeg-cvslog] aacdec: Use intfloat.h rather than local punning union.

Alex Converse git at videolan.org
Tue Dec 13 23:33:44 CET 2011


ffmpeg | branch: master | Alex Converse <alex.converse at gmail.com> | Mon Dec 12 10:23:51 2011 -0800| [5cd56e193fd3c9f04075ef95be2d4eade87ca870] | committer: Alex Converse

aacdec: Use intfloat.h rather than local punning union.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5cd56e193fd3c9f04075ef95be2d4eade87ca870
---

 libavcodec/aacdec.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 8e4b510..70396b6 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;



More information about the ffmpeg-cvslog mailing list