-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the compressor inside OpenEXRCore (#5)
* Whitespaces and licensing * WIP OpenEXRCore implementation * Brand new spanking blosc build. * Switch to single Scanline zstd compression and Single implementation * Fixed the tests * Undo whitespace changes * Last touches * Revert extra build changes
- Loading branch information
Showing
17 changed files
with
194 additions
and
133 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,30 @@ | ||
#pragma once | ||
|
||
// | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// Copyright (c) Contributors to the OpenEXR Project. | ||
// | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
#include "ImfNamespace.h" | ||
#include "ImfCompressor.h" | ||
#include "ImfHeader.h" | ||
#include "blosc2.h" | ||
#include "vector" | ||
|
||
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER | ||
class ZstdCompressor : public Compressor | ||
{ | ||
public: | ||
ZstdCompressor ( | ||
const Header& hdr, size_t maxScanLines, size_t numScanLines); | ||
|
||
explicit ZstdCompressor (const Header& hdr); | ||
private: | ||
using schunk_ptr = | ||
std::unique_ptr<blosc2_schunk, decltype (&blosc2_schunk_free)>; | ||
using raw_ptr = std::unique_ptr<char, decltype (&free)>; | ||
raw_ptr _outBuffer; | ||
schunk_ptr _schunk; | ||
size_t _maxScanlineSize; | ||
size_t _numScanLines; | ||
std::vector<raw_ptr> _outBuffer; | ||
int numScanLines () const override; // max | ||
int compress ( | ||
const char* inPtr, int inSize, int minY, const char*& outPtr) override; | ||
int uncompress ( | ||
const char* inPtr, int inSize, int minY, const char*& outPtr) override; | ||
int BLOSC_compress_impl ( | ||
const char* inPtr, int inSize, int typeSize, const char*& out); | ||
int BLOSC_uncompress_impl_single_blob ( | ||
const char* inPtr, int inSize, const char*& out); | ||
enum Versions : int | ||
{ | ||
SINGLE_BLOB = 1, | ||
LATEST = SINGLE_BLOB | ||
}; | ||
}; | ||
|
||
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT |
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
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
Oops, something went wrong.