diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-20 22:12:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-20 22:12:56 +0100 |
commit | f9c7b14c040fe1c5f9253d7abd474f8b2282903c (patch) | |
tree | 8524ee95a63b92bebf89add399a502f2d7dcf933 /libavcodec/huffyuvenc.c | |
parent | f70d7eb20c1d5a920f80ef73d1bb6199feedcec4 (diff) | |
download | ffmpeg-f9c7b14c040fe1c5f9253d7abd474f8b2282903c.tar.gz |
avcdoec/huffyuvenc: optimize sub_left_prediction()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/huffyuvenc.c')
-rw-r--r-- | libavcodec/huffyuvenc.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 206f182850..aba8f9c09c 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -69,15 +69,22 @@ static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst, } else { const uint16_t *src16 = (const uint16_t *)src; uint16_t *dst16 = ( uint16_t *)dst; - - for (i = 0; i < w; i++) { - const int temp = src16[i]; - dst16[i] = temp - left; - left = temp; + if (w < 32) { + for (i = 0; i < w; i++) { + const int temp = src16[i]; + dst16[i] = temp - left; + left = temp; + } + return left; + } else { + for (i = 0; i < 16; i++) { + const int temp = src16[i]; + dst16[i] = temp - left; + left = temp; + } + s->llviddsp.diff_int16(dst16 + 16, src16 + 16, src16 + 15, s->n - 1, w - 16); + return src16[w-1]; } - return left; - - //FIXME optimize } } |