[FFmpeg-devel] Doubts regarding SoftFloat

Umair Khan omerjerk at gmail.com
Tue May 31 17:32:01 CEST 2016


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 -
https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/softfloat.h#L41.
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.

2. Why isn't there a variable for the sign bit ? How do I know if a
particular SoftFloat is positive or negative ?

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 -
https://github.com/omerjerk/FFmpeg/commit/d3f4cba1ebaa072bcb70cb8ae7bb4cef4765f1b7

P.S. The code is working perfectly fine with just float.

Thanks,
Umair


More information about the ffmpeg-devel mailing list