comparison g726.c @ 7052:80ead68858f3 libavcodec

Float11 does not need int, .o file becomes smaller and the code might be faster.
author michael
date Mon, 16 Jun 2008 23:34:15 +0000
parents 4f1331b0d428
children e3ee81021cf1
comparison
equal deleted inserted replaced
7051:4f1331b0d428 7052:80ead68858f3
30 * G.726 Standard uses rather odd 11bit floating point arithmentic for 30 * G.726 Standard uses rather odd 11bit floating point arithmentic for
31 * numerous occasions. It's a mistery to me why they did it this way 31 * numerous occasions. It's a mistery to me why they did it this way
32 * instead of simply using 32bit integer arithmetic. 32 * instead of simply using 32bit integer arithmetic.
33 */ 33 */
34 typedef struct Float11 { 34 typedef struct Float11 {
35 int sign; /**< 1bit sign */ 35 uint8_t sign; /**< 1bit sign */
36 int exp; /**< 4bit exponent */ 36 uint8_t exp; /**< 4bit exponent */
37 int mant; /**< 6bit mantissa */ 37 uint8_t mant; /**< 6bit mantissa */
38 } Float11; 38 } Float11;
39 39
40 static inline Float11* i2f(int i, Float11* f) 40 static inline Float11* i2f(int i, Float11* f)
41 { 41 {
42 f->sign = (i < 0); 42 f->sign = (i < 0);