diff options
| author | Ewald Snel <esnel@users.sourceforge.net> | 2002-07-15 21:42:33 +0000 |
|---|---|---|
| committer | Ewald Snel <esnel@users.sourceforge.net> | 2002-07-15 21:42:33 +0000 |
| commit | 76e9bd86be57306fbf3bf607d68f9f38c04b4691 (patch) | |
| tree | d66dc0bb9e7653dce6ed1b38bc3c08841c61e521 /src/libxinevdec/cinepak.c | |
| parent | fbb014bfa86dd9183d53d9f2e81ac5abfa75246c (diff) | |
| download | xine-lib-76e9bd86be57306fbf3bf607d68f9f38c04b4691.tar.gz xine-lib-76e9bd86be57306fbf3bf607d68f9f38c04b4691.tar.bz2 | |
Add 'pitch' support to video decoders (pitch != width)
CVS patchset: 2282
CVS date: 2002/07/15 21:42:33
Diffstat (limited to 'src/libxinevdec/cinepak.c')
| -rw-r--r-- | src/libxinevdec/cinepak.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/libxinevdec/cinepak.c b/src/libxinevdec/cinepak.c index a448d2b54..7484a6916 100644 --- a/src/libxinevdec/cinepak.c +++ b/src/libxinevdec/cinepak.c @@ -22,7 +22,7 @@ * based on overview of Cinepak algorithm and example decoder * by Tim Ferguson: http://www.csse.monash.edu.au/~timf/ * - * $Id: cinepak.c,v 1.9 2002/07/05 17:32:04 mroi Exp $ + * $Id: cinepak.c,v 1.10 2002/07/15 21:42:34 esnel Exp $ */ #include <stdlib.h> @@ -358,28 +358,27 @@ static void cvid_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { img->pts = buf->pts; img->bad_frame = 0; + /* FIXME: use img->pitches[3] */ xine_fast_memcpy (img->base[0], this->img_buffer, n); xine_fast_memcpy (img->base[1], this->img_buffer + n, (n >> 2)); xine_fast_memcpy (img->base[2], this->img_buffer + n + (n >> 2), (n >> 2)); if (img->copy) { - - int height = abs(this->biHeight); - int stride = this->biWidth; - uint8_t* src[3]; - - src[0] = img->base[0]; - src[1] = img->base[1]; - src[2] = img->base[2]; - while ((height -= 16) >= 0) { - img->copy(img, src); - src[0] += 16 * stride; - src[1] += 4 * stride; - src[2] += 4 * stride; - } - } - - + int height = img->height; + uint8_t *src[3]; + + src[0] = img->base[0]; + src[1] = img->base[1]; + src[2] = img->base[2]; + + while ((height -= 16) >= 0) { + img->copy(img, src); + src[0] += 16 * img->pitches[0]; + src[1] += 8 * img->pitches[1]; + src[2] += 8 * img->pitches[2]; + } + } + img->draw(img); img->free(img); |
