Jonas Petersson , pp. 36. COM/School of Computing, 2012.
Using the mobile phone to play games is very common today. The development is going forward, which has increased the demands from the users. Demands such as; increased visual appearance, faster feedback and improved interactive possibilities. To meet with these requirements a more powerful computer can facilitate the work for the mobile phone, for example rendering a game and sending the image data to the phone using wireless communication. The phone can then decode and display the image on its screen.
The main object for this thesis is to implement a JPEG based decoder on Windows-based phones using C# and XNA 4.0. The decoder is based on an existing C++ implementation, which follows the JPEG standards.
The need of an 8x8 matrix made the existing XNA matrix inapplicable, which lead to the use of own defined matrices instead. Even though it seemed promising, the matrices that were own defined were too slow and created a bottleneck in the decoding process.
C# is not efficient at iterating through arrays with lots of data. An XNA based stream to decode the compressed image data made it possible to decode the image without using the matrices, and resolve the bottlenecks.
The FromStream method is in some cases almost nine times faster than the own implementation, the bottlenecks are for the mostly found in the matrix calculations.
When possible, use C++ when creating applications, it handles large amounts of data much faster than equal C# applications, unfortunately C++ will not work on all devices, such as Windows based phones.