From: Guenter B. <gu...@us...> - 2001-09-11 16:15:47
|
Update of /cvsroot/xine/xine-lib/src/libffmpeg In directory usw-pr-cvs1:/tmp/cvs-serv7006/src/libffmpeg Modified Files: xine_decoder.c Log Message: 444P and 422P colorspace support (for mjpeg) for ffmpeg Index: xine_decoder.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libffmpeg/xine_decoder.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- xine_decoder.c 2001/09/11 14:11:56 1.10 +++ xine_decoder.c 2001/09/11 16:15:42 1.11 @@ -235,7 +235,7 @@ sy = this->av_picture.data[0]; su = this->av_picture.data[1]; sv = this->av_picture.data[2]; - + for (y=0; y<this->biHeight; y++) { memcpy (dy, sy, this->biWidth); @@ -246,15 +246,45 @@ } for (y=0; y<(this->biHeight/2); y++) { + + if (this->context.pix_fmt != PIX_FMT_YUV444P) { - memcpy (du, su, this->biWidth/2); - memcpy (dv, sv, this->biWidth/2); + memcpy (du, su, this->biWidth/2); + memcpy (dv, sv, this->biWidth/2); + + } else { + + int x; + uint8_t *src; + uint8_t *dst; + + /* subsample */ + + src = su; dst = du; + for (x=0; x<(this->biWidth/2); x++) { + *dst = *src; + dst++; + src += 2; + } + src = sv; dst = dv; + for (x=0; x<(this->biWidth/2); x++) { + *dst = *src; + dst++; + src += 2; + } + + } du += this->biWidth/2; dv += this->biWidth/2; - su += this->av_picture.linesize[1]; - sv += this->av_picture.linesize[2]; + if (this->context.pix_fmt != PIX_FMT_YUV420P) { + su += 2*this->av_picture.linesize[1]; + sv += 2*this->av_picture.linesize[2]; + } else { + su += this->av_picture.linesize[1]; + sv += this->av_picture.linesize[2]; + } } if (img->copy) { |