When anti-aliasing hurts

Bungie posted their follow-up to the bombshell that Halo and Halo 2 output HD video signals when played on the Xbox 360. This Q/A was included:

How is the resolution change achieved technically?

For Halo and Halo 2, it happens in the “frame buffer� where Full Scene Anti Aliasing is applied. That image is then scaled for the best mix of image quality and compatibility.

I aim to show that, while this information is (unfortunately) expected, it means that you will theoretically NOT want to use the 720p output signal! Based on the results of a subjective, yet-to-be-run image-comparison experiment, we may be able to move this assertion from theory to fact.

First of all, what’s actually happening inside the Xbox 360 with Halo 2? When Halo 2 is running, the original Xbox creates the current image, or frame, based on the internal state of the game world, and the direction your camera is pointed (aimed out the eyes of the Master Chief). Once each frame of the video signal is created, it is stored in the “frame buffer”; a buffer is a temporary storage location in memory, this one intended for storing finished frames.

Next, the image is written from the frame buffer to the screen. Remember, the original image is 576 x 480 pixels - the standard dimensions of a NTSC TV image. High Definition TVs, however, have far more than 576 x 480 pixels: 720p signals require 1280 x 720 pixels. Therefore, to display this lower quality image, a HD TV upscales the image to fill up the space. Imagine taking a four-by-four pixel image and expanding it to fill an eight-by-eight screen - each original pixel would be blown up to be two pixels square. No additional data has been added; the image has simply been expanded to fit in the screen space. If a HD TV couldn’t do this, the image would be displayed in its original size in the middle of the screen, surrounded by black borders.

A game outputs the highest resolution it can, based on the the speed of its underlying program. For Halo 2, native 720p was originally planned, but was not possible due to it lowering the frame rate to an undesirable level. 480p thus became the maximum video output, regardless of what you did to the video signal once it left the Xbox. Once data hits the frame buffer, it is “finished” and ready for display. Any further image processing from here is necessarily defined as “lossy”, which means that you are losing some of the orignal data.

As a side note, upscaling is considered lossy if the frame is being scaled to a resolution that isn’t bigger by a whole integer factor, such as two times bigger, three times bigger, etc. Thus, the next truly lossless upscaling of a 576 x 480 pixel image should be to 1152 x 960. Do you see how this doesn’t fit in a screen that only goes up to 720p resolution = 1280 x 720? Some of the pixels in this scaling will have to be combined with their neighbors, in order to fill the entire screen. Combining pixels means that you are trying to get one pixel to hold the data that two held before. Imagine one was black, and the other white. Is the new pixel black, white, or grey? Data is thus lost. This upscaling is done by your TV - it is throwing away data to expand the signal, if it can’t natively support the upscaled resolution. Generally, we accept this loss, because the alternative is displaying the video on only a small section of our HD TVs. Upscaling algorithms also do a pretty good job in this conversion, so the loss is typically very small. To summarize upscaling, note that no new data is added, and that data is usually lost. Here’s an example:

anti-alias example

Now, with Halo 2 loaded and outputting 720p, the Xbox 360 performs a lossy editing routine on the image before it leaves the machine. Upscaling is done in the frame buffer (after the image is stored there) to get the frame into 720p, so that it won’t have to be upscaled by the TV. Fine and dandy, right? The signal has to be upscaled somewhere, after all. However, before the signal is upscaled, the 360 runs an anti-aliasing pass over it (I discussed anti-aliasing in my previous post). In the same way that combining pixels during upscaling loses data, smoothing out stair-step artifacts due to diagonal lines loses data, as well. Essentially, features that are only a few pixels in size can be effectively smoothed into nothingness by anti-aliasing. Look at one of the comparison pictures. Sure, the curves are rounder, but they’re rounder because the jaggy data around the edges has been altered. It actually looks very slightly bleary - the entire scene appears softened. This is a known side effect of anti-aliasing.

What is especially confusing to me is why they are running the anti-aliasing pass before they upscale. Imagine a 3 x 3 grid, with a diagonal line from the lower left corner to the upper right. According to the anti-aliasing algorithm I’m using, pixels above and below this line will be altered, which means that all of the pixels are changed. In a 6 x 6 grid, the line only affects ~67% of the pixels. Here’s an example, showing the difference between upscaling versus anti-aliasing first:

