Coverage Report

Created: 2026-01-25 07:18

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/ffmpeg/libavutil/half2float.h
Line
Count
Source
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
19
#ifndef AVUTIL_HALF2FLOAT_H
20
#define AVUTIL_HALF2FLOAT_H
21
22
#include <stdint.h>
23
#include "intfloat.h"
24
25
#include "config.h"
26
27
typedef struct Half2FloatTables {
28
#if HAVE_FAST_FLOAT16
29
    uint8_t dummy;
30
#else
31
    uint32_t mantissatable[3072];
32
    uint32_t exponenttable[64];
33
    uint16_t offsettable[64];
34
#endif
35
} Half2FloatTables;
36
37
void ff_init_half2float_tables(Half2FloatTables *t);
38
39
static inline uint32_t half2float(uint16_t h, const Half2FloatTables *t)
40
0
{
41
#if HAVE_FAST_FLOAT16
42
    union {
43
        _Float16 f;
44
        uint16_t i;
45
    } u;
46
    u.i = h;
47
    return av_float2int(u.f);
48
#else
49
0
    uint32_t f;
50
51
0
    f = t->mantissatable[t->offsettable[h >> 10] + (h & 0x3ff)] + t->exponenttable[h >> 10];
52
53
0
    return f;
54
0
#endif
55
0
}
Unexecuted instantiation: swscale.c:half2float
Unexecuted instantiation: utils.c:half2float
Unexecuted instantiation: vscale.c:half2float
Unexecuted instantiation: hscale_fast_bilinear_simd.c:half2float
Unexecuted instantiation: yuv2rgb.c:half2float
Unexecuted instantiation: alphablend.c:half2float
Unexecuted instantiation: graph.c:half2float
Unexecuted instantiation: hscale_fast_bilinear.c:half2float
Unexecuted instantiation: input.c:half2float
Unexecuted instantiation: options.c:half2float
Unexecuted instantiation: output.c:half2float
Unexecuted instantiation: rgb2rgb.c:half2float
Unexecuted instantiation: slice.c:half2float
Unexecuted instantiation: swscale_unscaled.c:half2float
Unexecuted instantiation: gamma.c:half2float
Unexecuted instantiation: hscale.c:half2float
Unexecuted instantiation: half2float.c:half2float
56
57
#endif /* AVUTIL_HALF2FLOAT_H */