[Mplayer-cvslog] CVS: main/libmpcodecs TODO,1.2,1.3 vd.h,1.4,1.5 vd_divx4.c,1.3,1.4 vd_dshow.c,1.2,1.3 vd_internal.h,1.3,1.4 vd_libmpeg2.c,1.1,1.2 vd_odivx.c,1.3,1.4

Arpi of Ize arpi at mplayer.dev.hu
Sat Mar 9 20:18:57 CET 2002


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

Modified Files:
	TODO vd.h vd_divx4.c vd_dshow.c vd_internal.h vd_libmpeg2.c 
	vd_odivx.c 
Log Message:
divx_quality and equalizer support done

Index: TODO
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/TODO,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TODO	9 Mar 2002 02:18:33 -0000	1.2
+++ TODO	9 Mar 2002 19:18:46 -0000	1.3
@@ -1,15 +1,18 @@
+URGENT:
+- add common postprocessing filter support (export qscale array)
+
 TODO:
-- equalizer support to divx4, dshow
 - vo_config callbacks to ffmpeg, cinepak
 - better mpi support to xanim (now it's EXPORT but could be better)
-- fix initial postprocessing flags (divx_quality)
-- add common postprocessing filter support (export qscale array)
 - IP buffering for NUV
 - finish MPNG (8bpp support)
 - IPB buffering to libmpeg2
 - review authors
 
 DONE:
+- equalizer support to divx4, dshow
+- fix initial postprocessing flags (divx_quality)
+
 #define VFM_CINEPAK 13
 #define VFM_QTRPZA 20
 #define VFM_FFMPEG 5

Index: vd.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vd.h	7 Mar 2002 21:12:27 -0000	1.4
+++ vd.h	9 Mar 2002 19:18:46 -0000	1.5
@@ -37,6 +37,7 @@
 #define VDCTRL_QUERY_FORMAT 3 /* test for availabilty of a format */
 #define VDCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
 #define VDCTRL_SET_PP_LEVEL 5 /* set postprocessing level */
+#define VDCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */
 
 // callbacks:
 int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt);

Index: vd_divx4.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_divx4.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vd_divx4.c	9 Mar 2002 00:57:05 -0000	1.3
+++ vd_divx4.c	9 Mar 2002 19:18:46 -0000	1.4
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdarg.h>
 #include <assert.h>
 
 #include "config.h"
@@ -41,6 +42,27 @@
 	decore(0x123,DEC_OPT_SETPP,&dec_set,NULL);
 	return CONTROL_OK;
     }
+#ifdef DECORE_VERSION
+#if DECORE_VERSION >= 20011010
+    case VDCTRL_SET_EQUALIZER: {
+	va_list ap;
+	int value;
+        int option;
+	va_start(ap, arg);
+	value=va_arg(ap, int);
+	va_end(ap);
+
+        if(!strcmp(arg,"Brightness")) option=DEC_GAMMA_BRIGHTNESS;
+        else if(!strcmp(arg, "Contrast")) option=DEC_GAMMA_CONTRAST;
+        else if(!strcmp(arg,"Saturation")) option=DEC_GAMMA_SATURATION;
+        else return CONTROL_FALSE;
+	
+        value = (value * 256) / 100 - 128;
+        decore(0x123, DEC_OPT_GAMMA, (void *)option, (void *) value);
+	return CONTROL_OK;
+    }
+#endif
+#endif
     
     }
 
