<span class="Apple-style-span" style="font-family: Arial; font-size: medium; "><pre><span class="Apple-style-span" style="font-family: Arial; white-space: normal; "><pre>>><i> is advanced by the number of coe cients that are added to the block as each
</i>>><i> token is decoded. After fully decoding all the tokens with token index
</i>>><i> ti , the
</i>>><i> current token index of every coded block will be ti or greater...."
</i>
>You need to read Section 7.7 of the spec thoroughly. I don't think you
>understand what a "token" represents yet.
>><i> ok.
</i>>><i> for example, my encoder produce only two blocks:
</i>>><i> 1) in first block (after DCT) i have
</i>>><i> AC0=1;
</i>
>I assume you mean DC, not AC0.
>><i> AC(1..62)=0;
</i>>><i> AC63=1;
</i>>><i> so, after zig-zag + RLE have tokens for
</i>>><i> AC0=(0,1);
</i>>><i> AC63=(62,1)
</i>
>What you _actually_ have is (token,extra bits) pairs like so
>DC=(9, no extra bits) (i.e., value token, value==1)
>AC1=(8,111110) (i.e., zero run token, run-length==62)
>AC63=(9, no extra bits) (i.e., value token, value==1)
><i><pre style="display: inline !important; ">></pre></i><i> 1) in first block (after DCT) i have</i></pre><pre>>I assume you meant in the second block.
><i><pre style="display: inline !important; ">></pre></i><i> AC0=1;</i></pre><pre>><i><pre style="display: inline !important; ">></pre></i><i> AC1=1;</i></pre><pre>><i><pre style="display: inline !important; ">
></pre></i><i> AC(2..62)=0;</i></pre><pre>><i><pre style="display: inline !important; ">></pre></i><i> AC63=1;</i></pre><pre>><i><pre style="display: inline !important; ">></pre></i><i> so, after zig-zag + RLE have tokens for</i></pre>
<pre>><i><pre style="display: inline !important; ">></pre></i><i> AC0=(0,1);</i></pre><pre>><i><pre style="display: inline !important; ">></pre></i><i> AC1=(0,1);</i></pre><pre>><i><pre style="display: inline !important; ">
></pre></i><i> AC63=(61,1)</i></pre><pre>>Again, the _actual_ tokens you would use are:
>DC=(9, no extra bits) (i.e., value token, value==1)
>AC1=(9, no extra bits) (i.e., value token, value==1)
>AC2=(8,111101) (i.e., zero run token, run-length==61)
>AC63=(9, no extra bits) (i.e., value token, value==1)
><i><pre style="display: inline !important; ">></pre></i><i> what about tokens for index 1-61?</i></pre><pre>>The first block only has tokens for indexes 0, 1, and 63, which generate
>1 coefficient value, 62 coefficient values, and 1 coefficient value,
>respectively (for a total of 64).
>The second block has tokens for indexes 0, 1, 2, and 63, which generate
>1, 1, 61, and 1 coefficient, respectively, again for a total of 64.
>As an aside, actually having 64 coefficients in a block is unusual. It
>happens, but it is much more common to end with a long zero run. It is
>important not to actually code these as zero runs, but using an "End Of
>Block" (EOB) token (token values 0...6). EOBs are much, much cheaper
>than using an explicit zero run to end the block, in terms of bits.</pre><pre>Thank you Timothy!</pre><pre>Now i undestand how tokens are made from zig-zaged block. I redraw stage-I in my blog <a href="http://developer-fpga.blogspot.com/">http://developer-fpga.blogspot.com/</a>, see diagram <a href="https://lh4.googleusercontent.com/-wDLGljOWTCs/TY3ofIhqNzI/AAAAAAAAAp8/nvdCht-qjbc/s1600/stage1.a.jpg">https://lh4.googleusercontent.com/-wDLGljOWTCs/TY3ofIhqNzI/AAAAAAAAAp8/nvdCht-qjbc/s1600/stage1.a.jpg</a></pre>
<pre> But i'm litle confused seen table 7.38 of Theora spec. How i understand we use only 8 bit values in coder (for quantized coefficient of block), but in table 7.38 is (for example token value = 22) i see tokenization of values more than 255? How it's possible? Extrabits for token value=22 is 10 bits. This mean we can present -512..+512 magnitude values for coeffs..... How it's possible? Ok. May be this is why when DCTed our 8-bits values we at result have 16-bits value out. Ok this is understand, but why realy thear are tokens fo 10-bits value? (Is it because we use quantization ?)</pre>
<pre><b><br></b></pre></span></pre></span>