anti-alias example

The point is that anti-aliasing before the upscale means that you are editing a greater percentage of the frame, and the new jaggies that result from the upscale (jaggies are always born when you upscale) will be untouched. If the image had been anti-aliased after the upscale, then the jaggies that result from the upscale would have been cleaned up. Now, one possible reason Bungie might not have done this is because the duration of anti-alising algorithms is based on the number of pixels being edited. Increase the number, and you slow down the frame rate. However, I do not believe that was a problem here. Upscaling is rather fast, and I believe there was certinaly power to spare in the Xbox 360 to upscale first, and then anti-alias.

In addition, remember that there is no new data being created. This was confirmed by Bungie when they said the image was upscaled, above. If you take nothing away from this article other than the following, I will be happy: There is a difference between outputting native 720p, and upscaling a lower quality signal to fill a 720p screen. As stated, however, this is not unexpected in the case of emulation by the Xbox 360. Emulated games that can’t output in HD still won’t be able to, and no emulation profile is going to change the code to enable them to. The emulation profiles “fake” the game into thinking it’s being run on different hardware than it really is, but the game is not being changed at all. No bug fixes or additional game content are possible.

So here is our conumdrum. The Xbox 360’s video signal would have been exactly the same on my giant HDTV whether upscaled by the 360, or my TV. The size of the picture is the same. However, because of the anti-aliasing, the image will be (theoretically) slightly degraded when output in 720p mode. Thus, I claim that you will receive slightly more jaggy, but more detailed images if you use standard 480p mode. I recommend not setting your Xbox 360 to 720p mode for Halo 2.

Is this actually true in practice, though? Certainly, some amount of bleariness accompanies all anti-aliasing, but will the anti-aliasing actually be so severe that we can no longer discern some small objects? To measure this, we need to run an experiment. We need to capture video coming from the Xbox 360 in 720p mode, and video leaving my HDTV in 720p that originally came from an Xbox 360’s 480p widescreen signal. We’ll take still shots, and examine subtle and/or small features to see if they remain discernable. If they are, then Bungie has tuned the AA correctly. If not, then we’ll have another reason to look forward to Halo 3: true 720p video.

Footnote: At least one other game being readied for the Xbox 360 uses upscaled HD trickery. It’s not true 720p, folks. However, this is HD - High Def is anything over 576 x 480, in progressive scan mode. It’s still gonna be the prettiest racing game ever.

Diablo
November 15th, 2005 3:25 pm

*Sigh*

And I was having such a good day. But no, Sandstone, if an effort to thwart blatant fanboisms, releases to following information about Halo and Halo 2. Guess I’ll go crawl back under my rock until the “tests” are done.

Well, if you get bored in the meantime, feel free to do a comparison on the RSX v. Xenon GPUs. Let me know if AA is really all that or just more over-hyping (e.g., “the RSX can do 1080p, but the Xenon cannot” claim)?

November 16th, 2005 10:09 am

Wow. Kudos to Sandy for this piece. I haven’t seen this caliber of analysis anywhere else on the web - very top notch stuff. Sandy, you should consider posting this on a Halo related forum (B.net, HBO, etc). I think the fans will appreciate the honesty.

I can understand the Halo 2 emulation cunundrum - Bungie would have to completely recode its visuals for true HD to be possible. But PGR3 being a sham as well?? What’s up with that? This is Gen2 folks! C’mon let’s get it together and deliver the goods!

November 17th, 2005 6:56 am

You know, it’s interesting hearing this come out - I noticed that the so-called antialiased output for 720p that Bungie showed off when they announced this had the telltale signs of upscaling and blurring. You can tell that the order is AA->upscale from the lack of definition on what should be sharp edges. Even high quality antialiasing never gives that level of smoothing (and that’s when considerable power is being dedicated to the process by the GPU). It’s somewhat akin to resizing a poor quality JPEG in Photoshop; you can always tell when it’s going on.

