summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2017-04-10 11:31:11 +0200
committerPaul B Mahol <onemda@gmail.com>2017-04-10 12:04:14 +0200
commit4dc2dd80dc78f4abb19052682bfb68d64a7a96d6 (patch)
tree8f74eb98c1937cea2ae14b4efcd3392792252f78
parent9cd44e64be25ac301fd0ee9330d13c0e4bef63e0 (diff)
avutil/float_dsp: add vector_dmac_scalar()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavutil/float_dsp.c9
-rw-r--r--libavutil/float_dsp.h16
-rw-r--r--libavutil/version.h2
3 files changed, 26 insertions, 1 deletions
diff --git a/libavutil/float_dsp.c b/libavutil/float_dsp.c
index c85daffc6a..1d4911d815 100644
--- a/libavutil/float_dsp.c
+++ b/libavutil/float_dsp.c
@@ -40,6 +40,14 @@ static void vector_fmac_scalar_c(float *dst, const float *src, float mul,
dst[i] += src[i] * mul;
}
+static void vector_dmac_scalar_c(double *dst, const double *src, double mul,
+ int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ dst[i] += src[i] * mul;
+}
+
static void vector_fmul_scalar_c(float *dst, const float *src, float mul,
int len)
{
@@ -125,6 +133,7 @@ av_cold AVFloatDSPContext *avpriv_float_dsp_alloc(int bit_exact)
fdsp->vector_fmul = vector_fmul_c;
fdsp->vector_fmac_scalar = vector_fmac_scalar_c;
fdsp->vector_fmul_scalar = vector_fmul_scalar_c;
+ fdsp->vector_dmac_scalar = vector_dmac_scalar_c;
fdsp->vector_dmul_scalar = vector_dmul_scalar_c;
fdsp->vector_fmul_window = vector_fmul_window_c;
fdsp->vector_fmul_add = vector_fmul_add_c;
diff --git a/libavutil/float_dsp.h b/libavutil/float_dsp.h
index d1be38f947..2c24d93471 100644
--- a/libavutil/float_dsp.h
+++ b/libavutil/float_dsp.h
@@ -55,6 +55,22 @@ typedef struct AVFloatDSPContext {
int len);
/**
+ * Multiply a vector of doubles by a scalar double and add to
+ * destination vector. Source and destination vectors must
+ * overlap exactly or not at all.
+ *
+ * @param dst result vector
+ * constraints: 32-byte aligned
+ * @param src input vector
+ * constraints: 32-byte aligned
+ * @param mul scalar value
+ * @param len length of vector
+ * constraints: multiple of 16
+ */
+ void (*vector_dmac_scalar)(double *dst, const double *src, double mul,
+ int len);
+
+ /**
* Multiply a vector of floats by a scalar float. Source and
* destination vectors must overlap exactly or not at all.
*
diff --git a/libavutil/version.h b/libavutil/version.h
index 95e1e929f3..f4d0930689 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -80,7 +80,7 @@
#define LIBAVUTIL_VERSION_MAJOR 55
#define LIBAVUTIL_VERSION_MINOR 60
-#define LIBAVUTIL_VERSION_MICRO 100
+#define LIBAVUTIL_VERSION_MICRO 101
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \