aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorSven Hesse2010-09-30 13:05:12 +0000
committerSven Hesse2010-09-30 13:05:12 +0000
commit3c449e19ab6d8f42afba6476ff24bacd3cf32c3e (patch)
treeb114f4a98e6af1dac1a3e64feed4c645bfd9f6ef /graphics
parent947540c0891afb42d9753fe2d05bdf4b5753d0ff (diff)
downloadscummvm-rg350-3c449e19ab6d8f42afba6476ff24bacd3cf32c3e.tar.gz
scummvm-rg350-3c449e19ab6d8f42afba6476ff24bacd3cf32c3e.tar.bz2
scummvm-rg350-3c449e19ab6d8f42afba6476ff24bacd3cf32c3e.zip
VIDEO: Allow for scaled Indeo3 frames
svn-id: r52953
Diffstat (limited to 'graphics')
-rw-r--r--graphics/video/codecs/indeo3.cpp37
1 files changed, 23 insertions, 14 deletions
diff --git a/graphics/video/codecs/indeo3.cpp b/graphics/video/codecs/indeo3.cpp
index c99afbd0d3..c4a6baba55 100644
--- a/graphics/video/codecs/indeo3.cpp
+++ b/graphics/video/codecs/indeo3.cpp
@@ -269,31 +269,40 @@ Surface *Indeo3Decoder::decodeImage(Common::SeekableReadStream *stream) {
const byte *srcU = _cur_frame->Ubuf;
const byte *srcV = _cur_frame->Vbuf;
byte *dest = (byte *)_surface->pixels;
+
+ uint32 scaleWidth = _surface->w / fWidth;
+ uint32 scaleHeight = _surface->h / fHeight;
+
for (uint32 y = 0; y < fHeight; y++) {
byte *rowDest = dest;
- for (uint32 x = 0; x < fWidth; x++, rowDest += _surface->bytesPerPixel) {
- const byte cY = srcY[x];
- const byte cU = srcU[x >> 2];
- const byte cV = srcV[x >> 2];
+ for (uint32 sH = 0; sH < scaleHeight; sH++) {
+ for (uint32 x = 0; x < fWidth; x++) {
+ const byte cY = srcY[x];
+ const byte cU = srcU[x >> 2];
+ const byte cV = srcV[x >> 2];
+
+ byte r = 0, g = 0, b = 0;
+ YUV2RGB(cY, cU, cV, r, g, b);
- byte r = 0, g = 0, b = 0;
- YUV2RGB(cY, cU, cV, r, g, b);
+ const uint32 color = _pixelFormat.RGBToColor(r, g, b);
- const uint32 color = _pixelFormat.RGBToColor(r, g, b);
+ for (uint32 sW = 0; sW < scaleWidth; sW++, rowDest += _surface->bytesPerPixel) {
+ if (_surface->bytesPerPixel == 1)
+ *((uint8 *)rowDest) = (uint8)color;
+ else if (_surface->bytesPerPixel == 2)
+ *((uint16 *)rowDest) = (uint16)color;
+ }
+ }
- if (_surface->bytesPerPixel == 1)
- *((uint8 *)rowDest) = (uint8)color;
- else if (_surface->bytesPerPixel == 2)
- *((uint16 *)rowDest) = (uint16)color;
+ dest += _surface->pitch;
}
- dest += _surface->pitch;
srcY += fWidth;
if ((y & 3) == 3) {
- srcU += fWidth >> 2;
- srcV += fWidth >> 2;
+ srcU += chromaWidth;
+ srcV += chromaWidth;
}
}