Heres what I'm doing.
My threshold is 512. so bits per sample will be 9.
I put all the pixels below or equal to 512 in a short array. So even though each value is expressed using 16 bits, im sure it is less than or equal to 512 and hence higher bits must be zero only.
for bitspersample = 9,10,11 ... I get the same assertion failed as above
" Assertion failed ..
file: c:/charls/defaulttraits.h
line: 85
Expression: abs(Errval) <=RANGE "
for bitspersample = 12 .. I get a new error
" Assertion failed ..
file: c:/charls/scan.h
line: 289
Expression: traits.IsNear(traits.ComputeReconstructedSample(Px, ApplySign(Errval, sign)), x) "
for bitspersample = 13 ... everything works fine. Although now the original and the decompressed values dont match. I guess the reason could be that im reading 16bit values after decompression whereas maybe I should be reading 13bits at a time and constructing
values. (are the bits accumulated to construct the decompressed data ?)
I'm puzzled. The input data is definitely 9 bit. Thanks for your help on this, really appreciate it!
