summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorNedeljko Babic <nedeljko.babic@imgtec.com>2015-04-15 15:14:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-15 18:53:55 +0200
commitf4ccf3890285f2c5a055f0cc92405a0f46cdfab2 (patch)
tree750542ac34005fb3bdd82d98e461946125f47df0 /libavutil
parent574978d2bdbc7a8c63e6030cf8b14233f8b0ac3b (diff)
libavutil/softfloat: Change order of fields in SoftFloat structure.
Softfloat will be used in implementation of AAC fixed point decoder. This change is needed in order to more easily integrate ffmpegs softfloat in already developed algorithm for AAC. Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/softfloat.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index 8647e6a4fc..654a31f9ad 100644
--- a/libavutil/softfloat.h
+++ b/libavutil/softfloat.h
@@ -31,8 +31,8 @@
#define ONE_BITS 29
typedef struct SoftFloat{
- int32_t exp;
int32_t mant;
+ int32_t exp;
}SoftFloat;
static av_const SoftFloat av_normalize_sf(SoftFloat a){
@@ -67,10 +67,10 @@ static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){
return a;
#elif 1
int t= a.mant + 0x40000000 < 0;
- return (SoftFloat){a.exp+t, a.mant>>t};
+ return (SoftFloat){ a.mant>>t, a.exp+t};
#else
int t= (a.mant + 0x40000000U)>>31;
- return (SoftFloat){a.exp+t, a.mant>>t};
+ return (SoftFloat){a.mant>>t, a.exp+t};
#endif
}
@@ -105,19 +105,19 @@ static inline av_const int av_cmp_sf(SoftFloat a, SoftFloat b){
static inline av_const SoftFloat av_add_sf(SoftFloat a, SoftFloat b){
int t= a.exp - b.exp;
if (t <-31) return b;
- else if (t < 0) return av_normalize1_sf((SoftFloat){b.exp, b.mant + (a.mant >> (-t))});
- else if (t < 32) return av_normalize1_sf((SoftFloat){a.exp, a.mant + (b.mant >> t )});
+ else if (t < 0) return av_normalize1_sf((SoftFloat){b.mant + (a.mant >> (-t)), b.exp});
+ else if (t < 32) return av_normalize1_sf((SoftFloat){a.mant + (b.mant >> t ), a.exp});
else return a;
}
static inline av_const SoftFloat av_sub_sf(SoftFloat a, SoftFloat b){
- return av_add_sf(a, (SoftFloat){b.exp, -b.mant});
+ return av_add_sf(a, (SoftFloat){ -b.mant, b.exp});
}
//FIXME sqrt, log, exp, pow, sin, cos
static inline av_const SoftFloat av_int2sf(int v, int frac_bits){
- return av_normalize_sf((SoftFloat){ONE_BITS-frac_bits, v});
+ return av_normalize_sf((SoftFloat){v, ONE_BITS-frac_bits});
}
/**