1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
20
21 #if !HAVE_FAST_FLOAT16
23 {
24 int32_t m =
i << 13;
// Zero pad mantissa bits
26
27 while (!(m & 0x00800000)) { // While not normalized
28 e -= 0x00800000; // Decrement exponent (1<<23)
29 m <<= 1; // Shift mantissa
30 }
31
32 m &= ~0x00800000; // Clear leading 1 bit
33 e += 0x38800000; // Adjust bias ((127-14)<<23)
34
35 return m | e; // Return combined number
36 }
37 #endif
38
40 {
41 #if !HAVE_FAST_FLOAT16
43 for (
int i = 1;
i < 1024;
i++)
45 for (
int i = 1024;
i < 2048;
i++)
47 for (
int i = 2048;
i < 3072;
i++)
50
52 for (
int i = 1;
i < 31;
i++)
54 for (
int i = 33;
i < 63;
i++)
59
61 for (
int i = 1;
i < 64;
i++)
66 #endif
67 }