Oldskooler Ramblings

the unlikely child born of the home computer wars

Archive for the ‘Digital Video’ Category

8088 Domination Post-Mortem, Part 1

Posted by Trixter on June 19, 2014

These next few posts are a technical write-up of how I created 8088 Domination, which is a program that displays fairly decent full-motion video on a 1981 IBM PC. Before reading further, it might be worthwhile to familiarize yourself with the production itself if you haven’t seen it. Here is video of what it looks like running on a 1981 IBM PC 5150 connected to a TV via the composite output jack:

…and if you doubt the above video’s authenticity, you can download the production and run it on your own vintage hardware as proof.

I would like to apologize in advance for switching between past tense (ie. my thought process during the design phase) and present tense (when describing how to achieve certain objectives) throughout this write-up.

Background

I’ve been fascinated by desktop digital video for decades. Starting with the first Video For Windows tools in the early 1990s, using early capture hardware (like the Media Vision Pro Movie Spectrum, which captured directly into MSV1/CRAM format), I’ve toyed with desktop video and its possibilities.

Of course, I’ve also been fascinated with demos since the early 1990s, and when you love two things that much, you find ways to mash them together. Many of my demoscene productions have had video as a part or whole of them in some way. Grind (1993) was a modplayer that displayed dancing Spring Break girls in perfect time to the music; the end-part of Explicit (1996) has dancing clubbers embedded in cubes, also dancing in perfect time to the music; and of course 8088 Corruption (2004) which displayed FMV on a 1981 IBM PC and took a chunk out of my 15 minutes.

8088 Corruption was not recognized for amazing quality video, but rather its novel solution to the problem of trying to display FMV on such a limited platform. That solution was to use 40×25 text mode, since that was the only mode represented in an amount of video memory that could be completely changed every frame without distracting artifacts or overtaxing the system.

I gave a talk in 2007 that explained 8088 Corruption in detail, and in that talk I explained that displaying FMV using CGA in graphics mode would be impossible. This is because CGA graphics mode uses 8x the amount of video memory that 8088 Corruption was handling. Even a simple calculation assuming 24fps video reveals that the amount of data needing to be updated per second (24fps * 16KB = 384KB/s) is outside of the IBM PC’s capability: CGA RAM can only be changed at a rate of 240KB/s, and most hard drives of the era operate at roughly 90KB/s. It sure felt impossible, so that’s why I said it.

Then I thought about the problem for 7 years.

Adjusting Expectations

I came to several realizations over the past few years thinking about this “impossible” problem. The most basic realization is that it isn’t always necessary to change every single pixel on the screen to show convincing FMV. If only a portion of the frame is in motion, such as in traditional animation, or a “talking heads” newscast, not every pixel is changing onscreen. But even if all pixels in a frame are changing, they might only be changing just a little bit… and if they are changing that little, the viewer might not notice if we cheat and don’t change them at all. So, we need to let go of the idea that we must change the entire screen every frame.  With the right picture content, we can get away with changing only a portion of screen memory, and it will look like we’re changing the entire screen.

delta_anim

Left: Black and White=differences, Grey=unchanged. Right: What the user sees after applying only the changes

Another realization was found re-evaluating what kind of bandwidth is available on the system. Previously, I was using the “40×25 text mode 2K of RAM” definition as the limit of what can be changed onscreen. But “2K of data changed” isn’t the real limitation; rather, it’s “not exceeding the time it takes to alter 2K”. In other words, the real limitation is not exceeding a specific time quantum per frame updating screen memory, no matter how much screen memory you’re changing.

This lead to a similar thought about disk I/O. In Corruption, I treated disk bandwidth as a series of fixed-length reads at a frequency of the framerate I needed to produce. As a result, Corruption uses fixed-length video+audio packets, so that (framerate * packetsize) is guaranteed to be less than the available disk bandwidth. But there’s no reason to adhere to that; the real limitation is the disk I/O itself, and I could read any amount of disk I wanted in a given time period as long as I didn’t exceed what the hardware could provide. This lead to the realization that video+audio packets could be of a variable length.

The combination of these and other ideas led to the design of a system that could fulfill the original requirement of “FMV in graphics mode”, which means we need a system that:

  • Finds differences between frames and updates screen memory with only those differences
  • Keeps track of how much time it takes to change screen memory and doesn’t exceed it
  • Keeps track of how much disk space is used and doesn’t exceed the transfer rates of the disk subsystem
  • Most importantly, degrades gracefully if we run out of CPU time or disk bandwidth before the source image is finished displaying

