RLE encoding/decoding tool
Hello World! I have done such a tool just because I'm working at the mpeg2-ts implementation in Silverlight project and RLE is one of the algorithms which is used in the mpeg2 compression.
I thought, that it would be better to divide such a big aim into the small aims. Soon, I shall publish my own implementations of other algorithms, but it's another story.
What about this project?
There are some features which are new from the origin ( standard ) RLE:
- first of if there goes only one char ( e.g. in original RLE it would be"abbbbbzccccc" -> "1a5b1z5c" ) in the string my tool doesn't explicitly mark thevalue '1' before the char, I've just not mark it, so as in example"abbbbbzccccc" you won't get the "1a5b1z5c" value, but you will get"a5bz5c" when you encode, e.g. standard output in my tool for encoding:
Base string (12 chars): abbbbbzccccc
After RLE-encoding (6 chars): a5bz5c
Compression percentage: %50
As you can see there is no any '1a' or '1z' etc...
I'm just skipping it in my tool. But if you want to use the standard output you can use the"-old" option (e.g. "encode abbbbbzccccc -old" ).
- RLE has in its abbreviation the keyword "encoding", but my tool is able also to decode the encoded string,e.g. standard output in my tool for decoding:
Base string (6 chars): 4a2b7c
After RLE-decoding (13 chars): aaaabbccccccc
Decompression percentage: %116.666666666667
- Also I'm calculating the compression/decompression percentage after encoding/decoding. It is a value, which determinates the compression/decompressiondifference.
- In the future uploads I shall add new checks and benchmarks tests in RLE encode/decode utility for the large strings and maybe smth else... I won't tell all future stuff.
- Despite on easy algorithm such as RLE, the source code is fully mine and isn't stolen from some resource. I've my own style of programming (on working with strings and program design), which could be recognized immediately, so the code is purely mine.
Also I want in future to make the benchmarks test and some new stuff in RLE, so it's also the sign, that project depends only on my skills.
Who doesn't know the definition of RLE, please read:
http://en.wikipedia.org/wiki/Run-length_encoding
I have chose the: C#, .NET FW 2.0 by default, because of the personal preferences and also for the such aims as to give you possibility of you want to upgrade to the higher version of the .NET Framework or using old 2008 express
edition IDE. I have to use the lower .NET version only for the compatibility aims and for easy reproduction the program to other language. I want to make it independent from the Linq syntax or another .NET modern stuff, I think that I shall make a fork
of project where will be pure/near functional style for: Lisp, Haskell, F# and functional-side of C#, so this fork is rather imperative and references to the simplified code for easy porting to another imperative language like a: VB.NET, D, PHP etc...
The details of the my first build, for the memory:
MD5 hash: 4d5a90030004000ffff00.
Oleg Orlov, 2013 (c) RLE encoding/decoding tool.
GNU General Public License version 2 (GPLv2).
http://rle.codeplex.com/license
Updated Wiki: Home
↧
↧
Trending Articles
More Pages to Explore .....