PDA

View Full Version : Me Wrapper for Utopia


someabitraryname
08-23-2011, 09:23 PM
The utopia section was on lockdown so I posted here.

I reversed the 5.00 sceMeCodecWrapper and decided to add it to the utopia project, I tested it with time machine and it seems to work fine.
Thought it looks utopia is dead or just comatose, I thought I would contribute.
me_wrapper (http://www.mediafire.com/?4kw5i3im2gc4ppl)

arnold
08-26-2011, 11:19 AM
Hi somearbitraryname,

That's excellent.

-arnold

Zer01ne
09-16-2011, 12:11 AM
hi
first of all, great job !
#define reverse decompile //yes i know,i should use IDA ...
i tried to use lcd from ipl (ipl's sdk driver seem unfinished) so i reversed different prxs to understand the process :
first, lowio.prx (lcdc.prx part) but i just found again the lcd init process used in ipl sdk ...
I wanted to understand the image blitting process ((V)RAM->lcd) so i reversed dmac (which wasn't in utopia) but dmac need interrupt ... so i reversed interruptManager ... but interrupt need exeptionManager ... so finally i wan't unable to find the interrupt that keep lcd's pixel alive orz (and lcd still refreshed without associated pspevent ...)

maybe i've made a mistake ? but i'm not desperate, i learned a lot (mostly on interrupt) so if anyone had information on this device (it seel that adrahil is 'the man' on psp hardware ^^)

@someabitraryname i have an mpeg.prx reverse on my hdd, (made when i searched a way to decode AVC on OFW) if you are interested.

(don't look at this post owner, that not me)

someabitraryname
09-16-2011, 06:05 PM
@zer01ne Your post is hard to follow, are you asking something?
or did someone hijack you account?
If you already reversed some modules/libraries why not add them so everyone can benefit.

@someabitraryname i have an mpeg.prx reverse on my hdd, (made when i searched a way to decode AVC on OFW) if you are interested.Yes , I am interested.

biscottealacrevette
09-17-2011, 12:49 AM
sound better with va_args ? (http://0xb15c077e.googlecode.com/svn/trunk/RE/PSP/me_wrapper.c)

114 sub reversed
39 sub untouched (adress prefixed sub)
http://pastebin.com/h8SX5z0e
my goal wasn't to recompile mpeg.prx, just understand it. (but of course i would like to finish it like you did with me_wrapper)

sorry if my previous post was messy.
i just wondering if anyone has information about lcd displaying process (init+interrupt)
because draw on the screen is more exting than SIO printf :)

edit : after some search this is what i've learne from AVcodec :

typedef struct{
int checkSize;
int unk1;
u32*Dcache;
u32 DcacheLen;
u32 needMem;
int unk4;
u32*src;
u32 srcLen;
u32*dst;
u32 dstLen;//filled by sceAudiocodecDecode : ch*bps*SampleLen
u32 freq;
int unkA[15];//3rd entry moded if mp3
u32 EDRAM;
int unkB[38];
}AudioCodec;

typedef struct{//size:0x60
/* 0*/ u32 version;// 0x05100601
/* 1*/ int unk1;//0xD4 (53*(void*) ?)
/* 2*/ void*unk2;//0
/* 3*/ int EDRAM;//0x198A40 == [5]
/* 4*/ Mp4AvcInfoStruct*info;//size = arg2 ? 0x100:0x28; (contain video info w/h)
/* 5*/ int EDRAM64;//EDRAM related?(memalign 64)
/* 6*/ int EDRAMlen;//0x8344 sizeof needed EDRAM
/* 7*/ void*init;//init stuff ?
/* 8*/ int initLen;//sizeof init stuff
/* 9*/ void*sample;//0x01000000+sample content
/*10*/ int sampleLen;
/*11*/ Mp4AvcYuvStruct*yuv;//size=entry*0x2C
/*12*/ void*unk12;//size=0x64|0x40
/*13*/ int cscMode;//0 csc mode
/*14*/ void*unk14;//size=entry*0x148
/*15*/ int entry;//4 (static)
/*16*/ int maxWidth;//480/720
/*17*/ int maxHeight;//272/480/576
/*18*/ int maxEntry;//3
/*19*/ int haveSEI;//1 if mode == 3,5,6
/*20*/ void*SEI;//size=0xC0 Supplemental enhancement information (optional)
/*21*/ void*crop;//0x40 frame crop (optional)
/*22*/ int csc;//manual:1 (csc)
/*23*/ void*ex;//unused (memalign 64)//EDRAM*?
}VideoCodec;


this is a shematic example on how to decode AVC1 samples :

VideoCodec vc;
sceMpegInit();
sceMpegCreate(Mpeg,...);
MpegAu.iEsBuffer=pool;
MpegAu.iAuSize=0;
for(int i=0;i>=0;i++){
sceMpegGetAvcNalAu(Mpeg,&nal,MpegAu);//setup the nal (i failed to do this by myself)
vc.sampleLen=MpegAu.iAuSize;
vc.sample=MpegAu.iEsBuffer;
sceVideocodecDecode(vc,0);//work after the 1st keyframe (call sceMpegAvcDecode for the 1st kf)
doCsc();
}

i don't know what init fuction is missing (maybe dmac) but after the first keyframe i can simply use sceVideoCodecDecode and sceMpegGetAvcNalAu

i tried to recode sceMpegGetAvcNalAu but it seem i failed (maybe because i dont copy sample to the "pool" like sceMpeg does ?)

but, well. i'll continue to investigate...
EDIT 2:
there is some stuff i don't understand about the first sample: generated sample size is 467b but i only have a 430b sample + 2b preNAL + 4b pps + 24b sps = 460b ...not 467
but the rest is okay (sampleLen=nalLen+nalPreLen)