Because the IBM PC is not fast enough to make these decisions realtime (nor has the bandwidth to do so), all of these constraints needed to be handled during the encoding phase, when we have nearly unlimited time. That also means that most (if not all) of these constraints are really just data management problems, which I’ll get to later. But before we write even a single line of code, we need to back up a little and see how to convert 24-bit color pictures into something that doesn’t look like total crap on a CGA card.

CGA FMV Graphics Conversion

A quick primer on CGA: CGA was the first color graphics standard for the IBM PC, and contains 16KB of memory to hold screen contents. That memory can be presented as a few different graphics modes that appear different, but are actually all the same under the hood: 80 “byte columns” wide by 200 lines. Those 80 byte-columns can be sliced up a few different ways:

  • 640×200 with 2 colors (1 bit per pixel)
  • 320×200 with 4 colors (2 bits per pixel)
  • 160×200 with 16 colors (4 bits per pixel)

Let’s see what those look like in practice. Here’s a pretty hummingbird:

hum_original

…and here’s that hummingbird converted to our three basic choices without any fancy processing:

hum_160_nodither

160×200, 16 colors

hum_320_nodither

320×200, 4 colors, palette 1

640x200, 2 colors

640×200, 2 colors

Already the graphics programmers in the audience are screaming DITHER THAT SHIT, and they would normally be correct. However, most dithers that people are familiar with are error-diffusing dithers, which means that error differences are propagated throughout the entire picture. This is not a good idea for a system that is going to be recording changes between frames just like LoL does in their challenger series, because if a single pixel changes in the source material, every single pixel in the dither algorithm’s row scanning order after the change is going to change as well. What we need is a so-called stable or localized dither, where the value of each output pixel does not depend on its neighbors. That way, when only a local area of the source material changes, only that area of the destination dither will change as well.

While there are some modified, alternate dithers that keep error propagation to a spatial minimum (ie. Riemersma dither, which dithers along a Hilbert curve), the only truly localized dithering algorithm I know of is ordered dithering, sometimes called Bayer dithering. Some of the best publicly-available research on color ordered dithering is by Bisqwit (“Yliluoma’s arbitrary-palette positional dithering algorithm“) so I won’t try to explain the concepts here; consult that instead.

Applying even a rudimentary ordered dither to our sources now shows this for our hummingbird converted to our three graphics modes:

160x200, 16 colors, ordered dither

160×200, 16 colors, ordered dither

320x200, 4 colors, palette 1, ordered dither

320×200, 4 colors, palette 1, ordered dither

640x200, 2 colors, ordered dither

640×200, 2 colors, ordered dither

Much nicer, and we don’t have to worry about the dither introducing massive differences between frames if only one pixel changes in the source.

While all three of those modes look viable in their own way, for Domination I had to make the decision to discard the middle one (320×200, 4 colors). This is because the 16-color and 2-color modes display properly via the composite output jack on the CGA card, and I knew I’d have to present at the compo with the native hardware hooked up to a projector.  So my choices were limited to 160x200x16 and 640x200x2.

Managing Ch-Ch-Changes

