Commit c76cf303 authored by Martin Vignali's avatar Martin Vignali

avcodec/magicyuv : use gradient_pred dsp func for 8 bits gradient mode

parent f2e9156e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment