avcodec/magicyuv: invert symbols when building vlc

Instead at every decoded symbol.
pull/350/head
Paul B Mahol 4 years ago
parent eb9fa00bcc
commit 445e5fb67a
  1. 10
      libavcodec/magicyuv.c

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

Loading…
Cancel
Save