The very fastest way to change screen memory on the 8088 is to either copy a linear sequence of bytes using REP MOVSB, or set a linear sequence of bytes all to the same value using REP STOSB. With this in mind, I chose to keep track of each change as a starting and ending offset of changed bytes, because that was closest to the exact method I would be using to “replay” those changes. I adopted a terminology to reduce confusion throughout the source code: I coined the term “delta” to refer to an area of changed bytes, and further classified deltas into “slices” (a delta where not all bytes are the same) and “runs” (deltas where all bytes are the same). This was important because “runs” can fill screen memory extremely quickly using REP STOSB, so it was worth keeping track of them. Here is the actual data structure I used:

  TDelta=object(TObject)
    startOfs:word;         {starting offset of delta in buffer (first changed byte)}
    endOfs:word;           {ending offset of delta in buffer (last changed byte)}
                           {rest are calculated during insert or other operations:}
    dtype:deltaType;       {slice or run}
    fillvalue:byte;        {for informational purposes only, not used for anything}
    blength:word;          {length of delta in bytes}
    numPixelsChanged:word; {# of pixels changed in the entire delta}
    REPcycleCost:real;     {different whether slice or run}
    frozen:boolean;        {flag used to control various optimization phases}

    Constructor Init(starto,endo:word);
    Destructor Done; virtual;
  end;

All of these deltas needed a good structure to collect and manage them, so I decided to use a Turbo Pascal 7 data structure called a TSortedCollection, which is analogous to a sorted linked list. Deltas were added to this list and maintained in sorted order using a variety of criteria in the following priority:

  1. Larger/Longer Deltas placed before smaller/shorter ones
  2. Given the same length, “runs” placed before “slices”
  3. All runs sorted by their fill value
  4. Given the same length, all deltas sorted by their interlaced start offset in memory

The sort order seems like an odd thing to mention here, doesn’t it? I’ve done so because it was a contributing factor to the success of the project, as it solved many data processing problems later on. It was so helpful that I think it’s worth going over in detail:

  1. Larger/Longer Deltas placed before smaller/shorter ones: As we process deltas from the top of the list to the bottom, the largest areas of the screen will change first until we run out of bandwidth. If we decide to completely jettison the list entirely before it is finished due to bandwidth starvation, only the smallest changes at the bottom of the list — the ones that don’t matter very much visually, as they only change a few pixels — are discarded.
  2. Given the same length, “runs” placed before “slices”: This gave priority to runs, because setting an area of screen memory with REP STOSB is both faster and smaller than trying to copy the same area with REP MOVSB.
  3. All runs sorted by their fill value: This came in handy during the encoding phase, where I was able to set a fill value once and then cache that value for subsequent runs if applicable. I would not have been able to do that if all the similar fill values weren’t right next to each other.
  4. Given the same length, all deltas sorted by their interlaced start offset in memory: This was an aesthetic choice; if I had to change an area where all deltas were exactly the same length (like a rectangular area of the screen), this allowed the changes to “paint” in somewhat linear top-to-bottom order.  This is necessary because CGA’s framebuffer is not organized in a linear fashion, but is interlaced.

For the curious, this is what the sort operator looked like:

Function TDeltas.Compare;
{
We want to maximize motion fidelity, so we are going to make our lives
easier and sort deltas by size.
Note that the comparisons are reversed -- that's because we want the largest
deltas at the beginning of the list.  (-1 means beginning of collection.)
- We add a second comparison so that deltas of the same length are sorted
by cycle execution time; this keeps runs prioritized over slices in terms
of what to prioritize if our bandwidth gets starved.
- We add a third comparison so that runs of the same run value
are kept together, so that we can cache the run value.
- We can optionally add a fourth comparison so that, all things being equal,
deltas are sorted by start offset compensated for CGA interlaced memory layout
(this is what I'm colloquially calling "Dave Murry interlace handling"
based on how Dave handled it in the PC booter Sierra Championship Boxing).
}

var
  k1so,k2so:word;

begin
  k1so:=PDelta(Key1)^.startofs;
  k2so:=PDelta(Key2)^.startofs;
  if MurryHandling then begin
    {if k1so > screenRAMsize div 2 then k1so:=k1so-(screenRAMsize div 2);
    if k2so > screenRAMsize div 2 then k2so:=k2so-(screenRAMsize div 2);}
    k1so:=k1so AND $1fff;
    k2so:=k2so AND $1fff;
  end;
  {sort by delta length}
  if PDelta(Key1)^.blength > PDelta(Key2)^.blength
    then Compare := -1
    else if PDelta(Key1)^.blength  PDelta(Key2)^.fillvalue
            then Compare := -1
            else if PDelta(Key1)^.fillvalue < PDelta(Key2)^.fillvalue
              then Compare := 1
              {sort deltas by start offset}
              else if k1so  k2so
                  then Compare := 1
                  else Compare := 0;
end;

With the data structures finalized, encoding one video frame's worth of changes becomes a simple matter of doing the following:

  1. Scan the preexisting frame and new source image for differences, and insert each found difference into the delta list data structure
  2. Determine the amount of CPU time and disk bandwidth we have available to paint our changes (a “byte pool” and a “cycle pool”)
  3. For every delta in the list, starting with the first and iterating to the last:
    1. Estimate the cycle and byte cost to paint this delta
    2. If our cycle or byte pools won’t be exhausted by these costs, encode the delta to disk and then remove it from the list, then updated the pools
    3. If one of the pools will be exhausted, skip this delta and move to the next one, which will likely be smaller or faster (or both) and have a better chance of not exhausting a pool
  4. If we empty the list, we’re done with the frame
  5. If we reach the end of the list, we are out of “time” for this frame and need to either:
    1. Spend the next frame going through the list again to finish up so that the existing source image has a chance to fully display, or:
    2. Throw away whatever is left and start working on a new source image

That’s pretty much it. When I release the source in a few weeks, you’ll see that the code implements the above logic very closely. However, there’s one very important detail that I haven’t explained yet, and it’s critical to playback performance: What does “encode the delta to disk” mean exactly, and how do we play an encoded delta back to screen memory as quickly as possible? Head on over to the conclusion of  our thrilling tale, where I’ll explain how I came up with a unique solution to that problem.

Posted in Demoscene, Digital Video, Programming, Vintage Computing | Tagged: , | 53 Comments »

8088 Domination

Posted by Trixter on June 17, 2014

A few days ago, I debuted 8088 Domination at @party 2014, which is an official sequel to 8088 Corruption that I made 10 years earlier. Like the former, 8088 Domination displays full-motion color video with audio on a 1981 IBM PC with CGA, a Sound Blaster, and any hard drive — but, unlike the former, Domination uses full graphics mode whereas Corruption used only text mode. This is significant because graphics mode requires 8x more memory and processing, and I had to combine a lot of creative and technical disciplines in order to pull it off.

Here is a capture of 8088 Domination running directly off of my IBM PC 5160; video is the composite CGA output signal, and audio is from a Sound Blaster Pro 2.0.

I am working on a postmortem write-up so you can all learn how I did it, but until then, download the party version at https://www.scene.org/file.php?file=%2Fparties%2F2014%2Fatparty14%2Fdemo_oldschool%2F8088_domination_party_version.zip&fileinfo if you’d like to run it on your own vintage hardware.

PS: A second round of thanks to Great Hierophant, for without whom I wouldn’t have been able to show off my production. He provided the hardware locally that I was unwilling to ship across the country.

Posted in Demoscene, Digital Video, Programming, Vintage Computing | 15 Comments »

I grow tired of the technologically ignorant

Posted by Trixter on February 29, 2012

(This post is overly subjective, more opinionated than my usual efforts, and contains some cussing.  Consider yourself warned.)

I am sick and tired of people who shun technology and progress under the guise of “I’m an old tech veteran, I’ve been working with technology for 30 years, and the new stuff is crap compared to the old stuff.”  People who defend this viewpoint are idiots.  I’m not talking about audiophiles or other self-delusional “prosumers”; I’m talking about people who have worked a tech trade or had hands-on access to technology for many years and think that their perceptions trump reality.  It’s a perverse combination of technology and anti-intellectualism — a form of hipsterism for the over-40 set.

I was prompted to cover this by a recent post on why widescreen monitors are a rip-off (which I will not link to because I truly enjoy the other 99% of this person’s blog, and linking to it would imply that I don’t like him or his site), but the underlying irritation of the entire mindset has been percolating for many years.  Viewpoints that drive me crazy include:

Widescreen monitors don’t make any sense

People think that widescreen monitors are stupid on laptops because most people use laptops for text work, and since text is more comfortable to read in columns, wide columns are harder to read.  This mindset has had the doubly idiotic result of making people think that websites need to be column-limited.  I just love going to a website and having the text squished into a 640-pixel-wide column with 75% of the screen unused.  Don’t like how narrow columns look on a widescreen monitor?  Use the extra space however you want — put up two web pages side by side, or simply don’t look at the unused space.  It’s people like these that also complain that 4:3 video has black bars on either side of it when viewed on a widescreen TV.  It’s called pillarboxing, you idiot, and it’s there to prevent your movie from looking like a funhouse mirror.

Widescreen monitors have made modern laptops better.  A widescreen laptop monitor allows the keyboard to be wider without the depth of the laptop getting too high (to support the height of a 4:3 monitor).  Having a decent keyboard on a laptop used to be impossible without clever wacky engineering tricks; now it is.  Widescreen monitors made ultra-small netbooks possible, so if you’re reading this on a netbook but somehow still disagree with me, you’re a hypocrite.

Analog audio is better than digital

There are entire websites (and wikipedia pages) dedicated to this, usually under the guise of “vinyl is better than CD”.  Most opinions on this subject were formed when analog audio had several decades of mature mastering and production processes, and digital was brand-new (for example vinyl vs. CD in 1983).  Early efforts to put things on CD resulted in some less-than-stellar A/D conversion, which created a type of distortion that most people weren’t used to hearing.  People formed opinions then that have perservered more than 25 years later, even though the technology has gotten much better and all of the early mastering problems have long since been corrected.

People who think vinyl sounds better than CD have nostalgia blinders on.  They bought an album in their youth, played it endlessly, loved it.  Then they buy the same album on CD decades later and condemn the entire format as inferior because it sounds different.  Want to know why it sounds different?  It has a wider frequency range, lacks rumble, lacks hiss, sounds exactly the same after 10+ playbacks, and was remastered with better technology and mixing conditions under the guidance and approval of the original artist when he wasn’t coked or drunk or stoned out of his mind.  People like Pete Townsend, Neil Young and Geddy Lee not only approve of the latest digital technology but are actively utilizing it and going through great pains to remaster their classic albums with it.  People are missing the point that it is the mastering and digital compression that causes issues, not the technology itself.  Neil Young recently spoke at a conference where he damned digital music, but not because it is digital — rather, because it is delivered differently than the artists intended.  Neil Young would like nothing better than for everyone to be able to listen to his music at 24/192.  Can’t do that on vinyl, bitches.

Even people who write about the loudness war get it wrong, despite that it’s an easy concept to understand.  Massive dynamic compression drowns out subtle details and can add distortion, which is horrible — but it is not exclusive to digital audio, nor caused by it.  One author correctly notes that massive dynamic compression butchers mixes, but then subtlety implies that all CDs that “clip” have distorted audio.  Digital audio “clips” only if you drive the signal beyond its digital limits.  If you took an audio waveform and normalized it such that the highest peak reached exactly the highest value, it is “positioned at maximum volume”, not clipped.  Nothing is lost (to be fair, nothing is gained either).

The problem is the mastering and production process, not the technology.  Which segues nicely into:

“I will never buy Blu-ray”

The only valid argument against Blu-ray is that it is harder to make a backup copy of the content.  It is indeed harder than it is for DVD, or laserdisc, or videotape.  That is it.  All other arguments are beyond moronic.  Even the cheapest possible 1080p HDTV viewing setup has five times the resolution of DVD and lacks signal degradation in the output path.  If you view a Blu-ray and can’t tell the difference between it and DVD, you have either a shitty viewing setup, a shitty Blu-ray, or a shitty visual cortex.

Someone recently tried to argue with me that DVDs have the same or better picture than Blu-ray and used Robocop as an example.  The comparison was weighted, as they were comparing the $9 Blu-ray that MGM belched out when Blu-ray was only a year old to the Criterion DVD treatment.  I own both, so I checked them out and I agree that the DVD has better color tonality throughout the film.  However, the Blu-ray thoroughly stomped the DVD in every single other area, most obviously resolution.  So much picture detail is added by the increase in resolution that I actually prefer it despite the lack of Criterion oversight.

The real problem, as previously stated, is how the mastering and preproduction process was handled.  Even with new 2012 DVD releases, you can still see the “loudness war” video equivalent of digital ringing, which used to be an accident but was later introduced on purpose as part of a misguided “sharpening” step.  Listen up:  Any sharpening filter added to any signal doesn’t make things sharper; it makes them appear sharper by overlaying a high-frequency permutation signal over the original content, which increases the acutance.  Quality is actually lost when you do this, as the high-frequency info obscures actual picture detail.

This is another example of perception vs. reality, which not coincidentally also segues into:

“Computing was better in the old days”

I love retrocomputing as a hobby.  I think about it nearly every day; this blog was partially created to talk about vintage computing.  But even I wouldn’t say that things were better in the old days.  People who say this don’t realize they are really trying to say something else.  For example, people who say that “BBSes were better than web forums are today” are actually referring to the sociological fact that, when you communicated with people on a BBS, you were communicating with people who met a minimum level of technical competence — because, if they hadn’t, they would have been too stupid to access a BBS, let alone be proficient with a computer.  The overall technological quality level of everyone you met on a BBS in the 1980s was higher than other places, like a laundromat or a bar.  What such people fail to consider is that modern web boards, while having a higher quotient of trolls and B1FFs, are open to the entire world.  The massive scale of humanity you can encounter on even a tiny niche topic is levels of magnitude higher than it used to be.  The sheer scale of information and interaction you can now achieve is staggering, and completely outweighs any minor niggle that you have to deal with 3 or 4 more asshats per day now.

Here’s another example:  “Computer games were better back in the old days.”  This is wrong.  The proper thing to say is that “Some computer game genres were better back in the old days.”  I can get behind that.  For example, graphics were so terrible (or non-existent!) at the birth of computer gaming that entire industries sprang up focusing on narrative.  For such genres (mainly adventure games), several times more effort was put into the story than other genres.  As technology and audiences changed over time, such genres morphed and combined until they no longer resembled their origins.  That doesn’t mean modern games are terrible; it just means that you need to shop around to get what you’re looking for your entertainment.  Don’t play Uncharted 2 expecting a fantastic story with engaging narrative.  (Dialog, maybe, not not narrative.)  Heck, some genres are genuinely awesome today compared to 30 years ago.  For example, Portal and Portal 2 are technically puzzle games, but the storytelling in them — despite never interacting directly with a human — is among the very best I’ve ever encountered.

About the only argument that does work involves the complexity of older computers — they were simpler, and you could study them intensely until you could very nearly understand every single circuit of the board, nuance of the video hardware, and opcode of the CPU.  Today, a complete understanding of a computer is no longer possible, which probably explains why Arduino sets and Raspberry Pi are getting so much attention.

Conclusion

I have no conclusion.  Stop being an old-fogey anti-intellectual technophobe, you ignorant hipster fuck.

Posted in Digital Video, Entertainment, Sociology, Technology, Vintage Computing | 10 Comments »

MindCandy Volume 3’s First Review

Posted by Trixter on November 30, 2011

Blu-ray.com gave MindCandy Volume 3 a Recommended rating with 4 out of 5 stars, and I couldn’t be happier.  I really respect blu-ray.com’s reviews for their specific coverage of picture quality, sound quality, and extras — the things that blu-ray massively improves on over DVD — so getting a good rating from them means a lot to me.  Picture Quality got a 5 out of 5, of course :-)

