diff options
Diffstat (limited to 'src/libxinevdec')
-rw-r--r-- | src/libxinevdec/fli.c | 57 | ||||
-rw-r--r-- | src/libxinevdec/idcinvideo.c | 9 | ||||
-rw-r--r-- | src/libxinevdec/msrle.c | 15 | ||||
-rw-r--r-- | src/libxinevdec/rgb.c | 9 |
4 files changed, 13 insertions, 77 deletions
diff --git a/src/libxinevdec/fli.c b/src/libxinevdec/fli.c index 9737dbc9c..3527692c0 100644 --- a/src/libxinevdec/fli.c +++ b/src/libxinevdec/fli.c @@ -23,7 +23,7 @@ * avoid when implementing a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: fli.c,v 1.2 2002/07/15 21:42:34 esnel Exp $ + * $Id: fli.c,v 1.3 2002/08/28 03:37:17 tmmm Exp $ */ #include <stdio.h> @@ -183,7 +183,7 @@ void decode_fli_frame(fli_decoder_t *this) { stream_ptr += 2; if (line_packets < 0) { line_packets = -line_packets; - y_ptr += (line_packets * this->yuv_planes.row_stride); + y_ptr += (line_packets * this->yuv_planes.row_width); ghost_y_ptr += (line_packets * this->width); } else { pixel_ptr = y_ptr; @@ -232,18 +232,7 @@ void decode_fli_frame(fli_decoder_t *this) { } } - // take care of the extra 2 pixels on the C lines - this->yuv_planes.u[pixel_ptr] = - this->yuv_planes.u[pixel_ptr - 1]; - this->yuv_planes.u[pixel_ptr + 1] = - this->yuv_planes.u[pixel_ptr - 2]; - - this->yuv_planes.v[pixel_ptr] = - this->yuv_planes.v[pixel_ptr - 1]; - this->yuv_planes.v[pixel_ptr + 1] = - this->yuv_planes.v[pixel_ptr - 2]; - - y_ptr += this->yuv_planes.row_stride; + y_ptr += this->yuv_planes.row_width; ghost_y_ptr += this->width; compressed_lines--; } @@ -254,7 +243,7 @@ void decode_fli_frame(fli_decoder_t *this) { /* line compressed */ starting_line = LE_16(&this->buf[stream_ptr]); stream_ptr += 2; - y_ptr = starting_line * this->yuv_planes.row_stride; + y_ptr = starting_line * this->yuv_planes.row_width; ghost_y_ptr = starting_line * this->width; compressed_lines = LE_16(&this->buf[stream_ptr]); @@ -299,18 +288,7 @@ void decode_fli_frame(fli_decoder_t *this) { } } - // take care of the extra 2 pixels on the C lines - this->yuv_planes.u[pixel_ptr] = - this->yuv_planes.u[pixel_ptr - 1]; - this->yuv_planes.u[pixel_ptr + 1] = - this->yuv_planes.u[pixel_ptr - 2]; - - this->yuv_planes.v[pixel_ptr] = - this->yuv_planes.v[pixel_ptr - 1]; - this->yuv_planes.v[pixel_ptr + 1] = - this->yuv_planes.v[pixel_ptr - 2]; - - y_ptr += this->yuv_planes.row_stride; + y_ptr += this->yuv_planes.row_width; ghost_y_ptr += this->width; compressed_lines--; } @@ -362,18 +340,7 @@ void decode_fli_frame(fli_decoder_t *this) { } } - // take care of the extra 2 pixels on the C lines - this->yuv_planes.u[pixel_ptr] = - this->yuv_planes.u[pixel_ptr - 1]; - this->yuv_planes.u[pixel_ptr + 1] = - this->yuv_planes.u[pixel_ptr - 2]; - - this->yuv_planes.v[pixel_ptr] = - this->yuv_planes.v[pixel_ptr - 1]; - this->yuv_planes.v[pixel_ptr + 1] = - this->yuv_planes.v[pixel_ptr - 2]; - - y_ptr += this->yuv_planes.row_stride; + y_ptr += this->yuv_planes.row_width; ghost_y_ptr += this->width; } break; @@ -419,18 +386,6 @@ void decode_fli_frame(fli_decoder_t *this) { pixel_ptr++; } - // take care of the extra 2 pixels on the C lines - this->yuv_planes.u[pixel_ptr] = - this->yuv_planes.u[pixel_ptr - 1]; - this->yuv_planes.u[pixel_ptr + 1] = - this->yuv_planes.u[pixel_ptr - 2]; - - // take care of the extra 2 pixels on the C lines - this->yuv_planes.v[pixel_ptr] = - this->yuv_planes.v[pixel_ptr - 1]; - this->yuv_planes.v[pixel_ptr + 1] = - this->yuv_planes.v[pixel_ptr - 2]; - pixel_ptr += 2; } } diff --git a/src/libxinevdec/idcinvideo.c b/src/libxinevdec/idcinvideo.c index 725eff548..dde1c8562 100644 --- a/src/libxinevdec/idcinvideo.c +++ b/src/libxinevdec/idcinvideo.c @@ -21,7 +21,7 @@ * the Id CIN format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: idcinvideo.c,v 1.1 2002/08/12 00:16:54 tmmm Exp $ + * $Id: idcinvideo.c,v 1.2 2002/08/28 03:37:17 tmmm Exp $ */ #include <stdio.h> @@ -91,7 +91,6 @@ void huff_decode(idcinvideo_decoder_t *this) { int prev; unsigned char v = 0; int bit_pos, node_num, dat_pos; - int width_countdown = this->width; int plane_ptr = 0; prev = bit_pos = dat_pos = 0; @@ -118,12 +117,6 @@ void huff_decode(idcinvideo_decoder_t *this) { this->yuv_planes.u[plane_ptr] = this->yuv_palette[node_num * 4 + 1]; this->yuv_planes.v[plane_ptr] = this->yuv_palette[node_num * 4 + 2]; plane_ptr++; - width_countdown--; - if (!width_countdown) { - FINISH_LINE(this->yuv_planes, plane_ptr - this->width); - width_countdown = this->width; - plane_ptr += 2; - } prev = node_num; } diff --git a/src/libxinevdec/msrle.c b/src/libxinevdec/msrle.c index 982d689dc..0d748c580 100644 --- a/src/libxinevdec/msrle.c +++ b/src/libxinevdec/msrle.c @@ -21,7 +21,7 @@ * For more information on the MS RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: msrle.c,v 1.3 2002/07/20 04:24:59 tmmm Exp $ + * $Id: msrle.c,v 1.4 2002/08/28 03:37:17 tmmm Exp $ */ #include <stdio.h> @@ -78,9 +78,9 @@ void decode_msrle8(msrle_decoder_t *this) { unsigned char extra_byte; unsigned char stream_byte; int pixel_ptr = 0; - int row_dec = this->yuv_planes.row_stride; + int row_dec = this->yuv_planes.row_width; int row_ptr = (this->height - 1) * row_dec; - int frame_size = this->yuv_planes.row_stride * this->height; + int frame_size = this->yuv_planes.row_width * this->height; unsigned char y, u, v; while (row_ptr >= 0) { @@ -90,22 +90,13 @@ void decode_msrle8(msrle_decoder_t *this) { /* fetch the next byte to see how to handle escape code */ FETCH_NEXT_STREAM_BYTE(); if (stream_byte == 0) { - /* take care of the extra 2 pixels on the C lines */ - FINISH_LINE(this->yuv_planes, row_ptr); - /* line is done, goto the next one */ row_ptr -= row_dec; pixel_ptr = 0; } else if (stream_byte == 1) { - /* take care of the extra 2 pixels on the C lines */ - FINISH_LINE(this->yuv_planes, row_ptr); - /* decode is done */ return; } else if (stream_byte == 2) { - /* take care of the extra 2 pixels on the C lines */ - FINISH_LINE(this->yuv_planes, row_ptr); - /* reposition frame decode coordinates */ FETCH_NEXT_STREAM_BYTE(); pixel_ptr += stream_byte; diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 3c6368ee0..7b01fcbb7 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -21,7 +21,7 @@ * Actually, this decoder just converts a raw RGB image to a YUY2 map * suitable for display under xine. * - * $Id: rgb.c,v 1.3 2002/07/20 04:24:59 tmmm Exp $ + * $Id: rgb.c,v 1.4 2002/08/28 03:37:17 tmmm Exp $ */ #include <stdio.h> @@ -162,9 +162,9 @@ static void rgb_decode_data (video_decoder_t *this_gen, /* iterate through each row */ buf_ptr = 0; - row_ptr = this->yuv_planes.row_stride * + row_ptr = this->yuv_planes.row_width * (this->yuv_planes.row_count - 1); - for (; row_ptr >= 0; row_ptr -= this->yuv_planes.row_stride) { + for (; row_ptr >= 0; row_ptr -= this->yuv_planes.row_width) { for (pixel_ptr = 0; pixel_ptr < this->width; pixel_ptr++) { if (this->bytes_per_pixel == 1) { @@ -206,9 +206,6 @@ static void rgb_decode_data (video_decoder_t *this_gen, } } - - /* take care of the extra 2 pixels on the C lines */ - FINISH_LINE(this->yuv_planes, row_ptr); } yuv444_to_yuy2(&this->yuv_planes, img->base[0], img->pitches[0]); |