Skip to content

Commit

Permalink
A bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
aous72 committed Oct 29, 2024
1 parent 4d47c40 commit 186e3ed
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions src/core/common/ojph_mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace ojph {
class line_buf
{
public:
enum line_buf_type {
enum : ui32 {
LFT_UNDEFINED = 0x00, // Type is undefined/uninitialized
// These flags reflects data size in bytes
LFT_BYTE = 0x01, // Set when data is 1 byte
Expand Down Expand Up @@ -167,7 +167,7 @@ namespace ojph {

size_t size;
ui32 pre_size;
line_buf_type flags;
ui32 flags;
union {
si32* i32; // 32bit integer type, used for lossless compression
float* f32; // float type, used for lossy compression
Expand Down
72 changes: 36 additions & 36 deletions src/core/transform/ojph_colour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,21 +324,21 @@ namespace ojph {
const line_buf *r, const line_buf *g, const line_buf *b,
line_buf *y, line_buf *cb, line_buf *cr, ui32 repeat)
{
assert((y->flags | line_buf::LFT_REVERSIBLE) &&
(cb->flags | line_buf::LFT_REVERSIBLE) &&
(cr->flags | line_buf::LFT_REVERSIBLE) &&
(r->flags | line_buf::LFT_REVERSIBLE) &&
(g->flags | line_buf::LFT_REVERSIBLE) &&
(b->flags | line_buf::LFT_REVERSIBLE));
assert((y->flags & line_buf::LFT_REVERSIBLE) &&
(cb->flags & line_buf::LFT_REVERSIBLE) &&
(cr->flags & line_buf::LFT_REVERSIBLE) &&
(r->flags & line_buf::LFT_REVERSIBLE) &&
(g->flags & line_buf::LFT_REVERSIBLE) &&
(b->flags & line_buf::LFT_REVERSIBLE));

if (y->flags & line_buf::LFT_32BIT)
{
assert((y->flags | line_buf::LFT_32BIT) &&
(cb->flags | line_buf::LFT_32BIT) &&
(cr->flags | line_buf::LFT_32BIT) &&
(r->flags | line_buf::LFT_32BIT) &&
(g->flags | line_buf::LFT_32BIT) &&
(b->flags | line_buf::LFT_32BIT));
assert((y->flags & line_buf::LFT_32BIT) &&
(cb->flags & line_buf::LFT_32BIT) &&
(cr->flags & line_buf::LFT_32BIT) &&
(r->flags & line_buf::LFT_32BIT) &&
(g->flags & line_buf::LFT_32BIT) &&
(b->flags & line_buf::LFT_32BIT));
const si32 *rp = r->i32, * gp = g->i32, * bp = b->i32;
si32 *yp = y->i32, * cbp = cb->i32, * crp = cr->i32;
for (ui32 i = repeat; i > 0; --i)
Expand All @@ -351,12 +351,12 @@ namespace ojph {
}
else
{
assert((y->flags | line_buf::LFT_64BIT) &&
(cb->flags | line_buf::LFT_64BIT) &&
(cr->flags | line_buf::LFT_64BIT) &&
(r->flags | line_buf::LFT_32BIT) &&
(g->flags | line_buf::LFT_32BIT) &&
(b->flags | line_buf::LFT_32BIT));
assert((y->flags & line_buf::LFT_64BIT) &&
(cb->flags & line_buf::LFT_64BIT) &&
(cr->flags & line_buf::LFT_64BIT) &&
(r->flags & line_buf::LFT_32BIT) &&
(g->flags & line_buf::LFT_32BIT) &&
(b->flags & line_buf::LFT_32BIT));
const si32 *rp = r->i32, *gp = g->i32, *bp = b->i32;
si64 *yp = (si64*)y->p, *cbp = (si64*)cb->p, *crp = (si64*)cr->p;
for (ui32 i = repeat; i > 0; --i)
Expand All @@ -374,21 +374,21 @@ namespace ojph {
const line_buf *y, const line_buf *cb, const line_buf *cr,
line_buf *r, line_buf *g, line_buf *b, ui32 repeat)
{
assert((y->flags | line_buf::LFT_REVERSIBLE) &&
(cb->flags | line_buf::LFT_REVERSIBLE) &&
(cr->flags | line_buf::LFT_REVERSIBLE) &&
(r->flags | line_buf::LFT_REVERSIBLE) &&
(g->flags | line_buf::LFT_REVERSIBLE) &&
(b->flags | line_buf::LFT_REVERSIBLE));
assert((y->flags & line_buf::LFT_REVERSIBLE) &&
(cb->flags & line_buf::LFT_REVERSIBLE) &&
(cr->flags & line_buf::LFT_REVERSIBLE) &&
(r->flags & line_buf::LFT_REVERSIBLE) &&
(g->flags & line_buf::LFT_REVERSIBLE) &&
(b->flags & line_buf::LFT_REVERSIBLE));

if (y->flags & line_buf::LFT_32BIT)
{
assert((y->flags | line_buf::LFT_32BIT) &&
(cb->flags | line_buf::LFT_32BIT) &&
(cr->flags | line_buf::LFT_32BIT) &&
(r->flags | line_buf::LFT_32BIT) &&
(g->flags | line_buf::LFT_32BIT) &&
(b->flags | line_buf::LFT_32BIT));
assert((y->flags & line_buf::LFT_32BIT) &&
(cb->flags & line_buf::LFT_32BIT) &&
(cr->flags & line_buf::LFT_32BIT) &&
(r->flags & line_buf::LFT_32BIT) &&
(g->flags & line_buf::LFT_32BIT) &&
(b->flags & line_buf::LFT_32BIT));
const si32 *yp = y->i32, *cbp = cb->i32, *crp = cr->i32;
si32 *rp = r->i32, *gp = g->i32, *bp = b->i32;
for (ui32 i = repeat; i > 0; --i)
Expand All @@ -402,12 +402,12 @@ namespace ojph {
}
else
{
assert((y->flags | line_buf::LFT_64BIT) &&
(cb->flags | line_buf::LFT_64BIT) &&
(cr->flags | line_buf::LFT_64BIT) &&
(r->flags | line_buf::LFT_32BIT) &&
(g->flags | line_buf::LFT_32BIT) &&
(b->flags | line_buf::LFT_32BIT));
assert((y->flags & line_buf::LFT_64BIT) &&
(cb->flags & line_buf::LFT_64BIT) &&
(cr->flags & line_buf::LFT_64BIT) &&
(r->flags & line_buf::LFT_32BIT) &&
(g->flags & line_buf::LFT_32BIT) &&
(b->flags & line_buf::LFT_32BIT));
const si64 *yp = (si64*)y->p, *cbp = (si64*)cb->p, *crp = (si64*)cr->p;
si32 *rp = r->i32, *gp = g->i32, *bp = b->i32;
for (ui32 i = repeat; i > 0; --i)
Expand Down

0 comments on commit 186e3ed

Please sign in to comment.