aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/magicyuv.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-08-31 16:19:55 +0200
committerPaul B Mahol <onemda@gmail.com>2020-08-31 16:31:10 +0200
commit445e5fb67ab1bd5b59e89efe7c14cda692a30e15 (patch)
treee36596877a4f78416f1d54e86eb98a29bb960209 /libavcodec/magicyuv.c
parenteb9fa00bcc7138516009c6e060e07b510806fe61 (diff)
downloadffmpeg-445e5fb67ab1bd5b59e89efe7c14cda692a30e15.tar.gz
avcodec/magicyuv: invert symbols when building vlc
Instead at every decoded symbol.
Diffstat (limited to 'libavcodec/magicyuv.c')
-rw-r--r--libavcodec/magicyuv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
index 5d76274d54..dd947c3c2f 100644
--- a/libavcodec/magicyuv.c
+++ b/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;
}