Skip to content

Commit

Permalink
- Fix incorrect packet parsing for RPCL, PCRL, CPRL
Browse files Browse the repository at this point in the history
- Change cmake configuration for MIngW environments
  • Loading branch information
osamu620 committed Nov 15, 2024
1 parent 7e77349 commit 6746092
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# [0.2.8] - 2024-11-12

* Fix incorrect packet parsing for RPCL, PCRL, CPRL
* Introduce stride access into DWT
* Change cmake configuration for MinGW environments

# [0.2.7] - 2024-06-13

* Refactor non-SIMD HT cleanup decoding
Expand Down
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ endif()

if(NOT EMSCRIPTEN)
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^[xX]86_64$|^[aA][mM][dD]64$") # x86_64
if(NOT MINGW)
option(ENABLE_AVX2 "Enable the use of Intel AVX2 intrinsics" ON)
endif()
option(ENABLE_AVX2 "Enable the use of Intel AVX2 intrinsics" ON)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} /arch:AVX2 /EHsc /D \"_CRT_SECURE_NO_WARNINGS\"")
Expand Down
14 changes: 5 additions & 9 deletions source/core/coding/coding_units.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,7 @@ void j2k_precinct_subband::parse_packet_header(buf_chain *packet_header, uint16_
if (!(block->Cmodes & HT_MIXED)) {
// Must be the first HT Cleanup pass
if (segment_bytes < 2) {
printf(
"ERROR: Length information for a HT-codeblock is "
"invalid\n");
printf("ERROR: Length information for a HT-codeblock is invalid\n");
throw std::exception();
}
next_segment_passes = 2;
Expand Down Expand Up @@ -595,9 +593,7 @@ void j2k_precinct_subband::parse_packet_header(buf_chain *packet_header, uint16_
if (block->Cmodes & HT_MIXED) {
block->Cmodes &= static_cast<uint16_t>(~(HT_PHLD | HT));
} else {
printf(
"ERROR: Length information for a HT-codeblock is "
"invalid\n");
printf("ERROR: Length information for a HT-codeblock is invalid\n");
throw std::exception();
}
}
Expand Down Expand Up @@ -1402,7 +1398,7 @@ void j2k_tile_component::init(j2k_main_header *hdr, j2k_tilepart_header *tphdr,
const uint32_t aligned_stride =
round_up((ceil_int(pos1.x, 1U << tile->reduce_NL) - ceil_int(pos0.x, 1U << tile->reduce_NL)), 32U);
const auto height = static_cast<uint32_t>(ceil_int(pos1.y, 1U << tile->reduce_NL)
- ceil_int(pos0.y, 1U << tile->reduce_NL));
- ceil_int(pos0.y, 1U << tile->reduce_NL));
const uint32_t num_bufsamples = aligned_stride * height;
samples = static_cast<int32_t *>(aligned_mem_alloc(sizeof(int32_t) * num_bufsamples, 32));

Expand Down Expand Up @@ -2459,7 +2455,7 @@ void j2k_tile::decode() {
#endif
}
} // end of codeblock loop
} // end of subbnad loop
} // end of subbnad loop
#ifdef OPENHTJ2K_THREAD
for (auto &result : results) {
result.get();
Expand Down Expand Up @@ -2667,7 +2663,7 @@ void j2k_tile::find_gcd_of_precinct_size(element_siz &out) {
for (uint8_t r = 0; r <= this->tcomp[c].get_dwt_levels(); r++) {
PP = this->tcomp[c].get_precinct_size(r);
PPx = (PPx > PP.x) ? static_cast<uint8_t>(PP.x) : PPx;
PPy = (PPy > PP.y) ? static_cast<uint8_t>(PP.y) : PPx;
PPy = (PPy > PP.y) ? static_cast<uint8_t>(PP.y) : PPy;
}
}
out.x = PPx;
Expand Down
2 changes: 1 addition & 1 deletion source/core/common/open_htj2k_version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@

#define OPENHTJ2K_VERSION_MAJOR 0
#define OPENHTJ2K_VERSION_MINOR 2
#define OPENHTJ2K_VERSION_PATCH 7
#define OPENHTJ2K_VERSION_PATCH 8

0 comments on commit 6746092

Please sign in to comment.