-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support lzma and lzip compression decompression via zmat toolbox (htt…
- Loading branch information
Showing
7 changed files
with
110 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function output = lzipdecode(input) | ||
%LZIPDECODE Decompress input bytes using lzip. | ||
% | ||
% output = lzipdecode(input) | ||
% | ||
% The function takes a compressed byte array INPUT and returns inflated | ||
% bytes OUTPUT. The INPUT is a result of LZIPDECODE function. The OUTPUT | ||
% is always an 1-by-N uint8 array. | ||
% | ||
% See also lzipencode typecast | ||
% | ||
% License : BSD, see LICENSE_*.txt | ||
% | ||
|
||
if(nargin==0) | ||
error('you must provide at least 1 input'); | ||
end | ||
if(exist('zmat')==3) | ||
output=zmat(uint8(input),0,'lzip'); | ||
return; | ||
else | ||
error('you must install ZMat toolbox to use this feature: http://github.com/fangq/zmat_mex') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function output = lzipencode(input) | ||
%LZIPENCODE Compress input bytes with lzip. | ||
% | ||
% output = lzipencode(input) | ||
% | ||
% The function takes a char, int8, or uint8 array INPUT and returns | ||
% compressed bytes OUTPUT as a uint8 array. Note that the compression | ||
% doesn't preserve input dimensions. | ||
% | ||
% See also lzipdecode | ||
% | ||
% License : BSD, see LICENSE_*.txt | ||
% | ||
|
||
if(nargin==0) | ||
error('you must provide at least 1 input'); | ||
end | ||
if(exist('zmat')==3) | ||
output=zmat(uint8(input),1,'lzip'); | ||
return; | ||
else | ||
error('you must install ZMat toolbox to use this feature: http://github.com/fangq/zmat_mex') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function output = lzmadecode(input) | ||
%LZMADECODE Decompress input bytes using lzma. | ||
% | ||
% output = lzmadecode(input) | ||
% | ||
% The function takes a compressed byte array INPUT and returns inflated | ||
% bytes OUTPUT. The INPUT is a result of LZMADECODE function. The OUTPUT | ||
% is always an 1-by-N uint8 array. | ||
% | ||
% See also lzmaencode typecast | ||
% | ||
% License : BSD, see LICENSE_*.txt | ||
% | ||
|
||
if(nargin==0) | ||
error('you must provide at least 1 input'); | ||
end | ||
if(exist('zmat')==3) | ||
output=zmat(uint8(input),0,'lzma'); | ||
return; | ||
else | ||
error('you must install ZMat toolbox to use this feature: http://github.com/fangq/zmat_mex') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function output = lzmaencode(input) | ||
%LZMAENCODE Compress input bytes with lzma. | ||
% | ||
% output = lzmaencode(input) | ||
% | ||
% The function takes a char, int8, or uint8 array INPUT and returns | ||
% compressed bytes OUTPUT as a uint8 array. Note that the compression | ||
% doesn't preserve input dimensions. | ||
% | ||
% See also lzmadecode | ||
% | ||
% License : BSD, see LICENSE_*.txt | ||
% | ||
|
||
if(nargin==0) | ||
error('you must provide at least 1 input'); | ||
end | ||
if(exist('zmat')==3) | ||
output=zmat(uint8(input),1,'lzma'); | ||
return; | ||
else | ||
error('you must install ZMat toolbox to use this feature: http://github.com/fangq/zmat_mex') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters