summaryrefslogtreecommitdiff
path: root/libavutil/fixed_dsp.h
diff options
context:
space:
mode:
authorNedeljko Babic <nedeljko.babic@imgtec.com>2015-06-03 16:00:36 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-03 22:50:53 +0200
commit1a06d0935fb2be5925a073fb4fee3452e431f279 (patch)
treeb7184b987f840688e8c9ce42fd52e4c1701051d7 /libavutil/fixed_dsp.h
parent3e34b7498f14c04baadde1700a6f73a7e9e86fa6 (diff)
libavutil: Add new fixed dsp functions.
Add functions needed for implementation of fixed point aac dec. Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/fixed_dsp.h')
-rw-r--r--libavutil/fixed_dsp.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/libavutil/fixed_dsp.h b/libavutil/fixed_dsp.h
index ff6f36599a..03987adddc 100644
--- a/libavutil/fixed_dsp.h
+++ b/libavutil/fixed_dsp.h
@@ -54,8 +54,13 @@
#include "libavcodec/mathops.h"
typedef struct AVFixedDSPContext {
+ /* Assume len is a multiple of 16, and arrays are 32-byte aligned */
+ /* Results of multiplications are scaled down by 31 bit (and rounded) if not
+ * stated otherwise */
+
/**
* Overlap/add with window function.
+ * Result is scaled down by "bits" bits.
* Used primarily by MDCT-based audio codecs.
* Source and destination vectors must overlap exactly or not at all.
*
@@ -92,6 +97,60 @@ typedef struct AVFixedDSPContext {
*/
void (*vector_fmul_window)(int32_t *dst, const int32_t *src0, const int32_t *src1, const int32_t *win, int len);
+ /**
+ * Fixed-point multiplication that calculates the entry wise product of two
+ * vectors of integers and stores the result in a vector of integers.
+ *
+ * @param dst output vector
+ * constraints: 32-byte aligned
+ * @param src0 first input vector
+ * constraints: 32-byte aligned
+ * @param src1 second input vector
+ * constraints: 32-byte aligned
+ * @param len number of elements in the input
+ * constraints: multiple of 16
+ */
+ void (*vector_fmul)(int *dst, const int *src0, const int *src1,
+ int len);
+
+ void (*vector_fmul_reverse)(int *dst, const int *src0, const int *src1, int len);
+ /**
+ * Calculate the entry wise product of two vectors of integers, add a third vector of
+ * integers and store the result in a vector of integers.
+ *
+ * @param dst output vector
+ * constraints: 32-byte aligned
+ * @param src0 first input vector
+ * constraints: 32-byte aligned
+ * @param src1 second input vector
+ * constraints: 32-byte aligned
+ * @param src2 third input vector
+ * constraints: 32-byte aligned
+ * @param len number of elements in the input
+ * constraints: multiple of 16
+ */
+ void (*vector_fmul_add)(int *dst, const int *src0, const int *src1,
+ const int *src2, int len);
+
+ /**
+ * Calculate the scalar product of two vectors of integers.
+ *
+ * @param v1 first vector, 16-byte aligned
+ * @param v2 second vector, 16-byte aligned
+ * @param len length of vectors, multiple of 4
+ *
+ * @return sum of elementwise products
+ */
+ int (*scalarproduct_fixed)(const int *v1, const int *v2, int len);
+
+ /**
+ * Calculate the sum and difference of two vectors of integers.
+ *
+ * @param v1 first input vector, sum output, 16-byte aligned
+ * @param v2 second input vector, difference output, 16-byte aligned
+ * @param len length of vectors, multiple of 4
+ */
+ void (*butterflies_fixed)(int *av_restrict v1, int *av_restrict v2, int len);
} AVFixedDSPContext;
/**