The only thing I think you may have wrong in your assessment above is concerning the power requirements for upscaling first then anti-aliasing; anti-aliasing is dependent upon two factors in order to ensure smooth framerates and good performance - graphics memory and pixel fillrate. The order in which you upscale and anti-alias will make a lot of difference here, as anti-aliasing an upscaled image will require both more graphics memory and since there are more pixels to perform the operation on, take longer. Performance would necessarily suffer (this is why people play PC games at lower resolutions with FSAA enabled rather than top whack with it on). There is of course another issue here; anti-aliasing an upscaled image could potentially cause more graphical anomalies than the other way around. FSAA as a process is still operating on a 3D scene in order to detect which edges need anti-aliasing and which don’t, whereas upscaling is no different from resizing a 2D image. By performing an upscale first you are losing the 3D data and can then only antialias by less accurate methods (such as supersampling) and artefacts may occur.

Still, the truth is in the tasting as they say, and until we can see this running live it’d be hard to say whether it’s bad or not. No matter what TV you use, their upscaling won’t have a stage of anti-aliasing beforehand, and so it should theoretically still be a superior picture quality. We’ll have to wait and see, of course…

November 17th, 2005 9:34 am

Actually, sorry folks, but most of his assumptions are wrong. We did not publish the full technical explanation in part because it would create confusion with our younger, already HD-confused readership, and in part because it happens in hardware.

First of all, you don’t lose information upscaling the image. It is lossless in this instance.

Secodnly AA gives you a better representation of the original geometry than the non AA 480p signal - still no information loss.

“you will receive slightly more jaggy, but more detailed images if you use standard 480p mode.” - you can disprove this yourself by toggling between 480p and 720p on a monitor. The images on the 720p monitor are by definition, more detailed. And in this case, you couldn’t even make a subjective argument against that.

Actually, we gave up attacking his statement a point at a time after we did that toggle. It looks ridiculously better. Just wait ’til Tuesday and make up your own minds.

November 17th, 2005 10:50 am

Ok Frankie, seeing as you’re in on this thread I have a couple of questions which would put the matter beyond doubt (and satisfy the curiosity of the inner geek in several of us, myself included).

First of all, at what resolution is the 3D scene being drawn? 480p or 720p? I think it is fair to say that it is indeed wrong to call upscaling ‘lossy’, as there isn’t anything being lost. But if the scene is being drawn at 480p then upscaled the image is fundamentally having extra data created that wasn’t in the original scene, probably based on nearest neighbour interpolation. Again, this isn’t losing anything, but there is a massive difference between an image drawn at XxY and an image created at PxQ and resized to XxY.

Secondly, what antialiasing method is being used? Is it multisampling or supersampling? It would seem likely it is multisampling applied prior to upscaling, but it could be either.

Ultimately I think that the premise of this article - that this method of anti-aliasing will harm the image quality - is in certain instances wrong, and in that I can understand why you guys would be upset at that assertion. The only circumstances where I feel there is potential for a worse quality result is if this upscaling happens only to be downscaled again to show on 480p (or less - pity us poor Brits and our crappy TVs). In that circumstance Sandstone is right - there would be loss in image quality, as you’ll be throwing away data that was created in order to fit a bigger picture on a smaller screen. Think what happens to an image in Photoshop if you resize it up and down a couple of times. I can’t say I’ve heard any comments to the effect that this feature would be optional or not, but if it isn’t then I can’t imagine that lower resolution displays would end up with a better quality picture than the Xbox original.

Either way, we’ll have to wait and see, like you say, then decide.

November 17th, 2005 10:57 am

Multisampling. Again, this is just one of those things that you can only demonstrate. No amount of explanation shows the difference. The best demonstration I had though, is that my wife could tell the difference (sorry, Mrs. Frank). She thought it looked “much better.”

November 17th, 2005 12:13 pm

Nice to see a healthy discussion - thanks everyone for pointing out incorrect conclusions I’ve drawn. Being incorrect lets you learn, no?

Anyone know why upscaling to an image size that isn’t a whole integer factor bigger isn’t lossy? I guess I don’t understand why that would be the case.

