1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avcodec/magicyuv: invert symbols when building vlc

Instead at every decoded symbol.
This commit is contained in:
Paul B Mahol 2020-08-31 16:19:55 +02:00
parent eb9fa00bcc
commit 445e5fb67a

View File

@ -113,7 +113,7 @@ static int huff_build10(VLC *vlc, uint8_t *len)
for (i = 1023; i >= 0; i--) {
codes[i] = code >> (32 - he[i].len);
bits[i] = he[i].len;
syms[i] = he[i].sym;
syms[i] = 1023 - he[i].sym;
code += 0x80000000u >> (he[i].len - 1);
}
@ -145,7 +145,7 @@ static int huff_build12(VLC *vlc, uint8_t *len)
for (i = 4095; i >= 0; i--) {
codes[i] = code >> (32 - he[i].len);
bits[i] = he[i].len;
syms[i] = he[i].sym;
syms[i] = 4095 - he[i].sym;
code += 0x80000000u >> (he[i].len - 1);
}
@ -177,7 +177,7 @@ static int huff_build(VLC *vlc, uint8_t *len)
for (i = 255; i >= 0; i--) {
codes[i] = code >> (32 - he[i].len);
bits[i] = he[i].len;
syms[i] = he[i].sym;
syms[i] = 255 - he[i].sym;
code += 0x80000000u >> (he[i].len - 1);
}
@ -259,7 +259,7 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata,
if (pix < 0)
return AVERROR_INVALIDDATA;
dst[x] = max - pix;
dst[x] = pix;
}
dst += stride;
}
@ -389,7 +389,7 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata,
if (pix < 0)
return AVERROR_INVALIDDATA;
dst[x] = 255 - pix;
dst[x] = pix;
}
dst += stride;
}