One of the things we got dinged on was the audio rating (3 out of 5), not because the sound was bad, but because the audio tracks weren’t lossless.  I agree lossless audio would have been best, but we couldn’t use lossless because of a technical limitation in Adobe Encore.  Encore had trouble dealing with .wav files over 2gig, which was the original RIFF .WAV format’s limitation (the W64 and RF64 extensions to .wav have overcome this, but Encore doesn’t support them).  At 3.5 hours of stereo audio @ 48KHz @ 24-bit resolution, a lossless track is 3.6gig.  I ran into odd random problems trying to use lossless 24-bit audio, but had no problems at all using Dolby AC3 audio.  So I chose the devil I knew.

Posted in Demoscene, Digital Video, Entertainment, MindCandy | 6 Comments »

MindCandy Volume 3 Is Now Available

Posted by Trixter on November 22, 2011

After 4 years of hard work and many setbacks, I’m very pleased to announce that MindCandy Volume 3 is finally available.

The official launch date is December 6th, however the first shipments will be going out to people who pre-ordered as early as Friday of this week.  You can order directly from us, from a reseller in your hemisphere, or from Amazon.

I’d like to thank the entire MindCandy crew past and present for getting “that  demodvd project” to this point.  From capturing some clips of a Capacala demo in 1996, to a professional Blu-ray in 2011 with over 3.5 hours of demos and 7 hours of extras, it’s been a long great ride.

