Logo Search packages:      
Sourcecode: libtheora version File versions  Download package

int theora_decode_YUVout ( theora_state th,
yuv_buffer yuv 
)

Output the next available frame of decoded YUV data.

Parameters:
thA theora_state handle previously initialized for decoding.
yuvA yuv_buffer in which libtheora should place the decoded data.
Return values:
0Success

Definition at line 376 of file toplevel.c.

References theora_decode_YUVout(), yuv_buffer::u, yuv_buffer::uv_height, yuv_buffer::uv_stride, yuv_buffer::uv_width, yuv_buffer::v, yuv_buffer::y, yuv_buffer::y_height, yuv_buffer::y_stride, and yuv_buffer::y_width.

Referenced by theora_decode_YUVout().

                                                          {
  PB_INSTANCE *pbi=(PB_INSTANCE *)(th->internal_decode);

  yuv->y_width = pbi->info.width;
  yuv->y_height = pbi->info.height;
  yuv->y_stride = pbi->YStride;

  yuv->uv_width = pbi->info.width / 2;
  yuv->uv_height = pbi->info.height / 2;
  yuv->uv_stride = pbi->UVStride;

  if(pbi->PostProcessingLevel){
    yuv->y = &pbi->PostProcessBuffer[pbi->ReconYDataOffset];
    yuv->u = &pbi->PostProcessBuffer[pbi->ReconUDataOffset];
    yuv->v = &pbi->PostProcessBuffer[pbi->ReconVDataOffset];
  }else{
    yuv->y = &pbi->LastFrameRecon[pbi->ReconYDataOffset];
    yuv->u = &pbi->LastFrameRecon[pbi->ReconUDataOffset];
    yuv->v = &pbi->LastFrameRecon[pbi->ReconVDataOffset];
  }
  
  /* we must flip the internal representation,
     so make the stride negative and start at the end */
  yuv->y += yuv->y_stride * (yuv->y_height - 1);
  yuv->u += yuv->uv_stride * (yuv->uv_height - 1);
  yuv->v += yuv->uv_stride * (yuv->uv_height - 1);
  yuv->y_stride = - yuv->y_stride;
  yuv->uv_stride = - yuv->uv_stride;

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index