Logo Search packages:      
Sourcecode: libtheora version File versions

int theora_decode_init ( theora_state th,
theora_info c 
)

Initialize a theora_state handle for decoding.

Parameters:
th The theora_state handle to initialize.
c A theora_info struct filled with the desired decoding parameters. This is of course usually obtained from a previous call to theora_decode_header().
Returns:
0 Success

Definition at line 289 of file toplevel.c.

References theora_info::codec_setup, theora_state::granulepos, theora_state::i, theora_state::internal_decode, theora_info::keyframe_frequency_force, and theora_decode_init().

Referenced by theora_decode_init().

                                                        {
  PB_INSTANCE *pbi;
  codec_setup_info *ci;

  ci=(codec_setup_info *)c->codec_setup;
  th->internal_decode=pbi=_ogg_calloc(1,sizeof(*pbi));

  InitPBInstance(pbi);
  memcpy(&pbi->info,c,sizeof(*c));
  pbi->info.codec_setup=NULL;
  th->i=&pbi->info;
  th->granulepos=-1;

  InitFrameDetails(pbi);

  pbi->keyframe_granule_shift=_ilog(c->keyframe_frequency_force-1);

  pbi->LastFrameQualityValue = 0;
  pbi->DecoderErrorCode = 0;

  /* Clear down the YUVtoRGB conversion skipped list. */
  memset(pbi->skipped_display_fragments, 0, pbi->UnitFragments );

  /* Initialise version specific quantiser and in-loop filter values */
  CopyQTables(pbi, ci);
  CopyFilterTables(pbi, ci);

  /* Huffman setup */
  InitHuffmanTrees(pbi, ci);

  return(0);

}


Generated by  Doxygen 1.6.0   Back to index