And special thanks to my family, for putting up with me and my hobby :-)

Posted in Demoscene, Digital Video, Entertainment, MindCandy | 12 Comments »

MindCandy Volume 3 sent to replicators

Posted by Trixter on October 14, 2011

After 3+ years of setbacks, MindCandy 3 was sent to the replicators ths morning.  Assuming there are no further issues, we should be shipping at the end of the month!

Update: As corrected by Dan, pre-orders before Black Friday and launch in December.  Assuming no problems at the replicator, of course.

Posted in Demoscene, Digital Video, Entertainment, MindCandy | 6 Comments »

Blu-ray media size mismatches

Posted by Trixter on October 3, 2011

This weekend, I finished the second (and hopefully final) Blu-ray release candidate for MindCandy 3.  (The DVD-9 is already final.)  Some major tweaks involved normalizing the audio across the entire thing, and a minor tweak was to re-encode the main video at a higher quality, so it could grow larger, so it would need to be split across layers, so that the disc is more compatible with old hardware players (it seems that if you’re going to do a layer break on a Blu-ray, it should be in the largest file, as there is apparently a minimum acceptable filesize for the break).  The size of the disc grew to about 46GiB, but since a Blu-ray is 46.6GiB, we were still under (by a hair).

Well, imagine my surprise when I tried to burn it to my rewritable test disc and saw this:

