mirror of https://github.com/mpv-player/mpv
updated to opendivx 0.48
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@81 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
7c51933043
commit
160a5a3f38
|
@ -93,11 +93,34 @@ draw_frame(uint8_t *src[])
|
|||
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 @@ ENC_RESULT enc_result;
|
|||
|
||||
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 @@ query_format(uint32_t format)
|
|||
{
|
||||
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 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3
|
|||
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
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ static void ac3_fill_buffer(uint8_t **start,uint8_t **end){
|
|||
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){
|
||||
|
||||
|
|
Loading…
Reference in New Issue