summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Vignali <martin.vignali@gmail.com>2017-12-09 19:26:47 +0100
committerMartin Vignali <martin.vignali@gmail.com>2017-12-19 20:55:12 +0100
commitc76cf303ce1131ca3ac249bb9328567797761e41 (patch)
tree79cd226c27d01bdca8d19e85106d4279330c711d
parentf2e9156eb62b4e862c08ffaf8054b546a7cc591f (diff)
downloadffmpeg-streaming-c76cf303ce1131ca3ac249bb9328567797761e41.zip
ffmpeg-streaming-c76cf303ce1131ca3ac249bb9328567797761e41.tar.gz
avcodec/magicyuv : use gradient_pred dsp func for 8 bits gradient mode
-rw-r--r--libavcodec/magicyuv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
index 195df12..9c6e1ba 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;
OpenPOWER on IntegriCloud