• entries
24
21
• views
17543

# Happy New Year

212 views

Not really much to talk about what with Christmas and the new year. I've spent a little free time looking further into Jpeg2000 over the last couple of weeks. I'm now trying to get my head round entropy decoding and the MQ arithmetic decoder. I printed out 22 pages of source code to take away with me over Christmas. I think I understand enough about the arithmetic decoder, which was about three of those 22 pages. The entropy decoder which took up the remainder of the space appears to be a very complicated "optimised" implementation of a relatively simple algorithm. I put the word optimised in quotes because I'm pretty confident that it was a bad choice of optimisation strategy. I shall find out if I'm right in the new year.

I thought I'd leave you with a couple of snippets from the JJ2000 source which made me laugh, when they didn't make me cry.

/** * Returns the reversibility of the filter. A filter is considered * reversible if it is suitable for lossless coding. * * @return true since the 9x7 is reversible, provided the appropriate * rounding is performed. * */public boolean isReversible() {    return false; }
for (rl=0; rl <= maxrl; rl++) { // Loop on resolution levels    // Find the number of subbands in the resolution level    if (rl == 0) { // Only the LL subband        minb = 0;        maxb = 1;    }    else {        // Dyadic decomposition        hpd = 1;        // Adapt hpd to resolution level        if (hpd > maxrl-rl) {            hpd -= maxrl-rl;        }        else {            hpd = 1;        }        // Determine max and min subband index        minb = 1<<((hpd-1)<<1); // minb = 4^(hpd-1)        maxb = 1<<(hpd<<1); // maxb = 4^hpd    }    // Allocate array for subbands in resolution level    exp[rl] = new int[maxb];    for(j=minb; j        tmp = ehs.readUnsignedByte();        exp[rl][j] = (tmp>>SQCX_EXP_SHIFT)&SQCX_EXP_MASK;    }// end for j}// end for rl
I've also decided, after reading far too much bad C++ code on the internet and far too many bad tutorials that come 2007 I shall try to find time to write my own modern C++ tutorial. Watch this space.

All that remains now is for me to wish you a Happy New Year. Farewell 2006, I hardly knew you.

?nigma

There are no comments to display.