Considering our premastering tool is highly accurate, and hadn’t shown any errors when I was premastering the project, this was confusing.  Fifteen minutes of research didn’t pull up anything concrete other than someone claiming that BD-RE discs take a few hundred meg as “reserve space”, whatever that means.

Rather than trust tha interwebz, I decided to check the media sizes of my rewritable BD-RE DL (50G) disc, and a regular BD-R DL (50G) blank using the media information window of ImgBurn.  Results:

BD-RE DL: Sectors: 23,652,352, Size: 48,440,016,896 bytes
BD-R DL:  Sectors: 24,438,784, Size: 50,050,629,632 bytes

Well look at that:  A rewritable dual-layer blu-ray has nearly 1.5 gig less available space than a regular blank.

Now you know!

Posted in Digital Video, MindCandy | Leave a Comment »

MPEG-2 Encoding, The OCD Way

Posted by Trixter on September 17, 2011

Remember that AssemblyTV advert that said we would ship MindCandy 3 in September?  We won’t, because we found several bugs in the first release candidate that we’re fixing.  In one instance, a Samsung BD-P1000 (a very early player) wouldn’t even get to the main menu!  So we’re going back and doing more compatibility fixes and testing, and adding a few missing features along the way (like pop-up menus for the NVScene talks).  We should be shipping in October.

However, with the Blu-ray build taking several hours at a time to test changes, I have some time to concentrate on the DVD (and write blog posts).  Let’s talk about MPEG-2 encoders.

