Signed-off-by: James Almer <jamr...@gmail.com>
---
libavcodec/flacdec.c | 8 ++------
libavcodec/flacdsp.c | 20 ++++++++++++++++++++
libavcodec/flacdsp.h | 3 +++
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 91bbdc657d..6e6a2896b4 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -602,13 +602,9 @@ static inline int decode_subframe(FLACContext *s, int
channel)
if (wasted) {
if (wasted+bps == 33) {
- int i;
- for (i = 0; i < s->blocksize; i++)
- s->decoded_33bps[i] = (uint64_t)decoded[i] << wasted;
+ s->dsp.wasted33(s->decoded_33bps, decoded, wasted, s->blocksize);
} else if (wasted < 32) {
- int i;
- for (i = 0; i < s->blocksize; i++)
- decoded[i] = (unsigned)decoded[i] << wasted;
+ s->dsp.wasted32(decoded, wasted, s->blocksize);
}
}
diff --git a/libavcodec/flacdsp.c b/libavcodec/flacdsp.c
index 71b4ac44aa..610831348a 100644
--- a/libavcodec/flacdsp.c
+++ b/libavcodec/flacdsp.c
@@ -84,11 +84,31 @@ static void flac_lpc_32_c(int32_t *decoded, const int
coeffs[32],
}
+static void flac_wasted_32_c(int32_t *decoded, int wasted, int len)
+{
+ int i;
+
+ for (i = 0; i < len; i++)
+ decoded[i] = (unsigned)decoded[i] << wasted;
+}
+
+static void flac_wasted_33_c(int64_t *decoded, const int32_t *residual,
+ int wasted, int len)
+{
+ int i;
+
+ for (i = 0; i < len; i++)