@@ -50,7 +72,7 @@
 // init driver
 static int init(sh_video_t *sh){
     DEC_PARAM dec_param;
-//    DEC_SET dec_set;
+    DEC_SET dec_set;
     int bits=16;
     memset(&dec_param,0,sizeof(dec_param));
 
@@ -76,8 +98,9 @@
     dec_param.x_dim = sh->disp_w;
     dec_param.y_dim = sh->disp_h;
     decore(0x123, DEC_OPT_INIT, &dec_param, NULL);
-//    dec_set.postproc_level = divx_quality;
-//    decore(0x123, DEC_OPT_SETPP, &dec_set, NULL);
+
+    dec_set.postproc_level = divx_quality;
+    decore(0x123, DEC_OPT_SETPP, &dec_set, NULL);
     
     mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: DivX4Linux video codec init OK!\n");
 

Index: vd_dshow.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_dshow.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vd_dshow.c	7 Mar 2002 20:43:17 -0000	1.2
+++ vd_dshow.c	9 Mar 2002 19:18:46 -0000	1.3
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdarg.h>
 
 #include "config.h"
 #ifdef USE_DIRECTSHOW
@@ -32,9 +33,17 @@
 	DS_VideoDecoder_SetValue(sh->context,"Quality",*((int*)arg));
 	return CONTROL_OK;
 
-// TODO: query/set video options (brightness contrast etc)
-//        DS_VideoDecoder_SetValue(ds_vdec,item,value);
-	
+    case VDCTRL_SET_EQUALIZER: {
+	va_list ap;
+	int value;
+	va_start(ap, arg);
+	value=va_arg(ap, int);
+	va_end(ap);
+	if(DS_VideoDecoder_SetValue(sh->context,arg,value)==0)
+	    return CONTROL_OK;
+	return CONTROL_FALSE;
+    }
+
     }
     return CONTROL_UNKNOWN;
 }
@@ -61,6 +70,7 @@
     default:
 	DS_VideoDecoder_SetDestFmt(sh->context,out_fmt&255,0);    // RGB/BGR
     }
+    DS_SetAttr_DivX("Quality",divx_quality);
     DS_VideoDecoder_StartInternal(sh->context);
     mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32/DShow video codec init OK!\n");
     return 1;

Index: vd_internal.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_internal.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vd_internal.h	7 Mar 2002 20:43:17 -0000	1.3
+++ vd_internal.h	9 Mar 2002 19:18:46 -0000	1.4
@@ -8,6 +8,8 @@
 
 #include "vd.h"
 
+extern int divx_quality;
+
 // prototypes:
 //static vd_info_t info;
 static int control(sh_video_t *sh,int cmd,void* arg,...);

Index: vd_libmpeg2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_libmpeg2.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vd_libmpeg2.c	9 Mar 2002 02:18:33 -0000	1.1
+++ vd_libmpeg2.c	9 Mar 2002 19:18:46 -0000	1.2
@@ -34,7 +34,7 @@
 // init driver
 static int init(sh_video_t *sh){
     mpeg2_init();
-    picture->pp_options=0; //divx_quality;
+    picture->pp_options=divx_quality;
     // send seq header to the decoder:  *** HACK ***
     mpeg2_decode_data(NULL,videobuffer,videobuffer+videobuf_len,0);
     mpeg2_allocate_image_buffers (picture);

Index: vd_odivx.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_odivx.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vd_odivx.c	9 Mar 2002 00:57:05 -0000	1.3
+++ vd_odivx.c	9 Mar 2002 19:18:46 -0000	1.4
@@ -97,7 +97,7 @@
 // init driver
 static int init(sh_video_t *sh){
     DEC_PARAM dec_param;
-//    DEC_SET dec_set;
+    DEC_SET dec_set;
     memset(&dec_param,0,sizeof(dec_param));
 #ifdef NEW_DECORE
     dec_param.output_format=DEC_USER;
@@ -111,8 +111,9 @@
     dec_param.x_dim = sh->disp_w;
     dec_param.y_dim = sh->disp_h;
     decore(0x123, DEC_OPT_INIT, &dec_param, NULL);
-//    dec_set.postproc_level = divx_quality;
-//    decore(0x123, DEC_OPT_SETPP, &dec_set, NULL);
+
+    dec_set.postproc_level = divx_quality;
+    decore(0x123, DEC_OPT_SETPP, &dec_set, NULL);
     
     mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: OpenDivX video codec init OK!\n");
 




More information about the MPlayer-cvslog mailing list