compression

Arduino: Lightweight compression algorithm to store data in EEPROM

心已入冬 提交于 2019-12-05 13:26:32
问题 I want to store a large amount of data onto my Arduino with a ATmega168/ATmega328 microcontroller, but unfortunately there's only 256 KB / 512 KB of EEPROM storage. My idea is to make use of an compression algorithm to strip down the size. But well, my knowledge on compression algorithms is quite low and my search for ready-to-use libraries failed. So, is there a good way to optimize the storage size? 回答1: You might have a look at the LZO algorithm, which is designed to be lightweight. I don

Compression of sequence of integers providing random access

孤人 提交于 2019-12-05 12:42:29
I have a sequence of n integers in a small range [0,k) and all the integers have the same frequency f (so the size of the sequence is n=f∗k ). What I'm trying to do now is to compress this sequence while providing random access (what is the i-th integer). The time to achieve random access doesn't have to be O(1). I'm more interested in achieving high compression at the expense of higher random access times. I haven't tried with Huffman coding since it assigns codes based on frequencies (and all my frequencies are the same). Perhaps I'm missing some simple encoding for this particular case. Any

Large number array compression

孤人 提交于 2019-12-05 12:18:51
I've got a javascript application that sends a large amount of numerical data down the wire. This data is then stored in a database. I am having size issues (too much bandwidth, database getting too big). I am now ready to sacrifice some performance for compression. I was thinking of implementing a base 62 number.toString(62) and parseInt(compressed, 62). This would certainly reduce the size of the data but before I go ahead and do this I thought I would put it to the folks here as I know there must be some outside the box solution I have not considered. The basic specs are: - Compress large

What is the maximum theoretically possible compression rate?

半城伤御伤魂 提交于 2019-12-05 09:53:57
问题 This is a theoretical question, so expect that many details here are not computable in practice or even in theory. Let's say I have a string s that I want to compress. The result should be a self-extracting binary (can be x86 assembler, but it can also be some other hypothetical Turing-complete low level language) which outputs s . Now, we can easily iterate through all possible such binaries and programs, ordered by size. Let B_s be the sub-list of these binaries who output s (of course B_s

How to retrieve data from a attached zip file in Blackberry application?

人盡茶涼 提交于 2019-12-05 09:43:07
问题 I am using eclipse to build application for Blackberry. I attached a zip file with my application. Please help me, I don't know how to retrieve data form the zip file in application development. 回答1: In BlackBerry we can use two compression standarts: GZip and ZLib. Choose one, then compress your file and add to project. Then you should be able to open it as an resource. After that decompress it with GZIPInputStream or ZLibInputStream accordingly. Example (uncompress and print text from test

GZip or Deflate for HTTP compression

梦想的初衷 提交于 2019-12-05 08:49:50
Which compression method is better? I've heard lots of back and forth about GZip being more widely used, but Deflate being faster (in some instances). Is there an accepted standard on which one to use and why? eigenein UPDATE According to the latest updates to the linked question, one should use GZip. See http://www.vervestudios.co/projects/compression-tests/results Old Answer Deflate is better . yorah Answers: http://www.stardeveloper.com/articles/display.html?article=2008111201&page=1 http://blog.usweb.com/archives/mod_deflate-vs-mod_gzip-comparing-the-two/ Why use deflate instead of gzip

How to create a zip file in memory, starting from file bytes?

拈花ヽ惹草 提交于 2019-12-05 08:44:11
I try to create a zip file in memory with c#, but the result is a zip file with corrupted files inside it. All file to zip are in a database. I store the bytes. The files are PDF. my code is the following //[extract bytes and file name for every file] using (var zipArchiveMemoryStream = new MemoryStream()) { using (var zipArchive = new ZipArchive(zipArchiveMemoryStream, ZipArchiveMode.Create, true)) { foreach (var file in fileData) { var zipEntry = zipArchive.CreateEntry(file.FileName); using (var entryStream = zipEntry.Open()) { using (var tmpMemory = new MemoryStream(file.Bytes)) { tmpMemory

ASCII compressor works for short test file, not on long

*爱你&永不变心* 提交于 2019-12-05 08:17:26
The current project in Systems Programming is to come up with an ASCII compressor that removes the top zero bit and writes the contents to the file. In order to facilitate decompression, the original file size is written to file, then the compressed char bytes. There are two files to run tests on- one that is 63 bytes long, and the other is 5344213 bytes. My code below works as expected for the first test file, as it writes 56 bytes of compressed text plus 4 bytes of file header. However, when I try it on the long test file, the compressed version is 3 bytes shorter than the original, when it

Where can I find a lossless compression algorithm, which produces headerless outputs?

别来无恙 提交于 2019-12-05 08:09:11
Does anyone of you know a lossless compression algorithm, which produces headerless outputs? For example do not store the huffman tree used to compress it? I do not speak about hard coded huffman trees, but I like to know if there is any algorithm that can compress and decompress input without storing some metadata in its output. Or is this even theoretically impossible? Adaptive Huffman coding does exactly that. More generally, the term adaptive coding is used to describe entropy codes with this property. Some dictionary codes have this property too, e.g. run-length encoding (RLE) and Lempel

What languages or methods allow graphics & music demos to fit in 64kb EXEs?

我怕爱的太早我们不能终老 提交于 2019-12-05 07:23:40
How is it possible that in a 64kb compiled exe, these programs can generate such crazy visuals, complete with matching music? An example: Ars Nova By Phantom Lord ( YouTube video of the demo running ) This program's only 64kb in size! How did they do that? Are they using some sorts of pre-existing objects, shaders, etc. inside DirectX or something like that? What languages do they even use? Is there some sort of guide to this stuff? EDIT: Another mind-blowing demo. How? http://www.scene.org/file.php?file=/demos/groups/farb-rausch/fr08_final.zip&fileinfo EDIT: More demoscene stuff. I found some