[Mplayer-cvslog] CVS: main dec_video.c,1.4,1.5 codec-cfg.c,1.26,1.27 configure,1.110,1.111 Makefile,1.53,1.54

Arpi of Ize arpi at mplayer.dev.hu
Fri Jul 20 00:39:54 CEST 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv18834

Modified Files:
	dec_video.c codec-cfg.c configure Makefile 
Log Message:
DivX4Linux support

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dec_video.c	16 Jul 2001 12:53:48 -0000	1.4
+++ dec_video.c	19 Jul 2001 22:39:52 -0000	1.5
@@ -45,7 +45,11 @@
     AVPicture lavc_picture;
 #endif
 
+#ifndef NEW_DECORE
 #include "opendivx/decore.h"
+#else
+#include <decore.h>
+#endif
 
 //**************************************************************************//
 //             The OpenDivX stuff:
@@ -156,29 +160,47 @@
    if(verbose) printf("OpenDivX video codec\n");
    { DEC_PARAM dec_param;
      DEC_SET dec_set;
+        memset(&dec_param,0,sizeof(dec_param));
 #ifdef NEW_DECORE
-     DEC_MEM_REQS dec_mem;
         dec_param.output_format=DEC_USER;
 #else
         dec_param.color_depth = 32;
 #endif
 	dec_param.x_dim = sh_video->bih->biWidth;
 	dec_param.y_dim = sh_video->bih->biHeight;
-#ifdef NEW_DECORE
-        // 0.50-CVS new malloc scheme
-        decore(0x123, DEC_OPT_MEMORY_REQS, &dec_param, &dec_mem);
-        dec_param.buffers.mp4_edged_ref_buffers=malloc(dec_mem.mp4_edged_ref_buffers_size);
-        dec_param.buffers.mp4_edged_for_buffers=malloc(dec_mem.mp4_edged_for_buffers_size);
-        dec_param.buffers.mp4_display_buffers=malloc(dec_mem.mp4_display_buffers_size);
-        dec_param.buffers.mp4_state=malloc(dec_mem.mp4_state_size);
-        dec_param.buffers.mp4_tables=malloc(dec_mem.mp4_tables_size);
-        dec_param.buffers.mp4_stream=malloc(dec_mem.mp4_stream_size);
-#endif
 	decore(0x123, DEC_OPT_INIT, &dec_param, NULL);
-
 	dec_set.postproc_level = divx_quality;
 	decore(0x123, DEC_OPT_SETPP, &dec_set, NULL);
-
+   }
+   if(verbose) printf("INFO: OpenDivX video codec init OK!\n");
+   break;
+ }
+ case 7: {  // DivX4Linux
+   if(verbose) printf("DivX4Linux video codec\n");
+   { DEC_PARAM dec_param;
+     DEC_SET dec_set;
+     int bits=16;
+        memset(&dec_param,0,sizeof(dec_param));
+	switch(out_fmt){
+	case IMGFMT_YV12: dec_param.output_format=DEC_YV12;bits=12;break;
+	case IMGFMT_YUY2: dec_param.output_format=DEC_YUY2;break;
+	case IMGFMT_UYVY: dec_param.output_format=DEC_UYVY;break;
+	case IMGFMT_I420: dec_param.output_format=DEC_420;bits=12;break;
+	case IMGFMT_BGR15: dec_param.output_format=DEC_RGB555_INV;break;
+	case IMGFMT_BGR16: dec_param.output_format=DEC_RGB565_INV;break;
+	case IMGFMT_BGR24: dec_param.output_format=DEC_RGB24_INV;bits=24;break;
+	case IMGFMT_BGR32: dec_param.output_format=DEC_RGB32_INV;bits=32;break;
+	default:
+	  fprintf(stderr,"Unsupported out_fmt: 0x%X\n",out_fmt);
+	  return 0;
+	}
+	dec_param.x_dim = sh_video->bih->biWidth;
+	dec_param.y_dim = sh_video->bih->biHeight;
+	decore(0x123, DEC_OPT_INIT, &dec_param, NULL);
+	dec_set.postproc_level = divx_quality;
+	decore(0x123, DEC_OPT_SETPP, &dec_set, NULL);
+//	sh_video->our_out_buffer = shmem_alloc(((bits*dec_param.x_dim+7)/8)*dec_param.y_dim);
+	sh_video->our_out_buffer = shmem_alloc(dec_param.x_dim*dec_param.y_dim*5);
    }
    if(verbose) printf("INFO: OpenDivX video codec init OK!\n");
    break;
@@ -247,14 +269,19 @@
     // let's decode
         dec_frame.length = in_size;
 	dec_frame.bitstream = start;
-	dec_frame.render_flag = 1;
+	dec_frame.render_flag = drop_frame?0:1;
+
 #ifdef NEW_DECORE
         dec_frame.bmp=&dec_pic;
         dec_pic.y=dec_pic.u=dec_pic.v=NULL;
-#endif
+	decore(0x123, (sh_video->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME, &dec_frame, NULL);
+#else
 	decore(0x123, 0, &dec_frame, NULL);
+#endif
+
       t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
 
+    // let's display
 #ifdef NEW_DECORE
       if(dec_pic.y){
         void* src[3];
@@ -276,6 +303,41 @@
         blit_frame=1;
       }
 #endif
+      t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
+
+    break;
+  }
+  case 7: {
+    // DivX4Linux
+    unsigned int t=GetTimer();
+    unsigned int t2;
+    DEC_FRAME dec_frame;
+    // let's decode
+        dec_frame.length = in_size;
+	dec_frame.bitstream = start;
+	dec_frame.render_flag = drop_frame?0:1;
+        dec_frame.bmp=sh_video->our_out_buffer;
+        dec_frame.stride=sh_video->disp_w;
+//	printf("Decoding DivX4 frame\n");
+	decore(0x123, (sh_video->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME, &dec_frame, NULL);
+      t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
+
+    if(!drop_frame && sh_video->our_out_buffer){
+//	printf("Displaying DivX4 frame\n");
+      if(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420){
+        uint8_t* dst[3];
+        int stride[3];
+        stride[0]=sh_video->disp_w;
+        stride[1]=stride[2]=sh_video->disp_w/2;
+        dst[0]=sh_video->our_out_buffer;
+        dst[2]=dst[0]+sh_video->disp_w*sh_video->disp_h;
+        dst[1]=dst[2]+sh_video->disp_w*sh_video->disp_h/4;
+        video_out->draw_slice(dst,stride,sh_video->disp_w,sh_video->disp_h,0,0);
+      } else
+        video_out->draw_frame((uint8_t **)&sh_video->our_out_buffer);
+      blit_frame=1;
+    }
+
       t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
 
     break;

Index: codec-cfg.c
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- codec-cfg.c	12 Jul 2001 15:10:06 -0000	1.26
+++ codec-cfg.c	19 Jul 2001 22:39:52 -0000	1.27
@@ -214,6 +214,7 @@
 		"dshow",
 		"ffmpeg",
 		"vfwex",
+		"divx4",
 		NULL
 	};
         char **drv=audioflag?audiodrv:videodrv;

Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- configure	19 Jul 2001 18:46:29 -0000	1.110
+++ configure	19 Jul 2001 22:39:52 -0000	1.111
@@ -1703,6 +1703,8 @@
 ESD_LIB = $_esdlib
 ARCH_LIBS = $_archlibs
 STREAM_SRCS = $_streamingsrcs
+DECORE_LIBS = -Lopendivx -ldecore
+# DECORE_LIBS=-L/usr/local/lib -ldivxdecore
 
 # --- Some stuff for autoconfigure ----
 $_target_arch
@@ -1719,6 +1721,10 @@
 cat > $CCONF << EOF
 
 /* -------- Generated by ./configure ----------- */
+
+/* Define for using new DivX4Linux library, instead of open-source OpenDivX */
+/* You have to change DECORE_LIBS in config.mak too! */
+#undef NEW_DECORE
 
 /* Define this to enable avg. byte/sec-based AVI sync method by default:
    (use -bps or -nobps commandline option for run-time method selection)    */

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- Makefile	14 Jul 2001 16:54:30 -0000	1.53
+++ Makefile	19 Jul 2001 22:39:52 -0000	1.54
@@ -81,7 +81,7 @@
 	@for a in mp3lib libac3 libmpeg2 libvo opendivx libavcodec encore loader/DirectShow ; do $(MAKE) -C $$a all ; done
 
 $(PRG):	$(MPLAYER_DEP)
-	$(CC) $(CFLAGS) -o $(PRG) mplayer.o $(OBJS) $(XMM_LIBS) $(LIRC_LIBS) $(A_LIBS) -lm $(TERMCAP_LIB) $(LIB_LOADER) $(AV_LIB) -Llibmpeg2 -lmpeg2 -Lopendivx -ldecore -Llibao2 -lao2 $(VO_LIBS) $(CSS_LIB) -Lencore -lencore $(ARCH_LIBS)
+	$(CC) $(CFLAGS) -o $(PRG) mplayer.o $(OBJS) $(XMM_LIBS) $(LIRC_LIBS) $(A_LIBS) -lm $(TERMCAP_LIB) $(LIB_LOADER) $(AV_LIB) -Llibmpeg2 -lmpeg2 -Llibao2 -lao2 $(VO_LIBS) $(CSS_LIB) -Lencore -lencore $(DECORE_LIBS) $(ARCH_LIBS)
 
 $(PRG_FIBMAP): fibmap_mplayer.o
 	$(CC) -o $(PRG_FIBMAP) fibmap_mplayer.o




More information about the MPlayer-cvslog mailing list