Friday, February 23, 2007

The Missing Artifact of MPEG Evolution

Man, it's been a while...

First off - last blog I made I mistook "TM Revolution" for "TM Network". The former is the 5 foot tall Japanese Michael Jackson who did the better of the RUROUNI KENSHIN TV themes, Heart of Sword. The latter is a mid 80's Japanese band who did the god-awfully unfitting VAMPIRE HUNTER D theme song. So, my bad.

So... where the fuck have I been? I'd like to know myself. Seems like at every turn I'm not doing anything special, yet I'm also not getting anything finished. But I have some good news for the... 2 or 3 fans of Kentai Films out there.

ANGEL COP - The subtitles are done. That's right. Not "I just need to fix this" or "they need to be formatted for that". Done.

My god it feels good to say that.

Now I've hit a new problem. Disc 3 is currently 4.967 gigs. DVD-R's have 4.7 gigs total. So... you see the dilemma just brewing there, since as the subtitles are done, they haven't been added to the DVD. Nor have the I added the liner notes, which remain the final link in getting this DVD set released. They're actually written, and while the background for it is "cute", it's also taking up only a small part of the screen, which isn't particularly helpful for reading on a small screen. So... they might get pasted into a new template. No biggie.


COUNTDOWN 2
- The menus' are "mostly" done, and I plan on re-scanning the Countdown/Temptation manga (that's relevant), but everything else is reasonably finished. This'll be the next release after Angel Cop. After that, Genocyber. Or else I don't get to do Adventure Kid. And nobody wants that to happen.


So, on to the rambling you actually come here for.

I hate re-encoding video. I mean, I really, REALLY hate it. Because, no matter what, you can't re-encode something and have it look like the source video. At least not with DVD's. DVD's are semi-low bit rate MPEG-2 files, and they have their own compression issues - banding, pixelation, mosquito noise, crap like that. So logically, saving them to the same format will not only have the same issues as the master, but a new layer of MPEG related ugliness on top of THAT. Ain't that just fun, waiting 16 hours to learn your professional style encode just looks like crap?

Now, unfortunately, it's something I have to learn to live with. Not everything will fit on a DVD-R, and even if it did putting a 65 minute feature (for instance) that's only 4.9 gigs on a DVD-9 is... well, insane. That didn't stop Manga Entertainment, mind, but I'm not that crazy. So, I need to find a way to compress a video file without... making it look like crap.

VAMPIRE HUNTER D (OVA, 1985) was the first title where that really became an issue. Having decided to restore the transfer, I found that for every problem I fixed, a new one was created. Having sighed, shrugged my shoulders and decided an un-remastered port of the R2 would probably be okay (despite having since found a better way to make the disc look sexier), I found I had to re-compress it anyway to fit the special features. So, I took a look at what could be done with TMPGEnc Plus 2.5, and Cinema Craft Encoder 2.7, which are regarded by hobbyists as some of the best encoders on the market. Now, to illustrate what I've found, I've included some screencaps of Doris doing her thing with her glowing whip. (Rrrrrrow!) You'll notice that there's 2 images happening on the same frame: this is how "interlaced" transfers work in NTSC land. It's complex, but basically this is how they convert film, which runs at 24 frames per second, in to NTSC, which runs 30 frames per second. During playback it looks fine. They're also - notably - harder to compress than progressive frames (which only store the 24 film frames and "force" the player to swap out to 30 fps through hardware or software).

Everything has been recompressed to high quality JPG, since there's no way in hell I'm uploading 15 gigs for a short blog post. Click the teeny pictures to open bigger pictures for, y'know. Good comparison's sake.

This is the original DVD frame. No filters, no recompression... just, it. Note that there are virtually no chunks of blocky, pixelated crapola'. In short, this is what MPEG video is supposed to look like. It's about 6.5 MBPS.







This is the same frame, as compressed by CCE in "interlaced" mode, at 6 MBPS. Note that it looks a bit "grainier", but it's still pretty close.








This is the same frame, as compressed by TMPGEnc in "interlaced" move, at 6MBPS. Note that... it looks like crap. Macroblocks (those blocky nasty patches) literally EVERYWHERE. I couldn't have made this shot look any worse if I wanted to.




So, TMPGEnc is a piece of crap and I should never touch it again, right? Well... that's what I thought, 'till I tried compressing something else. Check this out.



This is the original frame. Again, how it's supposed to look at about 7 MBPS.









This is TMPGEnc, re-compressed to 5 MBPS. It looks... pretty much identical. Slightly softer, but otherwise I don't notice anything.








This is CCE, re-compressed to 5 MBPS. Something's... wrong, isn't it? First of all, there's more noise on the right side of the screen - little flecks of the wrong color. It's subtle, but this shot is definitely noisier than the source. Also, check Devilman's tongue. And check his chin. Not only did CCE somehow stretch the video at the bottom, making Devilman's neck longer, but it also magically made his tongue BRIGHT red. Now... an encoder is supposed to make the file smaller without making the video look notably different. In short, CCE lost hard on this comparison.

So, what went wrong above? Simple: TMPGEnc just compresses very poorly when you feed it high-motion interlaced content. So... is there some way to fix that?



Beautiful, isn't it? This is TMPGEnc, at 5 MBPS (1 MB less than the fugly encode!) in Inverse 3:2 Pulldown mode, which encodes only the film frames when it can, and regresses to interlaced frames when the telecine sucked and turned out 100% interlaced (like on poor Doris here). Also, we lose the interlaced "ghosting" effect since the video is now progressive instead of interlaced. Unfortunately... Maestro won't read these Inverse 3:2 Pulldown video files, saying the "progressive stream is set to zero".


...but I found a way to fix that with ReStream. So I can use that sexy transfer if I want to. You bet your balls I'm planning on using this to my advantage in the future.

In short, TMPGEnc - at least, when it doesn't have to encode progressive content as interlaced - is a godsend from Cthulhu himself. The new transfer, while perhaps not 100% equal to the master, is so close (and so much smaller!) that I really don't care if it's a re-compression with an extra macroblock to be found every once in a while. In fact, I just upgraded to TMPGEnc XPRESS just incase that has a magically better encoding algorithm hidden inside.

I think I will tout a Digitally Remastered 4:3 AND 16:9 transfer on Vampire Hunter D after all.

Also: upscaling ANGEL COP in the future is right out. I'll explain why later.