# [theora] Coded Order vs Raster Order

Richard Bair Richard.Bair at Sun.COM
Mon Jun 19 11:14:23 PDT 2006

```Hey,

I'm not sure which mailing list this belongs on most, please correct
me if I'm on the wrong one.

I'm working through the Theora spec and trying to build an
implementation as I go along. I have a few questions that I couldn't
quite work out from the spec or in any online information that I
found. The first question I have is related to coded order vs raster
order. I understand from the spec the difference, and how they are
numbered. However, during the decode process for coded block flags
(section 7.3) I find this confusing sentence:

"for each block in coded order -- indexed by bi assign sbi the index
of the super block containing block bi".

So I would imagine that given some arbitrary coded index I would
return the appropriate super block index (in raster order). But what
does this phrase "for each block in coded order" mean? I'm having a
hard time visualizing it.

In this particular case, the input params include "nsbs" and "nbs".
So is this really just:

for (int i=0; i<nbs; i++) {
//do the rest
}

?

Thanks
Richard

PS> Doing all the conversions from superblock-raster-index to block-
raster-index to block-coded-index and so forth is all pretty
straightforward for planes where the superblocks line up exactly
(multiples of 4 blocks). When they are fragmented it gets tricky. Any
hints or suggestions? Is there any single mathematical formula to
use, or do I have to do if statements?
```