Here’s the golden rule: anytime you edit image data, you lose the original data. However, your edit may make it look subjectively better. My claim was that editing the frame with an AA pass after Halo 2 is done with it, as it sits in a frame buffer, theoretically entails the loss of data; it may in fact look better - but this wasn’t something I could test, and I’m glad that Frankie was willing to let us know about their subjective tests.

I’ve got my Xbox 360 pre-ordered for Tuesday, and I sure can’t wait to pop Halo 2 in - it’s the first thing I’ll try. I stood in line for all night for Halo 2, and I’ll stand in line for the 360, too. :)

November 17th, 2005 12:18 pm

One other thought - imagine that the final render into the frame buffer is done with the expectation that an AA pass would be applied - that would make the AA be a non-lossy edit, as it’s just one more stage in the frame pipeline. I had thought that that would require a change to the game code, though, which I also thought wasn’t possible? Thoughts?

McGrude
November 17th, 2005 1:45 pm

What if the emulation software/profile code that is installed to enable backwards compatibility for Halo/Halo2 is actually manipulating the frame buffer size that the game engine is rendering into? Bungie clearly has a great deal of knowledge about the internals of the original software. If the emulation software was able to manipulate the emulated software to render into a larger frame buffer then the frames would be rendered into this larger 1280×720 buffer.

Consider, for example, a postscript file. Postscript code has no knowledge of the capabilities of the output device. You can render this file to a 300 dpi printer, a 600 dpi printer, or even a 72dpi device such as a monitor. To each device the file is rendered correctly. If it were not then the 600dpi ouput image would be only 1/4 the area of the same output on the 300dpi printer. Likewise the 72dpi output would be about 16 times larger than the 300 dpi output. This is not the case. 1 inch on the 300 dpi device is 1 inch on the 600 dpu device.

Clearly postscript is a different beast than Halo/Halo2 game engine rendering, but if the graphic routines within the engine were abstracted properly then one could easily manipulate the frame buffer dimensions and render the output to a larger frame, without post-processing upscaling. In fact if Bungie at one time intended to render to a larger frame (720p) and didn’t because of the hardware capabilities of the first generation XBox then I’d suspect that the frame buffer size was abstracted from the code that actually does the drawing. It is really about having two coordinate systems one for the vetor graphics and one for the physical frame buffer pixel graphics, the vetor drawing routines draw in their coordinate system and the routines that actually manipulate the pysical frame buffer would perform a coordinate conversion function (multipler) to scale from the vector coordinate system to the physical one. If the dimensions of the physical frame buffer is changed then the multiplier is changed to adapt to the new size.

My $0.02

- McGrude

Halo Fan
November 17th, 2005 3:01 pm

Check out this post for the reasoning behind PGR3 running at 1024×600.

Not all upscalers are created equal, the scaler in the 360 (along with other PC video cards) does a much better job of resizing an image than 90% of the scalers in entry level HDTVs. For an explanition on how scalers work read this article.

November 17th, 2005 8:45 pm

I had thought that the images Halo 2 generated in the frame buffer were at 1600×1200 resolution and that is why all the screenshots that Bungie has posted of the game are at 1600×1200. Go check for yourself, just click on the image to get the high-res version in the screenshot gallery.


For example:

If that is indeed the case then there is plenty of image information to fill up a 720p signal, and it would explain why Frankie does not see any image loss. In fact the 720p signal will show you more of the scene than the Xbox was rendering.

Kyle
November 18th, 2005 11:07 am

From my experience so far (having won a 360), Halo 2 seems to be rendering at a higher resolution than it used to. I can read the text on some objects that I could never before, and can notice where some textures (such as on a package of shotgun shells) weren’t stored in a high resolution. I don’t have an HDTV, but I can already tell the difference.

meme
June 7th, 2006 6:45 am

im playing halo2 on my lcd monitor, on the xbox 360, i’ve gone through all the resolutions available and cant seem to get a setting i like. it looks better on the 50hz crappy tv that i bought on ebay for 50 quid

November 1st, 2007 4:13 am

Great site!4915a920bca3a7608756345b67d225d4

You must be logged in to post a comment.