From a54a51cc9bdd0596fd205db1db826d7e9d509541 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Fri, 14 Nov 2014 14:39:45 +0100
Subject: [PATCH] avutil/float_dsp: add avpriv_float_dsp_alloc()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 doc/APIchanges        |  3 +++
 libavutil/float_dsp.c | 11 ++++++++++-
 libavutil/float_dsp.h |  7 +++++++
 libavutil/version.h   |  2 +-
 4 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 79cccd27975..ff444687db0 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2014-08-09
 
 API changes, most recent first:
 
+2014-11-18 - xxxxxxx - lavu 54.14.100 - float_dsp.h
+  Add avpriv_float_dsp_alloc().
+
 2014-11-16 - xxxxxxx - lavf 56.13.0 - avformat.h
   Add AVStream.recommended_encoder_configuration with accessors.
 
diff --git a/libavutil/float_dsp.c b/libavutil/float_dsp.c
index 78de1a1d3c4..467d7a74c13 100644
--- a/libavutil/float_dsp.c
+++ b/libavutil/float_dsp.c
@@ -22,6 +22,7 @@
 #include "config.h"
 #include "attributes.h"
 #include "float_dsp.h"
+#include "mem.h"
 
 static void vector_fmul_c(float *dst, const float *src0, const float *src1,
                           int len)
@@ -139,6 +140,15 @@ av_cold void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact)
         ff_float_dsp_init_mips(fdsp);
 }
 
+av_cold AVFloatDSPContext *avpriv_float_dsp_alloc(int bit_exact)
+{
+    AVFloatDSPContext *ret = av_mallocz(sizeof(AVFloatDSPContext));
+    if (ret)
+        avpriv_float_dsp_init(ret, bit_exact);
+    return ret;
+}
+
+
 #ifdef TEST
 
 #include <float.h>
@@ -158,7 +168,6 @@ av_cold void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact)
 #include "internal.h"
 #include "lfg.h"
 #include "log.h"
-#include "mem.h"
 #include "random_seed.h"
 
 #define LEN 240
diff --git a/libavutil/float_dsp.h b/libavutil/float_dsp.h
index 7fc851b6e5f..543f7014eea 100644
--- a/libavutil/float_dsp.h
+++ b/libavutil/float_dsp.h
@@ -185,4 +185,11 @@ void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int strict);
 void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp);
 void ff_float_dsp_init_mips(AVFloatDSPContext *fdsp);
 
+/**
+ * Allocate a float DSP context.
+ *
+ * @param strict  setting to non-zero avoids using functions which may not be IEEE-754 compliant
+ */
+AVFloatDSPContext *avpriv_float_dsp_alloc(int strict);
+
 #endif /* AVUTIL_FLOAT_DSP_H */
diff --git a/libavutil/version.h b/libavutil/version.h
index bf7c7ef8c2f..e5c6e01a1c4 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,7 +56,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  54
-#define LIBAVUTIL_VERSION_MINOR  13
+#define LIBAVUTIL_VERSION_MINOR  14
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
GitLab