summaryrefslogtreecommitdiffstats
path: root/libavcodec/lossless_audiodsp.c
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2016-05-01 15:33:47 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-05-11 21:03:07 +0200
commit9ca16bdd3f0461b40d369080647747ae70715daf (patch)
treeebd5e6e8acaa786ab01e3883fdf7838c66695a1e /libavcodec/lossless_audiodsp.c
parentbf29794022db597f526a8575648244a7c6ee15ed (diff)
downloadffmpeg-streaming-9ca16bdd3f0461b40d369080647747ae70715daf.zip
ffmpeg-streaming-9ca16bdd3f0461b40d369080647747ae70715daf.tar.gz
lossless audio dsp: unroll
The loops are guaranteed to be at least multiples of 8, so this unrolling is safe but allows exploiting execution ports. For int32 version: 68 -> 58c. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/lossless_audiodsp.c')
-rw-r--r--libavcodec/lossless_audiodsp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/lossless_audiodsp.c b/libavcodec/lossless_audiodsp.c
index ea0568e..e3ea8e1 100644
--- a/libavcodec/lossless_audiodsp.c
+++ b/libavcodec/lossless_audiodsp.c
@@ -29,10 +29,12 @@ static int32_t scalarproduct_and_madd_int16_c(int16_t *v1, const int16_t *v2,
{
int res = 0;
- while (order--) {
+ do {
res += *v1 * *v2++;
*v1++ += mul * *v3++;
- }
+ res += *v1 * *v2++;
+ *v1++ += mul * *v3++;
+ } while (order-=2);
return res;
}
@@ -42,10 +44,12 @@ static int32_t scalarproduct_and_madd_int32_c(int16_t *v1, const int32_t *v2,
{
int res = 0;
- while (order--) {
+ do {
+ res += *v1 * *v2++;
+ *v1++ += mul * *v3++;
res += *v1 * *v2++;
*v1++ += mul * *v3++;
- }
+ } while (order-=2);
return res;
}
OpenPOWER on IntegriCloud