Jump to content
Sign in to follow this  
  • entries
  • comments
  • views

Happy New Year

Sign in to follow this  


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.

Check the JavaDoc comments:
* 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;
Tricky stuff, that dyadic decomposition:
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.

Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!