# HG changeset patch # User arpi # Date 1015701526 0 # Node ID 88481d4b9e0ed12a00b76f02622fbd8676f0bf43 # Parent 70751bbd6404d30fbb9ce7c7b082005b84c45796 divx_quality and equalizer support done diff -r 70751bbd6404 -r 88481d4b9e0e libmpcodecs/TODO --- a/libmpcodecs/TODO Sat Mar 09 17:27:37 2002 +0000 +++ b/libmpcodecs/TODO Sat Mar 09 19:18:46 2002 +0000 @@ -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 diff -r 70751bbd6404 -r 88481d4b9e0e libmpcodecs/vd.h --- a/libmpcodecs/vd.h Sat Mar 09 17:27:37 2002 +0000 +++ b/libmpcodecs/vd.h Sat Mar 09 19:18:46 2002 +0000 @@ -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); diff -r 70751bbd6404 -r 88481d4b9e0e libmpcodecs/vd_divx4.c --- a/libmpcodecs/vd_divx4.c Sat Mar 09 17:27:37 2002 +0000 +++ b/libmpcodecs/vd_divx4.c Sat Mar 09 19:18:46 2002 +0000 @@ -1,5 +1,6 @@ #include #include +#include #include #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"); diff -r 70751bbd6404 -r 88481d4b9e0e libmpcodecs/vd_dshow.c --- a/libmpcodecs/vd_dshow.c Sat Mar 09 17:27:37 2002 +0000 +++ b/libmpcodecs/vd_dshow.c Sat Mar 09 19:18:46 2002 +0000 @@ -1,5 +1,6 @@ #include #include +#include #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; diff -r 70751bbd6404 -r 88481d4b9e0e libmpcodecs/vd_internal.h --- a/libmpcodecs/vd_internal.h Sat Mar 09 17:27:37 2002 +0000 +++ b/libmpcodecs/vd_internal.h Sat Mar 09 19:18:46 2002 +0000 @@ -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,...); diff -r 70751bbd6404 -r 88481d4b9e0e libmpcodecs/vd_libmpeg2.c --- a/libmpcodecs/vd_libmpeg2.c Sat Mar 09 17:27:37 2002 +0000 +++ b/libmpcodecs/vd_libmpeg2.c Sat Mar 09 19:18:46 2002 +0000 @@ -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); diff -r 70751bbd6404 -r 88481d4b9e0e libmpcodecs/vd_odivx.c --- a/libmpcodecs/vd_odivx.c Sat Mar 09 17:27:37 2002 +0000 +++ b/libmpcodecs/vd_odivx.c Sat Mar 09 19:18:46 2002 +0000 @@ -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");