jPSXdec is a cross-platform PlayStation 1 media decoder/converter.
Get the latest version here.

Sunday, January 20, 2008

PSX YCbCr to yuv4mpeg2

PSX YCbCr

Given Y, Cb, and Cr color range of [-128, 127].
                              PSX
[ 1 0 1.402 ] [ Y + 128 ] [ r ]
[ 1 -0.3437 -0.7143 ] * [ Cb ] = [ g ]
[ 1 1.772 0 ] [ Cr ] [ b ]

yuv4mpeg2 (i.e. Rec.601) YCbCr

Given Y color range of [16, 235] and Cb,Cr color range of [16, 240].
                              Rec.601
[ 1.164 0 1.59 ] [ Y - 16 ] [ r ]
[ 1.164 -0.391 -0.813 ] * [ Cb - 128 ] = [ g ]
[ 1.164 2.018 0 ] [ Cr - 128 ] [ b ]

To convert a PSX YCbCr color to a Rec.601 YCbCr color:

[ 1 -3415973/13224846875 1242172/13224846875 ]
[ 0 105814197/105798775 -5608/105798775 ]
[ 0 19492/105798775 105791687/105798775 ]


Answer: yuv4mpeg2^-1 * PSX =
[ 1 3415973/13225888625 -1242172/13225888625 ]
[ 0 105791687/105807109 5608/105807109 ]
[ 0 -19492/105807109 105814197/105807109 ]


Rec601_YCbCr =
PSX
[Y + 128] [ 16]
Rec601_Matrix^-1 * PSX_Matrix * [Cb ] + [128]
[Cr ] [128]
Where
Rec601_Matrix^-1 * PSX_Matrix =

[250/291 -488509/2660418030 -82738/1330209015]
[0 4014411/4571165 164/4571165]
[0 3673/27426990 8031459/9142330]

Thanks to toruvinn for refreshing me on matrix math, and this site and Maxima for saving me from lots of raw calculations.

Update 27Feb2010: Fixed.
Update 23Mar2010: Really fixed.

Sunday, January 6, 2008

HATSUHINODE

Hope all had a pleasant new year. As we enter 2008, it is interesting to note that this year marks the 10th anniversary of the Serial Experiments Lain anime series, along with the Playstation game.

Now that holidays are over, I finally managed to release the latest compiled executable on the download page. No changes to the program interface (same wonderful command-line that you're used to ;), but it has all the latest internal goodness that I hope actually works--most notable is it now [edit] mostly supports FF8 (it would help to fully test it before making such calims :P).

Friday, December 14, 2007

Happy Winter Solstice

This time of year brings, among other things, demands that defy the known laws of time and space. So further updates for jPSXdec and the STR file format will have to wait until after the holidays.

In the works:
  • Full FF8 support done!
  • GUI well, it's something
  • Removing dependence on Java 1.6, down to 1.5 done!
  • FF9 video support video yes, audio no
  • TIM image searching and converting need to include more comprehensive TIM searching
So until then, may you have a pleasant season.

Thursday, November 29, 2007

Games tested with jPSXdec

PLEASE LEAVE A COMMENT ABOUT ANY GAME YOU USED WITH JPSXDEC

Alundra 2 - works
Valkyrie Profile - works
Xenogears - works
Final Fantasy Chronicles - works (video at 30 fps)
Saiyuki: Journey West - works
Intelligent Qube - works
Power Puff Girls - works
Simpsons Wrestling - works
Super Puzzle Fighter 2 Turbo - works
Lethal Enforcers 1 and 2 - works
Battle Arena Toshinden - works
Metal Gear Solid - works
Silent Hill - works
Tekken 3 - works
Xeno Gears - works
Motorhead - works
Oddworld Abes Oddysee - works
Spyro - works
Worms World Party - works
Soul Blade - works
R4 Ridge Racer Type 4 - works

Samples from ffmpeg examples
abc000.str - works (video at 30 fps)
descent_descent-e.str.bz2 - works
finalfantasyVII_movie-gold4.mov.bz2 - works
jumpingflash2_music2.xai.bz2 - works
jumpingflash2_movie-01.str.bz2 - works
lain.str - works
lunar2.str - works (video just under 20 fps)
river1.str - works (video at 12.5 fps)
st3.xa - works
logo.iki - works (from game "UmJammer Lammy")

Games requiring special handling
Serial Experiments Lain - works
FF7 - works
FF8 - works
FF9 - works
Chrono Cross - works
Alice in Cyberland - works
Sonic Wings Special - last movie seems like filler data, but can be converted if it is first copied off the disc normally
Ace Combat 3 - works
Legend of Mana

Gran Turismo?
G-Generation?
Ko'hloons Gate?
Maborosi (まぼろし月夜) Moonlit Night?
Formula 1?
Lunar 2?
BeatMania 4?

Friday, November 9, 2007

"Huve Fun With Family Movie"


...with out warranty of any kid.

Tuesday, November 6, 2007

#lain

Through a lucky course of events, the folks over at a Lain IRC channel ran across my page. As farhan put it, "i suppose lain favours your blog". The people were friendly, and I met an excellent tester that helped with the jPSXdec development (thanks phm!).

If you love Lain, and know how to get around IRC (or can fake it, like I do ;), then feel free to join us at IRCnet (open.ircnet.net or maybe irc.ircnet.com) #lain.

Sunday, November 4, 2007

nihongo

Since I began the task of decoding the Serial Experiments Lain Playstation movies years ago, I've hoped some friendly multi-lingual folks might someday translate all the audio and movies into English. I've always assumed the translated media would be downloadable, separate from the game itself, until I met a fellow who had the lofty desire to put the translated media back into the game.

I wondered what he was going to do about the 2 hours of audio. Dubbing seems the only option. But while finally playing through the whole game the other night, I found there are many sound-effects and characters in the audio portions. I would hate to lose all that to dubbing (not to mention my preference for sub-titles).

However, I also noticed the pictures shown in the background as you listen to audio, and I started thinking...


Not an actual screen-shot (you can tell by the pixels), but I have the ability to make it so. This isn't a perfect solution, but could be an alternative to dubbing (and it's probably easier too).