Ever wonder what the very best MPEG-2 encoder is?  Each have different strengths, parameters, quantization matrices, sensitivity to noise, and so on.  There’s no way to see which one is best for your source footage until you try one.  So you may be tickled to know that we tested pretty much every single Windows encoder that someone claimed to produce decent results (with the exception of ProCoder, which kept crashing on my rig, which is a shame since I recall it produced great output).  A few months ago, I prepared the then-current 480i version of the main timeline, a thoroughly interlaced 3h29m27s 30i video.  I made an avisynth wrapper for it that presented itself as a YV12 colorspace format (what MPEG-2 uses) and fed it to several encoders, each set to the same average bitrate (4.7 mbit/s) and set to DVD-compliant settings.  I then ran the encoded results through the MSU Video Quality Measurement Tool and concentrated on five metrics:

  • SSIM (the metric x264 uses)
  • 3SSIM (a modified version of SSIM)
  • VQM (a metric that exploits the DCT to simulate human visual perception)
  • PSNR (older, depreciated)
  • The color results of PSNR (U and V components) since the previous four only looked at luminance (Y)

Finally, I took the average metric score for all 376642 frames, stuck everything in a spreadsheet, and color-coded each from green (most similar to the original input file) to red (farthest):


Encoder Notable Configuration Parameters Average SSIM (Y) Average 3SSIM (Y) Average VQM (Y) Average PNSR (Y) Average PSNR (UV) Average PNSR (U) Average PNSR (V)
CCE SP3 CBR 4.7mbit/s (intentionally bad) 0.9562 0.95988 1.14252 34.36616 39.05231063 38.9542 38.53384
Adobe Media Encoder CS5 Quality 5, max render depth 0.96163 0.96772 1.00816 36.35463 39.09635214 39.8727 39.42966
CCE SP3 default settings 0.96511 0.96949 1.01146 36.45595 39.00388083 39.41969 38.96111
HcEnc 0.26 9-bit DC, defaults 0.96355 0.97021 0.98358 36.63967 38.966577 39.57915 39.15758
CCE SP3 10-bit DC, CG1 matrix, no filters, Q16 0.96428 0.97053 1.03151 36.72093 38.86613 39.32893 38.8701
CCE SP3 9-bit DC, CG1 matrix, no filters, Q16 0.96446 0.97075 1.02869 36.75945 38.788335 39.33256 38.87439
TMPGEnc 5 9-bit DC, defaults 0.96324 0.97108 0.9676 36.93709 38.630765 39.53456 39.12228
QuEnc 0.72 9-bit DC, all quality settings on (slow) 0.96679 0.97581 0.9007 38.36719 37.93311 38.11264 37.75358

Some interesting things can be noted from these results (keep in mind that my source is a noise-free, digitally clean, computer-generated video):

  • Adobe Media Encoder, which uses MainConcept’s engine, clearly uses PSNR as its comparison metric when optimizing 2-pass encodes (unfortunately, PSNR is not a good metric to optimize to, which is why it doesn’t do well in the metrics that actually matter like SSIM and 3SSIM, and why it looks worse visually)
  • CinemaCraft readily sacrifices color accuracy during a CBR encode, presumably to fit the target bitrate better and try to preserve as much luminance as it can.
  • CinemaCraft’s default settings produce, for it, the best SSIM metric.  All attempts to make it better by me (10-bit DC precision vs. 9-bit, different matrices, different filter settings, etc.) actually made it worse.

The subjective viewing quality of each of these results was mostly in-line with the technical results with one exception:  The QuEnc output was noticably worse than its SSIM score above would suggest.  It’s hard to explain without showing individual frames as comparison, but there was just something in QuEnc’s output that made it feel worse to the viewer than the others.  The PSNR metrics confirm that somewhat.  I think I must have made a mistake somewhere along the way with my testing of the QuEnc encoder, so I mentally ignored it when making my comparisons.

So which one did we end up using?  To understand that, you should understand my motivation.  I have a history of using psychology in most of my projects to gain a slight edge with my target audience wherever I can:  I chose nerd-familiar material for 8088 Corruption, I played virt’s rickroll composition during my presentation of MONOTONE, the contribution point reward system in MobyGames was my idea, etc.  So while TMPGEnc produced the best overall results in subjective user observations across the entire video, we went with CinemaCraft SP.  Why?  CinemaCraft SP allows you to skew the bitrate for any number of user-defined sections.  I used this feature to ensure perfect visual quality for the very first and last demo in the timeline.  Start strong and finish strong.

Posted in Digital Video, MindCandy | 4 Comments »

MindCandy: What’s taking so damn long?

Posted by Trixter on May 24, 2011

