Need insight on debugging of MPEG decoding by EE-IPU
#1
Hi everyone,


I've been trying to mod the Persona 3 FES (US release) by introducing higher-resolution cut scenes. The cutscenes are packaged into Sofdec SFD format, containing an MPEG1/2 video and a single audio stream. I was able to extract/upscale/re-encode/mux new SFD files, and they are accepted by the game/emulator. I use the Persona modding tool from GameBanana, it's all configured and kind of works.


Now, I observed 3 issues:
1 - Aspect ratio is 4:3 regardless of PCSX2 FMV configuration.
2 - Despite having adhered to the DVD standards when encoding my videos, and keeping the bitrate, buffer size, resolution up to spec, none of the videos worked. I had to significantly reduce the quality to make sofme videos to work. Some videos refuse to play still. 
3 - One of the cutscenes is not decoded correctly. I had to modify the aspect ratio and this required me to change the resolution. The MPEG decoder does extract the image, but I believe the renderer is somehow hardcoded to support a specific number of quantized chunks for the video in X and Y direction. Because of the resolution changes, the number of chunks mismatches and I get a telltale jigsaw pattern on the screen.

[Image: image.png?ex=66c2aa72&is=66c158f2&hm=76f...height=910]


My goal is to see how the cutscenes are being processed, and see what could be done to fix it.

Seeing how the devs used this Sofdec SFD format, it's possible some portions of the decoding are done in software. This would explain why the output screen is not affected by FMV settings in PCSX2, and why the last video isn't displayed correctly (it's hardcoded to expect specific resolution). So, I used Ghidra with PS2 extention to analyze the game's ELF file. I was able to find SFD-related functionality by tracking down the debug prints that were left in the code in what I presume is an SFD-verification code of sorts (based on the pattern). However, it would appear this is dead code on disc and it's not actually executed.


[Image: image.png?ex=66c3477f&is=66c1f5ff&hm=21a...08ea60f4f&]


I run the game with the PCSX2 debugger and it appears the IPU control registers aren't used (I also can't find their addresses in the game's code). So again, it's very much possible decoding is done in software, but so far I am unable to see any function in the stack of the emulated EE chip that would stick out. In fact, it would appear the only active thread just cycles a small portion of the code, without doing anything else.


Does anyone have suggestions on how I can approach this?


Please feel free to move the thread to appropriate section, I wasn't sure where to put it.


Attached Files Thumbnail(s)
       
Reply

Sponsored links





Users browsing this thread: 1 Guest(s)