mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
Original Commit: r6 | ods15 | 2006-09-16 20:36:31 +0300 (Sat, 16 Sep 2006) | 2 lines
add correct and working put_float ... Originally committed as revision 6417 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
3112124154
commit
1f7e7464e9
@ -67,7 +67,13 @@ static inline int ilog(unsigned int a) {
|
||||
}
|
||||
|
||||
static void put_float(PutBitContext * pb, float f) {
|
||||
put_bits(pb, 32, *(uint32_t*)&f);
|
||||
int exp, mant;
|
||||
uint32_t res = 0;
|
||||
mant = (int)ldexp(frexp(f, &exp), 20);
|
||||
exp += 788 - 20;
|
||||
if (mant < 0) { res |= (1 << 31); mant = -mant; }
|
||||
res |= mant | (exp << 21);
|
||||
put_bits(pb, 32, res);
|
||||
}
|
||||
|
||||
static void put_codebook_header(PutBitContext * pb, codebook_t * cb) {
|
||||
|
Loading…
Reference in New Issue
Block a user