summaryrefslogtreecommitdiffstats
path: root/libavcodec/dcaenc.h
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2017-02-20 23:22:51 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-05-08 05:56:14 +0100
commitb8c2b9c39279171f647d9c81f34ffa3d3ae93c47 (patch)
treefc50e13f8009274c05ab06eeeb80757b6dc10a94 /libavcodec/dcaenc.h
parent5f928c5201c077b9765610bc5304235c3f1d9bd6 (diff)
downloadffmpeg-streaming-b8c2b9c39279171f647d9c81f34ffa3d3ae93c47.zip
ffmpeg-streaming-b8c2b9c39279171f647d9c81f34ffa3d3ae93c47.tar.gz
avcodec/dcaenc: Initial implementation of ADPCM encoding for DCA encoder
Diffstat (limited to 'libavcodec/dcaenc.h')
-rw-r--r--libavcodec/dcaenc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/dcaenc.h b/libavcodec/dcaenc.h
index 06816c2..63fdaf0 100644
--- a/libavcodec/dcaenc.h
+++ b/libavcodec/dcaenc.h
@@ -24,6 +24,8 @@
#include <stdint.h>
+#include "dcamath.h"
+
typedef struct {
int32_t m;
int32_t e;
@@ -144,4 +146,13 @@ static const int8_t channel_reorder_nolfe[16][9] = {
{ 3, 2, 4, 0, 1, 5, 7, 6, -1 },
};
+static inline int32_t quantize_value(int32_t value, softfloat quant)
+{
+ int32_t offset = 1 << (quant.e - 1);
+
+ value = mul32(value, quant.m) + offset;
+ value = value >> quant.e;
+ return value;
+}
+
#endif /* AVCODEC_DCAENC_H */
OpenPOWER on IntegriCloud