lossless-compression

Can anyone make heads or tales of this spigot algorithm code Pitiny.c

与世无争的帅哥 提交于 2019-11-29 15:22:16
问题 This C program is just 143 characters long! But it “decompresses” into the first 10,000 digits of Pi . // Created by cheeseMan on 30/11/13. long a[35014],b,c=35014,d,e,f=1e4,g,h; int main(int argc, const char * argv[]) { for(;(b=c-=14); h=printf("%04ld",e+d/f)) for(e=d%=f;(g=--b*2);d/=g) d=d*b+f*(h?a[b]:f/5), a[b]=d%--g; } I was doing some research on loss-less compression algorithms, still no luck yet, when I came across this pitiny.c . The weird thing is that it compiles successfully no

100% Java library for JPEG lossless decoding

自作多情 提交于 2019-11-29 03:06:04
问题 I'm searching for a library in 100% Java which could decode JPEG images with jpeg-lossless compression. I know that ImageIO and JAI already could decode this images, but they're needed a native code which do not exists for all OS. I would consider open and close source solutions, as ImageIO plugin or stand-alone. 回答1: Marco Schmidt wrote a handy "List of Java libraries to read and write pixel image files" a long time ago. It is gone from the web now, but it still possible to view it with the

Why does base64-encoded data compress so poorly?

橙三吉。 提交于 2019-11-27 20:02:30
问题 I was recently compressing some files, and I noticed that base64-encoded data seems to compress really bad. Here is one example: Original file: 429,7 MiB compress via xz -9 : 13,2 MiB / 429,7 MiB = 0,031 4,9 MiB/s 1:28 base64 it and compress via xz -9 : 26,7 MiB / 580,4 MiB = 0,046 2,6 MiB/s 3:47 base64 the original compressed xz file: 17,8 MiB in almost no time = the expected 1.33x increase in size So what can be observed is that: xz compresses really good ☺ base64-encoded data doesn't

h264 lossless coding

余生颓废 提交于 2019-11-27 11:19:48
Is it possible to do completely lossless encoding in h264? By lossless, I mean that if I feed it a series of frames and encode them, and then if I extract all the frames from the encoded video, I will get the exact same frames as in the input, pixel by pixel, frame by frame. Is that actually possible? Take this example: I generate a bunch of frames, then I encode the image sequence to an uncompressed AVI (with something like virtualdub), I then apply lossless h264 (the help files claim that setting --qp 0 makes lossless compression, but I am not sure if that means that there is no loss at any

String compression in JavaScript

南楼画角 提交于 2019-11-27 03:27:43
I'm looking for a JavaScript function that given a string returns a compressed (shorter) string. I'm developing a Chrome web application that saves long strings (HTML) to a local database. For testing purposes I tried to zip the file storing the database, and it shrank by a factor of five, so I figured it would help keep the database smaller if I compressed the things it stores. I've found an implementation of LZSS in JavaScript here: http://code.google.com/p/u-lzss/ ("U-LZSS"). It seemed to work when I tested it "by hand" with short example strings (decode === encode), and it's reasonably

Is JPEG lossless when quality is set to 100?

一曲冷凌霜 提交于 2019-11-26 06:38:39
问题 I understand that JPEG is a lossy compression standard, and that the \'quality\' factor controls the degree of compression and thus the amount of data loss. But when the quality number is set to 100, is the resulting jpeg lossless? 回答1: As correctly answered above, using a "typical" JPEG encoder at quality 100 does not give you lossless compression. Lossless JPEG encoding exists, but it's different in nature and seldom used. I'm just posting to say why quality 100 does not mean lossless . In