Warning: Illegal string offset 'lang' in /home/www/zoon.dk/wp-content/plugins/keyword-statistics/keyword-statistics.php on line 350

Warning: Illegal string offset 'keywords' in /home/www/zoon.dk/wp-content/plugins/keyword-statistics/keyword-statistics.php on line 354

Warning: Illegal string offset 'description' in /home/www/zoon.dk/wp-content/plugins/keyword-statistics/keyword-statistics.php on line 356

Warning: Illegal string offset 'lang' in /home/www/zoon.dk/wp-content/plugins/keyword-statistics/keyword-statistics.php on line 353

Warning: Illegal string offset 'keywords' in /home/www/zoon.dk/wp-content/plugins/keyword-statistics/keyword-statistics.php on line 354

Warning: Illegal string offset 'description' in /home/www/zoon.dk/wp-content/plugins/keyword-statistics/keyword-statistics.php on line 356
Jan 28 2009

MPEG Decoding update

Well… it seems I ran into the classic SetData() problem on the XBox 360. It really is THAT slow! So my new improvements (multithreading) didn’t do anything for the XBox. I then changed the code to create the frames on a seperate thread, and THAT improved performance. Now I’m up to about 42 FPS (max) against the old 24-27’ish frame rate.

Next up is trying to improve picture quality using shaders! More on that later!

Jan 28 2009

Return of the XBox 360

Just got my XBox 360 back from repairs and it purs like a kitten 🙂

Motherboard and DVD drive was replaced so I’m ready to continue decoding MPEG streams and the like. I will (hopefully) return with an update on the framerate issue later. I’m hoping the new otimizations pays off.

Jan 24 2009


Multithreading the MPEG decoding process, I’ve managed to increase the performance of the decoder by ~28.71%. I’m hoping to squeeze another 2-3% out of the decoder on the cost of more memory consumption.

On another note, just got word from the Microsoft repair center that my XBox 360 already is on it’s way back… impressive to say the least! They only had it for 3 days before fixing and returning it. Looking forward to getting it back so I can test the new code 🙂

Jan 21 2009

Full Motion Video in XNA

About two weeks ago, the graphic artist I have working with me on my game said, that he had planned a whole lot of full motion video clips. Initially I had to disapoint him. As you probably know, there is no easy way of showing FMV on the XBox 360 from within the XNA framework.

So… since XNA does not have a video loader/decoder of it’s own, and we can not use Windows to load the video, we have to roll our own decoder.

Instead of saving all the frames from an AVI stream as single images, and then import them one at a time into XNA during runtime, why not use a “simple” compression format? Well.. some say that C# is simply not fast enough. I say it depends on optimization and available CPU resources (and the XBox 360 should have more than enough power)

So to prove my point, I have implemented a very simple MPEG I video decompressor in 100% managed code. (Video only)

What you see below, is a web-friendly version of a video captured with fraps. The video being decoded is a small clip from the Blender movie “Elephants Dream”, running on XNA 3.0.

Movie information:
Original dimensions: 720 x 576
Rescaled dimensions: 512 * 256 (power of two texture.. scaled using Sony Vega studio 9)
Original framerate: 25 FPS
Frames: 3384 in clip
Approx bitrate: 1660 kbps
Movie disk size: 29208028 bytes (~29 MB)
Decoding speed in C#: 65+ FPS, single threaded on an Intel 2.65 GHz Core 2 Duo

You will probably notice a frame rate drop when watching the movie. This has nothing to do with the decoder or XNA, but just the fact that my hard-drive is struggling to save the movie. Btw, the original fraps movies dimensions are 1024*768, so the movie has been scaled a few times when you watch this. If anyone wants it, I can save a few decoded frames from the movie, so you can evaluate the quality.

Now running on the XBox 360 is a different story. Here we get around 25/33 frames per second, if we set the decoding thread priority to high. So I will have to find a way to multithread the decoding procedure. However, this is not going to be easy!

If you want to know more about video compression, I would suggest you have a look at this page:  Video Compression