avcodec/magicyuvenc: improve compression
authorPaul B Mahol <onemda@gmail.com>
Sun, 29 Oct 2017 11:13:54 +0000 (12:13 +0100)
committerPaul B Mahol <onemda@gmail.com>
Sun, 29 Oct 2017 11:15:24 +0000 (12:15 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/magicyuvenc.c

index f948b03..a30922f 100644 (file)
@@ -344,7 +344,7 @@ static int encode_table(AVCodecContext *avctx, uint8_t *dst,
 
     for (i = 0; i < 256; i++) {
         counts[i].prob++;
-        counts[i].value = i;
+        counts[i].value = 255 - i;
     }
 
     magy_huffman_compute_bits(counts, he, 256, 16);