aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/exr.c
diff options
context:
space:
mode:
authorMartin Vignali <martin.vignali@gmail.com>2017-10-01 21:37:15 +0200
committerJames Almer <jamrial@gmail.com>2017-10-01 17:35:30 -0300
commitac5908b13f16cbda396730c35f5f3125ca24577a (patch)
tree01f49a554ed8199b7aaa5d095c859796c6c10c18 /libavcodec/exr.c
parent59924d5eb11646f82f70c206be8a867468f102b9 (diff)
downloadffmpeg-ac5908b13f16cbda396730c35f5f3125ca24577a.tar.gz
libavcodec/exr : add x86 SIMD for predictor
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/exr.c')
-rw-r--r--libavcodec/exr.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 230d5bbca8..0b755db3cb 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -265,18 +265,6 @@ static inline uint16_t exr_halflt2uint(uint16_t v)
return (v + (1 << 16)) >> (exp + 1);
}
-static void predictor(uint8_t *src, int size)
-{
- uint8_t *t = src + 1;
- uint8_t *stop = src + size;
-
- while (t < stop) {
- int d = (int) t[-1] + (int) t[0] - 128;
- t[0] = d;
- ++t;
- }
-}
-
static int zip_uncompress(EXRContext *s, const uint8_t *src, int compressed_size,
int uncompressed_size, EXRThreadData *td)
{
@@ -288,7 +276,7 @@ static int zip_uncompress(EXRContext *s, const uint8_t *src, int compressed_size
av_assert1(uncompressed_size % 2 == 0);
- predictor(td->tmp, uncompressed_size);
+ s->dsp.predictor(td->tmp, uncompressed_size);
s->dsp.reorder_pixels(td->uncompressed_data, td->tmp, uncompressed_size);
return 0;
@@ -335,7 +323,7 @@ static int rle_uncompress(EXRContext *ctx, const uint8_t *src, int compressed_si
av_assert1(uncompressed_size % 2 == 0);
- predictor(td->tmp, uncompressed_size);
+ ctx->dsp.predictor(td->tmp, uncompressed_size);
ctx->dsp.reorder_pixels(td->uncompressed_data, td->tmp, uncompressed_size);
return 0;