Mercurial > mplayer.hg
changeset 80:74064c2929a1
updated to opendivx 0.48
author | arpi_esp |
---|---|
date | Sun, 11 Mar 2001 02:45:02 +0000 |
parents | b7b038ee3fde |
children | ddd07e52a54f |
files | libvo/vo_odivx.c mplayer.c |
diffstat | 2 files changed, 36 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_odivx.c Sun Mar 11 01:28:31 2001 +0000 +++ b/libvo/vo_odivx.c Sun Mar 11 02:45:02 2001 +0000 @@ -93,11 +93,34 @@ d+=image_width*image_height/4; memcpy(d,src[2],image_width*image_height/4); break; -// case IMGFMT_YUY2: - case IMGFMT_BGR|24: - memcpy(d,src[0],image_width*image_height*3); + case IMGFMT_YUY2: { + uint8_t *dY=image; + uint8_t *dU=image+image_width*image_height; + uint8_t *dV=dU+image_width*image_height/4; + uint8_t *s=src[0]; + int y; + for(y=0;y<image_height;y+=2){ + uint8_t *e=s+image_width*2; + while(s<e){ + *dY++=s[0]; + *dU++=s[1]; + *dY++=s[2]; + *dV++=s[3]; + s+=4; + } + e=s+image_width*2; + while(s<e){ + *dY++=s[0]; + *dY++=s[2]; + s+=4; + } + } + +// case IMGFMT_BGR|24: +// memcpy(d,src[0],image_width*image_height*2); break; } + } return 0; } @@ -122,7 +145,7 @@ if(++frameno<10) return; -enc_frame.bmp=image; +enc_frame.image=image; enc_frame.bitstream=buffer; enc_frame.length=0; encore(0x123,0,&enc_frame,&enc_result); @@ -160,8 +183,8 @@ { switch(format){ case IMGFMT_YV12: -// case IMGFMT_YUY2: - case IMGFMT_BGR|24: + case IMGFMT_YUY2: +// case IMGFMT_BGR|24: return 1; } return 0; @@ -181,11 +204,13 @@ switch(format){ case IMGFMT_YV12: frame_size=width*height+width*height/2; - enc_param.flip=2; // 0=RGB 1=flippedRGB 2=planarYUV format +// enc_param.flip=2; // 0=RGB 1=flippedRGB 2=planarYUV format break; - case IMGFMT_BGR|24: - enc_param.flip=0; // 0=RGB 1=flippedRGB 2=planarYUV format - frame_size=width*height*3; + case IMGFMT_YUY2: +// case IMGFMT_BGR|24: +// enc_param.flip=0; // 0=RGB 1=flippedRGB 2=planarYUV format +// frame_size=width*height*2; + frame_size=width*height+width*height/2; break; default: return -1; // invalid format }
--- a/mplayer.c Sun Mar 11 01:28:31 2001 +0000 +++ b/mplayer.c Sun Mar 11 02:45:02 2001 +0000 @@ -165,7 +165,7 @@ unsigned char *opendivx_src[3]; int opendivx_stride[3]; -void my_convert_yuv(unsigned char *puc_y, int stride_y, +void convert_linux(unsigned char *puc_y, int stride_y, unsigned char *puc_u, unsigned char *puc_v, int stride_uv, unsigned char *bmp, int width_y, int height_y){