示例#1
0
文件: vcodec.c 项目: yne/opentube-psp
char* load() {
    Alert("vload\n");
//	_lcd=*ot->lcd;//save lcd context
//	ot->lcd->size=256;//multipl 2^6 512/576/640/704/768
    ot->me->mode=(ot->dmx->width>480||ot->dmx->height>272)?5:4;
    if(ot->dmx->width>272)ot->lcd->type=0;//PSP_DISPLAY_PIXEL_FORMAT_565;
    if(ot->dmx->width>480)return "tooBig";//still playable, but too slow.
    modmpg=ot->sys->modload("flash0:/kd/mpeg_vsh.prx");
    if(!ot->me->pool)return("noPool");
    if(sceMpegInit())return("MpegIni");
    if( (ot->me->buffLen=(sceMpegQueryMemSize(ot->me->mode)&0xFFFFFFF0)+16)<0)return("noMemSz");
    if(!(ot->me->buff=Memalign(64,ot->me->buffLen)))return("noMpgBf");
    if(sceMpegCreate(Mpeg,ot->me->buff,ot->me->buffLen,&ot->me->ring,/*cscInit*/512,ot->me->mode,(int)ot->me->pool))return("MpgCrea");//fail if ME not started
    if(!(ot->me->mpegAu=(SceMpegAu*)Memalign(64,64)))return("noMpgAu");
    if(sceMpegInitAu(Mpeg,(ot->me->buffAu=ot->me->pool+0x10000),ot->me->mpegAu))return("MpgInit");
    return NULL;
}
示例#2
0
bool GPUMemCopy::initCache(unsigned width)
{
    mInitialized = false;
#if QTAV_HAVE(SSE2)
    mCache.size = std::max<size_t>((width + 0x0f) & ~ 0x0f, CACHED_BUFFER_SIZE);
    mCache.buffer = (unsigned char*)Memalign(16, mCache.size);
    mInitialized = !!mCache.buffer;
    return mInitialized;
#endif
    return false;
}