From: Michael R. <mr...@us...> - 2005-04-25 14:43:58
|
Update of /cvsroot/xine/xine-lib/src/libxinevdec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv397/src/libxinevdec Modified Files: Tag: xine-1_0 rgb.c Log Message: cumulative fixes and additions for stable branch should be almost ready for xine-lib 1.0.1 (debian files yet to do) Index: rgb.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libxinevdec/rgb.c,v retrieving revision 1.29 retrieving revision 1.29.2.1 diff -u -r1.29 -r1.29.2.1 --- rgb.c 16 Dec 2004 13:59:12 -0000 1.29 +++ rgb.c 25 Apr 2005 14:43:15 -0000 1.29.2.1 @@ -39,14 +39,17 @@ #include <sys/types.h> #include <unistd.h> +#define LOG_MODULE "rgb" +#define LOG_VERBOSE +/* +#define LOG +*/ #include "xine_internal.h" #include "video_out.h" #include "buffer.h" #include "xineutils.h" #include "bswap.h" -#define VIDEOBUFSIZE 128*1024 - typedef struct { video_decoder_class_t decoder_class; } rgb_class_t; @@ -129,19 +132,24 @@ if (this->height < 0) { this->upside_down = 1; this->height = -this->height; - } else + } else { this->upside_down = 0; + } this->ratio = (double)this->width/(double)this->height; this->bit_depth = bih->biBitCount; if (this->bit_depth > 32) this->bit_depth &= 0x1F; /* round this number up in case of 15 */ + lprintf("width = %d, height = %d, bit_depth = %d\n", this->width, this->height, this->bit_depth); + this->bytes_per_pixel = (this->bit_depth + 1) / 8; if (this->buf) free (this->buf); - this->bufsize = VIDEOBUFSIZE; + + /* minimal buffer size */ + this->bufsize = this->width * this->height * this->bytes_per_pixel; this->buf = xine_xmalloc(this->bufsize); this->size = 0; @@ -160,7 +168,6 @@ this->bufsize = this->size + 2 * buf->size; this->buf = realloc (this->buf, this->bufsize); } - xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size); this->size += buf->size; @@ -176,6 +183,7 @@ img->pts = buf->pts; img->bad_frame = 0; + /* iterate through each row */ buf_ptr = 0; @@ -230,6 +238,7 @@ } } } else { + for (row_ptr = 0; row_ptr < this->yuv_planes.row_width * this->yuv_planes.row_count; row_ptr += this->yuv_planes.row_width) { pixels_left = 0; for (pixel_ptr = 0; pixel_ptr < this->width; pixel_ptr++) { |