Ejemplo n.º 1
0
DWORD CodecInst::DecompressBegin(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut) {
	DecompressEnd();  // free resources if necessary
	if (!CanDecompress(lpbiIn, lpbiOut))
		return ICERR_BADFORMAT;
	codec=new VideoCodec();
	if (!codec)
		return ICERR_MEMORY;
	if (!codec->SetupDecompress( lpbiIn->biWidth, lpbiIn->biHeight))
		return ICERR_MEMORY;
	return ICERR_OK;
}
Ejemplo n.º 2
0
HX_RESULT HXH263CodecInstance::DecompressStart(
    const HXVA_Image_Format &srcFormat,
    HXVA_Image_Format &dstFormat
)
{
    // Somebody called start without end
    //if(IsOpenDecoder(m_hDecoder))
    //	DecompressEnd();

    // open decoder with CIF capabilities
    // FIX: must check for success here
    m_hDecoder = (S16) VvOpenDecoder(capsCIF);

    if(m_hDecoder > MAX_NUM_DECODERS)     {
        MarkDecoderClosed(m_hDecoder);
        return HXR_OUTOFMEMORY;
    }

    // Initialize picture descriptor
    m_PicDesc.rows = ROUNDTO16(srcFormat.dimensions.height);
    m_PicDesc.cols = ROUNDTO16(srcFormat.dimensions.width);
    // Initialize the output picture
    m_PicOut.picLayout = VIVO_YUV12;
    m_PicOut.color = 1;


    // initialize remaining decoder state
    m_nextGob = 0;

    // Grab the decoder pointer
    m_lpDecoderPtr = (LPBYTE) VvGetDecoderPtr(m_hDecoder);

    if(m_lpDecoderPtr==NULL)    {
        DecompressEnd();
        return HXR_OUTOFMEMORY;
    }

    return HXR_OK;
}