-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add SPECK1D_FLT class, also apply a simple patch to cli11 * minor
- Loading branch information
Showing
5 changed files
with
90 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
1c1 | ||
< cmake_minimum_required(VERSION 3.4) | ||
--- | ||
> cmake_minimum_required(VERSION 3.14) |
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,19 @@ | ||
#ifndef SPECK1D_FLT_H | ||
#define SPECK1D_FLT_H | ||
|
||
#include "SPECK_FLT.h" | ||
|
||
namespace sperr { | ||
|
||
class SPECK1D_FLT : public SPECK_FLT { | ||
protected: | ||
void m_instantiate_encoder() override; | ||
void m_instantiate_decoder() override; | ||
|
||
void m_wavelet_xform() override; | ||
void m_inverse_wavelet_xform(bool) override; | ||
}; | ||
|
||
}; // namespace sperr | ||
|
||
#endif |
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "SPECK1D_FLT.h" | ||
#include "SPECK1D_INT_DEC.h" | ||
#include "SPECK1D_INT_ENC.h" | ||
|
||
void sperr::SPECK1D_FLT::m_instantiate_encoder() | ||
{ | ||
switch (m_uint_flag) { | ||
case UINTType::UINT8: | ||
if (m_encoder.index() != 0 || std::get<0>(m_encoder) == nullptr) | ||
m_encoder = std::make_unique<SPECK1D_INT_ENC<uint8_t>>(); | ||
break; | ||
case UINTType::UINT16: | ||
if (m_encoder.index() != 1 || std::get<1>(m_encoder) == nullptr) | ||
m_encoder = std::make_unique<SPECK1D_INT_ENC<uint16_t>>(); | ||
break; | ||
case UINTType::UINT32: | ||
if (m_encoder.index() != 2 || std::get<2>(m_encoder) == nullptr) | ||
m_encoder = std::make_unique<SPECK1D_INT_ENC<uint32_t>>(); | ||
break; | ||
default: | ||
if (m_encoder.index() != 3 || std::get<3>(m_encoder) == nullptr) | ||
m_encoder = std::make_unique<SPECK1D_INT_ENC<uint64_t>>(); | ||
} | ||
} | ||
|
||
void sperr::SPECK1D_FLT::m_instantiate_decoder() | ||
{ | ||
switch (m_uint_flag) { | ||
case UINTType::UINT8: | ||
if (m_decoder.index() != 0 || std::get<0>(m_decoder) == nullptr) | ||
m_decoder = std::make_unique<SPECK1D_INT_DEC<uint8_t>>(); | ||
break; | ||
case UINTType::UINT16: | ||
if (m_decoder.index() != 1 || std::get<1>(m_decoder) == nullptr) | ||
m_decoder = std::make_unique<SPECK1D_INT_DEC<uint16_t>>(); | ||
break; | ||
case UINTType::UINT32: | ||
if (m_decoder.index() != 2 || std::get<2>(m_decoder) == nullptr) | ||
m_decoder = std::make_unique<SPECK1D_INT_DEC<uint32_t>>(); | ||
break; | ||
default: | ||
if (m_decoder.index() != 3 || std::get<3>(m_decoder) == nullptr) | ||
m_decoder = std::make_unique<SPECK1D_INT_DEC<uint64_t>>(); | ||
} | ||
} | ||
|
||
void sperr::SPECK1D_FLT::m_wavelet_xform() | ||
{ | ||
m_cdf.dwt1d(); | ||
} | ||
|
||
void sperr::SPECK1D_FLT::m_inverse_wavelet_xform(bool multi_res) | ||
{ | ||
// Unfortunately, there's no multi-resolution support for 1D arrays... | ||
m_cdf.idwt1d(); | ||
} |