[theora-dev] Clarification of specification

Chris Brien chrisb at codian.com
Thu Mar 20 04:23:30 PDT 2008


Hi

I'm trying to make sense of the macroblock coding modes in section 7.4 of  
the Theora spec.

The text in the specification is:

(d) For each consecutive macro block in coded order (cf. Section 2.4)
     indexed by mbi:
     i. If a block bi in the luma plane of macro block mbi exists such
        that BCODED[bi ] is 1:
        A. If MSCHEME is not 7, read one bit at a time until one of
           the Huffman codes in Table 7.19 is recognized, and assign
           MBMODES[mbi] the value MALPHABET[mi], where mi
           is the index of the Huffman code decoded.
        B. Otherwise, if no luma-plane blocks in the macro block are
           coded, read a 3-bit unsigned integer as MBMODES[mbi].
    ii. Otherwise, assign MBMODE[mbi] the value 0 (INTER_NOMV).


The problem is that, as written, step d/i/B will never be executed. The  
logic is

let x be the phrase "there is a coded luma plane block in this macroblock".
if (x)
{
	if (y)
	{
	}
	else if (!x)
	{
		/* Can't get here! */
	}
}
else
{
}

I assume that the text
B. Otherwise, if no luma-plane blocks in the macro block are
coded, read a 3-bit unsigned integer as MBMODES[mbi].
should simply read
B. Otherwise, read a 3-bit unsigned integer as MBMODES[mbi].
which simplifies the logic to:
if (x)
{
	if (y)
	{
	}
	else
	{
	}
}
else
{
}


Is this correct?

Oh, and theres a typo in step d/ii - MBMODE should be MBMODES.

Chris Brien


More information about the theora-dev mailing list