Skip to content

Commit

Permalink
Improvement for pfm_in, and a bug fix for handling signed pfm data.
Browse files Browse the repository at this point in the history
  • Loading branch information
aous72 committed Sep 20, 2024
1 parent 9f8011c commit 7b0f5c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/apps/others/ojph_img_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ namespace ojph {
if (shift)
for (ui32 i = width; i > 0; --i, sp += num_comps)
{
ui32 v = *(ui32*)sp;
si32 v = *(si32*)sp;
v >>= shift;
*dp++ = *(float*)&v;
}
Expand All @@ -675,8 +675,9 @@ namespace ojph {
if (shift)
for (ui32 i = width; i > 0; --i, sp += num_comps) {
ui32 v = be2le(*(ui32*)sp);
v >>= shift;
*dp++ = *(float*)&v;
si32 u = *(si32*)&v;
u >>= shift;
*dp++ = *(float*)&u;
}
else
for (ui32 i = width; i > 0; --i, sp += num_comps) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/transform/ojph_colour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ namespace ojph {
{
for (ui32 i = width; i > 0; --i) {
const si32 v = *sp++;
*dp++ = v > 0 ? v : (- v - shift);
*dp++ = v >= 0 ? v : (- v - shift);
}
}

Expand Down

0 comments on commit 7b0f5c8

Please sign in to comment.