Work on MindCandy 3 continues, and I wouldn’t be posting something if the end wasn’t firmly in sight.  After three years, it is 99% finished and the end really is in sight.  Here’s the status:

  • All the demos, intros, NVScene footage, production notes, and easter eggs are completely finished and through production.  (And the blu-ray footage looks absolutely stunning.)
  • All the group commentary is in, except for the very last one which I hope will come through because it’s pretty important in my opinion, but I’m not going to wait until MekkaSymposiumBreakpointRevision 2018 to get it.  (edit: we got it!)
  • Our cover is done, another masterpiece from fthr.  Our booklet is 95% done.
  • I dusted the cobwebs off my Cinema 4D knowledge and put together an intro animation for the disc.  (Just a 15-second abstract thing, mind you, but it’s better than being dumped unceremoniously into the main menu without so much as a how-do-you-do.)  I also did some background drone and foley for it — shocking, I know!  Don’t be too impressed; I used loops.
  • The blu-ray is finished authoring, which was an arduous process because Adobe Encore is so damn buggy.  Phoenix did some great menus given the limitations we had to work with.  I had to start over from scratch a few times, and even then there are some bugs which will just have to stay in.

If things are looking so rosy, why are there still about 8 weeks left before you can hold this masterpiece in your hands?  One word:

Subtitles.

At my most maximum speed, typing between 90-100 wpm with a clear understanding of what is being said, it takes at best 4x realtime to subtitle what people are saying on the commentary.  Because there is a mixture of accents and varying degrees of being able to speak English, this can take as much as 10x realtime.  And you can only do about an hour of it before your hands start to cramp up.  So let’s do some math:  If it takes, say, 7x realtime on average to subtitle, and we have 4 hours to subtitle (main feature+intro featurette+production notes), it would take one person about 28 solid hours to complete the subtitling.  I have about 90 minutes a day to do subtitling, from my train ride back home from work where I can get a good seat and fall into a groove, to free time during evenings.  Still, that means the soonest I can get done is about 18 days (2.5 weeks!) from now.

Luckily, I have some weekend time too, and other members of the group are taking chunks, so hopefully we’ll be done in less than 2 weeks.

I hate subtitling.  I really, really hate it, especially since you are creating subtitles for something that should never be watched without audio in the first place (these are demos for goodness sakes!).  But because we have an international audience, and that audience may not understand English all that well, we are going through this ordeal for you, the customer.  All praise attention to detail!  All hail the customer!

I haven’t thought about who is going to do the translation of the subtitles, which is unfortunately going to extend time even further.  Maybe we’ll only offer English subtitles.  I really don’t want to delay MindCandy 3 beyond Assembly — I want it to be ready by Assembly.  Which is also the reason I’m not going to subtitle the additional TEN HOURS of NVScene 2008 footage, even though it is hard to understand sometimes.  I’m sorry, but really, do you want MindCandy 3 to be delayed until the end of the year for subtitling?

Enjoy a frame from the opening anim:

Posted in Demoscene, Digital Video, Entertainment, MindCandy | 3 Comments »

Dopplegangers!

Posted by Trixter on February 13, 2011

I have free time to work on a single project at a time, and that project this weekend has been MindCandy.  (We’re very close to a test disc (yay!) — minus subtitles.  Subtitling 4 hours of multi-speaker dialog is a massive chore, multiplied by the number of languages you want to have, so we’re strongly considering not doing subtitles.)  But if I had time to work on multiple projects simultaneously?  I’ve always wanted to produce videos about classic hardware and games, 99% centered on the PC/DOS platforms of the 1980s.  Imagine how happy I am to have discovered the following people:

Lazy Game Reviews – Produces 10-minute reviews on both hardware and games, with a touch of humor and lots of footage captured from the real hardware whenever possible.  The Carmageddon review in particular is perfection, having been captured from a real 3Dfx card and with meaningful illustrations of gameplay, including some accurate history of the development of the game.  His Youtube channel is easier to navigate past shows, but the blip.tv channel earns him a modicum of cash and has better quality video, so… choose.

Ancient DOS Games – While LGR covers the gamut of classic personal computers and gaming, Ancient DOS Games covers only DOS games, and the thoroughness and attention to detail is astounding.  Features like tips and tricks on how to play the game, recommending the best graphics mode or DOSBOX settings per game, noticing what the framerate of the game is and how it affects gameplay, and even a comparison of dithering methods in Thexder and whether or not they were effective — these are all OCD traits that I would have put into my own coverage of the material.  His fly-outs are pixel-art amusing.

Those guys are doing such an amazing job that I really don’t see the need for me to do so.  The both of them combined equals a quality of work that I can’t see myself improving upon, which not only makes me very happy, but frees me up to work on other projects.  Check them out, dammit!

PS: I found I have a true doppleganger over on tumblr.  We have very much in common — moreso were I lesbian.

Posted in Digital Video, Entertainment, Gaming, MindCandy, Vintage Computing | 3 Comments »