diff options
author | Martin Vignali <martin.vignali@gmail.com> | 2017-12-09 19:26:47 +0100 |
---|---|---|
committer | Martin Vignali <martin.vignali@gmail.com> | 2017-12-19 20:55:12 +0100 |
commit | c76cf303ce1131ca3ac249bb9328567797761e41 (patch) | |
tree | 79cd226c27d01bdca8d19e85106d4279330c711d /libavcodec/magicyuv.c | |
parent | f2e9156eb62b4e862c08ffaf8054b546a7cc591f (diff) | |
download | ffmpeg-c76cf303ce1131ca3ac249bb9328567797761e41.tar.gz |
avcodec/magicyuv : use gradient_pred dsp func for 8 bits gradient mode
Diffstat (limited to 'libavcodec/magicyuv.c')
-rw-r--r-- | libavcodec/magicyuv.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index 195df121cd..9c6e1ba1b1 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -345,7 +345,7 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, MagicYUVContext *s = avctx->priv_data; int interlaced = s->interlaced; AVFrame *p = s->p; - int i, k, x; + int i, k, x, min_width; GetBitContext gb; uint8_t *dst; @@ -413,16 +413,19 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, s->llviddsp.add_left_pred(dst, dst, width, 0); dst += stride; } + min_width = FFMIN(width, 32); for (k = 1 + interlaced; k < height; k++) { top = dst[-fake_stride]; left = top + dst[0]; dst[0] = left; - for (x = 1; x < width; x++) { + for (x = 1; x < min_width; x++) { /* dsp need aligned 32 */ top = dst[x - fake_stride]; lefttop = dst[x - (fake_stride + 1)]; left += top - lefttop + dst[x]; dst[x] = left; } + if (width > 32) + s->llviddsp.add_gradient_pred(dst + 32, fake_stride, width - 32); dst += stride; } break; |