-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
593 additions
and
112 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
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
Submodule libsundaowen
updated
5 files
+1 −1 | sdw_crc32.cpp | |
+2 −2 | sdw_define.h | |
+24 −24 | sdw_module.cpp | |
+4 −4 | sdw_string.cpp | |
+5 −5 | sdw_string.h |
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,49 @@ | ||
#include "lz4.h" | ||
#include <lz4.h> | ||
|
||
u32 CLz4::GetCompressBoundSize(u32 a_uUncompressedSize) | ||
{ | ||
return LZ4_compressBound(a_uUncompressedSize); | ||
} | ||
|
||
bool CLz4::Uncompress(const u8* a_pCompressed, u32 a_uCompressedSize, u8* a_pUncompressed, u32& a_uUncompressedSize) | ||
{ | ||
bool bResult = true; | ||
n32 nUncompressedSize = LZ4_decompress_safe(reinterpret_cast<const char*>(a_pCompressed), reinterpret_cast<char*>(a_pUncompressed), a_uCompressedSize, a_uUncompressedSize); | ||
if (nUncompressedSize < 0) | ||
{ | ||
bResult = false; | ||
} | ||
else | ||
{ | ||
a_uUncompressedSize = nUncompressedSize; | ||
} | ||
return bResult; | ||
} | ||
|
||
bool CLz4::Compress(const u8* a_pUncompressed, u32 a_uUncompressedSize, u8* a_pCompressed, u32& a_uCompressedSize) | ||
{ | ||
bool bResult = true; | ||
u32 uCompressedSize = LZ4_compressBound(a_uUncompressedSize); | ||
if (uCompressedSize == 0) | ||
{ | ||
bResult = false; | ||
} | ||
else | ||
{ | ||
uCompressedSize = LZ4_compress_default(reinterpret_cast<const char*>(a_pUncompressed), reinterpret_cast<char*>(a_pCompressed), a_uUncompressedSize, a_uCompressedSize); | ||
if (uCompressedSize == 0) | ||
{ | ||
bResult = false; | ||
} | ||
else | ||
{ | ||
a_uCompressedSize = uCompressedSize; | ||
} | ||
} | ||
return bResult; | ||
} | ||
|
||
CLz4::CLz4() | ||
{ | ||
} |
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,16 @@ | ||
#ifndef LZ4_H_ | ||
#define LZ4_H_ | ||
|
||
#include <sdw.h> | ||
|
||
class CLz4 | ||
{ | ||
public: | ||
static u32 GetCompressBoundSize(u32 a_uUncompressedSize); | ||
static bool Uncompress(const u8* a_pCompressed, u32 a_uCompressedSize, u8* a_pUncompressed, u32& a_uUncompressedSize); | ||
static bool Compress(const u8* a_pUncompressed, u32 a_uUncompressedSize, u8* a_pCompressed, u32& a_uCompressedSize); | ||
private: | ||
CLz4(); | ||
}; | ||
|
||
#endif // LZ4_H_ |
Oops, something went wrong.