aboutsummaryrefslogtreecommitdiff
path: root/graphics/decoders
diff options
context:
space:
mode:
authorMatthew Hoops2011-07-02 23:43:52 -0400
committerJohannes Schickel2012-03-20 01:06:48 +0100
commitb6d2a11432c16b12fea48830f7aa131dba091ef7 (patch)
tree0c272b0dee19fd58949452d95e38824f5574e9cf /graphics/decoders
parent765a8704454d705acc9ce5aa7a90c1c3079fb989 (diff)
downloadscummvm-rg350-b6d2a11432c16b12fea48830f7aa131dba091ef7.tar.gz
scummvm-rg350-b6d2a11432c16b12fea48830f7aa131dba091ef7.tar.bz2
scummvm-rg350-b6d2a11432c16b12fea48830f7aa131dba091ef7.zip
GRAPHICS: Make the JPEG code use the new YUV to RGB converter
Diffstat (limited to 'graphics/decoders')
-rw-r--r--graphics/decoders/jpeg.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/graphics/decoders/jpeg.cpp b/graphics/decoders/jpeg.cpp
index 0cd2388d52..a871377ca1 100644
--- a/graphics/decoders/jpeg.cpp
+++ b/graphics/decoders/jpeg.cpp
@@ -20,8 +20,8 @@
*
*/
-#include "graphics/conversion.h"
#include "graphics/pixelformat.h"
+#include "graphics/yuv_to_rgb.h"
#include "graphics/decoders/jpeg.h"
#include "common/debug.h"
@@ -81,13 +81,7 @@ const Surface *JPEGDecoder::getSurface() const {
const Graphics::Surface *uComponent = getComponent(2);
const Graphics::Surface *vComponent = getComponent(3);
- for (uint16 i = 0; i < _h; i++) {
- for (uint16 j = 0; j < _w; j++) {
- byte r = 0, g = 0, b = 0;
- YUV2RGB(*((const byte *)yComponent->getBasePtr(j, i)), *((const byte *)uComponent->getBasePtr(j, i)), *((const byte *)vComponent->getBasePtr(j, i)), r, g, b);
- *((uint32 *)_rgbSurface->getBasePtr(j, i)) = _rgbSurface->format.RGBToColor(r, g, b);
- }
- }
+ convertYUV444ToRGB(_rgbSurface, (byte *)yComponent->pixels, (byte *)uComponent->pixels, (byte *)vComponent->pixels, yComponent->w, yComponent->h, yComponent->pitch, uComponent->pitch);
return _rgbSurface;
}