1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 15:52:25 +00:00

yvu9 and if09 support

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6527 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2002-06-23 16:01:35 +00:00
parent 78191f35e9
commit 35dc99b12e
3 changed files with 49 additions and 36 deletions

View File

@ -119,6 +119,7 @@ static int add_to_format(char *s, unsigned int *fourcc, unsigned int *fourccmap)
{"I420", IMGFMT_I420}, {"I420", IMGFMT_I420},
{"IYUV", IMGFMT_IYUV}, {"IYUV", IMGFMT_IYUV},
{"YVU9", IMGFMT_YVU9}, {"YVU9", IMGFMT_YVU9},
{"IF09", IMGFMT_IF09},
{"YUY2", IMGFMT_YUY2}, {"YUY2", IMGFMT_YUY2},
{"UYVY", IMGFMT_UYVY}, {"UYVY", IMGFMT_UYVY},

View File

@ -55,7 +55,7 @@ int init_acm_audio_codec(sh_audio_t *sh_audio){
sh_audio->o_wf.cbSize=0; sh_audio->o_wf.cbSize=0;
if(verbose) { if(verbose) {
#if 0 #if 1
printf("Input format:\n"); printf("Input format:\n");
printf(" wFormatTag %d\n", in_fmt->wFormatTag); printf(" wFormatTag %d\n", in_fmt->wFormatTag);
printf(" nChannels %d\n", in_fmt->nChannels); printf(" nChannels %d\n", in_fmt->nChannels);
@ -75,6 +75,7 @@ int init_acm_audio_codec(sh_audio_t *sh_audio){
#else #else
printf("Input format:\n"); printf("Input format:\n");
print_wave_header(in_fmt); print_wave_header(in_fmt);
print_wave_header(sh_audio->wf);
printf("Output fmt:\n"); printf("Output fmt:\n");
print_wave_header(&sh_audio->o_wf); print_wave_header(&sh_audio->o_wf);
printf("\n"); printf("\n");
@ -314,6 +315,11 @@ printf("\n");
sh_video->o_bih.biBitCount=12; sh_video->o_bih.biBitCount=12;
yuv=1; yuv=1;
break; break;
case IMGFMT_YVU9:
case IMGFMT_IF09:
sh_video->o_bih.biBitCount=9;
yuv=1;
break;
/* packed format */ /* packed format */
case IMGFMT_YUY2: case IMGFMT_YUY2:

View File

@ -281,41 +281,22 @@ int xacodec_init_video(sh_video_t *vidinfo, int out_format)
switch(out_format) switch(out_format)
{ {
/* case IMGFMT_RGB8:
codec_hdr.depth = 8;
break;
case IMGFMT_RGB15:
codec_hdr.depth = 15;
break;
case IMGFMT_RGB16:
codec_hdr.depth = 16;
break;
case IMGFMT_RGB24:
codec_hdr.depth = 24;
break;
case IMGFMT_RGB32:
codec_hdr.depth = 32;
break;
case IMGFMT_BGR8:
codec_hdr.depth = 8;
break;
case IMGFMT_BGR15:
codec_hdr.depth = 15;
break;
case IMGFMT_BGR16:
codec_hdr.depth = 16;
break;
case IMGFMT_BGR24:
codec_hdr.depth = 24;
break;
case IMGFMT_BGR32:
codec_hdr.depth = 32;
break;*/
case IMGFMT_IYUV: case IMGFMT_IYUV:
case IMGFMT_I420: case IMGFMT_I420:
case IMGFMT_YV12: case IMGFMT_YV12:
codec_hdr.depth = 12; codec_hdr.depth = 12;
break; break;
case IMGFMT_YVU9:
if (vidinfo->bih->biCompression == mmioFOURCC('I','V','3','2') ||
vidinfo->bih->biCompression == mmioFOURCC('i','v','3','2') ||
vidinfo->bih->biCompression == mmioFOURCC('I','V','3','1') ||
vidinfo->bih->biCompression == mmioFOURCC('i','v','3','2'))
{
mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supporting YVU9 output with Indeo3\n");
return(0);
}
codec_hdr.depth = 9;
break;
default: default:
mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supported image out format (%s)\n", mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supported image out format (%s)\n",
vo_format_name(out_format)); vo_format_name(out_format));
@ -392,16 +373,22 @@ xacodec_image_t* xacodec_decode_frame(uint8_t *frame, int frame_size, int skip_f
image->planes[0]=image->mem; image->planes[0]=image->mem;
image->stride[0]=image->width; image->stride[0]=image->width;
image->stride[1]=image->stride[2]=image->width/2;
switch(image->out_fmt){ switch(image->out_fmt){
case IMGFMT_YV12: case IMGFMT_YV12:
image->planes[2]=image->planes[0]+image->width*image->height; image->planes[2]=image->planes[0]+image->width*image->height;
image->planes[1]=image->planes[2]+image->width*image->height/4; image->planes[1]=image->planes[2]+image->width*image->height/4;
image->stride[1]=image->stride[2]=image->width/2;
break; break;
case IMGFMT_I420: case IMGFMT_I420:
case IMGFMT_IYUV: case IMGFMT_IYUV:
image->planes[1]=image->planes[0]+image->width*image->height; image->planes[1]=image->planes[0]+image->width*image->height;
image->planes[2]=image->planes[1]+image->width*image->height/4; image->planes[2]=image->planes[1]+image->width*image->height/4;
image->stride[1]=image->stride[2]=image->width/2;
break;
case IMGFMT_YVU9:
image->planes[2]=image->planes[0]+image->width*image->height;
image->planes[1]=image->planes[2]+(image->width>>2)*(image->height>>2);
image->stride[1]=image->stride[2]=image->width/4;
break; break;
} }
@ -641,7 +628,7 @@ typedef struct
YUVBufs jpg_YUVBufs; YUVBufs jpg_YUVBufs;
YUVTabs def_yuv_tabs; YUVTabs def_yuv_tabs;
/* -------------- YUV 4x4 1x1 1x1 [Indeo 3,4,5] ------------------ */ /* -------------- YUV 4x4 1x1 1x1 (4:1:0 aka YVU9) [Indeo 3,4,5] ------------------ */
void XA_YUV1611_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey, void XA_YUV1611_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey,
unsigned int i_x, unsigned int i_y, YUVBufs *yuv, YUVTabs *yuv_tabs, unsigned int i_x, unsigned int i_y, YUVBufs *yuv, YUVTabs *yuv_tabs,
@ -665,6 +652,27 @@ void XA_YUV1611_Convert(unsigned char *image_p, unsigned int imagex, unsigned in
yuv->Ybuf,yuv->Ubuf,yuv->Vbuf,yuv->the_buf,yuv->the_buf_size, yuv->Ybuf,yuv->Ubuf,yuv->Vbuf,yuv->the_buf,yuv->the_buf_size,
yuv->y_w,yuv->y_h,yuv->uv_w,yuv->uv_h); yuv->y_w,yuv->y_h,yuv->uv_w,yuv->uv_h);
if(image->out_fmt == IMGFMT_YVU9 && !yuv_tabs->YUV_Y_tab)
{
if(i_x==image->width && i_y==image->height){
image->planes[0]=yuv->Ybuf;
image->planes[1]=yuv->Ubuf;
image->planes[2]=yuv->Vbuf;
image->stride[0]=i_x; // yuv->y_w
image->stride[1]=image->stride[2]=i_x/4; // yuv->uv_w
} else {
int y;
for(y=0;y<i_y;y++)
memcpy(image->planes[0]+y*image->stride[0],yuv->Ybuf+y*i_x,i_x);
i_x>>=2; i_y>>=2;
for(y=0;y<i_y;y++){
memcpy(image->planes[1]+y*image->stride[1],yuv->Ubuf+y*i_x,i_x);
memcpy(image->planes[2]+y*image->stride[2],yuv->Vbuf+y*i_x,i_x);
}
}
return;
}
// copy Y plane: // copy Y plane:
if(yuv_tabs->YUV_Y_tab){ // dirty hack to detect iv32: if(yuv_tabs->YUV_Y_tab){ // dirty hack to detect iv32:
for(y=0;y<imagey*imagex;y++) for(y=0;y<imagey*imagex;y++)
@ -707,7 +715,7 @@ void *XA_YUV1611_Func(unsigned int image_type)
return((void *)XA_YUV1611_Convert); return((void *)XA_YUV1611_Convert);
} }
/* -------------- YUV 4x1 1x1 1x1 (4:1:1 ?) [CYUV] ------------------ */ /* -------------- YUV 4x1 1x1 1x1 (4:1:1 but interleaved) [CYUV] ------------------ */
void XA_YUV411111_Convert(unsigned char *image, unsigned int imagex, unsigned int imagey, void XA_YUV411111_Convert(unsigned char *image, unsigned int imagex, unsigned int imagey,
unsigned int i_x, unsigned int i_y, YUVBufs *yuv_bufs, YUVTabs *yuv_tabs, unsigned int i_x, unsigned int i_y, YUVBufs *yuv_bufs, YUVTabs *yuv_tabs,
@ -740,8 +748,6 @@ void XA_YUV221111_Convert(unsigned char *image_p, unsigned int imagex, unsigned
yuv->Ybuf,yuv->Ubuf,yuv->Vbuf,yuv->the_buf,yuv->the_buf_size, yuv->Ybuf,yuv->Ubuf,yuv->Vbuf,yuv->the_buf,yuv->the_buf_size,
yuv->y_w,yuv->y_h,yuv->uv_w,yuv->uv_h); yuv->y_w,yuv->y_h,yuv->uv_w,yuv->uv_h);
#warning "FIXME! Decoder doesn't supports Vivo/2.00 :("
if(i_x==image->width && i_y==image->height){ if(i_x==image->width && i_y==image->height){
// printf("Direct render!!!\n"); // printf("Direct render!!!\n");
image->planes[0]=yuv->Ybuf; image->planes[0]=yuv->Ybuf;