I have the spec open in front of me and section 13.4.3.4 looks OK to me. Perhaps a little discussion might help, else maybe Anuradha Suraparaju or David Schleef can shed some light on this.

The codeblock mode == 1 has not, to my knowledge, been implemented in an encoder. So, I think, all the streams should correspond to codeblock mode == 0 and quantiser offset should always be zero. If <http://diracvideo.org/download/test-streams/quicktime/sage-640x360.mov>http://diracvideo.org/download/test-streams/quicktime/sage-640x360.mov has codeblock mode ==1 anywhere it is probably wrong - but I'd be surprised if this were the case. Bits of code you quote all seem to do the right thing when codeblock mode == 0.

Codeblock mode ==1 is designed to allow variable quantisation across a picture. This is probably a good idea but is difficult to implement in a rate distortion framework and also has implications for the arithmetic coding. Hence not implemented.

Anyone else have any comments?

Tim

At 00:19 08/03/2010, Tommy Thorn wrote:
I'm having trouble decoding the sample BBC streams, for example, sage-640x360.mov. It appears that my spec based decoder diverges from dirac-research and Schroedinger on codeblock quantiser offset. Both specs (Dirac 13.4.3.4) clearly states that if state[CODEBLOCK MODE] != 0 implies that the quantifier offset is read from the stream.

However Schroedinger and dirac-research does something more complicated here. Schroedinger 1.0.8 has

  if (params->codeblock_mode_index == 1) {
    ctx->have_quant_offset = TRUE;
    if (picture->decoder_instance->compat_quant_offset &&
        ctx->horiz_codeblocks == 1 && ctx->vert_codeblocks == 1) {
      ctx->have_quant_offset = FALSE;
    }
  } else {
    ctx->have_quant_offset = FALSE;
  }

in schro_decoder_setup_codeblocks and uses have_quant_offset and uses

  if (ctx->have_quant_offset && ctx->horiz_codeblocks == 1 &&
      ctx->vert_codeblocks == 1 && ctx->index == 0 &&
      ctx->ymin == 0 && ctx->xmin == 0) {
    if (params->is_noarith) {
      SchroUnpack unpack_copy;
      schro_unpack_copy (&unpack_copy, &ctx->unpack);
      quant_index += schro_unpack_decode_sint (&unpack_copy);
....

where the spec states simply

  if (params->code_mode_index) {
    if (params->is_noarith) {
      SchroUnpack unpack_copy;
      schro_unpack_copy (&unpack_copy, &ctx->unpack);
      quant_index += schro_unpack_decode_sint (&unpack_copy);
...

dirac-research is harder to correlate, but it looks like

        // Multiple quantiser are used only if
        // a. The global code_block_mode is QUANT_MULTIPLE
        //              and
        // b. More than one code block is present in the subband.
        bands(b).SetUsingMultiQuants(
                           m_decparams.SpatialPartition() &&
m_decparams.GetCodeBlockMode() == QUANT_MULTIPLE &&
                           (bands(b).GetCodeBlocks().LengthX() > 1 ||
                           bands(b).GetCodeBlocks().LengthY() > 1)
                                );

in CompDecompressor::Decompress is the equivalent logic.

So, is the spec wrong or is the BBC sample <http://diracvideo.org/download/test-streams/quicktime/sage-640x360.mov>http://diracvideo.org/download/test-streams/quicktime/sage-640x360.mov not compliant with the spec?

Thanks
Tommy

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Schrodinger-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/schrodinger-devel
Tim Borer
BBC Research & Development
BBC Centre House
56 Wood Lane
London     W12 7SB
Mobile: 07745 108652  
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Schrodinger-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/schrodinger-devel

Reply via email to