1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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

This commit is contained in:
Martin Vignali 2017-12-09 19:26:47 +01:00
parent f2e9156eb6
commit c76cf303ce

View File

@ -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;