Skip to content

Commit 0c1dc13

Browse files
Merge branch 'aous72:master' into feature/add-openexr-support
2 parents 47474b3 + 579d7dd commit 0c1dc13

File tree

3 files changed

+34
-30
lines changed

3 files changed

+34
-30
lines changed

src/core/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ if(EMSCRIPTEN)
3838
add_library(openjph ${SOURCES})
3939
add_library(openjphsimd ${SOURCES} ${CODESTREAM_WASM} ${CODING_WASM} ${TRANSFORM_WASM})
4040

41-
target_include_directories(openjph PUBLIC common)
42-
target_include_directories(openjphsimd PUBLIC common)
41+
target_include_directories(openjph PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common> $<INSTALL_INTERFACE:include>)
42+
target_include_directories(openjphsimd PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common> $<INSTALL_INTERFACE:include>)
4343

4444
target_compile_options(openjphsimd PRIVATE -DOJPH_ENABLE_WASM_SIMD -msimd128)
4545

@@ -124,7 +124,7 @@ if (BUILD_SHARED_LIBS AND WIN32)
124124
endif()
125125

126126
## include library version/name
127-
target_include_directories(openjph PUBLIC common)
127+
target_include_directories(openjph PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common> $<INSTALL_INTERFACE:include>)
128128
target_compile_definitions(openjph PUBLIC _FILE_OFFSET_BITS=64)
129129

130130
if (MSVC)

src/core/codestream/ojph_params.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,34 @@ namespace ojph {
951951
//
952952
//////////////////////////////////////////////////////////////////////////
953953

954+
//////////////////////////////////////////////////////////////////////////
955+
void param_qcd::check_validity(const param_siz& siz, const param_cod& cod)
956+
{
957+
ui32 num_decomps = cod.get_num_decompositions();
958+
num_subbands = 1 + 3 * num_decomps;
959+
if (cod.get_wavelet_kern() == param_cod::DWT_REV53)
960+
{
961+
ui32 bit_depth = 0;
962+
for (ui32 i = 0; i < siz.get_num_components(); ++i)
963+
bit_depth = ojph_max(bit_depth, siz.get_bit_depth(i));
964+
set_rev_quant(num_decomps, bit_depth,
965+
cod.is_employing_color_transform());
966+
}
967+
else if (cod.get_wavelet_kern() == param_cod::DWT_IRV97)
968+
{
969+
if (base_delta == -1.0f) {
970+
ui32 bit_depth = 0;
971+
for (ui32 i = 0; i < siz.get_num_components(); ++i)
972+
bit_depth =
973+
ojph_max(bit_depth, siz.get_bit_depth(i) + siz.is_signed(i));
974+
base_delta = 1.0f / (float)(1 << bit_depth);
975+
}
976+
set_irrev_quant(num_decomps);
977+
}
978+
else
979+
assert(0);
980+
}
981+
954982
//////////////////////////////////////////////////////////////////////////
955983
void param_qcd::set_rev_quant(ui32 num_decomps, ui32 bit_depth,
956984
bool is_employing_color_transform)

src/core/codestream/ojph_params_local.h

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ namespace ojph {
442442
}
443443

444444
//check the progression order matches downsampling
445-
if (SGCod.prog_order == 2 || SGCod.prog_order == 3)
445+
if (SGCod.prog_order == OJPH_PO_RPCL ||
446+
SGCod.prog_order == OJPH_PO_PCRL)
446447
{
447448
ui32 num_comps = siz.get_num_components();
448449
for (ui32 i = 0; i < num_comps; ++i)
@@ -606,33 +607,8 @@ namespace ojph {
606607
}
607608

608609
void set_delta(float delta) { base_delta = delta; }
610+
void check_validity(const param_siz& siz, const param_cod& cod);
609611

610-
void check_validity(const param_siz& siz, const param_cod& cod)
611-
{
612-
ui32 num_decomps = cod.get_num_decompositions();
613-
num_subbands = 1 + 3 * num_decomps;
614-
if (cod.get_wavelet_kern() == param_cod::DWT_REV53)
615-
{
616-
ui32 bit_depth = 0;
617-
for (ui32 i = 0; i < siz.get_num_components(); ++i)
618-
bit_depth = ojph_max(bit_depth, siz.get_bit_depth(i));
619-
set_rev_quant(num_decomps, bit_depth,
620-
cod.is_employing_color_transform());
621-
}
622-
else if (cod.get_wavelet_kern() == param_cod::DWT_IRV97)
623-
{
624-
if (base_delta == -1.0f) {
625-
ui32 bit_depth = 0;
626-
for (ui32 i = 0; i < siz.get_num_components(); ++i)
627-
bit_depth =
628-
ojph_max(bit_depth, siz.get_bit_depth(i) + siz.is_signed(i));
629-
base_delta = 1.0f / (float)(1 << bit_depth);
630-
}
631-
set_irrev_quant(num_decomps);
632-
}
633-
else
634-
assert(0);
635-
}
636612
ui32 get_num_guard_bits() const;
637613
ui32 get_MAGBp() const;
638614
ui32 get_Kmax(const param_dfs* dfs, ui32 num_decompositions,

0 commit comments

Comments
 (0)