[FFmpeg-devel] [PATCH 05/11] avutil: move half-precision float helper to avutil
Timo Rothenpieler
timo at rothenpieler.org
Wed Aug 10 23:47:06 EEST 2022
---
libavcodec/exr.c | 2 +-
libavcodec/exrenc.c | 2 +-
libavcodec/pnmdec.c | 3 ++-
libavcodec/pnmenc.c | 2 +-
{libavcodec => libavutil}/float2half.h | 6 +++---
{libavcodec => libavutil}/half2float.h | 6 +++---
6 files changed, 11 insertions(+), 10 deletions(-)
rename {libavcodec => libavutil}/float2half.h (96%)
rename {libavcodec => libavutil}/half2float.h (96%)
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 3a6b9c3014..5c6ca9adbf 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -41,6 +41,7 @@
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/color_utils.h"
+#include "libavutil/half2float.h"
#include "avcodec.h"
#include "bytestream.h"
@@ -53,7 +54,6 @@
#include "exrdsp.h"
#include "get_bits.h"
#include "internal.h"
-#include "half2float.h"
#include "mathops.h"
#include "thread.h"
diff --git a/libavcodec/exrenc.c b/libavcodec/exrenc.c
index 8cf7827bb6..56c084d483 100644
--- a/libavcodec/exrenc.c
+++ b/libavcodec/exrenc.c
@@ -31,11 +31,11 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
+#include "libavutil/float2half.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.h"
-#include "float2half.h"
enum ExrCompr {
EXR_RAW,
diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c
index 130407df25..9383dc8e60 100644
--- a/libavcodec/pnmdec.c
+++ b/libavcodec/pnmdec.c
@@ -21,12 +21,13 @@
#include "config_components.h"
+#include "libavutil/half2float.h"
+
#include "avcodec.h"
#include "codec_internal.h"
#include "internal.h"
#include "put_bits.h"
#include "pnm.h"
-#include "half2float.h"
static void samplecpy(uint8_t *dst, const uint8_t *src, int n, int maxval)
{
diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c
index b16c93c88f..7ce534d06e 100644
--- a/libavcodec/pnmenc.c
+++ b/libavcodec/pnmenc.c
@@ -24,10 +24,10 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
+#include "libavutil/float2half.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
-#include "float2half.h"
typedef struct PHMEncContext {
uint16_t basetable[512];
diff --git a/libavcodec/float2half.h b/libavutil/float2half.h
similarity index 96%
rename from libavcodec/float2half.h
rename to libavutil/float2half.h
index e05125088c..d6aaab8278 100644
--- a/libavcodec/float2half.h
+++ b/libavutil/float2half.h
@@ -16,8 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef AVCODEC_FLOAT2HALF_H
-#define AVCODEC_FLOAT2HALF_H
+#ifndef AVUTIL_FLOAT2HALF_H
+#define AVUTIL_FLOAT2HALF_H
#include <stdint.h>
@@ -64,4 +64,4 @@ static uint16_t float2half(uint32_t f, uint16_t *basetable, uint8_t *shifttable)
return h;
}
-#endif /* AVCODEC_FLOAT2HALF_H */
+#endif /* AVUTIL_FLOAT2HALF_H */
diff --git a/libavcodec/half2float.h b/libavutil/half2float.h
similarity index 96%
rename from libavcodec/half2float.h
rename to libavutil/half2float.h
index 7df6747e50..1f6deade07 100644
--- a/libavcodec/half2float.h
+++ b/libavutil/half2float.h
@@ -16,8 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef AVCODEC_HALF2FLOAT_H
-#define AVCODEC_HALF2FLOAT_H
+#ifndef AVUTIL_HALF2FLOAT_H
+#define AVUTIL_HALF2FLOAT_H
#include <stdint.h>
@@ -71,4 +71,4 @@ static uint32_t half2float(uint16_t h, const uint32_t *mantissatable, const uint
return f;
}
-#endif /* AVCODEC_HALF2FLOAT_H */
+#endif /* AVUTIL_HALF2FLOAT_H */
--
2.34.1
More information about the ffmpeg-devel
mailing list