[FFmpeg-devel] Doubts regarding SoftFloat
michael at niedermayer.cc
Tue May 31 23:08:23 CEST 2016
On Tue, May 31, 2016 at 09:02:01PM +0530, Umair Khan wrote:
> Hi all,
> I replaced floats in my code with SoftFloat and the results weren't as expected.
> I also had some doubts the way it is written.
> 1. The biggest one is why is the mantissa part of FLOAT_1 defined as
> 0x20000000 here -
> If I'm right, the mantissa part of an IEEE 754 float should have all
> mantissa bits unset, i.e., it should just be 0 if we talk in hex or
> decimal format. Also, mantissa is supposed to be 23 bits long, whereas
> the highest set bit of 0x20000000 is at 30th position.
SoftFloat makes no attempt to match 23 bit mantisse floats
Its goals where more to use the available space in 32bits ints
efficiently, be fast, accurate (in relation to the ideal infinite
precission) and binary reproducable.
It might be possible to extend it to work with 24bit mantissas if
that is something someone wants, if thats practical to make it
usable in a lossless integer coder i dont know.
I didnt realize you intend to use this in ALS before
> 2. Why isn't there a variable for the sign bit ? How do I know if a
> particular SoftFloat is positive or negative ?
the mantisse is signed but really thats a implementation detail
code that deals with the numbers at that low level should be in the
softfloat code and not the app using it
> 3. After making the changes, the exp part was always one less than
> what it should have been (I couldn't figure out why) and the mantissa
> was totally different altogether. This is the commit which converts
> float to SoftFloat -
> P.S. The code is working perfectly fine with just float.
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 181 bytes
Desc: Digital signature
More information about the ffmpeg-devel