Skip to content

yashikota/mtf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mtf

English | Japanese

Name

enc - Encodes input text using the Move-To-Front transform
dec - Decode text encoded by Move-To-Front

Synopsis

./enc [OPTION] FILE
./dec [OPTION] FILE

Description

Option

-o
Specify the name of the output file.
If not specified, the output will be the name of the input file.

Usage

Encode

./enc test.txt

The test.txt is MTF transformed and test.mtf is generated.

./enc -o output.mtf input.txt

The input.txt is MTF transformed and output.mtf is generated.

Decode

./dec test.mtf

The test.mtf is decoded and test.txt is generated.

./dec -o output.txt input.mtf

The input.mtf is decoded and output.txt is generated.

Build

make

The enc and dec are created in the current directory.

Example

Original

128
128
128
128
128
128
128
128
128
128
128
128
255
255
255
255
255
255
255
255
255
255
255
255
0
255
255
128
128
128
0
255
128
128
128
128

Transformed

128
1
0
0
0
0
0
0
0
0
0
0
255
1
0
0
0
0
0
0
0
0
0
0
2
0
0
2
1
0
2
2
0
0
0
0

Releases

No releases published