Thread: [Mplayerxp-cvslog] SF.net SVN: mplayerxp:[97] mplayerxp (Page 2)
Brought to you by:
olov
From: <nic...@us...> - 2010-01-11 18:28:55
|
Revision: 97 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=97&view=rev Author: nickols_k Date: 2010-01-11 18:28:46 +0000 (Mon, 11 Jan 2010) Log Message: ----------- print almost all help information Modified Paths: -------------- mplayerxp/cfgparser.c mplayerxp/cfgparser.h mplayerxp/input/input.c mplayerxp/input/input.h mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpdemux/demux_audio.c mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/demuxer.c mplayerxp/mplayer.c Modified: mplayerxp/cfgparser.c =================================================================== --- mplayerxp/cfgparser.c 2010-01-11 15:52:10 UTC (rev 96) +++ mplayerxp/cfgparser.c 2010-01-11 18:28:46 UTC (rev 97) @@ -948,7 +948,7 @@ #endif if (init_conf(config, COMMAND_LINE) == -1) - return -1; + return -1; if(config->last_parent == NULL) config->last_parent = config->pt; /* in order to work recursion detection properly in parse_config_file */ @@ -1055,22 +1055,6 @@ return -1; } -void m_config_show_options(const config_t *args) { - unsigned i; - MSG_INFO("List of available command-line options:\n"); - i=0; - while(args[i].name) { - if(args[i].type<=CONF_TYPE_PRINT) - MSG_INFO(" -%-11s (%-3s) %s\n" - ,args[i].name - ,args[i].type==CONF_TYPE_FLAG?"flg": - args[i].type==CONF_TYPE_INT?"int": - args[i].type==CONF_TYPE_FLOAT?"flt": - args[i].type==CONF_TYPE_STRING?"str":"" - ,(args[i].type==CONF_TYPE_PRINT && strcmp(args[i].help,"show help")!=0)?args[i].p:args[i].help); - i++; - }; -} int m_config_register_options(m_config_t *config,const config_t *args) { @@ -1318,4 +1302,78 @@ return 0; } +void m_config_show_options(const m_config_t *args) { + unsigned i,j; + const config_t *opts; + MSG_INFO("List of available command-line options:\n"); + j=0; + while((opts=args->opt_list[j])!=NULL) { + i=0; + while(opts[i].name) { + if(opts[i].type<=CONF_TYPE_PRINT) { + MSG_INFO(" -%-11s %s" + ,opts[i].name + ,(opts[i].type==CONF_TYPE_PRINT && strcmp(opts[i].help,"show help")!=0)?opts[i].p:opts[i].help); + if((opts[i].flags&CONF_NOCFG)==0) { + MSG_INFO(" {%s:", + opts[i].type==CONF_TYPE_FLAG?"flg": + opts[i].type==CONF_TYPE_INT?"int": + opts[i].type==CONF_TYPE_FLOAT?"flt": + opts[i].type==CONF_TYPE_STRING?"str":""); + switch(opts[i].type) { + case CONF_TYPE_FLAG: { + int defv = *((int*)(opts[i].p)); + MSG_INFO("<default=%i>",defv); + } + break; + case CONF_TYPE_STRING: { + const char *defv = (char*)(opts[i].p); + MSG_INFO("'%s'",defv); + } + break; + case CONF_TYPE_INT: { + int defv = *((int*)(opts[i].p)); + if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { + MSG_INFO("[%i...%i]",(int)opts[i].min,(int)opts[i].max); + } + else + if((opts[i].flags&CONF_MIN)==CONF_MIN) { + MSG_INFO("<min=%i>",(int)opts[i].min); + } + else + if((opts[i].flags&CONF_MAX)==CONF_MAX) { + MSG_INFO("<max=%i>",(int)opts[i].max); + } + MSG_INFO("<default=%i>",defv); + } + break; + case CONF_TYPE_FLOAT: { + float defv = *((float*)(opts[i].p)); + if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { + MSG_INFO("[%f...%f]",(float)opts[i].min,(float)opts[i].max); + } + else + if((opts[i].flags&CONF_MIN)==CONF_MIN) { + MSG_INFO("<min=%f>",(float)opts[i].min); + } + else + if((opts[i].flags&CONF_MAX)==CONF_MAX) { + MSG_INFO("<float=%f>",(float)opts[i].max); + } + MSG_INFO("<default=%f>",defv); + } + break; + default: + break; + } + MSG_INFO("}"); + } + MSG_INFO("\n"); + } + i++; + } + j++; + }; +} + #undef AS_INT Modified: mplayerxp/cfgparser.h =================================================================== --- mplayerxp/cfgparser.h 2010-01-11 15:52:10 UTC (rev 96) +++ mplayerxp/cfgparser.h 2010-01-11 18:28:46 UTC (rev 97) @@ -5,6 +5,7 @@ #ifndef __CONFIG_H #define __CONFIG_H +/* config types */ #define CONF_TYPE_FLAG 0 #define CONF_TYPE_INT 1 #define CONF_TYPE_FLOAT 2 @@ -21,15 +22,14 @@ #define ERR_OUT_OF_RANGE -3 #define ERR_FUNC_ERR -4 - - +/* config flags */ #define CONF_MIN (1<<0) #define CONF_MAX (1<<1) #define CONF_RANGE (CONF_MIN|CONF_MAX) #define CONF_NOCFG (1<<2) #define CONF_NOCMD (1<<3) #define CONF_GLOBAL (1<<4) -#define CONF_NOSAVE (1<<5) +#define CONF_NOSAVE (1<<5) typedef struct config config_t; @@ -108,11 +108,11 @@ */ int m_config_register_options(m_config_t *config,const config_t *args); -void m_config_show_options(const config_t *args); +void m_config_show_options(const m_config_t* args); /* * For all the following function when it's a subconfig option - * you must give an option name like 'tv:channel' and not just + * you must give an option name like 'tv:channel' and not just * 'channel' */ Modified: mplayerxp/input/input.c =================================================================== --- mplayerxp/input/input.c 2010-01-11 15:52:10 UTC (rev 96) +++ mplayerxp/input/input.c 2010-01-11 18:28:46 UTC (rev 97) @@ -91,7 +91,7 @@ { MP_CMD_CHELP, "help", 0, { {-1,{0}} } }, { MP_CMD_CEXIT, "exit", 0, { {-1,{0}} } }, { MP_CMD_CHIDE, "hide", 0, { {MP_CMD_ARG_INT,{3000}}, {-1,{0}} } }, - + { 0, NULL, 0, {} } }; @@ -229,7 +229,7 @@ { { MOUSE_BTN4, 0 }, "seek -10" }, { { MOUSE_BTN5, 0 }, "volume 1" }, { { MOUSE_BTN6, 0 }, "volume -1" }, - + #ifdef USE_DVDNAV { { KEY_KP8, 0 }, "dvdnav 1" }, // up { { KEY_KP2, 0 }, "dvdnav 2" }, // down @@ -408,35 +408,32 @@ // Our command line options static const config_t input_conf[] = { - { "conf", &config_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL }, - { "ar-delay", &ar_delay, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL }, - { "ar-rate", &ar_rate, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL }, - { "keylist", mp_input_print_key_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL }, - { "cmdlist", mp_input_print_cmd_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL }, - { "js-dev", &js_dev, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL }, - { "file", &in_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL }, - { NULL, NULL, 0, 0, 0, 0, NULL} + { "conf", &config_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "" }, + { "ar-delay", &ar_delay, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL, "" }, + { "ar-rate", &ar_rate, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL, "" }, + { "keylist", mp_input_print_key_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL, "" }, + { "cmdlist", mp_input_print_cmd_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL, "" }, + { "js-dev", &js_dev, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "" }, + { "file", &in_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "" }, + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; static const config_t mp_input_opts[] = { - { "input", &input_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, - { "nojoystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL }, - { "joystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL }, - { "nolirc", &use_lirc, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL }, - { "lirc", &use_lirc, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL }, - { "nolircc", &use_lircc, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL }, - { "lircc", &use_lircc, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL }, - { NULL, NULL, 0, 0, 0, 0, NULL} + { "input", &input_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, ""}, + { "joystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL, "enables using of joystick" }, + { "nojoystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL, "disables using of joystick" }, + { "lirc", &use_lirc, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL, "enables using of lirc" }, + { "nolirc", &use_lirc, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL, "disables using of lirc" }, + { "lircc", &use_lircc, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL, "enables using of lirc daemon" }, + { "nolircc", &use_lircc, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL, "disables using of lirc daemon" }, + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; -static int -mp_input_default_key_func(int fd); +static int mp_input_default_key_func(int fd); -static int -mp_input_default_cmd_func(int fd,char* buf, int l); +static int mp_input_default_cmd_func(int fd,char* buf, int l); -static char* -mp_input_get_key_name(int key); +static char* mp_input_get_key_name(int key); int @@ -598,7 +595,7 @@ if(e <= ptr2 || *(e - 1) != '\\') break; ptr2 = e + 1; } - + if(term != ' ' && (!e || e[0] == '\0')) { MSG_ERR("Command %s : argument %d is unterminated\n",cmd_def->name,i+1); ptr = NULL; @@ -667,8 +664,8 @@ mp_fd->buffer = (char*)malloc(MP_CMD_MAX_SIZE*sizeof(char)); mp_fd->pos = 0; mp_fd->size = MP_CMD_MAX_SIZE; - } - + } + // Get some data if needed/possible while( !(mp_fd->flags & MP_FD_GOT_CMD) && !(mp_fd->flags & MP_FD_EOF) && (mp_fd->size - mp_fd->pos > 1) ) { int r = ((mp_cmd_func_t)mp_fd->read_func)(mp_fd->fd,mp_fd->buffer+mp_fd->pos,mp_fd->size - 1 - mp_fd->pos); @@ -728,7 +725,7 @@ memmove(mp_fd->buffer,end+1,mp_fd->pos-(l+1)); mp_fd->pos -= l+1; } - + if(*ret) return 1; else @@ -764,8 +761,8 @@ filter->next = cmd_filters; cmd_filters = filter; } - + static char* mp_input_find_bind_for_key(const mp_cmd_bind_t* binds, int n,int* keys) { int j; @@ -864,12 +861,12 @@ if(n>0){ if(time >= 0 ) { - tv.tv_sec=time/1000; + tv.tv_sec=time/1000; tv.tv_usec = (time%1000)*1000; time_val = &tv; } else time_val = NULL; - + while(1) { if(select(max_fd+1,&fds,NULL,NULL,time_val) < 0) { if(errno == EINTR) @@ -916,7 +913,6 @@ } return MP_INPUT_NOTHING; } - static mp_cmd_t* mp_input_read_keys(int time,int paused) { @@ -969,7 +965,7 @@ key_down[num_key_down] = code; num_key_down++; last_key_down = 1; - } + } // We ignore key from last combination ret = last_key_down ? mp_input_get_cmd_from_keys(num_key_down,key_down,paused) : NULL; // Remove the key @@ -1052,7 +1048,7 @@ time_val = &tv; } else time_val = NULL; - + while(n > 0) { if((i = select(max_fd+1,&fds,NULL,NULL,time_val)) <= 0) { if(i < 0) { @@ -1096,9 +1092,9 @@ last_loop = i; return ret; } - + last_loop = 0; - return NULL; + return NULL; } int @@ -1119,14 +1115,14 @@ return NULL; ret = cmd_queue[cmd_queue_start]; - + if (!peek_only) { cmd_queue_length--; cmd_queue_start = (cmd_queue_start + 1) % CMD_QUEUE_SIZE; } - + return ret; -} +} /** * \param peek_only when set, the returned command stays in the queue. @@ -1209,7 +1205,7 @@ if(key_names[i].key == key) return key_names[i].name; } - + if(isascii(key)) { snprintf(key_str,12,"%c",(char)key); return key_str; @@ -1285,7 +1281,7 @@ } } } - + if(!bind) { cmd_binds = (mp_cmd_bind_t*)realloc(cmd_binds,(i+2)*sizeof(mp_cmd_bind_t)); memset(&cmd_binds[i],0,2*sizeof(mp_cmd_bind_t)); @@ -1482,7 +1478,7 @@ file = config_file[0] != '/' ? get_path(config_file) : config_file; if(!file) return; - + if(! mp_input_parse_config(file)) { // Try global conf dir file = CONFDIR "/input.conf"; @@ -1544,7 +1540,7 @@ if(cmd_fds[i].close_func) cmd_fds[i].close_func(cmd_fds[i].fd); } - + } void @@ -1552,21 +1548,52 @@ m_config_register_options(cfg,mp_input_opts); } +void mp_input_print_keys(void) { + unsigned i; + MSG_INFO("List of available KEYS:\n"); + for(i= 0; key_names[i].name != NULL ; i++) + MSG_INFO("%s\n",key_names[i].name); +} + static int mp_input_print_key_list(config_t* cfg) { - int i; - printf("\n"); - for(i= 0; key_names[i].name != NULL ; i++) - printf("%s\n",key_names[i].name); + mp_input_print_keys(); exit(0); } -static int mp_input_print_cmd_list(config_t* cfg) { +static char defkname[2]; +static const char * mp_find_keyname(int keyval) { + unsigned i; + defkname[1]='\0'; + if( keyval>' ' && keyval<='z' ) { + defkname[0]=keyval; + return defkname; + } + for(i= 0; key_names[i].name != NULL ; i++) { + if(keyval==key_names[i].key) return key_names[i].name; + } + return "unknown"; +} + +void mp_input_print_binds(void) { + unsigned i,j; + MSG_INFO("List of available key bindings:\n"); + for(i=0; def_cmd_binds[i].cmd != NULL ; i++) { + MSG_INFO(" %-15s",def_cmd_binds[i].cmd); + for(j=0;def_cmd_binds[i].input[j] != 0;j++) { + MSG_INFO(" %s",mp_find_keyname(def_cmd_binds[i].input[j])); + } + MSG_INFO("\n"); + } +} + +void mp_input_print_cmds(void) { const mp_cmd_t *cmd; int i,j; char* type; + MSG_INFO("List of available input commands:\n"); for(i = 0; (cmd = &mp_cmds[i])->name != NULL ; i++) { - printf("%-20.20s",cmd->name); + MSG_INFO(" %-20.20s",cmd->name); for(j= 0 ; j < MP_CMD_MAX_ARGS && cmd->args[j].type != -1 ; j++) { switch(cmd->args[j].type) { case MP_CMD_ARG_INT: @@ -1582,12 +1609,16 @@ type = "??"; } if(j+1 > cmd->nargs) - printf(" [%s]",type); + MSG_INFO(" [%s]",type); else - printf(" %s",type); + MSG_INFO(" %s",type); } - printf("\n"); + MSG_INFO("\n"); } +} + +static int mp_input_print_cmd_list(config_t* cfg) { + mp_input_print_cmds(); exit(0); } Modified: mplayerxp/input/input.h =================================================================== --- mplayerxp/input/input.h 2010-01-11 15:52:10 UTC (rev 96) +++ mplayerxp/input/input.h 2010-01-11 18:28:46 UTC (rev 97) @@ -208,3 +208,6 @@ int mp_input_check_interrupt(int time); +void mp_input_print_keys(void); +void mp_input_print_cmds(void); +void mp_input_print_binds(void); Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-11 15:52:10 UTC (rev 96) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-11 18:28:46 UTC (rev 97) @@ -43,21 +43,21 @@ static char *lavc_avopt = NULL; static const config_t options[] = { - {"ffmpeg_er", &lavc_param_error_resilience, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL}, - {"ffmpeg_idct", &lavc_param_idct_algo, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL}, - {"ffmpeg_ec", &lavc_param_error_concealment, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL}, - {"ffmpeg_vstats", &lavc_param_vstats, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"ffmpeg_debug", &lavc_param_debug, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL}, - {"ffmpeg_vismv", &lavc_param_vismv, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL}, - {"ffmpeg_st", &lavc_param_skip_top, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL}, - {"ffmpeg_sb", &lavc_param_skip_bottom, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL}, - {"ffmpeg_lowres", &lavc_param_lowres_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"ffmpeg_skiploopfilter", &lavc_param_skip_loop_filter_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"ffmpeg_skipidct", &lavc_param_skip_idct_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"ffmpeg_skipframe", &lavc_param_skip_frame_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"ffmpeg_threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL}, - {"ffmpeg_o", &lavc_avopt, CONF_TYPE_STRING, 0, 0, 0, NULL}, - { NULL, NULL, 0, 0, 0, 0, NULL} + {"ffmpeg_er", &lavc_param_error_resilience, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error resilience for ffmpeg decoders"}, + {"ffmpeg_idct", &lavc_param_idct_algo, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies idct algorithm for ffmpeg decoders"}, + {"ffmpeg_ec", &lavc_param_error_concealment, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error concealment for ffmpeg decoders"}, + {"ffmpeg_vstats", &lavc_param_vstats, CONF_TYPE_FLAG, 0, 0, 1, NULL,"specifies vstat for ffmpeg decoders"}, + {"ffmpeg_debug", &lavc_param_debug, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL,"specifies debug level for ffmpeg decoders"}, + {"ffmpeg_vismv", &lavc_param_vismv, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL,"specifies visualize motion vectors (MVs) for ffmpeg decoders"}, + {"ffmpeg_st", &lavc_param_skip_top, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL,"specifies skipping top lines for ffmpeg decoders"}, + {"ffmpeg_sb", &lavc_param_skip_bottom, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL,"specifies skipping bottom lines for ffmpeg decoders"}, + {"ffmpeg_lowres", &lavc_param_lowres_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies decoding at 1= 1/2, 2=1/4, 3=1/8 resolutions for ffmpeg decoders"}, + {"ffmpeg_skiploopfilter", &lavc_param_skip_loop_filter_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies skipping of loop filters for ffmpeg decoders"}, + {"ffmpeg_skipidct", &lavc_param_skip_idct_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies skipping of IDCT filters for ffmpeg decoders"}, + {"ffmpeg_skipframe", &lavc_param_skip_frame_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"indicates frame skipping for ffmpeg decoders"}, + {"ffmpeg_threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL,"specifies number of threads for ffmpeg decoders"}, + {"ffmpeg_o", &lavc_avopt, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies additional option for ffmpeg decoders"}, + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(ffmpeg) Modified: mplayerxp/libmpdemux/demux_audio.c =================================================================== --- mplayerxp/libmpdemux/demux_audio.c 2010-01-11 15:52:10 UTC (rev 96) +++ mplayerxp/libmpdemux/demux_audio.c 2010-01-11 18:28:46 UTC (rev 97) @@ -1767,9 +1767,9 @@ #include "../cfgparser.h" static const config_t audio_opts[] = { - { "hr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL }, - { "nohr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + { "hr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables hight-resolution mp3 seeking" }, + { "nohr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables hight-resolution mp3 seeking"}, + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; demuxer_driver_t demux_audio = Modified: mplayerxp/libmpdemux/demux_lavf.c =================================================================== --- mplayerxp/libmpdemux/demux_lavf.c 2010-01-11 15:52:10 UTC (rev 96) +++ mplayerxp/libmpdemux/demux_lavf.c 2010-01-11 18:28:46 UTC (rev 97) @@ -48,9 +48,9 @@ extern int ts_prog; const config_t lavfdopts_conf[] = { - {"lavf_format", &(opt_format), CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"lavf_cryptokey", &(opt_cryptokey), CONF_TYPE_STRING, 0, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {"lavf_format", &(opt_format), CONF_TYPE_STRING, 0, 0, 0, NULL, "forces format of lavf demuxer"}, + {"lavf_cryptokey", &(opt_cryptokey), CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies cryptokey for lavf demuxer"}, + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; static int64_t mpxp_gcd(int64_t a, int64_t b){ Modified: mplayerxp/libmpdemux/demuxer.c =================================================================== --- mplayerxp/libmpdemux/demuxer.c 2010-01-11 15:52:10 UTC (rev 96) +++ mplayerxp/libmpdemux/demuxer.c 2010-01-11 18:28:46 UTC (rev 97) @@ -746,12 +746,12 @@ /******************* Options stuff **********************/ static const config_t demuxer_opts[] = { - { "audiofile", &audio_stream, CONF_TYPE_STRING, 0, 0, 0, NULL }, - { "subfile", &sub_stream, CONF_TYPE_STRING, 0, 0, 0, NULL }, - { "demuxer", &demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL }, - { "audio-demuxer", &audio_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL }, - { "sub-demuxer", &sub_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL }, - { NULL, NULL, 0, 0, 0, 0, NULL} + { "audiofile", &audio_stream, CONF_TYPE_STRING, 0, 0, 0, NULL, "forces reading of audio-stream from other file" }, + { "subfile", &sub_stream, CONF_TYPE_STRING, 0, 0, 0, NULL, "forces reading of subtitles from other file" }, + { "demuxer", &demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces demxer by given number" }, + { "audio-demuxer", &audio_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces using of audio-demuxer" }, + { "sub-demuxer", &sub_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces using of subtitle-demuxer" }, + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; void demuxer_register_options(m_config_t* cfg) { Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2010-01-11 15:52:10 UTC (rev 96) +++ mplayerxp/mplayer.c 2010-01-11 18:28:46 UTC (rev 97) @@ -991,8 +991,9 @@ } void show_long_help(void) { - show_help(); - m_config_show_options(mplayer_opts); + m_config_show_options(mconfig); + mp_input_print_binds(); + print_stream_drivers(); vo_print_help(); ao_print_help(); vf_help(); @@ -2030,7 +2031,7 @@ ,get_delay_audio_buffer() ); } - + int v_bright=0; int v_cont=0; int v_hue=0; @@ -2104,7 +2105,7 @@ playtree = play_tree_cleanup(playtree); if(playtree) { playtree_iter = play_tree_iter_new(playtree,mconfig); - if(playtree_iter) { + if(playtree_iter) { if(play_tree_iter_step(playtree_iter,0,0) != PLAY_TREE_ITER_ENTRY) { play_tree_iter_free(playtree_iter); playtree_iter = NULL; @@ -2116,7 +2117,7 @@ ao_da_buffs = vo_da_buffs; if(enable_xp!=XP_None) vo_doublebuffering=1; else vo_use_bm = 0; - + init_player(); if(!filename){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-12 17:58:46
|
Revision: 98 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=98&view=rev Author: nickols_k Date: 2010-01-12 17:58:30 +0000 (Tue, 12 Jan 2010) Log Message: ----------- cleanups Modified Paths: -------------- mplayerxp/cfgparser.c mplayerxp/input/input.c Modified: mplayerxp/cfgparser.c =================================================================== --- mplayerxp/cfgparser.c 2010-01-11 18:28:46 UTC (rev 97) +++ mplayerxp/cfgparser.c 2010-01-12 17:58:30 UTC (rev 98) @@ -1327,8 +1327,8 @@ } break; case CONF_TYPE_STRING: { - const char *defv = (char*)(opts[i].p); - MSG_INFO("'%s'",defv); + const char **defv = (char**)(opts[i].p); + if(defv) MSG_INFO("'%s'",*defv); } break; case CONF_TYPE_INT: { Modified: mplayerxp/input/input.c =================================================================== --- mplayerxp/input/input.c 2010-01-11 18:28:46 UTC (rev 97) +++ mplayerxp/input/input.c 2010-01-12 17:58:30 UTC (rev 98) @@ -1560,29 +1560,14 @@ exit(0); } -static char defkname[2]; -static const char * mp_find_keyname(int keyval) { - unsigned i; - defkname[1]='\0'; - if( keyval>' ' && keyval<='z' ) { - defkname[0]=keyval; - return defkname; - } - for(i= 0; key_names[i].name != NULL ; i++) { - if(keyval==key_names[i].key) return key_names[i].name; - } - return "unknown"; -} - void mp_input_print_binds(void) { unsigned i,j; MSG_INFO("List of available key bindings:\n"); for(i=0; def_cmd_binds[i].cmd != NULL ; i++) { - MSG_INFO(" %-15s",def_cmd_binds[i].cmd); for(j=0;def_cmd_binds[i].input[j] != 0;j++) { - MSG_INFO(" %s",mp_find_keyname(def_cmd_binds[i].input[j])); + MSG_INFO(" %-20s",mp_input_get_key_name(def_cmd_binds[i].input[j])); } - MSG_INFO("\n"); + MSG_INFO(" %s\n",def_cmd_binds[i].cmd); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-13 15:42:54
|
Revision: 99 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=99&view=rev Author: nickols_k Date: 2010-01-13 15:42:47 +0000 (Wed, 13 Jan 2010) Log Message: ----------- new way of subconfig handling Modified Paths: -------------- mplayerxp/cfgparser.c mplayerxp/cfgparser.h mplayerxp/input/input.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpdemux/demux_audio.c mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/demux_rawaudio.c mplayerxp/libmpdemux/demux_rawvideo.c mplayerxp/libmpdemux/demux_viv.c mplayerxp/libmpdemux/demuxer.c Modified: mplayerxp/cfgparser.c =================================================================== --- mplayerxp/cfgparser.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/cfgparser.c 2010-01-13 15:42:47 UTC (rev 99) @@ -311,92 +311,6 @@ } } - if(! IS_RUNNING(config)) { - if(strcasecmp(opt,"vcd") == 0) { - char* s; - if(!param) - return ERR_MISSING_PARAM; - s = (char*)malloc((strlen(param) + 6 + 1)*sizeof(char)); - sprintf(s,"vcd://%s",param); - entry = play_tree_new(); - play_tree_add_file(entry,s); - free(s); - } else if(strcasecmp(opt,"dvd") == 0) { - char* s; - if(!param) - return ERR_MISSING_PARAM; - s = (char*)malloc((strlen(param) + 6 + 1)*sizeof(char)); - sprintf(s,"dvd://%s",param); - entry = play_tree_new(); - play_tree_add_file(entry,s); - free(s); - } else if(strcasecmp(opt,"tv") == 0) { - char *s,*pr,*prs; - char *channel=NULL; - const char *ps,*pe; - char *as; - int on=0; - if(!param) - return ERR_MISSING_PARAM; - ps = param; - pe = strchr(param,':'); - pr = prs = (char*)malloc((strlen(param)+1)*sizeof(char)); - pr[0] = '\0'; - while(ps) { - if(!pe) - pe = ps + strlen(ps); - - as = strchr(ps,'='); - if(as && as[1] != '\0' && pe-as > 0) - as++; - else - as = NULL; - if( !as && pe-ps == 2 && strncasecmp("on",ps,2) == 0 ) - on = 1; - else if(as && as-ps == 8 && strncasecmp("channel",ps,6) == 0 && pe-as > 0) { - channel = (char*)realloc(channel,(pe-as+1)*sizeof(char)); - strncpy(channel,as,pe-as); - channel[pe-as] = '\0'; - } else if(pe-ps > 0) { - if(prs != pr) { - prs[0] = ':'; - prs++; - } - strncpy(prs,ps,pe-ps); - prs += pe-ps; - prs[0] = '\0'; - } - - if(pe[0] != '\0') { - ps = pe+1; - pe = strchr(ps,':'); - } else - ps = NULL; - } - - if(on) { - int l=5; - - if(channel) - l += strlen(channel); - s = (char*) malloc((l+1)*sizeof(char)); - if(channel) - sprintf(s,"tv://%s",channel); - else - sprintf(s,"tv://"); - entry = play_tree_new(); - play_tree_add_file(entry,s); - if(strlen(pr) > 0) - play_tree_set_param(entry,"tv",pr); - free(s); - } - free(pr); - if(channel) - free(channel); - - } - } - if(entry) { if(config->last_entry) play_tree_append_entry(config->last_entry,entry); @@ -410,8 +324,6 @@ return 0; } - - static int config_read_option(m_config_t *config,config_t** conf_list,const char *opt,const char *param) { int i=0,nconf = 0; @@ -434,6 +346,7 @@ for (i = 0; conf[i].name != NULL; i++) { int namelength; /* allow 'aa*' in config.name */ +// MSG_DBG3( "cmp_option: conf=%s opt='%s'\n",conf[i].name,opt); namelength=strlen(conf[i].name); if ( (conf[i].name[namelength-1]=='*') && !memcmp(opt, conf[i].name, namelength-1)) @@ -442,8 +355,7 @@ goto option_found; } } - if (config->parser_mode == CONFIG_FILE) - MSG_ERR( "invalid option: %s\n",opt); + MSG_ERR( "invalid option: %s\n",opt); ret = ERR_NOT_AN_OPTION; goto out; option_found : @@ -465,7 +377,7 @@ return ret; else ret = -1; - if(! IS_RUNNING(config) && ! IS_GLOBAL(config) && + if(! IS_RUNNING(config) && ! IS_GLOBAL(config) && ! (conf[i].flags & CONF_GLOBAL) && conf[i].type != CONF_TYPE_SUBCONFIG ) m_config_push(config); if( !(conf[i].flags & CONF_NOSAVE) && ! (conf[i].flags & CONF_GLOBAL) ) @@ -498,6 +410,7 @@ ret = 1; } else { /* parser_mode == COMMAND_LINE */ *((int *) conf[i].p) = conf[i].max; + MSG_DBG3("assigning %s=%i as flag value\n",conf[i].name,conf[i].max); ret = 0; } break; @@ -527,6 +440,7 @@ } *((int *) conf[i].p) = tmp_int; + MSG_DBG3("assigning %s=%i as int value\n",conf[i].name,tmp_int); ret = 1; break; case CONF_TYPE_FLOAT: @@ -560,6 +474,7 @@ } *((float *) conf[i].p) = tmp_float; + MSG_DBG3("assigning %s=%f as float value\n",conf[i].name,tmp_float); ret = 1; break; case CONF_TYPE_STRING: @@ -582,6 +497,7 @@ goto out; } *((char **) conf[i].p) = strdup(param); + MSG_DBG3("assigning %s=%s as string value\n",conf[i].name,param); ret = 1; break; case CONF_TYPE_FUNC_PARAM: @@ -694,7 +610,7 @@ else if(ret > 0) play_tree_set_param(dest,o,param); free(o); - m_config_pop(config); + m_config_pop(config); } return ret; err_missing_param: @@ -703,14 +619,49 @@ goto out; } +static const config_t* m_config_find_option(const config_t **list,const char *name); + int m_config_set_option(m_config_t *config,const char *opt,const char *param) { char *e; + const config_t **clist=config->opt_list; #ifdef MP_DEBUG assert(config != NULL); assert(config->opt_list != NULL); assert(opt != NULL); #endif MSG_DBG2( "Setting option %s=%s\n",opt,param); + clist = config->opt_list; +#if 1 + if(strchr(opt,'.')) { + int flg,ret; + const config_t *subconf=NULL; + config_t* olist[] = { NULL, NULL }; + MSG_DBG2("Parsing %s as subconfig\n",opt); + do { + if(!(e = strchr(opt,'.'))) break; + if((e-opt)>0) { + char* s = (char*)malloc((e-opt+1)*sizeof(char)); + strncpy(s,opt,e-opt); + s[e-opt] = '\0'; + MSG_DBG2("Treat %s as subconfig name\n",s); + subconf = m_config_find_option(clist?clist:olist,s); + clist=NULL; + free(s); + MSG_DBG2("returned %p as subconfig name\n",subconf); + if(!subconf) return ERR_NOT_AN_OPTION; + if(subconf->type!=CONF_TYPE_SUBCONFIG) return ERR_NOT_AN_OPTION; + olist[0] = subconf->p; + opt = e+1; + MSG_DBG2("switching next subconf=%s\n",subconf->name); + } + }while(1); + flg=config->flags; + config->flags|=CONFIG_GLOBAL; + ret=config_read_option(config,olist,opt,param); + config->flags=flg; + return ret; + } +#endif e = strchr(opt,':'); if(e && e[1] != '\0') { int ret; @@ -1004,21 +955,43 @@ if ((no_more_opts == 0) && (*opt == '-') && (*(opt+1) != 0)) /* option */ { /* remove leading '-' */ + char *assign,*item,*parm; opt++; - MSG_DBG3( "this_opt = option: %s\n", opt); - tmp = m_config_set_option(config, opt, argv[i + 1]); + MSG_DBG2( "this_option: %s\n", opt); + parm = argv[i+1]; + item=opt; + assign = strchr(opt,'='); + if(assign) { + item = malloc(assign-opt); + memcpy(item,opt,assign-opt); + item[assign-opt]='\0'; + parm = strdup(assign+1); + } + tmp = m_config_set_option(config, item, parm); + if(!tmp && assign) + MSG_ERR("Option '%s' doesn't require arguments\n",item); + if(assign) { + free(item); + free(parm); + } + if(!tmp && assign) goto err_out; switch (tmp) { case ERR_NOT_AN_OPTION: case ERR_MISSING_PARAM: case ERR_OUT_OF_RANGE: case ERR_FUNC_ERR: - MSG_ERR( "Error %d while parsing option: '%s'!\n", - tmp, opt); + MSG_ERR( "Error '%s' while parsing option: '%s'!\n" + ,tmp==ERR_NOT_AN_OPTION?"no-option": + tmp==ERR_MISSING_PARAM?"missing-param": + tmp==ERR_OUT_OF_RANGE?"out-of-range": + "func-error" + ,opt); goto err_out; default: i += tmp; + if(assign) i--; break; } } @@ -1084,12 +1057,25 @@ return 1; } +static const config_t* m_config_find_option(const config_t **list,const char *name) { + unsigned i,j; + const config_t *conf; + if(list) { + for(j = 0; list[j] != NULL ; j++) { + conf = list[j]; + for(i=0; conf[i].name != NULL; i++) { + if(strcasecmp(conf[i].name,name) == 0) + return &conf[i]; + } + } + } + return NULL; +} + config_t* m_config_get_option(m_config_t const*config,const char* arg) { - int i,j; char *e; - config_t *conf; - config_t **conf_list; - config_t* cl[] = { NULL, NULL }; + const config_t **conf_list; + const config_t* cl[] = { NULL, NULL }; #ifdef MP_DEBUG assert(config != NULL); @@ -1108,17 +1094,7 @@ free(s); } else conf_list = config->opt_list; - - if(conf_list) { - for(j = 0 ; conf_list[j] != NULL ; j++) { - conf = conf_list[j]; - for(i=0; conf[i].name != NULL; i++) { - if(strcasecmp(conf[i].name,arg) == 0) - return &conf[i]; - } - } - } - return NULL; + return m_config_find_option(conf_list,arg); } void* m_config_get_option_ptr(m_config_t const*config,const char* arg) { @@ -1302,76 +1278,100 @@ return 0; } -void m_config_show_options(const m_config_t *args) { - unsigned i,j; - const config_t *opts; - MSG_INFO("List of available command-line options:\n"); - j=0; - while((opts=args->opt_list[j])!=NULL) { - i=0; - while(opts[i].name) { - if(opts[i].type<=CONF_TYPE_PRINT) { - MSG_INFO(" -%-11s %s" +static void __m_config_show_options(unsigned ntabs,const char *pfx,const config_t *opts) { + unsigned i,n; + i=0; + while(opts[i].name) { + if(opts[i].type==CONF_TYPE_SUBCONFIG && opts[i].p) { + char *newpfx; + unsigned pfxlen; + for(n=0;n<ntabs;n++) MSG_INFO(" "); + MSG_INFO("%s:\n",opts[i].help); + pfxlen=strlen(opts[i].name)+1; + if(pfx) pfxlen+=strlen(pfx); + newpfx=malloc(pfxlen+1); + if(pfx) strcpy(newpfx,pfx); + else newpfx[0]='\0'; + strcat(newpfx,opts[i].name); + strcat(newpfx,"."); + __m_config_show_options(ntabs+2,newpfx,(const config_t *)opts[i].p); + free(newpfx); + } + else + if(opts[i].type<=CONF_TYPE_PRINT) { + for(n=0;n<ntabs;n++) MSG_INFO(" "); + if(pfx) MSG_INFO("-%-s",pfx); + else MSG_INFO("-"); + MSG_INFO("%-11s %s" ,opts[i].name ,(opts[i].type==CONF_TYPE_PRINT && strcmp(opts[i].help,"show help")!=0)?opts[i].p:opts[i].help); - if((opts[i].flags&CONF_NOCFG)==0) { - MSG_INFO(" {%s:", + if((opts[i].flags&CONF_NOCFG)==0) { + MSG_INFO(" {%s:", opts[i].type==CONF_TYPE_FLAG?"flg": opts[i].type==CONF_TYPE_INT?"int": opts[i].type==CONF_TYPE_FLOAT?"flt": opts[i].type==CONF_TYPE_STRING?"str":""); - switch(opts[i].type) { - case CONF_TYPE_FLAG: { - int defv = *((int*)(opts[i].p)); - MSG_INFO("<default=%i>",defv); + switch(opts[i].type) { + case CONF_TYPE_FLAG: { + int defv = *((int*)(opts[i].p)); + MSG_INFO("<default=%i>",defv); + } + break; + case CONF_TYPE_STRING: { + const char **defv = (const char**)(opts[i].p); + if(defv) MSG_INFO("'%s'",*defv); + } + break; + case CONF_TYPE_INT: { + int defv = *((int*)(opts[i].p)); + if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { + MSG_INFO("[%i...%i]",(int)opts[i].min,(int)opts[i].max); } - break; - case CONF_TYPE_STRING: { - const char **defv = (char**)(opts[i].p); - if(defv) MSG_INFO("'%s'",*defv); + else + if((opts[i].flags&CONF_MIN)==CONF_MIN) { + MSG_INFO("<min=%i>",(int)opts[i].min); } - break; - case CONF_TYPE_INT: { - int defv = *((int*)(opts[i].p)); - if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { - MSG_INFO("[%i...%i]",(int)opts[i].min,(int)opts[i].max); - } - else - if((opts[i].flags&CONF_MIN)==CONF_MIN) { - MSG_INFO("<min=%i>",(int)opts[i].min); - } - else - if((opts[i].flags&CONF_MAX)==CONF_MAX) { - MSG_INFO("<max=%i>",(int)opts[i].max); - } - MSG_INFO("<default=%i>",defv); + else + if((opts[i].flags&CONF_MAX)==CONF_MAX) { + MSG_INFO("<max=%i>",(int)opts[i].max); } - break; - case CONF_TYPE_FLOAT: { - float defv = *((float*)(opts[i].p)); - if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { - MSG_INFO("[%f...%f]",(float)opts[i].min,(float)opts[i].max); - } - else - if((opts[i].flags&CONF_MIN)==CONF_MIN) { - MSG_INFO("<min=%f>",(float)opts[i].min); - } - else - if((opts[i].flags&CONF_MAX)==CONF_MAX) { - MSG_INFO("<float=%f>",(float)opts[i].max); - } - MSG_INFO("<default=%f>",defv); + MSG_INFO("<default=%i>",defv); + } + break; + case CONF_TYPE_FLOAT: { + float defv = *((float*)(opts[i].p)); + if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { + MSG_INFO("[%f...%f]",(float)opts[i].min,(float)opts[i].max); } - break; - default: - break; + else + if((opts[i].flags&CONF_MIN)==CONF_MIN) { + MSG_INFO("<min=%f>",(float)opts[i].min); } - MSG_INFO("}"); + else + if((opts[i].flags&CONF_MAX)==CONF_MAX) { + MSG_INFO("<float=%f>",(float)opts[i].max); } + MSG_INFO("<default=%f>",defv); + } + break; + default: + break; + } + MSG_INFO("}"); + } MSG_INFO("\n"); - } - i++; } + i++; + }; +} + +void m_config_show_options(const m_config_t *args) { + unsigned j; + const config_t *opts; + j=0; + MSG_INFO("List of available command-line options:\n"); + while((opts=args->opt_list[j])!=NULL) { + __m_config_show_options(2,NULL,opts); j++; }; } Modified: mplayerxp/cfgparser.h =================================================================== --- mplayerxp/cfgparser.h 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/cfgparser.h 2010-01-13 15:42:47 UTC (rev 99) @@ -52,8 +52,6 @@ const char *help; }; - - struct m_config { const config_t** opt_list; config_save_t** config_stack; Modified: mplayerxp/input/input.c =================================================================== --- mplayerxp/input/input.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/input/input.c 2010-01-13 15:42:47 UTC (rev 99) @@ -408,18 +408,18 @@ // Our command line options static const config_t input_conf[] = { - { "conf", &config_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "" }, - { "ar-delay", &ar_delay, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL, "" }, - { "ar-rate", &ar_rate, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL, "" }, - { "keylist", mp_input_print_key_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL, "" }, - { "cmdlist", mp_input_print_cmd_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL, "" }, - { "js-dev", &js_dev, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "" }, - { "file", &in_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "" }, + { "conf", &config_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "specifies alternative input.conf" }, + { "ar-delay", &ar_delay, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL, "autorepeate a key delay in milliseconds (0 to disable)" }, + { "ar-rate", &ar_rate, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL, "number of key-presses per second generating on autorepeat" }, + { "keylist", mp_input_print_key_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL, "prints all keys that can be bound to commands" }, + { "cmdlist", mp_input_print_cmd_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL, "prints all commands that can be bound to keys" }, + { "js-dev", &js_dev, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "specifies the joystick device" }, + { "file", &in_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "specifes file with commands (useful for FIFO)" }, { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; static const config_t mp_input_opts[] = { - { "input", &input_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, ""}, + { "input", &input_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Input specific options"}, { "joystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL, "enables using of joystick" }, { "nojoystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL, "disables using of joystick" }, { "lirc", &use_lirc, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL, "enables using of lirc" }, Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-13 15:42:47 UTC (rev 99) @@ -42,21 +42,26 @@ static int lavc_param_threads=-1; static char *lavc_avopt = NULL; +static const config_t ff_options[] = { + {"er", &lavc_param_error_resilience, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error resilience for ffmpeg decoders"}, + {"idct", &lavc_param_idct_algo, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies idct algorithm for ffmpeg decoders"}, + {"ec", &lavc_param_error_concealment, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error concealment for ffmpeg decoders"}, + {"vstats", &lavc_param_vstats, CONF_TYPE_FLAG, 0, 0, 1, NULL,"specifies vstat for ffmpeg decoders"}, + {"debug", &lavc_param_debug, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL,"specifies debug level for ffmpeg decoders"}, + {"vismv", &lavc_param_vismv, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL,"specifies visualize motion vectors (MVs) for ffmpeg decoders"}, + {"st", &lavc_param_skip_top, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL,"specifies skipping top lines for ffmpeg decoders"}, + {"sb", &lavc_param_skip_bottom, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL,"specifies skipping bottom lines for ffmpeg decoders"}, + {"lowres", &lavc_param_lowres_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies decoding at 1= 1/2, 2=1/4, 3=1/8 resolutions for ffmpeg decoders"}, + {"skiploopfilter", &lavc_param_skip_loop_filter_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies skipping of loop filters for ffmpeg decoders"}, + {"skipidct", &lavc_param_skip_idct_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies skipping of IDCT filters for ffmpeg decoders"}, + {"skipframe", &lavc_param_skip_frame_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"indicates frame skipping for ffmpeg decoders"}, + {"threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL,"specifies number of threads for ffmpeg decoders"}, + {"o", &lavc_avopt, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies additional option for ffmpeg decoders"}, + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} +}; + static const config_t options[] = { - {"ffmpeg_er", &lavc_param_error_resilience, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error resilience for ffmpeg decoders"}, - {"ffmpeg_idct", &lavc_param_idct_algo, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies idct algorithm for ffmpeg decoders"}, - {"ffmpeg_ec", &lavc_param_error_concealment, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error concealment for ffmpeg decoders"}, - {"ffmpeg_vstats", &lavc_param_vstats, CONF_TYPE_FLAG, 0, 0, 1, NULL,"specifies vstat for ffmpeg decoders"}, - {"ffmpeg_debug", &lavc_param_debug, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL,"specifies debug level for ffmpeg decoders"}, - {"ffmpeg_vismv", &lavc_param_vismv, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL,"specifies visualize motion vectors (MVs) for ffmpeg decoders"}, - {"ffmpeg_st", &lavc_param_skip_top, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL,"specifies skipping top lines for ffmpeg decoders"}, - {"ffmpeg_sb", &lavc_param_skip_bottom, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL,"specifies skipping bottom lines for ffmpeg decoders"}, - {"ffmpeg_lowres", &lavc_param_lowres_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies decoding at 1= 1/2, 2=1/4, 3=1/8 resolutions for ffmpeg decoders"}, - {"ffmpeg_skiploopfilter", &lavc_param_skip_loop_filter_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies skipping of loop filters for ffmpeg decoders"}, - {"ffmpeg_skipidct", &lavc_param_skip_idct_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies skipping of IDCT filters for ffmpeg decoders"}, - {"ffmpeg_skipframe", &lavc_param_skip_frame_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"indicates frame skipping for ffmpeg decoders"}, - {"ffmpeg_threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL,"specifies number of threads for ffmpeg decoders"}, - {"ffmpeg_o", &lavc_avopt, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies additional option for ffmpeg decoders"}, + {"ffmpeg", &ff_options, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "FFMPEG specific options"}, { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; Modified: mplayerxp/libmpdemux/demux_audio.c =================================================================== --- mplayerxp/libmpdemux/demux_audio.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demux_audio.c 2010-01-13 15:42:47 UTC (rev 99) @@ -1766,9 +1766,14 @@ #include "../cfgparser.h" +static const config_t mp3_opts[] = { + { "hr-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables hight-resolution mp3 seeking" }, + { "nohr-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables hight-resolution mp3 seeking"}, + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} +}; + static const config_t audio_opts[] = { - { "hr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables hight-resolution mp3 seeking" }, - { "nohr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables hight-resolution mp3 seeking"}, + { "mp3", &mp3_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "MP3 related options" }, {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; Modified: mplayerxp/libmpdemux/demux_lavf.c =================================================================== --- mplayerxp/libmpdemux/demux_lavf.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demux_lavf.c 2010-01-13 15:42:47 UTC (rev 99) @@ -47,9 +47,14 @@ static char *opt_cryptokey; extern int ts_prog; +const config_t lavf_opts[] = { + {"format", &(opt_format), CONF_TYPE_STRING, 0, 0, 0, NULL, "forces format of lavf demuxer"}, + {"cryptokey", &(opt_cryptokey), CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies cryptokey for lavf demuxer"}, + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} +}; + const config_t lavfdopts_conf[] = { - {"lavf_format", &(opt_format), CONF_TYPE_STRING, 0, 0, 0, NULL, "forces format of lavf demuxer"}, - {"lavf_cryptokey", &(opt_cryptokey), CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies cryptokey for lavf demuxer"}, + {"lavf", &lavf_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "LAVF-demuxer related options"}, {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; Modified: mplayerxp/libmpdemux/demux_rawaudio.c =================================================================== --- mplayerxp/libmpdemux/demux_rawaudio.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demux_rawaudio.c 2010-01-13 15:42:47 UTC (rev 99) @@ -17,16 +17,16 @@ static int format = 0x1; // Raw PCM static const config_t demux_rawaudio_opts[] = { - { "on", &use_rawaudio, CONF_TYPE_FLAG, 0,0, 1, NULL }, - { "channels", &channels, CONF_TYPE_INT,CONF_RANGE,1,8, NULL }, - { "rate", &samplerate, CONF_TYPE_INT,CONF_RANGE,1000,8*48000, NULL }, - { "samplesize", &samplesize, CONF_TYPE_INT,CONF_RANGE,1,8, NULL }, - { "format", &format, CONF_TYPE_INT, CONF_MIN, 0 , 0, NULL }, + { "on", &use_rawaudio, CONF_TYPE_FLAG, 0,0, 1, NULL, "forces treating stream as raw-audio" }, + { "channels", &channels, CONF_TYPE_INT,CONF_RANGE,1,8, NULL, "specifies number of channels in raw-audio steram" }, + { "rate", &samplerate, CONF_TYPE_INT,CONF_RANGE,1000,8*48000, NULL, "specifies sample-rate of raw-audio steram" }, + { "samplesize", &samplesize, CONF_TYPE_INT,CONF_RANGE,1,8, NULL, "specifies sample-size of raw-audio steram" }, + { "format", &format, CONF_TYPE_INT, CONF_MIN, 0 , 0, NULL, "specifies compression-format of raw-audio stream" }, {NULL, NULL, 0, 0, 0, 0, NULL} }; static const config_t rawaudio_conf[] = { - { "rawaudio", &demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + { "rawaudio", &demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Raw-audio specific commands"}, { NULL,NULL, 0, 0, 0, 0, NULL} }; Modified: mplayerxp/libmpdemux/demux_rawvideo.c =================================================================== --- mplayerxp/libmpdemux/demux_rawvideo.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demux_rawvideo.c 2010-01-13 15:42:47 UTC (rev 99) @@ -23,34 +23,34 @@ static int imgsize=0; static const config_t demux_rawvideo_opts[] = { - { "on", &use_rawvideo, CONF_TYPE_FLAG, 0,0, 1, NULL }, + { "on", &use_rawvideo, CONF_TYPE_FLAG, 0,0, 1, NULL, "forces treating stream as raw-vidio" }, // size: - { "w", &width, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL }, - { "h", &height, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL }, - { "sqcif", &size_id, CONF_TYPE_FLAG,0,0,1, NULL }, - { "qcif", &size_id, CONF_TYPE_FLAG,0,0,2, NULL }, - { "cif", &size_id, CONF_TYPE_FLAG,0,0,3, NULL }, - { "4cif", &size_id, CONF_TYPE_FLAG,0,0,4, NULL }, - { "pal", &size_id, CONF_TYPE_FLAG,0,0,5, NULL }, - { "ntsc", &size_id, CONF_TYPE_FLAG,0,0,6, NULL }, - { "16cif", &size_id, CONF_TYPE_FLAG,0,0,7, NULL }, - { "sif", &size_id, CONF_TYPE_FLAG,0,0,8, NULL }, + { "w", &width, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL, "specifies image width of raw-video stream" }, + { "h", &height, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL, "specifies image height of raw-video stream" }, + { "sqcif", &size_id, CONF_TYPE_FLAG,0,0,1, NULL, "sets image size to SQCIF standard" }, + { "qcif", &size_id, CONF_TYPE_FLAG,0,0,2, NULL, "sets image size to QCIF standard" }, + { "cif", &size_id, CONF_TYPE_FLAG,0,0,3, NULL, "sets image size to CIF standard" }, + { "4cif", &size_id, CONF_TYPE_FLAG,0,0,4, NULL, "sets image size to 4CIF standard" }, + { "pal", &size_id, CONF_TYPE_FLAG,0,0,5, NULL, "sets image size to PAL standard" }, + { "ntsc", &size_id, CONF_TYPE_FLAG,0,0,6, NULL, "sets image size to NTSC standard" }, + { "16cif", &size_id, CONF_TYPE_FLAG,0,0,7, NULL, "sets image size to 16CIF standard" }, + { "sif", &size_id, CONF_TYPE_FLAG,0,0,8, NULL, "sets image size to SIF standard" }, // format: - { "format", &format, CONF_TYPE_INT, 0, 0 , 0, NULL }, - { "i420", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_I420, NULL }, - { "yv12", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YV12, NULL }, - { "yuy2", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YUY2, NULL }, - { "uyvy", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_UYVY, NULL }, - { "y8", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_Y8, NULL }, + { "format", &format, CONF_TYPE_INT, 0, 0 , 0, NULL, "specifies colorspace (fourcc) in hex or string constant" }, + { "i420", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_I420, NULL, "treats raw-video as I420 fourcc" }, + { "yv12", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YV12, NULL, "treats raw-video as YV12 fourcc" }, + { "yuy2", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YUY2, NULL, "treats raw-video as YUY2 fourcc" }, + { "uyvy", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_UYVY, NULL, "treats raw-video as UYVY fourcc" }, + { "y8", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_Y8, NULL, "treats raw-video as Y8 fourcc" }, // misc: - { "fps", &fps, CONF_TYPE_FLOAT,CONF_RANGE,0.001,1000, NULL }, - { "size", &imgsize, CONF_TYPE_INT, CONF_RANGE, 1 , 8192*8192*4, NULL }, + { "fps", &fps, CONF_TYPE_FLOAT,CONF_RANGE,0.001,1000, NULL, "specifies rate in frames per second of raw-video stream" }, + { "size", &imgsize, CONF_TYPE_INT, CONF_RANGE, 1 , 8192*8192*4, NULL, "specifies frame size in bytes" }, {NULL, NULL, 0, 0, 0, 0, NULL} }; static const config_t rawvideo_conf[] = { - { "rawvideo", &demux_rawvideo_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + { "rawvideo", &demux_rawvideo_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Raw-video specific options"}, { NULL,NULL, 0, 0, 0, 0, NULL} }; Modified: mplayerxp/libmpdemux/demux_viv.c =================================================================== --- mplayerxp/libmpdemux/demux_viv.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demux_viv.c 2010-01-13 15:42:47 UTC (rev 99) @@ -77,21 +77,21 @@ static config_t vivoopts_conf[]={ - {"version", &vivo_param_version, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"version", &vivo_param_version, CONF_TYPE_INT, 0, 0, 0, NULL, "forces version of VIVO stream"}, /* audio options */ - {"acodec", &vivo_param_acodec, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"abitrate", &vivo_param_abitrate, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"samplerate", &vivo_param_samplerate, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"bytesperblock", &vivo_param_bytesperblock, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"acodec", &vivo_param_acodec, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies audio-codec of VIVO stream"}, + {"abitrate", &vivo_param_abitrate, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies audio bitrate of VIVO stream"}, + {"samplerate", &vivo_param_samplerate, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies audio samplerate of VIVO stream"}, + {"bytesperblock", &vivo_param_bytesperblock, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies number of bytes per audio-block in VIVO stream"}, /* video options */ - {"width", &vivo_param_width, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"height", &vivo_param_height, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"vformat", &vivo_param_vformat, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"width", &vivo_param_width, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies width of video in VIVO stream" }, + {"height", &vivo_param_height, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies height of video in VIVO stream"}, + {"vformat", &vivo_param_vformat, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies video-codec of VIVO stream"}, {NULL, NULL, 0, 0, 0, 0, NULL} }; static config_t vivo_conf[] = { - { "vivo", &vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + { "vivo", &vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Vivo specific options"}, { NULL,NULL, 0, 0, 0, 0, NULL} }; Modified: mplayerxp/libmpdemux/demuxer.c =================================================================== --- mplayerxp/libmpdemux/demuxer.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demuxer.c 2010-01-13 15:42:47 UTC (rev 99) @@ -745,15 +745,20 @@ /******************* Options stuff **********************/ -static const config_t demuxer_opts[] = { +static const config_t demux_opts[] = { { "audiofile", &audio_stream, CONF_TYPE_STRING, 0, 0, 0, NULL, "forces reading of audio-stream from other file" }, { "subfile", &sub_stream, CONF_TYPE_STRING, 0, 0, 0, NULL, "forces reading of subtitles from other file" }, - { "demuxer", &demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces demxer by given number" }, - { "audio-demuxer", &audio_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces using of audio-demuxer" }, - { "sub-demuxer", &sub_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces using of subtitle-demuxer" }, + { "type", &demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces demuxer by given number" }, + { "audio", &audio_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces using of audio-demuxer" }, + { "sub", &sub_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces using of subtitle-demuxer" }, { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; +static const config_t demuxer_opts[] = { + { "demuxer", &demux_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Demuxer related options" }, + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} +}; + void demuxer_register_options(m_config_t* cfg) { m_config_register_options(cfg,demuxer_opts); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-14 15:50:12
|
Revision: 100 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=100&view=rev Author: nickols_k Date: 2010-01-14 15:50:02 +0000 (Thu, 14 Jan 2010) Log Message: ----------- use new syntax of command-line arguments Modified Paths: -------------- DOCS/mplayerxp.1 mplayerxp/cfg-mplayer.h mplayerxp/cfgparser.c mplayerxp/cfgparser.h mplayerxp/configure mplayerxp/input/input.c mplayerxp/libao2/ao_oss.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpdemux/demux_avi.c mplayerxp/libmpdemux/demuxer.c mplayerxp/mixer.c mplayerxp/mixer.h mplayerxp/mplayer.c mplayerxp/nls/help_mp-bg.h mplayerxp/nls/help_mp-cz.h mplayerxp/nls/help_mp-de.h mplayerxp/nls/help_mp-dk.h mplayerxp/nls/help_mp-el.h mplayerxp/nls/help_mp-en.h mplayerxp/nls/help_mp-es.h mplayerxp/nls/help_mp-fr.h mplayerxp/nls/help_mp-hu.h mplayerxp/nls/help_mp-it.h mplayerxp/nls/help_mp-ja.h mplayerxp/nls/help_mp-ko.h mplayerxp/nls/help_mp-mk.h mplayerxp/nls/help_mp-nb.h mplayerxp/nls/help_mp-nl.h mplayerxp/nls/help_mp-no.h mplayerxp/nls/help_mp-pl.h mplayerxp/nls/help_mp-pt.h mplayerxp/nls/help_mp-ro.h mplayerxp/nls/help_mp-ru.h mplayerxp/nls/help_mp-sk.h mplayerxp/nls/help_mp-sv.h mplayerxp/nls/help_mp-tr.h mplayerxp/nls/help_mp-uk.h mplayerxp/nls/help_mp-zh.h Modified: DOCS/mplayerxp.1 =================================================================== --- DOCS/mplayerxp.1 2010-01-13 15:42:47 UTC (rev 99) +++ DOCS/mplayerxp.1 2010-01-14 15:50:02 UTC (rev 100) @@ -39,7 +39,7 @@ .LP .SH "XP OPTIONS" .TP -.B \-xp\ <0-4> +.B \-core.xp\ <0-4> start MPlayerXP in XP mode. You should get smoothness (fixed FPS on the screen) with UP systems and decoding speedup with SMP. 0 : XP mode off @@ -49,7 +49,7 @@ .B [default] 4 : Decode video and audio and play audio in three different threads .TP -.B \-da_buffs +.B \-core.da_buffs Allows you specify number of buffers for decoding ahead. You can set it from 5 upto 64. 64 is default. (I recommend to use 10 buffers as minimum to avoid screen juddering and other negative factors). @@ -69,7 +69,7 @@ and video should be presented simultaneously at the same moment of time. From historical reasons, mplayerxp had two methods of A-V synchronizations: so-called -.B dapsync +.B sync.dap and so-called .B Arpi's method. But version @@ -99,12 +99,12 @@ when there exists drift between streams (due not a perfect hardware/drivers for example). .TP -.B \-pts +.B \-sync.pts use PTS based method of A/V synchronization. .I [default] in XP mode. .TP -.B \-force_pts_fix +.B \-sync.force_pts_fix force PTS fixing for "bad" (see PTS-based method explanation above) files. Useful as "cure" tool during stream remuxing (see .B "MUXING" @@ -117,65 +117,65 @@ .I Note3: It may cause problems after seeking in some cases. .TP -.B \-force_pts_fix2 +.B \-sync.force_pts_fix2 .I [default] -in XP mode for MPEG with -pts. +in XP mode for MPEG with -sync.pts. Difference from the previous method is that PTS are not changed, instead are the frame duration temporarily used until both audio and video PTS has restarted from 0. This method does not have the problem after seeking but it can not be used together -with -nopts and it is default off in that case. If -force_pts_fix is set than that -method will be used even if -force_pts_fix2 is set to. +with -sync.nopts and it is default off in that case. If -sync.force_pts_fix is set than that +method will be used even if -sync.force_pts_fix2 is set to. .TP -.B \-nopts +.B \-sync.nopts use Arpi's A/V sync method. .TP -.B \-nopts \-dapsync +.B \-sync.nopts \-sync.dap use alternative A/V sync method. Where is it useful? (is not available in .I XP mode) .TP -.B \-frame_reorder +.B \-sync.frame_reorder .I [default] in XP mode. Useful with -pts in XP mode on some MPEG where the frames are not stored in order. The frames pts is reordered as they are add to buffer. .TP -.B \-delay\ <secs> +.B \-sync.delay\ <secs> audio delay in seconds (may be +/- float value) .TP -.B \-fps\ <value> +.B \-sync.fps\ <value> force frame rate (if value is wrong in the header) (float number) (works with -.I \-nopts +.I \-sync.nopts key only) .TP -.B \-mc\ <seconds/5frame> +.B \-sync.mc\ <seconds/5frame> maximum sync correction per 5 frames (in seconds) (works with -.I \-nopts +.I \-sync.nopts key only) .TP -.B \-noframedrop +.B \-sync.noframedrop no frame dropping : every frame is played, audio and video may be out of sync .I [default] .TP -.B \-framedrop +.B \-sync.framedrop frame dropping : decodes all video frames, but skips displaying some ones (useful for slow cpu/systems) .TP -.B \-hardframedrop +.B \-sync.hardframedrop hardframe dropping : skips displaying and decoding of some frames .I Note: may produce image distortion with some codecs (useful for very slow cpu/systems) .TP -.B \-softsleep +.B \-sync.softsleep uses high quality software timers. Efficient as the RTC, doesn't need root, but requires more CPU. .TP -.B \-nortc +.B \-sync.nortc Disables using of /dev/rtc (real-time clock - high precision x86 chip) to compute PTS. .LP @@ -189,7 +189,7 @@ on slow and fast CPUs and on different chips but anyway bus mastering should povide speedup on any system. .TP -.B \-enable_bm +.B \-video.bm Enables using of bus mastering if it's available for given OS/videocard. .I Note: 1. @@ -210,7 +210,7 @@ .TP modprobe dhahelper .TP -mplayerxp -vo xvidix -xp -enable_bm -fs -zoom videoout.avi +mplayerxp -vo xvidix -core.xp -video.bm -video.fs -video.zoom videoout.avi .SS .I Another ways to speedup playback: In general, there are two ways to increase performance of playback - @@ -275,7 +275,7 @@ .I mplayerxp -ao help .TP -.B \-lircconf\ <config\ file> +.B \-input.lircconf\ <config\ file> specifies a configfile for LIRC (see http://www.lirc.org) if you don't like the default ~/.lircrc .TP .B \-v @@ -306,7 +306,7 @@ MSGT_NLS 0x00100000 .TP -.B \-benchmark +.B \-core.benchmark Performs benchmarking. Currently it displays 3 characteristics of movie playback: MIN benchmark, AVE benchmark and MAX benchmark. You can estimate possibility of usage of @@ -318,27 +318,27 @@ .I Note: If MIN BENCH is more than 100% then MPlayerXP will not help you! (Same as MPlayer). .TP -.B \-playlist <file> +.B \-play.list <file> play files according to this filelist (1 file/row or Winamp or ASX format). .TP -.B \-ss\ <time> +.B \-play.ss\ <time> seek to given time position. For example : -ss 56 seeks to 56 seconds -ss 01:10:00 seeks to 1 hour 10 min -ss 00:40:20.3 seeks to 40 minutes and 20.3 seconds .TP -.B \-sb\ <byte\ position> +.B \-play.sb\ <byte\ position> seek to byte position .TP -.B \-loop\ <num> +.B \-play.loop\ <num> loops movie playback <num> times. 0 means forever. .TP -.B \-conf\ <path\ to\ input.conf\ file> +.B \-input.conf\ <path\ to\ input.conf\ file> get input bindings from an alternative input.conf file (default : ~/.mplayerxp/input.conf). .TP -.B \-speed\ <factor> +.B \-video.speed\ <factor> Sets playback speed factor (default: 1.0) .TP @@ -368,43 +368,6 @@ See '-ac help' for FULL list ! .TP -.SH "AUDIO CODEC PARAMETERS" -Currently only one codec supports parameters: -.B -ac mp3 -You may pass to it the value which will change mp3 scaling -.B -ac mp3:scaler=<val> -here -.B <val> -may accept any value in floating=point form. -Example: -.I mplayerxp -ac mp3:scaler=0.1 - -.B Why we need that? -I've found out that many mp3 streams were badly -coded (without volume decreasing before coding). During decoding -of such streams all codecs produce extremely distorted output. -This parameter helps us to descrease harmonical distortions -during decoding of such streams. -I've tested the maximal values of the signal of such stream and they -were much large than -.B 32767 -(that is maximal value of 16-bit signed integer type) -that don't allow us to have the right form of signal since the codec -cuts out high part of the signal that produces harmonical distortions. -This coeffecient allows us to decrease the volume before converting -the signal from floating-point form (this is main form of signal -within of the codec) into integer form. Thus scaler has the similar -behaviour as volume control but works within of codec before -point where distortions may have place. -.B Important: -volume control (instead of scaler) won't help with such streams since -the signal is already distrorted within of the codec. -Indeed, this parameter can't make absolutedly crystal clear sound -from badly coded streams and they require more complex mathematical -convertions but it helps a lot and significandly improves quality -of such streams. - -.TP .B \-vfm <video\ codec\ family> force usage of a specific codec FAMILY, and FALLBACK to default if failed. For example: @@ -424,7 +387,7 @@ .B -vfm ffmpeg List of parameters: .TP -.B ffmpeg_debug=<value> +.B ffmpeg.debug=<value> display debugging information: 0: disabled 1: picture info @@ -444,13 +407,13 @@ lower QP are tinted greener. 0x4000: Visualize block types. .TP -.B ffmpeg_ec=<value> +.B ffmpeg.ec=<value> Set error concealment strategy: 1: Use strong deblock filter for damaged MBs. 2: iterative motion vector (MV) search (slow) 3: all (default) .TP -.B ffmpeg_er=<value> +.B ffmpeg.er=<value> Set error resilience strategy: 0: disabled 1: careful (Should work with broken encoders.) @@ -459,27 +422,27 @@ even for valid bitstreams.) 4: very aggressive .TP -.B ffmpeg_idct=<0\-99> +.B ffmpeg.idct=<0\-99> For best decoding quality use the same IDCT algorithm for decoding and encoding. This may come at a price in accuracy, though. .TP -.B ffmpeg_vstats +.B ffmpeg.vstats Prints some statistics and stores them in ./vstats_*.log. .TP -.B ffmpeg_vismv=<value> +.B ffmpeg.vismv=<value> Visualize motion vectors: 0: disabled 1: Visualize forward predicted MVs of P-frames. 2: Visualize forward predicted MVs of B-frames. 4: Visualize backward predicted MVs of B-frames. .TP -.B ffmpeg_sb=<number> (MPEG-2 only) +.B ffmpeg.sb=<number> (MPEG-2 only) Skip the given number of macroblock rows at the bottom. .TP -.B ffmpeg_st=<number> (MPEG-2 only) +.B ffmpeg.st=<number> (MPEG-2 only) Skip the given number of macroblock rows at the top. .TP -.B ffmpeg_lowres=<number>[,<w>] +.B ffmpeg.lowres=<number>[,<w>] Decode at lower resolutions. Low resolution decoding is not supported by all codecs, and it will often result in ugly artifacts. This is not a bug, but a side effect of not decoding at full resolution: @@ -494,7 +457,7 @@ video is major than or equal to .I <w>. .TP -.B ffmpeg_skiploopfilter=<skipvalue> (H.264 only) +.B ffmpeg.skiploopfilter=<skipvalue> (H.264 only) Skips the loop filter (AKA deblocking) during H.264 decoding. Since the filtered frame is supposed to be used as reference for decoding dependent frames this has a worse effect on quality @@ -513,20 +476,20 @@ nonkey: Skip all frames except keyframes. all: Skip all frames. .TP -.B ffmpeg_skipidct=<skipvalue> (MPEG-1/2 only) +.B ffmpeg.skipidct=<skipvalue> (MPEG-1/2 only) Skips the IDCT step. This degrades quality a lot of in almost all cases (see skiploopfilter for available skip values). .TP -.B ffmpeg_skipframe=<skipvalue> +.B ffmpeg.skipframe=<skipvalue> Skips decoding of frames completely. Big speedup, but jerky motion and sometimes bad artifacts (see skiploopfilter for available skip values). .TP -.B ffmpeg_threads=<1\-8> (MPEG-1/2 and H.264 only) +.B ffmpeg.threads=<1\-8> (MPEG-1/2 and H.264 only) number of threads to use for decoding (default: 1) .TP -.B ffmpeg_o=<key>=<value>[,<key>=<value>[,...]] +.B ffmpeg.o=<key>=<value>[,<key>=<value>[,...]] Pass AVOptions to libavcodec decoder. Note, a patch to make the o= unneeded and pass all unknown options through the AVOption system is welcome. @@ -562,31 +525,25 @@ .B \-include configfile specify config file to be parsed after the default .TP -.B \-z\ <0-9> +.B \-video.z\ <0-9> specifies compression level for PNG output 0 : no compression 9 : max compression .TP -.B \-nodshow -disables usage of DirectShow video codecs -.TP -.B \-noxv (SDL only) +.B \-video.noxv (SDL only) disable XVideo hardware acceleration .TP -.B \-forcexv (SDL only) +.B \-video.forcexv (SDL only) force using XVideo hardware acceleration .TP -.B \-forcegl (SDL only) +.B \-video.forcegl (SDL only) force using OpenGL. (May help with cards which lack overlay/scaler but have powerful 3D-engine. Example: some SGI cards) .TP -.B \-config <config\ file> -specifies where to search for config file -.TP -.B \-frames\ number +.B \-play.frames\ number MPlayerXP plays <number> frames, then quits. .TP -.B \-cache\ <kbytes> +.B \-core.cache\ <kbytes> This option specifies how much memory to use when precaching a file/URL. Especially useful on slow media with variable speed of data transfer (sharped CDROM for example or network). Default is 1MB. @@ -643,19 +600,19 @@ .B \-csslib\ <path to libcss.so> This option is useful only if libcss.so can't be autodetected .TP -.B \-alang\ <audio\ stream\ language> +.B \-audio.lang\ <audio\ stream\ language> Used when playing DVD disks. Expects a two-letter country code(s) as parameter, and always tries to playback audio streams those language -matches the given code. For example: -alang hu,en will always try to play +matches the given code. For example: -audio.lang=hu,en will always try to play hungarian or if it's non-existant then english audio streams if there are any. .TP -.B \-slang\ <subtitle\ language> +.B \-sub.lang\ <subtitle\ language> See the -sid option, but this one needs a two-letter parameter, a country code. -Like: -slang hu,en will always select hungarian or if it's non existant then +Like: -sub.lang=hu,en will always select hungarian or if it's non existant then english subtitles, if there are any. For the list of available subtitles, use with the -v switch and look at the output. .TP -.B \-spuaa <mode> (OSD only) +.B \-osd.spuaa <mode> (OSD only) Antialiasing/\:scaling mode for DVD/\:VOBsub. A value of 16 may be added to <mode> in order to force scaling even when original and scaled frame size already match. @@ -667,19 +624,19 @@ 3 : bilinear (default, fast and not too bad) 4 : uses swscaler gaussian blur (looks very good) .TP -.B \-spualign <-1\-2> (OSD only) +.B \-osd.spualign <-1\-2> (OSD only) Specify how SPU (DVD/\:VOBsub) subtitles should be aligned. -1 : original position 0 : Align at top (original behavior, default). 1 : Align at center. 2 : Align at bottom. .TP -.B \-spugauss <0.0\-3.0> (OSD only) -Variance parameter of gaussian used by \-spuaa 4. +.B \-osd.spugauss <0.0\-3.0> (OSD only) +Variance parameter of gaussian used by \-osd.spuaa=4. Higher means more blur (default: 1.0). .TP -.B \-subcc +.B \-sub.cc Display DVD Closed Caption (CC) subtitles. These are .B not @@ -690,90 +647,90 @@ .LP .SH "FRAME'S GEOMETRY CONTROL" -.B \-flip +.B \-video.flip flip image (useful for example for old Indeo codecs). Supported only(?) by the 'sdl' and 'x11' outputs. .TP -.B \-aspect <ratio> +.B \-video.aspect <ratio> set aspect ratio of movies. It's autodetected on MPEG files, and can't be autodetected on AVI files. Examples: - -aspect 4:3 or -aspect 1.3333 - -aspect 16:9 or -aspect 1.7777 + -video.aspect=4:3 or -video.aspect=1.3333 + -video.aspect=16:9 or -video.aspect=1.7777 .TP -.B \-monitorpixelaspect <ratio> +.B \-video.monitorpixelaspect <ratio> Set the aspect of a single pixel of your monitor or TV screen (default: 1). A value of 1 means square pixels (correct for almost all LCDs). Examples: - -monitorpixelaspect 4:3 or 1.3333 + -video.monitorpixelaspect=4:3 or 1.3333 .TP -.B \-x\ <x> +.B \-video.x\ <x> scale image to x width (if driver supports) .TP -.B \-y\ <y> +.B \-video.y\ <y> scale image to y height (if driver supports) .TP -.B \-xy\ <factor> +.B \-video.xy\ <factor> scale image by <factor> .TP .LP .SH "SCREEN CONTROL" .TP -.B \-display <name> +.B \-x.display <name> specify the hostname and display number of the X server you want -to display on. For example : -display xtest.localdomain:0 +to display on. For example : -x.display=xtest.localdomain:0 .TP -.B \-xineramascreen <screen number> +.B \-x.xinerama <screen number> in Xinerama configurations (i.e. a single desktop that spans across multiple displays) this option tells MPlayerXP which screen to display movie on. Range 0 - ... .TP -.B \-wid\ <window\ id> +.B \-x.wid\ <window\ id> This tells MPlayerXP to use a X11 window, which is useful to embed MPlayerXP in a browser (with the plugger extension for instance) .TP -.B \-fsmode\ mode +.B \-x.rootwin +play movie in the root window (desktop background) instead of opening +a new one. Works only with the xv and xmga drivers. +.TP +.B \-video.fsmode\ mode This option workarounds some problems when using specific windowmanagers and fullscreen mode. If you experience fullscreen problems, try changing this value between 0 and 7. - -fsmode 0 new method - -fsmode 1 ICCCWM patch - (for KDE2/icewm) - -fsmode 2 old method - -fsmode 3 ICCCWM patch - plus Motif method + -video.fsmode=0 new method + -video.fsmode=1 ICCCWM patch + (for KDE2/icewm) + -video.fsmode=2 old method + -video.fsmode=3 ICCCWM patch + plus Motif method .TP -.B \-fs +.B \-video.fs fullscreen playing (centers movie, makes black bands around it and uses SW scaler if there is no HW one available). Toggle it with the 'f' key (not all video outputs support it). .TP -.B \-vm +.B \-video.vm try to change to a different video mode. dga2, x11 (XF86VidMode) and sdl output drivers support it. .TP -.B \-zoom +.B \-video.zoom Keeps aspect ratio on the screen .I [default] .TP -.B \-bpp\ <depth> +.B \-video.bpp\ <depth> use different color depth than autodetect. Not all -vo drivers support it (fbdev, dga2, svga, vesa). .TP -.B \-rootwin -play movie in the root window (desktop background) instead of opening -a new one. Works only with the xv and xmga drivers. -.TP -.B \-screenw\ <pixels> +.B \-video.screenw\ <pixels> If you use an output driver which can't know the resolution of the screen (fbdev/x11 and/or TVout) this is where you can specify the horizontal resolution. .TP -.B \-screenh\ <pixels> +.B \-video.screenh\ <pixels> If you use an output driver which can't know the resolution of the screen (fbdev/x11 and/or TVout) this is where you can specify the vertical resolution. @@ -837,7 +794,7 @@ Listed below options are implemented on software level and don't required special hardware. .TP -.B \-autoq\ <quality> +.B \-core.autoq\ <quality> dynamically changes the level of postprocess, depending on spare CPU time available. The number you specify will be the maximum level used. Usually you can use some big number. You may not use together with -vf pp but it's ok with @@ -845,12 +802,12 @@ .I Note: In XP mode it depends on tile of free buffers for decoding ahead. .I Example: --autoq 100 -vf pp=de +-core.autoq 100 -vf pp=de .I Note: If you have not enough power CPU then it would be reasonable to limit --autoq with 1 or 2 only. +-core.autoq with 1 or 2 only. .TP -.B \-sws\ <software\ scaler\ type> +.B \-video.sws\ <software\ scaler\ type> this option sets the quality (and speed, respectively) of the software scaler, with the -zoom option. For example with x11 or other outputs which lack hardware scaler. Possible settings are: @@ -874,27 +831,27 @@ .I Note: Currently only dshow and divx4linux codecs support this feature. .TP -.B \-brightness +.B \-video.eq.brightness Corrects brightness of video image (from black screen). .TP -.B \-saturation +.B \-video.eq.saturation Corrects satuartion of video image (from grayscaled image). .TP -.B \-contrast +.B \-video.eq.contrast Corrects contrast of video image (from black screen). .TP -.B \-hue +.B \-video.eq.hue Corrects hues of video image. .TP -.B \-red_intensity +.B \-video.eq.red .TP -.B \-green_intensity +.B \-video.eq.green .TP -.B \-blue_intensity +.B \-video.eq.blue Correct RGB intensity of video image. -.B Example: -mplayerxp -brightness 300 -contrast -237 -red_intensity 57 filename +.B Example: +mplayerxp -video.eq.brightness=300 -video.eq.contrast=-237 -video.eq.red=57 filename .SS VIDEO POSTPROCESSING .I Note: @@ -1548,27 +1505,20 @@ .B VIDIX provides real direct rendering into video memory. .TP -.B \-vaa_dr -Enables direct rendering (by default) -.TP -.B \-vaa_nodr -Disables direct rendering. It's useful if MPlayerXP has -some not fixed bugs only. -.TP -.B \-nodouble +.B \-video.nodouble disables doublebuffering. With the DGA driver this also disables OSD support but yields some speed gain. .TP -.B \-double +.B \-video.double enables doublebuffering. Double buffering is technology when video output is performed into separate video buffers. It supresses OSD flickering. When you specify -.I -xp +.I -core.xp key it forces multibuffering mode and uses all available (video) memory to enable .I decoding ahead .TP -.B \-vsync +.B \-video.vsync forces video hardware to wait VSYNC signal before buffer switching in doublebuffered mode. This key is useful only to supressing screen juddering during buffer switching. @@ -1576,13 +1526,13 @@ .LP .SH "OSD CONTROL" .TP -.B \-font\ <path\ to\ font.desc\ file> +.B \-osd.font\ <path\ to\ font.desc\ file> search for the OSD/SUB fonts in an alternative directory (default : ~/.mplayerxp/font/font.desc). For example: - -font ~/.mplayerxp/arial-14/font.desc + -osd.font ~/.mplayerxp/arial-14/font.desc .TP -.B \-ffactor\ <number> +.B \-osd.ffactor\ <number> resample alphamap of the font. Can be: 0 plain white fonts @@ -1590,67 +1540,64 @@ 1 narrow black outline 10 bold black outline .TP -.B \-sub\ <subtitle\ file> +.B \-sub.file\ <subtitle\ file> use/display this subtitle file .TP -.B \-subfps\ <rate> +.B \-sub.fps\ <rate> specify frame/sec rate of subtitle file (float number) (ONLY for frame-based SUB files, i.e. NOT MicroDVD format!) (default: the same fps as the movie) .TP -.B \-subdelay\ <sec> +.B \-sub.delay\ <sec> delays subtitles by <sec> seconds. Can be negative. .TP -.B \-vobsub\ <vobsub\ file\ without\ extention> +.B \-sub.vob\ <vobsub\ file\ without\ extention> specify the VobSub files that are to be used for subtitle. This is the full pathname without extensions, i.e. without the ".idx", ".ifo" or ".sub". .TP -.B \-vobsubid\ <vobsub\ subtitle\ id> +.B \-sub.vobid\ <vobsub\ subtitle\ id> specify the VobSub subtitle id. Valid values range from 0 to 31. .TP -.B \-osdlevel\ <level> +.B \-osd.level\ <level> specifies which mode the OSD should start in (0 : none, 1 : seek, 2: seek+timer) (default = 2) .TP -.B \-subcp\ codepage +.B \-sub.cp\ codepage If your system supports iconv(3), you can use this option to specify codepage of the subtitle. Examples: - -subcp latin2 - -subcp cp1250 + -sub.cp=latin2 + -sub.cp=cp1250 .TP -.B \-unicode +.B \-sub.unicode tells MPlayerXP to handle the subtitle file as UNICODE. -Contrary: -nounicode +Contrary: -sub.nounicode .TP -.B \-utf8 +.B \-sub.utf8 tells MPlayerXP to handle the subtitle file as UTF8. .IP .SH SOUND CONTROL .TP -.B \-mixer\ <device> +.B \-audio.mixer\ <device> this option will tell MPlayerXP to use a different device for mixing than /dev/mixer. .TP -.B \-master -obsoleted option, use Software audio mixer plugin instead (see DOCS). -.TP -.B \-nosound +.B \-audio.off don't play sound .TP -.B \-abs\ <bytes> +.B \-audio.bs\ <bytes> sound card audio buffer size (in bytes, default: measuring) .TP -.B \-stereo mode +.B \-audio.stereo mode select type of MP2/MP3 stereo output. Stereo 0 Left channel 1 Right channel 2 .TP -.B \-channels n +.B \-audio.channels n select number of audio output channels to be used Stereo 2 @@ -1659,7 +1606,7 @@ Currently this option is only honoured for AC3 audio. .TP -.B \-srate <Hz> +.B \-audio.rate <Hz> specifies Hz to playback audio on. Has effect on playback speed! .LP @@ -1749,38 +1696,38 @@ .B oss://<@device>#<channels>,<samplerate>,<sampleformat> This option enables the OSS grabbing feature of MPlayerXP. .TP -.B -shuffle +.B -play.shuffle Play files in random order. .TP -.B -ipv4 (network only) +.B -net.ipv4 (network only) will force mplayerxp to use IPv4 protocol over network. That is default settings. .TP -.B -ipv6 (network only) +.B -net.ipv6 (network only) will force mplayerxp to use IPv6 protocol over network. .TP -.B -ipv4-only-proxy (network only) +.B -net.ipv4-only-proxy (network only) Skip the proxy for IPv6 addresses. It will still be used for IPv4 connections. .TP -.B -cookies (network only) +.B -net.cookies (network only) Send cookies when making HTTP requests. .TP -.B -cookies-file <filename> (network only) +.B -net.cookies-file <filename> (network only) Read HTTP cookies from <filename> (default: ~/.mozilla/ and ~/.netscape/) and skip reading from default locations. The file is assumed to be in Netscape format. .TP -.B -netpass <password> (network only) +.B -net.pass <password> (network only) Specify password for HTTP authentication. .TP -.B -netuser <username> (network only) +.B -net.user <username> (network only) Specify username for HTTP authentication. .TP -.B -net-user-agent <string> +.B -net.user-agent <string> Use <string> as user agent for HTTP streaming. .TP -.B -netbandwidth <value> (network only) +.B -net.bandwidth <value> (network only) Specify the maximum bandwidth for network streaming (for servers that are able to send content in different bitrates). Useful if you want to watch live streamed media behind a slow connection. @@ -1789,33 +1736,33 @@ .LP .SH "MOVIE PARSER OR DEMUXING" .TP -.B \-aid\ <id> +.B \-audio.id\ <id> select audio channel [MPG: 0-31 AVI: 1-99 ASF: 0-127 VOB: 128-...] .TP -.B \-vid\ <id> +.B \-video.id\ <id> select video channel [MPG: 0-15 AVI: -- ] .TP -.B \-sid\ <id> +.B \-sub.id\ <id> Turns on DVD subtitle displaying. Also, you MUST specify a number which corresponds to a DVD subtitle language (0-31). For the list of available subtitles, use with the -v switch and look at the output. .TP -.B \-ni +.B \-avi.ni force usage of non-interleaved AVI parser (fixes playing of some bad AVI files) .TP -.B \-idx +.B \-avi.idx rebuilds INDEX of the AVI, thus allowing seeking. Useful with broken/incomplete downloads, or badly created AVIs. .TP -.B \-noidx +.B \-avi.noidx disregards INDEX of the AVI. Useful for files with broken index (desyncs, etc). Seeking will NOT be possible. You can fix the index permanently with .I MUXING , see below. .TP -.B \-forceidx +.B \-avi.forceidx force rebuilding of INDEX. Useful for files with broken index (desyncs, etc). Seeking will be possible. You can fix the index permanently with .I MUXING @@ -1827,16 +1774,16 @@ .I Introduction: This method was designed network as sucker and as facility to dump DVD into signle files but you may use it as "cure" tool in some cases (see -.B \-force_pts_fix +.B \-sync.force_pts_fix for detail). .I Note: Also you may specify -.B -ss +.B -play.ss and -.B -frames +.B -play.frames options to proceed only part of source stream. .TP -.B \-dump @<type>:<sname/subtype> +.B \-core.dump @<type>:<sname/subtype> specifies dump type and stream name .SS Dumping types .TP @@ -1850,16 +1797,16 @@ dumps raw stream into file. You may specify which part of movie should be dumped. Examples: -.I -dump @raw:audio +.I -core.dump @raw:audio - will dump audio data only in raw format into a_dump.raw -.I -dump @raw:video +.I -core.dump @raw:video - will dump video data only in raw format into v_dump.raw -.I -dump @raw:sub +.I -core.dump @raw:sub - will dump subtitles only in raw format into s_dump.raw -.I -dump @raw:filename.ext +.I -core.dump @raw:filename.ext - will dump all streams in raw format into filename.ext .TP @@ -1868,28 +1815,28 @@ into the stream of MPXPAV64 format. (Most compact A-V container today) Examples: -.I -dump @mpxp:filename.ext +.I -core.dump @mpxp:filename.ext - will dump all streams in MPXPAV64 format into filename.ext -.I -dump @mpxp:audio +.I -core.dump @mpxp:audio - will dump audio data only in MPXPAV64 format into a_dump.raw -.I -dump @mpxp:video +.I -core.dump @mpxp:video - will dump video data only in MPXPAV64 format into v_dump.raw -.I -dump @mpxp:sub +.I -core.dump @mpxp:sub - will dump subtitles only in MPXPAV64 format into s_dump.raw .TP -.B \-lavf +.B lavf remulitplexes any stream which can be recognized by demuxer into any stream which is supported by libavformat library. Examples: -.I -dump @lavf:avi +.I -core.dump @lavf:avi - will dump all streams in AVI format into avs_dump.avi -.I -dump @lavf:asf +.I -core.dump @lavf:asf - will dump all streams in ASF format into avs_dump.asf .I Note: @@ -2118,12 +2065,6 @@ .B Quickstart Video CD playing from cd_image mplayerxp vcdnav://@/tmp/cd_image.iso .TP -.B Play track 2 of Video CD only from CD image -mplayerxp vcd://@/tmp/cd_image.iso#2 -.TP -.B Play track 3 of Video CD only -mplayerxp vcd:///3 -.TP .B Stream from HTTP mplayerxp http://mplayerhq.hu/example.avi .TP Modified: mplayerxp/cfg-mplayer.h =================================================================== --- mplayerxp/cfg-mplayer.h 2010-01-13 15:42:47 UTC (rev 99) +++ mplayerxp/cfg-mplayer.h 2010-01-14 15:50:02 UTC (rev 100) @@ -22,10 +22,6 @@ extern int fakemono; // defined in dec_audio.c #endif -#ifdef HAVE_LIRC -extern char *lirc_configfile; -#endif - extern int vo_doublebuffering; extern int vo_vsync; extern int vo_fsmode; @@ -77,7 +73,6 @@ extern int enable_xp; extern int enable_gomp; -extern int enable_ffslices; extern int enable_xp_audio; extern unsigned vo_da_buffs; extern unsigned vo_use_bm; @@ -89,6 +84,13 @@ extern int x86_3dnow2; extern int x86_sse; extern int x86_sse2; +extern int x86_sse3; +extern int x86_ssse3; +extern int x86_sse41; +extern int x86_sse42; +extern int x86_aes; +extern int x86_avx; +extern int x86_fma; #endif extern float playbackspeed_factor; @@ -129,39 +131,75 @@ * by Folke */ -static const config_t mplayer_opts[]={ - /* name, pointer, type, flags, min, max, help */ - {"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL, ""}, /* this don't need anymore to be the first!!! */ +static const config_t xpcore_config[]={ + {"xp", &enable_xp, CONF_TYPE_INT, CONF_RANGE, 0, 4, NULL, "starts MPlayerXP in multi-thread and multi-buffer XP mode"}, + {"noxp", &enable_xp, CONF_TYPE_FLAG, 0, 1, 0, NULL, "starts MPlayerXP in single-thread mode"}, + {"dump", &stream_dump, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies dump type and name for the dump of stream"}, + {"gomp", &enable_gomp, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables usage of OpenMP extensions"}, + {"nogomp", &enable_gomp, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables usage of OpenMP extensions"}, + {"da_buffs", &vo_da_buffs, CONF_TYPE_INT, CONF_RANGE, 4, 1024, NULL, "specifies number of buffers for decoding-ahead in XP mode"}, + {"double", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables double-buffering for single-thread decoding"}, + {"nodouble", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 1, 0, NULL, "enables single-buffer for single-thread decoding"}, + {"cache", &stream_cache_size, CONF_TYPE_INT, CONF_RANGE, 4, 65536, NULL,"specifies amount of memory for precaching a file/URL"}, + {"nocache", &stream_cache_size, CONF_TYPE_FLAG, 0, 1, 0, NULL,"disables precaching a file/URL"}, + {"autoq", &auto_quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL, "dynamically changes the level of postprocessing depending on spare CPU time available"}, + {"benchmark", &benchmark, CONF_TYPE_FLAG, 0, 0, 1, NULL, "performs benchmarking to estimate performance of MPlayerXP"}, + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; -//---------------------- libao/libvo/mplayer options ------------------------ - {"vo", &video_driver, CONF_TYPE_STRING, 0, 0, 0, NULL, "select video output driver and optinaly device"}, - {"ao", &audio_driver, CONF_TYPE_STRING, 0, 0, 0, NULL, "select audio output driver and optinaly device"}, - {"mixer", &mixer_device, CONF_TYPE_STRING, 0, 0, 0, NULL, "select audio-mixer device"}, - {"channels", &audio_output_channels, CONF_TYPE_INT, CONF_RANGE, 2, 8, NULL, "select number of audio output channels to be used"}, -#ifdef HAVE_X11 - {"display", &mDisplayName, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the hostname and display number of the X server"}, +#ifdef HAVE_STREAMING +static const config_t net_config[]={ + {"ipv4", &network_prefer_ipv4, CONF_TYPE_FLAG, 0, 0, 1, NULL, "forces mplayerxp to use IPv4 protocol over network"}, +#ifdef HAVE_AF_INET6 + {"ipv6", &network_prefer_ipv4, CONF_TYPE_FLAG, 0, 1, 0, NULL, "forces mplayerxp to use IPv6 protocol over network"}, +#else + {"ipv6", "MPlayerXP was compiled without IPv6 support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, +#endif /* HAVE_AF_INET6 */ + {"ipv4-only-proxy", &network_ipv4_only_proxy, CONF_TYPE_FLAG, 0, 0, 1, NULL, "skip the proxy for IPv6 addresses"}, + {"user", &network_username, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies username for HTTP authentication"}, + {"passwd", &network_password, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies password for HTTP authentication"}, + {"bandwidth", &network_bandwidth, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL, "specifies the maximum bandwidth for network streaming"}, + {"user-agent", &network_useragent, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies string as user agent for HTTP streaming"}, + {"cookies", &network_cookies_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL,"send cookies when making HTTP requests"}, + {"cookies-file", &cookies_file, CONF_TYPE_STRING, 0, 0, 0, NULL,"Read HTTP cookies from file"}, + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; #endif - {"osdlevel", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 2 , NULL, "specifies initial mode of the OSD"}, - {"msgfilter", &mp_msg_filter, CONF_TYPE_INT, CONF_RANGE, 0, 0xFFFFFFFF, NULL, "specifies filter for verbosed messages"}, - {"vobsub", &vobsub_name, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the VobSub files that are to be used for subtitle"}, - {"vobsubid", &vobsub_id, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL, "specifies the VobSub subtitle id"}, -#ifdef USE_SUB - {"sub", &sub_name, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the subtitle file"}, -#ifdef USE_ICONV - {"subcp", &sub_cp, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies codepage of subtitles"}, -#endif - {"subdelay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL, "delays subtitles by given number of seconds"}, - {"subfps", &sub_fps, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL, "specifies frame/sec rate of subtitle file"}, - {"noautosub", &sub_auto, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disable autodetection of vobsub for textsubs if vobsub found"}, - {"unicode", &sub_unicode, CONF_TYPE_FLAG, 0, 0, 1, NULL, "tells MPlayerXP to handle the subtitle file as UNICODE"}, - {"nounicode", &sub_unicode, CONF_TYPE_FLAG, 0, 1, 0, NULL, "tells MPlayerXP to handle the subtitle file as non-UNICODE"}, - {"utf8", &sub_utf8, CONF_TYPE_FLAG, 0, 0, 1, NULL, "tells MPlayerXP to handle the subtitle file as UTF8"}, - {"noutf8", &sub_utf8, CONF_TYPE_FLAG, 0, 1, 0, NULL, "tells MPlayerXP to handle the subtitle file as non-UTF8"}, - {"subpos",&sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL, "specifies vertical shift of subtitles"}, +#if defined( ARCH_X86 ) || defined(ARCH_X86_64) +static const config_t cpu_config[]={ + {"mmx", &x86_mmx, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of MMX extensions of CPU"}, + {"nommx", &x86_mmx, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of MMX extensions of CPU"}, + {"mmx2", &x86_mmx2, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of MMX2 extensions of CPU"}, + {"nommx2", &x86_mmx2, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of MMX2 extensions of CPU"}, + {"3dnow", &x86_3dnow, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of 3DNow! extensions of CPU"}, + {"no3dnow", &x86_3dnow, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of 3DNow! extensions of CPU"}, + {"3dnow2", &x86_3dnow2, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of 3DNow-2! extensions of CPU"}, + {"no3dnow2", &x86_3dnow2, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of 3DNow-2! extensions of CPU"}, + {"sse", &x86_sse, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of SSE extensions of CPU"}, + {"nosse", &x86_sse, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of SSE extensions of CPU"}, + {"sse2", &x86_sse2, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of SSE2 extensions of CPU"}, + {"nosse2", &x86_sse2, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of SSE2 extensions of CPU"}, + {"sse3", &x86_sse3, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of SSE3 extensions of CPU"}, + {"nosse3", &x86_sse3, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of SSE3 extensions of CPU"}, + {"ssse3", &x86_ssse3, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of SSSE3 extensions of CPU"}, + {"nossse3", &x86_ssse3, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of SSSE3 extensions of CPU"}, + {"sse41", &x86_sse41, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of SSE41 extensions of CPU"}, + {"nosse41", &x86_sse41, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of SSE41 extensions of CPU"}, + {"sse42", &x86_sse42, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of SSE42 extensions of CPU"}, + {"nosse42", &x86_sse42, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of SSE42 extensions of CPU"}, + {"aes", &x86_aes, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of AES extensions of CPU"}, + {"noaes", &x86_aes, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of AES extensions of CPU"}, + {"avx", &x86_avx, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of AVX extensions of CPU"}, + {"noavx", &x86_avx, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of AVX extensions of CPU"}, + {"fma", &x86_fma, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of FMA extensions of CPU"}, + {"nofma", &x86_fma, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of FMA extensions of CPU"}, + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; #endif - {"subcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enable DVD Closed Caption (CC) subtitles"}, - {"nosubcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disable DVD Closed Caption (CC) subtitles"}, + +static const config_t osd_config[]={ + {"level", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 2 , NULL, "specifies initial mode of the OSD"}, #ifdef USE_OSD {"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies an alternative directory of font.desc location"}, {"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0, NULL, "specifies resampling of alphamap of the font"}, @@ -169,21 +207,31 @@ {"spuaa", &spu_aamode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL, "specifies antialiasing/scaling mode for SPU"}, {"spugauss", &spu_gaussvar, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 3.0, NULL, "specifies variance parameter of gaussian for -spuaa"}, #endif - {"sb", &seek_to_byte, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL, "seek to given byte position before playback"}, - {"ss", &seek_to_sec, CONF_TYPE_STRING, CONF_MIN, 0, 0, NULL, "seek to given time position before playback"}, - {"noloop", &loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL, "disable loop of playback"}, - {"loop", &loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL, "loops movie playback given number of times. 0 means forever"}, - {"abs", &ao_data.buffersize, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL, "specifies sound card audio buffer size in bytes. Default: measuring"}, + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; + +static const config_t veq_config[]={ + {"brightness",&vo_gamma_brightness, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies brightness-level for output image"}, + {"saturation",&vo_gamma_saturation, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies saturation-level for output image"}, + {"contrast",&vo_gamma_contrast, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies contrast-level for output image"}, + {"hue",&vo_gamma_hue, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies hue of gamma-correction for output image"}, + {"red",&vo_gamma_red_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of red component for output image"}, + {"green",&vo_gamma_green_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of green component for output image"}, + {"blue",&vo_gamma_blue_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of blue component for output image"}, + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; + + +static const config_t avsync_config[]={ {"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL, "specifies delay in seconds audio stream relatively video"}, - {"framedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables frame-dropping on slow systems: decodes all video frames, but skips displaying some ones"}, /*UD*/ {"hardframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 2, NULL, "enables hard frame-dropping on slow systems: skips displaying and decoding of some frames"}, {"noframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables frame dropping"}, {"pts", &av_sync_pts, CONF_TYPE_FLAG, 0, 0, 1, NULL, "use PTS-based method of A/V synchronization"}, {"nopts", &av_sync_pts, CONF_TYPE_FLAG, 0, 1, 0, NULL, "use BPS-based method of A/V synchronization"}, - {"dapsync", &dapsync, CONF_TYPE_FLAG, 0, 0, 1, NULL, "use alternative method of A/V synchronization"}, - {"nodapsync", &dapsync, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disable alternative method of A/V synchronization"}, + {"dap", &dapsync, CONF_TYPE_FLAG, 0, 0, 1, NULL, "use alternative method of A/V synchronization"}, + {"nodap", &dapsync, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disable alternative method of A/V synchronization"}, {"force_pts_fix", &av_force_pts_fix, CONF_TYPE_FLAG, 0, 0, 1, NULL, "force PTS fixing for \"bad\" files"}, {"noforce_pts_fix", &av_force_pts_fix, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disable PTS fixing for \"bad\" files"}, {"force_pts_fix2", &av_force_pts_fix2, CONF_TYPE_FLAG, 0, 0, 1, NULL, "force PTS fixing for \"bad\" files without PTS changing"}, @@ -195,20 +243,67 @@ {"rtc", &nortc, CONF_TYPE_FLAG, 0, 1, 0, NULL, "enables using of /dev/rtc (real-time clock chip) to compute PTS"}, {"nortc", &nortc, CONF_TYPE_FLAG, 0, 0, 1, NULL, "disables using of /dev/rtc (real-time clock chip) to compute PTS"}, #endif + {"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10, NULL, "maximum sync correction per 5 frames (in seconds)"}, + {"fps", &force_fps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0, NULL, "forces frame rate (if value is wrong in the header)"}, + {"vsync", &vo_vsync, CONF_TYPE_FLAG, 0, 0, 1, NULL, "forces video hardware to wait VSYNC signal before frame switching"}, + {"novsync", &vo_vsync, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables video hardware to wait VSYNC signal before frame switching"}, + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; - {"autoq", &auto_quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL, "dynamically changes the level of postprocessing depending on spare CPU time available"}, - {"benchmark", &benchmark, CONF_TYPE_FLAG, 0, 0, 1, NULL, "performs benchmarking to estimate performance of MPlayerXP"}, - - {"dump", &stream_dump, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies dump type and name for the dump of stream"}, -#ifdef HAVE_PNG - {"z", &z_compression, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL, "specifies compression level for PNG output"}, +static const config_t subtitle_config[]={ + {"vob", &vobsub_name, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the VobSub files that are to be used for subtitle"}, + {"vobid", &vobsub_id, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL, "specifies the VobSub subtitle id"}, +#ifdef USE_SUB + {"file", &sub_name, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the subtitle file"}, +#ifdef USE_ICONV + {"cp", &sub_cp, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies codepage of subtitles"}, +#endif + {"delay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL, "delays subtitles by given number of seconds"}, + {"fps", &sub_fps, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL, "specifies frame/sec rate of subtitle file"}, + {"noauto", &sub_auto, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disable autodetection of vobsub for textsubs if vobsub found"}, + {"unicode", &sub_unicode, CONF_TYPE_FLAG, 0, 0, 1, NULL, "tells MPlayerXP to handle the subtitle file as UNICODE"}, + {"nounicode", &sub_unicode, CONF_TYPE_FLAG, 0, 1, 0, NULL, "tells MPlayerXP to handle the subtitle file as non-UNICODE"}, + {"utf8", &sub_utf8, CONF_TYPE_FLAG, 0, 0, 1, NULL, "tells MPlayerXP to handle the subtitle file as UTF8"}, + {"noutf8", &sub_utf8, CONF_TYPE_FLAG, 0, 1, 0, NULL, "tells MPlayerXP to handle the subtitle file as non-UTF8"}, + {"pos",&sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL, "specifies vertical shift of subtitles"}, #endif -#ifdef HAVE_SDL - {"noxv", &sdl_noxv, CONF_TYPE_FLAG, 0, 0, 1, NULL, "disable XVideo hardware acceleration for SDL"}, - {"forcexv", &sdl_forcexv, CONF_TYPE_FLAG, 0, 0, 1, NULL, "force XVideo hardware acceleration for SDL"}, - {"forcegl", &sdl_forcegl, CONF_TYPE_FLAG, 0, 0, 1, NULL, "force OpenGL hardware acceleration for SDL"}, -#endif + {"cc", &subcc_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enable DVD Closed Caption (CC) subtitles"}, + {"nocc", &subcc_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disable DVD Closed Caption (CC) subtitles"}, + {"id", &dvdsub_id, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL, "selects subtitle channel"}, + {"lang", &dvdsub_lang, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies language of DVD-subtitle stream as two-letter country code(s)"}, + {"ifo", &spudec_ifo, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies .ifo file for DVD subtitles"}, + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; + +#ifdef HAVE_X11 +static const config_t x11_config[]={ + {"display", &mDisplayName, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the hostname and display number of the X server"}, + {"wid", &WinID, CONF_TYPE_INT, 0, 0, 0, NULL, "tells MPlayerXP to use existing X11 window (for using MPlayerXP as plugin)"}, + {"rootwin", &WinID, CONF_TYPE_FLAG, 0, -1, 0, NULL, "render movie in the root window (desktop background)"}, +#ifdef HAVE_XINERAMA + {"xinerama", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL, "tells MPlayerXP the display for movie playback"}, +#endif + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; +#endif + +static const config_t audio_config[]={ + {"on", &has_audio, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables audio-steam playback"}, + {"off", &has_audio, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables audio-stream playback"}, + {"mixer", &oss_mixer_device, CONF_TYPE_STRING, 0, 0, 0, NULL, "select audio-mixer device"}, + {"channels", &audio_output_channels, CONF_TYPE_INT, CONF_RANGE, 2, 8, NULL, "select number of audio output channels to be used"}, + {"rate", &force_srate, CONF_TYPE_INT, CONF_RANGE, 1000, 8*48000, NULL, "specifies Hz for audio playback"}, + {"lang", &audio_lang, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies language of DVD-audio stream as two-letter country code(s)"}, + {"id", &audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL, "selects audio channel"}, +#ifdef USE_FAKE_MONO + {"stereo", &fakemono, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL, "selects type of MP2/MP3 stereo output"}, +#endif + {"bs", &ao_data.buffersize, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL, "specifies sound card audio buffer size in bytes. Default: measuring"}, + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; + +static const config_t video_config[]={ {"x", &opt_screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL, "scale output image to x width (if driver supports)"}, {"y", &opt_screen_size_y, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL, "scale output image to y height (if driver supports)"}, {"xy", &screen_size_xy, CONF_TYPE_FLOAT, CONF_RANGE, 0, 4096, NULL, "scale output image by given factor"}, @@ -227,143 +322,79 @@ {"nozoom", &softzoom, CONF_TYPE_FLAG, 0, 1, 0, NULL, "render movie to the user-defined window's geometry"}, {"flip", &flip, CONF_TYPE_FLAG, 0, -1, 1, NULL, "flip output image upside-down"}, {"noflip", &flip, CONF_TYPE_FLAG, 0, -1, 0, NULL, "render output image as is"}, - {"bpp", &vo_dbpp, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL, "use different color depth than autodetect"}, - {"double", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables double-buffering for single-thread decoding"}, - {"nodouble", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 1, 0, NULL, "enables single-buffer for single-thread decoding"}, - {"vsync", &vo_vsync, CONF_TYPE_FLAG, 0, 0, 1, NULL, "forces video hardware to wait VSYNC signal before frame switching"}, - {"novsync", &vo_vsync, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables video hardware to wait VSYNC signal before frame switching"}, - {"brightness",&vo_gamma_brightness, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies brightness-level for output image"}, - {"saturation",&vo_gamma_saturation, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies saturation-level for output image"}, - {"contrast",&vo_gamma_contrast, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies contrast-level for output image"}, - {"hue",&vo_gamma_hue, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies hue of gamma-correction for output image"}, - {"red_intensity",&vo_gamma_red_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of red component for output image"}, - {"green_intensity",&vo_gamma_green_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of green component for output image"}, - {"blue_intensity",&vo_gamma_blue_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of blue component for output image"}, - - {"xp", &enable_xp, CONF_TYPE_INT, CONF_RANGE, 0, 4, NULL, "starts MPlayerXP in multi-thread and multi-buffer XP mode"}, - {"noxp", &enable_xp, CONF_TYPE_FLAG, 0, 1, 0, NULL, "starts MPlayerXP in single-thread mode"}, - {"gomp", &enable_gomp, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables usage of OpenMP extensions"}, - {"nogomp", &enable_gomp, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables usage of OpenMP extensions"}, - {"ffslices", &enable_ffslices, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables slice-based method of frame rendering in ffmpeg decoder"}, - {"noffslices", &enable_ffslices, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables slice-based method of frame rendering in ffmpeg decoder"}, - {"da_buffs", &vo_da_buffs, CONF_TYPE_INT, CONF_RANGE, 4, 1024, NULL, "specifies number of buffers for decoding-ahead in XP mode"}, - {"enable_bm", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of bus-mastering (if it available for given OS/videocard)"}, - {"enable_bm2", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 2, NULL, "enables using of bus-mastering to store all decoded-ahead frames in video-memory"}, - {"disable_bm", &vo_use_bm, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of bus-mastering"}, - -#if defined( ARCH_X86 ) || defined(ARCH_X86_64) - {"mmx", &x86_mmx, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of MMX extensions of CPU"}, - {"nommx", &x86_mmx, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of MMX extensions of CPU"}, - {"mmx2", &x86_mmx2, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of MMX2 extensions of CPU"}, - {"nommx2", &x86_mmx2, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of MMX2 extensions of CPU"}, - {"3dnow", &x86_3dnow, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of 3DNow! extensions of CPU"}, - {"no3dnow", &x86_3dnow, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of 3DNow! extensions of CPU"}, - {"3dnow2", &x86_3dnow2, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of 3DNow-2! extensions of CPU"}, - {"no3dnow2", &x86_3dnow2, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of 3DNow-2! extensions of CPU"}, - {"sse", &x86_sse, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of SSE extensions of CPU"}, - {"nosse", &x86_sse, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of SSE extensions of CPU"}, - {"sse2", &x86_sse2, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of SSE2 extensions of CPU"}, - {"nosse2", &x86_sse2, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of SSE2 extensions of CPU"}, + {"bm", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of bus-mastering (if it available for given OS/videocard)"}, + {"bm2", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 2, NULL, "enables using of bus-mastering to store all decoded-ahead frames in video-memory"}, + {"nobm", &vo_use_bm, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of bus-mastering"}, + {"id", &video_id, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL, "selects video channel"}, + {"pp", &npp_options, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies options of post-processing"}, + {"sws", &sws_flags, CONF_TYPE_INT, 0, 0, 2, NULL, "specifies the quality of the software scaler"}, +#ifdef HAVE_PNG + {"z", &z_compression, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL, "specifies compression level for PNG output"}, #endif +#ifdef HAVE_SDL + {"noxv", &sdl_noxv, CONF_TYPE_FLAG, 0, 0, 1, NULL, "disable XVideo hardware acceleration for SDL"}, + {"forcexv", &sdl_forcexv, CONF_TYPE_FLAG, 0, 0, 1, NULL, "force XVideo hardware acceleration for SDL"}, + {"forcegl", &sdl_forcegl, CONF_TYPE_FLAG, 0, 0, 1, NULL, "force OpenGL hardware acceleration for SDL"}, +#endif + {"eq",&veq_config, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Video-equalizer specific options"}, + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; -#ifdef HAVE_LIRC - {"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "specifies a config.file for LIRC"}, -#endif - - {"alang", &audio_lang, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies language of DVD-audio stream as two-letter country code(s)"}, - {"slang", &dvdsub_lang, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies language of DVD-subtitle stream as two-letter country code(s)"}, - - {"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies playlist (1 file/row or Winamp or ASX format)"}, - - {"slave", &slave_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL, "turns MPlayerXP into slave mode as a backend for other programs"}, - {"use-stdin", &use_stdin, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL, "forces reading of keyboard codes from STDIN instead of terminal's console"}, - -#ifdef HAVE_X11 - {"wid", &WinID, CONF_TYPE_INT, 0, 0, 0, NULL, "tells MPlayerXP to use existing X11 window (for using MPlayerXP as plugin)"}, - {"rootwin", &WinID, CONF_TYPE_FLAG, 0, -1, 0, NULL, "render movie in the root window (desktop background)"}, -#endif -#ifdef HAVE_XINERAMA - {"xineramascreen", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL, "tells MPlayerXP the display for movie playback"}, -#endif +static const config_t playback_config[]={ + {"sb", &seek_to_byte, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL, "seek to given byte position before playback"}, + {"ss", &seek_to_sec, CONF_TYPE_STRING, CONF_MIN, 0, 0, NULL, "seek to given time position before playback"}, + {"loop", &loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL, "loops movie playback given number of times. 0 means forever"}, + {"noloop", &loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL, "disable loop of playback"}, {"shuffle",&shuffle_playback, CONF_TYPE_FLAG, 0, 0, 1, NULL, "play files in random order"}, {"noshuffle",&shuffle_playback, CONF_TYPE_FLAG, 0, 1, 0, NULL, "play files in regular order"}, - -// ------------------------- stream options -------------------- -#ifdef HAVE_STREAMING - {"ipv4", &network_prefer_ipv4, CONF_TYPE_FLAG, 0, 0, 1, NULL, "forces mplayerxp to use IPv4 protocol over network"}, -#ifdef HAVE_AF_INET6 - {"ipv6", &network_prefer_ipv4, CONF_TYPE_FLAG, 0, 1, 0, NULL, "forces mplayerxp to use IPv6 protocol over network"}, -#else - {"ipv6", "MPlayerXP was compiled without IPv6 support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, -#endif /* HAVE_AF_INET6 */ - {"ipv4-only-proxy", &network_ipv4_only_proxy, CONF_TYPE_FLAG, 0, 0, 1, NULL, "skip the proxy for IPv6 addresses"}, - {"netuser", &network_username, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies username for HTTP authentication"}, - {"netpasswd", &network_password, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies password for HTTP authentication"}, - {"netbandwidth", &network_bandwidth, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL, "specifies the maximum bandwidth for network streaming"}, - {"net-user-agent", &network_useragent, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies string as user agent for HTTP streaming"}, - {"netcookies", &network_cookies_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL,"send cookies when making HTTP requests"}, - {"cookies-file", &cookies_file, CONF_TYPE_STRING, 0, 0, 0, NULL,"Read HTTP cookies from file"}, -#endif - {"cache", &stream_cache_size, CONF_TYPE_INT, CONF_RANGE, 4, 65536, NULL,"specifies amount of memory for precaching a file/URL"}, - {"nocache", &stream_cache_size, CONF_TYPE_FLAG, 0, 1, 0, NULL,"disables precaching a file/URL"}, - -#ifdef HAVE_LIBCSS - {"dvdauth", &dvd_auth_device, CONF_TYPE_STRING, 0, 0, 0, NULL,"provides authentification of encrypted DVD disk"}, - {"dvdkey", &dvdimportkey, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies key to decrypt stream encrypted with CSS"}, - {"csslib", &css_so, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies path to libcss.so"}, -#else - {"dvdauth", "MPlayerXP was compiled WITHOUT libcss support!\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL, ""}, - {"dvdkey", "MPlayerXP was compiled WITHOUT libcss support!\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL, ""}, - {"csslib", "MPlayerXP was compiled WITHOUT libcss support!\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL, ""}, -#endif - -// ------------------------- demuxer options -------------------- - - {"ni", &force_ni, CONF_TYPE_FLAG, 0, 0, 1, NULL,"force usage of non-interleaved AVI parser"}, - {"noni", &force_ni, CONF_TYPE_FLAG, 0, 1, 0, NULL,"disables usage of non-interleaved AVI parser"}, - - {"noidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 0, NULL, "disables INDEXES for AVI's demuxing"}, - {"idx", &index_mode, CONF_TYPE_FLAG, 0, -1, 1, NULL, "builds internal INDEXES of incomplete AVIs"}, - {"forceidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 2, NULL, "forces rebuilding of INDEXES for broken AVIs"}, - - {"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL, "selects audio channel"}, - {"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL, "selects video channel"}, - {"sid", &dvdsub_id, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL, "selects subtitle channel"}, - {"ifo", &spudec_ifo, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies .ifo file for DVD subtitles"}, - -// ------------------------- a-v sync options -------------------- - + {"list", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies playlist (1 file/row or Winamp or ASX format)"}, {"frames", &play_n_frames, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL, "play given number of frames and exit"}, + {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, +}; - {"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10, NULL, "maximum sync correction per 5 frames (in seconds)"}, - {"fps", &force_fps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0, NULL, "forces frame rate (if value is wrong in the header)"}, - {"srate", &force_srate, CONF_TYPE_INT, CONF_RANGE, 1000, 8*48000, NULL, "specifies Hz for audio playback"}, -// ------------------------- codec/pp options -------------------- +static const config_t mplayer_opts[]={ + /* name, pointer, type, flags, min, max, help */ + {"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL, ""}, /* ... [truncated message content] |
From: <nic...@us...> - 2010-01-15 17:48:13
|
Revision: 101 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=101&view=rev Author: nickols_k Date: 2010-01-15 17:48:06 +0000 (Fri, 15 Jan 2010) Log Message: ----------- cleanups Modified Paths: -------------- mplayerxp/cfg-mplayer.h mplayerxp/cfgparser.c mplayerxp/configure mplayerxp/libmpcodecs/ad_a52.c mplayerxp/libmpcodecs/ad_acm.c mplayerxp/libmpcodecs/ad_dca.c mplayerxp/libmpcodecs/ad_dmo.c mplayerxp/libmpcodecs/ad_dshow.c mplayerxp/libmpcodecs/ad_dvdpcm.c mplayerxp/libmpcodecs/ad_faad.c mplayerxp/libmpcodecs/ad_ffmp3.c mplayerxp/libmpcodecs/ad_hwac3.c mplayerxp/libmpcodecs/ad_libdv.c mplayerxp/libmpcodecs/ad_mp3.c mplayerxp/libmpcodecs/ad_null.c mplayerxp/libmpcodecs/ad_pcm.c mplayerxp/libmpcodecs/ad_real.c mplayerxp/libmpcodecs/ad_twin.c mplayerxp/libmpcodecs/ad_vorbis.c mplayerxp/libmpcodecs/dec_audio.c mplayerxp/libmpcodecs/dec_audio.h mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd_divx4.c mplayerxp/libmpcodecs/vd_dmo.c mplayerxp/libmpcodecs/vd_dshow.c mplayerxp/libmpcodecs/vd_huffyuv.c mplayerxp/libmpcodecs/vd_libdv.c mplayerxp/libmpcodecs/vd_libmpeg2.c mplayerxp/libmpcodecs/vd_mpegpes.c mplayerxp/libmpcodecs/vd_null.c mplayerxp/libmpcodecs/vd_nuv.c mplayerxp/libmpcodecs/vd_qtvideo.c mplayerxp/libmpcodecs/vd_raw.c mplayerxp/libmpcodecs/vd_real.c mplayerxp/libmpcodecs/vd_theora.c mplayerxp/libmpcodecs/vd_vfw.c mplayerxp/libmpcodecs/vd_xanim.c mplayerxp/libmpcodecs/vd_xvid.c mplayerxp/libmpdemux/cache2.c mplayerxp/libmpdemux/cdda.c mplayerxp/libmpdemux/demux_rawaudio.c mplayerxp/libmpdemux/demux_rawvideo.c mplayerxp/libmpdemux/demux_viv.c mplayerxp/libmpdemux/stream.c mplayerxp/libmpdemux/stream.h mplayerxp/libvo/font_load.c mplayerxp/libvo/sub.c mplayerxp/libvo/sub.h mplayerxp/mp-opt-reg.c mplayerxp/my_malloc.c mplayerxp/playtree.c mplayerxp/spudec.c Modified: mplayerxp/cfg-mplayer.h =================================================================== --- mplayerxp/cfg-mplayer.h 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/cfg-mplayer.h 2010-01-15 17:48:06 UTC (rev 101) @@ -396,5 +396,5 @@ { "net", &net_config, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Network specific options" }, #endif // ------------------------- codec/pp options -------------------- - {NULL, NULL, 0, 0, 0, 0, NULL} + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; Modified: mplayerxp/cfgparser.c =================================================================== --- mplayerxp/cfgparser.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/cfgparser.c 2010-01-15 17:48:06 UTC (rev 101) @@ -1320,52 +1320,54 @@ ,opts[i].name ,(opts[i].type==CONF_TYPE_PRINT && strcmp(opts[i].help,"show help")!=0)?opts[i].p:opts[i].help); if((opts[i].flags&CONF_NOCFG)==0) { - MSG_INFO(" {%s:", + MSG_INFO(" {%s=", opts[i].type==CONF_TYPE_FLAG?"flg": opts[i].type==CONF_TYPE_INT?"int": opts[i].type==CONF_TYPE_FLOAT?"flt": opts[i].type==CONF_TYPE_STRING?"str":""); switch(opts[i].type) { case CONF_TYPE_FLAG: { - int defv = *((int*)(opts[i].p)); - MSG_INFO("<default=%i>",defv); + int defv = (*((int*)(opts[i].p)))?1:0; + int max = opts[i].max ? 1:0; + int res = !(defv^max); + MSG_INFO("%s",res?"ON":"OFF"); } break; case CONF_TYPE_STRING: { const char **defv = (const char**)(opts[i].p); - if(defv) MSG_INFO("'%s'",*defv); + if(defv) MSG_INFO("\"%s\"",*defv); } break; case CONF_TYPE_INT: { int defv = *((int*)(opts[i].p)); + MSG_INFO("%i",defv); if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { - MSG_INFO("[%i...%i]",(int)opts[i].min,(int)opts[i].max); + MSG_INFO(" [%i...%i]",(int)opts[i].min,(int)opts[i].max); } else if((opts[i].flags&CONF_MIN)==CONF_MIN) { - MSG_INFO("<min=%i>",(int)opts[i].min); + MSG_INFO(" <min=%i>",(int)opts[i].min); } else if((opts[i].flags&CONF_MAX)==CONF_MAX) { - MSG_INFO("<max=%i>",(int)opts[i].max); + MSG_INFO(" <max=%i>",(int)opts[i].max); } - MSG_INFO("<default=%i>",defv); } break; case CONF_TYPE_FLOAT: { float defv = *((float*)(opts[i].p)); + MSG_INFO("%f",defv); if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { - MSG_INFO("[%f...%f]",(float)opts[i].min,(float)opts[i].max); + MSG_INFO(" [%f...%f]",(float)opts[i].min,(float)opts[i].max); } else if((opts[i].flags&CONF_MIN)==CONF_MIN) { - MSG_INFO("<min=%f>",(float)opts[i].min); + MSG_INFO(" <min=%f>",(float)opts[i].min); } else if((opts[i].flags&CONF_MAX)==CONF_MAX) { - MSG_INFO("<float=%f>",(float)opts[i].max); + MSG_INFO(" <max=%f>",(float)opts[i].max); } - MSG_INFO("<default=%f>",defv); } break; default: Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/configure 2010-01-15 17:48:06 UTC (rev 101) @@ -329,6 +329,7 @@ #enabled gomp && check_cflags -ftree-parallelize-loops=4 ##################################################### add_cflags "-Werror-implicit-function-declaration" +check_cflags "-Wextra" echocheck CFLAGS echores $CFLAGS Modified: mplayerxp/libmpcodecs/ad_a52.c =================================================================== --- mplayerxp/libmpcodecs/ad_a52.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_a52.c 2010-01-15 17:48:06 UTC (rev 101) @@ -36,7 +36,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(a52) Modified: mplayerxp/libmpcodecs/ad_acm.c =================================================================== --- mplayerxp/libmpcodecs/ad_acm.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_acm.c 2010-01-15 17:48:06 UTC (rev 101) @@ -19,7 +19,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(msacm) Modified: mplayerxp/libmpcodecs/ad_dca.c =================================================================== --- mplayerxp/libmpcodecs/ad_dca.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_dca.c 2010-01-15 17:48:06 UTC (rev 101) @@ -42,7 +42,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(dca) Modified: mplayerxp/libmpcodecs/ad_dmo.c =================================================================== --- mplayerxp/libmpcodecs/ad_dmo.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_dmo.c 2010-01-15 17:48:06 UTC (rev 101) @@ -19,7 +19,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(dmo) Modified: mplayerxp/libmpcodecs/ad_dshow.c =================================================================== --- mplayerxp/libmpcodecs/ad_dshow.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_dshow.c 2010-01-15 17:48:06 UTC (rev 101) @@ -17,7 +17,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(dshow) Modified: mplayerxp/libmpcodecs/ad_dvdpcm.c =================================================================== --- mplayerxp/libmpcodecs/ad_dvdpcm.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_dvdpcm.c 2010-01-15 17:48:06 UTC (rev 101) @@ -14,7 +14,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(dvdpcm) Modified: mplayerxp/libmpcodecs/ad_faad.c =================================================================== --- mplayerxp/libmpcodecs/ad_faad.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_faad.c 2010-01-15 17:48:06 UTC (rev 101) @@ -30,7 +30,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(faad) Modified: mplayerxp/libmpcodecs/ad_ffmp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_ffmp3.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_ffmp3.c 2010-01-15 17:48:06 UTC (rev 101) @@ -18,8 +18,6 @@ #define FF_INPUT_BUFFER_PADDING_SIZE 8 #endif -static AVCodec *lavc_codec=NULL; -static AVCodecContext *lavc_context; static int acodec_inited; static const ad_info_t info = @@ -31,7 +29,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(ffmp3) @@ -46,6 +44,8 @@ { int x; float pts; + AVCodec *lavc_codec=NULL; + AVCodecContext *lavc_context; MSG_V("FFmpeg's libavcodec audio codec\n"); if(!acodec_inited){ avcodec_init(); @@ -114,7 +114,8 @@ void uninit(sh_audio_t *sh) { - avcodec_close(lavc_context); + AVCodecContext *lavc_context=sh->context; + avcodec_close(sh->context); if (lavc_context->extradata) free(lavc_context->extradata); free(lavc_context); acodec_inited=0; @@ -122,7 +123,14 @@ int control(sh_audio_t *sh,int cmd,void* arg, ...) { - return CONTROL_UNKNOWN; + AVCodecContext *lavc_context = sh->context; + switch(cmd){ + case ADCTRL_RESYNC_STREAM: + avcodec_flush_buffers(lavc_context); + return CONTROL_TRUE; + default: break; + } + return CONTROL_UNKNOWN; } int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) Modified: mplayerxp/libmpcodecs/ad_hwac3.c =================================================================== --- mplayerxp/libmpcodecs/ad_hwac3.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_hwac3.c 2010-01-15 17:48:06 UTC (rev 101) @@ -150,7 +150,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(hwac3) Modified: mplayerxp/libmpcodecs/ad_libdv.c =================================================================== --- mplayerxp/libmpcodecs/ad_libdv.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_libdv.c 2010-01-15 17:48:06 UTC (rev 101) @@ -26,7 +26,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(libdv) Modified: mplayerxp/libmpcodecs/ad_mp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_mp3.c 2010-01-15 17:48:06 UTC (rev 101) @@ -21,7 +21,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(mp3) @@ -331,24 +331,6 @@ int control(sh_audio_t *sh,int cmd,void* arg, ...) { - float pts; - switch(cmd) - { - case ADCTRL_RESYNC_STREAM: -#if 0 - MP3_DecodeFrame(NULL,-2,&pts); // resync - MP3_DecodeFrame(NULL,-2,&pts); // resync - MP3_DecodeFrame(NULL,-2,&pts); // resync -#endif - return CONTROL_TRUE; - case ADCTRL_SKIP_FRAME: -#if 0 - MP3_DecodeFrame(NULL,-2,&pts); // skip MPEG frame -#endif - return CONTROL_TRUE; - default: - return CONTROL_UNKNOWN; - } return CONTROL_UNKNOWN; } @@ -358,7 +340,7 @@ unsigned char *indata=NULL; int err,indata_size; size_t len=0,done; - while(len<minlen) { + while(len<(size_t)minlen) { indata_size=ds_get_packet_r(sh->ds,&indata,len>0?&apts:pts); if(!indata_size) break; err=mpg123_decode(sh->context,indata,indata_size,buf,maxlen,&done); Modified: mplayerxp/libmpcodecs/ad_null.c =================================================================== --- mplayerxp/libmpcodecs/ad_null.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_null.c 2010-01-15 17:48:06 UTC (rev 101) @@ -12,7 +12,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(null) Modified: mplayerxp/libmpcodecs/ad_pcm.c =================================================================== --- mplayerxp/libmpcodecs/ad_pcm.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_pcm.c 2010-01-15 17:48:06 UTC (rev 101) @@ -13,7 +13,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(pcm) Modified: mplayerxp/libmpcodecs/ad_real.c =================================================================== --- mplayerxp/libmpcodecs/ad_real.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_real.c 2010-01-15 17:48:06 UTC (rev 101) @@ -19,7 +19,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(real) Modified: mplayerxp/libmpcodecs/ad_twin.c =================================================================== --- mplayerxp/libmpcodecs/ad_twin.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_twin.c 2010-01-15 17:48:06 UTC (rev 101) @@ -21,7 +21,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(twin) Modified: mplayerxp/libmpcodecs/ad_vorbis.c =================================================================== --- mplayerxp/libmpcodecs/ad_vorbis.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/ad_vorbis.c 2010-01-15 17:48:06 UTC (rev 101) @@ -17,7 +17,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(vorbis) Modified: mplayerxp/libmpcodecs/dec_audio.c =================================================================== --- mplayerxp/libmpcodecs/dec_audio.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/dec_audio.c 2010-01-15 17:48:06 UTC (rev 101) @@ -340,22 +340,21 @@ return cp_size; } +/* Note: it is called once after seeking, to resync. */ void resync_audio_stream(sh_audio_t *sh_audio) { - if(sh_audio) - if(sh_audio->inited && mpadec) mpadec->control(sh_audio,ADCTRL_RESYNC_STREAM,NULL); + if(sh_audio) { + sh_audio->a_in_buffer_len=0; /* workaround */ + if(sh_audio->inited && mpadec) mpadec->control(sh_audio,ADCTRL_RESYNC_STREAM,NULL); + } } +/* Note: it is called to skip (jump over) small amount (1/10 sec or 1 frame) + of audio data - used to sync audio to video after seeking */ void skip_audio_frame(sh_audio_t *sh_audio) { + int rc=CONTROL_TRUE; if(sh_audio) - if(sh_audio->inited && mpadec) mpadec->control(sh_audio,ADCTRL_SKIP_FRAME,NULL); + if(sh_audio->inited && mpadec) rc=mpadec->control(sh_audio,ADCTRL_SKIP_FRAME,NULL); + if(rc!=CONTROL_TRUE) ds_fill_buffer(sh_audio->ds); } - -/* MP3 decoder buffer callback:*/ -int mplayer_audio_read(char *buf,int size,float *pts){ - int len; - len=demux_read_data_r(dec_audio_sh->ds,buf,size,pts); - MSG_DBG2("%i=mplayer_audio_read(%p,%i,%f)\n",len,buf,size,*pts); - return len; -} Modified: mplayerxp/libmpcodecs/dec_audio.h =================================================================== --- mplayerxp/libmpcodecs/dec_audio.h 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/dec_audio.h 2010-01-15 17:48:06 UTC (rev 101) @@ -6,9 +6,6 @@ extern void resync_audio_stream(sh_audio_t *sh_audio); extern void skip_audio_frame(sh_audio_t *sh_audio); -// MP3 decoder buffer callback: -extern int mplayer_audio_read(char *buf,int size,float *pts); - extern int init_audio_filters(sh_audio_t *sh_audio, int in_samplerate, int in_channels, int in_format, int in_bps, int out_samplerate, int out_channels, int out_format, int out_bps, Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/dec_video.c 2010-01-15 17:48:06 UTC (rev 101) @@ -89,7 +89,7 @@ extern char *video_codec; int init_video(sh_video_t *sh_video,const char* codecname,const char * vfm,int status){ - unsigned o_bps,bpp,vf_flags; + unsigned o_bps,bpp; sh_video->codec=NULL; MSG_DBG3("init_video(%p, %s, %s, %i)\n",sh_video,codecname,vfm,status); while((sh_video->codec=find_codec(sh_video->format, @@ -166,6 +166,7 @@ sh_video->inited=1; #ifdef _OPENMP if(enable_gomp) { + int vf_flags; smp_num_cpus=omp_get_num_procs(); vf_flags=vf_query_flags(sh_video->vfilter); use_vf_threads=0; Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd.c 2010-01-15 17:48:06 UTC (rev 101) @@ -126,7 +126,7 @@ for(i=0;i<CODECS_MAX_OUTFMT;i++){ int flags; out_fmt=sh->codec->outfmt[i]; - if(out_fmt==(signed int)0xFFFFFFFF) continue; + if(out_fmt==0xFFFFFFFF) continue; flags=vf_query_format(vf,out_fmt,w,h); MSG_DBG2("vo_debug[step i=%d]: query(%s %ix%i) returned 0x%X for:\n",i,vo_format_name(out_fmt),w,h,flags); if(verbose>1) if(verbose) vf_showlist(vf); @@ -152,7 +152,7 @@ int ind; MSG_WARN("Can't find colorspace for: "); for(ind=0;ind<CODECS_MAX_OUTFMT;ind++) { - if(sh->codec->outfmt[ind]==(signed int)0xFFFFFFFF) break; + if(sh->codec->outfmt[ind]==0xFFFFFFFF) break; MSG_WARN("'%s' ",vo_format_name(sh->codec->outfmt[ind])); } MSG_WARN("Trying -vf fmtcvt\n"); Modified: mplayerxp/libmpcodecs/vd_divx4.c =================================================================== --- mplayerxp/libmpcodecs/vd_divx4.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_divx4.c 2010-01-15 17:48:06 UTC (rev 101) @@ -29,7 +29,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(divx4) Modified: mplayerxp/libmpcodecs/vd_dmo.c =================================================================== --- mplayerxp/libmpcodecs/vd_dmo.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_dmo.c 2010-01-15 17:48:06 UTC (rev 101) @@ -22,7 +22,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(dmo) Modified: mplayerxp/libmpcodecs/vd_dshow.c =================================================================== --- mplayerxp/libmpcodecs/vd_dshow.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_dshow.c 2010-01-15 17:48:06 UTC (rev 101) @@ -20,7 +20,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(dshow) Modified: mplayerxp/libmpcodecs/vd_huffyuv.c =================================================================== --- mplayerxp/libmpcodecs/vd_huffyuv.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_huffyuv.c 2010-01-15 17:48:06 UTC (rev 101) @@ -32,7 +32,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(huffyuv) @@ -506,7 +506,7 @@ { mp_image_t* mpi; int pixel_ptr; - unsigned char y1, y2, u, v, r, g, b, a; + unsigned char y1, y2, u, v, r, g, b; unsigned char left_y, left_u, left_v, left_r, left_g, left_b; unsigned char tmp, mi, mx, med; unsigned char *swap; Modified: mplayerxp/libmpcodecs/vd_libdv.c =================================================================== --- mplayerxp/libmpcodecs/vd_libdv.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_libdv.c 2010-01-15 17:48:06 UTC (rev 101) @@ -27,7 +27,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(libdv) Modified: mplayerxp/libmpcodecs/vd_libmpeg2.c =================================================================== --- mplayerxp/libmpcodecs/vd_libmpeg2.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_libmpeg2.c 2010-01-15 17:48:06 UTC (rev 101) @@ -27,7 +27,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(libmpeg2) Modified: mplayerxp/libmpcodecs/vd_mpegpes.c =================================================================== --- mplayerxp/libmpcodecs/vd_mpegpes.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_mpegpes.c 2010-01-15 17:48:06 UTC (rev 101) @@ -14,7 +14,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(mpegpes) Modified: mplayerxp/libmpcodecs/vd_null.c =================================================================== --- mplayerxp/libmpcodecs/vd_null.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_null.c 2010-01-15 17:48:06 UTC (rev 101) @@ -14,7 +14,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(null) Modified: mplayerxp/libmpcodecs/vd_nuv.c =================================================================== --- mplayerxp/libmpcodecs/vd_nuv.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_nuv.c 2010-01-15 17:48:06 UTC (rev 101) @@ -13,7 +13,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(nuv) Modified: mplayerxp/libmpcodecs/vd_qtvideo.c =================================================================== --- mplayerxp/libmpcodecs/vd_qtvideo.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_qtvideo.c 2010-01-15 17:48:06 UTC (rev 101) @@ -23,7 +23,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(qtvideo) Modified: mplayerxp/libmpcodecs/vd_raw.c =================================================================== --- mplayerxp/libmpcodecs/vd_raw.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_raw.c 2010-01-15 17:48:06 UTC (rev 101) @@ -13,7 +13,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(raw) Modified: mplayerxp/libmpcodecs/vd_real.c =================================================================== --- mplayerxp/libmpcodecs/vd_real.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_real.c 2010-01-15 17:48:06 UTC (rev 101) @@ -18,7 +18,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(real) Modified: mplayerxp/libmpcodecs/vd_theora.c =================================================================== --- mplayerxp/libmpcodecs/vd_theora.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_theora.c 2010-01-15 17:48:06 UTC (rev 101) @@ -21,7 +21,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(theora) Modified: mplayerxp/libmpcodecs/vd_vfw.c =================================================================== --- mplayerxp/libmpcodecs/vd_vfw.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_vfw.c 2010-01-15 17:48:06 UTC (rev 101) @@ -30,7 +30,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; #define info info_vfw Modified: mplayerxp/libmpcodecs/vd_xanim.c =================================================================== --- mplayerxp/libmpcodecs/vd_xanim.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_xanim.c 2010-01-15 17:48:06 UTC (rev 101) @@ -36,7 +36,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(xanim) @@ -246,7 +246,7 @@ char *error; XAVID_MOD_HDR *mod_hdr; XAVID_FUNC_HDR *func; - int i; + unsigned int i; codec_driver->file_handler = dlopen(filename, RTLD_NOW|RTLD_GLOBAL); if (!codec_driver->file_handler) @@ -766,7 +766,7 @@ unsigned int map_flag, unsigned int *map, XA_CHDR *chdr) { xacodec_image_t *image=(xacodec_image_t*)image_p; - int y; + unsigned int y; int uvstride; MSG_DBG3( "YUVTabs: %d %p %p %p %p %p\n",yuv_tabs->Uskip_mask, @@ -803,7 +803,7 @@ unsigned int stridev=image->stride[2]; unsigned char *du=image->planes[1]+2*y*strideu; unsigned char *dv=image->planes[2]+2*y*stridev; - int x; + unsigned int x; if(yuv_tabs->YUV_Y_tab){ // dirty hack to detect iv32: for(x=0;x<imagex;x++){ du[2*x]=du[2*x+1]=du[2*x+strideu]=du[2*x+strideu+1]=su[x]*2; @@ -860,7 +860,7 @@ #warning "FIXME! Decoder doesn't supports Vivo/2.00 :(" -if(i_x==image->width && i_y==image->height){ +if(i_x==(unsigned)image->width && i_y==(unsigned)image->height){ image->planes[0]=yuv->Ybuf; if(image->out_fmt==IMGFMT_YV12){ image->planes[1]=yuv->Ubuf; @@ -872,7 +872,7 @@ image->stride[0]=i_x; // yuv->y_w image->stride[1]=image->stride[2]=i_x/2; // yuv->uv_w } else { - int y; + unsigned 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>>=1; i_y>>=1; Modified: mplayerxp/libmpcodecs/vd_xvid.c =================================================================== --- mplayerxp/libmpcodecs/vd_xvid.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpcodecs/vd_xvid.c 2010-01-15 17:48:06 UTC (rev 101) @@ -35,7 +35,7 @@ } priv_t; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBVD_EXTERN(xvid) @@ -199,6 +199,7 @@ /* Returns DAR value according to VOL's informations contained in stats * param */ +#if 0 static float stats2aspect(xvid_dec_stats_t *stats) { if (stats->type == XVID_TYPE_VOL) { @@ -254,7 +255,7 @@ return(0.0f); } - +#endif // init driver static int init(sh_video_t *sh){ xvid_gbl_info_t xvid_gbl_info; Modified: mplayerxp/libmpdemux/cache2.c =================================================================== --- mplayerxp/libmpdemux/cache2.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpdemux/cache2.c 2010-01-15 17:48:06 UTC (rev 101) @@ -601,8 +601,9 @@ /* main interface here! */ -int __FASTCALL__ stream_read(stream_t *s,char* mem,int total) +int __FASTCALL__ stream_read(stream_t *s,void* _mem,int total) { + char *mem = _mem; if(s->cache_data) return c2_stream_read(s->cache_data,mem,total); else return nc_stream_read(s,mem,total); } Modified: mplayerxp/libmpdemux/cdda.c =================================================================== --- mplayerxp/libmpdemux/cdda.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpdemux/cdda.c 2010-01-15 17:48:06 UTC (rev 101) @@ -16,16 +16,16 @@ static int no_skip = 0; static const config_t cdda_opts[] = { - { "speed", &speed, CONF_TYPE_INT, CONF_RANGE,1,100, NULL }, - { "overlap", &search_overlap, CONF_TYPE_INT, CONF_RANGE,0,75, NULL }, - { "noskip", &no_skip, CONF_TYPE_FLAG, 0 , 0, 1, NULL }, - { "skip", &no_skip, CONF_TYPE_FLAG, 0 , 1, 0, NULL }, - {NULL, NULL, 0, 0, 0, 0, NULL} + { "speed", &speed, CONF_TYPE_INT, CONF_RANGE,1,100, NULL, "sets driver speed" }, + { "overlap", &search_overlap, CONF_TYPE_INT, CONF_RANGE,0,75, NULL, "reserved" }, + { "noskip", &no_skip, CONF_TYPE_FLAG, 0 , 0, 1, NULL, "reserved" }, + { "skip", &no_skip, CONF_TYPE_FLAG, 0 , 1, 0, NULL, "reserved" }, + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; static const config_t cdda_conf[] = { - { "cdda", &cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, - { NULL,NULL, 0, 0, 0, 0, NULL} + { "cdda", &cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "CD-DA related options"}, + { NULL,NULL, 0, 0, 0, 0, NULL, NULL} }; void cdda_register_options(m_config_t* cfg) { Modified: mplayerxp/libmpdemux/demux_rawaudio.c =================================================================== --- mplayerxp/libmpdemux/demux_rawaudio.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpdemux/demux_rawaudio.c 2010-01-15 17:48:06 UTC (rev 101) @@ -22,12 +22,12 @@ { "rate", &samplerate, CONF_TYPE_INT,CONF_RANGE,1000,8*48000, NULL, "specifies sample-rate of raw-audio steram" }, { "samplesize", &samplesize, CONF_TYPE_INT,CONF_RANGE,1,8, NULL, "specifies sample-size of raw-audio steram" }, { "format", &format, CONF_TYPE_INT, CONF_MIN, 0 , 0, NULL, "specifies compression-format of raw-audio stream" }, - {NULL, NULL, 0, 0, 0, 0, NULL} + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; static const config_t rawaudio_conf[] = { { "rawaudio", &demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Raw-audio specific commands"}, - { NULL,NULL, 0, 0, 0, 0, NULL} + { NULL,NULL, 0, 0, 0, 0, NULL, NULL} }; static int rawaudio_probe(demuxer_t* demuxer) Modified: mplayerxp/libmpdemux/demux_rawvideo.c =================================================================== --- mplayerxp/libmpdemux/demux_rawvideo.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpdemux/demux_rawvideo.c 2010-01-15 17:48:06 UTC (rev 101) @@ -45,13 +45,12 @@ // misc: { "fps", &fps, CONF_TYPE_FLOAT,CONF_RANGE,0.001,1000, NULL, "specifies rate in frames per second of raw-video stream" }, { "size", &imgsize, CONF_TYPE_INT, CONF_RANGE, 1 , 8192*8192*4, NULL, "specifies frame size in bytes" }, - - {NULL, NULL, 0, 0, 0, 0, NULL} + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; static const config_t rawvideo_conf[] = { { "rawvideo", &demux_rawvideo_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Raw-video specific options"}, - { NULL,NULL, 0, 0, 0, 0, NULL} + { NULL,NULL, 0, 0, 0, 0, NULL, NULL} }; static int rawvideo_probe(demuxer_t* demuxer) Modified: mplayerxp/libmpdemux/demux_viv.c =================================================================== --- mplayerxp/libmpdemux/demux_viv.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpdemux/demux_viv.c 2010-01-15 17:48:06 UTC (rev 101) @@ -87,12 +87,12 @@ {"width", &vivo_param_width, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies width of video in VIVO stream" }, {"height", &vivo_param_height, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies height of video in VIVO stream"}, {"vformat", &vivo_param_vformat, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies video-codec of VIVO stream"}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; static config_t vivo_conf[] = { { "vivo", &vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Vivo specific options"}, - { NULL,NULL, 0, 0, 0, 0, NULL} + { NULL,NULL, 0, 0, 0, 0, NULL, NULL} }; /* parse all possible extra headers */ Modified: mplayerxp/libmpdemux/stream.c =================================================================== --- mplayerxp/libmpdemux/stream.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpdemux/stream.c 2010-01-15 17:48:06 UTC (rev 101) @@ -271,7 +271,7 @@ return stream_eof(s)?-256:retval; } -int __FASTCALL__ nc_stream_read(stream_t *s,char* _mem,int total){ +int __FASTCALL__ nc_stream_read(stream_t *s,void* _mem,int total){ int i,x,ilen,_total=total,got_len; char *mem=_mem; MSG_DBG3( "nc_stream_read %u bytes from %llu\n",total,FILE_POS(s)+s->buf_pos); @@ -348,7 +348,7 @@ mem+=x; ilen-=x; } MSG_DBG3( "nc_stream_read got %u bytes ",total); - for(i=0;i<min(8,total);i++) MSG_DBG3("%02X ",(int)((unsigned char)_mem[i])); + for(i=0;i<min(8,total);i++) MSG_DBG3("%02X ",(int)((unsigned char)mem[i])); MSG_DBG3("\n"); return total; } Modified: mplayerxp/libmpdemux/stream.h =================================================================== --- mplayerxp/libmpdemux/stream.h 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libmpdemux/stream.h 2010-01-15 17:48:06 UTC (rev 101) @@ -71,7 +71,7 @@ extern int __FASTCALL__ nc_stream_seek_long(stream_t *s,off_t pos); extern void __FASTCALL__ nc_stream_reset(stream_t *s); extern int __FASTCALL__ nc_stream_read_char(stream_t *s); -extern int __FASTCALL__ nc_stream_read(stream_t *s,char* mem,int total); +extern int __FASTCALL__ nc_stream_read(stream_t *s,void* mem,int total); extern off_t __FASTCALL__ nc_stream_tell(stream_t *s); extern int __FASTCALL__ nc_stream_seek(stream_t *s,off_t pos); extern int __FASTCALL__ nc_stream_skip(stream_t *s,off_t len); @@ -79,7 +79,7 @@ /* this block describes interface to cache/non-cache stream functions */ extern int __FASTCALL__ stream_read_char(stream_t *s); -extern int __FASTCALL__ stream_read(stream_t *s,char* mem,int total); +extern int __FASTCALL__ stream_read(stream_t *s,void* mem,int total); extern off_t __FASTCALL__ stream_tell(stream_t *s); extern int __FASTCALL__ stream_seek(stream_t *s,off_t pos); extern int __FASTCALL__ stream_skip(stream_t *s,off_t len); Modified: mplayerxp/libvo/font_load.c =================================================================== --- mplayerxp/libvo/font_load.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libvo/font_load.c 2010-01-15 17:48:06 UTC (rev 101) @@ -41,7 +41,7 @@ } font_desc_t* read_font_desc(char* fname,float factor,int verbose){ -unsigned char sor[1024]; +char sor[1024]; unsigned char sor2[1024]; font_desc_t *desc; FILE *f; @@ -80,14 +80,14 @@ section[0]=0; while(fgets(sor,1020,f)){ - unsigned char* p[8]; + char* p[8]; int pdb=0; - unsigned char *s=sor; + unsigned char *s=(unsigned char *)sor; unsigned char *d=sor2; int ec=' '; int id=0; sor[1020]=0; - p[0]=d;++pdb; + p[0]=(char *)d;++pdb; while(1){ int c=*s++; if(c==0 || c==13 || c==10) break; @@ -98,7 +98,7 @@ if(c==' '){ if(ec==' ') continue; *d=0; ++d; - p[pdb]=d;++pdb; + p[pdb]=(char *)d;++pdb; if(pdb>=8) break; continue; } Modified: mplayerxp/libvo/sub.c =================================================================== --- mplayerxp/libvo/sub.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libvo/sub.c 2010-01-15 17:48:06 UTC (rev 101) @@ -38,7 +38,7 @@ //static int vo_font_loaded=-1; font_desc_t* vo_font=NULL; -unsigned char* vo_osd_text=NULL; +char* vo_osd_text=NULL; int sub_unicode=0; int sub_utf8=0; int sub_pos=100; @@ -116,7 +116,7 @@ } inline static void __FASTCALL__ vo_update_text_osd(mp_osd_obj_t* obj,int dxs,int dys){ - unsigned char *cp=vo_osd_text; + unsigned char *cp=(unsigned char *)vo_osd_text; int x=20; int h=0; UNUSED(dxs); @@ -137,7 +137,7 @@ } inline static void __FASTCALL__ vo_draw_text_osd(mp_osd_obj_t* obj,draw_osd_f draw_alpha){ - unsigned char *cp=vo_osd_text; + unsigned char *cp=(unsigned char *)vo_osd_text; int font; int x=obj->x; Modified: mplayerxp/libvo/sub.h =================================================================== --- mplayerxp/libvo/sub.h 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/libvo/sub.h 2010-01-15 17:48:06 UTC (rev 101) @@ -65,7 +65,7 @@ extern font_desc_t* vo_font; -extern unsigned char* vo_osd_text; +extern char* vo_osd_text; extern int vo_osd_progbar_type; extern int vo_osd_progbar_value; // 0..255 Modified: mplayerxp/mp-opt-reg.c =================================================================== --- mplayerxp/mp-opt-reg.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/mp-opt-reg.c 2010-01-15 17:48:06 UTC (rev 101) @@ -8,7 +8,7 @@ extern void mp_input_register_options(m_config_t* cfg); extern void libmpdemux_register_options(m_config_t* cfg); extern void demuxer_register_options(m_config_t* cfg); -#ifdef HAVE_CDDA +#ifdef HAVE_LIBCDIO extern void cdda_register_options(m_config_t* cfg); #endif extern void libmpcodecs_ad_register_options(m_config_t* cfg); @@ -19,7 +19,7 @@ mp_input_register_options(cfg); libmpdemux_register_options(cfg); demuxer_register_options(cfg); -#ifdef HAVE_CDDA +#ifdef HAVE_LIBCDIO cdda_register_options(cfg); #endif libmpcodecs_ad_register_options(cfg); Modified: mplayerxp/my_malloc.c =================================================================== --- mplayerxp/my_malloc.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/my_malloc.c 2010-01-15 17:48:06 UTC (rev 101) @@ -33,7 +33,7 @@ if(crc != (long)((char *)__ptr-sizeof(long))) { printf("Internal error: my_realloc found out memory corruption!\n"); - printf("INFO: ptr=%08X ptr[0]=%08X crc=%08X\n", + printf("INFO: ptr=%p ptr[0]=%lX crc=%lX\n", __ptr, osize, crc); @@ -83,7 +83,7 @@ if(crc != (long)myptr) { printf("Internal error: my_free found out memory corruption!\n"); - printf("INFO: ptr=%08X ptr[0]=%08X crc=%08X\n", + printf("INFO: ptr=%p ptr[0]=%lX crc=%lX\n", __ptr, osize, crc); Modified: mplayerxp/playtree.c =================================================================== --- mplayerxp/playtree.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/playtree.c 2010-01-15 17:48:06 UTC (rev 101) @@ -511,7 +511,7 @@ static play_tree_t* play_tree_rnd_step(play_tree_t* pt) { int count = 0; - int r,rnd,j; + int r,rnd; time_t tim; play_tree_t *i,*head; Modified: mplayerxp/spudec.c =================================================================== --- mplayerxp/spudec.c 2010-01-14 15:50:02 UTC (rev 100) +++ mplayerxp/spudec.c 2010-01-15 17:48:06 UTC (rev 101) @@ -347,7 +347,7 @@ unsigned int next_off; unsigned int start_pts=0; unsigned int end_pts=0; - unsigned int current_nibble[2]; + unsigned int current_nibble[2] = { 0, 0 }; unsigned int control_start; unsigned int display = 0; unsigned int start_col = 0; @@ -479,8 +479,7 @@ static void __FASTCALL__ spudec_decode(spudec_handle_t *this, unsigned int pts100) { if(this->hw_spu) { - static vo_mpegpes_t packet = { NULL, 0, 0x20, 0 }; - static vo_mpegpes_t *pkg=&packet; + vo_mpegpes_t packet = { NULL, 0, 0x20, 0 }; packet.data = this->packet; packet.size = this->packet_size; packet.timestamp = pts100; @@ -688,8 +687,8 @@ unsigned int t; unsigned int delta_src = end_src - start_src; unsigned int delta_tar = end_tar - start_tar; - int src = 0; - int src_step; + unsigned int src = 0; + unsigned int src_step; if (delta_src == 0 || delta_tar == 0) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-16 16:16:06
|
Revision: 104 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=104&view=rev Author: nickols_k Date: 2010-01-16 16:16:00 +0000 (Sat, 16 Jan 2010) Log Message: ----------- fixes Modified Paths: -------------- mplayerxp/cpudetect.c mplayerxp/libmpcodecs/ad_mp3.c Modified: mplayerxp/cpudetect.c =================================================================== --- mplayerxp/cpudetect.c 2010-01-16 15:33:05 UTC (rev 103) +++ mplayerxp/cpudetect.c 2010-01-16 16:16:00 UTC (rev 104) @@ -37,33 +37,29 @@ // return TRUE if cpuid supported static int has_cpuid() { - int a, c; - #ifdef ARCH_X86_64 return 1; #else + int a, c; // code from libavcodec: __asm__ __volatile__ ( - /* See if CPUID instruction is supported ... */ - /* ... Get copies of EFLAGS into eax and ecx */ - "pushf\n\t" - "pop %0\n\t" - "mov %0, %1\n\t" - - /* ... Toggle the ID bit in one copy and store */ - /* to the EFLAGS reg */ - "xor $0x200000, %0\n\t" - "push %0\n\t" - "popf\n\t" - - /* ... Get the (hopefully modified) EFLAGS */ - "pushf\n\t" - "pop %0\n\t" - : "=a" (a), "=c" (c) - : - : "cc" - ); - + /* See if CPUID instruction is supported ... */ + /* ... Get copies of EFLAGS into eax and ecx */ + "pushf\n\t" + "pop %0\n\t" + "mov %0, %1\n\t" + /* ... Toggle the ID bit in one copy and store */ + /* to the EFLAGS reg */ + "xor $0x200000, %0\n\t" + "push %0\n\t" + "popf\n\t" + /* ... Get the (hopefully modified) EFLAGS */ + "pushf\n\t" + "pop %0\n\t" + : "=a" (a), "=c" (c) + : + : "cc" + ); return (a!=c); #endif } Modified: mplayerxp/libmpcodecs/ad_mp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.c 2010-01-16 15:33:05 UTC (rev 103) +++ mplayerxp/libmpcodecs/ad_mp3.c 2010-01-16 16:16:00 UTC (rev 104) @@ -339,8 +339,9 @@ size_t len=0,done; while(len<(size_t)minlen) { indata_size=ds_get_packet_r(sh->ds,&indata,len>0?&apts:pts); - if(!indata_size) break; + if(indata_size<0) break; err=mpg123_decode(sh->context,indata,indata_size,buf,maxlen,&done); + MSG_DBG2("mp3_decode: %i->%i [%i...%i]\n",indata_size,done,minlen,maxlen); if(!((err==MPG123_OK)||(err==MPG123_NEED_MORE))) { MSG_ERR("mpg123_read = %s done = %u minlen = %u\n",mpg123_plain_strerror(err),done,minlen); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-17 19:43:08
|
Revision: 106 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=106&view=rev Author: nickols_k Date: 2010-01-17 18:46:44 +0000 (Sun, 17 Jan 2010) Log Message: ----------- slice-related fixes. -ffmpeg.noslice is sometime still required for -ffmpeg.threads>1! -core.gomp is still very experimental feature Modified Paths: -------------- etc/codecs.conf mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/vd.h mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpcodecs/vd_libmpeg2.c mplayerxp/libmpdemux/stheader.h mplayerxp/libvo/video_out.c mplayerxp/libvo/video_out.h mplayerxp/mp_image.c mplayerxp/mplayer.c mplayerxp/postproc/vf.c mplayerxp/postproc/vf_scale.c mplayerxp/postproc/vf_vo.c mplayerxp/postproc/vf_yuvcsp.c Modified: etc/codecs.conf =================================================================== --- etc/codecs.conf 2010-01-17 10:28:27 UTC (rev 105) +++ etc/codecs.conf 2010-01-17 18:46:44 UTC (rev 106) @@ -65,7 +65,7 @@ videocodec mpeg12 info "MPEG 1 or 2" comment "with postprocessing" - status buggy + status working ; for versions > 0.5 format 0x10000001 ; mpeg 1 format 0x10000002 ; mpeg 2 fourcc "DVR " Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/libmpcodecs/dec_video.c 2010-01-17 18:46:44 UTC (rev 106) @@ -164,14 +164,13 @@ ,o_bps); // Yeah! We got it! sh_video->inited=1; + sh_video->vf_flags=vf_query_flags(sh_video->vfilter); #ifdef _OPENMP if(enable_gomp) { - int vf_flags; smp_num_cpus=omp_get_num_procs(); - vf_flags=vf_query_flags(sh_video->vfilter); use_vf_threads=0; - MSG_DBG2("[mpdec] vf_flags=%08X num_cpus=%u\n",vf_flags,smp_num_cpus); - if(((vf_flags&MPDEC_THREAD_COND)==MPDEC_THREAD_COND) && (smp_num_cpus>1)) use_vf_threads=1; + MSG_DBG2("[mpdec] vf_flags=%08X num_cpus=%u\n",sh_video->vf_flags,smp_num_cpus); + if(((sh_video->vf_flags&MPDEC_THREAD_COND)==MPDEC_THREAD_COND) && (smp_num_cpus>1)) use_vf_threads=1; } #else MSG_V("[mpdec] GOMP was not compiled-in! Using single threaded video filtering!\n"); @@ -181,9 +180,61 @@ return 0; } +void mpcodecs_draw_image(sh_video_t* sh,mp_image_t *mpi) +{ + vf_instance_t* vf; + const unsigned h_step=16; + unsigned num_slices = mpi->h/h_step; + vf=sh->vfilter; + if(!(mpi->flags&(MP_IMGFLAG_DRAW_CALLBACK))){ + if(mpi->h%h_step) num_slices++; + if(sh->vf_flags&VF_FLAGS_SLICES) + { + unsigned j,i,y; + mp_image_t ampi[num_slices]; + static int hello_printed=0; + if(!hello_printed) { + MSG_OK("[VC] using %u threads for video filters\n",smp_num_cpus); + hello_printed=1; + } + y=0; + for(i=0;i<num_slices;i++) { + mpi_fake_slice(&i[i],mpi,y,h_step); + y+=h_step; + } +#ifdef _OPENMP + if(use_vf_threads && (num_slices>smp_num_cpus)) { + for(j=0;j<num_slices;j+=smp_num_cpus) { +#pragma omp parallel for shared(vf) private(i) + for(i=j;i<smp_num_cpus;i++) { + MSG_DBG2("Put slice[%u %u] in threads\n",ampi[i].y,ampi[i].h); + vf->put_slice(vf,&i[i]); + } + } + for(;j<num_slices;j++) { + MSG_DBG2("Put slice[%u %u] in threads\n",ampi[j].y,h_step); + vf->put_slice(vf,&i[j]); + } + } + else +#endif + { + /* execute slices instead of whole frame make faster multiple filters */ + for(i=0;i<num_slices;i++) { + MSG_DBG2("vf(%s) Put slice[%u %u] in threads\n",vf->info->name,ampi[i].y,ampi[i].h); + vf->put_slice(vf,&i[i]); + } + } + } else { + MSG_DBG2("Put whole frame\n"); + vf->put_slice(vf,mpi); + } + } +} + extern void update_subtitle(float v_pts); int decode_video(sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame, float pts){ -vf_instance_t* vf; + vf_instance_t* vf; mp_image_t *mpi=NULL; unsigned int t; unsigned int t2; @@ -193,15 +244,17 @@ t=GetTimer(); vf->control(vf,VFCTRL_START_FRAME,NULL); + +sh_video->active_slices=0; mpi=mpvdec->decode(sh_video, start, in_size, drop_frame); MSG_DBG2("decvideo: decoding video %u bytes\n",in_size); +while(sh_video->active_slices!=0) usleep(0); /* ------------------------ frame decoded. -------------------- */ - #ifdef HAVE_INT_PVECTOR _ivec_empty(); #endif - if(!mpi) return 0; // error / skipped frame +mpcodecs_draw_image(sh_video,mpi); t2=GetTimer();t=t2-t; tt = t*0.000001f; @@ -217,43 +270,6 @@ update_subtitle(pts); vo_flush_pages(); -if(!(mpi->flags&(MP_IMGFLAG_DRAW_CALLBACK))){ - MSG_DBG2("Put whole frame\n"); -#ifdef _OPENMP - if(use_vf_threads) { - unsigned i,y,h_step,h; - mp_image_t ampi[smp_num_cpus]; - static int hello_printed=0; - if(!hello_printed) { - MSG_OK("[VC] using %u threads for video filters\n",smp_num_cpus); - hello_printed=1; - } - h_step = mpi->h/smp_num_cpus; - h=mpi->height; - mpi->height=h_step; - y=0; - for(i=0;i<smp_num_cpus;i++) { - ampi[i] = *mpi; - ampi[i].y = y; - ampi[i].height = h_step; - ampi[i].chroma_height = h_step >> mpi->chroma_y_shift; - y+=h_step; - } -#pragma omp parallel for shared(vf) private(i) - for(i=0;i<smp_num_cpus;i++) { - MSG_DBG2("Put slice[%u %u] in threads\n",ampi[i].y,h_step); - vf->put_slice(vf,&i[i]); - } - if(y<h) { - ampi[0].y = y; - ampi[0].height = h - ampi[0].y; - vf->put_slice(vf,&i[0]); - } - } - else -#endif - vf->put_slice(vf,mpi); -} t2=GetTimer()-t2; tt=t2*0.000001f; vout_time_usage+=tt; Modified: mplayerxp/libmpcodecs/vd.h =================================================================== --- mplayerxp/libmpcodecs/vd.h 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/libmpcodecs/vd.h 2010-01-17 18:46:44 UTC (rev 106) @@ -40,5 +40,7 @@ // callbacks: int mpcodecs_config_vo(sh_video_t *sh, int w, int h, void *tune); mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag,int w, int h); -void mpcodecs_draw_slice(sh_video_t *sh, mp_image_t*); +void mpcodecs_draw_slice(sh_video_t* sh, mp_image_t*); +void mpcodecs_draw_image(sh_video_t* sh, mp_image_t *mpi); + Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-17 18:46:44 UTC (rev 106) @@ -42,10 +42,10 @@ static int lavc_param_threads=-1; static char *lavc_avopt = NULL; -static int enable_ffslices=-1; +static int enable_ffslices=1; static const config_t ff_options[] = { - {"slices", &enable_ffslices, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables slice-based method of frame rendering in ffmpeg decoder"}, - {"noslices", &enable_ffslices, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables slice-based method of frame rendering in ffmpeg decoder"}, + {"slices", &enable_ffslices, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables slice-based method of frame rendering in ffmpeg decoder"}, + {"noslices", &enable_ffslices, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables slice-based method of frame rendering in ffmpeg decoder"}, {"er", &lavc_param_error_resilience, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error resilience for ffmpeg decoders"}, {"idct", &lavc_param_idct_algo, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies idct algorithm for ffmpeg decoders"}, {"ec", &lavc_param_error_concealment, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error concealment for ffmpeg decoders"}, @@ -237,13 +237,6 @@ MSG_ERR(MSGTR_OutOfMemory); return 0; } -#ifdef HAVE_GOMP - /* Note: Slices have effect on UNI-processor machines only */ - if(enable_ffslices==-1) { - if(omp_get_num_procs()>1 && enable_gomp)enable_ffslices=0; - else enable_ffslices=1; - } -#endif #ifdef CODEC_FLAG_NOT_TRUNCATED vdff_ctx->ctx->flags|= CODEC_FLAG_NOT_TRUNCATED; @@ -360,6 +353,11 @@ #endif if(sh->bih) vdff_ctx->ctx->bits_per_coded_sample= sh->bih->biBitCount; + +#ifdef _OPENMP + /* Note: Slices have effect on UNI-processor machines only */ + if(enable_ffslices && omp_get_num_procs()>1 && enable_gomp) enable_ffslices=0; +#endif if(vdff_ctx->lavc_codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND && enable_ffslices) vdff_ctx->cap_slices=1; /* enable DR1 method */ if(vdff_ctx->lavc_codec->capabilities&CODEC_CAP_DR1) vdff_ctx->cap_dr1=1; @@ -370,6 +368,8 @@ avcodec_thread_init(vdff_ctx->ctx, lavc_param_threads); MSG_STATUS("Using %i threads in FFMPEG\n",lavc_param_threads); } + if(vdff_ctx->cap_slices) + MSG_STATUS("Trying to use slice-based rendering in FFMPEG\n"); /* open it */ rc = avcodec_open(vdff_ctx->ctx, vdff_ctx->lavc_codec); if (rc < 0) { @@ -393,13 +393,13 @@ { case IMGFMT_YV12: case IMGFMT_I420: - case IMGFMT_IYUV: pp_flags = PP_FORMAT_420; - break; + case IMGFMT_IYUV: pp_flags = PP_FORMAT_420; + break; case IMGFMT_YVYU: - case IMGFMT_YUY2: pp_flags = PP_FORMAT_422; - break; - case IMGFMT_411P: pp_flags = PP_FORMAT_411; - break; + case IMGFMT_YUY2: pp_flags = PP_FORMAT_422; + break; + case IMGFMT_411P: pp_flags = PP_FORMAT_411; + break; default: { const char *fmt; @@ -608,7 +608,13 @@ mpi->stride[1]=ls; } MSG_DBG2("ff_draw_callback %i %i %i %i\n",mpi->x,mpi->y,mpi->w,mpi->h); + pthread_mutex_lock(&sh->mutex); + sh->active_slices++; + pthread_mutex_unlock(&sh->mutex); mpcodecs_draw_slice (sh, mpi); + pthread_mutex_lock(&sh->mutex); + sh->active_slices--; + pthread_mutex_unlock(&sh->mutex); } /* copypaste from demux_real.c - it should match to get it working!*/ @@ -633,7 +639,7 @@ if(len<=0) return NULL; // skipped frame vdff_ctx->ctx->hurry_up=(flags&3)?((flags&2)?2:1):0; - if(vdff_ctx->cap_slices) vdff_ctx->use_slices=(divx_quality&&npp_options)?0:vdff_ctx->ctx->hurry_up?0:1; + if(vdff_ctx->cap_slices) vdff_ctx->use_slices= !(sh->vf_flags&VF_FLAGS_SLICES)?0:vdff_ctx->ctx->hurry_up?0:1; else vdff_ctx->use_slices=0; /* if codec is capable DR1 Modified: mplayerxp/libmpcodecs/vd_libmpeg2.c =================================================================== --- mplayerxp/libmpcodecs/vd_libmpeg2.c 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/libmpcodecs/vd_libmpeg2.c 2010-01-17 18:46:44 UTC (rev 106) @@ -207,7 +207,8 @@ mpi->stride[0]=w; mpi->stride[1]= mpi->stride[2]=w>>1; - mpcodecs_draw_slice(sh,mpi); + mpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK; + mpcodecs_draw_image(sh,mpi); } // decode a frame @@ -217,7 +218,7 @@ const mpeg2_info_t *info; int state,buf; if(len<=0) return NULL; // skipped null frame - + #if 0 // append extra 'end of frame' code: ((char*)data+len)[0]=0; Modified: mplayerxp/libmpdemux/stheader.h =================================================================== --- mplayerxp/libmpdemux/stheader.h 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/libmpdemux/stheader.h 2010-01-17 18:46:44 UTC (rev 106) @@ -73,9 +73,12 @@ // int coded_w,coded_h; // coded size (filled by video codec) float aspect; unsigned int outfmtidx; - + /* vfilter chan */ void *vfilter; int vfilter_inited; + int vf_flags; + pthread_mutex_t mutex; + unsigned active_slices; // unsigned int bitrate; // buffers: float num_frames; // number of frames played Modified: mplayerxp/libvo/video_out.c =================================================================== --- mplayerxp/libvo/video_out.c 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/libvo/video_out.c 2010-01-17 18:46:44 UTC (rev 106) @@ -397,7 +397,7 @@ video_out->control(DRI_GET_SURFACE_CAPS,&dri_cap); dri_config(dri_cap.fourcc); /* ugly workaround of swapped BGR-fourccs. Should be removed in the future */ - if(!has_dri) + if(!has_dri) { has_dri=1; dri_cap.fourcc = bswap_32(dri_cap.fourcc); @@ -555,7 +555,7 @@ return VO_FALSE; } /* video surface is bad thing for reading */ - if(mpi->flags&MP_IMGFLAG_READABLE && (dri_cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED) + if(((mpi->flags&MP_IMGFLAG_READABLE)||(mpi->type==MP_IMGTYPE_TEMP)) && (dri_cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED) { MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL mpi->flags&MP_IMGFLAG_READABLE && (dri_cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED\n"); return VO_FALSE; @@ -674,32 +674,10 @@ return VO_TRUE; } -uint32_t __FASTCALL__ vo_draw_frame(const uint8_t *src[]) +uint32_t __FASTCALL__ vo_draw_slice(const mp_image_t *mpi) { - unsigned stride[1]; - MSG_DBG3("dri_vo_dbg: vo_draw_frame\n"); - if(image_format == IMGFMT_YV12 || image_format == IMGFMT_I420 || image_format == IMGFMT_IYUV || - image_format == IMGFMT_YVU9 || image_format == IMGFMT_IF09) - MSG_WARN("dri_vo: draw_frame for planar fourcc was called, frame cannot be written\n"); - else - if(image_format == IMGFMT_RGB32 || image_format == IMGFMT_BGR32) - stride[0] = image_width*4; - else - if(image_format == IMGFMT_RGB24 || image_format == IMGFMT_BGR24) - stride[0] = image_width*3; - else - if(image_format == IMGFMT_RGB8 || image_format == IMGFMT_BGR8) - stride[0] = image_width; - else - stride[0] = image_width*2; - return vo_draw_slice(src,stride,image_width,image_height,0,0); -} - -uint32_t __FASTCALL__ vo_draw_slice(const uint8_t *src[], unsigned stride[], - unsigned w,unsigned h,unsigned x,unsigned y) -{ - unsigned i,_w[4],_h[4]; - MSG_DBG3("dri_vo_dbg: vo_draw_slice xywh=%i %i %i %i\n",x,y,w,h); + unsigned i,_w[4],_h[4],x,y; + MSG_DBG3("dri_vo_dbg: vo_draw_slice xywh=%i %i %i %i\n",mpi->x,mpi->y,mpi->w,mpi->h); if(has_dri) { uint8_t *dst[4]; @@ -709,15 +687,17 @@ { dst[i]=dri_surf[xp_frame].planes[i]+dri_off[i]; dstStride[i]=dri_cap.strides[i]; - dst[i]+=((y*dstStride[i])*vod.y_mul[i])/vod.y_div[i]; - dst[i]+=(x*vod.x_mul[i])/vod.x_div[i]; - _w[i]=(w*vod.x_mul[i])/vod.x_div[i]; - _h[i]=(h*vod.y_mul[i])/vod.y_div[i]; - ps_src[i] = src[i] + ps_off[i]; + dst[i]+=((mpi->y*dstStride[i])*vod.y_mul[i])/vod.y_div[i]; + dst[i]+=(mpi->x*vod.x_mul[i])/vod.x_div[i]; + _w[i]=(mpi->w*vod.x_mul[i])/vod.x_div[i]; + _h[i]=(mpi->h*vod.y_mul[i])/vod.y_div[i]; + y = i?(mpi->y>>mpi->chroma_y_shift):mpi->y; + x = i?(mpi->x>>mpi->chroma_x_shift):mpi->x; + ps_src[i] = mpi->planes[i]+(y*mpi->stride[i])+x+ps_off[i]; } for(i=0;i<4;i++) - if(stride[i]) - memcpy_pic(dst[i],ps_src[i],_w[i],_h[i],dstStride[i],stride[i]); + if(mpi->stride[i]) + memcpy_pic(dst[i],ps_src[i],_w[i],_h[i],dstStride[i],mpi->stride[i]); return 0; } return -1; Modified: mplayerxp/libvo/video_out.h =================================================================== --- mplayerxp/libvo/video_out.h 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/libvo/video_out.h 2010-01-17 18:46:44 UTC (rev 106) @@ -173,9 +173,8 @@ extern uint32_t __FASTCALL__ vo_set_frame_num( volatile unsigned * ); extern uint32_t __FASTCALL__ vo_get_active_frame( volatile unsigned * ); extern uint32_t __FASTCALL__ vo_set_active_frame( volatile unsigned * ); -extern uint32_t __FASTCALL__ vo_draw_frame(const uint8_t *src[]); -extern uint32_t __FASTCALL__ vo_draw_slice(const uint8_t *src[], unsigned stride[], - unsigned w,unsigned h,unsigned x,unsigned y); +extern uint32_t __FASTCALL__ vo_draw_frame(const mp_image_t *mpi); +extern uint32_t __FASTCALL__ vo_draw_slice(const mp_image_t *mpi); extern void vo_change_frame(void); extern void vo_flush_pages(void); extern void vo_draw_osd(void); Modified: mplayerxp/mp_image.c =================================================================== --- mplayerxp/mp_image.c 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/mp_image.c 2010-01-17 18:46:44 UTC (rev 106) @@ -211,16 +211,10 @@ } } -void mpi_fake_slice(mp_image_t *dmpi,const mp_image_t *mpi,unsigned y,unsigned height) +void mpi_fake_slice(mp_image_t *dmpi,const mp_image_t *mpi,unsigned y,unsigned h) { - unsigned uv_off = (y>>mpi->chroma_y_shift); *dmpi = *mpi; - dmpi->planes[0] = mpi->planes[0] + (mpi->stride[0]*y); - dmpi->planes[1] = mpi->planes[1] + (mpi->stride[1]*uv_off); - dmpi->planes[2] = mpi->planes[2] + (mpi->stride[2]*uv_off); - dmpi->planes[3] = mpi->planes[3] + (mpi->stride[3]*uv_off); - dmpi->qscale = mpi->qscale + (mpi->qstride*y); - dmpi->y = 0; - dmpi->h = height; - dmpi->chroma_height = (height >> mpi->chroma_y_shift); + dmpi->y = y; + dmpi->h = h; + dmpi->chroma_height = h >> mpi->chroma_y_shift; } Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/mplayer.c 2010-01-17 18:46:44 UTC (rev 106) @@ -1207,8 +1207,9 @@ pinfo[xp_id].current_module=NULL; } #endif - + // DVD sub: +#if 0 if(vo_flags & 0x08){ static vo_mpegpes_t packet; static vo_mpegpes_t *pkg=&packet; @@ -1218,7 +1219,9 @@ MSG_V("\rDVD sub: len=%d v_pts=%5.3f s_pts=%5.3f \n",packet.size,v_pts,d_dvdsub->pts); vo_draw_frame(&pkg); } - }else if(vo_spudec){ + }else +#endif + if(vo_spudec){ unsigned char* packet=NULL; int len,timestamp; pinfo[xp_id].current_module="spudec"; Modified: mplayerxp/postproc/vf.c =================================================================== --- mplayerxp/postproc/vf.c 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/postproc/vf.c 2010-01-17 18:46:44 UTC (rev 106) @@ -151,7 +151,7 @@ mp_image_t* __FASTCALL__ vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h){ mp_image_t* mpi=NULL; int w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?((w+15)&(~15)):w; - + if(vf->put_slice==vf_next_put_slice){ // passthru mode, if the plugin uses the fallback/default put_image() code return vf_get_image(vf->next,outfmt,mp_imgtype,mp_imgflag,w,h); @@ -187,14 +187,10 @@ mpi->type=mp_imgtype; mpi->w=w; mpi->h=h; // keep buffer allocation status & color flags only: -// mpi->flags&=~(MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE|MP_IMGFLAG_DIRECT); mpi->flags&=MP_IMGFLAG_ALLOCATED|MP_IMGFLAG_TYPE_DISPLAYED|MP_IMGFLAGMASK_COLORS; // accept restrictions & draw_slice flags only: mpi->flags|=mp_imgflag&(MP_IMGFLAGMASK_RESTRICTIONS|MP_IMGFLAG_DRAW_CALLBACK); -/* this not for mpxp because draw_slice is always present */ -// if(!vf->draw_slice) mpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK; if(mpi->width!=w2 || mpi->height!=h){ -// printf("vf.c: MPI parameters changed! %dx%d -> %dx%d \n", mpi->width,mpi->height,w2,h); if(mpi->flags&MP_IMGFLAG_ALLOCATED){ if(mpi->width<w2 || mpi->height<h){ // need to re-allocate buffer memory: @@ -202,11 +198,9 @@ mpi->flags&=~MP_IMGFLAG_ALLOCATED; MSG_V("vf.c: have to REALLOCATE buffer memory :(\n"); } -// } else { - } { - mpi->width=w2; mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift; - mpi->height=h; mpi->chroma_height=(h + (1<<mpi->chroma_y_shift) - 1)>>mpi->chroma_y_shift; } + mpi->width=w2; mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift; + mpi->height=h; mpi->chroma_height=(h + (1<<mpi->chroma_y_shift) - 1)>>mpi->chroma_y_shift; } if(!mpi->bpp) mp_image_setfmt(mpi,outfmt); if(!(mpi->flags&MP_IMGFLAG_ALLOCATED) && mpi->type>MP_IMGTYPE_EXPORT){ @@ -214,32 +208,32 @@ // check libvo first! if(vf->get_image) vf->get_image(vf,mpi); - if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ - // non-direct and not yet allocated image. allocate it! - - // check if codec prefer aligned stride: + if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ + // non-direct and not yet allocated image. allocate it! + + // check if codec prefer aligned stride: if(mp_imgflag&MP_IMGFLAG_PREFER_ALIGNED_STRIDE){ int align=(mpi->flags&MP_IMGFLAG_PLANAR && mpi->flags&MP_IMGFLAG_YUV) ? (8<<mpi->chroma_x_shift)-1 : 15; // -- maybe FIXME w2=((w+align)&(~align)); if(mpi->width!=w2){ - // we have to change width... check if we CAN co it: + // we have to change width... check if we CAN co it: int flags=vf->query_format(vf,outfmt,w,h); // should not fail if(!(flags&3)) MSG_WARN("??? vf_get_image{vf->query_format(outfmt)} failed!\n"); // printf("query -> 0x%X \n",flags); if(flags&VFCAP_ACCEPT_STRIDE){ - mpi->width=w2; + mpi->width=w2; mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift; } } } - + // IF09 - allocate space for 4. plane delta info - unused if (mpi->imgfmt == IMGFMT_IF09) { mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8+ - mpi->chroma_width*mpi->chroma_height); + mpi->chroma_width*mpi->chroma_height); /* export delta table */ mpi->planes[3]=mpi->planes[0]+(mpi->width*mpi->height)+2*(mpi->chroma_width*mpi->chroma_height); } @@ -247,9 +241,9 @@ mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); if(mpi->flags&MP_IMGFLAG_PLANAR){ // YV12/I420/YVU9/IF09. feel free to add other planar formats here... - //if(!mpi->stride[0]) + //if(!mpi->stride[0]) mpi->stride[0]=mpi->width; - //if(!mpi->stride[1]) + //if(!mpi->stride[1]) mpi->stride[1]=mpi->stride[2]=mpi->chroma_width; // YV12,I420/IYUV,YVU9,IF09 (Y,V,U) mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height; @@ -283,9 +277,6 @@ } } -// printf("\rVF_MPI: %p %p %p %d %d %d \n", -// mpi->planes[0],mpi->planes[1],mpi->planes[2], -// mpi->stride[0],mpi->stride[1],mpi->stride[2]); return mpi; } Modified: mplayerxp/postproc/vf_scale.c =================================================================== --- mplayerxp/postproc/vf_scale.c 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/postproc/vf_scale.c 2010-01-17 18:46:44 UTC (rev 106) @@ -342,6 +342,7 @@ stride[2]=mpi->stride[2]; } } + MSG_DBG2("vf_scale.put_slice was called\n"); dmpi=vf_get_image(vf->next,vf->priv->fmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE, vf->priv->w, vf->priv->h); @@ -583,12 +584,13 @@ { NULL, 0, 0} }; #endif +/* note: sclices give unstable performance */ const vf_info_t vf_info_scale = { "software scaling", "scale", "A'rpi", "", - VF_FLAGS_THREADS|VF_FLAGS_SLICES, + VF_FLAGS_THREADS, vf_open }; @@ -598,7 +600,7 @@ "fmtcvt", "A'rpi", "", - VF_FLAGS_THREADS|VF_FLAGS_SLICES, + VF_FLAGS_THREADS, vf_open }; Modified: mplayerxp/postproc/vf_vo.c =================================================================== --- mplayerxp/postproc/vf_vo.c 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/postproc/vf_vo.c 2010-01-17 18:46:44 UTC (rev 106) @@ -72,6 +72,7 @@ static int __FASTCALL__ control(struct vf_instance_s* vf, int request, void* data) { + MSG_DBG2("vf_control: %u\n",request); switch(request){ case VFCTRL_CHANGE_FRAME: { @@ -118,9 +119,13 @@ mp_image_t *mpi){ int retval; unsigned i; + struct vf_priv_s *priv = vf->priv; retval=vo_get_surface(mpi); - if(retval==VO_TRUE) + if(retval==VO_TRUE) { mpi->flags |= MP_IMGFLAG_FINAL|MP_IMGFLAG_DIRECT; + MSG_DBG2("vf_vo_get_image was called successfully\n"); + } + MSG_DBG2("vf_vo_get_image was called failed\n"); } static int __FASTCALL__ put_slice(struct vf_instance_s* vf, @@ -129,7 +134,7 @@ if(!(mpi->flags & MP_IMGFLAG_FINAL) || (vf->sh->vfilter==vf && !(mpi->flags & MP_IMGFLAG_RENDERED))) { MSG_DBG2("vf_vo_draw_slice was called %u %u %u %u\n",mpi->x,mpi->y,mpi->w,mpi->h); - vo_draw_slice(mpi->planes,mpi->stride,mpi->w,mpi->h,mpi->x,mpi->y); + vo_draw_slice(mpi); } return 1; } Modified: mplayerxp/postproc/vf_yuvcsp.c =================================================================== --- mplayerxp/postproc/vf_yuvcsp.c 2010-01-17 10:28:27 UTC (rev 105) +++ mplayerxp/postproc/vf_yuvcsp.c 2010-01-17 18:46:44 UTC (rev 106) @@ -47,8 +47,8 @@ cb_out = vf->dmpi->planes[1]; cr_out = vf->dmpi->planes[2]; - for (i = 0; i < mpi->height; i++) - for (j = mpi->x; j < mpi->width; j++) { + for (i = 0; i < mpi->h; i++) + for (j = mpi->x; j < mpi->w; j++) { y = i+mpi->y; x = j+mpi->x; y_out[y*vf->dmpi->stride[0]+x] = clamp_y(y_in[y*mpi->stride[0]+x]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-19 17:51:24
|
Revision: 112 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=112&view=rev Author: nickols_k Date: 2010-01-19 17:51:18 +0000 (Tue, 19 Jan 2010) Log Message: ----------- cumulative pathc: enable slices in vf_fmtcvt + pvector based MMX optimization Modified Paths: -------------- TOOLS/Makefile TOOLS/asmopt.c etc/codecs.conf mplayerxp/libmpcodecs/dec_video.c mplayerxp/postproc/dsp.c mplayerxp/postproc/dsp_accel.h mplayerxp/postproc/vf.c mplayerxp/postproc/vf_scale.c Added Paths: ----------- mplayerxp/postproc/dsp_accelf.h Modified: TOOLS/Makefile =================================================================== --- TOOLS/Makefile 2010-01-18 18:37:48 UTC (rev 111) +++ TOOLS/Makefile 2010-01-19 17:51:18 UTC (rev 112) @@ -1,6 +1,6 @@ -include ../mplayerxp/config.mak +include ../mplayerxp/mp_config.mak -CFLAGS = -I.. +CFLAGS = -g3 -I.. OBJS = bios2dump$(EXESUF) \ mem2dump$(EXESUF) \ @@ -12,7 +12,7 @@ ../mplayerxp/libmpdemux/freesdp/libfreesdp.a endif MP_LIBS += ../mplayerxp/libmpcodecs/libmpcodecs.a ../mplayerxp/libao2/libao2.a ../mplayerxp/postproc/libpostproc.a \ -../mplayerxp/postproc/libmenu/libmenu.a ../mplayerxp/input/libinput.a ../mplayerxp/libvo/libvo.a \ +../mplayerxp/input/libinput.a ../mplayerxp/libvo/libvo.a \ ../mplayerxp/osdep/libosdep.a ../mplayerxp/mp_msg.o ../mplayerxp/nls/libnls.a ../mplayerxp/cpudetect.o COMMON_LIBS = $(MP_LIBS) $(EXTRALIBS) -lm Modified: TOOLS/asmopt.c =================================================================== --- TOOLS/asmopt.c 2010-01-18 18:37:48 UTC (rev 111) +++ TOOLS/asmopt.c 2010-01-19 17:51:18 UTC (rev 112) @@ -20,66 +20,48 @@ #include "../mplayerxp/mp_config.h" #include "../mplayerxp/cpudetect.h" -#if defined( ARCH_X86 ) || defined(ARCH_X86_64) -#define CAN_COMPILE_X86_ASM -#endif +#undef OPTIMIZE_AVX +#undef OPTIMIZE_SSE4 +#undef OPTIMIZE_SSSE3 +#undef OPTIMIZE_SSE3 +#undef OPTIMIZE_SSE2 +#undef OPTIMIZE_SSE +#undef OPTIMIZE_MMX2 +#undef OPTIMIZE_MMX +#define RENAME(a) a ## _C +#include "asmopt_template.h" -#ifdef CAN_COMPILE_X86_ASM -#undef HAVE_MMX -#undef HAVE_MMX2 -#undef HAVE_SSE2 -#undef HAVE_SSE3 -#undef HAVE_SSSE3 -#undef HAVE_SSE4 -#undef HAVE_AVX - -/*MMX versions*/ +#ifdef __MMX__ +#define OPTIMIZE_MMX #undef RENAME -#define HAVE_MMX -#undef HAVE_MMX2 #define RENAME(a) a ## _MMX #include "asmopt_template.h" - -/*MMX2 versions*/ +#endif +#ifdef __SSE__ +#define OPTIMIZE_MMX2 #undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 #define RENAME(a) a ## _MMX2 #include "asmopt_template.h" - -/*SSE2 versions*/ +#endif +#ifdef __SSE2__ +#define OPTIMIZE_SSE2 #undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#define HAVE_SSE -#define HAVE_SSE2 #define RENAME(a) a ## _SSE2 #include "asmopt_template.h" - -/*SSE2 versions*/ +#endif +#ifdef __SSE3__ +#define OPTIMIZE_SSE3 #undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#define HAVE_SSE -#define HAVE_SSE2 -#define HAVE_SSE3 #define RENAME(a) a ## _SSE3 #include "asmopt_template.h" - #endif - -/* generic version */ +#ifdef __SSE4_1__ +#define OPTIMIZE_SSE4 #undef RENAME -#undef HAVE_MMX -#undef HAVE_MMX2 -#undef HAVE_SSE2 -#undef HAVE_SSE3 -#undef HAVE_SSSE3 -#undef HAVE_SSE4 -#undef HAVE_AVX -#define RENAME(a) a ## _C +#define RENAME(a) a ## _SSE4 #include "asmopt_template.h" +#endif #define ARR_SIZE (1024*64*2)*10 unsigned verbose=1; @@ -155,11 +137,17 @@ gCpuCaps.hasSSE, gCpuCaps.hasSSE2); test_simd("asmopt.gen" ,"GENERIC:",convert_C); -#ifdef CAN_COMPILE_X86_ASM // ordered per speed fasterst first +#ifdef __SSE3__ if(gCpuCaps.hasSSE3) test_simd("asmopt.sse3","SSE3 :",convert_SSE3); +#endif +#ifdef __SSE2__ if(gCpuCaps.hasSSE2) test_simd("asmopt.sse2","SSE2 :",convert_SSE2); +#endif +#ifdef __MMX2__ if(gCpuCaps.hasMMX2) test_simd("asmopt.mmx2","MMX2 :",convert_MMX2); +#endif +#ifdef __MMX__ if(gCpuCaps.hasMMX) test_simd("asmopt.mmx", "MMX :",convert_MMX); #endif return 0; Modified: etc/codecs.conf =================================================================== --- etc/codecs.conf 2010-01-18 18:37:48 UTC (rev 111) +++ etc/codecs.conf 2010-01-19 17:51:18 UTC (rev 112) @@ -2219,7 +2219,7 @@ videocodec ffwmv3 info "Windows Media Video 9 DMO" - status untested + status working fourcc WMV3,wmv3 fourcc WMVP,wmvp driver ffmpeg Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2010-01-18 18:37:48 UTC (rev 111) +++ mplayerxp/libmpcodecs/dec_video.c 2010-01-19 17:51:18 UTC (rev 112) @@ -167,8 +167,9 @@ if(enable_gomp) { smp_num_cpus=omp_get_num_procs(); use_vf_threads=0; - MSG_DBG2("[mpdec] vf_flags=%08X num_cpus=%u\n",sh_video->vf_flags,smp_num_cpus); if(((sh_video->vf_flags&MPDEC_THREAD_COND)==MPDEC_THREAD_COND) && (smp_num_cpus>1)) use_vf_threads=1; + if(use_vf_threads) + MSG_STATUS("[mpdec] will perform parallel video-filter on %u CPUs\n",smp_num_cpus); } #else MSG_V("[mpdec] GOMP was not compiled-in! Using single threaded video filtering!\n"); Modified: mplayerxp/postproc/dsp.c =================================================================== --- mplayerxp/postproc/dsp.c 2010-01-18 18:37:48 UTC (rev 111) +++ mplayerxp/postproc/dsp.c 2010-01-19 17:51:18 UTC (rev 112) @@ -20,6 +20,59 @@ #endif #include "dsp.h" +extern uint32_t load24bit(void* data, int pos); +extern void store24bit(void* data, int pos, uint32_t expanded_value); + +/* MMX optimized stugff */ +#include <limits.h> +#include "../mp_config.h" +#include "../cpudetect.h" + +#undef OPTIMIZE_AVX +#undef OPTIMIZE_SSE4 +#undef OPTIMIZE_SSSE3 +#undef OPTIMIZE_SSE3 +#undef OPTIMIZE_SSE2 +#undef OPTIMIZE_SSE +#undef OPTIMIZE_MMX2 +#undef OPTIMIZE_MMX +#define RENAME(a) a ## _c +#include "dsp_accel.h" +#include "dsp_accelf.h" + +#ifndef __x86_64__ +#ifdef __MMX__ +#define OPTIMIZE_MMX +#undef RENAME +#define RENAME(a) a ## _MMX +#include "dsp_accel.h" +#endif +#ifdef __SSE__ +#define OPTIMIZE_MMX2 +#undef RENAME +#define RENAME(a) a ## _MMX2 +#include "dsp_accel.h" +#endif +#endif //__x86_64__ +#ifdef __SSE2__ +#define OPTIMIZE_SSE2 +#undef RENAME +#define RENAME(a) a ## _SSE2 +#include "dsp_accel.h" +#endif +#ifdef __SSE3__ +#define OPTIMIZE_SSE3 +#undef RENAME +#define RENAME(a) a ## _SSE3 +#include "dsp_accel.h" +#endif +#ifdef __SSE4_1__ +#define OPTIMIZE_SSE4 +#undef RENAME +#define RENAME(a) a ## _SSE4 +#include "dsp_accel.h" +#endif + /****************************************************************************** * FIR filter implementations ******************************************************************************/ @@ -199,7 +252,7 @@ g += w[end-i-1] * (t3 + t2); // Total gain in filter w[end-i-1] = w[n-end+i] = w[end-i-1] * (t2 - t3); } - } + } else{ // Band stop if (!o) // Band stop filters must have odd length return -1; @@ -219,9 +272,9 @@ // Normalize gain g=1/g; - for (i=0; i<n; i++) + for (i=0; i<n; i++) w[i] *= g; - + return 0; } @@ -244,7 +297,7 @@ int i; // Counters int j; _ftype_t t; // g * w[i] - + // Sanity check if(l<1 || k<1 || !w || !pw) return -1; @@ -277,7 +330,7 @@ /* Pre-warp the coefficients of a numerator or denominator. Note that a0 is assumed to be 1, so there is no wrapping - of it. + of it. */ void __FASTCALL__ prewarp(_ftype_t* a, _ftype_t fc, _ftype_t fs) { @@ -560,7 +613,7 @@ *w++ = 0.2810638602 - 0.5208971735*cos(k1*(_ftype_t)i) + 0.1980389663*cos(k2*(_ftype_t)i); } -/* Computes the 0th order modified Bessel function of the first kind. +/* Computes the 0th order modified Bessel function of the first kind. // (Needed to compute Kaiser window) // // y = sum( (x/(2*n))^2 ) @@ -654,81 +707,30 @@ bp->prev = bp->pprev = 0.0; } -extern uint32_t load24bit(void* data, int pos); -extern void store24bit(void* data, int pos, uint32_t expanded_value); - - -/* MMX optimized stugff */ -#include <limits.h> -#include "../mp_config.h" -#include "../cpudetect.h" - -#undef HAVE_MMX -#undef HAVE_MMX2 -#undef HAVE_3DNOW -#undef HAVE_3DNOW2 -#undef HAVE_SSE -#define RENAME(a) a ## _c -#include "dsp_accel.h" - -#if defined( ARCH_X86 ) || defined(ARCH_X86_64) -#define CAN_COMPILE_X86_ASM +static void __FASTCALL__ init_change_bps(const void* in, void* out, unsigned len, unsigned inbps, unsigned outbps) +{ +#ifdef __SSE4_1__ + if(gCpuCaps.hasSSE41) change_bps = change_bps_SSE4; + else #endif -#ifdef CAN_COMPILE_X86_ASM -//MMX versions -#ifdef CAN_COMPILE_MMX -#undef RENAME -#define HAVE_MMX -#undef HAVE_MMX2 -#undef HAVE_3DNOW -#define RENAME(a) a ## _MMX -#include "dsp_accel.h" +#ifdef __SSE3__ + if(gCpuCaps.hasSSE3) change_bps = change_bps_SSE3; + else #endif - -//3DNow! versions -#ifdef CAN_COMPILE_3DNOW -#undef RENAME -#define HAVE_MMX -#undef HAVE_MMX2 -#define HAVE_3DNOW -#define RENAME(a) a ## _3DNow -#include "dsp_accel.h" +#ifdef __SSE2__ + if(gCpuCaps.hasSSE2) change_bps = change_bps_SSE2; + else #endif - -//3DNowEx! versions -#ifdef CAN_COMPILE_3DNOW2 -#undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#define HAVE_3DNOW -#define HAVE_3DNOW2 -#define RENAME(a) a ## _3DNowEx -#include "dsp_accel.h" -#endif - -//MMX2 versions -#ifdef CAN_COMPILE_MMX2 -#undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#undef HAVE_3DNOW -#define RENAME(a) a ## _MMX2 -#include "dsp_accel.h" -#endif - -#endif - -static void __FASTCALL__ init_change_bps(const void* in, void* out, unsigned len, unsigned inbps, unsigned outbps) -{ -#ifdef CAN_COMPILE_MMX -/* disable these functions for speed reason ! +#ifndef __x86_64__ +#ifdef __SSE__ if(gCpuCaps.hasMMX2) change_bps = change_bps_MMX2; else - if(gCpuCaps.has3DNow) change_bps = change_bps_3DNow; - else */ +#endif +#ifdef __MMX__ if(gCpuCaps.hasMMX) change_bps = change_bps_MMX; else -#endif //CAN_COMPILE_X86_ASM +#endif +#endif /* __x86_64__ */ change_bps = change_bps_c; (*change_bps)(in,out,len,inbps,outbps); } @@ -736,7 +738,7 @@ static void __FASTCALL__ init_float2int(void* in, void* out, int len, int bps) { -#ifdef CAN_COMPILE_X86_ASM +#if 0 #ifdef CAN_COMPILE_3DNOW2 if(gCpuCaps.has3DNowExt) float2int = float2int_3DNowEx; else @@ -753,7 +755,7 @@ static void __FASTCALL__ init_int2float(void* in, void* out, int len, int bps) { -#ifdef CAN_COMPILE_X86_ASM +#if 0 #ifdef CAN_COMPILE_3DNOW2 if(gCpuCaps.has3DNowExt) int2float = int2float_3DNowEx; else @@ -771,16 +773,20 @@ static int32_t __FASTCALL__ FIR_i16_init(int16_t *x,int16_t *w) { -#ifdef CAN_COMPILE_X86_ASM -#ifdef CAN_COMPILE_MMX2 +#ifdef __SSE2__ + if(gCpuCaps.hasSSE2) FIR_i16 = FIR_i16_SSE2; + else +#endif +#ifndef __x86_64__ +#ifdef __SSE__ if(gCpuCaps.hasMMX2) FIR_i16 = FIR_i16_MMX2; else #endif -#ifdef CAN_COMPILE_MMX +#ifdef __MMX__ if(gCpuCaps.hasMMX) FIR_i16 = FIR_i16_MMX; else #endif -#endif /*CAN_COMPILE_X86_ASM*/ +#endif /*__x86_64__*/ FIR_i16 = FIR_i16_c; return (*FIR_i16)(x,w); } @@ -788,7 +794,7 @@ static float __FASTCALL__ FIR_f32_init(float *x,float *w) { -#ifdef CAN_COMPILE_X86_ASM +#if 0 // if(gCpuCaps.hasSSE) FIR_f32 = FIR_f32_SSE; // else #ifdef CAN_COMPILE_3DNOW Modified: mplayerxp/postproc/dsp_accel.h =================================================================== --- mplayerxp/postproc/dsp_accel.h 2010-01-18 18:37:48 UTC (rev 111) +++ mplayerxp/postproc/dsp_accel.h 2010-01-19 17:51:18 UTC (rev 112) @@ -1,18 +1,64 @@ /* DSP acceleration routines */ -#include "../mmx_defs.h" +#include "pvector/pvector.h" +#ifdef HAVE_INT_PVECTOR +static __inline __m64 __attribute__((__gnu_inline__, __always_inline__)) +RENAME(_m_load)(const void *__P) +{ + return *(const __m64 *)__P; +} +#undef _m_load +#define _m_load RENAME(_m_load) +static __inline __m64 __attribute__((__gnu_inline__, __always_inline__)) +RENAME(_m_load_half)(const void *__P) +{ + return _mm_cvtsi32_si64 (*(const int *)__P); +} +#undef _m_load_half +#define _m_load_half RENAME(_m_load_half) + +static __inline void __attribute__((__gnu_inline__, __always_inline__)) +RENAME(_m_store)(void *__P, __m64 src) +{ + *(__m64 *)__P = src; +} +#undef _m_store +#define _m_store RENAME(_m_store) + +static __inline void __attribute__((__gnu_inline__, __always_inline__)) +RENAME(_m_store_half)(void *__P, __m64 src) +{ + *(int *)__P = _mm_cvtsi64_si32(src); +} +#undef _m_store_half +#define _m_store_half RENAME(_m_store_half) + +static __inline void __attribute__((__gnu_inline__, __always_inline__)) +RENAME(_m_movntq)(void *__P, __m64 src) +{ +#ifdef HAVE_MMX2 + _mm_stream_pi(__P,src); +#else + _m_store(__P,src); +#endif +} +#undef _m_movntq +#define _m_movntq RENAME(_m_movntq) +#endif + static void __FASTCALL__ RENAME(change_bps)(const void* in_data, void* out_data, unsigned len, unsigned inbps, unsigned outbps) { -#ifdef HAVE_MMX - unsigned len_mm; +#ifdef HAVE_INT_PVECTOR + __ivec izero = _ivec_setzero(); + unsigned len_mm,j; #endif - register unsigned i; + unsigned i; // Change the number of bits switch(inbps){ case 1: switch(outbps){ case 2: - i=0; + i=0; for(;i<len;i++) ((uint16_t*)out_data)[i]=((uint16_t)((uint8_t*)in_data)[i])<<8; break; @@ -23,7 +69,7 @@ ((uint8_t*)out_data)[3*i+2]=(((uint8_t*)in_data)[i]); break; case 4: - i=0; + i=0; for(;i<len;i++) ((uint32_t*)out_data)[i]=((uint32_t)((uint8_t*)in_data)[i])<<24; break; @@ -32,7 +78,7 @@ case 2: switch(outbps){ case 1: - i=0; + i=0; for(;i<len;i++) ((uint8_t*)out_data)[i]=(uint8_t)((((uint16_t*)in_data)[i])>>8); break; @@ -44,48 +90,27 @@ break; case 4: i=0; -#ifdef HAVE_MMX - len_mm=len&(~0xF); - for(;i<len_mm;i+=16) +#ifdef HAVE_INT_PVECTOR + j=0; + len_mm=len&(~(__IVEC_SIZE-1)); + for(;i<len;i++,j+=2){ + ((uint32_t*)out_data)[i]=((uint32_t)((uint16_t*)in_data)[i])<<16; + if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + } + if((len_mm-i)>=__IVEC_SIZE) + for(;i<len_mm;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) { - __asm __volatile( - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "pxor %%mm4, %%mm4\n\t" - "pxor %%mm5, %%mm5\n\t" - "pxor %%mm6, %%mm6\n\t" - "pxor %%mm7, %%mm7\n\t" - "punpcklwd %%mm0, %%mm4\n\t" - "punpckhwd %%mm0, %%mm5\n\t" - "punpcklwd %%mm1, %%mm6\n\t" - "punpckhwd %%mm1, %%mm7\n\t" - MOVNTQ" %%mm4, (%0)\n\t" - MOVNTQ" %%mm5, 8(%0)\n\t" - MOVNTQ" %%mm6, 16(%0)\n\t" - MOVNTQ" %%mm7, 24(%0)\n\t" - "pxor %%mm4, %%mm4\n\t" - "pxor %%mm5, %%mm5\n\t" - "pxor %%mm6, %%mm6\n\t" - "pxor %%mm7, %%mm7\n\t" - "punpcklwd %%mm2, %%mm4\n\t" - "punpckhwd %%mm2, %%mm5\n\t" - "punpcklwd %%mm3, %%mm6\n\t" - "punpckhwd %%mm3, %%mm7\n\t" - MOVNTQ" %%mm4, 32(%0)\n\t" - MOVNTQ" %%mm5, 40(%0)\n\t" - MOVNTQ" %%mm6, 48(%0)\n\t" - MOVNTQ" %%mm7, 56(%0)\n\t" - ::"r"(&(((uint32_t*)out_data)[i])),"r"(&(((uint16_t*)in_data)[i])) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED + __ivec ind,tmp[2]; + ind = _ivec_loadu(&((uint8_t *)in_data)[j]); +#if 0 /* slower but portable on non-x86 CPUs version */ + tmp[0]= _ivec_sll_s32_imm(_ivec_u32_from_lou16(ind),16); + tmp[1]= _ivec_sll_s32_imm(_ivec_u32_from_hiu16(ind),16); +#else + tmp[0]= _ivec_interleave_lo_u16(izero,ind); + tmp[1]= _ivec_interleave_hi_u16(izero,ind); #endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); + _ivec_storea(&((uint8_t *)out_data)[j*2],tmp[0]); + _ivec_storea(&((uint8_t *)out_data)[j*2+__IVEC_SIZE],tmp[1]); } #endif for(;i<len;i++) @@ -120,50 +145,27 @@ case 4: switch(outbps){ case 1: - i=0; + i=0; for(;i<len;i++) ((uint8_t*)out_data)[i]=(uint8_t)((((uint32_t*)in_data)[i])>>24); break; case 2: i=0; -#ifdef HAVE_MMX - len_mm=len&(~0xF); - for(;i<len_mm;i+=16) +#ifdef HAVE_INT_PVECTOR + j=0; + len_mm=len&(~(__IVEC_SIZE-1)); + for(;i<len;i++,j+=2){ + ((uint16_t*)out_data)[i]=(uint16_t)((((uint32_t*)in_data)[i])>>16); + if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + } + if((len-i)>=__IVEC_SIZE) + for(;i<len_mm;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) { - __asm __volatile( - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "movq 32(%1), %%mm4\n\t" - "movq 40(%1), %%mm5\n\t" - "movq 48(%1), %%mm6\n\t" - "movq 56(%1), %%mm7\n\t" - "psrad $16, %%mm0\n\t" - "psrad $16, %%mm1\n\t" - "psrad $16, %%mm2\n\t" - "psrad $16, %%mm3\n\t" - "psrad $16, %%mm4\n\t" - "psrad $16, %%mm5\n\t" - "psrad $16, %%mm6\n\t" - "psrad $16, %%mm7\n\t" - "packssdw %%mm1, %%mm0\n\t" - "packssdw %%mm3, %%mm2\n\t" - "packssdw %%mm5, %%mm4\n\t" - "packssdw %%mm7, %%mm6\n\t" - MOVNTQ" %%mm0, (%0)\n\t" - MOVNTQ" %%mm2, 8(%0)\n\t" - MOVNTQ" %%mm4, 16(%0)\n\t" - MOVNTQ" %%mm6, 24(%0)\n\t" - ::"r"(&(((uint16_t*)out_data)[i])),"r"(&(((uint32_t*)in_data)[i])) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); + __ivec ind[2],tmp; + ind[0]= _ivec_sra_s32_imm(_ivec_loadu(&((uint8_t *)in_data)[j*2]),16); + ind[1]= _ivec_sra_s32_imm(_ivec_loadu(&((uint8_t *)in_data)[j*2+__IVEC_SIZE]),16); + tmp = _ivec_s16_from_s32(ind[0],ind[1]); + _ivec_storea(&((uint8_t *)out_data)[j],tmp); } #endif for(;i<len;i++) @@ -176,364 +178,40 @@ ((uint8_t*)out_data)[3*i+2]=(((uint8_t*)in_data)[4*i+3]); break; } - break; + break; } -#ifdef HAVE_MMX -#ifndef HAVE_MMX1 - asm volatile(SFENCE:::"memory"); +#ifdef HAVE_INT_PVECTOR + _ivec_sfence(); + _ivec_empty(); #endif - asm volatile(EMMS:: - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); -#endif /* HAVE_MMX */ } -static void __FASTCALL__ RENAME(float2int)(void* in, void* out, int len, int bps) +static int32_t __FASTCALL__ RENAME(FIR_i16)(int16_t *x,int16_t *w) { -#ifdef HAVE_3DNOW - unsigned len_mm; - float tmp_f32[2]; -#endif - float ftmp; - register int i; - switch(bps){ - case(1): - for(i=0;i<len;i++) { - ftmp=((float*)in)[i]; - SATURATE(ftmp,-1.0,+1.0); - ((int8_t*)out)[i]=(int8_t)lrintf(SCHAR_MAX*ftmp); - } - break; - case(2): - i=0; -#ifdef HAVE_3DNOW - len_mm=len&(~15); - tmp_f32[0]= - tmp_f32[1]=SHRT_MAX; - for(;i<len_mm;i+=16) - { - __asm __volatile( - PREFETCH" 64(%1)\n\t" - PREFETCHW" 32(%0)\n\t" - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "movq 32(%1), %%mm4\n\t" - "movq 40(%1), %%mm5\n\t" - "movq 48(%1), %%mm6\n\t" - "movq 56(%1), %%mm7\n\t" - "pfmul %2, %%mm0\n\t" - "pfmul %2, %%mm1\n\t" - "pfmul %2, %%mm2\n\t" - "pfmul %2, %%mm3\n\t" - "pfmul %2, %%mm4\n\t" - "pfmul %2, %%mm5\n\t" - "pfmul %2, %%mm6\n\t" - "pfmul %2, %%mm7\n\t" - "pf2id %%mm0, %%mm0\n\t" - "pf2id %%mm1, %%mm1\n\t" - "pf2id %%mm2, %%mm2\n\t" - "pf2id %%mm3, %%mm3\n\t" - "pf2id %%mm4, %%mm4\n\t" - "pf2id %%mm5, %%mm5\n\t" - "pf2id %%mm6, %%mm6\n\t" - "pf2id %%mm7, %%mm7\n\t" - "packssdw %%mm1, %%mm0\n\t" - "packssdw %%mm3, %%mm2\n\t" - "packssdw %%mm5, %%mm4\n\t" - "packssdw %%mm7, %%mm6\n\t" - "movq %%mm0, (%0)\n\t" - "movq %%mm2, 8(%0)\n\t" - "movq %%mm4, 16(%0)\n\t" - "movq %%mm6, 24(%0)" - ::"r"(&(((uint16_t*)out)[i])),"r"(&(((float*)in)[i])),"m"(tmp_f32[0]) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - } -#endif - for(;i<len;i++) { - ftmp=((float*)in)[i]; - SATURATE(ftmp,-1.0,+1.0); - ((int16_t*)out)[i]=(int16_t)lrintf(SHRT_MAX*ftmp); - } - break; - case(3): - for(i=0;i<len;i++) { - ftmp=((float*)in)[i]; - SATURATE(ftmp,-1.0,+1.0); - store24bit(out, i, (int32_t)lrintf((INT_MAX-1)*ftmp)); - } - break; - case(4): - i=0; -#ifdef HAVE_3DNOW - len_mm=len&(~15); - tmp_f32[0]= - tmp_f32[1]=INT_MAX; - for(;i<len_mm;i+=16) - { - __asm __volatile( - PREFETCH" 64(%1)\n\t" - PREFETCHW" 64(%0)\n\t" - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "movq 32(%1), %%mm4\n\t" - "movq 40(%1), %%mm5\n\t" - "movq 48(%1), %%mm6\n\t" - "movq 56(%1), %%mm7\n\t" - "pfmul %2, %%mm0\n\t" - "pfmul %2, %%mm1\n\t" - "pfmul %2, %%mm2\n\t" - "pfmul %2, %%mm3\n\t" - "pfmul %2, %%mm4\n\t" - "pfmul %2, %%mm5\n\t" - "pfmul %2, %%mm6\n\t" - "pfmul %2, %%mm7\n\t" - "pf2id %%mm0, %%mm0\n\t" - "pf2id %%mm1, %%mm1\n\t" - "pf2id %%mm2, %%mm2\n\t" - "pf2id %%mm3, %%mm3\n\t" - "pf2id %%mm4, %%mm4\n\t" - "pf2id %%mm5, %%mm5\n\t" - "pf2id %%mm6, %%mm6\n\t" - "pf2id %%mm7, %%mm7\n\t" - "movq %%mm0, (%0)\n\t" - "movq %%mm1, 8(%0)\n\t" - "movq %%mm2, 16(%0)\n\t" - "movq %%mm3, 24(%0)\n\t" - "movq %%mm4, 32(%0)\n\t" - "movq %%mm5, 40(%0)\n\t" - "movq %%mm6, 48(%0)\n\t" - "movq %%mm7, 56(%0)" - ::"r"(&(((uint32_t*)out)[i])),"r"(&(((float*)in)[i])),"m"(tmp_f32[0]) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - } -#endif - for(;i<len;i++) { - ftmp=((float*)in)[i]; - SATURATE(ftmp,-1.0,+1.0); - ((int32_t*)out)[i]=(int32_t)lrintf((INT_MAX-1)*ftmp); - } - break; - } -#ifdef HAVE_3DNOW - asm volatile(EMMS:: - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); -#endif -} +#ifdef OPTIMIZE_MMX + __m64 mm[8]; + mm[0] = _m_load(&w[0]); + mm[1] = _m_load(&w[4]); + mm[2] = _m_load(&w[8]); + mm[3] = _m_load(&w[12]); -static void __FASTCALL__ RENAME(int2float)(void* in, void* out, int len, int bps) -{ -#ifdef HAVE_3DNOW - unsigned len_mm; - float tmp_f32[2]; -#endif - register int i; - switch(bps){ - case(1): - for(i=0;i<len;i++) - ((float*)out)[i]=(1.0/SCHAR_MAX)*((float)((int8_t*)in)[i]); - break; - case(2): - i=0; -#ifdef HAVE_3DNOW - tmp_f32[0]= - tmp_f32[1]=1.0/INT_MAX; - len_mm=len&(~15); - for(;i<len_mm;i+=16) - { - __asm __volatile( - PREFETCH" 32(%1)\n\t" - PREFETCHW" 64(%0)\n\t" - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "pxor %%mm4, %%mm4\n\t" - "pxor %%mm5, %%mm5\n\t" - "pxor %%mm6, %%mm6\n\t" - "pxor %%mm7, %%mm7\n\t" - "punpcklwd %%mm0, %%mm4\n\t" - "punpckhwd %%mm0, %%mm5\n\t" - "punpcklwd %%mm1, %%mm6\n\t" - "punpckhwd %%mm1, %%mm7\n\t" - "pi2fd %%mm4, %%mm4\n\t" - "pi2fd %%mm5, %%mm5\n\t" - "pi2fd %%mm6, %%mm6\n\t" - "pi2fd %%mm7, %%mm7\n\t" - "pfmul %2, %%mm4\n\t" - "pfmul %2, %%mm5\n\t" - "pfmul %2, %%mm6\n\t" - "pfmul %2, %%mm7\n\t" - "movq %%mm4, (%0)\n\t" - "movq %%mm5, 8(%0)\n\t" - "movq %%mm6, 16(%0)\n\t" - "movq %%mm7, 24(%0)\n\t" - "pxor %%mm4, %%mm4\n\t" - "pxor %%mm5, %%mm5\n\t" - "pxor %%mm6, %%mm6\n\t" - "pxor %%mm7, %%mm7\n\t" - "punpcklwd %%mm2, %%mm4\n\t" - "punpckhwd %%mm2, %%mm5\n\t" - "punpcklwd %%mm3, %%mm6\n\t" - "punpckhwd %%mm3, %%mm7\n\t" - "pi2fd %%mm4, %%mm4\n\t" - "pi2fd %%mm5, %%mm5\n\t" - "pi2fd %%mm6, %%mm6\n\t" - "pi2fd %%mm7, %%mm7\n\t" - "pfmul %2, %%mm4\n\t" - "pfmul %2, %%mm5\n\t" - "pfmul %2, %%mm6\n\t" - "pfmul %2, %%mm7\n\t" - "movq %%mm4, 32(%0)\n\t" - "movq %%mm5, 40(%0)\n\t" - "movq %%mm6, 48(%0)\n\t" - "movq %%mm7, 56(%0)\n\t" - "femms" - ::"r"(&(((float*)out)[i])),"r"(&(((int16_t*)in)[i])),"m"(tmp_f32[0]) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - } -#endif - for(;i<len;i++) - ((float*)out)[i]=(1.0/SHRT_MAX)*((float)((int16_t*)in)[i]); - break; - case(3): - for(i=0;i<len;i++) - ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t)load24bit(in, i))); - break; - case(4): - i=0; -#ifdef HAVE_3DNOW - tmp_f32[0]= - tmp_f32[1]=1.0/INT_MAX; - len_mm=len&(~15); - for(;i<len_mm;i+=16) - { - __asm __volatile( - PREFETCH" 64(%1)\n\t" - PREFETCHW" 64(%0)\n\t" - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "movq 32(%1), %%mm4\n\t" - "movq 40(%1), %%mm5\n\t" - "movq 48(%1), %%mm6\n\t" - "movq 56(%1), %%mm7\n\t" - "pi2fd %%mm0, %%mm0\n\t" - "pi2fd %%mm1, %%mm1\n\t" - "pi2fd %%mm2, %%mm2\n\t" - "pi2fd %%mm3, %%mm3\n\t" - "pi2fd %%mm4, %%mm4\n\t" - "pi2fd %%mm5, %%mm5\n\t" - "pi2fd %%mm6, %%mm6\n\t" - "pi2fd %%mm7, %%mm7\n\t" - "pfmul %2, %%mm0\n\t" - "pfmul %2, %%mm1\n\t" - "pfmul %2, %%mm2\n\t" - "pfmul %2, %%mm3\n\t" - "pfmul %2, %%mm4\n\t" - "pfmul %2, %%mm5\n\t" - "pfmul %2, %%mm6\n\t" - "pfmul %2, %%mm7\n\t" - "movq %%mm0, (%0)\n\t" - "movq %%mm1, 8(%0)\n\t" - "movq %%mm2, 16(%0)\n\t" - "movq %%mm3, 24(%0)\n\t" - "movq %%mm4, 32(%0)\n\t" - "movq %%mm5, 40(%0)\n\t" - "movq %%mm6, 48(%0)\n\t" - "movq %%mm7, 56(%0)\n\t" - "femms" - ::"r"(&(((float*)out)[i])),"r"(&(((int32_t*)in)[i])),"m"(tmp_f32[0]) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - } -#endif - for(;i<len;i++) - ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); - break; - } -} + mm[4] = _m_pmaddwd(mm[0],_m_load(&x[0])); + mm[5] = _m_pmaddwd(mm[1],_m_load(&x[4])); + mm[6] = _m_pmaddwd(mm[2],_m_load(&x[8])); + mm[7] = _m_pmaddwd(mm[3],_m_load(&x[12])); -static int32_t __FASTCALL__ RENAME(FIR_i16)(int16_t *x,int16_t *w) -{ -#ifdef HAVE_MMX - int32_t rval; - __asm __volatile( - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "pmaddwd (%2), %%mm0\n\t" - "pmaddwd 8(%2), %%mm1\n\t" - "pmaddwd 16(%2), %%mm2\n\t" - "pmaddwd 24(%2), %%mm3\n\t" - "paddd %%mm1, %%mm0\n\t" - "paddd %%mm3, %%mm2\n\t" - "paddd %%mm2, %%mm0\n\t" -#ifdef HAVE_MMX2 - "pshufw $0xFE, %%mm0, %%mm1\n\t" + mm[0] = _m_paddd(mm[4],mm[5]); + mm[1] = _m_paddd(mm[6],mm[7]); + mm[2] = _m_paddd(mm[0],mm[1]); +#ifdef OPTIMIZE_MMX2 + mm[0] = _m_pshufw(mm[2],0xFE); #else - "movq %%mm0, %%mm1\n\t" - "psrlq $32, %%mm1\n\t" + mm[0] = mm[2]; + mm[0] = _m_psrlqi(mm[0],32); #endif - "paddd %%mm1, %%mm0\n\t" - "psrld $16, %%mm0\n\t" - "movd %%mm0, %0\n\t" - "emms" - :"=&r"(rval):"r"(w),"r"(x) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - return rval; + mm[0] = _m_paddd(mm[0],mm[2]); + mm[0] = _m_psrldi(mm[0],16); + return _mm_cvtsi64_si32(mm[0]); #else return ( w[0] *x[0] +w[1] *x[1] +w[2] *x[2] +w[3] *x[3] + w[4] *x[4] +w[5] *x[5] +w[6] *x[6] +w[7] *x[7] @@ -542,51 +220,3 @@ #endif } -static float __FASTCALL__ RENAME(FIR_f32)(float *x,float *w) -{ -#ifdef HAVE_3DNOW - float rval; - __asm __volatile( - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "movq 32(%1), %%mm4\n\t" - "movq 40(%1), %%mm5\n\t" - "movq 48(%1), %%mm6\n\t" - "movq 56(%1), %%mm7\n\t" - "pfmul (%2), %%mm0\n\t" - "pfmul 8(%2), %%mm1\n\t" - "pfmul 16(%2), %%mm2\n\t" - "pfmul 24(%2), %%mm3\n\t" - "pfmul 32(%2), %%mm4\n\t" - "pfmul 40(%2), %%mm5\n\t" - "pfmul 48(%2), %%mm6\n\t" - "pfmul 56(%2), %%mm7\n\t" - "pfadd %%mm1, %%mm0\n\t" - "pfadd %%mm3, %%mm2\n\t" - "pfadd %%mm5, %%mm4\n\t" - "pfadd %%mm7, %%mm6\n\t" - "pfadd %%mm2, %%mm0\n\t" - "pfadd %%mm6, %%mm4\n\t" - "pfadd %%mm4, %%mm0\n\t" - "pfacc %%mm0, %%mm0\n\t" - "movd %%mm0, %0\n\t" - "femms" - :"=&r"(rval):"r"(w),"r"(x) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - return rval; -#else - return ( w[0] *x[0] +w[1] *x[1] +w[2] *x[2] +w[3] *x[3] - + w[4] *x[4] +w[5] *x[5] +w[6] *x[6] +w[7] *x[7] - + w[8] *x[8] +w[9] *x[9] +w[10]*x[10]+w[11]*x[11] - + w[12]*x[12]+w[13]*x[13]+w[14]*x[14]+w[15]*x[15] ); -#endif -} Added: mplayerxp/postproc/dsp_accelf.h =================================================================== --- mplayerxp/postproc/dsp_accelf.h (rev 0) +++ mplayerxp/postproc/dsp_accelf.h 2010-01-19 17:51:18 UTC (rev 112) @@ -0,0 +1,354 @@ +/* DSP floating-point acceleration routines */ + +static void __FASTCALL__ RENAME(float2int)(void* in, void* out, int len, int bps) +{ +#ifdef HAVE_3DNOW + unsigned len_mm; + float tmp_f32[2]; +#endif + float ftmp; + register int i; + switch(bps){ + case(1): + for(i=0;i<len;i++) { + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + ((int8_t*)out)[i]=(int8_t)lrintf(SCHAR_MAX*ftmp); + } + break; + case(2): + i=0; +#ifdef HAVE_3DNOW + len_mm=len&(~15); + tmp_f32[0]= + tmp_f32[1]=SHRT_MAX; + for(;i<len_mm;i+=16) + { + __asm __volatile( + PREFETCH" 64(%1)\n\t" + PREFETCHW" 32(%0)\n\t" + "movq (%1), %%mm0\n\t" + "movq 8(%1), %%mm1\n\t" + "movq 16(%1), %%mm2\n\t" + "movq 24(%1), %%mm3\n\t" + "movq 32(%1), %%mm4\n\t" + "movq 40(%1), %%mm5\n\t" + "movq 48(%1), %%mm6\n\t" + "movq 56(%1), %%mm7\n\t" + "pfmul %2, %%mm0\n\t" + "pfmul %2, %%mm1\n\t" + "pfmul %2, %%mm2\n\t" + "pfmul %2, %%mm3\n\t" + "pfmul %2, %%mm4\n\t" + "pfmul %2, %%mm5\n\t" + "pfmul %2, %%mm6\n\t" + "pfmul %2, %%mm7\n\t" + "pf2id %%mm0, %%mm0\n\t" + "pf2id %%mm1, %%mm1\n\t" + "pf2id %%mm2, %%mm2\n\t" + "pf2id %%mm3, %%mm3\n\t" + "pf2id %%mm4, %%mm4\n\t" + "pf2id %%mm5, %%mm5\n\t" + "pf2id %%mm6, %%mm6\n\t" + "pf2id %%mm7, %%mm7\n\t" + "packssdw %%mm1, %%mm0\n\t" + "packssdw %%mm3, %%mm2\n\t" + "packssdw %%mm5, %%mm4\n\t" + "packssdw %%mm7, %%mm6\n\t" + "movq %%mm0, (%0)\n\t" + "movq %%mm2, 8(%0)\n\t" + "movq %%mm4, 16(%0)\n\t" + "movq %%mm6, 24(%0)" + ::"r"(&(((uint16_t*)out)[i])),"r"(&(((float*)in)[i])),"m"(tmp_f32[0]) + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); + } +#endif + for(;i<len;i++) { + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + ((int16_t*)out)[i]=(int16_t)lrintf(SHRT_MAX*ftmp); + } + break; + case(3): + for(i=0;i<len;i++) { + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + store24bit(out, i, (int32_t)lrintf((INT_MAX-1)*ftmp)); + } + break; + case(4): + i=0; +#ifdef HAVE_3DNOW + len_mm=len&(~15); + tmp_f32[0]= + tmp_f32[1]=INT_MAX; + for(;i<len_mm;i+=16) + { + __asm __volatile( + PREFETCH" 64(%1)\n\t" + PREFETCHW" 64(%0)\n\t" + "movq (%1), %%mm0\n\t" + "movq 8(%1), %%mm1\n\t" + "movq 16(%1), %%mm2\n\t" + "movq 24(%1), %%mm3\n\t" + "movq 32(%1), %%mm4\n\t" + "movq 40(%1), %%mm5\n\t" + "movq 48(%1), %%mm6\n\t" + "movq 56(%1), %%mm7\n\t" + "pfmul %2, %%mm0\n\t" + "pfmul %2, %%mm1\n\t" + "pfmul %2, %%mm2\n\t" + "pfmul %2, %%mm3\n\t" + "pfmul %2, %%mm4\n\t" + "pfmul %2, %%mm5\n\t" + "pfmul %2, %%mm6\n\t" + "pfmul %2, %%mm7\n\t" + "pf2id %%mm0, %%mm0\n\t" + "pf2id %%mm1, %%mm1\n\t" + "pf2id %%mm2, %%mm2\n\t" + "pf2id %%mm3, %%mm3\n\t" + "pf2id %%mm4, %%mm4\n\t" + "pf2id %%mm5, %%mm5\n\t" + "pf2id %%mm6, %%mm6\n\t" + "pf2id %%mm7, %%mm7\n\t" + "movq %%mm0, (%0)\n\t" + "movq %%mm1, 8(%0)\n\t" + "movq %%mm2, 16(%0)\n\t" + "movq %%mm3, 24(%0)\n\t" + "movq %%mm4, 32(%0)\n\t" + "movq %%mm5, 40(%0)\n\t" + "movq %%mm6, 48(%0)\n\t" + "movq %%mm7, 56(%0)" + ::"r"(&(((uint32_t*)out)[i])),"r"(&(((float*)in)[i])),"m"(tmp_f32[0]) + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); + } +#endif + for(;i<len;i++) { + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + ((int32_t*)out)[i]=(int32_t)lrintf((INT_MAX-1)*ftmp); + } + break; + } +#ifdef HAVE_3DNOW + asm volatile(EMMS:: + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); +#endif +} + +static void __FASTCALL__ RENAME(int2float)(void* in, void* out, int len, int bps) +{ +#ifdef HAVE_3DNOW + unsigned len_mm; + float tmp_f32[2]; +#endif + register int i; + switch(bps){ + case(1): + for(i=0;i<len;i++) + ((float*)out)[i]=(1.0/SCHAR_MAX)*((float)((int8_t*)in)[i]); + break; + case(2): + i=0; +#ifdef HAVE_3DNOW + tmp_f32[0]= + tmp_f32[1]=1.0/INT_MAX; + len_mm=len&(~15); + for(;i<len_mm;i+=16) + { + __asm __volatile( + PREFETCH" 32(%1)\n\t" + PREFETCHW" 64(%0)\n\t" + "movq (%1), %%mm0\n\t" + "movq 8(%1), %%mm1\n\t" + "movq 16(%1), %%mm2\n\t" + "movq 24(%1), %%mm3\n\t" + "pxor %%mm4, %%mm4\n\t" + "pxor %%mm5, %%mm5\n\t" + "pxor %%mm6, %%mm6\n\t" + "pxor %%mm7, %%mm7\n\t" + "punpcklwd %%mm0, %%mm4\n\t" + "punpckhwd %%mm0, %%mm5\n\t" + "punpcklwd %%mm1, %%mm6\n\t" + "punpckhwd %%mm1, %%mm7\n\t" + "pi2fd %%mm4, %%mm4\n\t" + "pi2fd %%mm5, %%mm5\n\t" + "pi2fd %%mm6, %%mm6\n\t" + "pi2fd %%mm7, %%mm7\n\t" + "pfmul %2, %%mm4\n\t" + "pfmul %2, %%mm5\n\t" + "pfmul %2, %%mm6\n\t" + "pfmul %2, %%mm7\n\t" + "movq %%mm4, (%0)\n\t" + "movq %%mm5, 8(%0)\n\t" + "movq %%mm6, 16(%0)\n\t" + "movq %%mm7, 24(%0)\n\t" + "pxor %%mm4, %%mm4\n\t" + "pxor %%mm5, %%mm5\n\t" + "pxor %%mm6, %%mm6\n\t" + "pxor %%mm7, %%mm7\n\t" + "punpcklwd %%mm2, %%mm4\n\t" + "punpckhwd %%mm2, %%mm5\n\t" + "punpcklwd %%mm3, %%mm6\n\t" + "punpckhwd %%mm3, %%mm7\n\t" + "pi2fd %%mm4, %%mm4\n\t" + "pi2fd %%mm5, %%mm5\n\t" + "pi2fd %%mm6, %%mm6\n\t" + "pi2fd %%mm7, %%mm7\n\t" + "pfmul %2, %%mm4\n\t" + "pfmul %2, %%mm5\n\t" + "pfmul %2, %%mm6\n\t" + "pfmul %2, %%mm7\n\t" + "movq %%mm4, 32(%0)\n\t" + "movq %%mm5, 40(%0)\n\t" + "movq %%mm6, 48(%0)\n\t" + "movq %%mm7, 56(%0)\n\t" + "femms" + ::"r"(&(((float*)out)[i])),"r"(&(((int16_t*)in)[i])),"m"(tmp_f32[0]) + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); + } +#endif + for(;i<len;i++) + ((float*)out)[i]=(1.0/SHRT_MAX)*((float)((int16_t*)in)[i]); + break; + case(3): + for(i=0;i<len;i++) + ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t)load24bit(in, i))); + break; + case(4): + i=0; +#ifdef HAVE_3DNOW + tmp_f32[0]= + tmp_f32[1]=1.0/INT_MAX; + len_mm=len&(~15); + for(;i<len_mm;i+=16) + { + __asm __volatile( + PREFETCH" 64(%1)\n\t" + PREFETCHW" 64(%0)\n\t" + "movq (%1), %%mm0\n\t" + "movq 8(%1), %%mm1\n\t" + "movq 16(%1), %%mm2\n\t" + "movq 24(%1), %%mm3\n\t" + "movq 32(%1), %%mm4\n\t" + "movq 40(%1), %%mm5\n\t" + "movq 48(%1), %%mm6\n\t" + "movq 56(%1), %%mm7\n\t" + "pi2fd %%mm0, %%mm0\n\t" + "pi2fd %%mm1, %%mm1\n\t" + "pi2fd %%mm2, %%mm2\n\t" + "pi2fd %%mm3, %%mm3\n\t" + "pi2fd %%mm4, %%mm4\n\t" + "pi2fd %%mm5, %%mm5\n\t" + "pi2fd %%mm6, %%mm6\n\t" + "pi2fd %%mm7, %%mm7\n\t" + "pfmul %2, %%mm0\n\t" + "pfmul %2, %%mm1\n\t" + "pfmul %2, %%mm2\n\t" + "pfmul %2, %%mm3\n\t" + "pfmul %2, %%mm4\n\t" + "pfmul %2, %%mm5\n\t" + "pfmul %2, %%mm6\n\t" + "pfmul %2, %%mm7\n\t" + "movq %%mm0, (%0)\n\t" + "movq %%mm1, 8(%0)\n\t" + "movq %%mm2, 16(%0)\n\t" + "movq %%mm3, 24(%0)\n\t" + "movq %%mm4, 32(%0)\n\t" + "movq %%mm5, 40(%0)\n\t" + "movq %%mm6, 48(%0)\n\t" + "movq %%mm7, 56(%0)\n\t" + "femms" + ::"r"(&(((float*)out)[i])),"r"(&(((int32_t*)in)[i])),"m"(tmp_f32[0]) + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); + } +#endif + for(;i<len;i++) + ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); + break; + } +} + +static float __FASTCALL__ RENAME(FIR_f32)(float *x,float *w) +{ +#ifdef HAVE_3DNOW + float rval; + __asm __volatile( + "movq (%1), %%mm0\n\t" + "movq 8(%1), %%mm1\n\t" + "movq 16(%1), %%mm2\n\t" + "movq 24(%1), %%mm3\n\t" + "movq 32(%1), %%mm4\n\t" + "movq 40(%1), %%mm5\n\t" + "movq 48(%1), %%mm6\n\t" + "movq 56(%1), %%mm7\n\t" + "pfmul (%2), %%mm0\n\t" + "pfmul 8(%2), %%mm1\n\t" + "pfmul 16(%2), %%mm2\n\t" + "pfmul 24(%2), %%mm3\n\t" + "pfmul 32(%2), %%mm4\n\t" + "pfmul 40(%2), %%mm5\n\t" + "pfmul 48(%2), %%mm6\n\t" + "pfmul 56(%2), %%mm7\n\t" + "pfadd %%mm1, %%mm0\n\t" + "pfadd %%mm3, %%mm2\n\t" + "pfadd %%mm5, %%mm4\n\t" + "pfadd %%mm7, %%mm6\n\t" + "pfadd %%mm2, %%mm0\n\t" + "pfadd %%mm6, %%mm4\n\t" + "pfadd %%mm4, %%mm0\n\t" + "pfacc %%mm0, %%mm0\n\t" + "movd %%mm0, %0\n\t" + "femms" + :"=&r"(rval):"r"(w),"r"(x) + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); + return rval; +#else + return ( w[0] *x[0] +w[1] *x[1] +w[2] *x[2] +w[3] *x[3] + + w[4] *x[4] +w[5] *x[5] +w[6] *x[6] +w[7] *x[7] + + w[8] *x[8] +w[9] *x[9] +w[10]*x[10]+w[11]*x[11] + + w[12]*x[12]+w[13]*x[13]+w[14]*x[14]+w[15]*x[15] ); +#endif +} Property changes on: mplayerxp/postproc/dsp_accelf.h ___________________________________________________________________ Added: svn:eol-style + native Modified: mplayerxp/postproc/vf.c =================================================================== --- mplayerxp/postproc/vf.c 2010-01-18 18:37:48 UTC (rev 111) +++ mplayerxp/postproc/vf.c 2010-01-19 17:51:18 UTC (rev 112) @@ -618,7 +618,7 @@ { MSG_V("vf_reinit->config %i %i %s=> %i %i %s\n",sw,sh,vo_format_name(sfourcc),w,h,vo_format_name(fmt)); _saved=_this->prev; - vf_scaler=vf_open_filter(_this,sh_video,"scale",NULL); + vf_scaler=vf_open_filter(_this,sh_video,(w==sw&&h==sh)?"fmtcvt":"scale",NULL); if(vf_scaler) { void *sfnc; Modified: mplayerxp/postproc/vf_scale.c =================================================================== --- mplayerxp/postproc/vf_scale.c 2010-01-18 18:37:48 UTC (rev 111) +++ mplayerxp/postproc/vf_scale.c 2010-01-19 17:51:18 UTC (rev 112) @@ -118,11 +118,18 @@ static void __FASTCALL__ print_conf(struct vf_instance_s* vf) { - MSG_INFO("[vf_scale]: scaling [%dx%d,%s] -> [%dx%d,%s]\n", + MSG_INFO("[vf_scale]: in[%dx%d,%s] -> out[%dx%d,%s]\n", vf->priv->sw,vf->priv->sh,vo_format_name(vf->priv->sfmt), vf->priv->w,vf->priv->h,vo_format_name(vf->priv->ofmt)); } +static void __FASTCALL__ print_conf_fmtcvt(struct vf_instance_s* vf) +{ + MSG_INFO("[vf_fmtcvt]: video[%dx%d] in[%s] -> out[%s]\n", + vf->priv->sw,vf->priv->sh,vo_format_name(vf->priv->sfmt), + vo_format_name(vf->priv->ofmt)); +} + static int __FASTCALL__ config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt,void *tune){ @@ -272,7 +279,7 @@ vf->priv->palette[4*i+3]=0; } break; } - case IMGFMT_RGB4: + case IMGFMT_RGB4: case IMGFMT_RG4B: { int i; vf->priv->palette=malloc(4*16); @@ -321,7 +328,7 @@ } } -static int __FASTCALL__ put_slice(struct vf_instance_s* vf, mp_image_t *mpi){ +static int __FASTCALL__ put_frame(struct vf_instance_s* vf, mp_image_t *mpi){ mp_image_t *dmpi;//=mpi->priv; uint8_t *planes[3]; int stride[3]; @@ -342,7 +349,7 @@ stride[2]=mpi->stride[2]; } } - MSG_DBG2("vf_scale.put_slice was called\n"); + MSG_DBG2("vf_scale.put_frame was called\n"); dmpi=vf_get_image(vf->next,vf->priv->fmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE, vf->priv->w, vf->priv->h); @@ -350,6 +357,51 @@ return vf_next_put_slice(vf,dmpi); } +static int __FASTCALL__ put_slice(struct vf_instance_s* vf, mp_image_t *mpi){ + mp_image_t *dmpi;//=mpi->priv; + uint8_t *planes[3],*dplanes[3]; + int stride[3],newy,newh; + planes[0]=mpi->planes[0]; + stride[0]=mpi->stride[0]; + if(mpi->flags&MP_IMGFLAG_PLANAR){ + if(mpi->flags&MP_IMGFLAG_SWAPPED){ + // I420/IYUV (Y,U,V) + planes[1]=mpi->planes[2]; + planes[2]=mpi->planes[1]; + stride[1]=mpi->stride[2]; + stride[2]=mpi->stride[1]; + } else { + // YV12,YVU9,IF09 (Y,V,U) + planes[1]=mpi->planes[1]; + planes[2]=mpi->planes[2]; + stride[1]=mpi->stride[1]; + stride[2]=mpi->stride[2]; + } + } + MSG_DBG2("vf_scale.put_slice was called[%i %i]\n",mpi->y, mpi->h); + dmpi=vf_get_image(vf->next,vf->priv->fmt, + MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE, + vf->priv->w, vf->priv->h); + /* Try to fake first slice*/ + dplanes[0] = dmpi->planes[0]; + if(mpi->flags&MP_IMGFLAG_PLANAR) { + dplanes[1] = dmpi->planes[1]; + dplanes[2] = dmpi->planes[2]; + } + planes[0] += mpi->y*mpi->stride[0]; + dplanes[0] += mpi->y*dmpi->stride[0]; + if(mpi->flags&MP_IMGFLAG_PLANAR){ + planes[1] += (mpi->y>>mpi->chroma_y_shift)*mpi->stride[1]; + planes[2] += (mpi->y>>mpi->chroma_y_shift)*mpi->stride[2]; + dplanes[1]+= (mpi->y>>dmpi->chroma_y_shift)*dmpi->stride[0]; + dplanes[1]+= (mpi->y>>dmpi->chroma_y_shift)*dmpi->stride[0]; + } + scale(vf->priv->ctx, vf->priv->ctx2, planes, stride, 0, mpi->h, dplanes, dmpi->stride, vf->priv->interlaced); + dmpi->y = mpi->y; + dmpi->h = mpi->h; + return vf_next_put_slice(vf,dmpi); +} + static int __FASTCALL__ control(struct vf_instance_s* vf, int request, void* data){ int *table; int *inv_table; @@ -468,7 +520,7 @@ static int __FASTCALL__ vf_open(vf_instance_t *vf,const char* args){ vf->config=config; - vf->put_slice=put_slice; + vf->put_slice=put_frame; vf->query_format=query_format; vf->control= control; vf->uninit=uninit; @@ -499,6 +551,13 @@ return 1; } +static int __FASTCALL__ vf_open_fmtcvt(vf_instance_t *vf,const char* args){ + int retval = vf_open(vf,args); + vf->put_slice=put_slice; + vf->print_conf=print_conf_fmtcvt; + return retval; +} + //global sws_flags from the command line int sws_flags=2; @@ -600,8 +659,8 @@ "fmtcvt", "A'rpi", "", - VF_FLAGS_THREADS, - vf_open + VF_FLAGS_THREADS|VF_FLAGS_SLICES, + vf_open_fmtcvt }; //===========================================================================// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-20 18:04:32
|
Revision: 114 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=114&view=rev Author: nickols_k Date: 2010-01-20 18:04:15 +0000 (Wed, 20 Jan 2010) Log Message: ----------- improve pvector library and add float32 support Modified Paths: -------------- TOOLS/Makefile mplayerxp/libmpcodecs/dec_video.c mplayerxp/libvo/aclib.c mplayerxp/libvo/aclib_template.c mplayerxp/libvo/osd.c mplayerxp/libvo/osd_template.c mplayerxp/postproc/dsp.c mplayerxp/postproc/dsp_accel.h mplayerxp/pvector/pvector.h mplayerxp/pvector/pvector_int_x86.h Added Paths: ----------- TOOLS/asmoptf.c TOOLS/asmoptf_template.h mplayerxp/pvector/pvector_f32_x86.h mplayerxp/pvector/pvector_inc.h Removed Paths: ------------- mplayerxp/postproc/dsp_accelf.h Modified: TOOLS/Makefile =================================================================== --- TOOLS/Makefile 2010-01-19 18:20:08 UTC (rev 113) +++ TOOLS/Makefile 2010-01-20 18:04:15 UTC (rev 114) @@ -27,9 +27,12 @@ $(CC) $(CFLAGS) $< $(COMMON_LIBS) -o fastmem-sse$(EXESUF) -DNAME=\"sse\" -DHAVE_MMX -DHAVE_SSE -DHAVE_MMX2 ASMOPTOBJS = asmopt.o +ASMOPTFOBJS = asmoptf.o #CFLAGS=-E asmopt$(EXESUF): $(ASMOPTOBJS) $(CC) $(CFLAGS) $< $(COMMON_LIBS) -o $@ +asmoptf$(EXESUF): $(ASMOPTFOBJS) + $(CC) $(CFLAGS) $< $(COMMON_LIBS) -o $@ MMX2COBJS = mmx2c.o Added: TOOLS/asmoptf.c =================================================================== --- TOOLS/asmoptf.c (rev 0) +++ TOOLS/asmoptf.c 2010-01-20 18:04:15 UTC (rev 114) @@ -0,0 +1,167 @@ +/* + fastmemcpybench.c used to benchmark fastmemcpy.h code from libvo. + + Note: this code can not be used on PentMMX-PII because they contain + a bug in rdtsc. For Intel processors since P6(PII) rdpmc should be used + instead. For PIII it's disputable and seems bug was fixed but I don't + tested it. +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/ioctl.h> +#include <inttypes.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <sys/time.h> +#include <limits.h> + +#include "../mplayerxp/mp_config.h" +#include "../mplayerxp/cpudetect.h" + +#undef F32_OPTIMIZE_AVX +#undef F32_OPTIMIZE_SSE4 +#undef F32_OPTIMIZE_SSSE3 +#undef F32_OPTIMIZE_SSE3 +#undef F32_OPTIMIZE_SSE2 +#undef F32_OPTIMIZE_SSE +#undef F32_OPTIMIZE_3DNOW +#define RENAME(a) a ## _C +#include "asmoptf_template.h" + + +#ifdef __3dNOW__ +#define F32_OPTIMIZE_3DNOW +#undef RENAME +#define RENAME(a) a ## _3DNOW +#include "asmoptf_template.h" +#endif +#ifdef __SSE__ +#define F32_OPTIMIZE_SSE +#undef RENAME +#define RENAME(a) a ## _SSE +#include "asmoptf_template.h" +#endif +#ifdef __SSE2__ +#define F32_OPTIMIZE_SSE2 +#undef RENAME +#define RENAME(a) a ## _SSE2 +#include "asmoptf_template.h" +#endif +#ifdef __SSE3__ +#define F32_OPTIMIZE_SSE3 +#undef RENAME +#define RENAME(a) a ## _SSE3 +#include "asmoptf_template.h" +#endif +#ifdef __SSE4_1__ +#define F32_OPTIMIZE_SSE4 +#undef RENAME +#define RENAME(a) a ## _SSE4 +#include "asmoptf_template.h" +#endif +#ifdef __AVX__ +#define F32_OPTIMIZE_AVX +#undef RENAME +#define RENAME(a) a ## _AVX +#include "asmoptf_template.h" +#endif + +#define ARR_SIZE (1024*64*2)*10 +unsigned verbose=1; +extern CpuCaps gCpuCaps; + +/* Fixme: put here any complexness of source array filling */ +#define INIT_ARRAYS(x) \ +{\ + for(i=0; i<x; i++) srca[i] = i; \ + for(i=0; i<x; i++) src[i] = i+64; \ + memset(dsta,0,sizeof(ARR_SIZE*sizeof(float))); \ +} + +// Returns current time in microseconds +unsigned int GetTimer(){ + struct timeval tv; + struct timezone tz; +// float s; + gettimeofday(&tv,&tz); +// s=tv.tv_usec;s*=0.000001;s+=tv.tv_sec; + return (tv.tv_sec*1000000+tv.tv_usec); +} + +static inline unsigned long long int read_tsc( void ) +{ + unsigned long long int retval; + __asm __volatile ("rdtsc":"=A"(retval)::"memory"); + return retval; +} + +uint8_t __attribute__((aligned(4096)))dsta[ARR_SIZE*sizeof(float)]; +float __attribute__((aligned(4096)))src[ARR_SIZE],srca[ARR_SIZE]; + +uint8_t __attribute__((aligned(4096)))src1[ARR_SIZE*sizeof(float)],src2[ARR_SIZE*sizeof(float)]; +int cmp_result(const char *name) +{ + FILE *in1,*in2; + if((in1=fopen("asmoptf.gen","rb"))==NULL) return 0; + if((in2=fopen(name,"rb"))==NULL) { fclose(in1); return 0; } + fread(src1,ARR_SIZE*sizeof(float),1,in1); + fread(src2,ARR_SIZE*sizeof(float),1,in2); + fclose(in1); + fclose(in2); + return ((memcmp(src1,src2,ARR_SIZE*sizeof(float))==0)?1:0); +} + +typedef void (*mmx_test_f)(uint8_t *d,const uint8_t *s1,const uint8_t *s2,unsigned n); + +void test_simd(const char *fname,const char *pfx,mmx_test_f func) +{ + unsigned long long int v1,v2; + unsigned int t; + unsigned i; + FILE *out=fopen(fname,"wb"); + fprintf(stderr,"%s ",pfx); + INIT_ARRAYS(ARR_SIZE); + t=GetTimer(); + v1 = read_tsc(); + (*func)(dsta,(const uint8_t *)src,(const uint8_t *)srca,ARR_SIZE); + v2 = read_tsc(); + t=GetTimer()-t; + fprintf(stderr,"cpu clocks=%llu = %dus...",v2-v1,t); + if(out) fwrite(dsta,ARR_SIZE*sizeof(float),1,out); + fclose(out); + fprintf(stderr,"[%s]\n",cmp_result(fname)?"OK":"FAIL"); +} + +int main( void ) +{ + GetCpuCaps(&gCpuCaps); + fprintf(stderr,"CPUflags: MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n", + gCpuCaps.hasMMX,gCpuCaps.hasMMX2, + gCpuCaps.has3DNow, gCpuCaps.has3DNowExt, + gCpuCaps.hasSSE, gCpuCaps.hasSSE2); + + test_simd("asmoptf.gen" ,"GENERIC:",convert_C); +// ordered per speed fasterst first +#ifdef __AVX__ + if(gCpuCaps.hasAVX) test_simd("asmoptf.avx","AVX :",convert_AVX); +#endif +#ifdef __SSE4_1__ + if(gCpuCaps.hasSSE41) test_simd("asmoptf.sse4","SSE4 :",convert_SSE4); +#endif +#ifdef __SSE3__ + if(gCpuCaps.hasSSE3) test_simd("asmoptf.sse3","SSE3 :",convert_SSE3); +#endif +#ifdef __SSE2__ + if(gCpuCaps.hasSSE2) test_simd("asmoptf.sse2","SSE2 :",convert_SSE2); +#endif +#ifdef __SSE__ + if(gCpuCaps.hasSSE) test_simd("asmoptf.sse","SSE :",convert_SSE); +#endif +#ifdef __3dNOW__ + if(gCpuCaps.has3DNow) test_simd("asmoptf.3dnow", "3DNOW :",convert_3DNOW); +#endif + return 0; +} Property changes on: TOOLS/asmoptf.c ___________________________________________________________________ Added: svn:eol-style + native Added: TOOLS/asmoptf_template.h =================================================================== --- TOOLS/asmoptf_template.h (rev 0) +++ TOOLS/asmoptf_template.h 2010-01-20 18:04:15 UTC (rev 114) @@ -0,0 +1,43 @@ +/* Put your stuff_template.h here */ +#include "../mplayerxp/pvector/pvector.h" + +/* +Benchmarks for this test: +------------------------- +GENERIC: cpu clocks=27765822 = 12564us +SSE3 : cpu clocks=3991075 = 1808us...[OK] +SSE2 : cpu clocks=3942081 = 1785us...[OK] +MMX2 : cpu clocks=5874563 = 2659us...[OK] +MMX : cpu clocks=6092012 = 2757us...[OK] +*/ +void RENAME(convert)(uint8_t *dstbase,const uint8_t *src,const uint8_t *srca,unsigned int asize) +{ + unsigned i,len; + const uint8_t *in; + uint8_t *out; +#ifdef HAVE_F32_PVECTOR + __f32vec rev_imax = _f32vec_broadcast(1.0/INT_MAX); +#endif + in = src; + out = dstbase; + i=0; + len=asize; +#ifdef HAVE_F32_PVECTOR + for(;i<len;i++) { + ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); + if((((long)out)&(__F32VEC_SIZE-1))==0) break; + } + _f32vec_empty(); + if((len-i)>=__F32VEC_SIZE) + for(;i<len;i+=__F32VEC_SIZE/sizeof(float)) { + __f32vec tmp; + tmp = _f32vec_mul(rev_imax,_f32vec_from_s32u(&((int32_t*)in)[i])); + _f32vec_storea(&((float*)out)[i],tmp); + } + _f32vec_sfence(); + _f32vec_empty(); +#endif + for(;i<len;i++) { + ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); + } +} Property changes on: TOOLS/asmoptf_template.h ___________________________________________________________________ Added: svn:eol-style + native Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2010-01-19 18:20:08 UTC (rev 113) +++ mplayerxp/libmpcodecs/dec_video.c 2010-01-20 18:04:15 UTC (rev 114) @@ -33,7 +33,6 @@ vf_cfg_t vf_cfg; // Configuration for audio filters #include "postproc/postprocess.h" -#include "pvector/pvector.h" #include "cpudetect.h" #include "vd_msg.h" @@ -249,9 +248,7 @@ MSG_DBG2("decvideo: decoding video %u bytes\n",in_size); while(sh_video->active_slices!=0) usleep(0); /* ------------------------ frame decoded. -------------------- */ -#ifdef HAVE_INT_PVECTOR - _ivec_empty(); -#endif + if(!mpi) return 0; // error / skipped frame mpcodecs_draw_image(sh_video,mpi); Modified: mplayerxp/libvo/aclib.c =================================================================== --- mplayerxp/libvo/aclib.c 2010-01-19 18:20:08 UTC (rev 113) +++ mplayerxp/libvo/aclib.c 2010-01-20 18:04:15 UTC (rev 114) @@ -12,36 +12,9 @@ #define BLOCK_SIZE 4096 #define CONFUSION_FACTOR 0 -/* generic version */ -#undef OPTIMIZE_AVX -#undef OPTIMIZE_SSE4 -#undef OPTIMIZE_SSSE3 -#undef OPTIMIZE_SSE3 -#undef OPTIMIZE_SSE2 -#undef OPTIMIZE_SSE -#undef OPTIMIZE_MMX2 -#undef OPTIMIZE_MMX +#define PVECTOR_ACCEL_H "aclib_template.c" +#include "pvector/pvector_inc.h" -#ifndef __x86_64__ -#ifdef __MMX__ -#define OPTIMIZE_MMX -#undef RENAME -#define RENAME(a) a ## _MMX -#include "aclib_template.c" -#endif -#ifdef __SSE__ -#define OPTIMIZE_MMX2 -#undef RENAME -#define RENAME(a) a ## _MMX2 -#include "aclib_template.c" -#endif -#endif // __x86_64__ -#ifdef __SSE2__ -#define OPTIMIZE_SSE2 -#undef RENAME -#define RENAME(a) a ## _SSE2 -#include "aclib_template.c" -#endif /* aclib - advanced C library ;) This file contains functions which improve and expand standard C-library @@ -64,19 +37,19 @@ if(gCpuCaps.hasMMX2) { MSG_V("Using MMX2 optimized memcpy\n"); - fast_memcpy_ptr = fast_memcpy_MMX2; + fast_memcpy_ptr = fast_memcpy_SSE; } else #endif -#ifdef __MMX__ - if(gCpuCaps.hasMMX) - { - MSG_V("Using MMX optimized memcpy\n"); - fast_memcpy_ptr = fast_memcpy_MMX; - } - else +//#ifdef __MMX__ +// if(gCpuCaps.hasMMX) +// { +// MSG_V("Using MMX optimized memcpy\n"); +// fast_memcpy_ptr = fast_memcpy_MMX; +// } +// else +//#endif #endif -#endif { MSG_V("Using generic memcpy\n"); fast_memcpy_ptr = memcpy; /* prior to mmx we use the standart memcpy */ @@ -98,19 +71,19 @@ if(gCpuCaps.hasMMX2) { MSG_V("Using MMX2 optimized agpcpy\n"); - fast_stream_copy_ptr = fast_stream_copy_MMX2; + fast_stream_copy_ptr = fast_stream_copy_SSE; } else #endif -#ifdef __MMX__ - if(gCpuCaps.hasMMX) - { - MSG_V("Using MMX optimized agpcpy\n"); - fast_stream_copy_ptr = fast_stream_copy_MMX; - } - else +//#ifdef __MMX__ +// if(gCpuCaps.hasMMX) +// { +// MSG_V("Using MMX optimized agpcpy\n"); +// fast_stream_copy_ptr = fast_stream_copy_MMX; +// } +// else +//#endif #endif -#endif { MSG_V("Using generic optimized agpcpy\n"); fast_stream_copy_ptr = memcpy; /* prior to mmx we use the standart memcpy */ Modified: mplayerxp/libvo/aclib_template.c =================================================================== --- mplayerxp/libvo/aclib_template.c 2010-01-19 18:20:08 UTC (rev 113) +++ mplayerxp/libvo/aclib_template.c 2010-01-20 18:04:15 UTC (rev 114) @@ -4,6 +4,7 @@ */ #include "pvector/pvector.h" +#ifdef HAVE_INT_PVECTOR /* for small memory blocks (<256 bytes) this version is faster */ #undef small_memcpy #ifdef __x86_64__ @@ -158,7 +159,7 @@ #undef MEM_STORE #define MEM_STORE _ivec_stream -static inline void * RENAME(fast_stream_copy)(void * to, const void * from, size_t len) +static inline void * PVECTOR_RENAME(fast_stream_copy)(void * to, const void * from, size_t len) { MSG_DBG3("fast_stream_copy(%p, %p, %u) [cl_size=%u]\n",to,from,len,gCpuCaps.cl_size); FAST_MEMORY_COPY(to,from,len); @@ -166,9 +167,9 @@ #undef MEM_STORE #define MEM_STORE _ivec_storea -static inline void * RENAME(fast_memcpy)(void * to, const void * from, size_t len) +static inline void * PVECTOR_RENAME(fast_memcpy)(void * to, const void * from, size_t len) { MSG_DBG3("fast_memcpy(%p, %p, %u) [cl_size=%u]\n",to,from,len,gCpuCaps.cl_size); FAST_MEMORY_COPY(to,from,len); } - +#endif Modified: mplayerxp/libvo/osd.c =================================================================== --- mplayerxp/libvo/osd.c 2010-01-19 18:20:08 UTC (rev 113) +++ mplayerxp/libvo/osd.c 2010-01-20 18:04:15 UTC (rev 114) @@ -22,58 +22,15 @@ static const unsigned long long mask24hl __attribute__((used)) __attribute__((aligned(8))) = 0x0000FFFFFFFFFFFFULL; #endif -/* generic version */ -#undef OPTIMIZE_AVX -#undef OPTIMIZE_SSE4 -#undef OPTIMIZE_SSSE3 -#undef OPTIMIZE_SSE3 -#undef OPTIMIZE_SSE2 -#undef OPTIMIZE_SSE -#undef OPTIMIZE_MMX2 -#undef OPTIMIZE_MMX -#define RENAME(a) a ## _C -#include "osd_template.c" +#define PVECTOR_ACCEL_H "osd_template.c" +#include "pvector/pvector_inc.h" -#ifndef __x86_64__ -#ifdef __SSE__ -#define OPTIMIZE_MMX2 -#undef RENAME -#define RENAME(a) a ## _MMX2 -#include "osd_template.c" -#endif -#endif // __x86_64__ -#ifdef __SSE2__ -#define OPTIMIZE_SSE2 -#undef RENAME -#define RENAME(a) a ## _SSE2 -#include "osd_template.c" -#endif -#ifdef __SSE3__ -#define OPTIMIZE_SSE3 -#undef RENAME -#define RENAME(a) a ## _SSE3 -#include "osd_template.c" -#endif -#ifdef __SSSE3__ -#define OPTIMIZE_SSSE3 -#undef RENAME -#define RENAME(a) a ## _SSSE3 -#include "osd_template.c" -#endif -#ifdef __SSE4_1__ -#define OPTIMIZE_SSE4 -#undef RENAME -#define RENAME(a) a ## _SSE4 -#include "osd_template.c" -#endif - - #ifdef FAST_OSD_TABLE static unsigned short fast_osd_15bpp_table[256]; static unsigned short fast_osd_16bpp_table[256]; #endif -static void __FASTCALL__ vo_draw_alpha_rgb15_C(int w,int h, const unsigned char* src, const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ +static void __FASTCALL__ vo_draw_alpha_rgb15_c(int w,int h, const unsigned char* src, const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ int y; for(y=0;y<h;y++){ register unsigned short *dst = (unsigned short*) dstbase; @@ -105,7 +62,7 @@ return; } -static void __FASTCALL__ vo_draw_alpha_rgb16_C(int w,int h, const unsigned char* src, const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ +static void __FASTCALL__ vo_draw_alpha_rgb16_c(int w,int h, const unsigned char* src, const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ int y; for(y=0;y<h;y++){ register unsigned short *dst = (unsigned short*) dstbase; @@ -136,7 +93,7 @@ return; } -static void __FASTCALL__ vo_draw_alpha_uyvy_C(int w,int h, const unsigned char* src, const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ +static void __FASTCALL__ vo_draw_alpha_uyvy_c(int w,int h, const unsigned char* src, const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ (*vo_draw_alpha_yuy2_ptr)(w,h,src,srca,srcstride,dstbase+1,dststride,finalize); } @@ -144,9 +101,9 @@ draw_alpha_f vo_draw_alpha_yuy2_ptr=NULL; draw_alpha_f vo_draw_alpha_rgb24_ptr=NULL; draw_alpha_f vo_draw_alpha_rgb32_ptr=NULL; -draw_alpha_f vo_draw_alpha_uyvy_ptr=vo_draw_alpha_uyvy_C; -draw_alpha_f vo_draw_alpha_rgb15_ptr=vo_draw_alpha_rgb15_C; -draw_alpha_f vo_draw_alpha_rgb16_ptr=vo_draw_alpha_rgb16_C; +draw_alpha_f vo_draw_alpha_uyvy_ptr=vo_draw_alpha_uyvy_c; +draw_alpha_f vo_draw_alpha_rgb15_ptr=vo_draw_alpha_rgb15_c; +draw_alpha_f vo_draw_alpha_rgb16_ptr=vo_draw_alpha_rgb16_c; void vo_draw_alpha_init( void ){ #ifdef FAST_OSD_TABLE @@ -207,19 +164,30 @@ if(gCpuCaps.hasMMX2) { MSG_V("Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n"); - vo_draw_alpha_yv12_ptr=vo_draw_alpha_yv12_MMX2; - vo_draw_alpha_yuy2_ptr=vo_draw_alpha_yuy2_MMX2; - vo_draw_alpha_rgb24_ptr=vo_draw_alpha_rgb24_MMX2; - vo_draw_alpha_rgb32_ptr=vo_draw_alpha_rgb32_MMX2; + vo_draw_alpha_yv12_ptr=vo_draw_alpha_yv12_SSE; + vo_draw_alpha_yuy2_ptr=vo_draw_alpha_yuy2_SSE; + vo_draw_alpha_rgb24_ptr=vo_draw_alpha_rgb24_SSE; + vo_draw_alpha_rgb32_ptr=vo_draw_alpha_rgb32_SSE; } else #endif +#ifdef __MMX__ +if(gCpuCaps.hasMMX) +{ + MSG_V("Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n"); + vo_draw_alpha_yv12_ptr=vo_draw_alpha_yv12_MMX; + vo_draw_alpha_yuy2_ptr=vo_draw_alpha_yuy2_MMX; + vo_draw_alpha_rgb24_ptr=vo_draw_alpha_rgb24_MMX; + vo_draw_alpha_rgb32_ptr=vo_draw_alpha_rgb32_MMX; +} +else #endif +#endif { MSG_V("Using generic OnScreenDisplay\n"); - vo_draw_alpha_yv12_ptr=vo_draw_alpha_yv12_C; - vo_draw_alpha_yuy2_ptr=vo_draw_alpha_yuy2_C; - vo_draw_alpha_rgb24_ptr=vo_draw_alpha_rgb24_C; - vo_draw_alpha_rgb32_ptr=vo_draw_alpha_rgb32_C; + vo_draw_alpha_yv12_ptr=vo_draw_alpha_yv12_c; + vo_draw_alpha_yuy2_ptr=vo_draw_alpha_yuy2_c; + vo_draw_alpha_rgb24_ptr=vo_draw_alpha_rgb24_c; + vo_draw_alpha_rgb32_ptr=vo_draw_alpha_rgb32_c; } } Modified: mplayerxp/libvo/osd_template.c =================================================================== --- mplayerxp/libvo/osd_template.c 2010-01-19 18:20:08 UTC (rev 113) +++ mplayerxp/libvo/osd_template.c 2010-01-20 18:04:15 UTC (rev 114) @@ -5,39 +5,39 @@ #ifdef HAVE_INT_PVECTOR static __inline __m64 __attribute__((__gnu_inline__, __always_inline__)) -RENAME(_m_load)(const void *__P) +PVECTOR_RENAME(_m_load)(const void *__P) { return *(const __m64 *)__P; } #undef _m_load -#define _m_load RENAME(_m_load) +#define _m_load PVECTOR_RENAME(_m_load) static __inline __m64 __attribute__((__gnu_inline__, __always_inline__)) -RENAME(_m_load_half)(const void *__P) +PVECTOR_RENAME(_m_load_half)(const void *__P) { return _mm_cvtsi32_si64 (*(const int *)__P); } #undef _m_load_half -#define _m_load_half RENAME(_m_load_half) +#define _m_load_half PVECTOR_RENAME(_m_load_half) static __inline void __attribute__((__gnu_inline__, __always_inline__)) -RENAME(_m_store)(void *__P, __m64 src) +PVECTOR_RENAME(_m_store)(void *__P, __m64 src) { *(__m64 *)__P = src; } #undef _m_store -#define _m_store RENAME(_m_store) +#define _m_store PVECTOR_RENAME(_m_store) static __inline void __attribute__((__gnu_inline__, __always_inline__)) -RENAME(_m_store_half)(void *__P, __m64 src) +PVECTOR_RENAME(_m_store_half)(void *__P, __m64 src) { *(int *)__P = _mm_cvtsi64_si32(src); } #undef _m_store_half -#define _m_store_half RENAME(_m_store_half) +#define _m_store_half PVECTOR_RENAME(_m_store_half) static __inline void __attribute__((__gnu_inline__, __always_inline__)) -RENAME(_m_movntq)(void *__P, __m64 src) +PVECTOR_RENAME(_m_movntq)(void *__P, __m64 src) { #ifdef HAVE_MMX2 _mm_stream_pi(__P,src); @@ -46,11 +46,11 @@ #endif } #undef _m_movntq -#define _m_movntq RENAME(_m_movntq) +#define _m_movntq PVECTOR_RENAME(_m_movntq) #endif -static inline void RENAME(vo_draw_alpha_yv12)(int w,int h,const unsigned char* src,const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ +static inline void PVECTOR_RENAME(vo_draw_alpha_yv12)(int w,int h,const unsigned char* src,const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ unsigned y; #ifdef HAVE_INT_PVECTOR __ivec vzero = _ivec_setzero(); @@ -108,7 +108,7 @@ return; } -static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h,const unsigned char* src,const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ +static inline void PVECTOR_RENAME(vo_draw_alpha_yuy2)(int w,int h,const unsigned char* src,const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ int y; #if defined(FAST_OSD) && !defined(HAVE_MMX) w=w>>1; @@ -173,7 +173,7 @@ return; } -static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h,const unsigned char* src,const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ +static inline void PVECTOR_RENAME(vo_draw_alpha_rgb24)(int w,int h,const unsigned char* src,const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ int y; for(y=0;y<h;y++){ register unsigned char *dst = dstbase; @@ -245,7 +245,7 @@ return; } -static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h,const unsigned char* src,const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ +static inline void PVECTOR_RENAME(vo_draw_alpha_rgb32)(int w,int h,const unsigned char* src,const unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride,int finalize){ int y; PROFILE_START(); for(y=0;y<h;y++){ Modified: mplayerxp/postproc/dsp.c =================================================================== --- mplayerxp/postproc/dsp.c 2010-01-19 18:20:08 UTC (rev 113) +++ mplayerxp/postproc/dsp.c 2010-01-20 18:04:15 UTC (rev 114) @@ -28,51 +28,9 @@ #include "../mp_config.h" #include "../cpudetect.h" -#undef OPTIMIZE_AVX -#undef OPTIMIZE_SSE4 -#undef OPTIMIZE_SSSE3 -#undef OPTIMIZE_SSE3 -#undef OPTIMIZE_SSE2 -#undef OPTIMIZE_SSE -#undef OPTIMIZE_MMX2 -#undef OPTIMIZE_MMX -#define RENAME(a) a ## _c -#include "dsp_accel.h" -#include "dsp_accelf.h" +#define PVECTOR_ACCEL_H "dsp_accel.h" +#include "pvector/pvector_inc.h" -#ifndef __x86_64__ -#ifdef __MMX__ -#define OPTIMIZE_MMX -#undef RENAME -#define RENAME(a) a ## _MMX -#include "dsp_accel.h" -#endif -#ifdef __SSE__ -#define OPTIMIZE_MMX2 -#undef RENAME -#define RENAME(a) a ## _MMX2 -#include "dsp_accel.h" -#endif -#endif //__x86_64__ -#ifdef __SSE2__ -#define OPTIMIZE_SSE2 -#undef RENAME -#define RENAME(a) a ## _SSE2 -#include "dsp_accel.h" -#endif -#ifdef __SSE3__ -#define OPTIMIZE_SSE3 -#undef RENAME -#define RENAME(a) a ## _SSE3 -#include "dsp_accel.h" -#endif -#ifdef __SSE4_1__ -#define OPTIMIZE_SSE4 -#undef RENAME -#define RENAME(a) a ## _SSE4 -#include "dsp_accel.h" -#endif - /****************************************************************************** * FIR filter implementations ******************************************************************************/ @@ -86,7 +44,7 @@ _ftype_t __FASTCALL__ fir(register unsigned int n, _ftype_t* w, _ftype_t* x) { register _ftype_t y; // Output - y = 0.0; + y = 0.0; do{ n--; y+=w[n]*x[n]; @@ -127,7 +85,7 @@ { register _ftype_t* txq = *xq + xi; register int nt = n*2; - + while(d-- >0){ *txq= *(txq+n) = *in; txq+=nt; @@ -145,12 +103,12 @@ n filter length must be odd for HP and BS filters w buffer for the filter taps (must be n long) fc cutoff frequencies (1 for LP and HP, 2 for BP and BS) - 0 < fc < 1 where 1 <=> Fs/2 + 0 < fc < 1 where 1 <=> Fs/2 flags window and filter type as defined in filter.h - variables are ored together: i.e. LP|HAMMING will give a + variables are ored together: i.e. LP|HAMMING will give a low pass filter designed using a hamming window opt beta constant used only when designing using kaiser windows - + returns 0 if OK, -1 if fail */ int __FASTCALL__ design_fir(unsigned int n, _ftype_t* w, _ftype_t* fc, unsigned int flags, _ftype_t opt) @@ -286,7 +244,7 @@ pw Parallel FIR filter g Filter gain flags FWD forward indexing - REW reverse indexing + REW reverse indexing ODD multiply every 2nd filter tap by -1 => HP filter returns 0 if OK, -1 if fail @@ -342,7 +300,7 @@ /* Transform the numerator and denominator coefficients of s-domain biquad section into corresponding z-domain coefficients. - + The transfer function for z-domain is: 1 + alpha1 * z^(-1) + alpha2 * z^(-2) @@ -353,7 +311,7 @@ order: beta1, beta2 (denominator) alpha1, alpha2 (numerator) - + Arguments: a - s-domain numerator coefficients b - s-domain denominator coefficients @@ -364,7 +322,7 @@ specified in initial value of k. fs - sampling rate (Hz) coef - array of z-domain coefficients to be filled in. - + Return: On return, set coef z-domain coefficients and k to the gain required to maintain overall gain = 1.0; */ @@ -394,26 +352,25 @@ /* IIR filter design using bilinear transform and prewarp. Transforms 2nd order s domain analog filter into a digital IIR biquad link. To create a filter fill in a, b, Q and fs and make space for coef and k. - - Example Butterworth design: + Example Butterworth design: Below are Butterworth polynomials, arranged as a series of 2nd order sections: Note: n is filter order. - + n Polynomials ------------------------------------------------------------------- 2 s^2 + 1.4142s + 1 4 (s^2 + 0.765367s + 1) * (s^2 + 1.847759s + 1) 6 (s^2 + 0.5176387s + 1) * (s^2 + 1.414214 + 1) * (s^2 + 1.931852s + 1) - + For n=4 we have following equation for the filter transfer function: 1 1 T(s) = --------------------------- * ---------------------------- s^2 + (1/Q) * 0.765367s + 1 s^2 + (1/Q) * 1.847759s + 1 - + The filter consists of two 2nd order sections since highest s power is 2. Now we can take the coefficients, or the numbers by which s is multiplied and plug them into a standard formula to be used by @@ -548,7 +505,7 @@ { int i; _ftype_t k = 2*M_PI/((_ftype_t)(n+1)); // 2*pi/(N+1) - + // Calculate window coefficients for (i=0; i<n; i++) *w++ = 0.5*(1.0 - cos(k*(_ftype_t)(i+1))); @@ -607,7 +564,7 @@ int i; _ftype_t k1 = 2*M_PI/((_ftype_t)(n-1)); // 2*pi/(N-1) _ftype_t k2 = 2*k1; // 4*pi/(N-1) - + // Calculate window coefficients for (i=0; i<n; i++) *w++ = 0.2810638602 - 0.5208971735*cos(k1*(_ftype_t)i) + 0.1980389663*cos(k2*(_ftype_t)i); @@ -615,14 +572,14 @@ /* Computes the 0th order modified Bessel function of the first kind. // (Needed to compute Kaiser window) -// +// // y = sum( (x/(2*n))^2 ) // n */ #define BIZ_EPSILON 1E-21 // Max error acceptable _ftype_t __FASTCALL__ besselizero(_ftype_t x) -{ +{ _ftype_t temp; _ftype_t sum = 1.0; _ftype_t u = 1.0; @@ -651,10 +608,10 @@ // Gold (Theory and Application of DSP) under Kaiser windows for more // about Beta. The following table from Rabiner and Gold gives some // feel for the effect of Beta: -// +// // All ripples in dB, width of transition band = D*N where N = window // length -// +// // BETA D PB RIP SB RIP // 2.120 1.50 +-0.27 -30 // 3.384 2.23 0.0864 -40 @@ -671,8 +628,8 @@ _ftype_t k1 = 1.0/besselizero(b); int k2 = 1 - (n & 1); int end = (n + 1) >> 1; - int i; - + int i; + // Calculate window coefficients for (i=0 ; i<end ; i++){ tmp = (_ftype_t)(2*i + k2) / ((_ftype_t)n - 1.0); @@ -723,7 +680,7 @@ #endif #ifndef __x86_64__ #ifdef __SSE__ - if(gCpuCaps.hasMMX2) change_bps = change_bps_MMX2; + if(gCpuCaps.hasMMX2) change_bps = change_bps_SSE; else #endif #ifdef __MMX__ @@ -738,16 +695,36 @@ static void __FASTCALL__ init_float2int(void* in, void* out, int len, int bps) { -#if 0 -#ifdef CAN_COMPILE_3DNOW2 - if(gCpuCaps.has3DNowExt) float2int = float2int_3DNowEx; +#ifdef __AVX__ + if(gCpuCaps.hasAVX) float2int = float2int_AVX; else #endif -#ifdef CAN_COMPILE_3DNOW - if(gCpuCaps.has3DNow) float2int = float2int_3DNow; +#ifdef __SSE4_1__ + if(gCpuCaps.hasSSE41) float2int = float2int_SSE4; else #endif -#endif /*CAN_COMPILE_X86_ASM*/ +#ifdef __SSSE3__ + if(gCpuCaps.hasSSSE3) float2int = float2int_SSSE3; + else +#endif +#ifdef __SSE3__ + if(gCpuCaps.hasSSE3) float2int = float2int_SSE3; + else +#endif +#ifdef __SSE2__ + if(gCpuCaps.hasSSE2) float2int = float2int_SSE2; + else +#endif +#ifndef __x86_64__ +#ifdef __SSE__ + if(gCpuCaps.hasSSE) float2int = float2int_SSE; + else +#endif +#ifdef __3dNOW__ + if(gCpuCaps.has3DNow) float2int = float2int_3DNOW; + else +#endif +#endif /*__x86_64__*/ float2int = float2int_c; (*float2int)(in,out,len,bps); } @@ -755,16 +732,36 @@ static void __FASTCALL__ init_int2float(void* in, void* out, int len, int bps) { -#if 0 -#ifdef CAN_COMPILE_3DNOW2 - if(gCpuCaps.has3DNowExt) int2float = int2float_3DNowEx; +#ifdef __AVX__ + if(gCpuCaps.hasAVX) int2float = int2float_AVX; else #endif -#ifdef CAN_COMPILE_3DNOW - if(gCpuCaps.has3DNow) int2float = int2float_3DNow; +#ifdef __SSE4_1__ + if(gCpuCaps.hasSSE41) int2float = int2float_SSE4; else #endif -#endif /*CAN_COMPILE_X86_ASM*/ +#ifdef __SSSE3__ + if(gCpuCaps.hasSSSE3) int2float = int2float_SSSE3; + else +#endif +#ifdef __SSE3__ + if(gCpuCaps.hasSSE3) int2float = int2float_SSE3; + else +#endif +#ifdef __SSE2__ + if(gCpuCaps.hasSSE2) int2float = int2float_SSE2; + else +#endif +#ifndef __x86_64__ +#ifdef __SSE__ + if(gCpuCaps.hasSSE) int2float = int2float_SSE; + else +#endif +#ifdef __3dNOW__ + if(gCpuCaps.has3DNow) int2float = int2float_3DNOW; + else +#endif +#endif /*__x86_64__*/ int2float = int2float_c; (*int2float)(in,out,len,bps); } @@ -779,7 +776,7 @@ #endif #ifndef __x86_64__ #ifdef __SSE__ - if(gCpuCaps.hasMMX2) FIR_i16 = FIR_i16_MMX2; + if(gCpuCaps.hasMMX2) FIR_i16 = FIR_i16_SSE; else #endif #ifdef __MMX__ Modified: mplayerxp/postproc/dsp_accel.h =================================================================== --- mplayerxp/postproc/dsp_accel.h 2010-01-19 18:20:08 UTC (rev 113) +++ mplayerxp/postproc/dsp_accel.h 2010-01-20 18:04:15 UTC (rev 114) @@ -2,39 +2,39 @@ #include "pvector/pvector.h" #ifdef HAVE_INT_PVECTOR static __inline __m64 __attribute__((__gnu_inline__, __always_inline__)) -RENAME(_m_load)(const void *__P) +PVECTOR_RENAME(_m_load)(const void *__P) { return *(const __m64 *)__P; } #undef _m_load -#define _m_load RENAME(_m_load) +#define _m_load PVECTOR_RENAME(_m_load) static __inline __m64 __attribute__((__gnu_inline__, __always_inline__)) -RENAME(_m_load_half)(const void *__P) +PVECTOR_RENAME(_m_load_half)(const void *__P) { return _mm_cvtsi32_si64 (*(const int *)__P); } #undef _m_load_half -#define _m_load_half RENAME(_m_load_half) +#define _m_load_half PVECTOR_RENAME(_m_load_half) static __inline void __attribute__((__gnu_inline__, __always_inline__)) -RENAME(_m_store)(void *__P, __m64 src) +PVECTOR_RENAME(_m_store)(void *__P, __m64 src) { *(__m64 *)__P = src; } #undef _m_store -#define _m_store RENAME(_m_store) +#define _m_store PVECTOR_RENAME(_m_store) static __inline void __attribute__((__gnu_inline__, __always_inline__)) -RENAME(_m_store_half)(void *__P, __m64 src) +PVECTOR_RENAME(_m_store_half)(void *__P, __m64 src) { *(int *)__P = _mm_cvtsi64_si32(src); } #undef _m_store_half -#define _m_store_half RENAME(_m_store_half) +#define _m_store_half PVECTOR_RENAME(_m_store_half) static __inline void __attribute__((__gnu_inline__, __always_inline__)) -RENAME(_m_movntq)(void *__P, __m64 src) +PVECTOR_RENAME(_m_movntq)(void *__P, __m64 src) { #ifdef HAVE_MMX2 _mm_stream_pi(__P,src); @@ -43,10 +43,10 @@ #endif } #undef _m_movntq -#define _m_movntq RENAME(_m_movntq) +#define _m_movntq PVECTOR_RENAME(_m_movntq) #endif -static void __FASTCALL__ RENAME(change_bps)(const void* in_data, void* out_data, unsigned len, unsigned inbps, unsigned outbps) +static void __FASTCALL__ PVECTOR_RENAME(change_bps)(const void* in_data, void* out_data, unsigned len, unsigned inbps, unsigned outbps) { #ifdef HAVE_INT_PVECTOR __ivec izero = _ivec_setzero(); @@ -186,7 +186,7 @@ #endif } -static int32_t __FASTCALL__ RENAME(FIR_i16)(int16_t *x,int16_t *w) +static int32_t __FASTCALL__ PVECTOR_RENAME(FIR_i16)(int16_t *x,int16_t *w) { #ifdef OPTIMIZE_MMX __m64 mm[8]; @@ -220,3 +220,316 @@ #endif } +static void __FASTCALL__ PVECTOR_RENAME(float2int)(void* in, void* out, int len, int bps) +{ +#ifdef HAVE_3DNOW + unsigned len_mm; + float tmp_f32[2]; +#endif + float ftmp; + register int i; + switch(bps){ + case(1): + for(i=0;i<len;i++) { + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + ((int8_t*)out)[i]=(int8_t)lrintf(SCHAR_MAX*ftmp); + } + break; + case(2): + i=0; +#ifdef HAVE_3DNOW + len_mm=len&(~15); + tmp_f32[0]= + tmp_f32[1]=SHRT_MAX; + for(;i<len_mm;i+=16) + { + __asm __volatile( + PREFETCH" 64(%1)\n\t" + PREFETCHW" 32(%0)\n\t" + "movq (%1), %%mm0\n\t" + "movq 8(%1), %%mm1\n\t" + "movq 16(%1), %%mm2\n\t" + "movq 24(%1), %%mm3\n\t" + "movq 32(%1), %%mm4\n\t" + "movq 40(%1), %%mm5\n\t" + "movq 48(%1), %%mm6\n\t" + "movq 56(%1), %%mm7\n\t" + "pfmul %2, %%mm0\n\t" + "pfmul %2, %%mm1\n\t" + "pfmul %2, %%mm2\n\t" + "pfmul %2, %%mm3\n\t" + "pfmul %2, %%mm4\n\t" + "pfmul %2, %%mm5\n\t" + "pfmul %2, %%mm6\n\t" + "pfmul %2, %%mm7\n\t" + "pf2id %%mm0, %%mm0\n\t" + "pf2id %%mm1, %%mm1\n\t" + "pf2id %%mm2, %%mm2\n\t" + "pf2id %%mm3, %%mm3\n\t" + "pf2id %%mm4, %%mm4\n\t" + "pf2id %%mm5, %%mm5\n\t" + "pf2id %%mm6, %%mm6\n\t" + "pf2id %%mm7, %%mm7\n\t" + "packssdw %%mm1, %%mm0\n\t" + "packssdw %%mm3, %%mm2\n\t" + "packssdw %%mm5, %%mm4\n\t" + "packssdw %%mm7, %%mm6\n\t" + "movq %%mm0, (%0)\n\t" + "movq %%mm2, 8(%0)\n\t" + "movq %%mm4, 16(%0)\n\t" + "movq %%mm6, 24(%0)" + ::"r"(&(((uint16_t*)out)[i])),"r"(&(((float*)in)[i])),"m"(tmp_f32[0]) + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); + } +#endif + for(;i<len;i++) { + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + ((int16_t*)out)[i]=(int16_t)lrintf(SHRT_MAX*ftmp); + } + break; + case(3): + for(i=0;i<len;i++) { + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + store24bit(out, i, (int32_t)lrintf((INT_MAX-1)*ftmp)); + } + break; + case(4): + i=0; +#ifdef HAVE_3DNOW + len_mm=len&(~15); + tmp_f32[0]= + tmp_f32[1]=INT_MAX; + for(;i<len_mm;i+=16) + { + __asm __volatile( + PREFETCH" 64(%1)\n\t" + PREFETCHW" 64(%0)\n\t" + "movq (%1), %%mm0\n\t" + "movq 8(%1), %%mm1\n\t" + "movq 16(%1), %%mm2\n\t" + "movq 24(%1), %%mm3\n\t" + "movq 32(%1), %%mm4\n\t" + "movq 40(%1), %%mm5\n\t" + "movq 48(%1), %%mm6\n\t" + "movq 56(%1), %%mm7\n\t" + "pfmul %2, %%mm0\n\t" + "pfmul %2, %%mm1\n\t" + "pfmul %2, %%mm2\n\t" + "pfmul %2, %%mm3\n\t" + "pfmul %2, %%mm4\n\t" + "pfmul %2, %%mm5\n\t" + "pfmul %2, %%mm6\n\t" + "pfmul %2, %%mm7\n\t" + "pf2id %%mm0, %%mm0\n\t" + "pf2id %%mm1, %%mm1\n\t" + "pf2id %%mm2, %%mm2\n\t" + "pf2id %%mm3, %%mm3\n\t" + "pf2id %%mm4, %%mm4\n\t" + "pf2id %%mm5, %%mm5\n\t" + "pf2id %%mm6, %%mm6\n\t" + "pf2id %%mm7, %%mm7\n\t" + "movq %%mm0, (%0)\n\t" + "movq %%mm1, 8(%0)\n\t" + "movq %%mm2, 16(%0)\n\t" + "movq %%mm3, 24(%0)\n\t" + "movq %%mm4, 32(%0)\n\t" + "movq %%mm5, 40(%0)\n\t" + "movq %%mm6, 48(%0)\n\t" + "movq %%mm7, 56(%0)" + ::"r"(&(((uint32_t*)out)[i])),"r"(&(((float*)in)[i])),"m"(tmp_f32[0]) + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); + } +#endif + for(;i<len;i++) { + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + ((int32_t*)out)[i]=(int32_t)lrintf((INT_MAX-1)*ftmp); + } + break; + } +#ifdef HAVE_3DNOW + asm volatile(EMMS:: + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); +#endif +} + +static void __FASTCALL__ PVECTOR_RENAME(int2float)(void* in, void* out, int len, int bps) +{ +#ifdef HAVE_F32_PVECTOR + __f32vec rev_imax = _f32vec_broadcast(1.0/INT_MAX); +#endif + register int i; + switch(bps){ + case(1): + for(i=0;i<len;i++) + ((float*)out)[i]=(1.0/SCHAR_MAX)*((float)((int8_t*)in)[i]); + break; + case(2): + i=0; +#ifdef HAVE_3DNOW + tmp_f32[0]= + tmp_f32[1]=1.0/INT_MAX; + len_mm=len&(~15); + for(;i<len_mm;i+=16) + { + __asm __volatile( + PREFETCH" 32(%1)\n\t" + PREFETCHW" 64(%0)\n\t" + "movq (%1), %%mm0\n\t" + "movq 8(%1), %%mm1\n\t" + "movq 16(%1), %%mm2\n\t" + "movq 24(%1), %%mm3\n\t" + "pxor %%mm4, %%mm4\n\t" + "pxor %%mm5, %%mm5\n\t" + "pxor %%mm6, %%mm6\n\t" + "pxor %%mm7, %%mm7\n\t" + "punpcklwd %%mm0, %%mm4\n\t" + "punpckhwd %%mm0, %%mm5\n\t" + "punpcklwd %%mm1, %%mm6\n\t" + "punpckhwd %%mm1, %%mm7\n\t" + "pi2fd %%mm4, %%mm4\n\t" + "pi2fd %%mm5, %%mm5\n\t" + "pi2fd %%mm6, %%mm6\n\t" + "pi2fd %%mm7, %%mm7\n\t" + "pfmul %2, %%mm4\n\t" + "pfmul %2, %%mm5\n\t" + "pfmul %2, %%mm6\n\t" + "pfmul %2, %%mm7\n\t" + "movq %%mm4, (%0)\n\t" + "movq %%mm5, 8(%0)\n\t" + "movq %%mm6, 16(%0)\n\t" + "movq %%mm7, 24(%0)\n\t" + "pxor %%mm4, %%mm4\n\t" + "pxor %%mm5, %%mm5\n\t" + "pxor %%mm6, %%mm6\n\t" + "pxor %%mm7, %%mm7\n\t" + "punpcklwd %%mm2, %%mm4\n\t" + "punpckhwd %%mm2, %%mm5\n\t" + "punpcklwd %%mm3, %%mm6\n\t" + "punpckhwd %%mm3, %%mm7\n\t" + "pi2fd %%mm4, %%mm4\n\t" + "pi2fd %%mm5, %%mm5\n\t" + "pi2fd %%mm6, %%mm6\n\t" + "pi2fd %%mm7, %%mm7\n\t" + "pfmul %2, %%mm4\n\t" + "pfmul %2, %%mm5\n\t" + "pfmul %2, %%mm6\n\t" + "pfmul %2, %%mm7\n\t" + "movq %%mm4, 32(%0)\n\t" + "movq %%mm5, 40(%0)\n\t" + "movq %%mm6, 48(%0)\n\t" + "movq %%mm7, 56(%0)\n\t" + "femms" + ::"r"(&(((float*)out)[i])),"r"(&(((int16_t*)in)[i])),"m"(tmp_f32[0]) + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); + } +#endif + for(;i<len;i++) + ((float*)out)[i]=(1.0/SHRT_MAX)*((float)((int16_t*)in)[i]); + break; + case(3): + for(i=0;i<len;i++) + ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t)load24bit(in, i))); + break; + case(4): + i=0; +#ifdef HAVE_F32_PVECTOR + for(;i<len;i++) { + ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); + if((((long)out)&(__F32VEC_SIZE-1))==0) break; + } + _ivec_empty(); + if((len-i)>=__F32VEC_SIZE) + for(;i<len;i+=__F32VEC_SIZE/sizeof(float)) { + __f32vec tmp; + tmp = _f32vec_mul(rev_imax,_f32vec_from_s32u(&((int32_t*)in)[i])); + _f32vec_storea(&((float*)out)[i],tmp); + } + _ivec_sfence(); + _ivec_empty(); +#endif + for(;i<len;i++) + ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); + break; + } +} + +static float __FASTCALL__ PVECTOR_RENAME(FIR_f32)(float *x,float *w) +{ +#ifdef HAVE_3DNOW + float rval; + __asm __volatile( + "movq (%1), %%mm0\n\t" + "movq 8(%1), %%mm1\n\t" + "movq 16(%1), %%mm2\n\t" + "movq 24(%1), %%mm3\n\t" + "movq 32(%1), %%mm4\n\t" + "movq 40(%1), %%mm5\n\t" + "movq 48(%1), %%mm6\n\t" + "movq 56(%1), %%mm7\n\t" + "pfmul (%2), %%mm0\n\t" + "pfmul 8(%2), %%mm1\n\t" + "pfmul 16(%2), %%mm2\n\t" + "pfmul 24(%2), %%mm3\n\t" + "pfmul 32(%2), %%mm4\n\t" + "pfmul 40(%2), %%mm5\n\t" + "pfmul 48(%2), %%mm6\n\t" + "pfmul 56(%2), %%mm7\n\t" + "pfadd %%mm1, %%mm0\n\t" + "pfadd %%mm3, %%mm2\n\t" + "pfadd %%mm5, %%mm4\n\t" + "pfadd %%mm7, %%mm6\n\t" + "pfadd %%mm2, %%mm0\n\t" + "pfadd %%mm6, %%mm4\n\t" + "pfadd %%mm4, %%mm0\n\t" + "pfacc %%mm0, %%mm0\n\t" + "movd %%mm0, %0\n\t" + "femms" + :"=&r"(rval):"r"(w),"r"(x) + :"memory" +#ifdef FPU_CLOBBERED + ,FPU_CLOBBERED +#endif +#ifdef MMX_CLOBBERED + ,MMX_CLOBBERED +#endif + ); + return rval; +#else + return ( w[0] *x[0] +w[1] *x[1] +w[2] *x[2] +w[3] *x[3] + + w[4] *x[4] +w[5] *x[5] +w[6] *x[6] +w[7] *x[7] + + w[8] *x[8] +w[9] *x[9] +w[10]*x[10]+w[11]*x[11] + + w[12]*x[12]+w[13]*x[13]+w[14]*x[14]+w[15]*x[15] ); +#endif +} Deleted: mplayerxp/postproc/dsp_accelf.h =================================================================== --- mplayerxp/postproc/dsp_accelf.h 2010-01-19 18:20:08 UTC (rev 113) +++ mplayerxp/postproc/dsp_accelf.h 2010-01-20 18:04:15 UTC (rev 114) @@ -1,354 +0,0 @@ -/* DSP floating-point acceleration routines */ - -static void __FASTCALL__ RENAME(float2int)(void* in, void* out, int len, int bps) -{ -#ifdef HAVE_3DNOW - unsigned len_mm; - float tmp_f32[2]; -#endif - float ftmp; - register int i; - switch(bps){ - case(1): - for(i=0;i<len;i++) { - ftmp=((float*)in)[i]; - SATURATE(ftmp,-1.0,+1.0); - ((int8_t*)out)[i]=(int8_t)lrintf(SCHAR_MAX*ftmp); - } - break; - case(2): - i=0; -#ifdef HAVE_3DNOW - len_mm=len&(~15); - tmp_f32[0]= - tmp_f32[1]=SHRT_MAX; - for(;i<len_mm;i+=16) - { - __asm __volatile( - PREFETCH" 64(%1)\n\t" - PREFETCHW" 32(%0)\n\t" - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "movq 32(%1), %%mm4\n\t" - "movq 40(%1), %%mm5\n\t" - "movq 48(%1), %%mm6\n\t" - "movq 56(%1), %%mm7\n\t" - "pfmul %2, %%mm0\n\t" - "pfmul %2, %%mm1\n\t" - "pfmul %2, %%mm2\n\t" - "pfmul %2, %%mm3\n\t" - "pfmul %2, %%mm4\n\t" - "pfmul %2, %%mm5\n\t" - "pfmul %2, %%mm6\n\t" - "pfmul %2, %%mm7\n\t" - "pf2id %%mm0, %%mm0\n\t" - "pf2id %%mm1, %%mm1\n\t" - "pf2id %%mm2, %%mm2\n\t" - "pf2id %%mm3, %%mm3\n\t" - "pf2id %%mm4, %%mm4\n\t" - "pf2id %%mm5, %%mm5\n\t" - "pf2id %%mm6, %%mm6\n\t" - "pf2id %%mm7, %%mm7\n\t" - "packssdw %%mm1, %%mm0\n\t" - "packssdw %%mm3, %%mm2\n\t" - "packssdw %%mm5, %%mm4\n\t" - "packssdw %%mm7, %%mm6\n\t" - "movq %%mm0, (%0)\n\t" - "movq %%mm2, 8(%0)\n\t" - "movq %%mm4, 16(%0)\n\t" - "movq %%mm6, 24(%0)" - ::"r"(&(((uint16_t*)out)[i])),"r"(&(((float*)in)[i])),"m"(tmp_f32[0]) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - } -#endif - for(;i<len;i++) { - ftmp=((float*)in)[i]; - SATURATE(ftmp,-1.0,+1.0); - ((int16_t*)out)[i]=(int16_t)lrintf(SHRT_MAX*ftmp); - } - break; - case(3): - for(i=0;i<len;i++) { - ftmp=((float*)in)[i]; - SATURATE(ftmp,-1.0,+1.0); - store24bit(out, i, (int32_t)lrintf((INT_MAX-1)*ftmp)); - } - break; - case(4): - i=0; -#ifdef HAVE_3DNOW - len_mm=len&(~15); - tmp_f32[0]= - tmp_f32[1]=INT_MAX; - for(;i<len_mm;i+=16) - { - __asm __volatile( - PREFETCH" 64(%1)\n\t" - PREFETCHW" 64(%0)\n\t" - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "movq 32(%1), %%mm4\n\t" - "movq 40(%1), %%mm5\n\t" - "movq 48(%1), %%mm6\n\t" - "movq 56(%1), %%mm7\n\t" - "pfmul %2, %%mm0\n\t" - "pfmul %2, %%mm1\n\t" - "pfmul %2, %%mm2\n\t" - "pfmul %2, %%mm3\n\t" - "pfmul %2, %%mm4\n\t" - "pfmul %2, %%mm5\n\t" - "pfmul %2, %%mm6\n\t" - "pfmul %2, %%mm7\n\t" - "pf2id %%mm0, %%mm0\n\t" - "pf2id %%mm1, %%mm1\n\t" - "pf2id %%mm2, %%mm2\n\t" - "pf2id %%mm3, %%mm3\n\t" - "pf2id %%mm4, %%mm4\n\t" - "pf2id %%mm5, %%mm5\n\t" - "pf2id %%mm6, %%mm6\n\t" - "pf2id %%mm7, %%mm7\n\t" - "movq %%mm0, (%0)\n\t" - "movq %%mm1, 8(%0)\n\t" - "movq %%mm2, 16(%0)\n\t" - "movq %%mm3, 24(%0)\n\t" - "movq %%mm4, 32(%0)\n\t" - "movq %%mm5, 40(%0)\n\t" - "movq %%mm6, 48(%0)\n\t" - "movq %%mm7, 56(%0)" - ::"r"(&(((uint32_t*)out)[i])),"r"(&(((float*)in)[i])),"m"(tmp_f32[0]) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - } -#endif - for(;i<len;i++) { - ftmp=((float*)in)[i]; - SATURATE(ftmp,-1.0,+1.0); - ((int32_t*)out)[i]=(int32_t)lrintf((INT_MAX-1)*ftmp); - } - break; - } -#ifdef HAVE_3DNOW - asm volatile(EMMS:: - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); -#endif -} - -static void __FASTCALL__ RENAME(int2float)(void* in, void* out, int len, int bps) -{ -#ifdef HAVE_3DNOW - unsigned len_mm; - float tmp_f32[2]; -#endif - register int i; - switch(bps){ - case(1): - for(i=0;i<len;i++) - ((float*)out)[i]=(1.0/SCHAR_MAX)*((float)((int8_t*)in)[i]); - break; - case(2): - i=0; -#ifdef HAVE_3DNOW - tmp_f32[0]= - tmp_f32[1]=1.0/INT_MAX; - len_mm=len&(~15); - for(;i<len_mm;i+=16) - { - __asm __volatile( - PREFETCH" 32(%1)\n\t" - PREFETCHW" 64(%0)\n\t" - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "pxor %%mm4, %%mm4\n\t" - "pxor %%mm5, %%mm5\n\t" - "pxor %%mm6, %%mm6\n\t" - "pxor %%mm7, %%mm7\n\t" - "punpcklwd %%mm0, %%mm4\n\t" - "punpckhwd %%mm0, %%mm5\n\t" - "punpcklwd %%mm1, %%mm6\n\t" - "punpckhwd %%mm1, %%mm7\n\t" - "pi2fd %%mm4, %%mm4\n\t" - "pi2fd %%mm5, %%mm5\n\t" - "pi2fd %%mm6, %%mm6\n\t" - "pi2fd %%mm7, %%mm7\n\t" - "pfmul %2, %%mm4\n\t" - "pfmul %2, %%mm5\n\t" - "pfmul %2, %%mm6\n\t" - "pfmul %2, %%mm7\n\t" - "movq %%mm4, (%0)\n\t" - "movq %%mm5, 8(%0)\n\t" - "movq %%mm6, 16(%0)\n\t" - "movq %%mm7, 24(%0)\n\t" - "pxor %%mm4, %%mm4\n\t" - "pxor %%mm5, %%mm5\n\t" - "pxor %%mm6, %%mm6\n\t" - "pxor %%mm7, %%mm7\n\t" - "punpcklwd %%mm2, %%mm4\n\t" - "punpckhwd %%mm2, %%mm5\n\t" - "punpcklwd %%mm3, %%mm6\n\t" - "punpckhwd %%mm3, %%mm7\n\t" - "pi2fd %%mm4, %%mm4\n\t" - "pi2fd %%mm5, %%mm5\n\t" - "pi2fd %%mm6, %%mm6\n\t" - "pi2fd %%mm7, %%mm7\n\t" - "pfmul %2, %%mm4\n\t" - "pfmul %2, %%mm5\n\t" - "pfmul %2, %%mm6\n\t" - "pfmul %2, %%mm7\n\t" - "movq %%mm4, 32(%0)\n\t" - "movq %%mm5, 40(%0)\n\t" - "movq %%mm6, 48(%0)\n\t" - "movq %%mm7, 56(%0)\n\t" - "femms" - ::"r"(&(((float*)out)[i])),"r"(&(((int16_t*)in)[i])),"m"(tmp_f32[0]) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - } -#endif - for(;i<len;i++) - ((float*)out)[i]=(1.0/SHRT_MAX)*((float)((int16_t*)in)[i]); - break; - case(3): - for(i=0;i<len;i++) - ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t)load24bit(in, i))); - break; - case(4): - i=0; -#ifdef HAVE_3DNOW - tmp_f32[0]= - tmp_f32[1]=1.0/INT_MAX; - len_mm=len&(~15); - for(;i<len_mm;i+=16) - { - __asm __volatile( - PREFETCH" 64(%1)\n\t" - PREFETCHW" 64(%0)\n\t" - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "movq 32(%1), %%mm4\n\t" - "movq 40(%1), %%mm5\n\t" - "movq 48(%1), %%mm6\n\t" - "movq 56(%1), %%mm7\n\t" - "pi2fd %%mm0, %%mm0\n\t" - "pi2fd %%mm1, %%mm1\n\t" - "pi2fd %%mm2, %%mm2\n\t" - "pi2fd %%mm3, %%mm3\n\t" - "pi2fd %%mm4, %%mm4\n\t" - "pi2fd %%mm5, %%mm5\n\t" - "pi2fd %%mm6, %%mm6\n\t" - "pi2fd %%mm7, %%mm7\n\t" - "pfmul %2, %%mm0\n\t" - "pfmul %2, %%mm1\n\t" - "pfmul %2, %%mm2\n\t" - "pfmul %2, %%mm3\n\t" - "pfmul %2, %%mm4\n\t" - "pfmul %2, %%mm5\n\t" - "pfmul %2, %%mm6\n\t" - "pfmul %2, %%mm7\n\t" - "movq %%mm0, (%0)\n\t" - "movq %%mm1, 8(%0)\n\t" - "movq %%mm2, 16(%0)\n\t" - "movq %%mm3, 24(%0)\n\t" - "movq %%mm4, 32(%0)\n\t" - "movq %%mm5, 40(%0)\n\t" - "movq %%mm6, 48(%0)\n\t" - "movq %%mm7, 56(%0)\n\t" - "femms" - ::"r"(&(((float*)out)[i])),"r"(&(((int32_t*)in)[i])),"m"(tmp_f32[0]) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - } -#endif - for(;i<len;i++) - ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); - break; - } -} - -static float __FASTCALL__ RENAME(FIR_f32)(float *x,float *w) -{ -#ifdef HAVE_3DNOW - float rval; - __asm __volatile( - "movq (%1), %%mm0\n\t" - "movq 8(%1), %%mm1\n\t" - "movq 16(%1), %%mm2\n\t" - "movq 24(%1), %%mm3\n\t" - "movq 32(%1), %%mm4\n\t" - "movq 40(%1), %%mm5\n\t" - "movq 48(%1), %%mm6\n\t" - "movq 56(%1), %%mm7\n\t" - "pfmul (%2), %%mm0\n\t" - "pfmul 8(%2), %%mm1\n\t" - "pfmul 16(%2), %%mm2\n\t" - "pfmul 24(%2), %%mm3\n\t" - "pfmul 32(%2), %%mm4\n\t" - "pfmul 40(%2), %%mm5\n\t" - "pfmul 48(%2), %%mm6\n\t" - "pfmul 56(%2), %%mm7\n\t" - "pfadd %%mm1, %%mm0\n\t" - "pfadd %%mm3, %%mm2\n\t" - "pfadd %%mm5, %%mm4\n\t" - "pfadd %%mm7, %%mm6\n\t" - "pfadd %%mm2, %%mm0\n\t" - "pfadd %%mm6, %%mm4\n\t" - "pfadd %%mm4, %%mm0\n\t" - "pfacc %%mm0, %%mm0\n\t" - "movd %%mm0, %0\n\t" - "femms" - :"=&r"(rval):"r"(w),"r"(x) - :"memory" -#ifdef FPU_CLOBBERED - ,FPU_CLOBBERED -#endif -#ifdef MMX_CLOBBERED - ,MMX_CLOBBERED -#endif - ); - return rval; -#else - return ( w[0] *x[0] +w[1] *x[1] +w[2] *x[2] +w[3] *x[3] - + w[4] *x[4] +w[5] *x[5] +w[6] *x[6] +w[7] *x[7] - + w[8] *x[8] +w[9] *x[9] +w[10]*x[10]+w[11]*x[11] - + w[12]*x[12]+w[13]*x[13]+w[14]*x[14]+w[15]*x[15] ); -#endif -} Modified: mplayerxp/pvector/pvector.h =================================================================== --- mplayerxp/pvector/pvector.h 2010-01-19 18:20:08 UTC (rev 113) +++ mplayerxp/pvector/pvector.h 2010-01-20 18:04:15 UTC (rev 114) @@ -2,7 +2,12 @@ PVector - Portable vectoring implementation of parallel computing */ #define HAVE_INT_PVECTOR 1 +#define HAVE_F32_PVECTOR 1 +#ifndef PVECTOR_RENAME +#error "Never include this file directly! Include pvector_inc.h instead" +#endif + #ifdef OPTIMIZE_AVX #define OPTIMIZE_AES #endif @@ -22,7 +27,10 @@ #define OPTIMIZE_SSE #define OPTIMIZE_MMX2 #endif -#ifdef OPTIMIZE_MMX2 +#ifdef OPTIMIZE_SSE +#define OPTIMIZE_3DNOW +#endif +#if defined( OPTIMIZE_MMX2 ) #define OPTIMIZE_MMX #endif @@ -32,6 +40,12 @@ //#warning "pvector's generic version isn't yet ready" #undef HAVE_INT_PVECTOR #endif +#if defined( OPTIMIZE_3DNOW ) +#include "pvector_f32_x86.h" +#else +//#warning "pvector's generic version isn't yet ready" +#undef HAVE_F32_PVECTOR +#endif /* @@ -146,3 +160,40 @@ __ivec _ivec_mullo_s16(__ivec s1,__ivec s2); // Multiply low part S16 __ivec _ivec_mulhi_s16(__ivec s1,__ivec s2); // Multiply high part S16 */ + +/* ========================= FLOAT32 Support ================================ */ + +/* + ABBREVIATION: + f32 - float32_t + + This interface defines: + __F32VEC_SIZE size of vector in bytes + __f32vec type of vector + + functions: + ========== + LOAD/STORE engine: + ------------------ + __f32vec _f32vec_loadu(float const *__P); // load unaligned data into vector + __f32vec _f32vec_loada(float const *__P); // load aligned data into vector + __f32vec _f32vec_setzero(void); // load ZERO into vector + __f32vec _f32vec_broadcast(float f32); // fill vector with f32...f32 values + void _f32vec_storeu(float *__P, __f32vec src); // store vector into unaligned memory + void _f32vec_storea(float *__P, __f32vec src); // store vector into aligned memory + void _f32vec_stream(float *__P, __f32vec src); // store vector into memory across CPU's cache + + CONVERTION engine: + ------------------ + __f32vec _f32vec_from_s32u(void const * src); // convert s32 to f32 unaligned vector + void _f32vec_to_s32u(void *dst,__f32vec src); // convert f32 to s32 unaligned vector + __f32vec _f32vec_from_s32a(void const * src); // convert s32 to f32 aligned vector + void _f32vec_to_s32a(void *dst,__f32vec src); // convert f32 to s32 aligned vector + + ARITHMETIC engine: + ------------------ + __f32vec _f32vec_add(__f32vec f1, __f32vec f2); // add: f1+f2 + __f32vec _f32vec_sub(__f32vec f1, __f32vec f2); // sub: f1-f2 + __f32vec _f32vec_mul(__f32vec f1, __f32vec f2); // mul: f1*f2 + __f32vec _f32vec_div(__f32vec f1, __f32vec f2); // div: f1/f2 +*/ Added: mplayerxp/pvector/pvector_f32_x86.h =================================================================== --- mplayerxp/pvector/pvector_f32_x86.h (rev 0) +++ mplayerxp/pvector/pvector_f32_x86.h 2010-01-20 18:04:15 UTC (rev 114) @@ -0,0 +1,271 @@ +/* + pvector_f32_x86.h +*/ + +#if defined( OPTIMIZE_AVX ) +#include <immintrin.h> +#elif defined(OPTIMIZE_AES) +#include <wmmintrin.h> +#elif defined (OPTIMIZE_SSE4) +#include <smmintrin.h> +#elif defined(OPTIMIZE_SSSE3) +#include <tmmintrin.h> +#elif defined(OPTIMIZE_SSE3) +#include <pmmintrin.h> +#elif defined(OPTIMIZE_SSE2) +#include <emmintrin.h> +#elif defined(OPTIMIZE_SSE) +#include <xmmintrin.h> +#else +#include <xmmintrin.h> // includes mm_* +#include <mm3dnow.h> +#endif + +#undef __F32VEC_SIZE +#undef __f32vec +#ifdef OPTIMIZE_AVX +#define __F32VEC_SIZE 32 +#define __f32vec __m256 +#elif defined( OPTIMIZE_SSE ) +#define __F32VEC_SIZE 16 +#define __f32vec __m128 +#else +#define __F32VEC_SIZE 8 +#define __f32vec __m64 +#endif + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_loadu)(float const *__P) +{ +#ifdef OPTIMIZE_AVX + return _mm256_loadu_ps(__P); +#elif defined( OPTIMIZE_SSE ) + return _mm_loadu_ps(__P); +#else + return *(__f32vec const *)__P; +#endif +} +#undef _f32vec_loadu +#define _f32vec_loadu PVECTOR_RENAME(f32_loadu) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_loada)(float const *__P) +{ +#ifdef OPTIMIZE_AVX + return _mm256_load_ps(__P); +#elif defined( OPTIMIZE_SSE ) + return _mm_load_ps(__P); +#else + return *(__m64 const *)__P; +#endif +} +#undef _f32vec_loada +#define _f32vec_loada PVECTOR_RENAME(f32_loada) + +extern __inline void __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_storeu)(float *__P, __f32vec src) +{ +#ifdef OPTIMIZE_AVX + _mm256_storeu_ps(__P,src); +#elif defined( OPTIMIZE_SSE ) + _mm_storeu_ps(__P,src); +#else + *(__m64 *)__P = src; +#endif +} +#undef _f32vec_storeu +#define _f32vec_storeu PVECTOR_RENAME(f32_storeu) + +extern __inline void __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_storea)(float *__P, __f32vec src) +{ +#ifdef OPTIMIZE_AVX + _mm256_store_ps(__P,src); +#elif defined( OPTIMIZE_SSE ) + _mm_store_ps(__P,src); +#else + *(__m64 *)__P = src; +#endif +} +#undef _f32vec_storea +#define _f32vec_storea PVECTOR_RENAME(f32_storea) + +extern __inline void __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_stream)(float *__P, __f32vec src) +{ +#ifdef OPTIMIZE_AVX + _mm256_stream_ps(__P,src); +#elif defined( OPTIMIZE_SSE ) + _mm_stream_ps(__P,src); +#else + _mm_stream_pi((__m64 *)__P,(__m64)src); +#endif +} +#undef _f32vec_stream +#define _f32vec_stream PVECTOR_RENAME(f32_stream) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_setzero)(void) +{ +#ifdef OPTIMIZE_AVX + return _mm256_setzero_ps(); +#elif defined( OPTIMIZE_SSE ) + return _mm_setzero_ps(); +#else + return _mm_setzero_si64(); +#endif +} +#undef _f32vec_setzero +#define _f32vec_setzero PVECTOR_RENAME(f32_setzero) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_broadcast)(float f32) +{ +#ifdef OPTIMIZE_AVX + return _mm256_set1_ps(f32); +#elif defined( OPTIMIZE_SSE ) + return _mm_set1_ps(f32); +#else + return (__m64)(__v2sf){ f32, f32 }; +#endif +} +#undef _f32vec_broadcast +#define _f32vec_broadcast PVECTOR_RENAME(f32_broadcast) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_from_s32u)(void const * src) +{ +#ifdef OPTIMIZE_AVX + return _mm256_cvtepi32_ps(_mm256_loadu_si256(src)); +#elif defined( OPTIMIZE_SSE2 ) + return _mm_cvtepi32_ps(_mm_loadu_si128(src)); +#elif defined( OPTIMIZE_SSE ) + __m128 tmp=_mm_setzero_ps(); + tmp = _mm_cvtpi32_ps(tmp,*(__m64 const *)((char const *)src+8)); + tmp = _mm_movelh_ps (tmp, tmp); + return _mm_cvtpi32_ps(tmp,*(__m64 const *)src); +#else + return _m_pi2fd(*(__m64 const *)src); +#endif +} +#undef _f32vec_from_s32u +#define _f32vec_from_s32u PVECTOR_RENAME(f32_from_s32u) + +extern __inline void __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_to_s32u)(void *dst,__f32vec src) +{ +#ifdef OPTIMIZE_AVX + return _mm256_storeu_si356(dst,_mm256_cvtps_epi32(src)); +#elif defined( OPTIMIZE_SSE2 ) + return _mm_storeu_si128(dst,_mm_cvtps_epi32(src)); +#elif defined( OPTIMIZE_SSE ) + __m128 tmp; + *(__m64 *)dst = _mm_cvtps_pi32(src); + tmp = _mm_movehl_ps (tmp, src); + *(__m64 *)((char *)dst+8) = _mm_cvtps_pi32(tmp); +#else + *(__m64 *)dst = _m_pf2id(src); +#endif +} +#undef _f32vec_to_s32u +#define _f32vec_to_s32u PVECTOR_RENAME(f32_to_s32u) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_from_s32a)(void const * src) +{ +#ifdef OPTIMIZE_AVX + return _mm256_cvtepi32_ps(_mm256_load_si256(src)); +#elif defined( OPTIMIZE_SSE2 ) + return _mm_cvtepi32_ps(_mm_load_si128(src)); +#elif defined( OPTIMIZE_SSE ) + __m128 tmp=_mm_setzero_ps(); + tmp = _mm_cvtpi32_ps(tmp,*(__m64 const *)((char const *)src+8)); + tmp = _mm_movelh_ps (tmp, tmp); + return _mm_cvtpi32_ps(tmp,*(__m64 const *)src); +#else + return _m_pi2fd(*(__m64 const *)src); +#endif +} +#undef _f32vec_from_s32a +#define _f32vec_from_s32a PVECTOR_RENAME(f32_from_s32a) + +extern __inline void __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_to_s32a)(void *dst,__f32vec src) +{ +#ifdef OPTIMIZE_AVX + return _mm256_store_si356(dst,_mm256_cvtps_epi32(src)); +#elif defined( OPTIMIZE_SSE2 ) + _mm_store_si128(dst,_mm_cvtps_epi32(src)); +#elif defined( OPTIMIZE_SSE ) + __m128 tmp; + *(__m64 *)dst = _mm_cvtps_pi32(src); + tmp = _mm_movehl_ps (tmp, src); + *(__m64 *)((char *)dst+8) = _mm_cvtps_pi32(tmp); +#else + *(__m64 *)dst = _m_pf2id(src); +#endif +} +#undef _f32vec_to_s32a +#define _f32vec_to_s32a PVECTOR_RENAME(f32_to_s32a) + +/* ARITHMETICS */ + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_add)(__f32vec f1,__f32vec f2) +{ +#ifdef OPTIMIZE_AVX + return _mm256_add_ps(f1,f2); +#elif defined( OPTIMIZE_SSE ) + return _mm_add_ps(f1,f2); +#else + return _m_pfadd(f1,f2); +#endif +} +#undef _f32vec_add +#define _f32vec_add PVECTOR_RENAME(f32_add) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_sub)(__f32vec f1,__f32vec f2) +{ +#ifdef OPTIMIZE_AVX + return _mm256_sub_ps(f1,f2); +#elif defined( OPTIMIZE_SSE ) + return _mm_sub_ps(f1,f2); +#else + return _m_pfsub(f1,f2); +#endif +} +#undef _f32vec_sub +#define _f32vec_sub PVECTOR_RENAME(f32_sub) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_mul)(__f32vec f1,__f32vec f2) +{ +#ifdef OPTIMIZE_AVX + return _mm256_mul_ps(f1,f2); +#elif defined( OPTIMIZE_SSE ) + return _mm_mul_ps(f1,f2); +#else + return _m_pfmul(f1,f2); +#endif +} +#undef _f32vec_mul +#define _f32vec_mul PVECTOR_RENAME(f32_mul) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_div)(__f32vec f1,__f32vec f2) +{ +#ifdef OPTIMIZE_AVX + return _mm256_div_ps(f1,f2); +#elif defined( OPTIMIZE_SSE ) + return _mm_div_ps(f1,f2); +#else + __m64 tmp; + tmp = _m_pfrcp(f2); + tmp = _m_pfrcpit1(tmp,f2); + tmp = _m_pfrcpit2(tmp,f2); + return _m_pfmul(f1,tmp); +#endif +} +#undef _f32vec_div +#define _f32vec_div PVECTOR_RENAME(f32_div) Property changes on: mplayerxp/pvector/pvector_f32_x86.h ___________________________________________________________________ Added: svn:eol-style + native Added: mplayerxp/pvector/pvector_inc.h =================================================================== --- mplayerxp/pvector/pvector_inc.h (rev 0) +++ mplayerxp/pvector/pvector_inc.h 2010-01-20 18:04:15 UTC (rev 114) @@ -0,0 +1,79 @@ +#ifndef __PVECTOR_INC_H +#define __PVECTOR_INC_H + +#ifndef PVECTOR_ACCEL_H +#error "You should define PVECTOR_ACCEL_H before including of this file" +#endif + +#undef OPTIMIZE_AVX +#undef OPTIMIZE_SSE4 +#undef OPTIMIZE_SSSE3 +#undef OPTIMIZE_SSE3 +#undef OPTIMIZE_SSE2 +#undef OPTIMIZE_SSE +#undef OPTIMIZE_MMX2 +#undef OPTIMIZE_MMX +#undef OPTIMIZE_3DNOW +#define PVECTOR_RENAME(a) a ## _c +#include PVECTOR_ACCEL_H + +#ifndef __x86_64__ +#ifdef __MMX__ +#define OPTIMIZE_MMX +#undef PVECTOR_RENAME +#define PVECTOR_RENAME(a) a ## _MMX +#include PVECTOR_ACCEL_H +#endif + +#ifdef __3dNOW__ +#define OPTIMIZE_3DNOW +#undef PVECTOR_RENAME +#define PVECTOR_RENAME(a) a ## _3DNOW +#include PVECTOR_ACCEL_H +#endif + +#ifdef __SSE__ +#define OPTIMIZE_SSE +#define OPTIMIZE_MMX2 +#undef PVECTOR_RENAME +#define PVECTOR_RENAME(a) a ## _SSE +#include PVECTOR_ACCEL_H +#endif +#endif //__x86_64__ + +#ifdef __SSE2__ +#define OPTIMIZE_SSE2 +#undef PVECTOR_RENAME +#define PVECTOR_RENAME(a) a ## _SSE2 +#include PVECTOR_ACCEL_H +#endif + +#ifdef __SSE3__ +#define OPTIMIZE_SSE3 +#undef PVECTOR_RENAME +#define PVECTOR_RENAME(a) a ## _SSE3 +#include PVECTOR_ACCEL_H +#endif ... [truncated message content] |
From: <nic...@us...> - 2010-01-21 14:58:45
|
Revision: 116 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=116&view=rev Author: nickols_k Date: 2010-01-21 14:58:37 +0000 (Thu, 21 Jan 2010) Log Message: ----------- minor accelerate audio-filters + bugfixes Modified Paths: -------------- TOOLS/Makefile TOOLS/asmopt.c TOOLS/asmopt_template.h TOOLS/asmoptf.c TOOLS/asmoptf_template.h mplayerxp/configure mplayerxp/dec_ahead.c mplayerxp/dec_ahead.h mplayerxp/libmpcodecs/ad_mp3.c mplayerxp/libmpdemux/demuxer_r.c mplayerxp/mplayer.c mplayerxp/postproc/af.c mplayerxp/postproc/af.h mplayerxp/postproc/af_ao2.c mplayerxp/postproc/af_center.c mplayerxp/postproc/af_channels.c mplayerxp/postproc/af_comp.c mplayerxp/postproc/af_crystality.c mplayerxp/postproc/af_delay.c mplayerxp/postproc/af_dummy.c mplayerxp/postproc/af_dyn.c mplayerxp/postproc/af_echo3d.c mplayerxp/postproc/af_equalizer.c mplayerxp/postproc/af_export.c mplayerxp/postproc/af_extrastereo.c mplayerxp/postproc/af_ffenc.c mplayerxp/postproc/af_format.c mplayerxp/postproc/af_gate.c mplayerxp/postproc/af_hrtf.c mplayerxp/postproc/af_karaoke.c mplayerxp/postproc/af_lp.c mplayerxp/postproc/af_pan.c mplayerxp/postproc/af_raw.c mplayerxp/postproc/af_resample.c mplayerxp/postproc/af_scaletempo.c mplayerxp/postproc/af_sinesuppress.c mplayerxp/postproc/af_sub.c mplayerxp/postproc/af_surround.c mplayerxp/postproc/af_volnorm.c mplayerxp/postproc/af_volume.c mplayerxp/postproc/dsp.c mplayerxp/postproc/dsp.h mplayerxp/postproc/dsp_accel.h mplayerxp/pvector/pvector.h mplayerxp/pvector/pvector_f32_x86.h mplayerxp/pvector/pvector_inc.h Modified: TOOLS/Makefile =================================================================== --- TOOLS/Makefile 2010-01-20 18:48:33 UTC (rev 115) +++ TOOLS/Makefile 2010-01-21 14:58:37 UTC (rev 116) @@ -16,7 +16,7 @@ ../mplayerxp/osdep/libosdep.a ../mplayerxp/mp_msg.o ../mplayerxp/nls/libnls.a ../mplayerxp/cpudetect.o COMMON_LIBS = $(MP_LIBS) $(EXTRALIBS) -lm -CFLAGS = $(OPTFLAGS) -I ../mplayerxp -I../mplayerxp/libmpdemux -I../mplayerxp/libvo $(EXTRA_INC) +CFLAGS = $(OPTFLAGS) -I./ -I../mplayerxp -I../mplayerxp/libmpdemux -I../mplayerxp/libvo $(EXTRA_INC) all: $(OBJS) Modified: TOOLS/asmopt.c =================================================================== --- TOOLS/asmopt.c 2010-01-20 18:48:33 UTC (rev 115) +++ TOOLS/asmopt.c 2010-01-21 14:58:37 UTC (rev 116) @@ -20,49 +20,10 @@ #include "../mplayerxp/mp_config.h" #include "../mplayerxp/cpudetect.h" -#undef OPTIMIZE_AVX -#undef OPTIMIZE_SSE4 -#undef OPTIMIZE_SSSE3 -#undef OPTIMIZE_SSE3 -#undef OPTIMIZE_SSE2 -#undef OPTIMIZE_SSE -#undef OPTIMIZE_MMX2 -#undef OPTIMIZE_MMX -#define RENAME(a) a ## _C -#include "asmopt_template.h" +#define PVECTOR_TESTING +#define PVECTOR_ACCEL_H "asmopt_template.h" +#include "../mplayerxp/pvector/pvector_inc.h" - -#ifdef __MMX__ -#define OPTIMIZE_MMX -#undef RENAME -#define RENAME(a) a ## _MMX -#include "asmopt_template.h" -#endif -#ifdef __SSE__ -#define OPTIMIZE_MMX2 -#undef RENAME -#define RENAME(a) a ## _MMX2 -#include "asmopt_template.h" -#endif -#ifdef __SSE2__ -#define OPTIMIZE_SSE2 -#undef RENAME -#define RENAME(a) a ## _SSE2 -#include "asmopt_template.h" -#endif -#ifdef __SSE3__ -#define OPTIMIZE_SSE3 -#undef RENAME -#define RENAME(a) a ## _SSE3 -#include "asmopt_template.h" -#endif -#ifdef __SSE4_1__ -#define OPTIMIZE_SSE4 -#undef RENAME -#define RENAME(a) a ## _SSE4 -#include "asmopt_template.h" -#endif - #define ARR_SIZE (1024*64*2)*10 unsigned verbose=1; extern CpuCaps gCpuCaps; @@ -136,7 +97,7 @@ gCpuCaps.has3DNow, gCpuCaps.has3DNowExt, gCpuCaps.hasSSE, gCpuCaps.hasSSE2); - test_simd("asmopt.gen" ,"GENERIC:",convert_C); + test_simd("asmopt.gen" ,"GENERIC:",convert_c); // ordered per speed fasterst first #ifdef __SSE3__ if(gCpuCaps.hasSSE3) test_simd("asmopt.sse3","SSE3 :",convert_SSE3); @@ -144,8 +105,8 @@ #ifdef __SSE2__ if(gCpuCaps.hasSSE2) test_simd("asmopt.sse2","SSE2 :",convert_SSE2); #endif -#ifdef __MMX2__ - if(gCpuCaps.hasMMX2) test_simd("asmopt.mmx2","MMX2 :",convert_MMX2); +#ifdef __SSE__ + if(gCpuCaps.hasMMX2) test_simd("asmopt.mmx2","MMX2 :",convert_SSE); #endif #ifdef __MMX__ if(gCpuCaps.hasMMX) test_simd("asmopt.mmx", "MMX :",convert_MMX); Modified: TOOLS/asmopt_template.h =================================================================== --- TOOLS/asmopt_template.h 2010-01-20 18:48:33 UTC (rev 115) +++ TOOLS/asmopt_template.h 2010-01-21 14:58:37 UTC (rev 116) @@ -10,35 +10,39 @@ MMX2 : cpu clocks=5874563 = 2659us...[OK] MMX : cpu clocks=6092012 = 2757us...[OK] */ -void RENAME(convert)(unsigned char *dstbase,unsigned char *src,unsigned char *srca,unsigned int asize) +void PVECTOR_RENAME(convert)(unsigned char *dstbase,unsigned char *src,unsigned char *srca,unsigned int asize) { #ifdef HAVE_INT_PVECTOR - __ivec vzero = _ivec_setzero(); + __ivec izero = _ivec_setzero(); #endif - unsigned x,w; - x = 0; - w = asize; + uint8_t *out_data = dstbase; + uint8_t *in_data = src; + + unsigned i,len; + i = 0; + len = asize; #ifdef HAVE_INT_PVECTOR - if(w>=__IVEC_SIZE) - for(;x<w;x+=__IVEC_SIZE){ - __ivec vmsk,vdest,vsrc,vsrca,vt[4]; - vdest = _ivec_loadu(&dstbase[x]); - vsrc = _ivec_loada(&src[x]); - vsrca = _ivec_loada(&srca[x]); - vmsk = _ivec_not(_ivec_cmpeq_s8(vsrca,vzero)); - vt[0] = _ivec_u16_from_lou8(vdest); - vt[1] = _ivec_u16_from_hiu8(vdest); - vt[2] = _ivec_u16_from_lou8(vsrca); - vt[3] = _ivec_u16_from_hiu8(vsrca); - vt[0] = _ivec_srl_s16_imm(_ivec_mullo_s16(vt[0],vt[2]),8); - vt[1] = _ivec_srl_s16_imm(_ivec_mullo_s16(vt[1],vt[3]),8); - vt[0] = _ivec_add_s8(_ivec_u8_from_u16(vt[0],vt[1]),vsrc); - _ivec_storeu(&dstbase[x],_ivec_blend_u8(vdest,vt[0],vmsk)); - } + for(;i<len;i++) { + ((uint16_t*)out_data)[i]=((uint16_t)((uint8_t*)in_data)[i])<<8; + if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + } + if((len-i)>=__IVEC_SIZE) + for(;i<len;i+=__IVEC_SIZE){ + __ivec ind,itmp[2]; + ind = _ivec_loadu(&((uint8_t *)in_data)[i]); +#if 0 /* slower but portable on non-x86 CPUs version */ + itmp[0]= _ivec_sll_s16_imm(_ivec_u16_from_lou8(ind),8); + itmp[1]= _ivec_sll_s16_imm(_ivec_u16_from_hiu8(ind),8); +#else + itmp[0]= _ivec_interleave_lo_u8(izero,ind); + itmp[1]= _ivec_interleave_hi_u8(izero,ind); #endif - for(;x<(unsigned)w;x++){ - if(srca[x]) dstbase[x]=((dstbase[x]*srca[x])>>8)+src[x]; - } + _ivec_storea(&((uint16_t*)out_data)[i],itmp[0]); + _ivec_storea(&((uint16_t*)out_data)[i+__IVEC_SIZE/2],itmp[1]); + } +#endif + for(;i<len;i++) + ((uint16_t*)out_data)[i]=((uint16_t)((uint8_t*)in_data)[i])<<8; #ifdef HAVE_INT_PVECTOR _ivec_empty(); _ivec_sfence(); Modified: TOOLS/asmoptf.c =================================================================== --- TOOLS/asmoptf.c 2010-01-20 18:48:33 UTC (rev 115) +++ TOOLS/asmoptf.c 2010-01-21 14:58:37 UTC (rev 116) @@ -14,6 +14,8 @@ #include <inttypes.h> #include <unistd.h> #include <fcntl.h> +#define __USE_ISOC99 +#include <math.h> #include <sys/mman.h> #include <sys/time.h> #include <limits.h> @@ -21,54 +23,10 @@ #include "../mplayerxp/mp_config.h" #include "../mplayerxp/cpudetect.h" -#undef F32_OPTIMIZE_AVX -#undef F32_OPTIMIZE_SSE4 -#undef F32_OPTIMIZE_SSSE3 -#undef F32_OPTIMIZE_SSE3 -#undef F32_OPTIMIZE_SSE2 -#undef F32_OPTIMIZE_SSE -#undef F32_OPTIMIZE_3DNOW -#define RENAME(a) a ## _C -#include "asmoptf_template.h" +#define PVECTOR_TESTING +#define PVECTOR_ACCEL_H "asmoptf_template.h" +#include "../mplayerxp/pvector/pvector_inc.h" - -#ifdef __3dNOW__ -#define F32_OPTIMIZE_3DNOW -#undef RENAME -#define RENAME(a) a ## _3DNOW -#include "asmoptf_template.h" -#endif -#ifdef __SSE__ -#define F32_OPTIMIZE_SSE -#undef RENAME -#define RENAME(a) a ## _SSE -#include "asmoptf_template.h" -#endif -#ifdef __SSE2__ -#define F32_OPTIMIZE_SSE2 -#undef RENAME -#define RENAME(a) a ## _SSE2 -#include "asmoptf_template.h" -#endif -#ifdef __SSE3__ -#define F32_OPTIMIZE_SSE3 -#undef RENAME -#define RENAME(a) a ## _SSE3 -#include "asmoptf_template.h" -#endif -#ifdef __SSE4_1__ -#define F32_OPTIMIZE_SSE4 -#undef RENAME -#define RENAME(a) a ## _SSE4 -#include "asmoptf_template.h" -#endif -#ifdef __AVX__ -#define F32_OPTIMIZE_AVX -#undef RENAME -#define RENAME(a) a ## _AVX -#include "asmoptf_template.h" -#endif - #define ARR_SIZE (1024*64*2)*10 unsigned verbose=1; extern CpuCaps gCpuCaps; @@ -76,8 +34,8 @@ /* Fixme: put here any complexness of source array filling */ #define INIT_ARRAYS(x) \ {\ - for(i=0; i<x; i++) srca[i] = i; \ - for(i=0; i<x; i++) src[i] = i+64; \ + for(i=0; i<x; i++) srca[i] = i*0.0001; \ + for(i=0; i<x; i++) src[i] = (i+64)*0.0001; \ memset(dsta,0,sizeof(ARR_SIZE*sizeof(float))); \ } @@ -143,7 +101,7 @@ gCpuCaps.has3DNow, gCpuCaps.has3DNowExt, gCpuCaps.hasSSE, gCpuCaps.hasSSE2); - test_simd("asmoptf.gen" ,"GENERIC:",convert_C); + test_simd("asmoptf.gen" ,"GENERIC:",convert_c); // ordered per speed fasterst first #ifdef __AVX__ if(gCpuCaps.hasAVX) test_simd("asmoptf.avx","AVX :",convert_AVX); Modified: TOOLS/asmoptf_template.h =================================================================== --- TOOLS/asmoptf_template.h 2010-01-20 18:48:33 UTC (rev 115) +++ TOOLS/asmoptf_template.h 2010-01-21 14:58:37 UTC (rev 116) @@ -10,34 +10,86 @@ MMX2 : cpu clocks=5874563 = 2659us...[OK] MMX : cpu clocks=6092012 = 2757us...[OK] */ -void RENAME(convert)(uint8_t *dstbase,const uint8_t *src,const uint8_t *srca,unsigned int asize) +#ifndef SATURATE +#define SATURATE(x,_min,_max) {if((x)<(_min)) (x)=(_min); else if((x)>(_max)) (x)=(_max);} +#endif + +static void __FASTCALL__ PVECTOR_RENAME(float2int32)(float* in, int32_t* out, unsigned len, int final) { + register unsigned i; + float ftmp; +#ifdef HAVE_F32_PVECTOR + __f32vec int_max; +#endif + i=0; +#ifdef HAVE_F32_PVECTOR + int_max = _f32vec_broadcast(INT_MAX-1); + for(;i<len;i++) { + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + ((int32_t*)out)[i]=(int32_t)lrintf((INT_MAX-1)*ftmp); + if((((long)out)&(__F32VEC_SIZE-1))==0) break; + } + _ivec_empty(); + if((len-i)>=__F32VEC_SIZE) + for(;i<len;i+=__F32VEC_SIZE/sizeof(float)) { + __f32vec tmp; + tmp = _f32vec_mul(int_max,_f32vec_loadu(&((float*)in)[i])); + if(final) + _f32vec_to_s32_stream(&((int32_t*)out)[i],tmp); + else + _f32vec_to_s32a(&((int32_t*)out)[i],tmp); + } + _ivec_sfence(); + _ivec_empty(); +#endif + for(;i<len;i++) { + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + ((int32_t*)out)[i]=(int32_t)lrintf((INT_MAX-1)*ftmp); + } +} + +void PVECTOR_RENAME(convert)(uint8_t *dstbase,const uint8_t *src,const uint8_t *srca,unsigned int asize) +{ unsigned i,len; const uint8_t *in; - uint8_t *out; + float ftmp; + int32_t __attribute__((aligned(__IVEC_SIZE))) i32_tmp[asize]; #ifdef HAVE_F32_PVECTOR - __f32vec rev_imax = _f32vec_broadcast(1.0/INT_MAX); + __f32vec int_max = _f32vec_broadcast(SHRT_MAX); #endif - in = src; + uint8_t *out; + in = srca; out = dstbase; i=0; len=asize; #ifdef HAVE_F32_PVECTOR for(;i<len;i++) { - ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + ((int16_t*)out)[i]=(int16_t)lrintf(SHRT_MAX*ftmp); if((((long)out)&(__F32VEC_SIZE-1))==0) break; } - _f32vec_empty(); - if((len-i)>=__F32VEC_SIZE) - for(;i<len;i+=__F32VEC_SIZE/sizeof(float)) { - __f32vec tmp; - tmp = _f32vec_mul(rev_imax,_f32vec_from_s32u(&((int32_t*)in)[i])); - _f32vec_storea(&((float*)out)[i],tmp); + _ivec_empty(); + if((len-i)>=__F32VEC_SIZE) { + PVECTOR_RENAME(float2int32)(in,i32_tmp,len-i,0); + for(;i<len;i+=__IVEC_SIZE*2/sizeof(int32_t)) { + __ivec tmp[2]; + tmp[0] = _ivec_loada(&((int32_t*)i32_tmp)[i])); + tmp[1] = _ivec_loada(&((int32_t*)i32_tmp)[i+__F32VEC_SIZE])); + _f32vec_to_s32a(itmp[0],ftmp[0]); + _f32vec_to_s32a(itmp[1],ftmp[1]); + tmp=_ivec_s16_from_s32(_ivec_loada(itmp[1]),_ivec_loada(itmp[0])); + _ivec_storea(&((int16_t*)out)[i],tmp); } - _f32vec_sfence(); - _f32vec_empty(); + } + _ivec_sfence(); + _ivec_empty(); #endif for(;i<len;i++) { - ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); + ftmp=((float*)in)[i]; + SATURATE(ftmp,-1.0,+1.0); + ((int16_t*)out)[i]=(int16_t)lrintf(SHRT_MAX*ftmp); } } Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/configure 2010-01-21 14:58:37 UTC (rev 116) @@ -360,7 +360,7 @@ _arch=$host_arch x86_32 && _arch="x86_32" x86_64 && _arch="x86_64" -ffmpeg_args="--arch=$arch $ffmpeg_args" +ffmpeg_args="--arch=$_arch $ffmpeg_args" fi test "$debug" != "0" && ffmpeg_args="$ffmpeg_args --enable-debug=$debug" enabled $profile && ffmpeg_args="$ffmpeg_args --enable-profile" Modified: mplayerxp/dec_ahead.c =================================================================== --- mplayerxp/dec_ahead.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/dec_ahead.c 2010-01-21 14:58:37 UTC (rev 116) @@ -209,9 +209,7 @@ } if(in_size<0) { - LOCK_VDECA(); - shva[dec_ahead_locked_frame].eof=1; - UNLOCK_VDECA(); + __MP_SYNCHRONIZE(vdeca_mutex,shva[dec_ahead_locked_frame].eof=1); xp_eof=1; if(has_xp_audio && enable_xp<XP_VAFull) { while(!xp_audio_eof && !dec_ahead_in_lseek && !pthread_end_of_work) { @@ -562,9 +560,7 @@ if(pthread_id && pthread_is_living && has_xp_video) { pthread_end_of_work=1; - LOCK_VIDEO_DECODE(); - pthread_cond_signal(&video_decode_cond); - UNLOCK_VIDEO_DECODE(); + __MP_SYNCHRONIZE(video_decode_mutex,pthread_cond_signal(&video_decode_cond)); while(pthread_is_living && !force) usleep(0); pthread_is_living=0; pthread_attr_destroy(&our_attr); @@ -577,9 +573,7 @@ a_pthread_end_of_work=1; xp_audio_eof=1; if(a_pthread_is_living) { - LOCK_AUDIO_DECODE(); - pthread_cond_signal(&audio_decode_cond); - UNLOCK_AUDIO_DECODE(); + __MP_SYNCHRONIZE(audio_decode_mutex,pthread_cond_signal(&audio_decode_cond)); } while(a_pthread_is_living && !force) usleep(0); a_pthread_is_living=0; @@ -711,9 +705,7 @@ if (is_reset_vcache) UNLOCK_VDECODING(); /* Release lock from vo_x11 */ if(pthread_is_living) { - LOCK_VIDEO_DECODE(); - pthread_cond_signal(&video_decode_cond); - UNLOCK_VIDEO_DECODE(); + __MP_SYNCHRONIZE(video_decode_mutex,pthread_cond_signal(&video_decode_cond)); while(dec_ahead_in_lseek==PreSeek) usleep(1); } @@ -737,9 +729,7 @@ xp_thread_decode_audio(); if(pthread_is_living) { - LOCK_VIDEO_DECODE(); - pthread_cond_signal(&video_decode_cond); - UNLOCK_VIDEO_DECODE(); + __MP_SYNCHRONIZE(video_decode_mutex,pthread_cond_signal(&video_decode_cond)); while(dec_ahead_in_lseek==Seek) usleep(1); while(abs_dec_ahead_locked_frame == abs_dec_ahead_active_frame && !xp_eof) @@ -748,17 +738,11 @@ dec_ahead_in_lseek = NoSeek; - if(a_pthread_is_living) { - LOCK_AUDIO_DECODE(); - pthread_cond_signal(&audio_decode_cond); - UNLOCK_AUDIO_DECODE(); - } + if(a_pthread_is_living) + __MP_SYNCHRONIZE(audio_decode_mutex,pthread_cond_signal(&audio_decode_cond)); - if(pthread_audio_is_living) { - LOCK_AUDIO_PLAY(); - pthread_cond_signal(&audio_play_cond); - UNLOCK_AUDIO_PLAY(); - } + if(pthread_audio_is_living) + __MP_SYNCHRONIZE(audio_play_mutex,pthread_cond_signal(&audio_play_cond)); } /* Audio stuff */ Modified: mplayerxp/dec_ahead.h =================================================================== --- mplayerxp/dec_ahead.h 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/dec_ahead.h 2010-01-21 14:58:37 UTC (rev 116) @@ -45,22 +45,30 @@ #endif #define LOCK_VDEC_ACTIVE() { MSG_D(DA_PREFIX"LOCK_VDEC_ACTIVE\n"); pthread_mutex_lock(&vdec_active_mutex); } #define UNLOCK_VDEC_ACTIVE() { MSG_D(DA_PREFIX"UNLOCK_VDEC_ACTIVE\n"); pthread_mutex_unlock(&vdec_active_mutex); } + #define LOCK_VDEC_LOCKED() { MSG_D(DA_PREFIX"LOCK_VDEC_LOCKED\n"); pthread_mutex_lock(&vdec_locked_mutex); } #define UNLOCK_VDEC_LOCKED() { MSG_D(DA_PREFIX"UNLOCK_VDEC_LOCKED\n"); pthread_mutex_unlock(&vdec_locked_mutex); } + #define LOCK_VDECODING() { MSG_D(DA_PREFIX"LOCK_VDECODING\n"); pthread_mutex_lock(&vdecoding_mutex); } #define UNLOCK_VDECODING() { MSG_D(DA_PREFIX"UNLOCK_VDECODING\n"); pthread_mutex_unlock(&vdecoding_mutex); } + #define LOCK_VREADING() { MSG_D(DA_PREFIX"LOCK_VREADING\n"); pthread_mutex_lock(&vreading_mutex); } #define UNLOCK_VREADING() { MSG_D(DA_PREFIX"UNLOCK_VREADING\n"); pthread_mutex_unlock(&vreading_mutex); } + #define LOCK_VDECA() { MSG_D(DA_PREFIX"LOCK_VDECA\n"); pthread_mutex_lock(&vdeca_mutex); } #define UNLOCK_VDECA() { MSG_D(DA_PREFIX"UNLOCK_VDECA\n"); pthread_mutex_unlock(&vdeca_mutex); } + #define LOCK_AUDIO_PLAY() { MSG_D(DA_PREFIX"LOCK_AUDIO_PLAY\n"); pthread_mutex_lock(&audio_play_mutex); } #define UNLOCK_AUDIO_PLAY() { MSG_D(DA_PREFIX"UNLOCK_AUDIO_PLAY\n"); pthread_mutex_unlock(&audio_play_mutex); } + #define LOCK_AUDIO_DECODE() { MSG_D(DA_PREFIX"LOCK_AUDIO_DECODE\n"); pthread_mutex_lock(&audio_decode_mutex); } #define UNLOCK_AUDIO_DECODE() { MSG_D(DA_PREFIX"UNLOCK_AUDIO_DECODE\n"); pthread_mutex_unlock(&audio_decode_mutex); } + #define LOCK_VIDEO_DECODE() { MSG_D(DA_PREFIX"LOCK_VIDEO_DECODE\n"); pthread_mutex_lock(&video_decode_mutex); } #define UNLOCK_VIDEO_DECODE() { MSG_D(DA_PREFIX"UNLOCK_VIDEO_DECODE\n"); pthread_mutex_unlock(&video_decode_mutex); } -#define __MP_ATOMIC(OP) { pthread_mutex_t loc_mutex; pthread_mutex_lock(&loc_mutex); OP; pthread_mutex_unlock(&loc_mutex); } +#define __MP_ATOMIC(OP) { static pthread_mutex_t loc_mutex; pthread_mutex_lock(&loc_mutex); OP; pthread_mutex_unlock(&loc_mutex); } +#define __MP_SYNCHRONIZE(mtx,OP) { pthread_mutex_lock(&mtx); OP; pthread_mutex_unlock(&mtx); } typedef struct sh_video_attr { Modified: mplayerxp/libmpcodecs/ad_mp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/libmpcodecs/ad_mp3.c 2010-01-21 14:58:37 UTC (rev 116) @@ -331,7 +331,7 @@ ,fi.flags&MPG123_ORIGINAL?"Yes":"No" ,fi.flags&MPG123_CRC?"Yes":"No" ,fi.flags&MPG123_PRIVATE?"Yes":"No" - ,fi.emphasis,mpg123_current_decoder(sh->context)); + ,fi.emphasis,mpg123_current_decoder(priv->mh)); } return 1; } @@ -354,10 +354,10 @@ int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen,float *pts) { mp3_priv_t *priv=sh->context; - unsigned char *indata=NULL,*outdata; + unsigned char *indata=NULL,*outdata=NULL; int err=MPG123_OK,indata_size=0; off_t offset,cpos; - size_t done=0,total=0; + size_t done=0; minlen=1; /* decode one frame per call to be compatible with old logic: *************************** @@ -377,7 +377,6 @@ cpos = mpg123_tell(priv->mh); *pts = priv->pts+((float)(cpos-priv->pos)/sh->i_bps); err=mpg123_decode_frame(priv->mh,&offset,&outdata,&done); - total+=done; if(!((err==MPG123_OK)||(err==MPG123_NEED_MORE))) { MSG_ERR("mpg123_read = %s done = %u minlen = %u\n",mpg123_plain_strerror(err),done,minlen); } Modified: mplayerxp/libmpdemux/demuxer_r.c =================================================================== --- mplayerxp/libmpdemux/demuxer_r.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/libmpdemux/demuxer_r.c 2010-01-21 14:58:37 UTC (rev 116) @@ -9,6 +9,7 @@ #include "demuxer_r.h" #include "../osdep/timer.h" #include "../mplayer.h" +#include "../dec_ahead.h" pthread_mutex_t demuxer_mutex=PTHREAD_MUTEX_INITIALIZER; @@ -170,26 +171,20 @@ int demuxer_switch_audio_r(demuxer_t *d, int id) { int retval; - LOCK_DEMUXER(); - retval=demuxer_switch_audio(d,id); - UNLOCK_DEMUXER(); + __MP_SYNCHRONIZE(demuxer_mutex,retval=demuxer_switch_audio(d,id)); return retval; } int demuxer_switch_video_r(demuxer_t *d, int id) { int retval; - LOCK_DEMUXER(); - retval=demuxer_switch_video(d,id); - UNLOCK_DEMUXER(); + __MP_SYNCHRONIZE(demuxer_mutex,retval=demuxer_switch_video(d,id)); return retval; } int demuxer_switch_subtitle_r(demuxer_t *d, int id) { int retval; - LOCK_DEMUXER(); - retval=demuxer_switch_subtitle(d,id); - UNLOCK_DEMUXER(); + __MP_SYNCHRONIZE(demuxer_mutex,retval=demuxer_switch_subtitle(d,id)); return retval; } Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/mplayer.c 2010-01-21 14:58:37 UTC (rev 116) @@ -768,9 +768,7 @@ volatile int dec_ahead_active_frame; for(;;) { - LOCK_VDEC_ACTIVE(); - vo_get_active_frame(&dec_ahead_active_frame); - UNLOCK_VDEC_ACTIVE(); + __MP_SYNCHRONIZE(vdec_active_mutex,vo_get_active_frame(&dec_ahead_active_frame)); LOCK_VDECA(); if(shva[dec_ahead_active_frame].eof) break; usleep(0); @@ -1524,9 +1522,7 @@ int delay_corrected=1; int final_frame=0; int num_frames_decoded = 0; - LOCK_VDEC_ACTIVE(); - vo_get_active_frame(&dec_ahead_active_frame); - UNLOCK_VDEC_ACTIVE(); + __MP_SYNCHRONIZE(vdec_active_mutex,vo_get_active_frame(&dec_ahead_active_frame)); LOCK_VDECA(); final_frame = shva[dec_ahead_active_frame].eof; sh_video->num_frames = shva[dec_ahead_active_frame].num_frames; @@ -1722,9 +1718,7 @@ bench_dropped_frames ++; } } - LOCK_VDEC_ACTIVE(); - abs_dec_ahead_active_frame++; - UNLOCK_VDEC_ACTIVE(); + __MP_SYNCHRONIZE(vdec_active_mutex,abs_dec_ahead_active_frame++); pinfo[xp_id].current_module=NULL; /*================ A-V TIMESTAMP CORRECTION: =========================*/ @@ -1763,12 +1757,8 @@ if(x> max_pts_correction) x= max_pts_correction; if(default_max_pts_correction>=0) max_pts_correction=default_max_pts_correction; - else - { - LOCK_VDECA(); - max_pts_correction=shva[dec_ahead_active_frame].duration*0.10; // +-10% of time - UNLOCK_VDECA(); - } + else // +-10% of time + __MP_SYNCHRONIZE(vdeca_mutex,max_pts_correction=shva[dec_ahead_active_frame].duration*0.10); if(enable_xp>=XP_VAPlay) pthread_mutex_lock(&audio_timer_mutex); sh_audio->timer+=x; @@ -2869,9 +2859,7 @@ volatile unsigned ada_blitted_frame; do { usleep(0); - LOCK_VDEC_LOCKED(); - ada_blitted_frame = abs_dec_ahead_blitted_frame; - UNLOCK_VDEC_LOCKED(); + __MP_SYNCHRONIZE(vdec_locked_mutex,ada_blitted_frame = abs_dec_ahead_blitted_frame); }while(ada_blitted_frame < xp_num_frames/2 && !xp_eof); } if(run_xp_players()!=0) exit_player("Can't run xp players!\n"); @@ -3018,9 +3006,7 @@ ao_resume(); // resume audio if( enable_xp >= XP_VAPlay ) { dec_ahead_in_pause=0; - LOCK_AUDIO_PLAY(); - pthread_cond_signal(&audio_play_cond); - UNLOCK_AUDIO_PLAY(); + __MP_SYNCHRONIZE(audio_play_mutex,pthread_cond_signal(&audio_play_cond)); } } if (vo_inited && sh_video) Modified: mplayerxp/postproc/af.c =================================================================== --- mplayerxp/postproc/af.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af.c 2010-01-21 14:58:37 UTC (rev 116) @@ -523,7 +523,7 @@ // Iterate through all filters do{ MSG_DBG2("filtering %s\n",af->info->name); - data=af->play(af,data); + data=af->play(af,data,af->next?0:1); af=af->next; }while(af && data); return data; Modified: mplayerxp/postproc/af.h =================================================================== --- mplayerxp/postproc/af.h 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af.h 2010-01-21 14:58:37 UTC (rev 116) @@ -50,7 +50,7 @@ const af_info_t* info; int (* __FASTCALL__ control)(struct af_instance_s* af, int cmd, void* arg); void (* __FASTCALL__ uninit)(struct af_instance_s* af); - af_data_t* (* __FASTCALL__ play)(struct af_instance_s* af, af_data_t* data); + af_data_t* (* __FASTCALL__ play)(struct af_instance_s* af, af_data_t* data,int final); void* setup; // setup data for this specific instance and filter af_data_t* data; // configuration for outgoing data stream struct af_instance_s* next; Modified: mplayerxp/postproc/af_ao2.c =================================================================== --- mplayerxp/postproc/af_ao2.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_ao2.c 2010-01-21 14:58:37 UTC (rev 116) @@ -148,7 +148,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { // Do something necessary to get rid of annoying warning during compile if(!af) Modified: mplayerxp/postproc/af_center.c =================================================================== --- mplayerxp/postproc/af_center.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_center.c 2010-01-21 14:58:37 UTC (rev 116) @@ -70,7 +70,7 @@ } // Filter data through filter -static af_data_t* play(struct af_instance_s* af, af_data_t* data) +static af_data_t* play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data af_center_t* s = af->setup; // Setup for this instance Modified: mplayerxp/postproc/af_channels.c =================================================================== --- mplayerxp/postproc/af_channels.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_channels.c 2010-01-21 14:58:37 UTC (rev 116) @@ -244,7 +244,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data af_data_t* l = af->data; // Local data Modified: mplayerxp/postproc/af_comp.c =================================================================== --- mplayerxp/postproc/af_comp.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_comp.c 2010-01-21 14:58:37 UTC (rev 116) @@ -106,7 +106,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data af_comp_t* s = (af_comp_t*)af->setup; // Setup for this instance Modified: mplayerxp/postproc/af_crystality.c =================================================================== --- mplayerxp/postproc/af_crystality.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_crystality.c 2010-01-21 14:58:37 UTC (rev 116) @@ -516,7 +516,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; /* Current working data */ echo3d(af->setup,(float*)c->audio, c->len); Modified: mplayerxp/postproc/af_delay.c =================================================================== --- mplayerxp/postproc/af_delay.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_delay.c 2010-01-21 14:58:37 UTC (rev 116) @@ -107,7 +107,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data af_delay_t* s = af->setup; // Setup for this instance Modified: mplayerxp/postproc/af_dummy.c =================================================================== --- mplayerxp/postproc/af_dummy.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_dummy.c 2010-01-21 14:58:37 UTC (rev 116) @@ -27,7 +27,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { // Do something necessary to get rid of annoying warning during compile if(!af) Modified: mplayerxp/postproc/af_dyn.c =================================================================== --- mplayerxp/postproc/af_dyn.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_dyn.c 2010-01-21 14:58:37 UTC (rev 116) @@ -60,7 +60,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { register unsigned i = 0; float *in = (float*)data->audio; // Audio data Modified: mplayerxp/postproc/af_echo3d.c =================================================================== --- mplayerxp/postproc/af_echo3d.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_echo3d.c 2010-01-21 14:58:37 UTC (rev 116) @@ -192,7 +192,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; /* Current working data */ Modified: mplayerxp/postproc/af_equalizer.c =================================================================== --- mplayerxp/postproc/af_equalizer.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_equalizer.c 2010-01-21 14:58:37 UTC (rev 116) @@ -168,7 +168,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data af_equalizer_t* s = (af_equalizer_t*)af->setup; // Setup Modified: mplayerxp/postproc/af_export.c =================================================================== --- mplayerxp/postproc/af_export.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_export.c 2010-01-21 14:58:37 UTC (rev 116) @@ -194,7 +194,7 @@ af audio filter instance data audio data */ -static af_data_t* __FASTCALL__ play( struct af_instance_s* af, af_data_t* data ) +static af_data_t* __FASTCALL__ play( struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data af_export_t* s = af->setup; // Setup for this instance @@ -225,10 +225,10 @@ // Export buffer to mmaped area if(flag){ // update buffer in mapped area - memcpy(s->mmap_area + SIZE_HEADER, s->buf[0], sz * c->bps * nch); + stream_copy(s->mmap_area + SIZE_HEADER, s->buf[0], sz * c->bps * nch); s->count++; // increment counter (to sync) - memcpy(s->mmap_area + SIZE_HEADER - sizeof(s->count), - &(s->count), sizeof(s->count)); + stream_copy(s->mmap_area + SIZE_HEADER - sizeof(s->count), + &(s->count), sizeof(s->count)); } // We don't modify data, just export it Modified: mplayerxp/postproc/af_extrastereo.c =================================================================== --- mplayerxp/postproc/af_extrastereo.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_extrastereo.c 2010-01-21 14:58:37 UTC (rev 116) @@ -75,7 +75,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_extrastereo_t *s = af->setup; register int i = 0; Modified: mplayerxp/postproc/af_ffenc.c =================================================================== --- mplayerxp/postproc/af_ffenc.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_ffenc.c 2010-01-21 14:58:37 UTC (rev 116) @@ -154,7 +154,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { unsigned tlen,ilen,olen,delta; af_ffenc_t *s=af->setup; Modified: mplayerxp/postproc/af_format.c =================================================================== --- mplayerxp/postproc/af_format.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_format.c 2010-01-21 14:58:37 UTC (rev 116) @@ -38,11 +38,11 @@ }af_format_t; // Switch endianess -static void endian(void* in, void* out, int len, int bps); +static void endian(void* in, void* out, int len, int bps,int final); // From singed to unsigned -static void si2us(void* in, void* out, int len, int bps); +static void si2us(void* in, void* out, int len, int bps,int final); // From unsinged to signed -static void us2si(void* in, void* out, int len, int bps); +static void us2si(void* in, void* out, int len, int bps,int final); static const struct fmt_alias_s { @@ -378,7 +378,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* l = af->data; // Local data af_data_t* c = data; // Current working data @@ -389,7 +389,7 @@ // Change to cpu native endian format if((c->format&AF_FORMAT_END_MASK)!=AF_FORMAT_NE) - endian(c->audio,c->audio,len,c->bps); + endian(c->audio,c->audio,len,c->bps,final); // Conversion table switch(c->format & ~AF_FORMAT_END_MASK){ @@ -398,14 +398,14 @@ if(AF_FORMAT_A_LAW == (l->format&AF_FORMAT_SPECIAL_MASK)) to_ulaw(l->audio, l->audio, len, 1, AF_FORMAT_SI); if((l->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US) - si2us(l->audio,l->audio,len,l->bps); + si2us(l->audio,l->audio,len,l->bps,final); break; case(AF_FORMAT_A_LAW): from_alaw(c->audio, l->audio, len, l->bps, l->format&AF_FORMAT_POINT_MASK); if(AF_FORMAT_A_LAW == (l->format&AF_FORMAT_SPECIAL_MASK)) to_alaw(l->audio, l->audio, len, 1, AF_FORMAT_SI); if((l->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US) - si2us(l->audio,l->audio,len,l->bps); + si2us(l->audio,l->audio,len,l->bps,final); break; case(AF_FORMAT_F): switch(l->format&AF_FORMAT_SPECIAL_MASK){ @@ -416,9 +416,12 @@ to_alaw(c->audio, l->audio, len, c->bps, c->format&AF_FORMAT_POINT_MASK); break; default: - float2int(c->audio, l->audio, len, l->bps); - if((l->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US) - si2us(l->audio,l->audio,len,l->bps); + if((l->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US) { + float2int(c->audio, l->audio, len, l->bps,0); + si2us(l->audio,l->audio,len,l->bps,final); + } + else + float2int(c->audio, l->audio, len, l->bps,final); break; } break; @@ -428,9 +431,9 @@ // Change signed/unsigned if((c->format&AF_FORMAT_SIGN_MASK) != (l->format&AF_FORMAT_SIGN_MASK)){ if((c->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US) - us2si(c->audio,c->audio,len,c->bps); + us2si(c->audio,c->audio,len,c->bps,final); else - si2us(c->audio,c->audio,len,c->bps); + si2us(c->audio,c->audio,len,c->bps,final); } // Convert to special formats switch(l->format&(AF_FORMAT_SPECIAL_MASK|AF_FORMAT_POINT_MASK)){ @@ -441,12 +444,12 @@ to_alaw(c->audio, l->audio, len, c->bps, c->format&AF_FORMAT_POINT_MASK); break; case(AF_FORMAT_F): - int2float(c->audio, l->audio, len, c->bps); + int2float(c->audio, l->audio, len, c->bps,final); break; default: // Change the number of bits if(c->bps != l->bps) - change_bps(c->audio,l->audio,len,c->bps,l->bps); + change_bps(c->audio,l->audio,len,c->bps,l->bps,final); else l->audio=c->audio; break; @@ -456,7 +459,7 @@ // Switch from cpu native endian to the correct endianess if((l->format&AF_FORMAT_END_MASK)!=AF_FORMAT_NE) - endian(l->audio,l->audio,len,l->bps); + endian(l->audio,l->audio,len,l->bps,final); // Set output data c->audio = l->audio; @@ -515,7 +518,7 @@ } // Function implementations used by play -static void endian(void* in, void* out, int len, int bps) +static void endian(void* in, void* out, int len, int bps,int final) { register int i; switch(bps){ @@ -545,7 +548,7 @@ } } -static void si2us(void* in, void* out, int len, int bps) +static void si2us(void* in, void* out, int len, int bps,int final) { register int i; switch(bps){ @@ -568,7 +571,7 @@ } } -static void us2si(void* in, void* out, int len, int bps) +static void us2si(void* in, void* out, int len, int bps,int final) { register int i; switch(bps){ Modified: mplayerxp/postproc/af_gate.c =================================================================== --- mplayerxp/postproc/af_gate.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_gate.c 2010-01-21 14:58:37 UTC (rev 116) @@ -102,7 +102,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data af_gate_t* s = (af_gate_t*)af->setup; // Setup for this instance Modified: mplayerxp/postproc/af_hrtf.c =================================================================== --- mplayerxp/postproc/af_hrtf.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_hrtf.c 2010-01-21 14:58:37 UTC (rev 116) @@ -383,7 +383,7 @@ 2. A bass compensation is introduced to ensure that 0-200 Hz are not damped (without any real 3D acoustical image, however). */ -static af_data_t* __FASTCALL__ play(struct af_instance_s *af, af_data_t *data) +static af_data_t* __FASTCALL__ play(struct af_instance_s *af, af_data_t *data,int final) { af_hrtf_t *s = af->setup; real_t *in = data->audio; // Input audio data Modified: mplayerxp/postproc/af_karaoke.c =================================================================== --- mplayerxp/postproc/af_karaoke.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_karaoke.c 2010-01-21 14:58:37 UTC (rev 116) @@ -37,7 +37,7 @@ } // Filter data through filter -static af_data_t* play(struct af_instance_s* af, af_data_t* data) +static af_data_t* play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data float* a = c->audio; // Audio data Modified: mplayerxp/postproc/af_lp.c =================================================================== --- mplayerxp/postproc/af_lp.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_lp.c 2010-01-21 14:58:37 UTC (rev 116) @@ -58,7 +58,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { // Do something necessary to get rid of annoying warning during compile if(!af) Modified: mplayerxp/postproc/af_pan.c =================================================================== --- mplayerxp/postproc/af_pan.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_pan.c 2010-01-21 14:58:37 UTC (rev 116) @@ -123,7 +123,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data af_data_t* l = af->data; // Local data Modified: mplayerxp/postproc/af_raw.c =================================================================== --- mplayerxp/postproc/af_raw.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_raw.c 2010-01-21 14:58:37 UTC (rev 116) @@ -142,7 +142,7 @@ af audio filter instance data audio data */ -static af_data_t* __FASTCALL__ play( struct af_instance_s* af, af_data_t* data ) +static af_data_t* __FASTCALL__ play( struct af_instance_s* af, af_data_t* data,int final) { af_raw_t* s = af->setup; // Setup for this instance if(s->fd) fwrite(data->audio,data->len,1,s->fd); Modified: mplayerxp/postproc/af_resample.c =================================================================== --- mplayerxp/postproc/af_resample.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_resample.c 2010-01-21 14:58:37 UTC (rev 116) @@ -348,7 +348,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { int len = 0; // Length of output data af_data_t* c = data; // Current working data Modified: mplayerxp/postproc/af_scaletempo.c =================================================================== --- mplayerxp/postproc/af_scaletempo.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_scaletempo.c 2010-01-21 14:58:37 UTC (rev 116) @@ -165,7 +165,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_scaletempo_t* s = af->setup; int offset_in; @@ -202,6 +202,11 @@ bytes_off = s->best_overlap_offset(s); s->output_overlap(s, pout, bytes_off); } + if(final) + stream_copy(pout + s->bytes_overlap, + s->buf_queue + bytes_off + s->bytes_overlap, + s->bytes_standing); + else memcpy(pout + s->bytes_overlap, s->buf_queue + bytes_off + s->bytes_overlap, s->bytes_standing); Modified: mplayerxp/postproc/af_sinesuppress.c =================================================================== --- mplayerxp/postproc/af_sinesuppress.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_sinesuppress.c 2010-01-21 14:58:37 UTC (rev 116) @@ -31,9 +31,9 @@ double pos; }af_sinesuppress_t; -static af_data_t* play_s16(struct af_instance_s* af, af_data_t* data); +static af_data_t* play_s16(struct af_instance_s* af, af_data_t* data,int final); #if 0 -static af_data_t* play_float(struct af_instance_s* af, af_data_t* data); +static af_data_t* play_float(struct af_instance_s* af, af_data_t* data,int final); #endif // Initialization and runtime control @@ -90,7 +90,7 @@ } // Filter data through filter -static af_data_t* play_s16(struct af_instance_s* af, af_data_t* data) +static af_data_t* play_s16(struct af_instance_s* af, af_data_t* data,int final) { af_sinesuppress_t *s = af->setup; register int i = 0; @@ -121,7 +121,7 @@ } #if 0 -static af_data_t* play_float(struct af_instance_s* af, af_data_t* data) +static af_data_t* play_float(struct af_instance_s* af, af_data_t* data,int final) { af_sinesuppress_t *s = af->setup; register int i = 0; Modified: mplayerxp/postproc/af_sub.c =================================================================== --- mplayerxp/postproc/af_sub.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_sub.c 2010-01-21 14:58:37 UTC (rev 116) @@ -136,7 +136,7 @@ #endif // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data af_sub_t* s = af->setup; // Setup for this instance Modified: mplayerxp/postproc/af_surround.c =================================================================== --- mplayerxp/postproc/af_surround.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_surround.c 2010-01-21 14:58:37 UTC (rev 116) @@ -168,7 +168,7 @@ //static int amp_L = 0, amp_R = 0, amp_C = 0, amp_S = 0; // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data){ +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final){ af_surround_t* s = (af_surround_t*)af->setup; float* m = steering_matrix[0]; float* in = data->audio; // Input audio data Modified: mplayerxp/postproc/af_volnorm.c =================================================================== --- mplayerxp/postproc/af_volnorm.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_volnorm.c 2010-01-21 14:58:37 UTC (rev 116) @@ -116,7 +116,7 @@ free(af->setup); } -static void __FASTCALL__ method1_int16(af_volnorm_t *s, af_data_t *c) +static void __FASTCALL__ method1_int16(af_volnorm_t *s, af_data_t *c,int final) { register int i = 0; int16_t *data = (int16_t*)c->audio; // Audio data @@ -158,7 +158,7 @@ s->lastavg = (1.0 - SMOOTH_LASTAVG) * s->lastavg + SMOOTH_LASTAVG * newavg; } -static void __FASTCALL__ method1_float(af_volnorm_t *s, af_data_t *c) +static void __FASTCALL__ method1_float(af_volnorm_t *s, af_data_t *c,int final) { register int i = 0; float *data = (float*)c->audio; // Audio data @@ -195,7 +195,7 @@ s->lastavg = (1.0 - SMOOTH_LASTAVG) * s->lastavg + SMOOTH_LASTAVG * newavg; } -static void __FASTCALL__ method2_int16(af_volnorm_t *s, af_data_t *c) +static void __FASTCALL__ method2_int16(af_volnorm_t *s, af_data_t *c,int final) { register int i = 0; int16_t *data = (int16_t*)c->audio; // Audio data @@ -245,7 +245,7 @@ s->idx = (s->idx + 1) % NSAMPLES; } -static void __FASTCALL__ method2_float(af_volnorm_t *s, af_data_t *c) +static void __FASTCALL__ method2_float(af_volnorm_t *s, af_data_t *c,int final) { register int i = 0; float *data = (float*)c->audio; // Audio data @@ -292,23 +292,23 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_volnorm_t *s = af->setup; if(af->data->format == (AF_FORMAT_SI | AF_FORMAT_NE)) { if (s->method) - method2_int16(s, data); + method2_int16(s, data,final); else - method1_int16(s, data); + method1_int16(s, data,final); } else if(af->data->format == (AF_FORMAT_F | AF_FORMAT_NE)) { if (s->method) - method2_float(s, data); + method2_float(s, data,final); else - method1_float(s, data); + method1_float(s, data,final); } return data; } Modified: mplayerxp/postproc/af_volume.c =================================================================== --- mplayerxp/postproc/af_volume.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/af_volume.c 2010-01-21 14:58:37 UTC (rev 116) @@ -135,7 +135,7 @@ } // Filter data through filter -static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data) +static af_data_t* __FASTCALL__ play(struct af_instance_s* af, af_data_t* data,int final) { af_data_t* c = data; // Current working data af_volume_t* s = (af_volume_t*)af->setup; // Setup for this instance Modified: mplayerxp/postproc/dsp.c =================================================================== --- mplayerxp/postproc/dsp.c 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/dsp.c 2010-01-21 14:58:37 UTC (rev 116) @@ -664,7 +664,7 @@ bp->prev = bp->pprev = 0.0; } -static void __FASTCALL__ init_change_bps(const void* in, void* out, unsigned len, unsigned inbps, unsigned outbps) +static void __FASTCALL__ init_change_bps(const void* in, void* out, unsigned len, unsigned inbps, unsigned outbps,int final) { #ifdef __SSE4_1__ if(gCpuCaps.hasSSE41) change_bps = change_bps_SSE4; @@ -689,11 +689,11 @@ #endif #endif /* __x86_64__ */ change_bps = change_bps_c; - (*change_bps)(in,out,len,inbps,outbps); + (*change_bps)(in,out,len,inbps,outbps,final); } -void (* __FASTCALL__ change_bps)(const void* in, void* out, unsigned len, unsigned inbps, unsigned outbps)=init_change_bps; +void (* __FASTCALL__ change_bps)(const void* in, void* out, unsigned len, unsigned inbps, unsigned outbps,int final)=init_change_bps; -static void __FASTCALL__ init_float2int(void* in, void* out, int len, int bps) +static void __FASTCALL__ init_float2int(void* in, void* out, int len, int bps,int final) { #ifdef __AVX__ if(gCpuCaps.hasAVX) float2int = float2int_AVX; @@ -726,11 +726,11 @@ #endif #endif /*__x86_64__*/ float2int = float2int_c; - (*float2int)(in,out,len,bps); + (*float2int)(in,out,len,bps,final); } -void (* __FASTCALL__ float2int)(void* in, void* out, int len, int bps)=init_float2int; +void (* __FASTCALL__ float2int)(void* in, void* out, int len, int bps,int final)=init_float2int; -static void __FASTCALL__ init_int2float(void* in, void* out, int len, int bps) +static void __FASTCALL__ init_int2float(void* in, void* out, int len, int bps,int final) { #ifdef __AVX__ if(gCpuCaps.hasAVX) int2float = int2float_AVX; @@ -763,9 +763,9 @@ #endif #endif /*__x86_64__*/ int2float = int2float_c; - (*int2float)(in,out,len,bps); + (*int2float)(in,out,len,bps,final); } -void (* __FASTCALL__ int2float)(void* in, void* out, int len, int bps)=init_int2float; +void (* __FASTCALL__ int2float)(void* in, void* out, int len, int bps,int final)=init_int2float; static int32_t __FASTCALL__ FIR_i16_init(int16_t *x,int16_t *w) Modified: mplayerxp/postproc/dsp.h =================================================================== --- mplayerxp/postproc/dsp.h 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/dsp.h 2010-01-21 14:58:37 UTC (rev 116) @@ -143,9 +143,9 @@ } /* some mmx_optimized stuff */ -extern void (* __FASTCALL__ change_bps)(const void* in, void* out, unsigned len, unsigned inbps, unsigned outbps); -extern void (* __FASTCALL__ float2int)(void* in, void* out, int len, int bps); -extern void (* __FASTCALL__ int2float)(void* in, void* out, int len, int bps); +extern void (* __FASTCALL__ change_bps)(const void* in, void* out, unsigned len, unsigned inbps, unsigned outbps,int final); +extern void (* __FASTCALL__ float2int)(void* in, void* out, int len, int bps,int final); +extern void (* __FASTCALL__ int2float)(void* in, void* out, int len, int bps,int final); extern int32_t (* __FASTCALL__ FIR_i16)(int16_t *x,int16_t *w); extern float (* __FASTCALL__ FIR_f32)(float *x,float *w); Modified: mplayerxp/postproc/dsp_accel.h =================================================================== --- mplayerxp/postproc/dsp_accel.h 2010-01-20 18:48:33 UTC (rev 115) +++ mplayerxp/postproc/dsp_accel.h 2010-01-21 14:58:37 UTC (rev 116) @@ -1,66 +1,163 @@ /* DSP acceleration routines */ #include "pvector/pvector.h" -#ifdef HAVE_INT_PVECTOR -static __inline __m64 __attribute__((__gnu_inline__, __always_inline__)) -PVECTOR_RENAME(_m_load)(const void *__P) -{ - return *(const __m64 *)__P; -} -#undef _m_load -#define _m_load PVECTOR_RENAME(_m_load) -static __inline __m64 __attribute__((__gnu_inline__, __always_inline__)) -PVECTOR_RENAME(_m_load_half)(const void *__P) +static void __FASTCALL__ PVECTOR_RENAME(int8_to_int16)(const int8_t* in_data, int16_t* out_data, unsigned len, int final) { - return _mm_cvtsi32_si64 (*(const int *)__P); +#ifdef HAVE_INT_PVECTOR + __ivec izero = _ivec_setzero(); +#endif + unsigned i; + i = 0; +#ifdef HAVE_INT_PVECTOR + for(;i<len;i++) { + ((uint16_t*)out_data)[i]=((uint16_t)((uint8_t*)in_data)[i])<<8; + if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + } + if((len-i)>=__IVEC_SIZE) + for(;i<len;i+=__IVEC_SIZE){ + __ivec ind,itmp[2]; + ind = _ivec_loadu(&((uint8_t *)in_data)[i]); +#if 0 /* slower but portable on non-x86 CPUs version */ + itmp[0]= _ivec_sll_s16_imm(_ivec_u16_from_lou8(ind),8); + itmp[1]= _ivec_sll_s16_imm(_ivec_u16_from_hiu8(ind),8); +#else + itmp[0]= _ivec_interleave_lo_u8(izero,ind); + itmp[1]= _ivec_interleave_hi_u8(izero,ind); +#endif + if(final) { + _ivec_stream(&((uint16_t*)out_data)[i],itmp[0]); + _ivec_stream(&((uint16_t*)out_data)[i+__IVEC_SIZE/2],itmp[1]); + } else { + _ivec_storea(&((uint16_t*)out_data)[i],itmp[0]); + _ivec_storea(&((uint16_t*)out_data)[i+__IVEC_SIZE/2],itmp[1]); + } + } +#endif + for(;i<len;i++) + ((uint16_t*)out_data)[i]=((uint16_t)((uint8_t*)in_data)[i])<<8; +#ifdef HAVE_INT_PVECTOR + _ivec_empty(); + _ivec_sfence(); +#endif } -#undef _m_load_half -#define _m_load_half PVECTOR_RENAME(_m_load_half) -static __inline void __attribute__((__gnu_inline__, __always_inline__)) -PVECTOR_RENAME(_m_store)(void *__P, __m64 src) +static void __FASTCALL__ PVECTOR_RENAME(int16_to_int8)(const int16_t* in_data, int8_t* out_data, unsigned len, int final) { - *(__m64 *)__P = src; + unsigned i; + i = 0; +#ifdef HAVE_INT_PVECTOR + for(;i<len;i++) { + ((uint8_t*)out_data)[i]=(uint8_t)((((uint16_t*)in_data)[i])>>8); + if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + } + if((len-i)>=__IVEC_SIZE) + for(;i<len;i+=__IVEC_SIZE){ + __ivec outd,itmp[2]; + itmp[0] = _ivec_sra_s16_imm(_ivec_loadu(&((uint16_t*)in_data)[i]),8); + itmp[1] = _ivec_sra_s16_imm(_ivec_loadu(&((uint16_t*)in_data)[i+__IVEC_SIZE/2]),8); + outd = _ivec_s8_from_s16(itmp[0],itmp[1]); + if(final) + _ivec_stream(&((uint8_t*)out_data)[i],outd); + else + _ivec_storea(&((uint8_t*)out_data)[i],outd); + } +#endif + for(;i<len;i++) + ((uint8_t*)out_data)[i]=(uint8_t)((((uint16_t*)in_data)[i])>>8); +#ifdef HAVE_INT_PVECTOR + _ivec_empty(); + _ivec_sfence(); +#endif } -#undef _m_store -#define _m_store PVECTOR_RENAME(_m_store) -static __inline void __attribute__((__gnu_inline__, __always_inline__)) -PVECTOR_RENAME(_m_store_half)(void *__P, __m64 src) +static void __FASTCALL__ PVECTOR_RENAME(int16_to_int32)(const int16_t* in_data, int32_t* out_data, unsigned len, int final) { - *(int *)__P = _mm_cvtsi64_si32(src); -} -#undef _m_store_half -#define _m_store_half PVECTOR_RENAME(_m_store_half) - -static __inline void __attribute__((__gnu_inline__, __always_inline__)) -PVECTOR_RENAME(_m_movntq)(void *__P, __m64 src) -{ -#ifdef HAVE_MMX2 - _mm_stream_pi(__P,src); +#ifdef HAVE_INT_PVECTOR + __ivec izero = _ivec_setzero(); + unsigned len_mm,j; +#endif + unsigned i; + i=0; +#ifdef HAVE_INT_PVECTOR + j=0; + len_mm=len&(~(__IVEC_SIZE-1)); + for(;i<len;i++,j+=2){ + ((uint32_t*)out_data)[i]=((uint32_t)((uint16_t*)in_data)[i])<<16; + if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + } + if((len_mm-i)>=__IVEC_SIZE) + for(;i<len_mm;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) + { + __ivec ind,tmp[2]; + ind = _ivec_loadu(&((uint8_t *)in_data)[j]); +#if 0 /* slower but portable on non-x86 CPUs version */ + tmp[0]= _ivec_sll_s32_imm(_ivec_u32_from_lou16(ind),16); + tmp[1]= _ivec_sll_s32_imm(_ivec_u32_from_hiu16(ind),16); #else - _m_store(__P,src); + tmp[0]= _ivec_interleave_lo_u16(izero,ind); + tmp[1]= _ivec_interleave_hi_u16(izero,ind); #endif -} -#undef _m_movntq -#define _m_movntq PVECTOR_RENAME(_m_movntq) + if(final) { + _ivec_stream(&((uint8_t *)out_data)[j*2],tmp[0]); + _ivec_stream(&((uint8_t *)out_data)[j*2+__IVEC_SIZE],tmp[1]); + } else { + _ivec_storea(&((uint8_t *)out_data)[j*2],tmp[0]); + _ivec_storea(&((uint8_t *)out_data)[j*2+__IVEC_SIZE],tmp[1]); + } + } #endif + for(;i<len;i++) + ((uint32_t*)out_data)[i]=((uint32_t)((uint16_t*)in_data)[i])<<16; +#ifdef HAVE_INT_PVECTOR + _ivec_sfence(); + _ivec_empty(); +#endif +} -static void __FASTCALL__ PVECTOR_RENAME(change_bps)(const void* in_data, void* out_data, unsigned len, unsigned inbps, unsigned outbps) +static void __FASTCALL__ PVECTOR_RENAME(int32_to_int16)(const int32_t* in_data, int16_t* out_data, unsigned len, int final) { #ifdef HAVE_INT_PVECTOR - __ivec izero = _ivec_setzero(); - unsigned len_mm,j; + unsigned len_mm,j; #endif + unsigned i; + i=0; +#ifdef HAVE_INT_PVECTOR + j=0; + len_mm=len&(~(__IVEC_SIZE-1)); + for(;i<len;i++,j+=2){ + ((uint16_t*)out_data)[i]=(uint16_t)((((uint32_t*)in_data)[i])>>16); + if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + } + if((len-i)>=__IVEC_SIZE) + for(;i<len_mm;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) + { + __ivec ind[2],tmp; + ind[0]= _ivec_sra_s32_imm(_ivec_loadu(&((uint8_t *)in_data)[j*2]),16); + ind[1]= _ivec_sra_s32_imm(_ivec_loadu(&((uint8_t *)in_data)[j*2+__IVEC_SIZE]),16); + tmp = _ivec_s16_from_s32(ind[0],ind[1]); + if(final) + _ivec_stream(&((uint8_t *)out_data)[j],tmp); + else + _ivec_storea(&((uint8_t *)out_data)[j],tmp); + } +#endif + for(;i<len;i++) + ((uint16_t*)out_data)[i]=(uint16_t)((((uint32_t*)in_data)[i])>>16); +#ifdef HAVE_INT_PVECTOR + _ivec_sfence(); + _ivec_empty(); +#endif +} + +static void __FASTCALL__ PVECTOR_RENAME(change_bps)(const void* in_data, void* out_data, unsigned len, unsigned inbps, unsigned outbps,int final) +{ unsigned i; // Change the number of bits switch(inbps){ case 1: switch(outbps){ case 2: - i=0; - for(;i<len;i++) - ((uint16_t*)out_data)[i]=((uint16_t)((uint8_t*)in_data)[i])<<8; + PVECTOR_RENAME(int8_to_int16)(in_data,out_data,len,final); break; case 3: for(i=0;i<len;i++) @@ -78,9 +175,7 @@ case 2: switch(outbps){ case 1: - i=0; - for(;i<len;i++) - ((uint8_t*)out_data)[i]=(uint8_t)((((uint16_t*)in_data)[i])>>8); + PVECTOR_RENAME(int16_to_int8)(in_data,out_data,len,final); break; case 3: for(i=0;i<len;i++) @@ -89,32 +184,7 @@ ((uint8_t*)out_data)[3*i+2]=(((uint8_t*)in_data)[2*i+1]); break; case 4: - i=0; -#ifdef HAVE_INT_PVECTOR - j=0; - len_mm=len&(~(__IVEC_SIZE-1)); - for(;i<len;i++,j+=2){ - ((uint32_t*)out_data)[i]=((uint32_t)((uint16_t*)in_data)[i])<<16; - if((((long)out_data)&(__IVEC_SIZE-1))==0) break; - } - if((len_mm-i)>=__IVEC_SIZE) - for(;i<len_mm;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) - { - __ivec ind,tmp[2]; - ind = _ivec_loadu(&((uint8_t *)in_data)[j]); -#if 0 /* slower but portable on non-x86 CPUs version */ - tmp[0]= _ivec_sll_s32_imm(_ivec_u32_from_lou16(ind),16); - tmp[1]= _ivec_sll_s32_imm(_ivec_u32_from_hiu16(ind),16); -#else - tmp[0]= _ivec_interleave_lo_u16(izero,ind); - tmp[1]= _ivec_interleave_hi_u16(izero,ind); -#endif - _ivec_storea(&((uint8_t *)out_data)[j*2],tmp[0]); - _ivec_storea(&((uint8_t *)out_data)[j*2+__IVEC_SIZE],tmp[1]); - } -#endif - for(;i<len;i++) - ((uint32_t*)out_data)[i]=((uint32_t)((uint16_t*)in_data)[i])<<16; + PVECTOR_RENAME(int16_to_int32)(in_data,out_data,len,final); break; } break; @@ -150,26 +220,7 @@ ((uint8_t*)out_data)[i]=(uint8_t)((((uint32_t*)in_data)[i])>>24); break; case 2: - i=0; -#ifdef HAVE_INT_PVECTOR - j=0; - len_mm=len&(~(__IVEC_SIZE-1)); - for(;i<len;i++,j+=2){ - ((uint16_t*)out_data)[i]=(uint16_t)((((uint32_t*)in_data)[i])>>16); - if((((long)out_data)&(__IVEC_SIZE-1))==0) break; - } - if((len-i)>=__IVEC_SIZE) - for(;i<len_mm;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) - { - __ivec ind[2],tmp; - ind[0]= _ivec_sra_s32_imm(_ivec_loadu(&((uint8_t *)in_data)[j*2]),16); - ind[1]= _ivec_sra_s32_imm(_ivec_loadu(&((uint8_t *)in_data)[j*2+__IVEC_SIZE]),16); - tmp = _ivec_s16_from_s32(ind[0],ind[1]); - _ivec_storea(&((uint8_t *)out_data)[j],tmp); - } -#endif - for(;i<len;i++) - ((uint16_t*)out_data)[i]=(uint16_t)((((uint32_t*)in_data)[i])>>16); + PVECTOR_RENAME(int32_to_int16)(in_data,out_data,len,final); break; case 3: for(i=0;i<len;i++) @@ -180,12 +231,53 @@ } break; } +} + #ifdef HAVE_INT_PVECTOR - _ivec_sfence(); - _ivec_empty(); -#endif +static __inline __m64 __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(_m_load)(const void *__P) +{ + return *(const __m64 *)__P; } +#undef _m_load +#define _m_load PVECTOR_RENAME(_m_load) +static __inline __m64 __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(_m_load_half)(const void *__P) +{ + return _mm_cvtsi32_si64 (*(const int *)__P); +} +#undef _m_load_half +#define _m_load_half PVECTOR_RENAME(_m_load_half) + +static __inline void __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(_m_store)(void *__P, __m64... [truncated message content] |
From: <nic...@us...> - 2010-01-21 18:28:03
|
Revision: 117 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=117&view=rev Author: nickols_k Date: 2010-01-21 18:27:56 +0000 (Thu, 21 Jan 2010) Log Message: ----------- minor fixes Modified Paths: -------------- mplayerxp/libmpcodecs/ad_mp3.c mplayerxp/postproc/dsp_accel.h mplayerxp/pvector/pvector.h mplayerxp/pvector/pvector_f32_x86.h Modified: mplayerxp/libmpcodecs/ad_mp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.c 2010-01-21 14:58:37 UTC (rev 116) +++ mplayerxp/libmpcodecs/ad_mp3.c 2010-01-21 18:27:56 UTC (rev 117) @@ -212,8 +212,8 @@ #define mpg123_current_decoder(a) (*mpg123_current_decoder_ptr)(a) static int (*mpg123_decode_frame_ptr)(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); #define mpg123_decode_frame(a,b,c,d) (*mpg123_decode_frame_ptr)(a,b,c,d) -static off_t (*mpg123_tell_ptr)(mpg123_handle *mh); -#define mpg123_tell(a) (*mpg123_tell_ptr)(a) +static off_t (*mpg123_tell_stream_ptr)(mpg123_handle *mh); +#define mpg123_tell_stream(a) (*mpg123_tell_stream_ptr)(a) static void *dll_handle; @@ -234,13 +234,13 @@ mpg123_decode_ptr = ld_sym(dll_handle,"mpg123_decode"); mpg123_read_ptr = ld_sym(dll_handle,"mpg123_read"); mpg123_feed_ptr = ld_sym(dll_handle,"mpg123_feed"); - mpg123_tell_ptr = ld_sym(dll_handle,"mpg123_tell"); + mpg123_tell_stream_ptr = ld_sym(dll_handle,"mpg123_tell_stream"); mpg123_decode_frame_ptr = ld_sym(dll_handle,"mpg123_decode_frame"); return mpg123_decode_ptr && mpg123_init_ptr && mpg123_exit_ptr && mpg123_new_ptr && mpg123_delete_ptr && mpg123_plain_strerror_ptr && mpg123_open_feed_ptr && mpg123_close_ptr && mpg123_getformat_ptr && mpg123_param_ptr && mpg123_info_ptr && mpg123_current_decoder_ptr && - mpg123_read_ptr && mpg123_feed_ptr && mpg123_decode_frame_ptr && mpg123_tell_ptr; + mpg123_read_ptr && mpg123_feed_ptr && mpg123_decode_frame_ptr && mpg123_tell_stream_ptr; } @@ -374,7 +374,7 @@ */ MSG_DBG2("mp3_decode start: pts=%f\n",*pts); do { - cpos = mpg123_tell(priv->mh); + cpos = mpg123_tell_stream(priv->mh); *pts = priv->pts+((float)(cpos-priv->pos)/sh->i_bps); err=mpg123_decode_frame(priv->mh,&offset,&outdata,&done); if(!((err==MPG123_OK)||(err==MPG123_NEED_MORE))) { @@ -388,7 +388,7 @@ float apts=0.; indata_size=ds_get_packet_r(sh->ds,&indata,&apts); if(indata_size<0) return 0; - priv->pos = mpg123_tell(priv->mh); + priv->pos = mpg123_tell_stream(priv->mh); priv->pts = apts; mpg123_feed(priv->mh,indata,indata_size); } Modified: mplayerxp/postproc/dsp_accel.h =================================================================== --- mplayerxp/postproc/dsp_accel.h 2010-01-21 14:58:37 UTC (rev 116) +++ mplayerxp/postproc/dsp_accel.h 2010-01-21 18:27:56 UTC (rev 117) @@ -9,36 +9,34 @@ unsigned i; i = 0; #ifdef HAVE_INT_PVECTOR - for(;i<len;i++) { - ((uint16_t*)out_data)[i]=((uint16_t)((uint8_t*)in_data)[i])<<8; - if((((long)out_data)&(__IVEC_SIZE-1))==0) break; - } - if((len-i)>=__IVEC_SIZE) - for(;i<len;i+=__IVEC_SIZE){ - __ivec ind,itmp[2]; - ind = _ivec_loadu(&((uint8_t *)in_data)[i]); + for(;i<len;i++) { + ((uint16_t*)out_data)[i]=((uint16_t)((const uint8_t*)in_data)[i])<<8; + if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + } + if((len-i)>=__IVEC_SIZE) + for(;i<len;i+=__IVEC_SIZE){ + __ivec ind,itmp[2]; + ind = _ivec_loadu(&((const uint8_t *)in_data)[i]); #if 0 /* slower but portable on non-x86 CPUs version */ - itmp[0]= _ivec_sll_s16_imm(_ivec_u16_from_lou8(ind),8); - itmp[1]= _ivec_sll_s16_imm(_ivec_u16_from_hiu8(ind),8); + itmp[0]= _ivec_sll_s16_imm(_ivec_u16_from_lou8(ind),8); + itmp[1]= _ivec_sll_s16_imm(_ivec_u16_from_hiu8(ind),8); #else - itmp[0]= _ivec_interleave_lo_u8(izero,ind); - itmp[1]= _ivec_interleave_hi_u8(izero,ind); + itmp[0]= _ivec_interleave_lo_u8(izero,ind); + itmp[1]= _ivec_interleave_hi_u8(izero,ind); #endif - if(final) { - _ivec_stream(&((uint16_t*)out_data)[i],itmp[0]); - _ivec_stream(&((uint16_t*)out_data)[i+__IVEC_SIZE/2],itmp[1]); - } else { - _ivec_storea(&((uint16_t*)out_data)[i],itmp[0]); - _ivec_storea(&((uint16_t*)out_data)[i+__IVEC_SIZE/2],itmp[1]); - } + if(final) { + _ivec_stream(&((uint16_t*)out_data)[i],itmp[0]); + _ivec_stream(&((uint16_t*)out_data)[i+__IVEC_SIZE/2],itmp[1]); + } else { + _ivec_storea(&((uint16_t*)out_data)[i],itmp[0]); + _ivec_storea(&((uint16_t*)out_data)[i+__IVEC_SIZE/2],itmp[1]); } -#endif - for(;i<len;i++) - ((uint16_t*)out_data)[i]=((uint16_t)((uint8_t*)in_data)[i])<<8; -#ifdef HAVE_INT_PVECTOR + } _ivec_empty(); _ivec_sfence(); #endif + for(;i<len;i++) + ((uint16_t*)out_data)[i]=((uint16_t)((const uint8_t*)in_data)[i])<<8; } static void __FASTCALL__ PVECTOR_RENAME(int16_to_int8)(const int16_t* in_data, int8_t* out_data, unsigned len, int final) @@ -47,27 +45,25 @@ i = 0; #ifdef HAVE_INT_PVECTOR for(;i<len;i++) { - ((uint8_t*)out_data)[i]=(uint8_t)((((uint16_t*)in_data)[i])>>8); + ((uint8_t*)out_data)[i]=(uint8_t)((((const uint16_t*)in_data)[i])>>8); if((((long)out_data)&(__IVEC_SIZE-1))==0) break; } if((len-i)>=__IVEC_SIZE) for(;i<len;i+=__IVEC_SIZE){ __ivec outd,itmp[2]; - itmp[0] = _ivec_sra_s16_imm(_ivec_loadu(&((uint16_t*)in_data)[i]),8); - itmp[1] = _ivec_sra_s16_imm(_ivec_loadu(&((uint16_t*)in_data)[i+__IVEC_SIZE/2]),8); + itmp[0] = _ivec_sra_s16_imm(_ivec_loadu(&((const uint16_t*)in_data)[i]),8); + itmp[1] = _ivec_sra_s16_imm(_ivec_loadu(&((const uint16_t*)in_data)[i+__IVEC_SIZE/2]),8); outd = _ivec_s8_from_s16(itmp[0],itmp[1]); if(final) _ivec_stream(&((uint8_t*)out_data)[i],outd); else _ivec_storea(&((uint8_t*)out_data)[i],outd); } -#endif - for(;i<len;i++) - ((uint8_t*)out_data)[i]=(uint8_t)((((uint16_t*)in_data)[i])>>8); -#ifdef HAVE_INT_PVECTOR _ivec_empty(); _ivec_sfence(); #endif + for(;i<len;i++) + ((uint8_t*)out_data)[i]=(uint8_t)((((const uint16_t*)in_data)[i])>>8); } static void __FASTCALL__ PVECTOR_RENAME(int16_to_int32)(const int16_t* in_data, int32_t* out_data, unsigned len, int final) @@ -82,14 +78,14 @@ j=0; len_mm=len&(~(__IVEC_SIZE-1)); for(;i<len;i++,j+=2){ - ((uint32_t*)out_data)[i]=((uint32_t)((uint16_t*)in_data)[i])<<16; + ((uint32_t*)out_data)[i]=((uint32_t)((const uint16_t*)in_data)[i])<<16; if((((long)out_data)&(__IVEC_SIZE-1))==0) break; } if((len_mm-i)>=__IVEC_SIZE) for(;i<len_mm;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) { __ivec ind,tmp[2]; - ind = _ivec_loadu(&((uint8_t *)in_data)[j]); + ind = _ivec_loadu(&((const uint8_t *)in_data)[j]); #if 0 /* slower but portable on non-x86 CPUs version */ tmp[0]= _ivec_sll_s32_imm(_ivec_u32_from_lou16(ind),16); tmp[1]= _ivec_sll_s32_imm(_ivec_u32_from_hiu16(ind),16); @@ -105,48 +101,43 @@ _ivec_storea(&((uint8_t *)out_data)[j*2+__IVEC_SIZE],tmp[1]); } } -#endif - for(;i<len;i++) - ((uint32_t*)out_data)[i]=((uint32_t)((uint16_t*)in_data)[i])<<16; -#ifdef HAVE_INT_PVECTOR _ivec_sfence(); _ivec_empty(); #endif + for(;i<len;i++) + ((uint32_t*)out_data)[i]=((uint32_t)((const uint16_t*)in_data)[i])<<16; } static void __FASTCALL__ PVECTOR_RENAME(int32_to_int16)(const int32_t* in_data, int16_t* out_data, unsigned len, int final) { #ifdef HAVE_INT_PVECTOR - unsigned len_mm,j; + unsigned j; #endif unsigned i; i=0; #ifdef HAVE_INT_PVECTOR j=0; - len_mm=len&(~(__IVEC_SIZE-1)); for(;i<len;i++,j+=2){ - ((uint16_t*)out_data)[i]=(uint16_t)((((uint32_t*)in_data)[i])>>16); + ((uint16_t*)out_data)[i]=(uint16_t)((((const uint32_t*)in_data)[i])>>16); if((((long)out_data)&(__IVEC_SIZE-1))==0) break; } if((len-i)>=__IVEC_SIZE) - for(;i<len_mm;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) + for(;i<len;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) { __ivec ind[2],tmp; - ind[0]= _ivec_sra_s32_imm(_ivec_loadu(&((uint8_t *)in_data)[j*2]),16); - ind[1]= _ivec_sra_s32_imm(_ivec_loadu(&((uint8_t *)in_data)[j*2+__IVEC_SIZE]),16); + ind[0]= _ivec_sra_s32_imm(_ivec_loadu(&((const uint8_t *)in_data)[j*2]),16); + ind[1]= _ivec_sra_s32_imm(_ivec_loadu(&((const uint8_t *)in_data)[j*2+__IVEC_SIZE]),16); tmp = _ivec_s16_from_s32(ind[0],ind[1]); if(final) _ivec_stream(&((uint8_t *)out_data)[j],tmp); else _ivec_storea(&((uint8_t *)out_data)[j],tmp); } -#endif - for(;i<len;i++) - ((uint16_t*)out_data)[i]=(uint16_t)((((uint32_t*)in_data)[i])>>16); -#ifdef HAVE_INT_PVECTOR _ivec_sfence(); _ivec_empty(); #endif + for(;i<len;i++) + ((uint16_t*)out_data)[i]=(uint16_t)((((const uint32_t*)in_data)[i])>>16); } static void __FASTCALL__ PVECTOR_RENAME(change_bps)(const void* in_data, void* out_data, unsigned len, unsigned inbps, unsigned outbps,int final) @@ -312,27 +303,35 @@ #endif } -static void __FASTCALL__ PVECTOR_RENAME(float_to_int32)(float* in, int32_t* out, unsigned len, int final) +static void __FASTCALL__ PVECTOR_RENAME(float_to_int32)(const float* in, int32_t* out, unsigned len, int final) { register unsigned i; float ftmp; #ifdef HAVE_F32_PVECTOR - __f32vec int_max; + unsigned len_mm; + __f32vec int_max,plus1,minus1; #endif i=0; #ifdef HAVE_F32_PVECTOR - int_max = _f32vec_broadcast(INT_MAX-1); + int_max = _f32vec_broadcast(INT32_MAX-1); + /* SSE engine sometime has unpredictable behaviour. So downscale volume on 1% here. */ + plus1 = _f32vec_broadcast(+0.99); + minus1= _f32vec_broadcast(-0.99); for(;i<len;i++) { - ftmp=((float*)in)[i]; + ftmp=((const float*)in)[i]; SATURATE(ftmp,-1.0,+1.0); ((int32_t*)out)[i]=(int32_t)lrintf((INT_MAX-1)*ftmp); if((((long)out)&(__F32VEC_SIZE-1))==0) break; } _ivec_empty(); - if((len-i)>=__F32VEC_SIZE) - for(;i<len;i+=__F32VEC_SIZE/sizeof(float)) { + len_mm=len&(~(__F32VEC_SIZE-1)); + if((len_mm-i)>=__F32VEC_SIZE/sizeof(float)) + for(;i<len_mm;i+=__F32VEC_SIZE/sizeof(float)) { __f32vec tmp; - tmp = _f32vec_mul(int_max,_f32vec_loadu(&((float*)in)[i])); + tmp = _f32vec_loadu(&((const float*)in)[i]); + tmp = _f32vec_min(tmp,plus1); + tmp = _f32vec_max(tmp,minus1); + tmp = _f32vec_mul(int_max,tmp); if(final) _f32vec_to_s32_stream(&((int32_t*)out)[i],tmp); else @@ -342,14 +341,10 @@ _ivec_empty(); #endif for(;i<len;i++) { - ftmp=((float*)in)[i]; - SATURATE(ftmp,-1.0,+1.0); - ((int32_t*)out)[i]=(int32_t)lrintf((INT_MAX-1)*ftmp); + ftmp=((const float*)in)[i]; + SATURATE(ftmp,-0.99,+0.99); + ((int32_t*)out)[i]=(int32_t)lrintf((INT32_MAX-1)*ftmp); } -#ifdef HAVE_INT_PVECTOR - _ivec_sfence(); - _ivec_empty(); -#endif } static void __FASTCALL__ PVECTOR_RENAME(int32_to_float)(int32_t* in, float* out, unsigned len, int final) @@ -360,14 +355,14 @@ register unsigned i=0; #ifdef HAVE_F32_PVECTOR for(;i<len;i++) { - ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); + ((float*)out)[i]=(1.0/INT_MAX)*((float)((const int32_t*)in)[i]); if((((long)out)&(__F32VEC_SIZE-1))==0) break; } _ivec_empty(); if((len-i)>=__F32VEC_SIZE) for(;i<len;i+=__F32VEC_SIZE/sizeof(float)) { __f32vec tmp; - tmp = _f32vec_mul(rev_imax,_f32vec_from_s32u(&((int32_t*)in)[i])); + tmp = _f32vec_mul(rev_imax,_f32vec_from_s32u(&((const int32_t*)in)[i])); if(final) _f32vec_stream(&((float*)out)[i],tmp); else @@ -377,11 +372,7 @@ _ivec_empty(); #endif for(;i<len;i++) - ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t*)in)[i]); -#ifdef HAVE_INT_PVECTOR - _ivec_sfence(); - _ivec_empty(); -#endif + ((float*)out)[i]=(1.0/INT_MAX)*((float)((const int32_t*)in)[i]); } static void __FASTCALL__ PVECTOR_RENAME(float2int)(void* in, void* out, int len, int bps,int final) Modified: mplayerxp/pvector/pvector.h =================================================================== --- mplayerxp/pvector/pvector.h 2010-01-21 14:58:37 UTC (rev 116) +++ mplayerxp/pvector/pvector.h 2010-01-21 18:27:56 UTC (rev 117) @@ -197,4 +197,9 @@ __f32vec _f32vec_sub(__f32vec f1, __f32vec f2); // sub: f1-f2 __f32vec _f32vec_mul(__f32vec f1, __f32vec f2); // mul: f1*f2 __f32vec _f32vec_div(__f32vec f1, __f32vec f2); // div: f1/f2 + + COMPARE engine: + --------------- + __f32vec _f32vec_min(__f32vec f1, __f32vec f2); // MIN(f1,f2) + __f32vec _f32vec_max(__f32vec f1, __f32vec f2); // MAX(f1,f2) */ Modified: mplayerxp/pvector/pvector_f32_x86.h =================================================================== --- mplayerxp/pvector/pvector_f32_x86.h 2010-01-21 14:58:37 UTC (rev 116) +++ mplayerxp/pvector/pvector_f32_x86.h 2010-01-21 18:27:56 UTC (rev 117) @@ -289,3 +289,31 @@ } #undef _f32vec_div #define _f32vec_div PVECTOR_RENAME(f32_div) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_max)(__f32vec f1,__f32vec f2) +{ +#ifdef OPTIMIZE_AVX + return _mm256_max_ps(f1,f2); +#elif defined( OPTIMIZE_SSE ) + return _mm_max_ps(f1,f2); +#else + return _m_pfmax(f1,f2); +#endif +} +#undef _f32vec_max +#define _f32vec_max PVECTOR_RENAME(f32_max) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_min)(__f32vec f1,__f32vec f2) +{ +#ifdef OPTIMIZE_AVX + return _mm256_min_ps(f1,f2); +#elif defined( OPTIMIZE_SSE ) + return _mm_min_ps(f1,f2); +#else + return _m_pfmin(f1,f2); +#endif +} +#undef _f32vec_min +#define _f32vec_min PVECTOR_RENAME(f32_min) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-22 15:41:53
|
Revision: 118 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=118&view=rev Author: nickols_k Date: 2010-01-22 15:41:46 +0000 (Fri, 22 Jan 2010) Log Message: ----------- let mp_image knows number of XP-frame where it will be rendered Modified Paths: -------------- mplayerxp/dec_ahead.c mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libvo/video_out.c mplayerxp/libvo/video_out.h mplayerxp/mp_image.c mplayerxp/mp_image.h mplayerxp/postproc/vf.c mplayerxp/postproc/vf_menu.c mplayerxp/postproc/vf_vo.c Modified: mplayerxp/dec_ahead.c =================================================================== --- mplayerxp/dec_ahead.c 2010-01-21 18:27:56 UTC (rev 117) +++ mplayerxp/dec_ahead.c 2010-01-22 15:41:46 UTC (rev 118) @@ -248,7 +248,7 @@ MSG_DBG2("Sync mpeg pts %f\n", mpeg_timer); } else mpeg_timer+=duration; } - vo_set_frame_num(&dec_ahead_locked_frame); + vo_set_decoding_frame_num(&dec_ahead_locked_frame); /* ----------- compute frame dropping ------------- */ LOCK_VDEC_ACTIVE(); ada_active_frame= abs_dec_ahead_active_frame; Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2010-01-21 18:27:56 UTC (rev 117) +++ mplayerxp/libmpcodecs/vd.c 2010-01-22 15:41:46 UTC (rev 118) @@ -270,8 +270,11 @@ // returns NULL or allocated mp_image_t* // Note: buffer allocation may be moved to mpcodecs_config_vo() later... mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag,int w, int h){ + MSG_DBG2("mpcodecs_get_image(vf_%s,%i,%i,%i,%i) was called\n",((vf_instance_t *)(sh->vfilter))->info->name,mp_imgtype,mp_imgflag,w,h); mp_image_t* mpi=vf_get_image(sh->vfilter,sh->codec->outfmt[sh->outfmtidx],mp_imgtype,mp_imgflag,w,h); mpi->x=mpi->y=0; + if(mpi->xp_idx==XP_IDX_INVALID) + MSG_WARN("[mpcodecs_get_image] Incorrect mpi->xp_idx. Be ready for segfault!\n"); return mpi; } Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-21 18:27:56 UTC (rev 117) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-22 15:41:46 UTC (rev 118) @@ -87,6 +87,8 @@ AVCodec *lavc_codec; AVCodecContext *ctx; AVFrame *lavc_picture; + mp_image_t* mpi; + unsigned long long frame_number; /* total frame number since begin of movie */ int b_age; int ip_age[2]; int qp_stat[32]; @@ -225,6 +227,7 @@ vdff_ctx=malloc(sizeof(priv_t)); memset(vdff_ctx,0,sizeof(priv_t)); sh->context = vdff_ctx; + vdff_ctx->frame_number=-2; vdff_ctx->lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh->codec->dll_name); if(!vdff_ctx->lavc_codec){ MSG_ERR(MSGTR_MissingLAVCcodec,sh->codec->dll_name); @@ -577,9 +580,14 @@ { sh_video_t *sh=s->opaque; priv_t *vdff_ctx=sh->context; - mp_image_t *mpi; + mp_image_t *mpi=vdff_ctx->mpi; + unsigned long long int total_frame; + unsigned orig_idx = mpi->xp_idx; + /* sync-point*/ + if(src->pict_type==FF_I_TYPE) vdff_ctx->frame_number = src->coded_picture_number; + total_frame = vdff_ctx->frame_number; if(vdff_ctx->use_dr1) { MSG_DBG2("Ignoring draw_slice due dr1\n"); return; } /* we may call vo_start_slice() here */ - mpi=mpcodecs_get_image(sh,MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_DRAW_CALLBACK|MP_IMGFLAG_DIRECT,s->width,s->height); +// mpi=mpcodecs_get_image(sh,MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_DRAW_CALLBACK|MP_IMGFLAG_DIRECT,s->width,s->height); mpi->stride[0]=src->linesize[0]; mpi->stride[1]=src->linesize[1]; @@ -609,9 +617,33 @@ mpi->stride[2]=mpi->stride[1]; mpi->stride[1]=ls; } - MSG_DBG2("ff_draw_callback[%ux%u] %i %i %i %i\n",mpi->width,mpi->height,mpi->x,mpi->y,mpi->w,mpi->h); +#if 0 + /* handle IPB-frames here */ + if(total_frame!=src->coded_picture_number) { + unsigned long long int tf = total_frame; + /* we can do only 1 step forward */ + if(total_frame<src->coded_picture_number) + mpi->xp_idx = vo_get_decoding_next_frame(mpi->xp_idx); + else + while(tf>src->coded_picture_number) { + mpi->xp_idx = vo_get_decoding_prev_frame(mpi->xp_idx); + tf--; + } + } +#endif + MSG_DBG2("ff_draw_callback<%u->%u:%u:%u-%s>[%ux%u] %i %i %i %i\n", + orig_idx,mpi->xp_idx,(unsigned)total_frame,src->coded_picture_number, + src->pict_type==FF_BI_TYPE?"bi": + src->pict_type==FF_SP_TYPE?"sp": + src->pict_type==FF_SI_TYPE?"si": + src->pict_type==FF_S_TYPE?"s": + src->pict_type==FF_B_TYPE?"b": + src->pict_type==FF_P_TYPE?"p": + src->pict_type==FF_I_TYPE?"i":"??" + ,mpi->width,mpi->height,mpi->x,mpi->y,mpi->w,mpi->h); __MP_ATOMIC(sh->active_slices++); mpcodecs_draw_slice (sh, mpi); + mpi->xp_idx = orig_idx; __MP_ATOMIC(sh->active_slices--); } @@ -630,8 +662,6 @@ int ret,has_b_frames; priv_t *vdff_ctx=sh->context; mp_image_t* mpi=NULL; - void *next_put_slice; - vf_instance_t *vf; vdff_ctx->ctx->opaque=sh; if(len<=0) return NULL; // skipped frame @@ -644,24 +674,17 @@ if sh->vfilter==vf_vo (DR1 is meaningless into temp buffer) It always happens with (vidix+bus mastering), (if (disp_w%16==0)) with xv */ - vf=sh->vfilter; - next_put_slice=NULL; - while(vf) - { - /* exclude vf_aspect and similar */ - if(vf->put_slice != vf_next_put_slice && vf->next) next_put_slice=vf->put_slice; - vf=vf->next; - } has_b_frames=vdff_ctx->ctx->has_b_frames|| sh->format==0x10000001 || /* mpeg1 may have b frames */ vdff_ctx->lavc_codec->id==CODEC_ID_SVQ3|| 1; mpi= mpcodecs_get_image(sh,has_b_frames?MP_IMGTYPE_IPB:MP_IMGTYPE_IP,MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE|MP_IMGFLAG_READABLE|MP_IMGFLAG_PRESERVE, 16,16); - if(vdff_ctx->cap_dr1 && + if(!(vdff_ctx->cap_dr1 && vdff_ctx->lavc_codec->id != CODEC_ID_H264 && - !next_put_slice && mpi->flags&MP_IMGFLAG_DIRECT) - vdff_ctx->use_dr1=1; + vdff_ctx->use_slices && mpi->flags&MP_IMGFLAG_DIRECT && !has_b_frames)) + vdff_ctx->use_slices=0; + if(vdff_ctx->use_slices) vdff_ctx->use_dr1=0; if( sh->format == mmioFOURCC('R', 'V', '1', '0') || sh->format == mmioFOURCC('R', 'V', '1', '3') || sh->format == mmioFOURCC('R', 'V', '2', '0') @@ -694,6 +717,8 @@ if(!(flags&3) && vdff_ctx->use_slices) { mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_DRAW_CALLBACK|MP_IMGFLAG_DIRECT,sh->disp_w, sh->disp_h); + vdff_ctx->mpi = mpi; + vdff_ctx->frame_number++; vdff_ctx->ctx->draw_horiz_band=draw_slice; } else vdff_ctx->ctx->draw_horiz_band=NULL; /* skip draw_slice on framedropping */ Modified: mplayerxp/libvo/video_out.c =================================================================== --- mplayerxp/libvo/video_out.c 2010-01-21 18:27:56 UTC (rev 117) +++ mplayerxp/libvo/video_out.c 2010-01-22 15:41:46 UTC (rev 118) @@ -527,6 +527,7 @@ int width_less_stride; MSG_DBG2("dri_vo_dbg: vo_get_surface type=%X flg=%X\n",mpi->type,mpi->flags); width_less_stride = 0; + mpi->xp_idx = xp_frame; if(mpi->flags & MP_IMGFLAG_PLANAR) { width_less_stride = mpi->w <= dri_cap.strides[0] && @@ -644,16 +645,30 @@ return VO_TRUE; } -uint32_t __FASTCALL__ vo_get_frame_num( volatile unsigned * fr ) +uint32_t __FASTCALL__ vo_get_decoding_frame_num( volatile unsigned * fr ) { *fr = has_dri ? xp_frame : 0; - MSG_DBG3("dri_vo_dbg: %u=vo_get_frame_num\n",*fr); + MSG_DBG3("dri_vo_dbg: %u=vo_get_decoding_frame_num\n",*fr); return VO_TRUE; } -uint32_t __FASTCALL__ vo_set_frame_num( volatile unsigned * fr ) +unsigned __FASTCALL__ vo_get_decoding_next_frame( unsigned idx ) { - MSG_DBG3("dri_vo_dbg: vo_set_frame_num(%u)\n",*fr); + unsigned rval; + rval = has_dri ? (idx+1)%dri_nframes : 0; + return rval; +} + +unsigned __FASTCALL__ vo_get_decoding_prev_frame( unsigned idx ) +{ + unsigned rval; + rval = has_dri ? (idx-1+dri_nframes)%dri_nframes : 0; + return rval; +} + +uint32_t __FASTCALL__ vo_set_decoding_frame_num( volatile unsigned * fr ) +{ + MSG_DBG2("dri_vo_dbg: vo_set_decoding_frame_num(%u) for decoding to\n",*fr); xp_frame = *fr; dri_has_thread = 1; return VO_TRUE; @@ -666,14 +681,6 @@ return VO_TRUE; } -uint32_t __FASTCALL__ vo_set_active_frame( volatile unsigned * fr) -{ - MSG_DBG3("dri_vo_dbg: vo_set_active_frame(%u)\n",*fr); - active_frame = *fr; - vo_change_frame(); - return VO_TRUE; -} - uint32_t __FASTCALL__ vo_draw_slice(const mp_image_t *mpi) { unsigned i,_w[4],_h[4],x,y; @@ -684,9 +691,10 @@ const uint8_t *ps_src[4]; int dstStride[4]; int finalize=vo_is_final(); + unsigned idx = mpi->xp_idx; for(i=0;i<4;i++) { - dst[i]=dri_surf[xp_frame].planes[i]+dri_off[i]; + dst[i]=dri_surf[idx].planes[i]+dri_off[i]; dstStride[i]=dri_cap.strides[i]; dst[i]+=((mpi->y*dstStride[i])*vod.y_mul[i])/vod.y_div[i]; dst[i]+=(mpi->x*vod.x_mul[i])/vod.x_div[i]; @@ -711,7 +719,7 @@ void vo_change_frame(void) { - MSG_DBG3("dri_vo_dbg: vo_change_frame [active_frame=%u]\n",active_frame); + MSG_DBG2("dri_vo_dbg: vo_change_frame [active_frame=%u]\n",active_frame); if(vo_doublebuffering || (dri_cap.caps & DRI_CAP_VIDEO_MMAPED)!=DRI_CAP_VIDEO_MMAPED) { video_out->change_frame(active_frame); Modified: mplayerxp/libvo/video_out.h =================================================================== --- mplayerxp/libvo/video_out.h 2010-01-21 18:27:56 UTC (rev 117) +++ mplayerxp/libvo/video_out.h 2010-01-22 15:41:46 UTC (rev 118) @@ -169,11 +169,11 @@ extern uint32_t __FASTCALL__ vo_get_surface( mp_image_t* mpi ); extern int vo_check_events( void ); extern uint32_t __FASTCALL__ vo_get_num_frames( unsigned * ); -extern uint32_t __FASTCALL__ vo_get_frame_num( volatile unsigned * ); -extern uint32_t __FASTCALL__ vo_set_frame_num( volatile unsigned * ); +extern uint32_t __FASTCALL__ vo_get_decoding_frame_num( volatile unsigned * ); +extern uint32_t __FASTCALL__ vo_set_decoding_frame_num( volatile unsigned * ); +extern unsigned __FASTCALL__ vo_get_decoding_next_frame( unsigned idx ); +extern unsigned __FASTCALL__ vo_get_decoding_prev_frame( unsigned idx ); extern uint32_t __FASTCALL__ vo_get_active_frame( volatile unsigned * ); -extern uint32_t __FASTCALL__ vo_set_active_frame( volatile unsigned * ); -extern uint32_t __FASTCALL__ vo_draw_frame(const mp_image_t *mpi); extern uint32_t __FASTCALL__ vo_draw_slice(const mp_image_t *mpi); extern void vo_change_frame(void); extern void vo_flush_pages(void); Modified: mplayerxp/mp_image.c =================================================================== --- mplayerxp/mp_image.c 2010-01-21 18:27:56 UTC (rev 117) +++ mplayerxp/mp_image.c 2010-01-22 15:41:46 UTC (rev 118) @@ -1,4 +1,3 @@ - #include "mp_config.h" #include <stdio.h> @@ -143,10 +142,11 @@ mpi->bpp=0; } -mp_image_t* new_mp_image(int w,int h){ +mp_image_t* new_mp_image(unsigned w,unsigned h,unsigned xp_idx){ mp_image_t* mpi=(mp_image_t*)malloc(sizeof(mp_image_t)); if(!mpi) return NULL; // error! memset(mpi,0,sizeof(mp_image_t)); + mpi->xp_idx = xp_idx; mpi->width=mpi->w=w; mpi->height=mpi->h=h; return mpi; @@ -161,10 +161,15 @@ free(mpi); } -mp_image_t* alloc_mpi(int w, int h, unsigned int fmt) { - mp_image_t* mpi = new_mp_image(w,h); +mp_image_t* alloc_mpi(unsigned w, unsigned h, unsigned int fmt,unsigned xp_idx) { + mp_image_t* mpi = new_mp_image(w,h,xp_idx); mp_image_setfmt(mpi,fmt); + mpi_alloc_planes(mpi); + return mpi; +} + +void mpi_alloc_planes(mp_image_t *mpi) { // IF09 - allocate space for 4. plane delta info - unused if (mpi->imgfmt == IMGFMT_IF09) { @@ -192,8 +197,6 @@ if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8; } mpi->flags|=MP_IMGFLAG_ALLOCATED; - - return mpi; } void copy_mpi(mp_image_t *dmpi,const mp_image_t *mpi) { Modified: mplayerxp/mp_image.h =================================================================== --- mplayerxp/mp_image.h 2010-01-21 18:27:56 UTC (rev 117) +++ mplayerxp/mp_image.h 2010-01-22 15:41:46 UTC (rev 118) @@ -4,68 +4,48 @@ //--------- codec's requirements (filled by the codec/vf) --------- //--- buffer content restrictions: -// set if buffer content shouldn't be modified: -#define MP_IMGFLAG_PRESERVE 0x01 -// set if buffer content will be READ for next frame's MC: (I/P mpeg frames) -#define MP_IMGFLAG_READABLE 0x02 +#define MP_IMGFLAG_PRESERVE 0x00001 // set if buffer content shouldn't be modified: +#define MP_IMGFLAG_READABLE 0x00002 // set if buffer content will be READ for next frame's MC: (I/P mpeg frames) //--- buffer width/stride/plane restrictions: (used for direct rendering) // stride _have_to_ be aligned to MB boundary: [for DR restrictions] -#define MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE 0x04 /* no flag - should be neg value of MP_IMGFLAG_ACCEPT_STRIDE */ +#define MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE 0x00004 /* no flag - should be neg value of MP_IMGFLAG_ACCEPT_STRIDE */ // stride should be aligned to MB boundary: [for buffer allocation] -#define MP_IMGFLAG_PREFER_ALIGNED_STRIDE 0x08 /* sould be no flag - everything prefer aligned strides */ -// codec accept any stride (>=width): -#define MP_IMGFLAG_ACCEPT_STRIDE 0x10 -// codec accept any width (width*bpp=stride -> stride%bpp==0) (>=width): -#define MP_IMGFLAG_ACCEPT_WIDTH 0x20 +#define MP_IMGFLAG_PREFER_ALIGNED_STRIDE 0x00008 /* sould be no flag - everything prefer aligned strides */ +#define MP_IMGFLAG_ACCEPT_STRIDE 0x00010 // codec accept any stride (>=width): +#define MP_IMGFLAG_ACCEPT_WIDTH 0x00020 // codec accept any width (width*bpp=stride -> stride%bpp==0) (>=width): //--- for planar formats only: // uses only stride[0], and stride[1]=stride[2]=stride[0]>>mpi->chroma_x_shift -#define MP_IMGFLAG_COMMON_STRIDE 0x40 /* UNUSED */ +#define MP_IMGFLAG_COMMON_STRIDE 0x00040 /* UNUSED */ // uses only planes[0], and calculates planes[1,2] from width,height,imgfmt -#define MP_IMGFLAG_COMMON_PLANE 0x80 /* UNUSED */ -#define MP_IMGFLAGMASK_RESTRICTIONS 0xFF +#define MP_IMGFLAG_COMMON_PLANE 0x00080 /* UNUSED */ +#define MP_IMGFLAGMASK_RESTRICTIONS 0x000FF //--------- color info (filled by mp_image_setfmt() ) ----------- -// set if number of planes > 1 -#define MP_IMGFLAG_PLANAR 0x100 -// set if it's YUV colorspace -#define MP_IMGFLAG_YUV 0x200 -// set if it's swapped (BGR or YVU) plane/byteorder -#define MP_IMGFLAG_SWAPPED 0x400 -// using palette for RGB data -#define MP_IMGFLAG_RGB_PALETTE 0x800 -#define MP_IMGFLAGMASK_COLORS 0xF00 +#define MP_IMGFLAG_PLANAR 0x00100 // set if number of planes > 1 +#define MP_IMGFLAG_YUV 0x00200 // set if it's YUV colorspace +#define MP_IMGFLAG_SWAPPED 0x00400 // set if it's swapped (BGR or YVU) plane/byteorder +#define MP_IMGFLAG_RGB_PALETTE 0x00800 // using palette for RGB data +#define MP_IMGFLAGMASK_COLORS 0x00F00 // codec uses drawing/rendering callbacks (draw_slice()-like thing, DR method 2) // [the codec will set this flag if it supports callbacks, and the vo _may_ // clear it in get_image() if draw_slice() not implemented] -#define MP_IMGFLAG_DRAW_CALLBACK 0x1000 -// set if it's in video buffer/memory: [set by vo/vf's get_image() !!!] -#define MP_IMGFLAG_DIRECT 0x2000 -// set if buffer is allocated (used in destination images): -#define MP_IMGFLAG_ALLOCATED 0x4000 +#define MP_IMGFLAG_DRAW_CALLBACK 0x01000 +#define MP_IMGFLAG_DIRECT 0x02000 // set if it's in video buffer/memory: [set by vo/vf's get_image() !!!] +#define MP_IMGFLAG_ALLOCATED 0x04000 // set if buffer is allocated (used in destination images): +#define MP_IMGFLAG_TYPE_DISPLAYED 0x08000 // buffer type was printed (do NOT set this flag - it's for INTERNAL USE!!!) +#define MP_IMGFLAG_FINAL 0x10000 // buffer is video memory +#define MP_IMGFLAG_RENDERED 0x20000 // final buffer was already painted +#define MP_IMGFLAG_FINALIZED 0x40000 // indicates final step of image processing from CPU side!!! -// buffer type was printed (do NOT set this flag - it's for INTERNAL USE!!!) -#define MP_IMGFLAG_TYPE_DISPLAYED 0x8000 -// buffer is video memory -#define MP_IMGFLAG_FINAL 0x10000 -// final buffer was already painted -#define MP_IMGFLAG_RENDERED 0x20000 -// indicates final step of image processing from CPU side!!! -#define MP_IMGFLAG_FINALIZED 0x40000 +/* codec doesn't support any form of direct rendering - it has own buffer */ +#define MP_IMGTYPE_EXPORT 0 // allocation. so we just export its buffer pointers: +#define MP_IMGTYPE_STATIC 1 // codec requires a static WO buffer, but it does only partial updates later: +#define MP_IMGTYPE_TEMP 2 // codec just needs some WO memory, where it writes/copies the whole frame to: +#define MP_IMGTYPE_IP 3 // I+P type, requires 2+ independent static R/W buffers +#define MP_IMGTYPE_IPB 4 // I+P+B type, requires 2+ independent static R/W and 1+ temp WO buffers -// codec doesn't support any form of direct rendering - it has own buffer -// allocation. so we just export its buffer pointers: -#define MP_IMGTYPE_EXPORT 0 -// codec requires a static WO buffer, but it does only partial updates later: -#define MP_IMGTYPE_STATIC 1 -// codec just needs some WO memory, where it writes/copies the whole frame to: -#define MP_IMGTYPE_TEMP 2 -// I+P type, requires 2+ independent static R/W buffers -#define MP_IMGTYPE_IP 3 -// I+P+B type, requires 2+ independent static R/W and 1+ temp WO buffers -#define MP_IMGTYPE_IPB 4 - #define MP_MAX_PLANES 4 #define MP_IMGFIELD_ORDERED 0x01 @@ -76,35 +56,38 @@ #define MP_IMGFIELD_INTERLACED 0x20 #include <stdlib.h> +#include <limits.h> +#define XP_IDX_INVALID UINT_MAX typedef struct mp_image_s { - unsigned int flags; - unsigned char type; - unsigned char bpp; // bits/pixel. NOT depth! for RGB it will be n*8 - unsigned int imgfmt; - int width,height; // stored dimensions - int x,y,w,h; // slice dimensions - unsigned char* planes[MP_MAX_PLANES]; - unsigned int stride[MP_MAX_PLANES]; - char * qscale; - int qstride; - int pict_type; // 0->unknown, 1->I, 2->P, 3->B - int fields; - int qscale_type; // 0->mpeg1/4/h263, 1->mpeg2 - int num_planes; + unsigned xp_idx; /* index of xp_frame associated with this image */ + unsigned int flags; + unsigned char type; + unsigned char bpp; // bits/pixel. NOT depth! for RGB it will be n*8 + unsigned int imgfmt; + unsigned width,height; // stored dimensions + int x,y,w,h; // slice dimensions + unsigned num_planes; + unsigned char* planes[MP_MAX_PLANES]; + unsigned int stride[MP_MAX_PLANES]; + char * qscale; + unsigned qstride; + unsigned qscale_type; // 0->mpeg1/4/h263, 1->mpeg2 + unsigned pict_type; // 0->unknown, 1->I, 2->P, 3->B + unsigned fields; /* these are only used by planar formats Y,U(Cb),V(Cr) */ - int chroma_width; - int chroma_height; - int chroma_x_shift; // horizontal - int chroma_y_shift; // vertical - /* for private use by filter or vo driver (to store buffer id or dmpi) */ - void* priv; + int chroma_width; + int chroma_height; + int chroma_x_shift; // horizontal + int chroma_y_shift; // vertical + void* priv; /* for private use by filter or vo driver (to store buffer id or dmpi) */ } mp_image_t; extern void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt); -extern mp_image_t* new_mp_image(int w,int h); +extern mp_image_t* new_mp_image(unsigned w,unsigned h,unsigned xp_idx); extern void free_mp_image(mp_image_t* mpi); -extern mp_image_t* alloc_mpi(int w, int h, unsigned int fmt); +extern mp_image_t* alloc_mpi(unsigned w, unsigned h, unsigned int fmt,unsigned xp_idx); +extern void mpi_alloc_planes(mp_image_t *mpi); extern void copy_mpi(mp_image_t *dmpi,const mp_image_t *mpi); extern void mpi_fake_slice(mp_image_t *dmpi,const mp_image_t *mpi,unsigned y,unsigned height); Modified: mplayerxp/postproc/vf.c =================================================================== --- mplayerxp/postproc/vf.c 2010-01-21 18:27:56 UTC (rev 117) +++ mplayerxp/postproc/vf.c 2010-01-22 15:41:46 UTC (rev 118) @@ -151,34 +151,36 @@ mp_image_t* __FASTCALL__ vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h){ mp_image_t* mpi=NULL; int w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?((w+15)&(~15)):w; + unsigned xp_idx=XP_IDX_INVALID; + MSG_DBG2("vf_get_image(%s,0x%X,0x%X,0x%X,0x%X,0x%X) was called\n",vf->info->name,outfmt,mp_imgtype,mp_imgflag,w,h); if(vf->put_slice==vf_next_put_slice){ - // passthru mode, if the plugin uses the fallback/default put_image() code + MSG_DBG2("passthru mode to %s\n",vf->next->info->name); return vf_get_image(vf->next,outfmt,mp_imgtype,mp_imgflag,w,h); } // Note: we should call libvo first to check if it supports direct rendering // and if not, then fallback to software buffers: switch(mp_imgtype){ case MP_IMGTYPE_EXPORT: - if(!vf->imgctx.export_images[0]) vf->imgctx.export_images[0]=new_mp_image(w2,h); + if(!vf->imgctx.export_images[0]) vf->imgctx.export_images[0]=new_mp_image(w2,h,xp_idx); mpi=vf->imgctx.export_images[0]; break; case MP_IMGTYPE_STATIC: - if(!vf->imgctx.static_images[0]) vf->imgctx.static_images[0]=new_mp_image(w2,h); + if(!vf->imgctx.static_images[0]) vf->imgctx.static_images[0]=new_mp_image(w2,h,xp_idx); mpi=vf->imgctx.static_images[0]; break; case MP_IMGTYPE_TEMP: - if(!vf->imgctx.temp_images[0]) vf->imgctx.temp_images[0]=new_mp_image(w2,h); + if(!vf->imgctx.temp_images[0]) vf->imgctx.temp_images[0]=new_mp_image(w2,h,xp_idx); mpi=vf->imgctx.temp_images[0]; break; case MP_IMGTYPE_IPB: if(!(mp_imgflag&MP_IMGFLAG_READABLE)){ // B frame: - if(!vf->imgctx.temp_images[0]) vf->imgctx.temp_images[0]=new_mp_image(w2,h); + if(!vf->imgctx.temp_images[0]) vf->imgctx.temp_images[0]=new_mp_image(w2,h,xp_idx); mpi=vf->imgctx.temp_images[0]; break; } case MP_IMGTYPE_IP: - if(!vf->imgctx.static_images[vf->imgctx.static_idx]) vf->imgctx.static_images[vf->imgctx.static_idx]=new_mp_image(w2,h); + if(!vf->imgctx.static_images[vf->imgctx.static_idx]) vf->imgctx.static_images[vf->imgctx.static_idx]=new_mp_image(w2,h,xp_idx); mpi=vf->imgctx.static_images[vf->imgctx.static_idx]; vf->imgctx.static_idx^=1; break; @@ -190,23 +192,26 @@ mpi->flags&=MP_IMGFLAG_ALLOCATED|MP_IMGFLAG_TYPE_DISPLAYED|MP_IMGFLAGMASK_COLORS; // accept restrictions & draw_slice flags only: mpi->flags|=mp_imgflag&(MP_IMGFLAGMASK_RESTRICTIONS|MP_IMGFLAG_DRAW_CALLBACK); + MSG_DBG2("vf_get_image fills mpi structure. flags=0x%X\n",mpi->flags); if(mpi->width!=w2 || mpi->height!=h){ if(mpi->flags&MP_IMGFLAG_ALLOCATED){ if(mpi->width<w2 || mpi->height<h){ // need to re-allocate buffer memory: free(mpi->planes[0]); mpi->flags&=~MP_IMGFLAG_ALLOCATED; - MSG_V("vf.c: have to REALLOCATE buffer memory :(\n"); + MSG_DBG2("vf.c: have to REALLOCATE buffer memory :(\n"); } } mpi->width=w2; mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift; mpi->height=h; mpi->chroma_height=(h + (1<<mpi->chroma_y_shift) - 1)>>mpi->chroma_y_shift; } if(!mpi->bpp) mp_image_setfmt(mpi,outfmt); + MSG_DBG2("vf_get_image setfmt. flags=0x%X\n",mpi->flags); if(!(mpi->flags&MP_IMGFLAG_ALLOCATED) && mpi->type>MP_IMGTYPE_EXPORT){ // check libvo first! if(vf->get_image) vf->get_image(vf,mpi); + MSG_DBG2("[vf->get_image] returns xp_idx=%u\n",mpi->xp_idx); if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ // non-direct and not yet allocated image. allocate it! @@ -228,35 +233,16 @@ } } } - - // IF09 - allocate space for 4. plane delta info - unused - if (mpi->imgfmt == IMGFMT_IF09) - { - mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8+ - mpi->chroma_width*mpi->chroma_height); - /* export delta table */ - mpi->planes[3]=mpi->planes[0]+(mpi->width*mpi->height)+2*(mpi->chroma_width*mpi->chroma_height); - } - else - mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); - if(mpi->flags&MP_IMGFLAG_PLANAR){ - // YV12/I420/YVU9/IF09. feel free to add other planar formats here... - //if(!mpi->stride[0]) - mpi->stride[0]=mpi->width; - //if(!mpi->stride[1]) - mpi->stride[1]=mpi->stride[2]=mpi->chroma_width; - // YV12,I420/IYUV,YVU9,IF09 (Y,V,U) - mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height; - mpi->planes[1]=mpi->planes[2]+mpi->chroma_width*mpi->chroma_height; - } else { - //if(!mpi->stride[0]) - mpi->stride[0]=mpi->width*mpi->bpp/8; - } + + mpi_alloc_planes(mpi); // printf("clearing img!\n"); - vf_mpi_clear(mpi,0,0,mpi->width,mpi->height); - mpi->flags|=MP_IMGFLAG_ALLOCATED; +// vf_mpi_clear(mpi,0,0,mpi->width,mpi->height); } } + else { + MSG_DBG2("vf_get_image forces xp_idx retrieving\n"); + vo_get_decoding_frame_num(&mpi->xp_idx); + } if(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK) if(vf->start_slice) vf->start_slice(vf,mpi); if(!(mpi->flags&MP_IMGFLAG_TYPE_DISPLAYED)){ @@ -277,6 +263,7 @@ } } + MSG_DBG2("vf_get_image returns xp_idx=%i\n",mpi->xp_idx); return mpi; } Modified: mplayerxp/postproc/vf_menu.c =================================================================== --- mplayerxp/postproc/vf_menu.c 2010-01-21 18:27:56 UTC (rev 117) +++ mplayerxp/postproc/vf_menu.c 2010-01-22 15:41:46 UTC (rev 118) @@ -172,7 +172,7 @@ pause_mpi = NULL; } if(!pause_mpi) - pause_mpi = alloc_mpi(mpi->w,mpi->h,mpi->imgfmt); + pause_mpi = alloc_mpi(mpi->w,mpi->h,mpi->imgfmt,XP_IDX_INVALID); copy_mpi(pause_mpi,mpi); mp_input_queue_cmd(mp_input_parse_cmd("pause")); go2pause = 2; Modified: mplayerxp/postproc/vf_vo.c =================================================================== --- mplayerxp/postproc/vf_vo.c 2010-01-21 18:27:56 UTC (rev 117) +++ mplayerxp/postproc/vf_vo.c 2010-01-22 15:41:46 UTC (rev 118) @@ -135,7 +135,7 @@ if(!vo_config_count) return 0; // vo not configured? if(!(mpi->flags & MP_IMGFLAG_FINAL) || (vf->sh->vfilter==vf && !(mpi->flags & MP_IMGFLAG_RENDERED))) { - MSG_DBG2("vf_vo_draw_slice was called %u %u %u %u\n",mpi->x,mpi->y,mpi->w,mpi->h); + MSG_DBG2("vf_vo_put_slice was called(%u): %u %u %u %u\n",mpi->xp_idx,mpi->x,mpi->y,mpi->w,mpi->h); vo_draw_slice(mpi); } return 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-22 16:43:43
|
Revision: 119 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=119&view=rev Author: nickols_k Date: 2010-01-22 16:43:32 +0000 (Fri, 22 Jan 2010) Log Message: ----------- minor fixes Modified Paths: -------------- NEWS mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/postproc/vf_scale.c Modified: NEWS =================================================================== --- NEWS 2010-01-22 15:41:46 UTC (rev 118) +++ NEWS 2010-01-22 16:43:32 UTC (rev 119) @@ -2,6 +2,8 @@ Version 0.8 +* significand acceleration of playback. Now it can scale 640x480->2000x1500 at 25 FPS in real-time without + framedropping with using of non-accelerated '-vo x11' driver on Quad-Core AMD Phenom-9550 running at 2.2GHz * project migrated from CVS on SVN * Redesigned internal architecture of the player (now it being building statically with all internal libs) * new configure script Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2010-01-22 15:41:46 UTC (rev 118) +++ mplayerxp/libmpcodecs/vd.c 2010-01-22 16:43:32 UTC (rev 119) @@ -274,7 +274,7 @@ mp_image_t* mpi=vf_get_image(sh->vfilter,sh->codec->outfmt[sh->outfmtidx],mp_imgtype,mp_imgflag,w,h); mpi->x=mpi->y=0; if(mpi->xp_idx==XP_IDX_INVALID) - MSG_WARN("[mpcodecs_get_image] Incorrect mpi->xp_idx. Be ready for segfault!\n"); + MSG_V("[mpcodecs_get_image] Incorrect mpi->xp_idx. Be ready for segfault!\n"); return mpi; } Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-22 15:41:46 UTC (rev 118) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-22 16:43:32 UTC (rev 119) @@ -97,6 +97,7 @@ int ip_count; int b_count; int vo_inited; + int hello_printed; }priv_t; static pp_context_t* ppContext=NULL; static void draw_slice(struct AVCodecContext *s, @@ -372,8 +373,6 @@ avcodec_thread_init(vdff_ctx->ctx, lavc_param_threads); MSG_STATUS("Using %i threads in FFMPEG\n",lavc_param_threads); } - if(vdff_ctx->cap_slices) - MSG_STATUS("Trying to use slice-based rendering in FFMPEG\n"); /* open it */ rc = avcodec_open(vdff_ctx->ctx, vdff_ctx->lavc_codec); if (rc < 0) { @@ -680,10 +679,14 @@ 1; mpi= mpcodecs_get_image(sh,has_b_frames?MP_IMGTYPE_IPB:MP_IMGTYPE_IP,MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE|MP_IMGFLAG_READABLE|MP_IMGFLAG_PRESERVE, 16,16); - if(!(vdff_ctx->cap_dr1 && + if(vdff_ctx->cap_dr1 && vdff_ctx->lavc_codec->id != CODEC_ID_H264 && - vdff_ctx->use_slices && mpi->flags&MP_IMGFLAG_DIRECT && !has_b_frames)) - vdff_ctx->use_slices=0; + vdff_ctx->use_slices && mpi->flags&MP_IMGFLAG_DIRECT) + vdff_ctx->use_dr1=1; + if(has_b_frames) { + MSG_V("Disable slice-based rendering in FFMPEG due possible B-frames in video-stream\n"); + vdff_ctx->use_slices=0; + } if(vdff_ctx->use_slices) vdff_ctx->use_dr1=0; if( sh->format == mmioFOURCC('R', 'V', '1', '0') || sh->format == mmioFOURCC('R', 'V', '1', '3') @@ -722,6 +725,14 @@ vdff_ctx->ctx->draw_horiz_band=draw_slice; } else vdff_ctx->ctx->draw_horiz_band=NULL; /* skip draw_slice on framedropping */ + if(!vdff_ctx->hello_printed) { + if(vdff_ctx->use_slices) + MSG_STATUS("Use slice-based rendering in FFMPEG\n"); + else if (vdff_ctx->use_dr1) + MSG_STATUS("Use DR1 rendering in FFMPEG\n"); + else + vdff_ctx->hello_printed=1; + } ret = avcodec_decode_video(vdff_ctx->ctx, vdff_ctx->lavc_picture, &got_picture, data, len); if(ret<0) MSG_WARN("Error while decoding frame!\n"); Modified: mplayerxp/postproc/vf_scale.c =================================================================== --- mplayerxp/postproc/vf_scale.c 2010-01-22 15:41:46 UTC (rev 118) +++ mplayerxp/postproc/vf_scale.c 2010-01-22 16:43:32 UTC (rev 119) @@ -330,24 +330,17 @@ static int __FASTCALL__ put_frame(struct vf_instance_s* vf, mp_image_t *mpi){ mp_image_t *dmpi;//=mpi->priv; - uint8_t *planes[3]; - int stride[3]; + uint8_t *planes[4]; + int stride[4]; planes[0]=mpi->planes[0]; stride[0]=mpi->stride[0]; if(mpi->flags&MP_IMGFLAG_PLANAR){ - if(mpi->flags&MP_IMGFLAG_SWAPPED){ - // I420/IYUV (Y,U,V) - planes[1]=mpi->planes[2]; - planes[2]=mpi->planes[1]; - stride[1]=mpi->stride[2]; - stride[2]=mpi->stride[1]; - } else { - // YV12,YVU9,IF09 (Y,V,U) planes[1]=mpi->planes[1]; planes[2]=mpi->planes[2]; + planes[3]=mpi->planes[3]; stride[1]=mpi->stride[1]; stride[2]=mpi->stride[2]; - } + stride[3]=mpi->stride[3]; } MSG_DBG2("vf_scale.put_frame was called\n"); dmpi=vf_get_image(vf->next,vf->priv->fmt, @@ -359,24 +352,17 @@ static int __FASTCALL__ put_slice(struct vf_instance_s* vf, mp_image_t *mpi){ mp_image_t *dmpi;//=mpi->priv; - uint8_t *planes[3],*dplanes[3]; - int stride[3],newy,newh; + uint8_t *planes[4],*dplanes[4]; + int stride[4],newy,newh; planes[0]=mpi->planes[0]; stride[0]=mpi->stride[0]; if(mpi->flags&MP_IMGFLAG_PLANAR){ - if(mpi->flags&MP_IMGFLAG_SWAPPED){ - // I420/IYUV (Y,U,V) - planes[1]=mpi->planes[2]; - planes[2]=mpi->planes[1]; - stride[1]=mpi->stride[2]; - stride[2]=mpi->stride[1]; - } else { - // YV12,YVU9,IF09 (Y,V,U) planes[1]=mpi->planes[1]; planes[2]=mpi->planes[2]; + planes[3]=mpi->planes[3]; stride[1]=mpi->stride[1]; stride[2]=mpi->stride[2]; - } + stride[3]=mpi->stride[3]; } MSG_DBG2("vf_scale.put_slice was called[%i %i]\n",mpi->y, mpi->h); dmpi=vf_get_image(vf->next,vf->priv->fmt, @@ -387,14 +373,17 @@ if(mpi->flags&MP_IMGFLAG_PLANAR) { dplanes[1] = dmpi->planes[1]; dplanes[2] = dmpi->planes[2]; + dplanes[3] = dmpi->planes[3]; } planes[0] += mpi->y*mpi->stride[0]; dplanes[0] += mpi->y*dmpi->stride[0]; if(mpi->flags&MP_IMGFLAG_PLANAR){ planes[1] += (mpi->y>>mpi->chroma_y_shift)*mpi->stride[1]; planes[2] += (mpi->y>>mpi->chroma_y_shift)*mpi->stride[2]; + planes[3] += (mpi->y>>mpi->chroma_y_shift)*mpi->stride[3]; dplanes[1]+= (mpi->y>>dmpi->chroma_y_shift)*dmpi->stride[0]; - dplanes[1]+= (mpi->y>>dmpi->chroma_y_shift)*dmpi->stride[0]; + dplanes[2]+= (mpi->y>>dmpi->chroma_y_shift)*dmpi->stride[1]; + dplanes[3]+= (mpi->y>>dmpi->chroma_y_shift)*dmpi->stride[2]; } scale(vf->priv->ctx, vf->priv->ctx2, planes, stride, 0, mpi->h, dplanes, dmpi->stride, vf->priv->interlaced); dmpi->y = mpi->y; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-23 17:56:47
|
Revision: 121 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=121&view=rev Author: nickols_k Date: 2010-01-23 17:56:40 +0000 (Sat, 23 Jan 2010) Log Message: ----------- sign correctness and minor cleanups Modified Paths: -------------- mplayerxp/dec_ahead.c mplayerxp/libao2/ao_alsa9.c mplayerxp/libao2/ao_arts.c mplayerxp/libao2/ao_esd.c mplayerxp/libao2/ao_jack.c mplayerxp/libao2/ao_nas.c mplayerxp/libao2/ao_null.c mplayerxp/libao2/ao_openal.c mplayerxp/libao2/ao_oss.c mplayerxp/libao2/ao_sdl.c mplayerxp/libao2/ao_wav.c mplayerxp/libao2/audio_out.c mplayerxp/libao2/audio_out.h mplayerxp/libao2/audio_out_internal.h mplayerxp/libmpcodecs/ad.h mplayerxp/libmpcodecs/ad_a52.c mplayerxp/libmpcodecs/ad_acm.c mplayerxp/libmpcodecs/ad_dca.c mplayerxp/libmpcodecs/ad_dmo.c mplayerxp/libmpcodecs/ad_dshow.c mplayerxp/libmpcodecs/ad_dvdpcm.c mplayerxp/libmpcodecs/ad_faad.c mplayerxp/libmpcodecs/ad_ffmp3.c mplayerxp/libmpcodecs/ad_hwac3.c mplayerxp/libmpcodecs/ad_internal.h mplayerxp/libmpcodecs/ad_libdv.c mplayerxp/libmpcodecs/ad_mp3.c mplayerxp/libmpcodecs/ad_null.c mplayerxp/libmpcodecs/ad_pcm.c mplayerxp/libmpcodecs/ad_qtaudio.c mplayerxp/libmpcodecs/ad_real.c mplayerxp/libmpcodecs/ad_twin.c mplayerxp/libmpcodecs/ad_vorbis.c mplayerxp/libmpcodecs/dec_audio.c mplayerxp/libmpcodecs/dec_audio.h mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpdemux/demux_avi.c mplayerxp/libmpdemux/demux_mov.c mplayerxp/libmpdemux/demux_mpg.c mplayerxp/libvo/font_load.c mplayerxp/mplayer.c mplayerxp/osdep/timer-lx.c mplayerxp/sig_hand.c Modified: mplayerxp/dec_ahead.c =================================================================== --- mplayerxp/dec_ahead.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/dec_ahead.c 2010-01-23 17:56:40 UTC (rev 121) @@ -110,9 +110,9 @@ extern int init_audio_buffer(int size, int min_reserv, int indices, sh_audio_t *sh_audio); extern void uninit_audio_buffer(void); -extern int read_audio_buffer(sh_audio_t *audio, unsigned char *buffer, int minlen, int maxlen ); +extern int read_audio_buffer(sh_audio_t *audio, unsigned char *buffer, unsigned minlen, unsigned maxlen ); extern float get_delay_audio_buffer(void); -extern int decode_audio_buffer(int len); +extern int decode_audio_buffer(unsigned len); extern void reset_audio_buffer(void); extern int get_len_audio_buffer(void); extern int get_free_audio_buffer(void); @@ -203,7 +203,7 @@ UNLOCK_VDEC_LOCKED(); UNLOCK_VDEC_ACTIVE(); if(xp_is_bad_pts) mpeg_timer=HUGE; - dec_ahead_in_lseek=NoSeek; + dec_ahead_in_lseek=NoSeek; MSG_T("\nDEC_AHEAD: reset counters to (%u %u) due lseek\n",dec_ahead_locked_frame,abs_dec_ahead_locked_frame); pinfo[xp_id].current_module = "dec_ahead 3"; } @@ -233,14 +233,14 @@ xp_eof=0; continue; } - break; + break; } /* in_size==0: it's or broken stream or demuxer's bug */ if(in_size==0 && !pthread_end_of_work) { dec_ahead_in_lseek=NoSeek; continue; } - if(xp_is_bad_pts) + if(xp_is_bad_pts) { if(mpeg_timer==HUGE)mpeg_timer=v_pts; else if( mpeg_timer-duration<v_pts ) { @@ -348,11 +348,11 @@ if(dec_ahead_in_lseek!=NoSeek) continue; LOCK_VDECODING(); if(dec_ahead_in_lseek!=NoSeek) { - UNLOCK_VDECODING(); - continue; - } + UNLOCK_VDECODING(); + continue; + } #if 0 -/* +/* We can't seriously examine question of too slow machines by motivation reasons */ @@ -636,11 +636,11 @@ { int retval; retval = pthread_attr_setdetachstate(&our_attr,PTHREAD_CREATE_DETACHED); - if(retval) + if(retval) { if(verbose) printf("running thread: attr_setdetachstate fault!!!\n"); return retval; - } + } pthread_attr_setscope(&our_attr,PTHREAD_SCOPE_SYSTEM); if( has_xp_audio && enable_xp >= XP_VAPlay ) { @@ -648,7 +648,7 @@ if(retval) { if(verbose) printf("running audio thread: attr_setdetachstate fault!!!\n"); return retval; - } + } pthread_attr_setscope(&audio_attr,PTHREAD_SCOPE_SYSTEM); } @@ -749,26 +749,27 @@ volatile float dec_ahead_audio_delay; int xp_thread_decode_audio() { - int free_buf, len=0, vbuf_size, pref_buf; + int free_buf, vbuf_size, pref_buf; + unsigned len=0; if(dec_ahead_in_lseek) { xp_audio_eof = 0; reset_audio_buffer(); decode_audio_buffer(MAX_OUTBURST); return 1; - } + } free_buf = get_free_audio_buffer(); - + if( free_buf == -1 ) { /* End of file */ xp_audio_eof = 1; return 0; } - if( free_buf < sh_audio->audio_out_minsize ) /* full */ + if( free_buf < (int)sh_audio->audio_out_minsize ) /* full */ return 0; len = get_len_audio_buffer(); - + if( len < MAX_OUTBURST ) /* Buffer underrun */ return decode_audio_buffer(MAX_OUTBURST); Modified: mplayerxp/libao2/ao_alsa9.c =================================================================== --- mplayerxp/libao2/ao_alsa9.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/ao_alsa9.c 2010-01-23 17:56:40 UTC (rev 121) @@ -2,11 +2,11 @@ ao_alsa9 - ALSA-0.9.x output plugin for MPlayer (C) Alex Beregszaszi <al...@na...> - + modified for real alsa-0.9.0-support by Joy Winter <jo...@pi...> additional AC3 passthrough support by Andy Lo A Foe <an...@al...> 08/22/2002 iec958-init rewritten and merged with common init, joy - + Any bugreports regarding to this driver are welcome. */ @@ -51,8 +51,8 @@ /* 16 sets buffersize to 16 * chunksize is as default 1024 * which seems to be good avarge for most situations * so buffersize is 16384 frames by default */ -static int alsa_fragcount = 16; -static int chunk_size = 1024; //is alsa_fragsize / 4 +static unsigned alsa_fragcount = 16; +static unsigned chunk_size = 1024; //is alsa_fragsize / 4 #define MIN_CHUNK_SIZE 1024 @@ -276,7 +276,7 @@ } } #endif - + } //end witch return(CONTROL_UNKNOWN); } @@ -353,17 +353,18 @@ open & setup audio device return: 1=success 0=fail */ -static int __FASTCALL__ init(int flags) +static int __FASTCALL__ init(unsigned flags) { int err; int cards = -1; - int period_val; + unsigned period_val; snd_pcm_info_t *alsa_info; char *str_block_mode; char *alsa_dev=NULL; char *alsa_port=NULL; char alsa_device[ALSA_DEVICE_SIZE]; + UNUSED(flags); alsa_handler = NULL; alsa_device[0]='\0'; @@ -504,7 +505,7 @@ MSG_ERR("alsa-init: error set block-mode %s\n", snd_strerror(err)); } else MSG_V("alsa-init: pcm opend in %s\n", str_block_mode); - + snd_pcm_hw_params_malloc(&alsa_hwparams); snd_pcm_sw_params_malloc(&alsa_swparams); @@ -558,7 +559,7 @@ //set period_count snd_pcm_hw_params_get_periods_max(alsa_hwparams,&period_val, 0); if (period_val < alsa_fragcount) { - alsa_fragcount = period_val; + alsa_fragcount = period_val; } MSG_V("alsa-init: current val=%i, fragcount=%i\n", period_val, alsa_fragcount); @@ -574,9 +575,10 @@ return 1; } // end init -static int __FASTCALL__ configure(int rate_hz, int channels, int format) +static int __FASTCALL__ configure(unsigned rate_hz, unsigned channels, unsigned format) { - int err,i; + int err; + unsigned i; snd_pcm_uframes_t dummy; MSG_V("alsa-conf: requested format: %d Hz, %d channels, %s\n", rate_hz, @@ -623,13 +625,13 @@ bytes_per_sample = ao_data.bps / ao_data.samplerate; if ((err = snd_pcm_hw_params_set_format(alsa_handler, alsa_hwparams, - alsa_format)) < 0) + alsa_format)) < 0) { MSG_ERR("alsa-conf: unable to set format(%s): %s\n", snd_pcm_format_name(alsa_format), snd_strerror(err)); MSG_HINT("Please try one of: "); - for(i=0;i<SND_PCM_FORMAT_LAST;i++) + for(i=0;i<SND_PCM_FORMAT_LAST;i++) if (!(snd_pcm_hw_params_test_format(alsa_handler, alsa_hwparams, i))) MSG_HINT("%s ",snd_pcm_format_name(i)); MSG_HINT("\n"); @@ -805,9 +807,10 @@ thanxs for marius <ma...@ro...> for giving us the light ;) */ -static int __FASTCALL__ play(void* data, int len, int flags) +static unsigned __FASTCALL__ play(void* data, unsigned len, unsigned flags) { - int num_frames; + unsigned num_frames; + UNUSED(flags); snd_pcm_sframes_t res = 0; len = len / ao_data.outburst * ao_data.outburst; num_frames = len / bytes_per_sample; @@ -844,20 +847,21 @@ } } while (res == 0); - return res < 0 ? res : res * bytes_per_sample; + return res * bytes_per_sample; } /* how many byes are free in the buffer */ -static int get_space(void) +static unsigned get_space(void) { snd_pcm_status_t *status; - int ret; + unsigned ret; + int err; snd_pcm_status_alloca(&status); - if ((ret = snd_pcm_status(alsa_handler, status)) < 0) + if ((err = snd_pcm_status(alsa_handler, status)) < 0) { - MSG_ERR("ao_alsa: cannot get PCM status: %s\n", snd_strerror(ret)); + MSG_ERR("ao_alsa: cannot get PCM status: %s\n", snd_strerror(err)); return 0; } Modified: mplayerxp/libao2/ao_arts.c =================================================================== --- mplayerxp/libao2/ao_arts.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/ao_arts.c 2010-01-23 17:56:40 UTC (rev 121) @@ -48,13 +48,15 @@ static int control(int cmd, long arg) { + UNUSED(cmd); + UNUSED(arg); return CONTROL_UNKNOWN; } -static int init(int flags) +static int init(unsigned flags) { int err; - int frag_spec; + UNUSED(flags); if( (err=arts_init()) ) { MSG_ERR("[aRts] init failed: %s\n", arts_error_text(err)); @@ -65,9 +67,9 @@ return 1; } -static int __FASTCALL__ configure(int rate,int channels,int format) +static int __FASTCALL__ configure(unsigned rate,unsigned channels,unsigned format) { - int frag_spec,samplesize; + unsigned frag_spec,samplesize; /* * arts supports 8bit unsigned and 16bit signed sample formats * (16bit apparently in little endian format, even in the case @@ -137,9 +139,10 @@ arts_free(); } -static int play(void* data,int len,int flags) +static unsigned play(void* data,unsigned len,unsigned flags) { - return arts_write(stream, data, len); + UNUSED(flags); + return arts_write(stream, data, len); } static void audio_pause(void) @@ -154,7 +157,7 @@ { } -static int get_space(void) +static unsigned get_space(void) { return arts_stream_get(stream, ARTS_P_BUFFER_SPACE); } Modified: mplayerxp/libao2/ao_esd.c =================================================================== --- mplayerxp/libao2/ao_esd.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/ao_esd.c 2010-01-23 17:56:40 UTC (rev 121) @@ -156,9 +156,10 @@ * open & setup audio device * return: 1=success 0=fail */ -static int init(int flags) +static int init(unsigned flags) { char *server = ao_subdevice; /* NULL for localhost */ + UNUSED(flags); if (esd_fd < 0) { esd_fd = esd_open_sound(server); if (esd_fd < 0) { @@ -166,9 +167,10 @@ return 0; } } + return 1; } -static int configure(int rate_hz, int channels, int format) +static int configure(unsigned rate_hz,unsigned channels,unsigned format) { char *server = ao_subdevice; /* NULL for localhost */ esd_format_t esd_fmt; @@ -310,17 +312,15 @@ * it should round it down to outburst*n * return: number of bytes played */ -static int play(void* data, int len, int flags) +static unsigned play(void* data, unsigned len, unsigned flags) { - int offs; - int nwritten; + unsigned offs; + unsigned nwritten; int nsamples; int n; - + UNUSED(flags); /* round down buffersize to a multiple of ESD_BUF_SIZE bytes */ len = len / ESD_BUF_SIZE * ESD_BUF_SIZE; - if (len <= 0) - return 0; #define SINGLE_WRITE 0 #if SINGLE_WRITE @@ -333,8 +333,9 @@ */ n = write(esd_play_fd, (char*)data + offs, ESD_BUF_SIZE); if ( n < 0 ) { - if ( errno != EAGAIN ) + if ( errno != EAGAIN ) { dprintf("esd play: write failed: %s\n", strerror(errno)); + } break; } else if ( n != ESD_BUF_SIZE ) { nwritten += n; @@ -404,12 +405,12 @@ /* * return: how many bytes can be played without blocking */ -static int get_space(void) +static unsigned get_space(void) { struct timeval tmout; fd_set wfds; float current_delay; - int space; + unsigned space; /* * Don't buffer too much data in the esd daemon. Modified: mplayerxp/libao2/ao_jack.c =================================================================== --- mplayerxp/libao2/ao_jack.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/ao_jack.c 2010-01-23 17:56:40 UTC (rev 121) @@ -51,7 +51,7 @@ //! maximum number of channels supported, avoids lots of mallocs #define MAX_CHANS 6 static jack_port_t *ports[MAX_CHANS]; -static int num_ports; ///< Number of used ports == number of channels +static unsigned num_ports; ///< Number of used ports == number of channels static jack_client_t *client; static float jack_latency; static int estimate; @@ -121,9 +121,9 @@ * If there is not enough data in the buffer remaining parts will be filled * with silence. */ -static int read_buffer(float **bufs, int cnt, int num_bufs) { +static unsigned read_buffer(float **bufs, unsigned cnt, unsigned num_bufs) { struct deinterleave di = {bufs, num_bufs, 0, 0}; - int buffered = cb_fifo_size(buffer); + unsigned buffered = cb_fifo_size(buffer); if (cnt * sizeof(float) * num_bufs > buffered) { silence(bufs, cnt, num_bufs); cnt = buffered / sizeof(float) / num_bufs; @@ -135,6 +135,8 @@ // end ring buffer stuff static int control(int cmd, long arg) { + UNUSED(cmd); + UNUSED(arg); return CONTROL_UNKNOWN; } @@ -160,7 +162,8 @@ */ static int outputaudio(jack_nframes_t nframes, void *arg) { float *bufs[MAX_CHANS]; - int i; + unsigned i; + UNUSED(arg); for (i = 0; i < num_ports; i++) bufs[i] = jack_port_get_buffer(ports[i], nframes); if (paused || underrun) @@ -180,6 +183,7 @@ return 0; } +#if 0 /** * \brief print suboption usage help */ @@ -200,10 +204,10 @@ " Automatically start JACK server if necessary\n" ); } +#endif +static int init(unsigned flags) { UNUSED(flags); return 1; } -static int init(int flags) { return 1; } - -static int configure(int rate, int channels, int format) { +static int configure(unsigned rate,unsigned channels,unsigned format) { const char **matching_ports = NULL; char *port_name = NULL; char *client_name = NULL; @@ -219,8 +223,9 @@ */ jack_options_t open_options = JackUseExactName; int port_flags = JackPortIsInput; - int i; + unsigned i; estimate = 1; + UNUSED(format); /* if (subopt_parse(ao_subdevice, subopts) != 0) { print_help(); @@ -338,15 +343,16 @@ paused = 0; } -static int get_space(void) { +static unsigned get_space(void) { return cb_fifo_space(buffer); } /** * \brief write data into buffer and reset underrun flag */ -static int play(void *data, int len, int flags) { +static unsigned play(void *data, unsigned len, unsigned flags) { underrun = 0; + UNUSED(flags); return write_buffer(data, len); } Modified: mplayerxp/libao2/ao_nas.c =================================================================== --- mplayerxp/libao2/ao_nas.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/ao_nas.c 2010-01-23 17:56:40 UTC (rev 121) @@ -413,20 +413,21 @@ } -static int init(int flags) +static int init(unsigned flags) { + UNUSED(flags); return 1; } // open & setup audio device // return: 1=success 0=fail -static int configure(int rate,int channels,int format) +static int configure(unsigned rate,unsigned channels,unsigned format) { AuElement elms[3]; AuStatus as; char str[256]; unsigned char auformat = nas_aformat_to_auformat(&format); - int bytes_per_sample = channels * AuSizeofFormat(auformat); - int buffer_size; + unsigned bytes_per_sample = channels * AuSizeofFormat(auformat); + unsigned buffer_size; char *server; nas_data=malloc(sizeof(struct ao_nas_data)); @@ -574,9 +575,9 @@ // return: how many bytes can be played without blocking -static int get_space(void) +static unsigned get_space(void) { - int result; + unsigned result; MSG_DBG3("ao_nas: get_space()\n"); @@ -590,11 +591,11 @@ // plays 'len' bytes of 'data' // it should round it down to outburst*n // return: number of bytes played -static int play(void* data,int len,int flags) +static unsigned play(void* data,unsigned len,unsigned flags) { - int written, maxbursts = 0, playbursts = 0; + unsigned written, maxbursts = 0, playbursts = 0; AuStatus as; - + UNUSED(flags); MSG_DBG3( "ao_nas: play(%p, %d, %d)\n", data, len, flags); Modified: mplayerxp/libao2/ao_null.c =================================================================== --- mplayerxp/libao2/ao_null.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/ao_null.c 2010-01-23 17:56:40 UTC (rev 121) @@ -94,13 +94,16 @@ // to set/get/query special features/parameters static int __FASTCALL__ control(int cmd,long arg){ + UNUSED(cmd); + UNUSED(arg); return CONTROL_TRUE; } // open & setup audio device // return: 1=success 0=fail -static int __FASTCALL__ init(int flags){ +static int __FASTCALL__ init(unsigned flags){ char *null_dev=NULL,*mode=NULL; + UNUSED(flags); if (ao_subdevice) { mrl_parse_line(ao_subdevice,NULL,NULL,&null_dev,&mode); fd=NULL; @@ -111,8 +114,8 @@ return 1; } -static int __FASTCALL__ configure(int rate,int channels,int format){ - int bits; +static int __FASTCALL__ configure(unsigned rate,unsigned channels,unsigned format){ + unsigned bits; ao_data.buffersize= 0xFFFFF; ao_data.outburst=0xFFFF;//4096; ao_data.channels=channels; @@ -145,7 +148,7 @@ ao_data.bps *= 3; break; default: - break; + break; } buffer=0; gettimeofday(&last_tv, 0); @@ -194,7 +197,7 @@ } // return: how many bytes can be played without blocking -static int get_space(void){ +static unsigned get_space(void){ drain(); return fast_mode?INT_MAX:ao_data.outburst - buffer; @@ -203,12 +206,11 @@ // plays 'len' bytes of 'data' // it should round it down to outburst*n // return: number of bytes played -static int __FASTCALL__ play(void* data,int len,int flags){ - - - int maxbursts = (ao_data.buffersize - buffer) / ao_data.outburst; - int playbursts = len / ao_data.outburst; - int bursts = playbursts > maxbursts ? maxbursts : playbursts; +static unsigned __FASTCALL__ play(void* data,unsigned len,unsigned flags) +{ + unsigned maxbursts = (ao_data.buffersize - buffer) / ao_data.outburst; + unsigned playbursts = len / ao_data.outburst; + unsigned bursts = playbursts > maxbursts ? maxbursts : playbursts; buffer += bursts * ao_data.outburst; if(fd && len) Modified: mplayerxp/libao2/ao_openal.c =================================================================== --- mplayerxp/libao2/ao_openal.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/ao_openal.c 2010-01-23 17:56:40 UTC (rev 121) @@ -75,6 +75,7 @@ return CONTROL_UNKNOWN; } +#if 0 /** * \brief print suboption usage help */ @@ -85,10 +86,11 @@ "\nOptions:\n" ); } - +#endif static ALCdevice* alc_dev; -static int init(int flags) +static int init(unsigned flags) { + UNUSED(flags); alc_dev = alcOpenDevice(NULL); if (!alc_dev) { MSG_ERR("[OpenAL] could not open device\n"); @@ -97,7 +99,7 @@ return 1; } -static int configure(int rate, int channels, int format) +static int configure(unsigned rate, unsigned channels, unsigned format) { ALCcontext *ctx = NULL; float position[3] = {0, 0, 0}; @@ -110,7 +112,7 @@ }; ALCint freq = 0; ALCint attribs[] = {ALC_FREQUENCY, rate, 0, 0}; - int i; + unsigned i; /* const opt_t subopts[] = { {NULL} @@ -120,6 +122,7 @@ return 0; } */ + UNUSED(format); if (channels > MAX_CHANS) { MSG_ERR("[OpenAL] Invalid number of channels: %i\n", channels); goto err_out; @@ -176,7 +179,7 @@ static void unqueue_buffers(void) { ALint p; - int s; + unsigned s; for (s = 0; s < ao_data.channels; s++) { int till_wrap = NUM_BUF - unqueue_buf[s]; alGetSourcei(sources[s], AL_BUFFERS_PROCESSED, &p); @@ -214,7 +217,7 @@ alSourcePlayv(ao_data.channels, sources); } -static int get_space(void) { +static unsigned get_space(void) { ALint queued; unqueue_buffers(); alGetSourcei(sources[0], AL_BUFFERS_QUEUED, &queued); @@ -226,11 +229,12 @@ /** * \brief write data into buffer and reset underrun flag */ -static int play(void *data, int len, int flags) { +static unsigned play(void *data, unsigned len, unsigned flags) { ALint state; - int i, j, k; - int ch; + unsigned i, j, k; + unsigned ch; int16_t *d = data; + UNUSED(flags); len /= ao_data.channels * CHUNK_SIZE; for (i = 0; i < len; i++) { for (ch = 0; ch < ao_data.channels; ch++) { Modified: mplayerxp/libao2/ao_oss.c =================================================================== --- mplayerxp/libao2/ao_oss.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/ao_oss.c 2010-01-23 17:56:40 UTC (rev 121) @@ -189,9 +189,9 @@ } // open & setup audio device // return: 1=success 0=fail -static int __FASTCALL__ init(int flags){ +static int __FASTCALL__ init(unsigned flags){ char *mixer_channels [SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; - + UNUSED(flags); if (ao_subdevice) { char *p; @@ -228,8 +228,8 @@ return 1; } -static int __FASTCALL__ configure(int rate,int channels,int format){ - +static int __FASTCALL__ configure(unsigned rate,unsigned channels,unsigned format) +{ MSG_V("ao2: %d Hz %d chans %s\n",rate,channels, ao_format_name(format)); @@ -238,10 +238,10 @@ ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_data.samplerate); } -ac3_retry: +ac3_retry: ao_data.format=format; if( ioctl(audio_fd, SNDCTL_DSP_SETFMT, &ao_data.format)<0 || - ao_data.format != format) + ao_data.format != format) { if(format == AFMT_AC3){ MSG_WARN("OSS-CONF: Can't set audio device %s to AC3 output, trying S16...\n", dsp); @@ -297,11 +297,11 @@ } else { MSG_V("OSS-CONF: frags: %3d/%d (%d bytes/frag) free: %6d\n", zz.fragments, zz.fragstotal, zz.fragsize, zz.bytes); - if(ao_data.buffersize==-1) ao_data.buffersize=zz.bytes; + if(ao_data.buffersize==0) ao_data.buffersize=zz.bytes; ao_data.outburst=zz.fragsize; } - if(ao_data.buffersize==-1){ + if(ao_data.buffersize==0){ // Measuring buffer size: void* data; ao_data.buffersize=0; @@ -332,7 +332,7 @@ ao_data.outburst-=ao_data.outburst % ao_data.bps; // round down ao_data.bps*=ao_data.samplerate; - return 1; + return 1; } // close audio device @@ -384,8 +384,8 @@ // return: how many bytes can be played without blocking -static int get_space(void){ - int playsize=ao_data.outburst; +static unsigned get_space(void){ + unsigned playsize=ao_data.outburst; #ifdef SNDCTL_DSP_GETOSPACE if(ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &zz)!=-1){ @@ -415,7 +415,8 @@ // plays 'len' bytes of 'data' // it should round it down to outburst*n // return: number of bytes played -static int __FASTCALL__ play(void* data,int len,int flags){ +static unsigned __FASTCALL__ play(void* data,unsigned len,unsigned flags){ + UNUSED(flags); len/=ao_data.outburst; len=write(audio_fd,data,len*ao_data.outburst); return len; Modified: mplayerxp/libao2/ao_sdl.c =================================================================== --- mplayerxp/libao2/ao_sdl.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/ao_sdl.c 2010-01-23 17:56:40 UTC (rev 121) @@ -135,15 +135,17 @@ } // SDL Callback function -void outputaudio(void *unused, Uint8 *stream, int len) { - read_buffer(stream, len); +static void outputaudio(void *unused, Uint8 *stream, int len) { + UNUSED(unused); + read_buffer(stream, len); } // open & setup audio device // return: 1=success 0=fail -static int __FASTCALL__ init(int flags) +static int __FASTCALL__ init(unsigned flags) { - int i; + unsigned i; + UNUSED(flags); /* Allocate ring-buffer memory */ for(i=0;i<NUM_BUFS;i++) buffer[i]=(unsigned char *) malloc(BUFFSIZE); @@ -153,11 +155,11 @@ return 1; } -static int __FASTCALL__ configure(int rate,int channels,int format){ - +static int __FASTCALL__ configure(unsigned rate,unsigned channels,unsigned format) +{ /* SDL Audio Specifications */ SDL_AudioSpec aspec, obtained; - char drv_name[80]; + char drv_name[80]; ao_data.channels=channels; ao_data.samplerate=rate; @@ -209,16 +211,16 @@ aspec.userdata = NULL; /* initialize the SDL Audio system */ - if (SDL_Init (SDL_INIT_AUDIO/*|SDL_INIT_NOPARACHUTE*/)) { - MSG_ERR("SDL: Initializing of SDL Audio failed: %s.\n", SDL_GetError()); - return 0; + if (SDL_Init (SDL_INIT_AUDIO/*|SDL_INIT_NOPARACHUTE*/)) { + MSG_ERR("SDL: Initializing of SDL Audio failed: %s.\n", SDL_GetError()); + return 0; } /* Open the audio device and start playing sound! */ if(SDL_OpenAudio(&aspec, &obtained) < 0) { - MSG_ERR("SDL: Unable to open audio: %s\n", SDL_GetError()); - return(0); - } + MSG_ERR("SDL: Unable to open audio: %s\n", SDL_GetError()); + return(0); + } /* did we got what we wanted ? */ ao_data.channels=obtained.channels; @@ -244,8 +246,8 @@ ao_data.format = AFMT_U16_BE; break; default: - MSG_WARN("SDL: Unsupported SDL audio format: 0x%x.\n", obtained.format); - return 0; + MSG_WARN("SDL: Unsupported SDL audio format: 0x%x.\n", obtained.format); + return 0; } MSG_V("SDL: buf size = %d\n",aspec.size); @@ -299,16 +301,17 @@ // return: how many bytes can be played without blocking -static int get_space(void){ +static unsigned get_space(void){ return (NUM_BUFS-full_buffers)*BUFFSIZE - buf_write_pos; } // plays 'len' bytes of 'data' // it should round it down to outburst*n // return: number of bytes played -static int __FASTCALL__ play(void* data,int len,int flags){ - -#if 0 +static unsigned __FASTCALL__ play(void* data,unsigned len,unsigned flags) +{ + UNUSED(flags); +#if 0 int ret; /* Audio locking prohibits call of outputaudio */ @@ -317,7 +320,7 @@ ret = write_buffer(data, len); SDL_UnlockAudio(); - return ret; + return ret; #else return write_buffer(data, len); #endif Modified: mplayerxp/libao2/ao_wav.c =================================================================== --- mplayerxp/libao2/ao_wav.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/ao_wav.c 2010-01-23 17:56:40 UTC (rev 121) @@ -85,18 +85,22 @@ // to set/get/query special features/parameters static int control(int cmd,long arg){ + UNUSED(cmd); + UNUSED(arg); return -1; } // open & setup audio device // return: 1=success 0=fail -static int init(int flags) { +static int init(unsigned flags) { // set defaults + UNUSED(flags); ao_pcm_waveheader = 1; + return 1; } -static int configure(int rate,int channels,int format){ - int bits; +static int configure(unsigned rate,unsigned channels,unsigned format){ + unsigned bits; char str[256]; if(ao_subdevice) ao_outputfilename = ao_subdevice; @@ -205,7 +209,7 @@ } // return: how many bytes can be played without blocking -static int get_space(void){ +static unsigned get_space(void){ if(vo_pts) return ao_data.pts < vo_pts + fast * 30000 ? ao_data.outburst : 0; return ao_data.outburst; @@ -214,8 +218,8 @@ // plays 'len' bytes of 'data' // it should round it down to outburst*n // return: number of bytes played -static int play(void* data,int len,int flags){ - //printf("PCM: Writing chunk!\n"); +static unsigned play(void* data,unsigned len,unsigned flags){ + UNUSED(flags); fwrite(data,len,1,fp); if(ao_pcm_waveheader) data_length += len; Modified: mplayerxp/libao2/audio_out.c =================================================================== --- mplayerxp/libao2/audio_out.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/audio_out.c 2010-01-23 17:56:40 UTC (rev 121) @@ -207,7 +207,7 @@ return audio_out->info; } -int __FASTCALL__ ao_init(int flags) +int __FASTCALL__ ao_init(unsigned flags) { int retval; retval = audio_out->init(flags); @@ -215,7 +215,7 @@ return retval; } -int __FASTCALL__ ao_configure(int rate,int channels,int format) +int __FASTCALL__ ao_configure(unsigned rate,unsigned channels,unsigned format) { int retval; retval=audio_out->configure(rate,channels,format); @@ -233,7 +233,7 @@ if(ao_inited) audio_out->reset(); } -int ao_get_space(void) +unsigned ao_get_space(void) { return ao_inited?audio_out->get_space():0; } @@ -243,7 +243,7 @@ return ao_inited?audio_out->get_delay():0; } -int __FASTCALL__ ao_play(void* data,int len,int flags) +unsigned __FASTCALL__ ao_play(void* data,unsigned len,unsigned flags) { return ao_inited?audio_out->play(data,len,flags):0; } Modified: mplayerxp/libao2/audio_out.h =================================================================== --- mplayerxp/libao2/audio_out.h 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/audio_out.h 2010-01-23 17:56:40 UTC (rev 121) @@ -20,31 +20,31 @@ * @param arg argument associated with command * @return CONTROL_OK if success CONTROL_FALSE CONTROL_ERROR CONTROL_NA otherwise **/ - int (* __FASTCALL__ control)(int cmd,long arg); + int (* __FASTCALL__ control)(int cmd,long arg); /** Preinitializes driver * @param flag currently unused * @return 1 on successful initialization, 0 on error. **/ - int (* __FASTCALL__ init)(int flags); + int (* __FASTCALL__ init)(unsigned flags); /** Configures the audio driver. * @param rate specifies samplerate in Hz - * @param channels specifies number of channels (1 - mono, 2 - stereo, 6 - surround) + * @param channels specifies number of channels (1 - mono, 2 - stereo, 6 - surround) * @param format specifies format of audio samples (see AFMT_* for detail) * @return 1 on successful configuration, 0 on error. - **/ - int (* __FASTCALL__ configure)(int rate,int channels,int format); + **/ + int (* __FASTCALL__ configure)(unsigned rate,unsigned channels,unsigned format); - /** Closes driver. Should restore the original state of the system. - **/ - void (*uninit)(void); + /** Closes driver. Should restore the original state of the system. + **/ + void (*uninit)(void); /** Stops playing and empties buffers (for seeking/pause) **/ void (*reset)(void); /** Returns how many bytes can be played without blocking **/ - int (*get_space)(void); + unsigned (*get_space)(void); /** Plays decoded (PCM) audio buffer * @param data buffer with PCM data @@ -52,28 +52,28 @@ * @param flags currently unused * return number of bytes which were copied into audio card **/ - int (* __FASTCALL__ play)(void* data,int len,int flags); + unsigned (* __FASTCALL__ play)(void* data,unsigned len,unsigned flags); /** Returns delay in seconds between first and last sample in buffer **/ - float (*get_delay)(void); - + float (*get_delay)(void); + /** Stops playing, keep buffers (for pause) */ - void (*pause)(void); + void (*pause)(void); /** Resumes playing, after audio_pause() */ - void (*resume)(void); + void (*resume)(void); } ao_functions_t; /** Global data used by mplayerxp and plugins */ typedef struct ao_data_s { - int samplerate; /**< rate of samples in Hz */ - int channels; /**< number of audio channels */ - int format; /**< format of audio samples */ - int bps; /**< bytes per second */ - int outburst; /**< outburst */ - int buffersize; /**< suize of audio buffer */ - int pts; /**< PTS of audio buffer */ + unsigned samplerate; /**< rate of samples in Hz */ + unsigned channels; /**< number of audio channels */ + unsigned format; /**< format of audio samples */ + unsigned bps; /**< bytes per second */ + unsigned outburst; /**< outburst */ + unsigned buffersize; /**< suize of audio buffer */ + float pts; /**< PTS of audio buffer */ } ao_data_t; extern char *ao_subdevice; @@ -108,12 +108,12 @@ extern void ao_print_help( void ); extern const ao_functions_t* __FASTCALL__ ao_register(const char *driver_name); extern const ao_info_t* ao_get_info( void ); -extern int __FASTCALL__ ao_init(int flags); -extern int __FASTCALL__ ao_configure(int rate,int channels,int format); +extern int __FASTCALL__ ao_init(unsigned flags); +extern int __FASTCALL__ ao_configure(unsigned rate,unsigned channels,unsigned format); extern void ao_uninit(void); extern void ao_reset(void); -extern int ao_get_space(void); -extern int __FASTCALL__ ao_play(void* data,int len,int flags); +extern unsigned ao_get_space(void); +extern unsigned __FASTCALL__ ao_play(void* data,unsigned len,unsigned flags); extern float ao_get_delay(void); extern void ao_pause(void); extern void ao_resume(void); Modified: mplayerxp/libao2/audio_out_internal.h =================================================================== --- mplayerxp/libao2/audio_out_internal.h 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libao2/audio_out_internal.h 2010-01-23 17:56:40 UTC (rev 121) @@ -2,12 +2,12 @@ // prototypes: //static ao_info_t info; static int __FASTCALL__ control(int cmd,long arg); -static int __FASTCALL__ init(int flags); -static int __FASTCALL__ configure(int rate,int channels,int format); +static int __FASTCALL__ init(unsigned flags); +static int __FASTCALL__ configure(unsigned rate,unsigned channels,unsigned format); static void uninit(void); static void reset(void); -static int get_space(void); -static int __FASTCALL__ play(void* data,int len,int flags); +static unsigned get_space(void); +static unsigned __FASTCALL__ play(void* data,unsigned len,unsigned flags); static float get_delay(void); static void audio_pause(void); static void audio_resume(void); Modified: mplayerxp/libmpcodecs/ad.h =================================================================== --- mplayerxp/libmpcodecs/ad.h 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad.h 2010-01-23 17:56:40 UTC (rev 121) @@ -32,10 +32,10 @@ const ad_info_t *info; const config_t* options;/**< Optional: MPlayerXP's option related */ int (*preinit)(sh_audio_t *); - int (*init)(sh_audio_t *sh); - void (*uninit)(sh_audio_t *sh); - int (*control)(sh_audio_t *sh,int cmd,void* arg, ...); - int (*decode_audio)(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts); + int (*init)(sh_audio_t *sh); + void (*uninit)(sh_audio_t *sh); + int (*control)(sh_audio_t *sh,int cmd,void* arg, ...); + unsigned (*decode_audio)(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts); } ad_functions_t; // NULL terminated array of all drivers Modified: mplayerxp/libmpcodecs/ad_a52.c =================================================================== --- mplayerxp/libmpcodecs/ad_a52.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_a52.c 2010-01-23 17:56:40 UTC (rev 121) @@ -195,6 +195,7 @@ int control(sh_audio_t *sh,int cmd,void* arg, ...) { + UNUSED(arg); switch(cmd) { case ADCTRL_RESYNC_STREAM: @@ -212,13 +213,16 @@ return CONTROL_UNKNOWN; } -int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) +unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { sample_t level=1, bias=384; int flags=mpxp_a52_flags|A52_ADJUST_LEVEL; - int i,len=-1; + unsigned i; + unsigned len=0; + UNUSED(minlen); + UNUSED(maxlen); a52_priv_t *a52_priv=sh_audio->context; - if(!sh_audio->a_in_buffer_len) + if(!sh_audio->a_in_buffer_len) { if(a52_fillbuff(sh_audio,pts)<0) return len; /* EOF */ } Modified: mplayerxp/libmpcodecs/ad_acm.c =================================================================== --- mplayerxp/libmpcodecs/ad_acm.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_acm.c 2010-01-23 17:56:40 UTC (rev 121) @@ -183,7 +183,7 @@ return CONTROL_UNKNOWN; } -int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) +unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { ACMSTREAMHEADER ash; HRESULT hr; Modified: mplayerxp/libmpcodecs/ad_dca.c =================================================================== --- mplayerxp/libmpcodecs/ad_dca.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_dca.c 2010-01-23 17:56:40 UTC (rev 121) @@ -196,6 +196,7 @@ int control(sh_audio_t *sh,int cmd,void* arg, ...) { + UNUSED(arg); switch(cmd) { case ADCTRL_RESYNC_STREAM: @@ -213,13 +214,15 @@ return CONTROL_UNKNOWN; } -int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) +unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { sample_t level=1, bias=384; unsigned i,nblocks,flags=mpxp_dca_flags|DCA_ADJUST_LEVEL; - int len=-1; + unsigned len=0; dca_priv_t *dca_priv=sh_audio->context; - if(!sh_audio->a_in_buffer_len) + UNUSED(minlen); + UNUSED(maxlen); + if(!sh_audio->a_in_buffer_len) { if(dca_fillbuff(sh_audio,pts)<0) return len; /* EOF */ } Modified: mplayerxp/libmpcodecs/ad_dmo.c =================================================================== --- mplayerxp/libmpcodecs/ad_dmo.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_dmo.c 2010-01-23 17:56:40 UTC (rev 121) @@ -35,6 +35,7 @@ static int init(sh_audio_t *sh) { + UNUSED(sh); return 1; } @@ -73,6 +74,7 @@ static int control(sh_audio_t *sh_audio,int cmd,void* arg, ...) { int skip; + UNUSED(arg); switch(cmd) { case ADCTRL_SKIP_FRAME: @@ -90,34 +92,37 @@ return CONTROL_UNKNOWN; } -static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) +static unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { - dmo_priv_t *priv=sh_audio->context; -// int len=-1; - int size_in=0; - int size_out=0; - int srcsize=DMO_AudioDecoder_GetSrcSize(priv->ds_adec, maxlen); - MSG_DBG3("DMO says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen); - if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! - if(sh_audio->a_in_buffer_len<srcsize){ - int l; - l=demux_read_data_r(sh_audio->ds,&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len], - srcsize-sh_audio->a_in_buffer_len,pts); - *pts=FIX_APTS(sh_audio,*pts,-sh_audio->a_in_buffer_len); - sh_audio->a_in_buffer_len+=l; + dmo_priv_t* priv = sh_audio->context; + unsigned len=0; + UNUSED(minlen); + { + unsigned size_in=0; + unsigned size_out=0; + unsigned srcsize=DMO_AudioDecoder_GetSrcSize(priv->ds_adec, maxlen); + MSG_DBG2("DMO says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen); + if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! + if((unsigned)sh_audio->a_in_buffer_len<srcsize){ + unsigned l; + l=demux_read_data_r(sh_audio->ds,&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len], + srcsize-sh_audio->a_in_buffer_len,pts); + sh_audio->a_in_buffer_len+=l; priv->pts=*pts; - } + } else *pts=priv->pts; - DMO_AudioDecoder_Convert(priv->ds_adec, sh_audio->a_in_buffer,sh_audio->a_in_buffer_len, - buf,maxlen, &size_in,&size_out); - MSG_DBG2("DMO: audio %d -> %d converted (in_buf_len=%d of %d) %d\n",size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,ds_tell_pts(sh_audio->ds)); - if(size_in>=sh_audio->a_in_buffer_len){ - sh_audio->a_in_buffer_len=0; - } else { - sh_audio->a_in_buffer_len-=size_in; - memmove(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len); + DMO_AudioDecoder_Convert(priv->ds_adec, sh_audio->a_in_buffer,sh_audio->a_in_buffer_len, + buf,maxlen, &size_in,&size_out); + MSG_DBG2("DMO: audio %d -> %d converted (in_buf_len=%d of %d) %f\n" + ,size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,*pts); + if(size_in>=(unsigned)sh_audio->a_in_buffer_len){ + sh_audio->a_in_buffer_len=0; + } else { + sh_audio->a_in_buffer_len-=size_in; + memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len); priv->pts=FIX_APTS(sh_audio,priv->pts,size_in); - } -// len=size_out; - return size_out; + } + len=size_out; + } + return len; } Modified: mplayerxp/libmpcodecs/ad_dshow.c =================================================================== --- mplayerxp/libmpcodecs/ad_dshow.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_dshow.c 2010-01-23 17:56:40 UTC (rev 121) @@ -30,6 +30,7 @@ int init(sh_audio_t *sh) { + UNUSED(sh); return 1; } @@ -64,6 +65,7 @@ int control(sh_audio_t *sh_audio,int cmd,void* arg, ...) { int skip; + UNUSED(arg); switch(cmd) { case ADCTRL_RESYNC_STREAM: @@ -86,35 +88,36 @@ return CONTROL_UNKNOWN; } -int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) +unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { dshow_priv_t* priv = sh_audio->context; - int len=-1; - { int size_in=0; - int size_out=0; - int srcsize=DS_AudioDecoder_GetSrcSize(priv->ds_adec, maxlen); - MSG_DBG3("DShow says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen); - if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! - if(sh_audio->a_in_buffer_len<srcsize){ - int l; - l=demux_read_data_r(sh_audio->ds,&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len], - srcsize-sh_audio->a_in_buffer_len,pts); - *pts=FIX_APTS(sh_audio,*pts,-sh_audio->a_in_buffer_len); - sh_audio->a_in_buffer_len+=l; + unsigned len=0; + UNUSED(minlen); + { unsigned size_in=0; + unsigned size_out=0; + unsigned srcsize=DS_AudioDecoder_GetSrcSize(priv->ds_adec, maxlen); + MSG_DBG3("DShow says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen); + if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! + if((unsigned)sh_audio->a_in_buffer_len<srcsize){ + unsigned l; + l=demux_read_data_r(sh_audio->ds,&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len], + srcsize-sh_audio->a_in_buffer_len,pts); + sh_audio->a_in_buffer_len+=l; priv->pts=*pts; - } + } else *pts=priv->pts; - DS_AudioDecoder_Convert(priv->ds_adec, sh_audio->a_in_buffer,sh_audio->a_in_buffer_len, - buf,maxlen, &size_in,&size_out); - MSG_DBG2("DShow: audio %d -> %d converted (in_buf_len=%d of %d) %d\n",size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,ds_tell_pts_r(sh_audio->ds)); - if(size_in>=sh_audio->a_in_buffer_len){ - sh_audio->a_in_buffer_len=0; - } else { - sh_audio->a_in_buffer_len-=size_in; - memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len); + DS_AudioDecoder_Convert(priv->ds_adec, sh_audio->a_in_buffer,sh_audio->a_in_buffer_len, + buf,maxlen, &size_in,&size_out); + MSG_DBG2("DShow: audio %d -> %d converted (in_buf_len=%d of %d) %f\n" + ,size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,*pts); + if(size_in>=(unsigned)sh_audio->a_in_buffer_len){ + sh_audio->a_in_buffer_len=0; + } else { + sh_audio->a_in_buffer_len-=size_in; + memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len); priv->pts=FIX_APTS(sh_audio,priv->pts,size_in); - } - len=size_out; + } + len=size_out; } return len; } Modified: mplayerxp/libmpcodecs/ad_dvdpcm.c =================================================================== --- mplayerxp/libmpcodecs/ad_dvdpcm.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_dvdpcm.c 2010-01-23 17:56:40 UTC (rev 121) @@ -69,11 +69,13 @@ void uninit(sh_audio_t *sh) { + UNUSED(sh); } int control(sh_audio_t *sh,int cmd,void* arg, ...) { int skip; + UNUSED(arg); switch(cmd) { case ADCTRL_SKIP_FRAME: @@ -90,10 +92,12 @@ return CONTROL_UNKNOWN; } -int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) +unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { - int j,len; + int j; + unsigned len; float null_pts; + UNUSED(maxlen); if (sh_audio->samplesize == 3) { if (((sh_audio->codecdata[1] >> 6) & 3) == 1) { // 20 bit @@ -146,7 +150,7 @@ } len = j; } - } else + } else len=demux_read_data_r(sh_audio->ds,buf,(minlen+3)&(~3),pts); return len; } Modified: mplayerxp/libmpcodecs/ad_faad.c =================================================================== --- mplayerxp/libmpcodecs/ad_faad.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_faad.c 2010-01-23 17:56:40 UTC (rev 121) @@ -253,9 +253,9 @@ if(!sh->i_bps) { MSG_WARN("FAAD: compressed input bitrate missing, assuming 128kbit/s!\n"); sh->i_bps = 128*1000/8; // XXX: HACK!!! ::atmos - } else + } else MSG_V("FAAD: got %dkbit/s bitrate from MP4 header!\n",sh->i_bps*8/1000); - } + } return 1; } @@ -274,10 +274,11 @@ return CONTROL_UNKNOWN; } -static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen,float *pts) +static unsigned decode_audio(sh_audio_t *sh,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { faad_priv_t *priv=sh->context; - int j = 0, len = 0; + int j = 0; + unsigned len = 0; void *NeAAC_sample_buffer; UNUSED(maxlen); while(len < minlen) { @@ -294,7 +295,7 @@ } else *pts=priv->pts; #ifdef DUMP_AAC_COMPRESSED - {int i; + {unsigned i; for (i = 0; i < 16; i++) printf ("%02X ", sh->a_in_buffer[i]); printf ("\n");} @@ -304,9 +305,9 @@ // raw aac stream: do { NeAAC_sample_buffer = NeAACDecDecode(NeAAC_hdec, &NeAAC_finfo, sh->a_in_buffer+j, sh->a_in_buffer_len); - + /* update buffer index after NeAACDecDecode */ - if(NeAAC_finfo.bytesconsumed >= sh->a_in_buffer_len) { + if(NeAAC_finfo.bytesconsumed >= (unsigned)sh->a_in_buffer_len) { sh->a_in_buffer_len=0; } else { sh->a_in_buffer_len-=NeAAC_finfo.bytesconsumed; @@ -320,7 +321,7 @@ j++; } else break; - } while(j < FAAD_BUFFLEN); + } while(j < FAAD_BUFFLEN); } else { // packetized (.mp4) aac stream: unsigned char* bufptr=NULL; @@ -329,7 +330,7 @@ NeAAC_sample_buffer = NeAACDecDecode(NeAAC_hdec, &NeAAC_finfo, bufptr, buflen); // printf("NeAAC decoded %d of %d (err: %d) \n",NeAAC_finfo.bytesconsumed,buflen,NeAAC_finfo.error); } - + if(NeAAC_finfo.error > 0) { MSG_WARN("FAAD: Failed to decode frame: %s \n", NeAACDecGetErrorMessage(NeAAC_finfo.error)); Modified: mplayerxp/libmpcodecs/ad_ffmp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_ffmp3.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_ffmp3.c 2010-01-23 17:56:40 UTC (rev 121) @@ -123,6 +123,7 @@ int control(sh_audio_t *sh,int cmd,void* arg, ...) { + UNUSED(arg); AVCodecContext *lavc_context = sh->context; switch(cmd){ case ADCTRL_RESYNC_STREAM: @@ -133,10 +134,11 @@ return CONTROL_UNKNOWN; } -int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) +unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { unsigned char *start=NULL; - int y,len=-1; + int y; + unsigned len=0; float apts=0.,null_pts; while(len<minlen){ int len2=maxlen; @@ -153,7 +155,7 @@ } if(len2>0){ //len=len2;break; - if(len<0) len=len2; else len+=len2; + if(len==0) len=len2; else len+=len2; buf+=len2; } MSG_DBG2("Decoded %d -> %d \n",y,len2); Modified: mplayerxp/libmpcodecs/ad_hwac3.c =================================================================== --- mplayerxp/libmpcodecs/ad_hwac3.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_hwac3.c 2010-01-23 17:56:40 UTC (rev 121) @@ -204,10 +204,11 @@ int control(sh_audio_t *sh,int cmd,void* arg, ...) { + UNUSED(arg); switch(cmd) { case ADCTRL_RESYNC_STREAM: - sh->a_in_buffer_len=0; // reset ACM/DShow audio buffer + sh->a_in_buffer_len=0; // reset ACM/DShow audio buffer return CONTROL_TRUE; case ADCTRL_SKIP_FRAME: { @@ -221,11 +222,13 @@ return CONTROL_UNKNOWN; } -int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) +unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { - int len=-1; + unsigned len=0; + UNUSED(minlen); + UNUSED(maxlen); if(!sh_audio->a_in_buffer_len) - if((len=a52_fillbuff(sh_audio,pts))<0) return len; /*EOF*/ + if((int)(len=a52_fillbuff(sh_audio,pts))<0) return 0; /*EOF*/ sh_audio->a_in_buffer_len=0; len = ac3_iec958_build_burst(len, 0x01, 1, sh_audio->a_in_buffer, buf); return len; Modified: mplayerxp/libmpcodecs/ad_internal.h =================================================================== --- mplayerxp/libmpcodecs/ad_internal.h 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_internal.h 2010-01-23 17:56:40 UTC (rev 121) @@ -17,7 +17,7 @@ static int preinit(sh_audio_t *sh); static void uninit(sh_audio_t *sh); static int control(sh_audio_t *sh,int cmd,void* arg, ...); -static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts); +static unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts); #define LIBAD_EXTERN(x) const ad_functions_t mpcodecs_ad_##x = {\ &info,\ Modified: mplayerxp/libmpcodecs/ad_libdv.c =================================================================== --- mplayerxp/libmpcodecs/ad_libdv.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_libdv.c 2010-01-23 17:56:40 UTC (rev 121) @@ -40,11 +40,16 @@ return 1; } -static int16_t *audioBuffers[4]={NULL,NULL,NULL,NULL}; +typedef struct libdv_priv_s +{ + dv_decoder_t* decoder; + int16_t *audioBuffers[4]; +}libdv_priv_t; static int init(sh_audio_t *sh) { - int i; + unsigned i; + libdv_priv_t *priv; WAVEFORMATEX *h=sh->wf; if(!h) return 0; @@ -53,45 +58,53 @@ sh->channels=h->nChannels; sh->samplerate=h->nSamplesPerSec; sh->samplesize=(h->wBitsPerSample+7)/8; - - sh->context=init_global_rawdv_decoder(); - + priv = malloc(sizeof(libdv_priv_t)); + memset(priv,0,sizeof(libdv_priv_t)); + priv->decoder=init_global_rawdv_decoder(); + sh->context = priv; for (i=0; i < 4; i++) - audioBuffers[i] = malloc(2*DV_AUDIO_MAX_SAMPLES); + priv->audioBuffers[i] = malloc(2*DV_AUDIO_MAX_SAMPLES); return 1; } static void uninit(sh_audio_t *sh_audio) { - int i; + libdv_priv_t *priv = sh_audio->context; + unsigned i; + UNUSED(sh_audio); for (i=0; i < 4; i++) - free(audioBuffers[i]); + free(priv->audioBuffers[i]); } static int control(sh_audio_t *sh,int cmd,void* arg, ...) { // TODO!!! + UNUSED(sh); + UNUSED(cmd); + UNUSED(arg); return CONTROL_UNKNOWN; } -static int decode_audio(sh_audio_t *audio, unsigned char *buf, int minlen, int maxlen,float *pts) +static unsigned decode_audio(sh_audio_t *sh, unsigned char *buf, unsigned minlen, unsigned maxlen,float *pts) { - dv_decoder_t* decoder=audio->context; //global_rawdv_decoder; + libdv_priv_t *priv = sh->context; + dv_decoder_t* decoder=priv->decoder; //global_rawdv_decoder; unsigned char* dv_audio_frame=NULL; - int xx; + unsigned xx; size_t len=0; float apts; + UNUSED(maxlen); while(len<minlen) { - xx=ds_get_packet_r(audio->ds,&dv_audio_frame,len>0?&apts:pts); - if(xx<=0 || !dv_audio_frame) return 0; // EOF? + xx=ds_get_packet_r(sh->ds,&dv_audio_frame,len>0?&apts:pts); + if((int)xx<=0 || !dv_audio_frame) return 0; // EOF? dv_parse_header(decoder, dv_audio_frame); if(xx!=decoder->frame_size) MSG_WARN("AudioFramesize differs %u %u\n",xx, decoder->frame_size); - if (dv_decode_full_audio(decoder, dv_audio_frame,(int16_t**) audioBuffers)) { + if (dv_decode_full_audio(decoder, dv_audio_frame,(int16_t**)priv->audioBuffers)) { /* Interleave the audio into a single buffer */ int i=0; int16_t *bufP=(int16_t*)buf; @@ -100,7 +113,7 @@ { int ch; for (ch=0; ch < decoder->audio->num_channels; ch++) - bufP[len++] = audioBuffers[ch][i]; + bufP[len++] = priv->audioBuffers[ch][i]; } } len+=decoder->audio->samples_this_frame; Modified: mplayerxp/libmpcodecs/ad_mp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_mp3.c 2010-01-23 17:56:40 UTC (rev 121) @@ -348,10 +348,13 @@ int control(sh_audio_t *sh,int cmd,void* arg, ...) { + UNUSED(sh); + UNUSED(cmd); + UNUSED(arg); return CONTROL_UNKNOWN; } -int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen,float *pts) +unsigned decode_audio(sh_audio_t *sh,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { mp3_priv_t *priv=sh->context; unsigned char *indata=NULL,*outdata=NULL; Modified: mplayerxp/libmpcodecs/ad_null.c =================================================================== --- mplayerxp/libmpcodecs/ad_null.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_null.c 2010-01-23 17:56:40 UTC (rev 121) @@ -19,23 +19,35 @@ int init(sh_audio_t *sh) { + UNUSED(sh); return 1; } int preinit(sh_audio_t *sh) { + UNUSED(sh); return 1; } -void uninit(sh_audio_t *sh){} +void uninit(sh_audio_t *sh) +{ + UNUSED(sh); +} int control(sh_audio_t *sh,int cmd,void* arg, ...) { + UNUSED(sh); + UNUSED(cmd); + UNUSED(arg); return CONTROL_UNKNOWN; } -int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) +unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { + UNUSED(sh_audio); + UNUSED(buf); + UNUSED(minlen); + UNUSED(maxlen); *pts=0; - return -1; + return 0; } Modified: mplayerxp/libmpcodecs/ad_pcm.c =================================================================== --- mplayerxp/libmpcodecs/ad_pcm.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_pcm.c 2010-01-23 17:56:40 UTC (rev 121) @@ -64,11 +64,13 @@ void uninit(sh_audio_t *sh) { + UNUSED(sh); } int control(sh_audio_t *sh,int cmd,void* arg, ...) { int skip; + UNUSED(arg); switch(cmd) { case ADCTRL_SKIP_FRAME: @@ -85,7 +87,7 @@ return CONTROL_UNKNOWN; } -int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen,float *pts) +unsigned decode_audio(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts) { unsigned len = sh_audio->channels*sh_audio->samplesize; len = (minlen + len - 1) / len * len; Modified: mplayerxp/libmpcodecs/ad_qtaudio.c =================================================================== --- mplayerxp/libmpcodecs/ad_qtaudio.c 2010-01-23 13:25:30 UTC (rev 120) +++ mplayerxp/libmpcodecs/ad_qtaudio.c 2010-01-23 17:56:40 UTC (rev 121) @@ -25,7 +25,7 @@ }; static const config_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; LIBAD_EXTERN(qtaudio) @@ -89,62 +89,62 @@ #ifdef WIN32_LOADER Setup_LDT_Keeper(); #endif - qtml_dll = LoadLibraryA("qtmlClient.dll"); + qtml_dll = LoadLibraryA((LPCSTR)"qtmlClient.dll"); if( qtml_dll == NULL ) { MSG_ERR("failed loading dll\n" ); return 1; } #if 1 - InitializeQTML = (LPFUNC1)GetProcAddress(qtml_dll,"InitializeQTML"); + InitializeQTML = (LPFUNC1)GetProcAddress(qtml_dll,(LPCSTR)"InitializeQTML"); if ( InitializeQTML == NULL ) { MSG_ERR("failed geting proc address InitializeQTML\n"); return 1; } - SoundConverterOpen = (LPFUNC2)GetProcAddress(qtml_dll,"SoundConverterOpen"); + SoundConverterOpen = (LPFUNC2)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterOpen"); if ( SoundConverterOpen == NULL ) { MSG_ERR("failed getting proc address SoundConverterOpen\n"); return 1; } - SoundConverterClose = (LPFUNC3)GetProcAddress(qtml_dll,"SoundConverterClose"); + SoundConverterClose = (LPFUNC3)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterClose"); if ( SoundConverterClose == NULL ) { MSG_ERR("failed getting proc address SoundConverterClose\n"); return 1; } - TerminateQTML = (LPFUNC4)GetProcAddress(qtml_dll,"TerminateQTML"); + TerminateQTML = (LPFUNC4)GetProcAddress(qtml_dll,(LPCSTR)"TerminateQTML"); if ( TerminateQTML == NULL ) { MSG_ERR("failed getting proc address TerminateQTML\n"); return 1; } - SoundConverterSetInfo = (LPFUNC5)GetProcAddress(qtml_dll,"SoundConverterSetInfo"); + SoundConverterSetInfo = (LPFUNC5)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterSetInfo"); if ( SoundConverterSetInfo == NULL ) { MSG_ERR("failed getting proc address SoundConverterSetInfo\n"); return 1; } - SoundConverterGetBufferSizes = (LPFUNC6)GetProcAddress(qtml_dll,"SoundConverterGetBufferSizes"); + SoundConverterGetBufferSizes = (LPFUNC6)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterGetBufferSizes"); if ( SoundConverterGetBufferSizes == NULL ) { MSG_ERR("failed getting proc address SoundConverterGetBufferSizes\n"); return 1; } - SoundConverterConvertBuffer = (LPFUNC7)GetProcAddress(qtml_dll,"SoundConverterConvertBuffer"); + SoundConverterConvertBuffer = (LPFUNC7)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterConvertBuffer"); if ( SoundConverterConvertBuffer == NULL ) { MSG_ERR("failed getting proc address SoundConverterConvertBuffer1\n"); return 1; } - SoundConverterEndConversion = (LPFUNC8)GetProcAddress(qtml_dll,"SoundConverterEndConversion"); + SoundConverterEndConversion = (LPFUNC8)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterEndConversion"); if ( SoundConverterEndConversion == NULL ) { MSG_ERR("failed getting proc address SoundConverterEndConversion\n"); return 1; } - SoundConverterBeginConversion = (LPFUNC9)GetProcAddress(qtml_dll,"SoundConverterBeginConversion"); + SoundConverterBeginConversion = (LPFUNC9)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterBeginConversion"); if ( SoundConverterBeginConversion == NULL ) { MSG_ERR("failed getting proc address SoundConverterBeginConversion\n"); @@ -230,7 +230,7 @@ sh->audio_out_minsize=OutputBufferSize; sh->audio_in_minsize=InputBufferSize; - + sh->channels=sh->wf->nChannels; sh->samplerate=sh->wf->nSamplesPerSec; sh->samplesize=2; //(sh->wf->wBitsPerSample+7)/8; @@ -254,8 +254,9 @@ return 1; // return values: 1=OK 0=ERROR } -static int init(sh_audio_t *sh_audio){ - +static int init(sh_audio_t *sh_audio) +{ + UNUSED(sh_audio); return 1; // return values: 1=OK 0=ERROR } @@ -263,6 +264,7 @@ int error; unsigned long ConvertedFrames=0; unsigned long ConvertedBytes=0; + UNUSED(sh); error=SoundConverterEndConversion(myConverter,NULL,&ConvertedFrames,&ConvertedBytes); MSG_V("SoundConverterEndConversion:%i\n",e... [truncated message content] |
From: <nic...@us...> - 2010-01-25 17:01:33
|
Revision: 126 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=126&view=rev Author: nickols_k Date: 2010-01-25 17:01:27 +0000 (Mon, 25 Jan 2010) Log Message: ----------- final fixes before release Modified Paths: -------------- TOOLS/subfont-c/Makefile TOOLS/subfont-c/fontgen TOOLS/subfont-c/runme TOOLS/subfont-c/subfont.c distrib/mplayerxp.spec mplayerxp/configure Modified: TOOLS/subfont-c/Makefile =================================================================== --- TOOLS/subfont-c/Makefile 2010-01-24 18:56:10 UTC (rev 125) +++ TOOLS/subfont-c/Makefile 2010-01-25 17:01:27 UTC (rev 126) @@ -1,7 +1,5 @@ -include ../../mplayerxp/config.mak - LDLIBS=-lm $(shell freetype-config --libs) -CFLAGS=$(OPTFLAGS) $(shell freetype-config --cflags) +CFLAGS=-O2 $(shell freetype-config --cflags) #CFLAGS+=-O0 # for RedHat's gcc-2.96-95 #CFLAGS+=-DOLD_FREETYPE2 # for FreeType 2.0.1 @@ -11,6 +9,7 @@ subfont: subfont.o + $(CC) $(CFLAGS) $< $(LDLIBS) -o $@ subfont.o: subfont.c Makefile ../../mplayerxp/bswap.h Modified: TOOLS/subfont-c/fontgen =================================================================== --- TOOLS/subfont-c/fontgen 2010-01-24 18:56:10 UTC (rev 125) +++ TOOLS/subfont-c/fontgen 2010-01-25 17:01:27 UTC (rev 126) @@ -24,9 +24,9 @@ mkdir $2 fi #font=verdana.ttf -encoding=iso-8859-2 -fontsize=12 -symbolssize=10 +encoding=koi8-r +fontsize=24 +symbolssize=35 blur=2 outline=1.5 Modified: TOOLS/subfont-c/runme =================================================================== --- TOOLS/subfont-c/runme 2010-01-24 18:56:10 UTC (rev 125) +++ TOOLS/subfont-c/runme 2010-01-25 17:01:27 UTC (rev 126) @@ -1,9 +1,10 @@ #!/bin/bash -#unicode="--unicode" -font=arial.ttf +unicode="--unicode" +font=./EuroStyle.ttf +#font=/usr/share/fonts/TTF/FreeMono.ttf #font=verdana.ttf -encoding=iso-8859-2 +encoding=koi8-r fontsize=24 symbolssize=35 blur=2 Modified: TOOLS/subfont-c/subfont.c =================================================================== --- TOOLS/subfont-c/subfont.c 2010-01-24 18:56:10 UTC (rev 125) +++ TOOLS/subfont-c/subfont.c 2010-01-25 17:01:27 UTC (rev 126) @@ -36,7 +36,7 @@ //// default values char *encoding = "iso-8859-1"; /* target encoding */ -char *charmap = "ucs-4"; /* font charmap encoding, I hope ucs-4 is always big endian */ +char *charmap = "utf-32"/*"ucs-4"*/; /* font charmap encoding, I hope ucs-4 is always big endian */ /* gcc 2.1.3 doesn't support ucs-4le, but supports ucs-4 (==ucs-4be) */ float ppem = 22; /* font size in pixels */ @@ -68,8 +68,8 @@ unsigned char *bbuffer, *abuffer; int width, height; int padding; -static FT_ULong charset[max_charset_size]; /* characters we want to render; Unicode */ -static FT_ULong charcodes[max_charset_size]; /* character codes in 'encoding' */ +static uint32_t charset[max_charset_size]; /* characters we want to render; Unicode */ +static uint32_t charcodes[max_charset_size]; /* character codes in 'encoding' */ iconv_t cd; // iconv conversion descriptor @@ -143,7 +143,7 @@ int const load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING; int pen_x = 0, pen_xa; int ymin = INT_MAX, ymax = INT_MIN; - int i, uni_charmap = 1; + int i, uni_charmap = 0; int baseline, space_advance = 20; int glyphs_count = 0; @@ -282,7 +282,7 @@ glyphs = (FT_Glyph*)malloc(charset_size*sizeof(FT_Glyph*)); for (i= 0; i<charset_size; ++i) { FT_GlyphSlot slot; - FT_ULong character, code; + uint32_t character, code; FT_UInt glyph_index; FT_BBox bbox; @@ -293,7 +293,7 @@ if (character==0) glyph_index = 0; else { - glyph_index = FT_Get_Char_Index(face, uni_charmap ? character:code); + glyph_index = FT_Get_Char_Index(face, uni_charmap ? character: code); if (glyph_index==0) { WARNING("Glyph for char 0x%02x|U+%04X|%c not found.", code, character, code<' '||code>255 ? '.':code); @@ -418,13 +418,15 @@ /* decode from 'encoding' to unicode */ -FT_ULong decode_char(char c) { - FT_ULong o; +uint32_t decode_char(char c) { + uint32_t o; char *inbuf = &c; char *outbuf = (char*)&o; - int inbytesleft = 1; - int outbytesleft = sizeof(FT_ULong); + size_t inbytesleft = 1; + size_t outbytesleft = sizeof(uint32_t); + inbuf[1]=0; + printf("converting %c character\n",c); size_t count = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); /* convert unicode BigEndian -> MachineEndian */ @@ -441,7 +443,7 @@ void prepare_charset() { FILE *f; - FT_ULong i; + unsigned i; f = fopen(encoding, "r"); // try to read custom encoding if (f==NULL) { @@ -453,6 +455,7 @@ cd = iconv_open(charmap, encoding); if (cd==(iconv_t)-1) ERROR("Unsupported encoding `%s', use iconv --list to list character sets known on your system.", encoding); + else printf("Successfully open iconv from %s to %s\n",encoding,charmap); charset_size = 256 - first_char; for (i = 0; i<charset_size; ++i) { Modified: distrib/mplayerxp.spec =================================================================== --- distrib/mplayerxp.spec 2010-01-24 18:56:10 UTC (rev 125) +++ distrib/mplayerxp.spec 2010-01-25 17:01:27 UTC (rev 126) @@ -1,8 +1,18 @@ ######################################################################################################## # This is a .spec file for building mplayerxp.rpm packages. -# Usage: rpm -bb mplayerxp.spec +# +# Usage: +# rpmbuild -bb --target i686-linux mplayerxp.spec +# or: +# rpmbuild -bb --target x86_64-linux mplayerxp.spec +# +# For fast linkage: +# rpmbuild -bb --target CPU-linux --short-circuit mplayerxp.spec +# +# For testing package.rpm: +# rpm -qp --queryformat "%{arch}\n" mplayerxp-*.rpm +# rpm -qp --queryformat "%{os}\n" mplayerxp-*.rpm ######################################################################################################## -%define x86_64 0 %define name mplayerxp %define version 0.7.95 %define release 1 @@ -13,9 +23,9 @@ Name: %{name} Version: %{version} -Release: %{release} +Release: %{release}_%_target_os Prefix: %{prefix} -Summary: Media Player for *nix systems with eXtra Performance. +Summary: Media Player for *nix systems with eXtra Performance License: GPL Group: Applications/Multimedia Packager: Nickols_K <nic...@ma...> @@ -30,20 +40,23 @@ core. The new core provides better CPU utilization and excellently improves performance of video decoding. Main goal of this project is to achieve smoothness of video playback due monotonous CPU loading. -%if %{x86_64} +%if %_target_cpu==x86_64 %define bitness 64 %define lib lib64 %define gcc "gcc -m64" -%define host x86_64-unknown-linux-gnu +%define host "x86_64-unknown-linux-gnu" %define ld_library_path "$LD_LIBRARY_PATH:usr/%{lib}:/usr/%{lib}/xorg" %define pkg_config_path "$PKG_CONFIG_PATH:$PKG64_CONFIG_PATH:/usr/local/%{lib}" -%else +%elseif %_target_cpu==i686 %define bitness 32 %define lib lib %define gcc "gcc -m32" -%define host i686-unknown-linux-gnu +%define host "i686-unknown-linux-gnu" %define ld_library_path "$LD_LIBRARY_PATH:usr/%{lib}:/usr/%{lib}/xorg" %define pkg_config_path "$PKG_CONFIG_PATH:$PKG32_CONFIG_PATH:/usr/local/%{lib}" +%else +# generic or unknown arch-os +%define gcc "gcc" %endif %prep Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-24 18:56:10 UTC (rev 125) +++ mplayerxp/configure 2010-01-25 17:01:27 UTC (rev 126) @@ -626,12 +626,11 @@ x86_32 || disable vesa _vesa=$vesa enabled vesa && require3 vesa "asm/vm86.h string.h" VIF_MASK memset -print_config HAVE_ mp_config.h mp_config.mak vesa - -disabled vesa && vesa=$_vesa +if disabled vesa ; then +vesa=$_vesa enabled vesa && require3 vesa "asm/vm86.h string.h" X86_EFLAGS_VIF memset +fi print_config HAVE_ mp_config.h mp_config.mak vesa - enabled vesa && vomodules="vesa $vomodules" || novomodules="vesa $novomodules" ################# This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-27 14:21:25
|
Revision: 127 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=127&view=rev Author: nickols_k Date: 2010-01-27 14:21:04 +0000 (Wed, 27 Jan 2010) Log Message: ----------- fixed some configuring problems Modified Paths: -------------- DOCS/configure configure etc/configure functions mplayerxp/configure Modified: DOCS/configure =================================================================== --- DOCS/configure 2010-01-25 17:01:27 UTC (rev 126) +++ DOCS/configure 2010-01-27 14:21:04 UTC (rev 127) @@ -1,4 +1,6 @@ -#!/bin/sh +#!/bin/bash +# query full-featured shell here +# # The simplest configure for win loader . ../functions Modified: configure =================================================================== --- configure 2010-01-25 17:01:27 UTC (rev 126) +++ configure 2010-01-27 14:21:04 UTC (rev 127) @@ -1,4 +1,6 @@ -#!/bin/sh +#!/bin/bash +# query full-featured shell here +# # The simplest configure for mplayerxp for parm in "$@" ; do if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then Modified: etc/configure =================================================================== --- etc/configure 2010-01-25 17:01:27 UTC (rev 126) +++ etc/configure 2010-01-27 14:21:04 UTC (rev 127) @@ -1,4 +1,6 @@ -#!/bin/sh +#!/bin/bash +# query full-featured shell here +# # The simplest configure for win loader . ../functions Modified: functions =================================================================== --- functions 2010-01-25 17:01:27 UTC (rev 126) +++ functions 2010-01-27 14:21:04 UTC (rev 127) @@ -1,4 +1,5 @@ -#!/bin/sh +#!/bin/bash +# query full-featured shell here # # functions This file contains functions to be used by all # shell scripts of the mplayerxp Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-25 17:01:27 UTC (rev 126) +++ mplayerxp/configure 2010-01-27 14:21:04 UTC (rev 127) @@ -1,4 +1,5 @@ -#! /bin/sh +#!/bin/bash +# query full-featured shell here # # Original version (C) 2000 Pontscho/fresh!mindworkz # pon...@ma... @@ -254,7 +255,7 @@ cc_version="$cc_version, bad" cc_verc_fail=yes ;; - 3.[2-9]|3.[2-9].[0-9]|4.[0-9].[0-9]) + 3.[2-9]|3.[2-9].[0-9]|4.[0-9]|4.[0-9].[0-9]) cc_version="$cc_version, ok" cc_verc_fail=no ;; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-27 16:07:41
|
Revision: 128 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=128&view=rev Author: nickols_k Date: 2010-01-27 16:07:30 +0000 (Wed, 27 Jan 2010) Log Message: ----------- minor speedup Modified Paths: -------------- mplayerxp/libvo/aclib_template.c mplayerxp/libvo/osd_template.c mplayerxp/postproc/dsp_accel.h mplayerxp/pvector/pvector_inc.h Modified: mplayerxp/libvo/aclib_template.c =================================================================== --- mplayerxp/libvo/aclib_template.c 2010-01-27 14:21:04 UTC (rev 127) +++ mplayerxp/libvo/aclib_template.c 2010-01-27 16:07:30 UTC (rev 128) @@ -147,7 +147,7 @@ cfrom+=block_size;\ tto+=block_size;\ }\ - _ivec_sfence();\ + MEM_SFENCE\ _ivec_empty();\ }\ /*\ @@ -158,7 +158,8 @@ } #undef MEM_STORE -#define MEM_STORE _ivec_stream +#define MEM_STORE _ivec_stream +#define MEM_SFENCE _ivec_sfence(); static inline void * PVECTOR_RENAME(fast_stream_copy)(void * to, const void * from, size_t len) { MSG_DBG3("fast_stream_copy(%p, %p, %u) [cl_size=%u]\n",to,from,len,gCpuCaps.cl_size); @@ -167,6 +168,7 @@ #undef MEM_STORE #define MEM_STORE _ivec_storea +#define MEM_SFENCE static inline void * PVECTOR_RENAME(fast_memcpy)(void * to, const void * from, size_t len) { MSG_DBG3("fast_memcpy(%p, %p, %u) [cl_size=%u]\n",to,from,len,gCpuCaps.cl_size); Modified: mplayerxp/libvo/osd_template.c =================================================================== --- mplayerxp/libvo/osd_template.c 2010-01-27 14:21:04 UTC (rev 127) +++ mplayerxp/libvo/osd_template.c 2010-01-27 16:07:30 UTC (rev 128) @@ -102,7 +102,7 @@ } #ifdef HAVE_INT_PVECTOR _ivec_empty(); - _ivec_sfence(); + if(finalize) _ivec_sfence(); #endif PROFILE_END("vo_draw_alpha_yv12"); return; @@ -167,7 +167,7 @@ } #ifdef HAVE_INT_PVECTOR _ivec_empty(); - _ivec_sfence(); + if(finalize) _ivec_sfence(); #endif PROFILE_END("vo_draw_alpha_yuy2"); return; @@ -240,7 +240,7 @@ } #ifdef HAVE_INT_PVECTOR _ivec_empty(); - _ivec_sfence(); + if(finalize) _ivec_sfence(); #endif return; } @@ -306,7 +306,7 @@ } #ifdef HAVE_INT_PVECTOR _ivec_empty(); - _ivec_sfence(); + if(finalize) _ivec_sfence(); #endif PROFILE_END("vo_draw_alpha_rgb32"); return; Modified: mplayerxp/postproc/dsp_accel.h =================================================================== --- mplayerxp/postproc/dsp_accel.h 2010-01-27 14:21:04 UTC (rev 127) +++ mplayerxp/postproc/dsp_accel.h 2010-01-27 16:07:30 UTC (rev 128) @@ -33,7 +33,7 @@ } } _ivec_empty(); - _ivec_sfence(); + if(final) _ivec_sfence(); #endif for(;i<len;i++) ((uint16_t*)out_data)[i]=((uint16_t)((const uint8_t*)in_data)[i])<<8; @@ -60,7 +60,7 @@ _ivec_storea(&((uint8_t*)out_data)[i],outd); } _ivec_empty(); - _ivec_sfence(); + if(final) _ivec_sfence(); #endif for(;i<len;i++) ((uint8_t*)out_data)[i]=(uint8_t)((((const uint16_t*)in_data)[i])>>8); @@ -101,7 +101,7 @@ _ivec_storea(&((uint8_t *)out_data)[j*2+__IVEC_SIZE],tmp[1]); } } - _ivec_sfence(); + if(final) _ivec_sfence(); _ivec_empty(); #endif for(;i<len;i++) @@ -133,7 +133,7 @@ else _ivec_storea(&((uint8_t *)out_data)[j],tmp); } - _ivec_sfence(); + if(final) _ivec_sfence(); _ivec_empty(); #endif for(;i<len;i++) @@ -337,7 +337,7 @@ else _f32vec_to_s32a(&((int32_t*)out)[i],tmp); } - _ivec_sfence(); + if(final) _ivec_sfence(); _ivec_empty(); #endif for(;i<len;i++) { @@ -368,7 +368,7 @@ else _f32vec_storea(&((float*)out)[i],tmp); } - _ivec_sfence(); + if(final) _ivec_sfence(); _ivec_empty(); #endif for(;i<len;i++) Modified: mplayerxp/pvector/pvector_inc.h =================================================================== --- mplayerxp/pvector/pvector_inc.h 2010-01-27 14:21:04 UTC (rev 127) +++ mplayerxp/pvector/pvector_inc.h 2010-01-27 16:07:30 UTC (rev 128) @@ -18,12 +18,14 @@ #include PVECTOR_ACCEL_H #if !defined( __x86_64__ ) || defined(PVECTOR_TESTING) +#if !defined( __i686__ ) || defined(PVECTOR_TESTING) #ifdef __MMX__ #define OPTIMIZE_MMX #undef PVECTOR_RENAME #define PVECTOR_RENAME(a) a ## _MMX #include PVECTOR_ACCEL_H #endif +#endif // __i686__ #ifdef __3dNOW__ #define OPTIMIZE_3DNOW This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-28 15:43:41
|
Revision: 130 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=130&view=rev Author: nickols_k Date: 2010-01-28 15:43:33 +0000 (Thu, 28 Jan 2010) Log Message: ----------- minor speedup and fixes Modified Paths: -------------- TOOLS/asmopt.c TOOLS/asmopt_template.h mplayerxp/libvo/aclib_template.c mplayerxp/libvo/osd_template.c mplayerxp/postproc/dsp_accel.h mplayerxp/pvector/pvector.h mplayerxp/pvector/pvector_f32_x86.h mplayerxp/pvector/pvector_int_x86.h Modified: TOOLS/asmopt.c =================================================================== --- TOOLS/asmopt.c 2010-01-28 15:41:48 UTC (rev 129) +++ TOOLS/asmopt.c 2010-01-28 15:43:33 UTC (rev 130) @@ -32,7 +32,7 @@ #define INIT_ARRAYS(x) \ {\ for(i=0; i<x; i++) srca[i] = i; \ - for(i=0; i<x; i++) src[i] = i+64; \ + for(i=0; i<x; i++) src[i] = i-61; \ for(i=0; i<x; i++) dsta[i] = i+128; \ } @@ -44,7 +44,7 @@ gettimeofday(&tv,&tz); // s=tv.tv_usec;s*=0.000001;s+=tv.tv_sec; return (tv.tv_sec*1000000+tv.tv_usec); -} +} static inline unsigned long long int read_tsc( void ) { Modified: TOOLS/asmopt_template.h =================================================================== --- TOOLS/asmopt_template.h 2010-01-28 15:41:48 UTC (rev 129) +++ TOOLS/asmopt_template.h 2010-01-28 15:43:33 UTC (rev 130) @@ -17,7 +17,7 @@ #endif uint8_t *out_data = dstbase; uint8_t *in_data = src; - + unsigned i,len; i = 0; len = asize; @@ -30,19 +30,13 @@ for(;i<len;i+=__IVEC_SIZE){ __ivec ind,itmp[2]; ind = _ivec_loadu(&((uint8_t *)in_data)[i]); -#if 0 /* slower but portable on non-x86 CPUs version */ - itmp[0]= _ivec_sll_s16_imm(_ivec_u16_from_lou8(ind),8); - itmp[1]= _ivec_sll_s16_imm(_ivec_u16_from_hiu8(ind),8); -#else - itmp[0]= _ivec_interleave_lo_u8(izero,ind); - itmp[1]= _ivec_interleave_hi_u8(izero,ind); -#endif + itmp[0]= _ivec_s16_from_s8(ind,&itmp[1]); _ivec_storea(&((uint16_t*)out_data)[i],itmp[0]); _ivec_storea(&((uint16_t*)out_data)[i+__IVEC_SIZE/2],itmp[1]); } #endif for(;i<len;i++) - ((uint16_t*)out_data)[i]=((uint16_t)((uint8_t*)in_data)[i])<<8; + ((int16_t*)out_data)[i]=((int16_t)((int8_t*)in_data)[i]); #ifdef HAVE_INT_PVECTOR _ivec_empty(); _ivec_sfence(); Modified: mplayerxp/libvo/aclib_template.c =================================================================== --- mplayerxp/libvo/aclib_template.c 2010-01-28 15:41:48 UTC (rev 129) +++ mplayerxp/libvo/aclib_template.c 2010-01-28 15:43:33 UTC (rev 130) @@ -158,6 +158,7 @@ } #undef MEM_STORE +#undef MEM_SFENCE #define MEM_STORE _ivec_stream #define MEM_SFENCE _ivec_sfence(); static inline void * PVECTOR_RENAME(fast_stream_copy)(void * to, const void * from, size_t len) @@ -167,6 +168,7 @@ } #undef MEM_STORE +#undef MEM_SFENCE #define MEM_STORE _ivec_storea #define MEM_SFENCE static inline void * PVECTOR_RENAME(fast_memcpy)(void * to, const void * from, size_t len) Modified: mplayerxp/libvo/osd_template.c =================================================================== --- mplayerxp/libvo/osd_template.c 2010-01-28 15:41:48 UTC (rev 129) +++ mplayerxp/libvo/osd_template.c 2010-01-28 15:43:33 UTC (rev 130) @@ -64,10 +64,11 @@ _ivec_prefetch(&src[x]); _ivec_prefetch(&srca[x]); /* MOVNTDQ: #GP(0) - If memory operand is not aligned on a 16-byte boundary */ + if(!IVEC_ALIGNED(dstbase)) for(;x<w;x++){ unsigned char *dst=&dstbase[x]; if(srca[x]) *dst=((dstbase[x]*srca[x])>>8)+src[x]; - if((((long)dst)&(__IVEC_SIZE-1))==0) break; /* align on sizeof(MMREG) boundary */ + if(IVEC_ALIGNED(dst)) break; /* align on sizeof(MMREG) boundary */ } if((w-x)>=__IVEC_SIZE) for(;x<w;x+=__IVEC_SIZE){ @@ -76,13 +77,17 @@ _ivec_prefetch(&src[x+__IVEC_SIZE*4]); _ivec_prefetch(&srca[x+__IVEC_SIZE*4]); vdest = _ivec_loada(&dstbase[x]); - vsrc = _ivec_loadu(&src[x]); - vsrca = _ivec_loadu(&srca[x]); + if(IVEC_ALIGNED(&src[x])) + vsrc = _ivec_loada(&src[x]); + else + vsrc = _ivec_loadu(&src[x]); + if(IVEC_ALIGNED(&srca[x])) + vsrca = _ivec_loada(&srca[x]); + else + vsrca = _ivec_loadu(&srca[x]); vmsk = _ivec_not(_ivec_cmpeq_s8(vsrca,vzero)); - vt[0] = _ivec_u16_from_lou8(vdest); - vt[1] = _ivec_u16_from_hiu8(vdest); - vt[2] = _ivec_u16_from_lou8(vsrca); - vt[3] = _ivec_u16_from_hiu8(vsrca); + vt[0] = _ivec_u16_from_u8(vdest,&vt[1]); + vt[2] = _ivec_u16_from_u8(vsrca,&vt[3]); vt[0] = _ivec_srl_s16_imm(_ivec_mullo_s16(vt[0],vt[2]),8); vt[1] = _ivec_srl_s16_imm(_ivec_mullo_s16(vt[1],vt[3]),8); vt[0] = _ivec_add_s8(_ivec_u8_from_u16(vt[0],vt[1]),vsrc); Modified: mplayerxp/postproc/dsp_accel.h =================================================================== --- mplayerxp/postproc/dsp_accel.h 2010-01-28 15:41:48 UTC (rev 129) +++ mplayerxp/postproc/dsp_accel.h 2010-01-28 15:43:33 UTC (rev 130) @@ -3,27 +3,22 @@ static void __FASTCALL__ PVECTOR_RENAME(int8_to_int16)(const int8_t* in_data, int16_t* out_data, unsigned len, int final) { -#ifdef HAVE_INT_PVECTOR - __ivec izero = _ivec_setzero(); -#endif unsigned i; i = 0; #ifdef HAVE_INT_PVECTOR + if(!IVEC_ALIGNED(out_data)) for(;i<len;i++) { ((uint16_t*)out_data)[i]=((uint16_t)((const uint8_t*)in_data)[i])<<8; - if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + if(IVEC_ALIGNED(out_data)) break; } if((len-i)>=__IVEC_SIZE) for(;i<len;i+=__IVEC_SIZE){ __ivec ind,itmp[2]; - ind = _ivec_loadu(&((const uint8_t *)in_data)[i]); -#if 0 /* slower but portable on non-x86 CPUs version */ - itmp[0]= _ivec_sll_s16_imm(_ivec_u16_from_lou8(ind),8); - itmp[1]= _ivec_sll_s16_imm(_ivec_u16_from_hiu8(ind),8); -#else - itmp[0]= _ivec_interleave_lo_u8(izero,ind); - itmp[1]= _ivec_interleave_hi_u8(izero,ind); -#endif + if(IVEC_ALIGNED(in_data)) + ind = _ivec_loada(&((const uint8_t *)in_data)[i]); + else + ind = _ivec_loadu(&((const uint8_t *)in_data)[i]); + itmp[0] = _ivec_scale_u16_from_u8(ind,&itmp[1]); if(final) { _ivec_stream(&((uint16_t*)out_data)[i],itmp[0]); _ivec_stream(&((uint16_t*)out_data)[i+__IVEC_SIZE/2],itmp[1]); @@ -44,16 +39,23 @@ unsigned i; i = 0; #ifdef HAVE_INT_PVECTOR + if(!IVEC_ALIGNED(out_data)) for(;i<len;i++) { ((uint8_t*)out_data)[i]=(uint8_t)((((const uint16_t*)in_data)[i])>>8); - if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + if(IVEC_ALIGNED(out_data)) break; } if((len-i)>=__IVEC_SIZE) for(;i<len;i+=__IVEC_SIZE){ __ivec outd,itmp[2]; - itmp[0] = _ivec_sra_s16_imm(_ivec_loadu(&((const uint16_t*)in_data)[i]),8); - itmp[1] = _ivec_sra_s16_imm(_ivec_loadu(&((const uint16_t*)in_data)[i+__IVEC_SIZE/2]),8); - outd = _ivec_s8_from_s16(itmp[0],itmp[1]); + if(IVEC_ALIGNED(in_data)) { + itmp[0] = _ivec_loada(&((const uint16_t*)in_data)[i]); + itmp[1] = _ivec_loada(&((const uint16_t*)in_data)[i+__IVEC_SIZE/2]); + } + else { + itmp[0] = _ivec_loadu(&((const uint16_t*)in_data)[i]); + itmp[1] = _ivec_loadu(&((const uint16_t*)in_data)[i+__IVEC_SIZE/2]); + } + outd = _ivec_scale_s8_from_s16(itmp[0],itmp[1]); if(final) _ivec_stream(&((uint8_t*)out_data)[i],outd); else @@ -69,7 +71,6 @@ static void __FASTCALL__ PVECTOR_RENAME(int16_to_int32)(const int16_t* in_data, int32_t* out_data, unsigned len, int final) { #ifdef HAVE_INT_PVECTOR - __ivec izero = _ivec_setzero(); unsigned len_mm,j; #endif unsigned i; @@ -77,22 +78,20 @@ #ifdef HAVE_INT_PVECTOR j=0; len_mm=len&(~(__IVEC_SIZE-1)); + if(!IVEC_ALIGNED(out_data)) for(;i<len;i++,j+=2){ ((uint32_t*)out_data)[i]=((uint32_t)((const uint16_t*)in_data)[i])<<16; - if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + if(IVEC_ALIGNED(out_data)) break; } if((len_mm-i)>=__IVEC_SIZE) for(;i<len_mm;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) { __ivec ind,tmp[2]; - ind = _ivec_loadu(&((const uint8_t *)in_data)[j]); -#if 0 /* slower but portable on non-x86 CPUs version */ - tmp[0]= _ivec_sll_s32_imm(_ivec_u32_from_lou16(ind),16); - tmp[1]= _ivec_sll_s32_imm(_ivec_u32_from_hiu16(ind),16); -#else - tmp[0]= _ivec_interleave_lo_u16(izero,ind); - tmp[1]= _ivec_interleave_hi_u16(izero,ind); -#endif + if(IVEC_ALIGNED(in_data)) + ind = _ivec_loada(&((const uint8_t *)in_data)[j]); + else + ind = _ivec_loadu(&((const uint8_t *)in_data)[j]); + tmp[0]= _ivec_scale_u32_from_u16(ind,&tmp[1]); if(final) { _ivec_stream(&((uint8_t *)out_data)[j*2],tmp[0]); _ivec_stream(&((uint8_t *)out_data)[j*2+__IVEC_SIZE],tmp[1]); @@ -117,17 +116,23 @@ i=0; #ifdef HAVE_INT_PVECTOR j=0; + if(!IVEC_ALIGNED(out_data)) for(;i<len;i++,j+=2){ ((uint16_t*)out_data)[i]=(uint16_t)((((const uint32_t*)in_data)[i])>>16); - if((((long)out_data)&(__IVEC_SIZE-1))==0) break; + if(IVEC_ALIGNED(out_data)) break; } if((len-i)>=__IVEC_SIZE) for(;i<len;i+=__IVEC_SIZE/2,j+=__IVEC_SIZE) { __ivec ind[2],tmp; - ind[0]= _ivec_sra_s32_imm(_ivec_loadu(&((const uint8_t *)in_data)[j*2]),16); - ind[1]= _ivec_sra_s32_imm(_ivec_loadu(&((const uint8_t *)in_data)[j*2+__IVEC_SIZE]),16); - tmp = _ivec_s16_from_s32(ind[0],ind[1]); + if(IVEC_ALIGNED(in_data)) { + ind[0]=_ivec_loada(&((const uint8_t *)in_data)[j*2]); + ind[1]=_ivec_loada(&((const uint8_t *)in_data)[j*2+__IVEC_SIZE]); + } else { + ind[0]=_ivec_loadu(&((const uint8_t *)in_data)[j*2]); + ind[1]=_ivec_loadu(&((const uint8_t *)in_data)[j*2+__IVEC_SIZE]); + } + tmp = _ivec_scale_s16_from_s32(ind[0],ind[1]); if(final) _ivec_stream(&((uint8_t *)out_data)[j],tmp); else @@ -314,23 +319,27 @@ i=0; #ifdef HAVE_F32_PVECTOR int_max = _f32vec_broadcast(INT32_MAX-1); - /* SSE engine sometime has unpredictable behaviour. So downscale volume on 1% here. */ - plus1 = _f32vec_broadcast(+0.99); - minus1= _f32vec_broadcast(-0.99); + /* SSE float2int engine doesn't have SATURATION functionality. + So CLAMP volume on 0.0002% here. */ + plus1 = _f32vec_broadcast(+0.999998); + minus1= _f32vec_broadcast(-0.999998); + if(!F32VEC_ALIGNED(out)) for(;i<len;i++) { ftmp=((const float*)in)[i]; SATURATE(ftmp,-1.0,+1.0); ((int32_t*)out)[i]=(int32_t)lrintf((INT_MAX-1)*ftmp); - if((((long)out)&(__F32VEC_SIZE-1))==0) break; + if(F32VEC_ALIGNED(out)) break; } _ivec_empty(); len_mm=len&(~(__F32VEC_SIZE-1)); if((len_mm-i)>=__F32VEC_SIZE/sizeof(float)) for(;i<len_mm;i+=__F32VEC_SIZE/sizeof(float)) { __f32vec tmp; - tmp = _f32vec_loadu(&((const float*)in)[i]); - tmp = _f32vec_min(tmp,plus1); - tmp = _f32vec_max(tmp,minus1); + if(F32VEC_ALIGNED(in)) + tmp = _f32vec_loada(&((const float*)in)[i]); + else + tmp = _f32vec_loadu(&((const float*)in)[i]); + tmp = _f32vec_clamp(tmp,minus1,plus1); tmp = _f32vec_mul(int_max,tmp); if(final) _f32vec_to_s32_stream(&((int32_t*)out)[i],tmp); @@ -354,15 +363,20 @@ #endif register unsigned i=0; #ifdef HAVE_F32_PVECTOR + if(!F32VEC_ALIGNED(out)) for(;i<len;i++) { ((float*)out)[i]=(1.0/INT_MAX)*((float)((const int32_t*)in)[i]); - if((((long)out)&(__F32VEC_SIZE-1))==0) break; + if(F32VEC_ALIGNED(out)) break; } _ivec_empty(); if((len-i)>=__F32VEC_SIZE) for(;i<len;i+=__F32VEC_SIZE/sizeof(float)) { __f32vec tmp; - tmp = _f32vec_mul(rev_imax,_f32vec_from_s32u(&((const int32_t*)in)[i])); + if(F32VEC_ALIGNED(in)) + tmp = _f32vec_from_s32a(&((const int32_t*)in)[i]); + else + tmp = _f32vec_from_s32u(&((const int32_t*)in)[i]); + tmp = _f32vec_mul(rev_imax,tmp); if(final) _f32vec_stream(&((float*)out)[i],tmp); else Modified: mplayerxp/pvector/pvector.h =================================================================== --- mplayerxp/pvector/pvector.h 2010-01-28 15:41:48 UTC (rev 129) +++ mplayerxp/pvector/pvector.h 2010-01-28 15:43:33 UTC (rev 130) @@ -47,6 +47,10 @@ #undef HAVE_F32_PVECTOR #endif +#undef IVEC_ALIGNED +#define IVEC_ALIGNED(p) ((((long)((void *)(p)))&(__IVEC_SIZE-1))==0) +#undef F32VEC_ALIGNED +#define F32VEC_ALIGNED(p) ((((long)((void *)(p)))&(__F32VEC_SIZE-1))==0) /* ABBREVIATION: @@ -130,15 +134,22 @@ __ivec _ivec_interleave_lo_u32(__ivec s1, _ivec_ s2); __ivec _ivec_interleave_hi_u32(__ivec s1, _ivec_ s2); - __ivec _ivec_u16_from_lou8(__ivec s); // Convert lo part of mvec from U8 to U16 - __ivec _ivec_u16_from_hiu8(__ivec s); // Convert hi part of mvec from U8 to U16 - __ivec _ivec_u32_from_lou16(__ivec s);// Convert lo part of mvec from U16 to U32 - __ivec _ivec_u32_from_hiu16(__ivec s); // Convert hi part of mvec from U16 to U32 + __ivec _ivec_u16_from_u8(__ivec s,__ivec *hipart); // Convert ivec from U8 to U16 + __ivec _ivec_u32_from_u16(__ivec s,__ivec *hipart);// Convert ivec from U16 to U32 + __ivec _ivec_s16_from_s8(__ivec s,__ivec *hipart); // Convert ivec from S8 to S16 + __ivec _ivec_s32_from_s16(__ivec s,__ivec *hipart);// Convert ivec from S16 to S32 + __ivec _ivec_scale_u16_from_u8(__ivec s,__ivec *hipart); // Convert ivec from U8 to U16 and shift left on 8-bit + __ivec _ivec_scale_u32_from_u16(__ivec s,__ivec *hipart);// Convert ivec from U16 to U32 and shift left on 16-bit + __ivec _ivec_s16_from_s32(__ivec s1,__ivec s2); // Convert from S32 to S16 __ivec _ivec_s8_from_s16(__ivec s1,__ivec s2); // Convert from S16 to S8 __ivec _ivec_u8_from_u16(__ivec s1,__ivec s2); // Convert from U16 to U8 + __ivec _ivec_scale_s16_from_s32(__ivec s1,__ivec s2); // Convert from S32 to S16 and shift right on 16-bit + __ivec _ivec_scale_s8_from_s16(__ivec s1,__ivec s2); // Convert from S16 to S8 and shift right on 8-bit + __ivec _ivec_scale_u8_from_u16(__ivec s1,__ivec s2); // Convert from U16 to U8 and shift right on 8-bit + ARITHMETIC engine: ------------------ __ivec _ivec_add_s8(__ivec s1,__ivec s2); // Add S8 @@ -202,4 +213,5 @@ --------------- __f32vec _f32vec_min(__f32vec f1, __f32vec f2); // MIN(f1,f2) __f32vec _f32vec_max(__f32vec f1, __f32vec f2); // MAX(f1,f2) + __f32vec _f32vec_clamp(__f32vec f1, __f32vec minval,__f32vec maxval); // CLAMP(f1,minval,maxval); */ Modified: mplayerxp/pvector/pvector_f32_x86.h =================================================================== --- mplayerxp/pvector/pvector_f32_x86.h 2010-01-28 15:41:48 UTC (rev 129) +++ mplayerxp/pvector/pvector_f32_x86.h 2010-01-28 15:43:33 UTC (rev 130) @@ -317,3 +317,12 @@ } #undef _f32vec_min #define _f32vec_min PVECTOR_RENAME(f32_min) + +extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32_clamp)(__f32vec f1,__f32vec minval,__f32vec maxval) +{ + return _f32vec_max(_f32vec_min(f1,maxval),minval); +} +#undef _f32vec_clamp +#define _f32vec_clamp PVECTOR_RENAME(f32_clamp) + Modified: mplayerxp/pvector/pvector_int_x86.h =================================================================== --- mplayerxp/pvector/pvector_int_x86.h 2010-01-28 15:41:48 UTC (rev 129) +++ mplayerxp/pvector/pvector_int_x86.h 2010-01-28 15:43:33 UTC (rev 130) @@ -414,33 +414,50 @@ #define _ivec_interleave_hi_u32 PVECTOR_RENAME(interleave_hi_u32) extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) -PVECTOR_RENAME(u16_from_lou8)(__ivec s) +PVECTOR_RENAME(u16_from_u8)(__ivec s,__ivec *hipart) { - return _ivec_interleave_lo_u8(s,_ivec_setzero()); + __ivec filler = _ivec_setzero(); + *hipart = _ivec_interleave_hi_u8(s,filler); + return _ivec_interleave_lo_u8(s,filler); } -#undef _ivec_u16_from_lou8 -#define _ivec_u16_from_lou8 PVECTOR_RENAME(u16_from_lou8) +#undef _ivec_u16_from_u8 +#define _ivec_u16_from_u8 PVECTOR_RENAME(u16_from_u8) + extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) -PVECTOR_RENAME(u16_from_hiu8)(__ivec s) +PVECTOR_RENAME(u32_from_u16)(__ivec s,__ivec *hipart) { - return _ivec_interleave_hi_u8(s,_ivec_setzero()); + __ivec filler = _ivec_setzero(); + *hipart = _ivec_interleave_hi_u16(s,filler); + return _ivec_interleave_lo_u16(s,filler); } -#undef _ivec_u16_from_hiu8 -#define _ivec_u16_from_hiu8 PVECTOR_RENAME(u16_from_hiu8) +#undef _ivec_u32_from_u16 +#define _ivec_u32_from_u16 PVECTOR_RENAME(u32_from_u16) + extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) -PVECTOR_RENAME(u32_from_lou16)(__ivec s) +PVECTOR_RENAME(s16_from_s8)(__ivec s,__ivec* hipart) { - return _ivec_interleave_lo_u16(s,_ivec_setzero()); + const __ivec izero = _ivec_setzero(); + __ivec filler; + filler = _ivec_cmpgt_s8(izero,s); + *hipart = _ivec_interleave_hi_u8(s,filler); + return _ivec_interleave_lo_u8(s,filler); } -#undef _ivec_u32_from_lou16 -#define _ivec_u32_from_lou16 PVECTOR_RENAME(u32_from_lou16) +#undef _ivec_s16_from_s8 +#define _ivec_s16_from_s8 PVECTOR_RENAME(s16_from_s8) + extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) -PVECTOR_RENAME(u32_from_hiu16)(__ivec s) +PVECTOR_RENAME(s32_from_s16)(__ivec s,__ivec* hipart) { - return _ivec_interleave_hi_u16(s,_ivec_setzero()); + const __ivec izero = _ivec_setzero(); + __ivec filler; + filler = _ivec_cmpgt_s16(izero,s); + *hipart = _ivec_interleave_hi_u16(s,filler); + return _ivec_interleave_lo_u16(s,filler); } -#undef _ivec_u32_from_hiu16 -#define _ivec_u32_from_hiu16 PVECTOR_RENAME(u32_from_hiu16) +#undef _ivec_s32_from_s16 +#define _ivec_s32_from_s16 PVECTOR_RENAME(s32_from_s16) + + extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) PVECTOR_RENAME(s16_from_s32)(__ivec s1, __ivec s2) { @@ -840,3 +857,61 @@ } #undef _ivec_srl_s64_imm #define _ivec_srl_s64_imm PVECTOR_RENAME(srl_s64_imm) + +extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(scale_u16_from_u8)(__ivec s,__ivec *hipart) +{ +#if 0 /* slower but portable on non-x86 CPUs version */ + __ivec tmp[2]; + tmp[0] = _ivec_u16_from_u8(s,&tmp[1]); + *hipart = _ivec_sll_s16_imm(tmp[1],8); + return _ivec_sll_s16_imm(tmp[0],8); +#else + __ivec filler = _ivec_setzero(); + *hipart = _ivec_interleave_hi_u8(filler,s); + return _ivec_interleave_lo_u8(filler,s); +#endif +} +#undef _ivec_scale_u16_from_u8 +#define _ivec_scale_u16_from_u8 PVECTOR_RENAME(scale_u16_from_u8) + +extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(scale_u32_from_u16)(__ivec s,__ivec *hipart) +{ +#if 0 /* slower but portable on non-x86 CPUs version */ + __ivec tmp[2]; + tmp[0] = _ivec_u32_from_u16(s,&tmp[1]); + *hipart = _ivec_sll_s32_imm(tmp[1],16); + return _ivec_sll_s32_imm(tmp[0],16); +#else + __ivec filler = _ivec_setzero(); + *hipart = _ivec_interleave_hi_u16(filler,s); + return _ivec_interleave_lo_u16(filler,s); +#endif +} +#undef _ivec_scale_u32_from_u16 +#define _ivec_scale_u32_from_u16 PVECTOR_RENAME(scale_u32_from_u16) + +extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(scale_s16_from_s32)(__ivec s1, __ivec s2) +{ + return _ivec_s16_from_s32(_ivec_sra_s32_imm(s1,16),_ivec_sra_s32_imm(s2,16)); +} +#undef _ivec_scale_s16_from_s32 +#define _ivec_scale_s16_from_s32 PVECTOR_RENAME(scale_s16_from_s32) + +extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(scale_s8_from_s16)(__ivec s1, __ivec s2) +{ + return _ivec_s8_from_s16(_ivec_sra_s16_imm(s1,8),_ivec_sra_s16_imm(s2,8)); +} +#undef _ivec_scale_s8_from_s16 +#define _ivec_scale_s8_from_s16 PVECTOR_RENAME(scale_s8_from_s16) +extern __inline __ivec __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(scale_u8_from_u16)(__ivec s1, __ivec s2) +{ + return _ivec_u8_from_u16(_ivec_sra_s16_imm(s1,8),_ivec_sra_s16_imm(s2,8)); +} +#undef _ivec_scale_u8_from_u16 +#define _ivec_scale_u8_from_u16 PVECTOR_RENAME(scale_u8_from_u16) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-28 18:14:11
|
Revision: 133 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=133&view=rev Author: nickols_k Date: 2010-01-28 18:14:04 +0000 (Thu, 28 Jan 2010) Log Message: ----------- schedule next bug-fix release Modified Paths: -------------- NEWS mplayerxp/version.sh Modified: NEWS =================================================================== --- NEWS 2010-01-28 18:09:44 UTC (rev 132) +++ NEWS 2010-01-28 18:14:04 UTC (rev 133) @@ -1,5 +1,11 @@ MplayerXP NEWS -- history of user-visible changes. +Version 0.7.96 + +* enable software scaler in x11 fullscreen mode. Fixed xinerama moving position +* minor speedup and fixes +* fixed some configure-related problems + Version 0.7.95 * significand acceleration of playback. Now 64-bit version can scale 640x480 up to 2000x1500+ at 25 FPS Modified: mplayerxp/version.sh =================================================================== --- mplayerxp/version.sh 2010-01-28 18:09:44 UTC (rev 132) +++ mplayerxp/version.sh 2010-01-28 18:14:04 UTC (rev 133) @@ -1,7 +1,7 @@ #!/bin/sh # define here official release digits. Example: "1.0" -version="0.7.95 " +version="0.7.96 " svn_exec=$(LC_ALL=C which svn) svn_revision= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-01-29 17:57:36
|
Revision: 135 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=135&view=rev Author: nickols_k Date: 2010-01-29 17:57:20 +0000 (Fri, 29 Jan 2010) Log Message: ----------- gcc-related code-generation fixed + gcc-44 related workaround Modified Paths: -------------- functions mplayerxp/configure mplayerxp/cpudetect.c mplayerxp/libvo/osd.c mplayerxp/postproc/dsp.c mplayerxp/postproc/dsp_accel.h mplayerxp/pvector/pvector_int_x86.h Modified: functions =================================================================== --- functions 2010-01-28 19:09:03 UTC (rev 134) +++ functions 2010-01-29 17:57:20 UTC (rev 135) @@ -321,31 +321,40 @@ check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC } -check_asm(){ +test_asm(){ log check_asm "$@" name="$1" asm="$2" shift 2 - check_cc "$@" <<EOF && enable $name || disable $name + check_cc "$@" <<EOF && return 0 || return 1 int foo(void){ asm volatile($asm); } EOF } +check_asm(){ + name="$1" + test_asm "$@" && enable $name || disable $name +} + check_ld(){ log check_ld "$@" check_cc || return check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs } -check_cflags(){ +test_cflags(){ log check_cflags "$@" - check_cc "$@" <<EOF && add_cflags "$@" + check_cc "$@" <<EOF && return 0 || return 1 int x; EOF } +check_cflags(){ + test_cflags "$@" && add_cflags "$@" +} + is_in_cflags(){ value=$1 shift @@ -356,15 +365,19 @@ return 1 } -check_ldflags(){ +test_ldflags(){ log check_ldflags "$@" - check_ld "$@" <<EOF && add_ldflags "$@" + check_ld "$@" <<EOF && return 0 || return 1 int main(void){ return 0; } EOF } +check_ldflags(){ + test_ldflags "$@" && add_ldflags "$@" +} + check_header(){ log check_header "$@" header=$1 @@ -877,6 +890,13 @@ } # Display error message, flushes tempfile, exit +warning() { + log "Warning: $@" + echo + echo "Warning: $@" >&2 + echo >&2 +} + die() { log "Error: $@" echo @@ -1128,8 +1148,13 @@ fi # agree with user-defined architecture/tuning here +if enabled gcc44_workaround ; then +is_in_cflags "-march" || check_cflags "-march=native" +is_in_cflags "-mtune" || check_cflags "-mtune=native" +else is_in_cflags "-march" || check_cflags $locarch is_in_cflags "-mtune" || check_cflags "-mtune=generic" +fi if enabled profile || test $debug -gt 2 || enabled gcov; then add_cflags "-O2 -fno-builtin" if enabled profile ; then @@ -1145,7 +1170,7 @@ add_extralibs "-lgcov" fi else - add_cflags "-O3" + is_in_cflags "-O3" || add_cflags "-O3" mips || check_cflags "-pipe" x86_32 && check_cflags "-fomit-frame-pointer" # -fomit-frame-pointer is not needed for x86_64 @@ -1155,12 +1180,14 @@ is_in_cflags "-mfancy-math-387" || check_cflags "-mfancy-math-387" is_in_cflags "-fno-math-errno" || check_cflags "-fno-math-errno" is_in_cflags "-fno-signed-zeros" || check_cflags "-fno-signed-zeros" -# depend on compiler version -#check_cflags "-fno-tree-vectorize" +# it seems that -mtune=generic doesn't prevent generation of SSE4 opcodes for i686 arch +check_cflags "-fno-tree-vectorize" +check_cflags "-fno-tree-vect-loop-version" +check_cflags "-fno-vect-cost-model" disable mmx_test x86 && enable mmx_test - +enabled gcc44_workaround && disable mmx_test if enabled mmx_test ; then check_cflags -mmmx check_cflags -m3dnow Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-28 19:09:03 UTC (rev 134) +++ mplayerxp/configure 2010-01-29 17:57:20 UTC (rev 135) @@ -238,6 +238,7 @@ add_ldflags "-L/usr/bin" fi +disable gcc44_workaround # Checking CC version... # gcc-3.0 merges optimizations coming from egcs, pgcc, agcc, ... echocheck "$cc version" @@ -247,51 +248,16 @@ cc_version=`$cc -dumpversion` cc_v=$cc_version case $cc_version in - '') - cc_version="v. ?.??, bad" - cc_verc_fail=yes + 4.[4-9]|4.[4-9].[0-9]) + enable gcc44_workaround ;; - 3.2|3.2.[0-2]) - cc_version="$cc_version, bad" - cc_verc_fail=yes + 3.[3-9]|3.[2-9].[3-9]|4.[0-3]|4.[0-3].[0-9]) ;; - 3.[2-9]|3.[2-9].[0-9]|4.[0-9]|4.[0-9].[0-9]) - cc_version="$cc_version, ok" - cc_verc_fail=no - ;; *) - cc_version="$cc_version, bad" - cc_verc_fail=yes + die "*** Bad gcc-$cc_version: Please upgrade C compiler at least to gcc-3.2.3+! ***" ;; esac echores "$cc_version" - test "$cc_verc_fail" = yes && disable fastcall - if enabled fastcall ; then - echocheck "__fastcall optimization abilities" - case $cc_v in - '') - fastcall=no - ;; - # avoid fastcall usage on gcc-2.95.2 and older - 3.[2-9]|3.[2-9].[0-9]|4.[0-9].[0-9]) - fastcall=yes - ;; - *) - fastcall=no - ;; - esac - echores "$fastcall" - fi - - if test "$cc_verc_fail" = yes ; then - cat <<EOF - -*** Please upgrade C compiler to gcc-3.2.3+ version! *** -EOF - die "Bad gcc version" - fi -# --- - # now that we know what compiler should be used for compilation, try to find # out which assembler is used by the $cc compiler if cygwin ; then @@ -1012,6 +978,13 @@ EOF fi +if enabled gcc44_workaround ; then +warning "*** gcc-4.4.x sometime generates AVX opcodes for -mavx key ignoring -fno-tree-vectorize option. +That breaks current logic of mplayerxp configuring. +It is stronly recommended to use this version of gcc for home purposes only! +Please don't use this compiler to produce redistributable executables of mplayerxp!!! ***" +fi + # Last move: rmtmps Modified: mplayerxp/cpudetect.c =================================================================== --- mplayerxp/cpudetect.c 2010-01-28 19:09:03 UTC (rev 134) +++ mplayerxp/cpudetect.c 2010-01-29 17:57:20 UTC (rev 135) @@ -155,44 +155,6 @@ gCpuCaps.hasAVX, gCpuCaps.hasFMA ); - - /* FIXME: Does SSE2 need more OS support, too? */ -#if defined(__linux__) || defined(__FreeBSD__) - if (caps->hasSSE) - check_os_katmai_support(); - if (!caps->hasSSE) - caps->hasSSE2 = 0; -#else - caps->hasSSE=0; - caps->hasSSE2 = 0; -#endif - -#ifndef ARCH_X86_64 -#ifndef CAN_COMPILE_MMX - if(caps->hasMMX) MSG_WARN("MMX supported but disabled\n"); - caps->hasMMX=0; -#endif -#ifndef CAN_COMPILE_MMX2 - if(caps->hasMMX2) MSG_WARN("MMX2 supported but disabled\n"); - caps->hasMMX2=0; -#endif -#ifndef CAN_COMPILE_SSE - if(caps->hasSSE) MSG_WARN("SSE supported but disabled\n"); - caps->hasSSE=0; -#endif -#ifndef CAN_COMPILE_SSE2 - if(caps->hasSSE2) MSG_WARN("SSE2 supported but disabled\n"); - caps->hasSSE2=0; -#endif -#ifndef CAN_COMPILE_3DNOW - if(caps->has3DNow) MSG_WARN("3DNow supported but disabled\n"); - caps->has3DNow=0; -#endif -#ifndef CAN_COMPILE_3DNOW2 - if(caps->has3DNowExt) MSG_WARN("3DNowExt supported but disabled\n"); - caps->has3DNowExt=0; -#endif -#endif } Modified: mplayerxp/libvo/osd.c =================================================================== --- mplayerxp/libvo/osd.c 2010-01-28 19:09:03 UTC (rev 134) +++ mplayerxp/libvo/osd.c 2010-01-29 17:57:20 UTC (rev 135) @@ -115,6 +115,17 @@ #endif /*FIXME the optimized stuff is a lie for 15/16bpp as they arent optimized yet*/ // ordered per speed fasterst first +#ifdef __AVX__ +if(gCpuCaps.hasSSE41) +{ + MSG_V("Using SSE4 Optimized OnScreenDisplay\n"); + vo_draw_alpha_yv12_ptr=vo_draw_alpha_yv12_AVX; + vo_draw_alpha_yuy2_ptr=vo_draw_alpha_yuy2_AVX; + vo_draw_alpha_rgb24_ptr=vo_draw_alpha_rgb24_AVX; + vo_draw_alpha_rgb32_ptr=vo_draw_alpha_rgb32_AVX; +} +else +#endif #ifdef __SSE4_1__ if(gCpuCaps.hasSSE41) { Modified: mplayerxp/postproc/dsp.c =================================================================== --- mplayerxp/postproc/dsp.c 2010-01-28 19:09:03 UTC (rev 134) +++ mplayerxp/postproc/dsp.c 2010-01-29 17:57:20 UTC (rev 135) @@ -666,6 +666,10 @@ static void __FASTCALL__ init_change_bps(const void* in, void* out, unsigned len, unsigned inbps, unsigned outbps,int final) { +#ifdef __AVX__ + if(gCpuCaps.hasAVX) change_bps = change_bps_AVX; + else +#endif #ifdef __SSE4_1__ if(gCpuCaps.hasSSE41) change_bps = change_bps_SSE4; else @@ -683,10 +687,6 @@ if(gCpuCaps.hasMMX2) change_bps = change_bps_SSE; else #endif -#ifdef __MMX__ - if(gCpuCaps.hasMMX) change_bps = change_bps_MMX; - else -#endif #endif /* __x86_64__ */ change_bps = change_bps_c; (*change_bps)(in,out,len,inbps,outbps,final); @@ -779,10 +779,6 @@ if(gCpuCaps.hasMMX2) FIR_i16 = FIR_i16_SSE; else #endif -#ifdef __MMX__ - if(gCpuCaps.hasMMX) FIR_i16 = FIR_i16_MMX; - else -#endif #endif /*__x86_64__*/ FIR_i16 = FIR_i16_c; return (*FIR_i16)(x,w); Modified: mplayerxp/postproc/dsp_accel.h =================================================================== --- mplayerxp/postproc/dsp_accel.h 2010-01-28 19:09:03 UTC (rev 134) +++ mplayerxp/postproc/dsp_accel.h 2010-01-29 17:57:20 UTC (rev 135) @@ -276,7 +276,7 @@ #endif static int32_t __FASTCALL__ PVECTOR_RENAME(FIR_i16)(int16_t *x,int16_t *w) { -#ifdef OPTIMIZE_MMX +#ifdef OPTIMIZE_SSE __m64 mm[8]; mm[0] = _m_load(&w[0]); mm[1] = _m_load(&w[4]); @@ -291,12 +291,8 @@ mm[0] = _m_paddd(mm[4],mm[5]); mm[1] = _m_paddd(mm[6],mm[7]); mm[2] = _m_paddd(mm[0],mm[1]); -#ifdef OPTIMIZE_SSE mm[0] = _m_pshufw(mm[2],0xFE); -#else - mm[0] = mm[2]; - mm[0] = _m_psrlqi(mm[0],32); -#endif + mm[0] = _m_paddd(mm[0],mm[2]); mm[0] = _m_psrldi(mm[0],16); return _mm_cvtsi64_si32(mm[0]); Modified: mplayerxp/pvector/pvector_int_x86.h =================================================================== --- mplayerxp/pvector/pvector_int_x86.h 2010-01-28 19:09:03 UTC (rev 134) +++ mplayerxp/pvector/pvector_int_x86.h 2010-01-29 17:57:20 UTC (rev 135) @@ -2,10 +2,10 @@ pvector_int_x86.h */ -//#if defined( OPTIMIZE_AVX ) -//#define _VEC(a) a ## _AVX -//#include <immintrin.h> -#if defined(OPTIMIZE_AES) +#if defined( OPTIMIZE_AVX ) +#define _VEC(a) a ## _AVX +#include <immintrin.h> +#elif defined(OPTIMIZE_AES) #include <wmmintrin.h> #elif defined (OPTIMIZE_SSE4) #include <smmintrin.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-06-26 10:35:17
|
Revision: 147 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=147&view=rev Author: nickols_k Date: 2010-06-26 10:35:11 +0000 (Sat, 26 Jun 2010) Log Message: ----------- compilation fixed Modified Paths: -------------- mplayerxp/postproc/dsp.c mplayerxp/pvector/pvector_int_x86.h Modified: mplayerxp/postproc/dsp.c =================================================================== --- mplayerxp/postproc/dsp.c 2010-06-26 09:58:27 UTC (rev 146) +++ mplayerxp/postproc/dsp.c 2010-06-26 10:35:11 UTC (rev 147) @@ -801,7 +801,7 @@ else #endif #ifdef __3dNOW__ - if(gCpuCaps.has3DNow) FIR_f32 = FIR_f32_3DNow; + if(gCpuCaps.has3DNow) FIR_f32 = FIR_f32_3DNOW; else #endif #endif /*__x86_64__*/ Modified: mplayerxp/pvector/pvector_int_x86.h =================================================================== --- mplayerxp/pvector/pvector_int_x86.h 2010-06-26 09:58:27 UTC (rev 146) +++ mplayerxp/pvector/pvector_int_x86.h 2010-06-26 10:35:11 UTC (rev 147) @@ -17,6 +17,9 @@ #include <emmintrin.h> #elif defined(OPTIMIZE_MMX2) #include <xmmintrin.h> +#ifdef OPTIMIZE_3DNOW +#include <mm3dnow.h> +#endif #else #include <mmintrin.h> #endif @@ -34,7 +37,9 @@ extern __inline void __attribute__((__gnu_inline__, __always_inline__)) PVECTOR_RENAME(empty)(void) { -#ifdef OPTIMIZE_SSE2 +#if defined( OPTIMIZE_SSE2 ) || defined( OPTIMIZE_SSE ) +#elif defined( OPTIMIZE_3DNOW ) + _m_femms(); #else _mm_empty(); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2010-08-18 14:01:17
|
Revision: 149 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=149&view=rev Author: nickols_k Date: 2010-08-18 14:01:11 +0000 (Wed, 18 Aug 2010) Log Message: ----------- free project from complex philosophical terms Modified Paths: -------------- COPYING TOOLS/mem2dump.c mplayerxp/dec_ahead.c mplayerxp/libmpdemux/demux_avi.c mplayerxp/libmpdemux/demux_mkv.c mplayerxp/libmpdemux/demux_pva.c mplayerxp/libmpdemux/demux_real.c mplayerxp/libmpdemux/librtsp/rtsp_rtp.c mplayerxp/libmpdemux/s_file.c mplayerxp/libmpdemux/stream.h mplayerxp/loader/pe_image.c mplayerxp/loader/wine/avifmt.h mplayerxp/loader/wine/winnt.h mplayerxp/loader/wine/winuser.h mplayerxp/nls/help_mp-cz.h mplayerxp/nls/help_mp-dk.h mplayerxp/nls/help_mp-en.h mplayerxp/nls/help_mp-es.h mplayerxp/nls/help_mp-fr.h mplayerxp/nls/help_mp-nl.h mplayerxp/nls/help_mp-no.h mplayerxp/nls/help_mp-ro.h Modified: COPYING =================================================================== --- COPYING 2010-07-27 14:02:33 UTC (rev 148) +++ COPYING 2010-08-18 14:01:11 UTC (rev 149) @@ -278,62 +278,3 @@ POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) 19yy <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. Modified: TOOLS/mem2dump.c =================================================================== --- TOOLS/mem2dump.c 2010-07-27 14:02:33 UTC (rev 148) +++ TOOLS/mem2dump.c 2010-08-18 14:01:11 UTC (rev 149) @@ -1,6 +1,6 @@ /* bios2dump.c - Was designed to dump memory block to file. - Usage: as argument requires absolute address of memory dump and its lenght + Usage: as argument requires a full address of memory dump and its lenght (int hexadecimal form). as output - will write file which will named: memADDR_LEN.dump where: ADDR - given address of memory Modified: mplayerxp/dec_ahead.c =================================================================== --- mplayerxp/dec_ahead.c 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/dec_ahead.c 2010-08-18 14:01:11 UTC (rev 149) @@ -87,7 +87,7 @@ extern int loop_times; /* it's const for xp mode */ extern float rel_seek_secs; /* FIXME: in hope that user will not rewind */ -extern int abs_seek_pos; /* the movie at end of file :( */ +extern int sof_seek_pos; /* the movie at end of file :( */ extern int decore_audio( int xp_id ); extern int mpxp_seek_time; Modified: mplayerxp/libmpdemux/demux_avi.c =================================================================== --- mplayerxp/libmpdemux/demux_avi.c 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/libmpdemux/demux_avi.c 2010-08-18 14:01:11 UTC (rev 149) @@ -1284,7 +1284,7 @@ // bad video header, try to get number of frames from audio if(sh_audio && sh_audio->wf->nAvgBytesPerSec) priv->numberofframes=sh_video->fps*sh_audio->audio.dwLength/sh_audio->audio.dwRate*sh_audio->audio.dwScale; if(priv->numberofframes<=1){ - MSG_WARN("Could not determine number of frames (for absolute seek)\n"); + MSG_WARN("Could not determine number of frames (for SOF seek)\n"); priv->numberofframes=0; } @@ -1351,7 +1351,7 @@ int i; if(flags&DEMUX_SEEK_SET){ - // seek absolute + // seek SOF video_chunk_pos=0; } Modified: mplayerxp/libmpdemux/demux_mkv.c =================================================================== --- mplayerxp/libmpdemux/demux_mkv.c 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/libmpdemux/demux_mkv.c 2010-08-18 14:01:11 UTC (rev 149) @@ -3862,7 +3862,7 @@ (int64_t) mkv_d->indexes[i].timecode * mkv_d->tc_scale / 1000000.0; if ((flags & 1 || target_timecode <= mkv_d->last_pts*1000)) { - // Absolute seek or seek backward: find the last index + // SOF seek or seek backward: find the last index // position before target time if (diff < 0 || diff >= min_diff) continue; Modified: mplayerxp/libmpdemux/demux_pva.c =================================================================== --- mplayerxp/libmpdemux/demux_pva.c 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/libmpdemux/demux_pva.c 2010-08-18 14:01:11 UTC (rev 149) @@ -480,11 +480,11 @@ total_bitrate=((sh_audio_t *)demuxer->audio->sh)->i_bps + ((sh_video_t *)demuxer->video->sh)->i_bps; /* - * Compute absolute offset inside the stream. Approximate total bitrate with sum of bitrates + * Compute SOF offset inside the stream. Approximate total bitrate with sum of bitrates * reported by the audio and video codecs. The seek is not accurate because, just like * with MPEG streams, the bitrate is not constant. Moreover, we do not take into account * the overhead caused by PVA and PES headers. - * If the calculated absolute offset is negative, seek to the beginning of the file. + * If the calculated SOF offset is negative, seek to the beginning of the file. */ dest_offset=(flags&DEMUX_SEEK_SET?demuxer->movi_start:stream_tell(demuxer->stream))+rel_seek_secs*total_bitrate; Modified: mplayerxp/libmpdemux/demux_real.c =================================================================== --- mplayerxp/libmpdemux/demux_real.c 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/libmpdemux/demux_real.c 2010-08-18 14:01:11 UTC (rev 149) @@ -1524,7 +1524,7 @@ return; if (flags & DEMUX_SEEK_SET) - /* seek absolute */ + /* seek SOF */ priv->current_apacket = priv->current_vpacket = 0; if ((streams & 1) && priv->current_vpacket >= priv->index_table_size[vid]) Modified: mplayerxp/libmpdemux/librtsp/rtsp_rtp.c =================================================================== --- mplayerxp/libmpdemux/librtsp/rtsp_rtp.c 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/libmpdemux/librtsp/rtsp_rtp.c 2010-08-18 14:01:11 UTC (rev 149) @@ -613,7 +613,7 @@ rtsp_schedule_field (rtsp_session, temp_buf); /* 10. check for the media control URL type and initiate RTSP SETUP */ - if (!strncmp (rtp_session->control_url, "rtsp://", 7)) /* absolute URL */ + if (!strncmp (rtp_session->control_url, "rtsp://", 7)) /* full URL */ statut = rtsp_request_setup (rtsp_session, rtp_session->control_url, NULL); else /* relative URL */ Modified: mplayerxp/libmpdemux/s_file.c =================================================================== --- mplayerxp/libmpdemux/s_file.c 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/libmpdemux/s_file.c 2010-08-18 14:01:11 UTC (rev 149) @@ -34,7 +34,7 @@ if(stream->end_pos == -1) stream->type = STREAMTYPE_STREAM; else stream->type = STREAMTYPE_SEEKABLE; /* decreasing number of packet from 256 to 10 speedups cache2 from 3.27% to 1.26% - with absolute speed 1.04% for -nocache */ + with full speed 1.04% for -nocache */ /* Note: Please locate sector_size changinf after all read/write operations of open() function */ stream->sector_size=stream_cache_size?stream_cache_size*1024/10:STREAM_BUFFER_SIZE; ((file_priv_t*)stream->priv)->spos = 0; Modified: mplayerxp/libmpdemux/stream.h =================================================================== --- mplayerxp/libmpdemux/stream.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/libmpdemux/stream.h 2010-08-18 14:01:11 UTC (rev 149) @@ -40,7 +40,7 @@ /** Stream description */ typedef struct stream_s{ int fd; /**< file handler */ - off_t pos; /**< absolute offset from begin of stream */ + off_t pos; /**< SOF offset from begin of stream */ int eof; /**< indicates EOF */ int type; /**< properties of the stream (see STREAMTYPE_ for detail) */ int file_format; /**< detected file format (by http:// protocol for example) */ @@ -179,7 +179,7 @@ /** Seeks on new stream position * @param _this points structure which identifies stream - * @param off absolute offset from begin of stream + * @param off SOF offset from begin of stream * @return real offset after seeking **/ off_t (* __FASTCALL__ seek)(stream_t *_this,off_t off); Modified: mplayerxp/loader/pe_image.c =================================================================== --- mplayerxp/loader/pe_image.c 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/loader/pe_image.c 2010-08-18 14:01:11 UTC (rev 149) @@ -392,7 +392,7 @@ // TRACE_(fixup)("patching %x type %x\n", offset, type); switch(type) { - case IMAGE_REL_BASED_ABSOLUTE: break; + case IMAGE_REL_BASED_FULL: break; case IMAGE_REL_BASED_HIGH: *(short*)(page+offset) += hdelta; break; Modified: mplayerxp/loader/wine/avifmt.h =================================================================== --- mplayerxp/loader/wine/avifmt.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/loader/wine/avifmt.h 2010-08-18 14:01:11 UTC (rev 149) @@ -240,14 +240,14 @@ typedef struct __attribute__((packed)) _avisuperindex_entry { - QWORD qwOffset; // absolute file offset + QWORD qwOffset; // full file offset DWORD dwSize; // size of index chunk at this offset DWORD dwDuration; // time span in stream ticks } avisuperindex_entry; typedef struct __attribute__((packed)) _avistdindex_entry { - DWORD dwOffset; // qwBaseOffset + this is absolute file offset + DWORD dwOffset; // qwBaseOffset + this is full file offset DWORD dwSize; // bit 31 is set if this is NOT a keyframe } avistdindex_entry; Modified: mplayerxp/loader/wine/winnt.h =================================================================== --- mplayerxp/loader/wine/winnt.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/loader/wine/winnt.h 2010-08-18 14:01:11 UTC (rev 149) @@ -1494,7 +1494,7 @@ #include "poppack.h" #define IMAGE_SYM_UNDEFINED (SHORT)0 -#define IMAGE_SYM_ABSOLUTE (SHORT)-1 +#define IMAGE_SYM_FULL (SHORT)-1 #define IMAGE_SYM_DEBUG (SHORT)-2 #define IMAGE_SYM_TYPE_NULL 0x0000 @@ -1685,7 +1685,7 @@ #define IMAGE_SIZEOF_RELOCATION 10 /* generic relocation types */ -#define IMAGE_REL_BASED_ABSOLUTE 0 +#define IMAGE_REL_BASED_FULL 0 #define IMAGE_REL_BASED_HIGH 1 #define IMAGE_REL_BASED_LOW 2 #define IMAGE_REL_BASED_HIGHLOW 3 @@ -1699,7 +1699,7 @@ #define IMAGE_REL_BASED_HIGH3ADJ 11 /* I386 relocation types */ -#define IMAGE_REL_I386_ABSOLUTE 0 +#define IMAGE_REL_I386_FULL 0 #define IMAGE_REL_I386_DIR16 1 #define IMAGE_REL_I386_REL16 2 #define IMAGE_REL_I386_DIR32 6 @@ -1710,7 +1710,7 @@ #define IMAGE_REL_I386_REL32 20 /* MIPS relocation types */ -#define IMAGE_REL_MIPS_ABSOLUTE 0x0000 +#define IMAGE_REL_MIPS_FULL 0x0000 #define IMAGE_REL_MIPS_REFHALF 0x0001 #define IMAGE_REL_MIPS_REFWORD 0x0002 #define IMAGE_REL_MIPS_JMPADDR 0x0003 @@ -1727,7 +1727,7 @@ #define IMAGE_REL_MIPS_PAIR 0x0025 /* ALPHA relocation types */ -#define IMAGE_REL_ALPHA_ABSOLUTE 0x0000 +#define IMAGE_REL_ALPHA_FULL 0x0000 #define IMAGE_REL_ALPHA_REFLONG 0x0001 #define IMAGE_REL_ALPHA_REFQUAD 0x0002 #define IMAGE_REL_ALPHA_GPREL 0x0003 @@ -1753,7 +1753,7 @@ #define IMAGE_REL_ALPHA_GPRELHI 0x0017 /* PowerPC relocation types */ -#define IMAGE_REL_PPC_ABSOLUTE 0x0000 +#define IMAGE_REL_PPC_FULL 0x0000 #define IMAGE_REL_PPC_ADDR64 0x0001 #define IMAGE_REL_PPC_ADDR 0x0002 #define IMAGE_REL_PPC_ADDR24 0x0003 @@ -1783,7 +1783,7 @@ #define IMAGE_REL_PPC_TOCDEFN 0x0800 /* SH3 ? relocation type */ -#define IMAGE_REL_SH3_ABSOLUTE 0x0000 +#define IMAGE_REL_SH3_FULL 0x0000 #define IMAGE_REL_SH3_DIRECT16 0x0001 #define IMAGE_REL_SH3_DIRECT 0x0002 #define IMAGE_REL_SH3_DIRECT8 0x0003 @@ -1802,7 +1802,7 @@ #define IMAGE_REL_SH3_DIRECT32_NB 0x0010 /* ARM (Archimedes?) relocation types */ -#define IMAGE_REL_ARM_ABSOLUTE 0x0000 +#define IMAGE_REL_ARM_FULL 0x0000 #define IMAGE_REL_ARM_ADDR 0x0001 #define IMAGE_REL_ARM_ADDR32NB 0x0002 #define IMAGE_REL_ARM_BRANCH24 0x0003 @@ -1811,7 +1811,7 @@ #define IMAGE_REL_ARM_SECREL 0x000F /* IA64 relocation types */ -#define IMAGE_REL_IA64_ABSOLUTE 0x0000 +#define IMAGE_REL_IA64_FULL 0x0000 #define IMAGE_REL_IA64_IMM14 0x0001 #define IMAGE_REL_IA64_IMM22 0x0002 #define IMAGE_REL_IA64_IMM64 0x0003 Modified: mplayerxp/loader/wine/winuser.h =================================================================== --- mplayerxp/loader/wine/winuser.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/loader/wine/winuser.h 2010-08-18 14:01:11 UTC (rev 149) @@ -1982,7 +1982,7 @@ #define MOUSEEVENTF_MIDDLEDOWN 0x0020 #define MOUSEEVENTF_MIDDLEUP 0x0040 #define MOUSEEVENTF_WHEEL 0x0800 -#define MOUSEEVENTF_ABSOLUTE 0x8000 +#define MOUSEEVENTF_ABS 0x8000 /* ExitWindows() flags */ #define EW_RESTARTWINDOWS 0x0042 Modified: mplayerxp/nls/help_mp-cz.h =================================================================== --- mplayerxp/nls/help_mp-cz.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/nls/help_mp-cz.h 2010-08-18 14:01:11 UTC (rev 149) @@ -136,7 +136,7 @@ #define MSGTR_NI_Message "%s NEPROKLÁDANÝ formát souboru AVI!\n" #define MSGTR_UsingNINI "Používám NEPROKLÁDANÝ poškozený formát souboru AVI!\n" //tohle taky nějak opravit -#define MSGTR_CouldntDetFNo "Nemohu určit počet snímků (pro absolutní posun) \n" +#define MSGTR_CouldntDetFNo "Nemohu určit počet snímků (pro SOFní posun) \n" #define MSGTR_CantSeekRawAVI "Nelze se posouvat v surových (raw) .AVI proudech! (Potřebuji index, zkuste použít volbu -idx !) \n" #define MSGTR_CantSeekFile "Nemohu posouvat v tomto souboru! \n" Modified: mplayerxp/nls/help_mp-dk.h =================================================================== --- mplayerxp/nls/help_mp-dk.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/nls/help_mp-dk.h 2010-08-18 14:01:11 UTC (rev 149) @@ -134,7 +134,7 @@ #define MSGTR_NI_Message "%s NON-INTERLEAVED AVI fil-format!\n" #define MSGTR_UsingNINI "Bruger NON-INTERLEAVED ødelagt AVI fil-format!\n" -#define MSGTR_CouldntDetFNo "Kunne ikke finde antallet af billeder (for en absolute søgning) \n" +#define MSGTR_CouldntDetFNo "Kunne ikke finde antallet af billeder (for en SOF søgning) \n" #define MSGTR_CantSeekRawAVI "Kan ikke søge i rå .AVI streams! (manglende index, prøv med -idx!) \n" #define MSGTR_CantSeekFile "Kan ikke søge i denne fil! \n" #define MSGTR_EncryptedVOB "Krypteret VOB fil (ikke kompileret med libcss support)! Læs filen DOCS/cd-dvd.html\n" Modified: mplayerxp/nls/help_mp-en.h =================================================================== --- mplayerxp/nls/help_mp-en.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/nls/help_mp-en.h 2010-08-18 14:01:11 UTC (rev 149) @@ -377,7 +377,7 @@ #define MSGTR_UsingNINI "Using NON-INTERLEAVED Broken AVI file-format!\n" #endif #ifndef MSGTR_CouldntDetFNo -#define MSGTR_CouldntDetFNo "Couldn't determine number of frames (for absolute seek) \n" +#define MSGTR_CouldntDetFNo "Couldn't determine number of frames (for SOF seek) \n" #endif #ifndef MSGTR_CantSeekRawAVI #define MSGTR_CantSeekRawAVI "Can't seek in raw .AVI streams! (index required, try with the -idx switch!) \n" Modified: mplayerxp/nls/help_mp-es.h =================================================================== --- mplayerxp/nls/help_mp-es.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/nls/help_mp-es.h 2010-08-18 14:01:11 UTC (rev 149) @@ -134,7 +134,7 @@ #define MSGTR_NI_Message "%s formato de AVI 'NON-INTERLEAVED'!\n" #define MSGTR_UsingNINI "Usando formato de AVI roto 'NON-INTERLEAVED'!\n" -#define MSGTR_CouldntDetFNo "No se puede determinar el número de cuadros (para una búsqueda absoluta)\n" +#define MSGTR_CouldntDetFNo "No se puede determinar el número de cuadros (para una búsqueda SOF)\n" #define MSGTR_CantSeekRawAVI "No se puede avanzar/retroceder en un stream crudo .AVI! (se requiere índice, pruebe con -idx!) \n" #define MSGTR_CantSeekFile "No se puede avanzar/retroceder en este archivo! \n" Modified: mplayerxp/nls/help_mp-fr.h =================================================================== --- mplayerxp/nls/help_mp-fr.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/nls/help_mp-fr.h 2010-08-18 14:01:11 UTC (rev 149) @@ -138,7 +138,7 @@ #define MSGTR_NI_Message "%s format de fichier AVI NON-ENTRELACÉ!\n" #define MSGTR_UsingNINI "Utilise fichier de format AVI NON-ENTRELACÉ défectueux!\n" -#define MSGTR_CouldntDetFNo "Ne peut déterminer le nombre de frames (pour recherche absolue) \n" +#define MSGTR_CouldntDetFNo "Ne peut déterminer le nombre de frames (pour recherche SOF) \n" #define MSGTR_CantSeekRawAVI "Ne peut chercher dans un flux .AVI brut! (index requis, essayez l'option -idx!)\n" #define MSGTR_CantSeekFile "Ne peut chercher dans ce fichier! \n" Modified: mplayerxp/nls/help_mp-nl.h =================================================================== --- mplayerxp/nls/help_mp-nl.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/nls/help_mp-nl.h 2010-08-18 14:01:11 UTC (rev 149) @@ -132,7 +132,7 @@ #define MSGTR_NI_Message "%s NON-INTERLEAVED AVI bestandsformaat!\n" #define MSGTR_UsingNINI "NON-INTERLEAVED Broken AVI bestandsformaat wordt gebruikt!\n" -#define MSGTR_CouldntDetFNo "Kon het aantal frames niet bepalen (voor absolute verplaatsing) \n" +#define MSGTR_CouldntDetFNo "Kon het aantal frames niet bepalen (voor SOF verplaatsing) \n" #define MSGTR_CantSeekRawAVI "Kan niet in raw .AVI streams verplaatsen! (index nodig, probeer met de -idx optie!) \n" #define MSGTR_CantSeekFile "Kan niet verplaatsen in dit bestand! \n" Modified: mplayerxp/nls/help_mp-no.h =================================================================== --- mplayerxp/nls/help_mp-no.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/nls/help_mp-no.h 2010-08-18 14:01:11 UTC (rev 149) @@ -133,7 +133,7 @@ #define MSGTR_NI_Message "%s IKKE-INTERLEAVED AVI filformat!\n" #define MSGTR_UsingNINI "Bruker NON-INTERLEAVED Ødelagt AVI filformat!\n" -#define MSGTR_CouldntDetFNo "Kan ikke bestemme antall frames (for absolutt søk) \n" +#define MSGTR_CouldntDetFNo "Kan ikke bestemme antall frames (for SOF søk) \n" #define MSGTR_CantSeekRawAVI "Kan ikke søke i rå .AVI streams! (index behøves, prøv med -idx valget!) \n" #define MSGTR_CantSeekFile "Kan ikke søke i denne filen! \n" Modified: mplayerxp/nls/help_mp-ro.h =================================================================== --- mplayerxp/nls/help_mp-ro.h 2010-07-27 14:02:33 UTC (rev 148) +++ mplayerxp/nls/help_mp-ro.h 2010-08-18 14:01:11 UTC (rev 149) @@ -131,7 +131,7 @@ #define MSGTR_NI_Message "%s fişier AVI NE-ÎNTREŢESUT!\n" #define MSGTR_UsingNINI "Folosesc fişier AVI NE-ÎNTREŢESUT eronat!\n" -#define MSGTR_CouldntDetFNo "Nu pot determina numărul de cadre (pentru căutare absolută)\n" +#define MSGTR_CouldntDetFNo "Nu pot determina numărul de cadre (pentru căutare SOFă)\n" #define MSGTR_CantSeekRawAVI "Nu pot căuta în fişiere .AVI neindexate! (am nevoie de index, încercaţi cu -idx!) \n" #define MSGTR_CantSeekFile "Nu pot căuta în fişier! \n" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2012-10-12 13:19:35
|
Revision: 151 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=151&view=rev Author: nickols_k Date: 2012-10-12 13:19:04 +0000 (Fri, 12 Oct 2012) Log Message: ----------- make it compatible with ffmpeg-1.0 Modified Paths: -------------- mplayerxp/libmpcodecs/ad_ffmp3.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpdemux/Makefile mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/demuxer.c mplayerxp/libmpdemux/muxer.c mplayerxp/libmpdemux/s_ffmpeg.c mplayerxp/postproc/af_ffenc.c mplayerxp/postproc/postprocess.c mplayerxp/postproc/postprocess.h mplayerxp/postproc/swscale.c mplayerxp/postproc/swscale.h mplayerxp/postproc/vf_pp.c mplayerxp/postproc/vf_rgb2bgr.c mplayerxp/postproc/vf_scale.c mplayerxp/postproc/vf_yuy2.c mplayerxp/postproc/vf_yvu9.c Added Paths: ----------- ffmpeg/ ffmpeg/.config ffmpeg/COPYING.GPLv2 ffmpeg/COPYING.GPLv3 ffmpeg/COPYING.LGPLv2.1 ffmpeg/COPYING.LGPLv3 ffmpeg/CREDITS ffmpeg/Changelog ffmpeg/Doxyfile ffmpeg/INSTALL ffmpeg/LICENSE ffmpeg/MAINTAINERS ffmpeg/Makefile ffmpeg/README ffmpeg/RELEASE ffmpeg/VERSION ffmpeg/arch.mak ffmpeg/cmdutils.c ffmpeg/cmdutils.h ffmpeg/cmdutils_common_opts.h ffmpeg/common.mak ffmpeg/compat/ ffmpeg/compat/getopt.c ffmpeg/compat/msvcrt/ ffmpeg/compat/msvcrt/snprintf.c ffmpeg/compat/msvcrt/snprintf.h ffmpeg/compat/strtod.c ffmpeg/compat/va_copy.h ffmpeg/configure ffmpeg/doc/ ffmpeg/doc/APIchanges ffmpeg/doc/Makefile ffmpeg/doc/RELEASE_NOTES ffmpeg/doc/avtools-common-opts.texi ffmpeg/doc/avutil.txt ffmpeg/doc/bitstream_filters.texi ffmpeg/doc/build_system.txt ffmpeg/doc/decoders.texi ffmpeg/doc/demuxers.texi ffmpeg/doc/developer.texi ffmpeg/doc/doxy/ ffmpeg/doc/doxy/doxy_stylesheet.css ffmpeg/doc/doxy/footer.html ffmpeg/doc/doxy/header.html ffmpeg/doc/encoders.texi ffmpeg/doc/errno.txt ffmpeg/doc/eval.texi ffmpeg/doc/examples/ ffmpeg/doc/examples/Makefile ffmpeg/doc/examples/decoding_encoding.c ffmpeg/doc/examples/demuxing.c ffmpeg/doc/examples/filtering_audio.c ffmpeg/doc/examples/filtering_video.c ffmpeg/doc/examples/metadata.c ffmpeg/doc/examples/muxing.c ffmpeg/doc/examples/pc-uninstalled/ ffmpeg/doc/examples/pc-uninstalled/libavcodec.pc ffmpeg/doc/examples/pc-uninstalled/libavdevice.pc ffmpeg/doc/examples/pc-uninstalled/libavfilter.pc ffmpeg/doc/examples/pc-uninstalled/libavformat.pc ffmpeg/doc/examples/pc-uninstalled/libavutil.pc ffmpeg/doc/examples/pc-uninstalled/libpostproc.pc ffmpeg/doc/examples/pc-uninstalled/libswresample.pc ffmpeg/doc/examples/pc-uninstalled/libswscale.pc ffmpeg/doc/examples/scaling_video.c ffmpeg/doc/faq.texi ffmpeg/doc/fate.texi ffmpeg/doc/ffmpeg.texi ffmpeg/doc/ffmpeg.txt ffmpeg/doc/ffplay.texi ffmpeg/doc/ffprobe.texi ffmpeg/doc/ffprobe.xsd ffmpeg/doc/ffserver.conf ffmpeg/doc/ffserver.texi ffmpeg/doc/filter_design.txt ffmpeg/doc/filters.texi ffmpeg/doc/general.texi ffmpeg/doc/git-howto.texi ffmpeg/doc/git-howto.txt ffmpeg/doc/indevs.texi ffmpeg/doc/issue_tracker.txt ffmpeg/doc/metadata.texi ffmpeg/doc/mips.txt ffmpeg/doc/multithreading.txt ffmpeg/doc/muxers.texi ffmpeg/doc/optimization.txt ffmpeg/doc/outdevs.texi ffmpeg/doc/platform.texi ffmpeg/doc/print_options.c ffmpeg/doc/protocols.texi ffmpeg/doc/rate_distortion.txt ffmpeg/doc/snow.txt ffmpeg/doc/soc.txt ffmpeg/doc/swresample.txt ffmpeg/doc/swscale.txt ffmpeg/doc/syntax.texi ffmpeg/doc/t2h.init ffmpeg/doc/tablegen.txt ffmpeg/doc/texi2pod.pl ffmpeg/doc/viterbi.txt ffmpeg/ffmpeg.c ffmpeg/ffmpeg.h ffmpeg/ffmpeg_filter.c ffmpeg/ffmpeg_opt.c ffmpeg/ffplay.c ffmpeg/ffprobe.c ffmpeg/ffserver.c ffmpeg/libavcodec/ ffmpeg/libavcodec/4xm.c ffmpeg/libavcodec/8bps.c ffmpeg/libavcodec/8svx.c ffmpeg/libavcodec/Makefile ffmpeg/libavcodec/a64colors.h ffmpeg/libavcodec/a64enc.h ffmpeg/libavcodec/a64multienc.c ffmpeg/libavcodec/a64tables.h ffmpeg/libavcodec/aac.h ffmpeg/libavcodec/aac_ac3_parser.c ffmpeg/libavcodec/aac_ac3_parser.h ffmpeg/libavcodec/aac_adtstoasc_bsf.c ffmpeg/libavcodec/aac_parser.c ffmpeg/libavcodec/aac_tablegen.c ffmpeg/libavcodec/aac_tablegen.h ffmpeg/libavcodec/aac_tablegen_decl.h ffmpeg/libavcodec/aacadtsdec.c ffmpeg/libavcodec/aacadtsdec.h ffmpeg/libavcodec/aaccoder.c ffmpeg/libavcodec/aacdec.c ffmpeg/libavcodec/aacdectab.h ffmpeg/libavcodec/aacenc.c ffmpeg/libavcodec/aacenc.h ffmpeg/libavcodec/aacps.c ffmpeg/libavcodec/aacps.h ffmpeg/libavcodec/aacps_tablegen.c ffmpeg/libavcodec/aacps_tablegen.h ffmpeg/libavcodec/aacpsdata.c ffmpeg/libavcodec/aacpsdsp.c ffmpeg/libavcodec/aacpsdsp.h ffmpeg/libavcodec/aacpsy.c ffmpeg/libavcodec/aacpsy.h ffmpeg/libavcodec/aacsbr.c ffmpeg/libavcodec/aacsbr.h ffmpeg/libavcodec/aacsbrdata.h ffmpeg/libavcodec/aactab.c ffmpeg/libavcodec/aactab.h ffmpeg/libavcodec/aandcttab.c ffmpeg/libavcodec/aandcttab.h ffmpeg/libavcodec/aasc.c ffmpeg/libavcodec/ac3.c ffmpeg/libavcodec/ac3.h ffmpeg/libavcodec/ac3_parser.c ffmpeg/libavcodec/ac3_parser.h ffmpeg/libavcodec/ac3dec.c ffmpeg/libavcodec/ac3dec.h ffmpeg/libavcodec/ac3dec_data.c ffmpeg/libavcodec/ac3dec_data.h ffmpeg/libavcodec/ac3dsp.c ffmpeg/libavcodec/ac3dsp.h ffmpeg/libavcodec/ac3enc.c ffmpeg/libavcodec/ac3enc.h ffmpeg/libavcodec/ac3enc_fixed.c ffmpeg/libavcodec/ac3enc_float.c ffmpeg/libavcodec/ac3enc_opts_template.c ffmpeg/libavcodec/ac3enc_template.c ffmpeg/libavcodec/ac3tab.c ffmpeg/libavcodec/ac3tab.h ffmpeg/libavcodec/acelp_filters.c ffmpeg/libavcodec/acelp_filters.h ffmpeg/libavcodec/acelp_pitch_delay.c ffmpeg/libavcodec/acelp_pitch_delay.h ffmpeg/libavcodec/acelp_vectors.c ffmpeg/libavcodec/acelp_vectors.h ffmpeg/libavcodec/adpcm.c ffmpeg/libavcodec/adpcm.h ffmpeg/libavcodec/adpcm_data.c ffmpeg/libavcodec/adpcm_data.h ffmpeg/libavcodec/adpcmenc.c ffmpeg/libavcodec/adx.c ffmpeg/libavcodec/adx.h ffmpeg/libavcodec/adx_parser.c ffmpeg/libavcodec/adxdec.c ffmpeg/libavcodec/adxenc.c ffmpeg/libavcodec/alac.c ffmpeg/libavcodec/alacenc.c ffmpeg/libavcodec/allcodecs.c ffmpeg/libavcodec/alpha/ ffmpeg/libavcodec/alpha/Makefile ffmpeg/libavcodec/alpha/asm.h ffmpeg/libavcodec/alpha/dsputil_alpha.c ffmpeg/libavcodec/alpha/dsputil_alpha.h ffmpeg/libavcodec/alpha/dsputil_alpha_asm.S ffmpeg/libavcodec/alpha/motion_est_alpha.c ffmpeg/libavcodec/alpha/motion_est_mvi_asm.S ffmpeg/libavcodec/alpha/mpegvideo_alpha.c ffmpeg/libavcodec/alpha/regdef.h ffmpeg/libavcodec/alpha/simple_idct_alpha.c ffmpeg/libavcodec/alsdec.c ffmpeg/libavcodec/amr.h ffmpeg/libavcodec/amrnbdata.h ffmpeg/libavcodec/amrnbdec.c ffmpeg/libavcodec/amrwbdata.h ffmpeg/libavcodec/amrwbdec.c ffmpeg/libavcodec/anm.c ffmpeg/libavcodec/ansi.c ffmpeg/libavcodec/apedec.c ffmpeg/libavcodec/arm/ ffmpeg/libavcodec/arm/Makefile ffmpeg/libavcodec/arm/aac.h ffmpeg/libavcodec/arm/aacpsdsp_init_arm.c ffmpeg/libavcodec/arm/aacpsdsp_neon.S ffmpeg/libavcodec/arm/ac3dsp_arm.S ffmpeg/libavcodec/arm/ac3dsp_armv6.S ffmpeg/libavcodec/arm/ac3dsp_init_arm.c ffmpeg/libavcodec/arm/ac3dsp_neon.S ffmpeg/libavcodec/arm/asm-offsets.h ffmpeg/libavcodec/arm/dca.h ffmpeg/libavcodec/arm/dcadsp_init_arm.c ffmpeg/libavcodec/arm/dcadsp_neon.S ffmpeg/libavcodec/arm/dsputil_arm.S ffmpeg/libavcodec/arm/dsputil_arm.h ffmpeg/libavcodec/arm/dsputil_armv6.S ffmpeg/libavcodec/arm/dsputil_init_arm.c ffmpeg/libavcodec/arm/dsputil_init_armv5te.c ffmpeg/libavcodec/arm/dsputil_init_armv6.c ffmpeg/libavcodec/arm/dsputil_init_neon.c ffmpeg/libavcodec/arm/dsputil_init_vfp.c ffmpeg/libavcodec/arm/dsputil_neon.S ffmpeg/libavcodec/arm/dsputil_vfp.S ffmpeg/libavcodec/arm/fft_fixed_init_arm.c ffmpeg/libavcodec/arm/fft_fixed_neon.S ffmpeg/libavcodec/arm/fft_init_arm.c ffmpeg/libavcodec/arm/fft_neon.S ffmpeg/libavcodec/arm/flacdsp_arm.S ffmpeg/libavcodec/arm/flacdsp_init_arm.c ffmpeg/libavcodec/arm/fmtconvert_init_arm.c ffmpeg/libavcodec/arm/fmtconvert_neon.S ffmpeg/libavcodec/arm/fmtconvert_vfp.S ffmpeg/libavcodec/arm/h264cmc_neon.S ffmpeg/libavcodec/arm/h264dsp_init_arm.c ffmpeg/libavcodec/arm/h264dsp_neon.S ffmpeg/libavcodec/arm/h264idct_neon.S ffmpeg/libavcodec/arm/h264pred_init_arm.c ffmpeg/libavcodec/arm/h264pred_neon.S ffmpeg/libavcodec/arm/int_neon.S ffmpeg/libavcodec/arm/jrevdct_arm.S ffmpeg/libavcodec/arm/mathops.h ffmpeg/libavcodec/arm/mdct_fixed_neon.S ffmpeg/libavcodec/arm/mdct_neon.S ffmpeg/libavcodec/arm/mpegaudiodsp_fixed_armv6.S ffmpeg/libavcodec/arm/mpegaudiodsp_init_arm.c ffmpeg/libavcodec/arm/mpegvideo_arm.c ffmpeg/libavcodec/arm/mpegvideo_arm.h ffmpeg/libavcodec/arm/mpegvideo_armv5te.c ffmpeg/libavcodec/arm/mpegvideo_armv5te_s.S ffmpeg/libavcodec/arm/mpegvideo_neon.S ffmpeg/libavcodec/arm/neon.S ffmpeg/libavcodec/arm/rdft_neon.S ffmpeg/libavcodec/arm/rv34dsp_init_neon.c ffmpeg/libavcodec/arm/rv34dsp_neon.S ffmpeg/libavcodec/arm/rv40dsp_init_neon.c ffmpeg/libavcodec/arm/rv40dsp_neon.S ffmpeg/libavcodec/arm/sbrdsp_init_arm.c ffmpeg/libavcodec/arm/sbrdsp_neon.S ffmpeg/libavcodec/arm/simple_idct_arm.S ffmpeg/libavcodec/arm/simple_idct_armv5te.S ffmpeg/libavcodec/arm/simple_idct_armv6.S ffmpeg/libavcodec/arm/simple_idct_neon.S ffmpeg/libavcodec/arm/synth_filter_neon.S ffmpeg/libavcodec/arm/vp3dsp_init_arm.c ffmpeg/libavcodec/arm/vp3dsp_neon.S ffmpeg/libavcodec/arm/vp56_arith.h ffmpeg/libavcodec/arm/vp56dsp_init_arm.c ffmpeg/libavcodec/arm/vp56dsp_neon.S ffmpeg/libavcodec/arm/vp8.h ffmpeg/libavcodec/arm/vp8_armv6.S ffmpeg/libavcodec/arm/vp8dsp.h ffmpeg/libavcodec/arm/vp8dsp_armv6.S ffmpeg/libavcodec/arm/vp8dsp_init_arm.c ffmpeg/libavcodec/arm/vp8dsp_init_armv6.c ffmpeg/libavcodec/arm/vp8dsp_init_neon.c ffmpeg/libavcodec/arm/vp8dsp_neon.S ffmpeg/libavcodec/ass.c ffmpeg/libavcodec/ass.h ffmpeg/libavcodec/ass_split.c ffmpeg/libavcodec/ass_split.h ffmpeg/libavcodec/assdec.c ffmpeg/libavcodec/assenc.c ffmpeg/libavcodec/asv1.c ffmpeg/libavcodec/atrac.c ffmpeg/libavcodec/atrac.h ffmpeg/libavcodec/atrac1.c ffmpeg/libavcodec/atrac1data.h ffmpeg/libavcodec/atrac3.c ffmpeg/libavcodec/atrac3data.h ffmpeg/libavcodec/audio_frame_queue.c ffmpeg/libavcodec/audio_frame_queue.h ffmpeg/libavcodec/audioconvert.c ffmpeg/libavcodec/audioconvert.h ffmpeg/libavcodec/aura.c ffmpeg/libavcodec/avcodec.h ffmpeg/libavcodec/avfft.c ffmpeg/libavcodec/avfft.h ffmpeg/libavcodec/avpacket.c ffmpeg/libavcodec/avr32/ ffmpeg/libavcodec/avr32/mathops.h ffmpeg/libavcodec/avrndec.c ffmpeg/libavcodec/avs.c ffmpeg/libavcodec/avuidec.c ffmpeg/libavcodec/avuienc.c ffmpeg/libavcodec/bethsoftvideo.c ffmpeg/libavcodec/bethsoftvideo.h ffmpeg/libavcodec/bfi.c ffmpeg/libavcodec/bfin/ ffmpeg/libavcodec/bfin/Makefile ffmpeg/libavcodec/bfin/config_bfin.h ffmpeg/libavcodec/bfin/dsputil_bfin.c ffmpeg/libavcodec/bfin/dsputil_bfin.h ffmpeg/libavcodec/bfin/fdct_bfin.S ffmpeg/libavcodec/bfin/idct_bfin.S ffmpeg/libavcodec/bfin/mathops.h ffmpeg/libavcodec/bfin/mpegvideo_bfin.c ffmpeg/libavcodec/bfin/pixels_bfin.S ffmpeg/libavcodec/bfin/vp3_bfin.c ffmpeg/libavcodec/bfin/vp3_idct_bfin.S ffmpeg/libavcodec/bgmc.c ffmpeg/libavcodec/bgmc.h ffmpeg/libavcodec/bink.c ffmpeg/libavcodec/binkaudio.c ffmpeg/libavcodec/binkdata.h ffmpeg/libavcodec/binkdsp.c ffmpeg/libavcodec/binkdsp.h ffmpeg/libavcodec/bintext.c ffmpeg/libavcodec/bintext.h ffmpeg/libavcodec/bit_depth_template.c ffmpeg/libavcodec/bitstream.c ffmpeg/libavcodec/bitstream_filter.c ffmpeg/libavcodec/bmp.c ffmpeg/libavcodec/bmp.h ffmpeg/libavcodec/bmp_parser.c ffmpeg/libavcodec/bmpenc.c ffmpeg/libavcodec/bmv.c ffmpeg/libavcodec/bytestream.h ffmpeg/libavcodec/c93.c ffmpeg/libavcodec/cabac.c ffmpeg/libavcodec/cabac.h ffmpeg/libavcodec/cabac_functions.h ffmpeg/libavcodec/cavs.c ffmpeg/libavcodec/cavs.h ffmpeg/libavcodec/cavs_parser.c ffmpeg/libavcodec/cavsdata.c ffmpeg/libavcodec/cavsdata.h ffmpeg/libavcodec/cavsdec.c ffmpeg/libavcodec/cavsdsp.c ffmpeg/libavcodec/cavsdsp.h ffmpeg/libavcodec/cbrt_tablegen.c ffmpeg/libavcodec/cbrt_tablegen.h ffmpeg/libavcodec/cdgraphics.c ffmpeg/libavcodec/cdxl.c ffmpeg/libavcodec/celp_filters.c ffmpeg/libavcodec/celp_filters.h ffmpeg/libavcodec/celp_math.c ffmpeg/libavcodec/celp_math.h ffmpeg/libavcodec/cga_data.c ffmpeg/libavcodec/cga_data.h ffmpeg/libavcodec/chomp_bsf.c ffmpeg/libavcodec/cinepak.c ffmpeg/libavcodec/cljr.c ffmpeg/libavcodec/cllc.c ffmpeg/libavcodec/codec_desc.c ffmpeg/libavcodec/cook.c ffmpeg/libavcodec/cook_parser.c ffmpeg/libavcodec/cookdata.h ffmpeg/libavcodec/cos_tablegen.c ffmpeg/libavcodec/cpia.c ffmpeg/libavcodec/crystalhd.c ffmpeg/libavcodec/cscd.c ffmpeg/libavcodec/cyuv.c ffmpeg/libavcodec/dca.c ffmpeg/libavcodec/dca.h ffmpeg/libavcodec/dca_parser.c ffmpeg/libavcodec/dca_parser.h ffmpeg/libavcodec/dcadata.h ffmpeg/libavcodec/dcadec.c ffmpeg/libavcodec/dcadsp.c ffmpeg/libavcodec/dcadsp.h ffmpeg/libavcodec/dcaenc.c ffmpeg/libavcodec/dcaenc.h ffmpeg/libavcodec/dcahuff.h ffmpeg/libavcodec/dct-test.c ffmpeg/libavcodec/dct.c ffmpeg/libavcodec/dct.h ffmpeg/libavcodec/dct32.c ffmpeg/libavcodec/dct32.h ffmpeg/libavcodec/dct32_fixed.c ffmpeg/libavcodec/dct32_float.c ffmpeg/libavcodec/dctref.c ffmpeg/libavcodec/dctref.h ffmpeg/libavcodec/dfa.c ffmpeg/libavcodec/dirac.c ffmpeg/libavcodec/dirac.h ffmpeg/libavcodec/dirac_arith.c ffmpeg/libavcodec/dirac_arith.h ffmpeg/libavcodec/dirac_parser.c ffmpeg/libavcodec/diracdec.c ffmpeg/libavcodec/diracdsp.c ffmpeg/libavcodec/diracdsp.h ffmpeg/libavcodec/dnxhd_parser.c ffmpeg/libavcodec/dnxhddata.c ffmpeg/libavcodec/dnxhddata.h ffmpeg/libavcodec/dnxhddec.c ffmpeg/libavcodec/dnxhdenc.c ffmpeg/libavcodec/dnxhdenc.h ffmpeg/libavcodec/dpcm.c ffmpeg/libavcodec/dpx.c ffmpeg/libavcodec/dpxenc.c ffmpeg/libavcodec/dsicinav.c ffmpeg/libavcodec/dsputil.c ffmpeg/libavcodec/dsputil.h ffmpeg/libavcodec/dsputil_template.c ffmpeg/libavcodec/dump_extradata_bsf.c ffmpeg/libavcodec/dv.c ffmpeg/libavcodec/dv_profile.c ffmpeg/libavcodec/dv_profile.h ffmpeg/libavcodec/dv_tablegen.c ffmpeg/libavcodec/dv_tablegen.h ffmpeg/libavcodec/dv_vlc_data.h ffmpeg/libavcodec/dvbsub.c ffmpeg/libavcodec/dvbsub_parser.c ffmpeg/libavcodec/dvbsubdec.c ffmpeg/libavcodec/dvdata.c ffmpeg/libavcodec/dvdata.h ffmpeg/libavcodec/dvdec.c ffmpeg/libavcodec/dvdsub_parser.c ffmpeg/libavcodec/dvdsubdec.c ffmpeg/libavcodec/dvdsubenc.c ffmpeg/libavcodec/dwt.c ffmpeg/libavcodec/dwt.h ffmpeg/libavcodec/dxa.c ffmpeg/libavcodec/dxtory.c ffmpeg/libavcodec/dxva2.c ffmpeg/libavcodec/dxva2.h ffmpeg/libavcodec/dxva2_h264.c ffmpeg/libavcodec/dxva2_internal.h ffmpeg/libavcodec/dxva2_mpeg2.c ffmpeg/libavcodec/dxva2_vc1.c ffmpeg/libavcodec/eac3_data.c ffmpeg/libavcodec/eac3_data.h ffmpeg/libavcodec/eac3dec.c ffmpeg/libavcodec/eac3enc.c ffmpeg/libavcodec/eac3enc.h ffmpeg/libavcodec/eacmv.c ffmpeg/libavcodec/eaidct.c ffmpeg/libavcodec/eaidct.h ffmpeg/libavcodec/eamad.c ffmpeg/libavcodec/eatgq.c ffmpeg/libavcodec/eatgv.c ffmpeg/libavcodec/eatqi.c ffmpeg/libavcodec/elbg.c ffmpeg/libavcodec/elbg.h ffmpeg/libavcodec/error_resilience.c ffmpeg/libavcodec/escape124.c ffmpeg/libavcodec/escape130.c ffmpeg/libavcodec/exr.c ffmpeg/libavcodec/faandct.c ffmpeg/libavcodec/faandct.h ffmpeg/libavcodec/faanidct.c ffmpeg/libavcodec/faanidct.h ffmpeg/libavcodec/faxcompr.c ffmpeg/libavcodec/faxcompr.h ffmpeg/libavcodec/fft-fixed-test.c ffmpeg/libavcodec/fft-internal.h ffmpeg/libavcodec/fft-test.c ffmpeg/libavcodec/fft.c ffmpeg/libavcodec/fft.h ffmpeg/libavcodec/fft_fixed.c ffmpeg/libavcodec/fft_float.c ffmpeg/libavcodec/ffv1.c ffmpeg/libavcodec/ffwavesynth.c ffmpeg/libavcodec/flac.c ffmpeg/libavcodec/flac.h ffmpeg/libavcodec/flac_parser.c ffmpeg/libavcodec/flacdata.c ffmpeg/libavcodec/flacdata.h ffmpeg/libavcodec/flacdec.c ffmpeg/libavcodec/flacdsp.c ffmpeg/libavcodec/flacdsp.h ffmpeg/libavcodec/flacdsp_template.c ffmpeg/libavcodec/flacenc.c ffmpeg/libavcodec/flashsv.c ffmpeg/libavcodec/flashsv2enc.c ffmpeg/libavcodec/flashsvenc.c ffmpeg/libavcodec/flicvideo.c ffmpeg/libavcodec/flv.h ffmpeg/libavcodec/flvdec.c ffmpeg/libavcodec/flvenc.c ffmpeg/libavcodec/fmtconvert.c ffmpeg/libavcodec/fmtconvert.h ffmpeg/libavcodec/frame_thread_encoder.c ffmpeg/libavcodec/frame_thread_encoder.h ffmpeg/libavcodec/fraps.c ffmpeg/libavcodec/frwu.c ffmpeg/libavcodec/g722.c ffmpeg/libavcodec/g722.h ffmpeg/libavcodec/g722dec.c ffmpeg/libavcodec/g722enc.c ffmpeg/libavcodec/g723_1.c ffmpeg/libavcodec/g723_1_data.h ffmpeg/libavcodec/g726.c ffmpeg/libavcodec/g729.h ffmpeg/libavcodec/g729data.h ffmpeg/libavcodec/g729dec.c ffmpeg/libavcodec/g729postfilter.c ffmpeg/libavcodec/g729postfilter.h ffmpeg/libavcodec/get_bits.h ffmpeg/libavcodec/gif.c ffmpeg/libavcodec/gifdec.c ffmpeg/libavcodec/golomb-test.c ffmpeg/libavcodec/golomb.c ffmpeg/libavcodec/golomb.h ffmpeg/libavcodec/gsm.h ffmpeg/libavcodec/gsm_parser.c ffmpeg/libavcodec/gsmdec.c ffmpeg/libavcodec/gsmdec_data.c ffmpeg/libavcodec/gsmdec_data.h ffmpeg/libavcodec/gsmdec_template.c ffmpeg/libavcodec/h261.c ffmpeg/libavcodec/h261.h ffmpeg/libavcodec/h261_parser.c ffmpeg/libavcodec/h261data.c ffmpeg/libavcodec/h261data.h ffmpeg/libavcodec/h261dec.c ffmpeg/libavcodec/h261enc.c ffmpeg/libavcodec/h263.c ffmpeg/libavcodec/h263.h ffmpeg/libavcodec/h263_parser.c ffmpeg/libavcodec/h263_parser.h ffmpeg/libavcodec/h263data.h ffmpeg/libavcodec/h263dec.c ffmpeg/libavcodec/h264.c ffmpeg/libavcodec/h264.h ffmpeg/libavcodec/h264_cabac.c ffmpeg/libavcodec/h264_cavlc.c ffmpeg/libavcodec/h264_direct.c ffmpeg/libavcodec/h264_loopfilter.c ffmpeg/libavcodec/h264_mb_template.c ffmpeg/libavcodec/h264_mc_template.c ffmpeg/libavcodec/h264_mp4toannexb_bsf.c ffmpeg/libavcodec/h264_mvpred.h ffmpeg/libavcodec/h264_parser.c ffmpeg/libavcodec/h264_ps.c ffmpeg/libavcodec/h264_refs.c ffmpeg/libavcodec/h264_sei.c ffmpeg/libavcodec/h264data.h ffmpeg/libavcodec/h264dsp.c ffmpeg/libavcodec/h264dsp.h ffmpeg/libavcodec/h264dsp_template.c ffmpeg/libavcodec/h264idct.c ffmpeg/libavcodec/h264idct_template.c ffmpeg/libavcodec/h264pred.c ffmpeg/libavcodec/h264pred.h ffmpeg/libavcodec/h264pred_template.c ffmpeg/libavcodec/huffman.c ffmpeg/libavcodec/huffman.h ffmpeg/libavcodec/huffyuv.c ffmpeg/libavcodec/idcinvideo.c ffmpeg/libavcodec/iff.c ffmpeg/libavcodec/iirfilter.c ffmpeg/libavcodec/iirfilter.h ffmpeg/libavcodec/imc.c ffmpeg/libavcodec/imcdata.h ffmpeg/libavcodec/imgconvert.c ffmpeg/libavcodec/imgconvert.h ffmpeg/libavcodec/imx_dump_header_bsf.c ffmpeg/libavcodec/indeo2.c ffmpeg/libavcodec/indeo2data.h ffmpeg/libavcodec/indeo3.c ffmpeg/libavcodec/indeo3data.h ffmpeg/libavcodec/indeo4.c ffmpeg/libavcodec/indeo4data.h ffmpeg/libavcodec/indeo5.c ffmpeg/libavcodec/indeo5data.h ffmpeg/libavcodec/intelh263dec.c ffmpeg/libavcodec/internal.h ffmpeg/libavcodec/interplayvideo.c ffmpeg/libavcodec/intrax8.c ffmpeg/libavcodec/intrax8.h ffmpeg/libavcodec/intrax8dsp.c ffmpeg/libavcodec/intrax8dsp.h ffmpeg/libavcodec/intrax8huf.h ffmpeg/libavcodec/inverse.c ffmpeg/libavcodec/ituh263dec.c ffmpeg/libavcodec/ituh263enc.c ffmpeg/libavcodec/ivi_common.c ffmpeg/libavcodec/ivi_common.h ffmpeg/libavcodec/ivi_dsp.c ffmpeg/libavcodec/ivi_dsp.h ffmpeg/libavcodec/j2k.c ffmpeg/libavcodec/j2k.h ffmpeg/libavcodec/j2k_dwt.c ffmpeg/libavcodec/j2k_dwt.h ffmpeg/libavcodec/j2kdec.c ffmpeg/libavcodec/j2kenc.c ffmpeg/libavcodec/jacosub.h ffmpeg/libavcodec/jacosubdec.c ffmpeg/libavcodec/jfdctfst.c ffmpeg/libavcodec/jfdctint.c ffmpeg/libavcodec/jfdctint_template.c ffmpeg/libavcodec/jpegls.c ffmpeg/libavcodec/jpegls.h ffmpeg/libavcodec/jpeglsdec.c ffmpeg/libavcodec/jpeglsdec.h ffmpeg/libavcodec/jpeglsenc.c ffmpeg/libavcodec/jrevdct.c ffmpeg/libavcodec/jvdec.c ffmpeg/libavcodec/kbdwin.c ffmpeg/libavcodec/kbdwin.h ffmpeg/libavcodec/kgv1dec.c ffmpeg/libavcodec/kmvc.c ffmpeg/libavcodec/lagarith.c ffmpeg/libavcodec/lagarithrac.c ffmpeg/libavcodec/lagarithrac.h ffmpeg/libavcodec/latm_parser.c ffmpeg/libavcodec/lcl.h ffmpeg/libavcodec/lcldec.c ffmpeg/libavcodec/lclenc.c ffmpeg/libavcodec/libaacplus.c ffmpeg/libavcodec/libavcodec.v ffmpeg/libavcodec/libcelt_dec.c ffmpeg/libavcodec/libfaac.c ffmpeg/libavcodec/libfdk-aacenc.c ffmpeg/libavcodec/libgsm.c ffmpeg/libavcodec/libilbc.c ffmpeg/libavcodec/libmp3lame.c ffmpeg/libavcodec/libopencore-amr.c ffmpeg/libavcodec/libopenjpegdec.c ffmpeg/libavcodec/libopenjpegenc.c ffmpeg/libavcodec/libopus_dec.c ffmpeg/libavcodec/libschroedinger.c ffmpeg/libavcodec/libschroedinger.h ffmpeg/libavcodec/libschroedingerdec.c ffmpeg/libavcodec/libschroedingerenc.c ffmpeg/libavcodec/libspeexdec.c ffmpeg/libavcodec/libspeexenc.c ffmpeg/libavcodec/libstagefright.cpp ffmpeg/libavcodec/libtheoraenc.c ffmpeg/libavcodec/libtwolame.c ffmpeg/libavcodec/libutvideo.h ffmpeg/libavcodec/libutvideodec.cpp ffmpeg/libavcodec/libutvideoenc.cpp ffmpeg/libavcodec/libvo-aacenc.c ffmpeg/libavcodec/libvo-amrwbenc.c ffmpeg/libavcodec/libvorbisdec.c ffmpeg/libavcodec/libvorbisenc.c ffmpeg/libavcodec/libvpxdec.c ffmpeg/libavcodec/libvpxenc.c ffmpeg/libavcodec/libx264.c ffmpeg/libavcodec/libxavs.c ffmpeg/libavcodec/libxvid.c ffmpeg/libavcodec/libxvid.h ffmpeg/libavcodec/libxvid_rc.c ffmpeg/libavcodec/ljpegenc.c ffmpeg/libavcodec/loco.c ffmpeg/libavcodec/lpc.c ffmpeg/libavcodec/lpc.h ffmpeg/libavcodec/lsp.c ffmpeg/libavcodec/lsp.h ffmpeg/libavcodec/lzw.c ffmpeg/libavcodec/lzw.h ffmpeg/libavcodec/lzwenc.c ffmpeg/libavcodec/mace.c ffmpeg/libavcodec/mathops.h ffmpeg/libavcodec/mdct.c ffmpeg/libavcodec/mdct_fixed.c ffmpeg/libavcodec/mdct_float.c ffmpeg/libavcodec/mdec.c ffmpeg/libavcodec/microdvddec.c ffmpeg/libavcodec/mimic.c ffmpeg/libavcodec/mips/ ffmpeg/libavcodec/mips/Makefile ffmpeg/libavcodec/mips/acelp_filters_mips.c ffmpeg/libavcodec/mips/acelp_vectors_mips.c ffmpeg/libavcodec/mips/amrwbdec_mips.c ffmpeg/libavcodec/mips/amrwbdec_mips.h ffmpeg/libavcodec/mips/celp_filters_mips.c ffmpeg/libavcodec/mips/celp_math_mips.c ffmpeg/libavcodec/mips/compute_antialias_fixed.h ffmpeg/libavcodec/mips/compute_antialias_float.h ffmpeg/libavcodec/mips/dsputil_mips.c ffmpeg/libavcodec/mips/dsputil_mmi.c ffmpeg/libavcodec/mips/fft_init_table.c ffmpeg/libavcodec/mips/fft_mips.c ffmpeg/libavcodec/mips/fft_table.h ffmpeg/libavcodec/mips/fmtconvert_mips.c ffmpeg/libavcodec/mips/idct_mmi.c ffmpeg/libavcodec/mips/lsp_mips.h ffmpeg/libavcodec/mips/mathops.h ffmpeg/libavcodec/mips/mmi.h ffmpeg/libavcodec/mips/mpegaudiodsp_mips_fixed.c ffmpeg/libavcodec/mips/mpegaudiodsp_mips_float.c ffmpeg/libavcodec/mips/mpegvideo_mmi.c ffmpeg/libavcodec/mjpeg.c ffmpeg/libavcodec/mjpeg.h ffmpeg/libavcodec/mjpeg2jpeg_bsf.c ffmpeg/libavcodec/mjpeg_parser.c ffmpeg/libavcodec/mjpega_dump_header_bsf.c ffmpeg/libavcodec/mjpegbdec.c ffmpeg/libavcodec/mjpegdec.c ffmpeg/libavcodec/mjpegdec.h ffmpeg/libavcodec/mjpegenc.c ffmpeg/libavcodec/mjpegenc.h ffmpeg/libavcodec/mlp.c ffmpeg/libavcodec/mlp.h ffmpeg/libavcodec/mlp_parser.c ffmpeg/libavcodec/mlp_parser.h ffmpeg/libavcodec/mlpdec.c ffmpeg/libavcodec/mlpdsp.c ffmpeg/libavcodec/mmvideo.c ffmpeg/libavcodec/motion-test.c ffmpeg/libavcodec/motion_est.c ffmpeg/libavcodec/motion_est_template.c ffmpeg/libavcodec/motionpixels.c ffmpeg/libavcodec/motionpixels_tablegen.c ffmpeg/libavcodec/motionpixels_tablegen.h ffmpeg/libavcodec/movsub_bsf.c ffmpeg/libavcodec/movtextdec.c ffmpeg/libavcodec/movtextenc.c ffmpeg/libavcodec/mp3_header_compress_bsf.c ffmpeg/libavcodec/mp3_header_decompress_bsf.c ffmpeg/libavcodec/mpc.c ffmpeg/libavcodec/mpc.h ffmpeg/libavcodec/mpc7.c ffmpeg/libavcodec/mpc7data.h ffmpeg/libavcodec/mpc8.c ffmpeg/libavcodec/mpc8data.h ffmpeg/libavcodec/mpc8huff.h ffmpeg/libavcodec/mpcdata.h ffmpeg/libavcodec/mpeg12.c ffmpeg/libavcodec/mpeg12.h ffmpeg/libavcodec/mpeg12data.c ffmpeg/libavcodec/mpeg12data.h ffmpeg/libavcodec/mpeg12decdata.h ffmpeg/libavcodec/mpeg12enc.c ffmpeg/libavcodec/mpeg4audio.c ffmpeg/libavcodec/mpeg4audio.h ffmpeg/libavcodec/mpeg4data.h ffmpeg/libavcodec/mpeg4video.c ffmpeg/libavcodec/mpeg4video.h ffmpeg/libavcodec/mpeg4video_parser.c ffmpeg/libavcodec/mpeg4video_parser.h ffmpeg/libavcodec/mpeg4videodec.c ffmpeg/libavcodec/mpeg4videoenc.c ffmpeg/libavcodec/mpegaudio.c ffmpeg/libavcodec/mpegaudio.h ffmpeg/libavcodec/mpegaudio_parser.c ffmpeg/libavcodec/mpegaudio_tablegen.c ffmpeg/libavcodec/mpegaudio_tablegen.h ffmpeg/libavcodec/mpegaudiodata.c ffmpeg/libavcodec/mpegaudiodata.h ffmpeg/libavcodec/mpegaudiodec.c ffmpeg/libavcodec/mpegaudiodec_float.c ffmpeg/libavcodec/mpegaudiodecheader.c ffmpeg/libavcodec/mpegaudiodecheader.h ffmpeg/libavcodec/mpegaudiodectab.h ffmpeg/libavcodec/mpegaudiodsp.c ffmpeg/libavcodec/mpegaudiodsp.h ffmpeg/libavcodec/mpegaudiodsp_data.c ffmpeg/libavcodec/mpegaudiodsp_fixed.c ffmpeg/libavcodec/mpegaudiodsp_float.c ffmpeg/libavcodec/mpegaudiodsp_template.c ffmpeg/libavcodec/mpegaudioenc.c ffmpeg/libavcodec/mpegaudiotab.h ffmpeg/libavcodec/mpegvideo.c ffmpeg/libavcodec/mpegvideo.h ffmpeg/libavcodec/mpegvideo_enc.c ffmpeg/libavcodec/mpegvideo_motion.c ffmpeg/libavcodec/mpegvideo_parser.c ffmpeg/libavcodec/mpegvideo_xvmc.c ffmpeg/libavcodec/mqc.c ffmpeg/libavcodec/mqc.h ffmpeg/libavcodec/mqcdec.c ffmpeg/libavcodec/mqcenc.c ffmpeg/libavcodec/msgsmdec.c ffmpeg/libavcodec/msgsmdec.h ffmpeg/libavcodec/msmpeg4.c ffmpeg/libavcodec/msmpeg4.h ffmpeg/libavcodec/msmpeg4data.c ffmpeg/libavcodec/msmpeg4data.h ffmpeg/libavcodec/msmpeg4enc.c ffmpeg/libavcodec/msrle.c ffmpeg/libavcodec/msrledec.c ffmpeg/libavcodec/msrledec.h ffmpeg/libavcodec/mss1.c ffmpeg/libavcodec/mss12.c ffmpeg/libavcodec/mss12.h ffmpeg/libavcodec/mss2.c ffmpeg/libavcodec/mss2dsp.c ffmpeg/libavcodec/mss2dsp.h ffmpeg/libavcodec/mss3.c ffmpeg/libavcodec/mss34dsp.c ffmpeg/libavcodec/mss34dsp.h ffmpeg/libavcodec/mss4.c ffmpeg/libavcodec/msvideo1.c ffmpeg/libavcodec/msvideo1enc.c ffmpeg/libavcodec/mxpegdec.c ffmpeg/libavcodec/nellymoser.c ffmpeg/libavcodec/nellymoser.h ffmpeg/libavcodec/nellymoserdec.c ffmpeg/libavcodec/nellymoserenc.c ffmpeg/libavcodec/noise_bsf.c ffmpeg/libavcodec/nuv.c ffmpeg/libavcodec/old_codec_ids.h ffmpeg/libavcodec/options.c ffmpeg/libavcodec/options_table.h ffmpeg/libavcodec/os2threads.h ffmpeg/libavcodec/paf.c ffmpeg/libavcodec/paf.h ffmpeg/libavcodec/pamenc.c ffmpeg/libavcodec/parser.c ffmpeg/libavcodec/parser.h ffmpeg/libavcodec/pcm-mpeg.c ffmpeg/libavcodec/pcm.c ffmpeg/libavcodec/pcm_tablegen.c ffmpeg/libavcodec/pcm_tablegen.h ffmpeg/libavcodec/pcx.c ffmpeg/libavcodec/pcxenc.c ffmpeg/libavcodec/pgssubdec.c ffmpeg/libavcodec/pictordec.c ffmpeg/libavcodec/png.c ffmpeg/libavcodec/png.h ffmpeg/libavcodec/png_parser.c ffmpeg/libavcodec/pngdec.c ffmpeg/libavcodec/pngdsp.c ffmpeg/libavcodec/pngdsp.h ffmpeg/libavcodec/pngenc.c ffmpeg/libavcodec/pnm.c ffmpeg/libavcodec/pnm.h ffmpeg/libavcodec/pnm_parser.c ffmpeg/libavcodec/pnmdec.c ffmpeg/libavcodec/pnmenc.c ffmpeg/libavcodec/ppc/ ffmpeg/libavcodec/ppc/Makefile ffmpeg/libavcodec/ppc/asm.S ffmpeg/libavcodec/ppc/dsputil_altivec.c ffmpeg/libavcodec/ppc/dsputil_altivec.h ffmpeg/libavcodec/ppc/dsputil_ppc.c ffmpeg/libavcodec/ppc/fdct_altivec.c ffmpeg/libavcodec/ppc/fft_altivec.c ffmpeg/libavcodec/ppc/fft_altivec_s.S ffmpeg/libavcodec/ppc/float_altivec.c ffmpeg/libavcodec/ppc/fmtconvert_altivec.c ffmpeg/libavcodec/ppc/gmc_altivec.c ffmpeg/libavcodec/ppc/h264_altivec.c ffmpeg/libavcodec/ppc/h264_altivec_template.c ffmpeg/libavcodec/ppc/idct_altivec.c ffmpeg/libavcodec/ppc/int_altivec.c ffmpeg/libavcodec/ppc/mathops.h ffmpeg/libavcodec/ppc/mpegaudiodec_altivec.c ffmpeg/libavcodec/ppc/mpegvideo_altivec.c ffmpeg/libavcodec/ppc/vc1dsp_altivec.c ffmpeg/libavcodec/ppc/vp3dsp_altivec.c ffmpeg/libavcodec/ppc/vp8dsp_altivec.c ffmpeg/libavcodec/proresdata.c ffmpeg/libavcodec/proresdata.h ffmpeg/libavcodec/proresdec.h ffmpeg/libavcodec/proresdec2.c ffmpeg/libavcodec/proresdec_lgpl.c ffmpeg/libavcodec/proresdsp.c ffmpeg/libavcodec/proresdsp.h ffmpeg/libavcodec/proresenc_anatoliy.c ffmpeg/libavcodec/proresenc_kostya.c ffmpeg/libavcodec/psymodel.c ffmpeg/libavcodec/psymodel.h ffmpeg/libavcodec/pthread.c ffmpeg/libavcodec/ptx.c ffmpeg/libavcodec/put_bits.h ffmpeg/libavcodec/qcelpdata.h ffmpeg/libavcodec/qcelpdec.c ffmpeg/libavcodec/qdm2.c ffmpeg/libavcodec/qdm2_tablegen.c ffmpeg/libavcodec/qdm2_tablegen.h ffmpeg/libavcodec/qdm2data.h ffmpeg/libavcodec/qdrw.c ffmpeg/libavcodec/qpeg.c ffmpeg/libavcodec/qtrle.c ffmpeg/libavcodec/qtrleenc.c ffmpeg/libavcodec/r210dec.c ffmpeg/libavcodec/r210enc.c ffmpeg/libavcodec/ra144.c ffmpeg/libavcodec/ra144.h ffmpeg/libavcodec/ra144dec.c ffmpeg/libavcodec/ra144enc.c ffmpeg/libavcodec/ra288.c ffmpeg/libavcodec/ra288.h ffmpeg/libavcodec/ralf.c ffmpeg/libavcodec/ralfdata.h ffmpeg/libavcodec/rangecoder.c ffmpeg/libavcodec/rangecoder.h ffmpeg/libavcodec/ratecontrol.c ffmpeg/libavcodec/ratecontrol.h ffmpeg/libavcodec/raw.c ffmpeg/libavcodec/raw.h ffmpeg/libavcodec/rawdec.c ffmpeg/libavcodec/rawenc.c ffmpeg/libavcodec/rdft.c ffmpeg/libavcodec/rdft.h ffmpeg/libavcodec/realtextdec.c ffmpeg/libavcodec/rectangle.h ffmpeg/libavcodec/remove_extradata_bsf.c ffmpeg/libavcodec/resample.c ffmpeg/libavcodec/resample2.c ffmpeg/libavcodec/rl.h ffmpeg/libavcodec/rl2.c ffmpeg/libavcodec/rle.c ffmpeg/libavcodec/rle.h ffmpeg/libavcodec/roqaudioenc.c ffmpeg/libavcodec/roqvideo.c ffmpeg/libavcodec/roqvideo.h ffmpeg/libavcodec/roqvideodec.c ffmpeg/libavcodec/roqvideoenc.c ffmpeg/libavcodec/rpza.c ffmpeg/libavcodec/rtjpeg.c ffmpeg/libavcodec/rtjpeg.h ffmpeg/libavcodec/rv10.c ffmpeg/libavcodec/rv10enc.c ffmpeg/libavcodec/rv20enc.c ffmpeg/libavcodec/rv30.c ffmpeg/libavcodec/rv30data.h ffmpeg/libavcodec/rv30dsp.c ffmpeg/libavcodec/rv34.c ffmpeg/libavcodec/rv34.h ffmpeg/libavcodec/rv34_parser.c ffmpeg/libavcodec/rv34data.h ffmpeg/libavcodec/rv34dsp.c ffmpeg/libavcodec/rv34dsp.h ffmpeg/libavcodec/rv34vlc.h ffmpeg/libavcodec/rv40.c ffmpeg/libavcodec/rv40data.h ffmpeg/libavcodec/rv40dsp.c ffmpeg/libavcodec/rv40vlc2.h ffmpeg/libavcodec/s302m.c ffmpeg/libavcodec/s3tc.c ffmpeg/libavcodec/s3tc.h ffmpeg/libavcodec/samidec.c ffmpeg/libavcodec/sanm.c ffmpeg/libavcodec/sanm_data.h ffmpeg/libavcodec/sbr.h ffmpeg/libavcodec/sbrdsp.c ffmpeg/libavcodec/sbrdsp.h ffmpeg/libavcodec/sgi.h ffmpeg/libavcodec/sgidec.c ffmpeg/libavcodec/sgienc.c ffmpeg/libavcodec/sh4/ ffmpeg/libavcodec/sh4/Makefile ffmpeg/libavcodec/sh4/dsputil_align.c ffmpeg/libavcodec/sh4/dsputil_sh4.c ffmpeg/libavcodec/sh4/dsputil_sh4.h ffmpeg/libavcodec/sh4/idct_sh4.c ffmpeg/libavcodec/sh4/qpel.c ffmpeg/libavcodec/sh4/sh4.h ffmpeg/libavcodec/shorten.c ffmpeg/libavcodec/simple_idct.c ffmpeg/libavcodec/simple_idct.h ffmpeg/libavcodec/simple_idct_template.c ffmpeg/libavcodec/sinewin.c ffmpeg/libavcodec/sinewin.h ffmpeg/libavcodec/sinewin_tablegen.c ffmpeg/libavcodec/sinewin_tablegen.h ffmpeg/libavcodec/sipr.c ffmpeg/libavcodec/sipr.h ffmpeg/libavcodec/sipr16k.c ffmpeg/libavcodec/sipr16kdata.h ffmpeg/libavcodec/siprdata.h ffmpeg/libavcodec/smacker.c ffmpeg/libavcodec/smc.c ffmpeg/libavcodec/snow.c ffmpeg/libavcodec/snow.h ffmpeg/libavcodec/snowdata.h ffmpeg/libavcodec/snowdec.c ffmpeg/libavcodec/snowenc.c ffmpeg/libavcodec/sonic.c ffmpeg/libavcodec/sp5x.h ffmpeg/libavcodec/sp5xdec.c ffmpeg/libavcodec/sparc/ ffmpeg/libavcodec/sparc/Makefile ffmpeg/libavcodec/sparc/dsputil_vis.c ffmpeg/libavcodec/sparc/dsputil_vis.h ffmpeg/libavcodec/sparc/simple_idct_vis.c ffmpeg/libavcodec/sparc/vis.h ffmpeg/libavcodec/srtdec.c ffmpeg/libavcodec/srtenc.c ffmpeg/libavcodec/subviewerdec.c ffmpeg/libavcodec/sunrast.c ffmpeg/libavcodec/sunrast.h ffmpeg/libavcodec/sunrastenc.c ffmpeg/libavcodec/svq1.c ffmpeg/libavcodec/svq1.h ffmpeg/libavcodec/svq13.c ffmpeg/libavcodec/svq1_cb.h ffmpeg/libavcodec/svq1_vlc.h ffmpeg/libavcodec/svq1dec.c ffmpeg/libavcodec/svq1enc.c ffmpeg/libavcodec/svq1enc_cb.h ffmpeg/libavcodec/svq3.c ffmpeg/libavcodec/synth_filter.c ffmpeg/libavcodec/synth_filter.h ffmpeg/libavcodec/tableprint.h ffmpeg/libavcodec/targa.c ffmpeg/libavcodec/targa.h ffmpeg/libavcodec/targaenc.c ffmpeg/libavcodec/thread.h ffmpeg/libavcodec/tiertexseqv.c ffmpeg/libavcodec/tiff.c ffmpeg/libavcodec/tiff.h ffmpeg/libavcodec/tiff_data.c ffmpeg/libavcodec/tiff_data.h ffmpeg/libavcodec/tiffenc.c ffmpeg/libavcodec/timecode.c ffmpeg/libavcodec/timecode.h ffmpeg/libavcodec/tmv.c ffmpeg/libavcodec/truemotion1.c ffmpeg/libavcodec/truemotion1data.h ffmpeg/libavcodec/truemotion2.c ffmpeg/libavcodec/truespeech.c ffmpeg/libavcodec/truespeech_data.h ffmpeg/libavcodec/tscc.c ffmpeg/libavcodec/tscc2.c ffmpeg/libavcodec/tscc2data.h ffmpeg/libavcodec/tta.c ffmpeg/libavcodec/twinvq.c ffmpeg/libavcodec/twinvq_data.h ffmpeg/libavcodec/txd.c ffmpeg/libavcodec/ulti.c ffmpeg/libavcodec/ulti_cb.h ffmpeg/libavcodec/unary.h ffmpeg/libavcodec/utils.c ffmpeg/libavcodec/utvideo.c ffmpeg/libavcodec/utvideo.h ffmpeg/libavcodec/utvideodec.c ffmpeg/libavcodec/utvideoenc.c ffmpeg/libavcodec/v210dec.c ffmpeg/libavcodec/v210dec.h ffmpeg/libavcodec/v210enc.c ffmpeg/libavcodec/v210x.c ffmpeg/libavcodec/v308dec.c ffmpeg/libavcodec/v308enc.c ffmpeg/libavcodec/v408dec.c ffmpeg/libavcodec/v408enc.c ffmpeg/libavcodec/v410dec.c ffmpeg/libavcodec/v410enc.c ffmpeg/libavcodec/vaapi.c ffmpeg/libavcodec/vaapi.h ffmpeg/libavcodec/vaapi_h264.c ffmpeg/libavcodec/vaapi_internal.h ffmpeg/libavcodec/vaapi_mpeg2.c ffmpeg/libavcodec/vaapi_mpeg4.c ffmpeg/libavcodec/vaapi_vc1.c ffmpeg/libavcodec/vb.c ffmpeg/libavcodec/vble.c ffmpeg/libavcodec/vc1.c ffmpeg/libavcodec/vc1.h ffmpeg/libavcodec/vc1_parser.c ffmpeg/libavcodec/vc1acdata.h ffmpeg/libavcodec/vc1data.c ffmpeg/libavcodec/vc1data.h ffmpeg/libavcodec/vc1dec.c ffmpeg/libavcodec/vc1dsp.c ffmpeg/libavcodec/vc1dsp.h ffmpeg/libavcodec/vcr1.c ffmpeg/libavcodec/vda.h ffmpeg/libavcodec/vda_h264.c ffmpeg/libavcodec/vda_h264_dec.c ffmpeg/libavcodec/vdpau.c ffmpeg/libavcodec/vdpau.h ffmpeg/libavcodec/vdpau_internal.h ffmpeg/libavcodec/version.h ffmpeg/libavcodec/vima.c ffmpeg/libavcodec/vmdav.c ffmpeg/libavcodec/vmnc.c ffmpeg/libavcodec/vorbis.c ffmpeg/libavcodec/vorbis.h ffmpeg/libavcodec/vorbis_data.c ffmpeg/libavcodec/vorbis_enc_data.h ffmpeg/libavcodec/vorbis_parser.c ffmpeg/libavcodec/vorbis_parser.h ffmpeg/libavcodec/vorbisdec.c ffmpeg/libavcodec/vorbisenc.c ffmpeg/libavcodec/vp3.c ffmpeg/libavcodec/vp3_parser.c ffmpeg/libavcodec/vp3data.h ffmpeg/libavcodec/vp3dsp.c ffmpeg/libavcodec/vp3dsp.h ffmpeg/libavcodec/vp5.c ffmpeg/libavcodec/vp56.c ffmpeg/libavcodec/vp56.h ffmpeg/libavcodec/vp56data.c ffmpeg/libavcodec/vp56data.h ffmpeg/libavcodec/vp56dsp.c ffmpeg/libavcodec/vp56dsp.h ffmpeg/libavcodec/vp56rac.c ffmpeg/libavcodec/vp5data.h ffmpeg/libavcodec/vp6.c ffmpeg/libavcodec/vp6data.h ffmpeg/libavcodec/vp6dsp.c ffmpeg/libavcodec/vp8.c ffmpeg/libavcodec/vp8.h ffmpeg/libavcodec/vp8_parser.c ffmpeg/libavcodec/vp8data.h ffmpeg/libavcodec/vp8dsp.c ffmpeg/libavcodec/vp8dsp.h ffmpeg/libavcodec/vqavideo.c ffmpeg/libavcodec/w32pthreads.h ffmpeg/libavcodec/wavpack.c ffmpeg/libavcodec/webvttdec.c ffmpeg/libavcodec/wma.c ffmpeg/libavcodec/wma.h ffmpeg/libavcodec/wma_common.c ffmpeg/libavcodec/wma_common.h ffmpeg/libavcodec/wmadata.h ffmpeg/libavcodec/wmadec.c ffmpeg/libavcodec/wmaenc.c ffmpeg/libavcodec/wmalosslessdec.c ffmpeg/libavcodec/wmaprodata.h ffmpeg/libavcodec/wmaprodec.c ffmpeg/libavcodec/wmavoice.c ffmpeg/libavcodec/wmavoice_data.h ffmpeg/libavcodec/wmv2.c ffmpeg/libavcodec/wmv2.h ffmpeg/libavcodec/wmv2dec.c ffmpeg/libavcodec/wmv2enc.c ffmpeg/libavcodec/wnv1.c ffmpeg/libavcodec/ws-snd1.c ffmpeg/libavcodec/x86/ ffmpeg/libavcodec/x86/Makefile ffmpeg/libavcodec/x86/ac3dsp.asm ffmpeg/libavcodec/x86/ac3dsp_init.c ffmpeg/libavcodec/x86/cabac.h ffmpeg/libavcodec/x86/cavsdsp.c ffmpeg/libavcodec/x86/dct32.asm ffmpeg/libavcodec/x86/deinterlace.asm ffmpeg/libavcodec/x86/diracdsp_mmx.c ffmpeg/libavcodec/x86/diracdsp_mmx.h ffmpeg/libavcodec/x86/diracdsp_yasm.asm ffmpeg/libavcodec/x86/dnxhdenc.c ffmpeg/libavcodec/x86/dsputil.asm ffmpeg/libavcodec/x86/dsputil_avg_template.c ffmpeg/libavcodec/x86/dsputil_mmx.c ffmpeg/libavcodec/x86/dsputil_mmx.h ffmpeg/libavcodec/x86/dsputil_qns_template.c ffmpeg/libavcodec/x86/dsputil_rnd_template.c ffmpeg/libavcodec/x86/dsputilenc.asm ffmpeg/libavcodec/x86/dsputilenc_mmx.c ffmpeg/libavcodec/x86/dwt.c ffmpeg/libavcodec/x86/dwt.h ffmpeg/libavcodec/x86/dwt_yasm.asm ffmpeg/libavcodec/x86/fdct.c ffmpeg/libavcodec/x86/fft.asm ffmpeg/libavcodec/x86/fft.h ffmpeg/libavcodec/x86/fft_init.c ffmpeg/libavcodec/x86/fmtconvert.asm ffmpeg/libavcodec/x86/fmtconvert_init.c ffmpeg/libavcodec/x86/h264_chromamc.asm ffmpeg/libavcodec/x86/h264_chromamc_10bit.asm ffmpeg/libavcodec/x86/h264_deblock.asm ffmpeg/libavcodec/x86/h264_deblock_10bit.asm ffmpeg/libavcodec/x86/h264_i386.h ffmpeg/libavcodec/x86/h264_idct.asm ffmpeg/libavcodec/x86/h264_idct_10bit.asm ffmpeg/libavcodec/x86/h264_intrapred.asm ffmpeg/libavcodec/x86/h264_intrapred_10bit.asm ffmpeg/libavcodec/x86/h264_intrapred_init.c ffmpeg/libavcodec/x86/h264_qpel.c ffmpeg/libavcodec/x86/h264_qpel_10bit.asm ffmpeg/libavcodec/x86/h264_weight.asm ffmpeg/libavcodec/x86/h264_weight_10bit.asm ffmpeg/libavcodec/x86/h264dsp_init.c ffmpeg/libavcodec/x86/idct_mmx.c ffmpeg/libavcodec/x86/idct_mmx_xvid.c ffmpeg/libavcodec/x86/idct_sse2_xvid.c ffmpeg/libavcodec/x86/idct_xvid.h ffmpeg/libavcodec/x86/imdct36.asm ffmpeg/libavcodec/x86/lpc.c ffmpeg/libavcodec/x86/mathops.h ffmpeg/libavcodec/x86/mlpdsp.c ffmpeg/libavcodec/x86/motion_est.c ffmpeg/libavcodec/x86/mpegaudiodec.c ffmpeg/libavcodec/x86/mpegvideo.c ffmpeg/libavcodec/x86/mpegvideoenc.c ffmpeg/libavcodec/x86/mpegvideoenc_template.c ffmpeg/libavcodec/x86/pngdsp.asm ffmpeg/libavcodec/x86/pngdsp_init.c ffmpeg/libavcodec/x86/proresdsp.asm ffmpeg/libavcodec/x86/proresdsp_init.c ffmpeg/libavcodec/x86/rv34dsp.asm ffmpeg/libavcodec/x86/rv34dsp_init.c ffmpeg/libavcodec/x86/rv40dsp.asm ffmpeg/libavcodec/x86/rv40dsp_init.c ffmpeg/libavcodec/x86/sbrdsp.asm ffmpeg/libavcodec/x86/sbrdsp_init.c ffmpeg/libavcodec/x86/simple_idct.c ffmpeg/libavcodec/x86/snowdsp.c ffmpeg/libavcodec/x86/v210-init.c ffmpeg/libavcodec/x86/v210.asm ffmpeg/libavcodec/x86/vc1dsp.asm ffmpeg/libavcodec/x86/vc1dsp_mmx.c ffmpeg/libavcodec/x86/vp3dsp.asm ffmpeg/libavcodec/x86/vp3dsp_init.c ffmpeg/libavcodec/x86/vp56_arith.h ffmpeg/libavcodec/x86/vp56dsp.asm ffmpeg/libavcodec/x86/vp56dsp_init.c ffmpeg/libavcodec/x86/vp8dsp.asm ffmpeg/libavcodec/x86/vp8dsp_init.c ffmpeg/libavcodec/x86/w64xmmtest.c ffmpeg/libavcodec/xan.c ffmpeg/libavcodec/xbmdec.c ffmpeg/libavcodec/xbmenc.c ffmpeg/libavcodec/xiph.c ffmpeg/libavcodec/xiph.h ffmpeg/libavcodec/xl.c ffmpeg/libavcodec/xsubdec.c ffmpeg/libavcodec/xsubenc.c ffmpeg/libavcodec/xvmc.h ffmpeg/libavcodec/xvmc_internal.h ffmpeg/libavcodec/xwd.h ffmpeg/libavcodec/xwddec.c ffmpeg/libavcodec/xwdenc.c ffmpeg/libavcodec/xxan.c ffmpeg/libavcodec/y41pdec.c ffmpeg/libavcodec/y41penc.c ffmpeg/libavcodec/yop.c ffmpeg/libavcodec/yuv4dec.c ffmpeg/libavcodec/yuv4enc.c ffmpeg/libavcodec/zerocodec.c ffmpeg/libavcodec/zmbv.c ffmpeg/libavcodec/zmbvenc.c ffmpeg/libavdevice/ ffmpeg/libavdevice/Makefile ffmpeg/libavdevice/alldevices.c ffmpeg/libavdevice/alsa-audio-common.c ffmpeg/libavdevice/alsa-audio-dec.c ffmpeg/libavdevice/alsa-audio-enc.c ffmpeg/libavdevice/alsa-audio.h ffmpeg/libavdevice/avdevice.c ffmpeg/libavdevice/avdevice.h ffmpeg/libavdevice/bktr.c ffmpeg/libavdevice/caca.c ffmpeg/libavdevice/dshow.c ffmpeg/libavdevice/dshow_capture.h ffmpeg/libavdevice/dshow_common.c ffmpeg/libavdevice/dshow_enummediatypes.c ffmpeg/libavdevice/dshow_enumpins.c ffmpeg/libavdevice/dshow_filter.c ffmpeg/libavdevice/dshow_pin.c ffmpeg/libavdevice/dv1394.c ffmpeg/libavdevice/dv1394.h ffmpeg/libavdevice/fbdev.c ffmpeg/libavdevice/iec61883.c ffmpeg/libavdevice/jack_audio.c ffmpeg/libavdevice/lavfi.c ffmpeg/libavdevice/libavdevice.v ffmpeg/libavdevice/libcdio.c ffmpeg/libavdevice/libdc1394.c ffmpeg/libavdevice/openal-dec.c ffmpeg/libavdevice/oss_audio.c ffmpeg/libavdevice/pulse.c ffmpeg/libavdevice/sdl.c ffmpeg/libavdevice/sndio_common.c ffmpeg/libavdevice/sndio_common.h ffmpeg/libavdevice/sndio_dec.c ffmpeg/libavdevice/sndio_enc.c ffmpeg/libavdevice/timefilter.c ffmpeg/libavdevice/timefilter.h ffmpeg/libavdevice/v4l.c ffmpeg/libavdevice/v4l2.c ffmpeg/libavdevice/version.h ffmpeg/libavdevice/vfwcap.c ffmpeg/libavdevice/x11grab.c ffmpeg/libavfilter/ ffmpeg/libavfilter/Makefile ffmpeg/libavfilter/af_aconvert.c ffmpeg/libavfilter/af_aformat.c ffmpeg/libavfilter/af_amerge.c ffmpeg/libavfilter/af_amix.c ffmpeg/libavfilter/af_anull.c ffmpeg/libavfilter/af_aresample.c ffmpeg/libavfilter/af_asetnsamples.c ffmpeg/libavfilter/af_ashowinfo.c ffmpeg/libavfilter/af_astreamsync.c ffmpeg/libavfilter/af_asyncts.c ffmpeg/libavfilter/af_atempo.c ffmpeg/libavfilter/af_channelmap.c ffmpeg/libavfilter/af_channelsplit.c ffmpeg/libavfilter/af_earwax.c ffmpeg/libavfilter/af_join.c ffmpeg/libavfilter/af_pan.c ffmpeg/libavfilter/af_resample.c ffmpeg/libavfilter/af_silencedetect.c ffmpeg/libavfilter/af_volume.c ffmpeg/libavfilter/af_volumedetect.c ffmpeg/libavfilter/all_channel_layouts.inc ffmpeg/libavfilter/allfilters.c ffmpeg/libavfilter/asink_anullsink.c ffmpeg/libavfilter/asrc_abuffer.h ffmpeg/libavfilter/asrc_aevalsrc.c ffmpeg/libavfilter/asrc_anullsrc.c ffmpeg/libavfilter/asrc_flite.c ffmpeg/libavfilter/audio.c ffmpeg/libavfilter/audio.h ffmpeg/libavfilter/avcodec.c ffmpeg/libavfilter/avcodec.h ffmpeg/libavfilter/avf_concat.c ffmpeg/libavfilter/avf_showspectrum.c ffmpeg/libavfilter/avf_showwaves.c ffmpeg/libavfilter/avfilter.c ffmpeg/libavfilter/avfilter.h ffmpeg/libavfilter/avfiltergraph.c ffmpeg/libavfilter/avfiltergraph.h ffmpeg/libavfilter/bbox.c ffmpeg/libavfilter/bbox.h ffmpeg/libavfilter/buffer.c ffmpeg/libavfilter/bufferqueue.h ffmpeg/libavfilter/buffersink.c ffmpeg/libavfilter/buffersink.h ffmpeg/libavfilter/buffersrc.c ffmpeg/libavfilter/buffersrc.h ffmpeg/libavfilter/drawutils.c ffmpeg/libavfilter/drawutils.h ffmpeg/libavfilter/f_sendcmd.c ffmpeg/libavfilter/f_setpts.c ffmpeg/libavfilter/f_settb.c ffmpeg/libavfilter/fifo.c ffmpeg/libavfilter/filtfmts.c ffmpeg/libavfilter/formats.c ffmpeg/libavfilter/formats.h ffmpeg/libavfilter/gradfun.h ffmpeg/libavfilter/graphdump.c ffmpeg/libavfilter/graphparser.c ffmpeg/libavfilter/internal.h ffmpeg/libavfilter/lavfutils.c ffmpeg/libavfilter/lavfutils.h ffmpeg/libavfilter/libavfilter.v ffmpeg/libavfilter/libmpcodecs/ ffmpeg/libavfilter/libmpcodecs/cpudetect.h ffmpeg/libavfilter/libmpcodecs/help_mp.h ffmpeg/libavfilter/libmpcodecs/img_format.c ffmpeg/libavfilter/libmpcodecs/img_format.h ffmpeg/libavfilter/libmpcodecs/libvo/ ffmpeg/libavfilter/libmpcodecs/libvo/fastmemcpy.h ffmpeg/libavfilter/libmpcodecs/libvo/video_out.h ffmpeg/libavfilter/libmpcodecs/mp_image.c ffmpeg/libavfilter/libmpcodecs/mp_image.h ffmpeg/libavfilter/libmpcodecs/mp_msg.h ffmpeg/libavfilter/libmpcodecs/mpbswap.h ffmpeg/libavfilter/libmpcodecs/mpc_info.h ffmpeg/libavfilter/libmpcodecs/pullup.c ffmpeg/libavfilter/libmpcodecs/pullup.h ffmpeg/libavfilter/libmpcodecs/vd_ffmpeg.h ffmpeg/libavfilter/libmpcodecs/vf.h ffmpeg/libavfilter/libmpcodecs/vf_denoise3d.c ffmpeg/libavfilter/libmpcodecs/vf_detc.c ffmpeg/libavfilter/libmpcodecs/vf_dint.c ffmpeg/libavfilter/libmpcodecs/vf_divtc.c ffmpeg/libavfilter/libmpcodecs/vf_down3dright.c ffmpeg/libavfilter/libmpcodecs/vf_dsize.c ffmpeg/libavfilter/libmpcodecs/vf_eq.c ffmpeg/libavfilter/libmpcodecs/vf_eq2.c ffmpeg/libavfilter/libmpcodecs/vf_field.c ffmpeg/libavfilter/libmpcodecs/vf_fil.c ffmpeg/libavfilter/libmpcodecs/vf_filmdint.c ffmpeg/libavfilter/libmpcodecs/vf_fixpts.c ffmpeg/libavfilter/libmpcodecs/vf_fspp.c ffmpeg/libavfilter/libmpcodecs/vf_geq.c ffmpeg/libavfilter/libmpcodecs/vf_harddup.c ffmpeg/libavfilter/libmpcodecs/vf_hqdn3d.c ffmpeg/libavfilter/libmpcodecs/vf_il.c ffmpeg/libavfilter/libmpcodecs/vf_ilpack.c ffmpeg/libavfilter/libmpcodecs/vf_ivtc.c ffmpeg/libavfilter/libmpcodecs/vf_kerndeint.c ffmpeg/libavfilter/libmpcodecs/vf_mcdeint.c ffmpeg/libavfilter/libmpcodecs/vf_noise.c ffmpeg/libavfilter/libmpcodecs/vf_ow.c ffmpeg/libavfilter/libmpcodecs/vf_palette.c ffmpeg/libavfilter/libmpcodecs/vf_perspective.c ffmpeg/libavfilter/libmpcodecs/vf_phase.c ffmpeg/libavfilter/libmpcodecs/vf_pp.c ffmpeg/libavfilter/libmpcodecs/vf_pp7.c ffmpeg/libavfilter/libmpcodecs/vf_pullup.c ffmpeg/libavfilter/libmpcodecs/vf_qp.c ffmpeg/libavfilter/libmpcodecs/vf_rectangle.c ffmpeg/libavfilter/libmpcodecs/vf_sab.c ffmpeg/libavfilter/libmpcodecs/vf_scale.h ffmpeg/libavfilter/libmpcodecs/vf_softpulldown.c ffmpeg/libavfilter/libmpcodecs/vf_softskip.c ffmpeg/libavfilter/libmpcodecs/vf_spp.c ffmpeg/libavfilter/libmpcodecs/vf_stereo3d.c ffmpeg/libavfilter/libmpcodecs/vf_telecine.c ffmpeg/libavfilter/libmpcodecs/vf_tile.c ffmpeg/libavfilter/libmpcodecs/vf_tinterlace.c ffmpeg/libavfilter/libmpcodecs/vf_unsharp.c ffmpeg/libavfilter/libmpcodecs/vf_uspp.c ffmpeg/libavfilter/libmpcodecs/vf_yuvcsp.c ffmpeg/libavfilter/libmpcodecs/vf_yvu9.c ffmpeg/libavfilter/libmpcodecs/vfcap.h ffmpeg/libavfilter/lswsutils.c ffmpeg/libavfilter/lswsutils.h ffmpeg/libavfilter/sink_buffer.c ffmpeg/libavfilter/split.c ffmpeg/libavfilter/src_buffer.c ffmpeg/libavfilter/src_movie.c ffmpeg/libavfilter/transform.c ffmpeg/libavfilter/transform.h ffmpeg/libavfilter/version.h ffmpeg/libavfilter/vf_alphaextract.c ffmpeg/libavfilter/vf_alphamerge.c ffmpeg/libavfilter/vf_aspect.c ffmpeg/libavfilter/vf_ass.c ffmpeg/libavfilter/vf_bbox.c ffmpeg/libavfilter/vf_blackdetect.c ffmpeg/libavfilter/vf_blackframe.c ffmpeg/libavfilter/vf_boxblur.c ffmpeg/libavfilter/vf_colormatrix.c ffmpeg/libavfilter/vf_copy.c ffmpeg/libavfilter/vf_crop.c ffmpeg/libavfilter/vf_cropdetect.c ffmpeg/libavfilter/vf_decimate.c ffmpeg/libavfilter/vf_delogo.c ffmpeg/libavfilter/vf_deshake.c ffmpeg/libavfilter/vf_drawbox.c ffmpeg/libavfilter/vf_drawtext.c ffmpeg/libavfilter/vf_edgedetect.c ffmpeg/libavfilter/vf_fade.c ffmpeg/libavfilter/vf_fieldorder.c ffmpeg/libavfilter/vf_format.c ffmpeg/libavfilter/vf_fps.c ffmpeg/libavfilter/vf_framestep.c ffmpeg/libavfilter/vf_frei0r.c ffmpeg/libavfilter/vf_gradfun.c ffmpeg/libavfilter/vf_hflip.c ffmpeg/libavfilter/vf_hqdn3d.c ffmpeg/libavfilter/vf_hue.c ffmpeg/libavfilter/vf_idet.c ffmpeg/libavfilter/vf_libopencv.c ffmpeg/libavfilter/vf_lut.c ffmpeg/libavfilter/vf_mp.c ffmpeg/libavfilter/vf_null.c ffmpeg/libavfilter/vf_overlay.c ffmpeg/libavfilter/vf_pad.c ffmpeg/libavfilter/vf_pixdesctest.c ffmpeg/libavfilter/vf_removelogo.c ffmpeg/libavfilter/vf_scale.c ffmpeg/libavfilter/vf_select.c ffmpeg/libavfilter/vf_setfield.c ffmpeg/libavfilter/vf_showinfo.c ffmpeg/libavfilter/vf_slicify.c ffmpeg/libavfilter/vf_smartblur.c ffmpeg/libavfilter/vf_super2xsai.c ffmpeg/libavfilter/vf_swapuv.c ffmpeg/libavfilter/vf_thumbnail.c ffmpeg/libavfilter/vf_tile.c ffmpeg/libavfilter/vf_tinterlace.c ffmpeg/libavfilter/vf_transpose.c ffmpeg/libavfilter/vf_unsharp.c ffmpeg/libavfilter/vf_vflip.c ffmpeg/libavfilter/vf_yadif.c ffmpeg/libavfilter/video.c ffmpeg/libavfilter/video.h ffmpeg/libavfilter/vsink_nullsink.c ffmpeg/libavfilter/vsrc_cellauto.c ffmpeg/libavfilter/vsrc_life.c ffmpeg/libavfilter/vsrc_mandelbrot.c ffmpeg/libavfilter/vsrc_mptestsrc.c ffmpeg/libavfilter/vsrc_testsrc.c ffmpeg/libavfilter/x86/ ffmpeg/libavfilter/x86/Makefile ffmpeg/libavfilter/x86/gradfun.c ffmpeg/libavfilter/x86/hqdn3d.asm ffmpeg/libavfilter/x86/yadif.c ffmpeg/libavfilter/x86/yadif_template.c ffmpeg/libavfilter/yadif.h ffmpeg/libavformat/ ffmpeg/libavformat/4xm.c ffmpeg/libavformat/Makefile ffmpeg/libavformat/a64.c ffmpeg/libavformat/aacdec.c ffmpeg/libavformat/ac3dec.c ffmpeg/libavformat/act.c ffmpeg/libavformat/adtsenc.c ffmpeg/libavformat/adxdec.c ffmpeg/libavformat/aea.c ffmpeg/libavformat/aiff.h ffmpeg/libavformat/aiffdec.c ffmpeg/libavformat/aiffenc.c ffmpeg/libavformat/allformats.c ffmpeg/libavformat/amr.c ffmpeg/libavformat/anm.c ffmpeg/libavformat/apc.c ffmpeg/libavformat/ape.c ffmpeg/libavformat/apetag.c ffmpeg/libavformat/apetag.h ffmpeg/libavformat/apetagenc.c ffmpeg/libavformat/asf.c ffmpeg/libavformat/asf.h ffmpeg/libavformat/asfcrypt.c ffmpeg/libavformat/asfcrypt.h ffmpeg/libavformat/asfdec.c ffmpeg/libavformat/asfenc.c ffmpeg/libavformat/assdec.c ffmpeg/libavformat/assenc.c ffmpeg/libavformat/au.c ffmpeg/libavformat/audiointerleave.c ffmpeg/libavformat/audiointerleave.h ffmpeg/libavformat/avc.c ffmpeg/libavformat/avc.h ffmpeg/libavformat/avformat.h ffmpeg/libavformat/avi.h ffmpeg/libavformat/avidec.c ffmpeg/libavformat/avienc.c ffmpeg/libavformat/avio.c ffmpeg/libavformat/avio.h ffmpeg/libavformat/avio_internal.h ffmpeg/libavformat/aviobuf.c ffmpeg/libavformat/avisynth.c ffmpeg/libavformat/avlanguage.c ffmpeg/libavformat/avlanguage.h ffmpeg/libavformat/avs.c ffmpeg/libavformat/bethsoftvid.c ffmpeg/libavformat/bfi.c ffmpeg/libavformat/bink.c ffmpeg/libavformat/bintext.c ffmpeg/libavformat/bit.c ffmpeg/libavformat/bluray.c ffmpeg/libavformat/bmv.c ffmpeg/libavformat/c93.c ffmpeg/libavformat/cache.c ffmpeg/libavformat/caf.c ffmpeg/libavformat/caf.h ffmpeg/libavformat/cafdec.c ffmpeg/libavformat/cafenc.c ffmpeg/libavformat/cavsvideodec.c ffmpeg/libavformat/cdg.c ffmpeg/libavformat/cdxl.c ffmpeg/libavformat/concat.c ffmpeg/libavformat/crcenc.c ffmpeg/libavformat/crypto.c ffmpeg/libavformat/cutils.c ffmpeg/libavformat/daud.c ffmpeg/libavformat/dfa.c ffmpeg/libavformat/diracdec.c ffmpeg/libavformat/dnxhddec.c ffmpeg/libavformat/dsicin.c ffmpeg/libavformat/dtsdec.c ffmpeg/libavformat/dv.c ffmpeg/libavformat/dv.h ffmpeg/libavformat/dvenc.c ffmpeg/libavformat/dxa.c ffmpeg/libavformat/eacdata.c ffmpeg/libavformat/electronicarts.c ffmpeg/libavformat/ffm.h ffmpeg/libavformat/ffmdec.c ffmpeg/libavformat/ffmenc.c ffmpeg/libavformat/ffmeta.h ffmpeg/libavformat/ffmetadec.c ffmpeg/libavformat/ffmetaenc.c ffmpeg/libavformat/file.c ffmpeg/libavformat/filmstripdec.c ffmpeg/libavformat/filmstripenc.c ffmpeg/libavformat/flacdec.c ffmpeg/libavformat/flacenc.c ffmpeg/libavformat/flacenc.h ffmpeg/libavformat/flacenc_header.c ffmpeg/libavformat/flic.c ffmpeg/libavformat/flv.h ffmpeg/libavformat/flvdec.c ffmpeg/libavformat/flvenc.c ffmpeg/libavformat/framecrcenc.c ffmpeg/libavformat/framehash.c ffmpeg/libavformat/g723_1.c ffmpeg/libavformat/g729dec.c ffmpeg/libavformat/gif.c ffmpeg/libavformat/gopher.c ffmpeg/libavformat/gsmdec.c ffmpeg/libavformat/gxf.c ffmpeg/libavformat/gxf.h ffmpeg/libavformat/gxfenc.c ffmpeg/libavformat/h261dec.c ffmpeg/libavformat/h263dec.c ffmpeg/libavformat/h264dec.c ffmpeg/libavformat/hls.c ffmpeg/libavformat/hlsproto.c ffmpeg/libavformat/http.c ffmpeg/libavformat/http.h ffmpeg/libavformat/httpauth.c ffmpeg/libavformat/httpauth.h ffmpeg/libavformat/icodec.c ffmpeg/libavformat/icoenc.c ffmpeg/libavformat/id3v1.c ffmpeg/libavformat/id3v1.h ffmpeg/libavformat/id3v2.c ffmpeg/libavformat/id3v2.h ffmpeg/libavformat/id3v2enc.c ffmpeg/libavformat/idcin.c ffmpeg/libavformat/idroqdec.c ffmpeg/libavformat/idroqenc.c ffmpeg/libavformat/iff.c ffmpeg/libavformat/ilbc.c ffmpeg/libavformat/img2.c ffmpeg/libavformat/img2dec.c ffmpeg/libavformat/img2enc.c ffmpeg/libavformat/ingenientdec.c ffmpeg/libavformat/internal.h ffmpeg/libavformat/ipmovie.c ffmpeg/libavformat/isom.c ffmpeg/libavformat/isom.h ffmpeg/libavformat/iss.c ffmpeg/libavformat/iv8.c ffmpeg/libavformat/ivfdec.c ffmpeg/libavformat/ivfenc.c ffmpeg/libavformat/jacosubdec.c ffmpeg/libavformat/jacosubenc.c ffmpeg/libavformat/jvdec.c ffmpeg/libavformat/latmenc.c ffmpeg/libavformat/libavformat.v ffmpeg/libavformat/libmodplug.c ffmpeg/libavformat/libnut.c ffmpeg/libavformat/librtmp.c ffmpeg/libavformat/lmlm4.c ffmpeg/libavformat/loasdec.c ffmpeg/libavformat/lxfdec.c ffmpeg/libavformat/m4vdec.c ffmpeg/libavformat/matroska.c ffmpeg/libavformat/matroska.h ffmpeg/libavformat/matroskadec.c ffmpeg/libavformat/matroskaenc.c ffmpeg/libavformat/md5enc.c ffmpeg/libavformat/md5proto.c ffmpeg/libavformat/metadata.c ffmpeg/libavformat/metadata.h ffmpeg/libavformat/mgsts.c ffmpeg/libavformat/microdvddec.c ffmpeg/libavformat/microdvdenc.c ffmpeg/libavformat/mkvtimestamp_v2.c ffmpeg/libavformat/mm.c ffmpeg/libavformat/mmf.c ffmpeg/libavformat/mms.c ffmpeg/libavformat/mms.h ffmpeg/libavformat/mmsh.c ffmpeg/libavformat/mmst.c ffmpeg/libavformat/mov.c ffmpeg/libavformat/mov_chan.c ffmpeg/libavformat/mov_chan.h ffmpeg/libavformat/movenc.c ffmpeg/libavformat/movenc.h ffmpeg/libavformat/movenchint.c ffmpeg/libavformat/mp3dec.c ffmpeg/libavformat/mp3enc.c ffmpeg/libavformat/mpc.c ffmpeg/libavformat/mpc8.c ffmpeg/libavformat/mpeg.c ffmpeg/libavformat/mpeg.h ffmpeg/libavformat/mpegenc.c ffmpeg/libavformat/mpegts.c ffmpeg/libavformat/mpegts.h ffmpeg/libavformat/mpegtsenc.c ffmpeg/libavformat/mpegvideodec.c ffmpeg/libavformat/mpjpeg.c ffmpeg/libavformat/msnwc_tcp.c ffmpeg/libavformat/mtv.c ffmpeg/libavformat/mvi.c ffmpeg/libavformat/mxf.c ffmpeg/libavformat/mxf.h ffmpeg/libavformat/mxfdec.c ffmpeg/libavformat/mxfenc.c ffmpeg/libavformat/mxg.c ffmpeg/libavformat/ncdec.c ffmpeg/libavformat/network.c ffmpeg/libavformat/network.h ffmpeg/libavformat/nsvdec.c ffmpeg/libavformat/nullenc.c ffmpeg/libavformat/nut.c ffmpeg/libavformat/nut.h ffmpeg/libavformat/nutdec.c ffmpeg/libavformat/nutenc.c ffmpeg/libavformat/nuv.c ffmpeg/libavformat/oggdec.c ffmpeg/libavformat/oggdec.h ffmpeg/libavformat/oggenc.c ffmpeg/libavformat/oggparsecelt.c ffmpeg/libavformat/oggparsedirac.c ffmpeg/libavformat/oggparseflac.c ffmpeg/libavformat/oggparseogm.c ffmpeg/libavformat/oggparseopus.c ffmpeg/libavformat/oggparseskeleton.c ffmpeg/libavformat/oggparsespeex.c ffmpeg/libavformat/oggparsetheora.c ffmpeg/libavformat/oggparsevorbis.c ffmpeg/libavformat/oma.c ffmpeg/libavformat/oma.h ffmpeg/libavformat/omadec.c ffmpeg/libavformat/omaenc.c ffmpeg/libavformat/options.c ffmpeg/libavformat/options_table.h ffmpeg/libavformat/os_support.c ffmpeg/libavformat/os_support.h ffmpeg/libavformat/paf.c ffmpeg/libavformat/pcm.c ffmpeg/libavformat/pcm.h ffmpeg/libavformat/pcmdec.c ffmpeg/libavformat/pcmenc.c ffmpeg/libavformat/pmpdec.c ffmpeg/libavformat/psxstr.c ffmpeg/libavformat/pva.c ffmpeg/libavformat/qcp.c ffmpeg/libavformat/qtpalette.h ffmpeg/libavformat/r3d.c ffmpeg/libavformat/rawdec.c ffmpeg/libavformat/rawdec.h ffmpeg/libavformat/rawenc.c ffmpeg/libavformat/rawenc.h ffmpeg/libavformat/rawvideodec.c ffmpeg/libavformat/rdt.c ffmpeg/libavformat/rdt.h ffmpeg/libavformat/realtextdec.c ffmpeg/libavformat/riff.c ffmpeg/libavformat/riff.h ffmpeg/libavformat/rl2.c ffmpeg/libavformat/rm.c ffmpeg/libavformat/rm.h ffmpeg/libavformat/rmdec.c ffmpeg/libavformat/rmenc.c ffmpeg/libavformat/rpl.c ffmpeg/libavformat/rso.c ffmpeg/libavformat/rso.h ffmpeg/libavformat/rsodec.c ffmpeg/libavformat/rsoenc.c ffmpeg/... [truncated message content] |
From: <nic...@us...> - 2012-10-15 16:05:24
|
Revision: 163 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=163&view=rev Author: nickols_k Date: 2012-10-15 16:05:13 +0000 (Mon, 15 Oct 2012) Log Message: ----------- more warnings Modified Paths: -------------- mplayerxp/configure mplayerxp/libao2/audio_out.h Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2012-10-15 15:55:11 UTC (rev 162) +++ mplayerxp/configure 2012-10-15 16:05:13 UTC (rev 163) @@ -295,7 +295,7 @@ #enabled gomp && check_cflags -ftree-parallelize-loops=4 ##################################################### add_cflags "-Werror-implicit-function-declaration" -check_cflags "-Wextra" +check_cflags "-W -Wall -Wextra" echocheck CFLAGS echores $CFLAGS Modified: mplayerxp/libao2/audio_out.h =================================================================== --- mplayerxp/libao2/audio_out.h 2012-10-15 15:55:11 UTC (rev 162) +++ mplayerxp/libao2/audio_out.h 2012-10-15 16:05:13 UTC (rev 163) @@ -13,7 +13,7 @@ /** AO-driver interface */ typedef struct ao_functions_s { - ao_info_t *info; /**< text-info about this driver */ + const ao_info_t *info; /**< text-info about this driver */ /** Control interface * @param cmd command. See AOCONTROL_** for detail This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2012-10-16 16:31:48
|
Revision: 164 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=164&view=rev Author: nickols_k Date: 2012-10-16 16:31:36 +0000 (Tue, 16 Oct 2012) Log Message: ----------- optimize size+speed: combine variables into structures Modified Paths: -------------- mplayerxp/cfg-mplayer.h mplayerxp/configure mplayerxp/find_sub.c mplayerxp/libmpdemux/demux_mkv.c mplayerxp/libmpdemux/demux_mpxp64.c mplayerxp/libmpdemux/demux_ogg.c mplayerxp/libmpdemux/demuxer.c mplayerxp/libmpdemux/s_dvdnav.c mplayerxp/libmpdemux/sub_cc.c mplayerxp/libmpdemux/sub_ty.c mplayerxp/libvo/font_load.c mplayerxp/libvo/screenshot.c mplayerxp/libvo/sub.c mplayerxp/libvo/sub.h mplayerxp/libvo/video_out.c mplayerxp/libvo/video_out.h mplayerxp/libvo/vo_dga.c mplayerxp/libvo/vo_fbdev.c mplayerxp/libvo/vo_null.c mplayerxp/libvo/vo_opengl.c mplayerxp/libvo/vo_vesa.c mplayerxp/libvo/vo_x11.c mplayerxp/libvo/vo_xv.c mplayerxp/libvo/vo_xvidix.c mplayerxp/libvo/vosub_vidix.c mplayerxp/libvo/x11_common.c mplayerxp/libvo/x11_common.h mplayerxp/mplayer.c mplayerxp/postproc/libmenu/menu.c mplayerxp/postproc/libmenu/menu_list.c mplayerxp/postproc/libmenu/menu_txt.c mplayerxp/spudec.c mplayerxp/spudec.h mplayerxp/subreader.c mplayerxp/subreader.h Modified: mplayerxp/cfg-mplayer.h =================================================================== --- mplayerxp/cfg-mplayer.h 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/cfg-mplayer.h 2012-10-16 16:31:36 UTC (rev 164) @@ -22,25 +22,12 @@ extern int fakemono; // defined in dec_audio.c #endif -#ifdef USE_SUB -extern int sub_unicode; -extern int sub_utf8; -#ifdef USE_ICONV -extern char *sub_cp; -#endif -extern int sub_pos; -#endif extern int subcc_enabled; #ifdef USE_OSD extern int osd_level; #endif -#ifdef HAVE_X11 -extern char *mDisplayName; -extern int WinID; -#endif - #ifdef HAVE_AA extern int vo_aa_parseoption(struct config * conf, char *opt, char * param); extern void vo_aa_revertoption(config_t* opt,char* param); @@ -245,16 +232,16 @@ #ifdef USE_SUB {"file", &sub_name, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the subtitle file"}, #ifdef USE_ICONV - {"cp", &sub_cp, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies codepage of subtitles"}, + {"cp", &sub_data.cp, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies codepage of subtitles"}, #endif {"delay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL, "delays subtitles by given number of seconds"}, {"fps", &sub_fps, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL, "specifies frame/sec rate of subtitle file"}, {"noauto", &sub_auto, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disable autodetection of vobsub for textsubs if vobsub found"}, - {"unicode", &sub_unicode, CONF_TYPE_FLAG, 0, 0, 1, NULL, "tells MPlayerXP to handle the subtitle file as UNICODE"}, - {"nounicode", &sub_unicode, CONF_TYPE_FLAG, 0, 1, 0, NULL, "tells MPlayerXP to handle the subtitle file as non-UNICODE"}, - {"utf8", &sub_utf8, CONF_TYPE_FLAG, 0, 0, 1, NULL, "tells MPlayerXP to handle the subtitle file as UTF8"}, - {"noutf8", &sub_utf8, CONF_TYPE_FLAG, 0, 1, 0, NULL, "tells MPlayerXP to handle the subtitle file as non-UTF8"}, - {"pos",&sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL, "specifies vertical shift of subtitles"}, + {"unicode", &sub_data.unicode, CONF_TYPE_FLAG, 0, 0, 1, NULL, "tells MPlayerXP to handle the subtitle file as UNICODE"}, + {"nounicode", &sub_data.unicode, CONF_TYPE_FLAG, 0, 1, 0, NULL, "tells MPlayerXP to handle the subtitle file as non-UNICODE"}, + {"utf8", &sub_data.utf8, CONF_TYPE_FLAG, 0, 0, 1, NULL, "tells MPlayerXP to handle the subtitle file as UTF8"}, + {"noutf8", &sub_data.utf8, CONF_TYPE_FLAG, 0, 1, 0, NULL, "tells MPlayerXP to handle the subtitle file as non-UTF8"}, + {"pos",&sub_data.pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL, "specifies vertical shift of subtitles"}, #endif {"cc", &subcc_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enable DVD Closed Caption (CC) subtitles"}, {"nocc", &subcc_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disable DVD Closed Caption (CC) subtitles"}, @@ -266,9 +253,9 @@ #ifdef HAVE_X11 static const config_t x11_config[]={ - {"display", &mDisplayName, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the hostname and display number of the X server"}, - {"wid", &WinID, CONF_TYPE_INT, 0, 0, 0, NULL, "tells MPlayerXP to use existing X11 window (for using MPlayerXP as plugin)"}, - {"rootwin", &WinID, CONF_TYPE_FLAG, 0, -1, 0, NULL, "render movie in the root window (desktop background)"}, + {"display", &vo.mDisplayName, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the hostname and display number of the X server"}, + {"wid", &vo.WinID, CONF_TYPE_INT, 0, 0, 0, NULL, "tells MPlayerXP to use existing X11 window (for using MPlayerXP as plugin)"}, + {"rootwin", &vo.WinID, CONF_TYPE_FLAG, 0, -1, 0, NULL, "render movie in the root window (desktop background)"}, #ifdef HAVE_XINERAMA {"xinerama", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL, "tells MPlayerXP the display for movie playback"}, #endif Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/configure 2012-10-16 16:31:36 UTC (rev 164) @@ -699,10 +699,6 @@ enabled tv && print_config USE_ mp_config.h mp_config.mak tv enabled tv && inputmodules="tv $inputmodules" || noinputmodules="tv $noinputmodules" -enabled tv_v4l && require2 tv_v4l "stdlib.h linux/videodev.h" video_devdata -print_config HAVE_ mp_config.h mp_config.mak tv_v4l -enabled tv_v4l && vomodules="tv-v4l $vomodules" || novomodules="tv-v4l $novomodules" - print_config HAVE_ mp_config.h mp_config.mak audio_select enabled libvorbis && check_pkg libvorbis vorbis Modified: mplayerxp/find_sub.c =================================================================== --- mplayerxp/find_sub.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/find_sub.c 2012-10-16 16:31:36 UTC (rev 164) @@ -25,8 +25,8 @@ if ( !subtitles ) return; - if(vo_sub){ - if(key>=vo_sub->start && key<=vo_sub->end) return; // OK! + if(vo.sub){ + if(key>=vo.sub->start && key<=vo.sub->end) return; // OK! } else { if(key>nosub_range_start && key<nosub_range_end) return; // OK! } @@ -36,7 +36,7 @@ vo_osd_changed(OSDTYPE_SUBTITLE); if(key<=0){ - vo_sub=NULL; // no sub here + vo.sub=NULL; // no sub here return; } @@ -47,13 +47,13 @@ // no sub nosub_range_start=subtitles[current_sub].end; nosub_range_end=subtitles[current_sub+1].start; - vo_sub=NULL; + vo.sub=NULL; return; } // next sub? ++current_sub; - vo_sub=&subtitles[current_sub]; - if(key>=vo_sub->start && key<=vo_sub->end) return; // OK! + vo.sub=&subtitles[current_sub]; + if(key>=vo.sub->start && key<=vo.sub->end) return; // OK! } @@ -61,20 +61,20 @@ i=0;j=sub_num-1; while(j>=i){ current_sub=(i+j+1)/2; - vo_sub=&subtitles[current_sub]; - if(key<vo_sub->start) j=current_sub-1; - else if(key>vo_sub->end) i=current_sub+1; + vo.sub=&subtitles[current_sub]; + if(key<vo.sub->start) j=current_sub-1; + else if(key>vo.sub->end) i=current_sub+1; else return; // found! } -// if(key>=vo_sub->start && key<=vo_sub->end) return; // OK! +// if(key>=vo.sub->start && key<=vo.sub->end) return; // OK! // check where are we... - if(key<vo_sub->start){ + if(key<vo.sub->start){ if(current_sub<=0){ // before the first sub nosub_range_start=key-1; // tricky - nosub_range_end=vo_sub->start; - vo_sub=NULL; + nosub_range_end=vo.sub->start; + vo.sub=NULL; return; } --current_sub; @@ -82,31 +82,31 @@ // no sub nosub_range_start=subtitles[current_sub].end; nosub_range_end=subtitles[current_sub+1].start; - vo_sub=NULL; + vo.sub=NULL; return; } MSG_V("HEH???? "); } else { - if(key<=vo_sub->end) MSG_V("JAJJ! "); else + if(key<=vo.sub->end) MSG_V("JAJJ! "); else if(current_sub+1>=sub_num){ // at the end? - nosub_range_start=vo_sub->end; + nosub_range_start=vo.sub->end; nosub_range_end=0x7FFFFFFF; // MAXINT - vo_sub=NULL; + vo.sub=NULL; return; } else if(key>subtitles[current_sub].end && key<subtitles[current_sub+1].start){ // no sub nosub_range_start=subtitles[current_sub].end; nosub_range_end=subtitles[current_sub+1].start; - vo_sub=NULL; + vo.sub=NULL; return; } } - - MSG_ERR("SUB ERROR: %d ? %d --- %d [%d] \n",key,(int)vo_sub->start,(int)vo_sub->end,current_sub); - vo_sub=NULL; // no sub here + MSG_ERR("SUB ERROR: %d ? %d --- %d [%d] \n",key,(int)vo.sub->start,(int)vo.sub->end,current_sub); + + vo.sub=NULL; // no sub here } #endif Modified: mplayerxp/libmpdemux/demux_mkv.c =================================================================== --- mplayerxp/libmpdemux/demux_mkv.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libmpdemux/demux_mkv.c 2012-10-16 16:31:36 UTC (rev 164) @@ -3156,7 +3156,7 @@ return; } - sub_utf8 = 1; + sub_data.utf8 = 1; size -= ptr1 - block; dp = new_demux_packet(size); memcpy(dp->buffer, ptr1, size); Modified: mplayerxp/libmpdemux/demux_mpxp64.c =================================================================== --- mplayerxp/libmpdemux/demux_mpxp64.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libmpdemux/demux_mpxp64.c 2012-10-16 16:31:36 UTC (rev 164) @@ -22,6 +22,7 @@ #include "bswap.h" #include "aviheader.h" #include "../libmpcodecs/dec_audio.h" +#include "../libvo/sub.h" #include "aviprint.h" #include "mpxpav64.h" #include "demux_msg.h" @@ -428,7 +429,7 @@ { str=malloc(len); stream_read(s,str,len); - sub_cp=nls_get_screen_cp(); + sub_data.cp=nls_get_screen_cp(); demux_info_add(demuxer,infot,nls_recode2screen_cp(codepage,str,len)); free(str); } Modified: mplayerxp/libmpdemux/demux_ogg.c =================================================================== --- mplayerxp/libmpdemux/demux_ogg.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libmpdemux/demux_ogg.c 2012-10-16 16:31:36 UTC (rev 164) @@ -21,7 +21,7 @@ #include "aviprint.h" #include "../libmpcodecs/codecs_ld.h" #include "../libmpcodecs/dec_audio.h" -#include "../libvo/sub.h" +#include "../libvo/video_out.h" #include "demux_msg.h" #define BLOCK_SIZE 4096 @@ -291,7 +291,7 @@ #ifdef USE_ICONV subcp_recode1(&ogg_sub); #endif - vo_sub = &ogg_sub; + vo.sub = &ogg_sub; vo_osd_changed(OSDTYPE_SUBTITLE); } @@ -554,7 +554,7 @@ /// Clear subtitles if necessary (for broken files) if ((clear_sub > 0) && (pts >= clear_sub)) { ogg_sub.lines = 0; - vo_sub = &ogg_sub; + vo.sub = &ogg_sub; vo_osd_changed(OSDTYPE_SUBTITLE); clear_sub = -1; } @@ -1412,7 +1412,7 @@ } if(!precision && (is_keyframe || os->vorbis) ) { ogg_sub.lines = 0; - vo_sub = &ogg_sub; + vo.sub = &ogg_sub; vo_osd_changed(OSDTYPE_SUBTITLE); clear_sub = -1; demux_ogg_add_packet(ds,os,ds->id,&op); Modified: mplayerxp/libmpdemux/demuxer.c =================================================================== --- mplayerxp/libmpdemux/demuxer.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libmpdemux/demuxer.c 2012-10-16 16:31:36 UTC (rev 164) @@ -21,6 +21,7 @@ #include "stheader.h" #include "../libvo/fastmemcpy.h" +#include "../libvo/sub.h" #include "demux_msg.h" extern demuxer_driver_t demux_aiff; @@ -712,7 +713,7 @@ MSG_V( "Demuxer info '%s' already present as '%s'!\n",info_names[opt],((demuxer_info_t *)demuxer->info)->id[opt]); free(((demuxer_info_t *)demuxer->info)->id[opt]); } - ((demuxer_info_t *)demuxer->info)->id[opt]=nls_recode2screen_cp(sub_cp,param,strlen(param)); + ((demuxer_info_t *)demuxer->info)->id[opt]=nls_recode2screen_cp(sub_data.cp,param,strlen(param)); return 1; } Modified: mplayerxp/libmpdemux/s_dvdnav.c =================================================================== --- mplayerxp/libmpdemux/s_dvdnav.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libmpdemux/s_dvdnav.c 2012-10-16 16:31:36 UTC (rev 164) @@ -509,12 +509,12 @@ stream_change->physical_letterbox, stream_change->physical_pan_scan, stream_change->logical); - if (vo_spudec && dvdsub_id!=stream_change->physical_wide) { + if (vo.spudec && dvdsub_id!=stream_change->physical_wide) { MSG_DBG2("d_dvdsub->id change: was %d is now %d\n", d_dvdsub->id,stream_change->physical_wide); // FIXME: need a better way to change SPU id d_dvdsub->id=dvdsub_id=stream_change->physical_wide; - if (vo_spudec) spudec_reset(vo_spudec); + if (vo.spudec) spudec_reset(vo.spudec); } break; } @@ -560,7 +560,7 @@ MSG_DBG2("DVDNAV Event: Nav SPU CLUT Change\n"); if(sp->len!=64) MSG_WARN("DVDNAV Event: Nav SPU CLUT Change: %i bytes <> 64\n",sp->len); // send new palette to SPU decoder - if (vo_spudec) spudec_update_palette(vo_spudec,(const unsigned int *)(sp->buf)); + if (vo.spudec) spudec_update_palette(vo.spudec,(const unsigned int *)(sp->buf)); break; } } Modified: mplayerxp/libmpdemux/sub_cc.c =================================================================== --- mplayerxp/libmpdemux/sub_cc.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libmpdemux/sub_cc.c 2012-10-16 16:31:36 UTC (rev 164) @@ -151,7 +151,7 @@ static void display_buffer(const subtitle * buf) { - vo_sub=buf; + vo.sub=buf; vo_osd_changed(OSDTYPE_SUBTITLE); } Modified: mplayerxp/libmpdemux/sub_ty.c =================================================================== --- mplayerxp/libmpdemux/sub_ty.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libmpdemux/sub_ty.c 2012-10-16 16:31:36 UTC (rev 164) @@ -17,7 +17,7 @@ #include "help_mp.h" #include "sub_cc.h" -#include "../libvo/sub.h" +#include "../libvo/video_out.h" #include "demux_msg.h" extern int sub_justify; @@ -894,7 +894,7 @@ // { // printf( "OSD:%d:%s\n", index, ty_OSD1.text[ index ] ); // } - vo_sub = &ty_OSD1; + vo.sub = &ty_OSD1; vo_osd_changed( OSDTYPE_SUBTITLE ); tyOSDUpdate = 0; } Modified: mplayerxp/libvo/font_load.c =================================================================== --- mplayerxp/libvo/font_load.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libvo/font_load.c 2012-10-16 16:31:36 UTC (rev 164) @@ -204,7 +204,7 @@ int chr=p[0][0]; int start=atoi(p[1]); int end=atoi(p[2]); - if(sub_unicode && (chr>=0x80)) chr=(chr<<8)+p[0][1]; + if(sub_data.unicode && (chr>=0x80)) chr=(chr<<8)+p[0][1]; else if(strlen(p[0])!=1) chr=strtol(p[0],NULL,0); if(end<start) { MSG_ERR("error in font desc: end<start for char '%c'\n",chr); Modified: mplayerxp/libvo/screenshot.c =================================================================== --- mplayerxp/libvo/screenshot.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libvo/screenshot.c 2012-10-16 16:31:36 UTC (rev 164) @@ -31,9 +31,11 @@ #define RGB 0 #define BGR 1 -static int cspace = RGB; -static unsigned image_width,image_height; - +typedef struct sshot_priv_s { + int cspace; + unsigned image_width,image_height; +}sshot_priv_t; +static sshot_priv_t sshot = { RGB, 0, 0 }; #ifdef HAVE_PNG int z_compression = Z_NO_COMPRESSION; @@ -88,14 +90,14 @@ /* set the zlib compression level */ png_set_compression_level(png.png_ptr, z_compression); - png_set_IHDR(png.png_ptr, png.info_ptr, image_width, image_height, + png_set_IHDR(png.png_ptr, png.info_ptr, sshot.image_width, sshot.image_height, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); MSG_V("PNG Write Info\n"); png_write_info(png.png_ptr, png.info_ptr); - if(cspace) { + if(sshot.cspace) { MSG_V("PNG Set BGR Conversion\n"); png_set_bgr(png.png_ptr); } @@ -200,9 +202,9 @@ MSG_ERR("vo_png: Can't initialize SwScaler\n"); return -1; } - image_width = w; - image_height = h; - if(!(image_data = malloc(image_width*image_height*3))) + sshot.image_width = w; + sshot.image_height = h; + if(!(image_data = malloc(sshot.image_width*sshot.image_height*3))) { MSG_ERR("vo_png: Can't allocate temporary buffer\n"); return -1; @@ -223,7 +225,7 @@ } MSG_V("PNG Compression level %i\n", z_compression); #endif - dstStride[0]=image_width*3; + dstStride[0]=sshot.image_width*3; dstStride[1]= dstStride[2]=0; dst[0]=image_data; @@ -244,9 +246,9 @@ } { - png_byte *row_pointers[image_height]; + png_byte *row_pointers[sshot.image_height]; unsigned bppmul = (bpp+7)/8; - for ( k = 0; k < image_height; k++ ) row_pointers[k] = &image_data[image_width*k*bppmul]; + for ( k = 0; k < sshot.image_height; k++ ) row_pointers[k] = &image_data[sshot.image_width*k*bppmul]; png_write_image(png.png_ptr, row_pointers); } Modified: mplayerxp/libvo/sub.c =================================================================== --- mplayerxp/libvo/sub.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libvo/sub.c 2012-10-16 16:31:36 UTC (rev 164) @@ -34,19 +34,14 @@ "Hue" }; static const char * __sub_osd_names_short[] ={ "", "|>", "||", "[]", "<<" , ">>", "", "", "", "", "", ""}; +static int vo_osd_changed_status = 0; +static rect_highlight_t nav_hl; +static int draw_alpha_init_flag=0; +static mp_osd_obj_t* vo_osd_list=NULL; -//static int vo_font_loaded=-1; -font_desc_t* vo_font=NULL; +sub_data_t sub_data = { NULL, 0, 0, 100, 0, 0 }; -char* vo_osd_text=NULL; -int sub_unicode=0; -int sub_utf8=0; -int sub_pos=100; -int sub_bg_color=0; /* subtitles background color */ -int sub_bg_alpha=0; -static rect_highlight_t nav_hl; - void __FASTCALL__ osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey) { nav_hl.sx = sx; nav_hl.sy = sy; @@ -68,8 +63,8 @@ obj->bitmap_buffer = (unsigned char *)memalign(16, len); obj->alpha_buffer = (unsigned char *)memalign(16, len); } - memset(obj->bitmap_buffer, sub_bg_color, len); - memset(obj->alpha_buffer, sub_bg_alpha, len); + memset(obj->bitmap_buffer, sub_data.bg_color, len); + memset(obj->alpha_buffer, sub_data.bg_alpha, len); } // renders the buffer @@ -105,18 +100,18 @@ // return the real height of a char: static inline int __FASTCALL__ get_height(int c,int h){ int font; - if ((font=vo_font->font[c])>=0) - if(h<vo_font->pic_a[font]->h) h=vo_font->pic_a[font]->h; + if ((font=vo.font->font[c])>=0) + if(h<vo.font->pic_a[font]->h) h=vo.font->pic_a[font]->h; return h; } int __FASTCALL__ get_osd_height(int c,int h) { - return vo_font?get_height(c,h):0; + return vo.font?get_height(c,h):0; } inline static void __FASTCALL__ vo_update_text_osd(mp_osd_obj_t* obj,int dxs,int dys){ - unsigned char *cp=(unsigned char *)vo_osd_text; + unsigned char *cp=(unsigned char *)vo.osd_text; int x=20; int h=0; UNUSED(dxs); @@ -126,37 +121,34 @@ while (*cp){ int c=*cp++; - x+=vo_font->width[c]+vo_font->charspace; + x+=vo.font->width[c]+vo.font->charspace; h=get_height(c,h); } - obj->bbox.x2=x-vo_font->charspace; + obj->bbox.x2=x-vo.font->charspace; obj->bbox.y2=obj->bbox.y1+h; obj->flags|=OSDFLAG_BBOX; } inline static void __FASTCALL__ vo_draw_text_osd(mp_osd_obj_t* obj,draw_osd_f draw_alpha){ - unsigned char *cp=(unsigned char *)vo_osd_text; + unsigned char *cp=(unsigned char *)vo.osd_text; int font; int x=obj->x; while (*cp){ int c=*cp++; - if ((font=vo_font->font[c])>=0 && c != ' ') + if ((font=vo.font->font[c])>=0 && c != ' ') draw_alpha(x,obj->y, - vo_font->width[c], - vo_font->pic_a[font]->h, - vo_font->pic_b[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); - x+=vo_font->width[c]+vo_font->charspace; + vo.font->width[c], + vo.font->pic_a[font]->h, + vo.font->pic_b[font]->bmp+vo.font->start[c], + vo.font->pic_a[font]->bmp+vo.font->start[c], + vo.font->pic_a[font]->w); + x+=vo.font->width[c]+vo.font->charspace; } } -int vo_osd_progbar_type=-1; -int vo_osd_progbar_value=100; // 0..256 - // if we have n=256 bars then OSD progbar looks like below // // 0 1 2 3 ... 256 <= vo_osd_progbar_value @@ -168,21 +160,21 @@ inline static void __FASTCALL__ vo_update_text_progbar(mp_osd_obj_t* obj,int dxs,int dys){ obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE; - - if(vo_osd_progbar_type<0 || !vo_font){ + + if(vo.osd_progbar_type<0 || !vo.font){ obj->flags&=~OSDFLAG_VISIBLE; return; } - + { int h=0; - int y=(dys-vo_font->height)/2; - int delimw=vo_font->width[OSD_PB_START] - +vo_font->width[OSD_PB_END] - +vo_font->charspace; + int y=(dys-vo.font->height)/2; + int delimw=vo.font->width[OSD_PB_START] + +vo.font->width[OSD_PB_END] + +vo.font->charspace; int width=(2*dxs-3*delimw)/3; - int charw=vo_font->width[OSD_PB_0]+vo_font->charspace; + int charw=vo.font->width[OSD_PB_0]+vo.font->charspace; int elems=width/charw; - int x=(dxs-elems*charw-delimw)/2; + int x=(dxs-elems*charw-delimw)/2; h=get_height(OSD_PB_START,h); h=get_height(OSD_PB_END,h); h=get_height(OSD_PB_0,h); @@ -190,61 +182,60 @@ obj->bbox.x1=obj->x=x; obj->bbox.y1=obj->y=y; obj->bbox.x2=x+width+delimw; - obj->bbox.y2=y+h; //vo_font->height; + obj->bbox.y2=y+h; //vo.font->height; obj->flags|=OSDFLAG_BBOX; obj->params.progbar.elems=elems; } - + } inline static void __FASTCALL__ vo_draw_text_progbar(mp_osd_obj_t* obj,draw_osd_f draw_alpha){ - unsigned char *s; - unsigned char *sa; - int i,w,h,st,mark; - int x=obj->x; - int y=obj->y; - int c,font; - int charw=vo_font->width[OSD_PB_0]+vo_font->charspace; - int elems=obj->params.progbar.elems; + unsigned char *s; + unsigned char *sa; + int i,w,h,st,mark; + int x=obj->x; + int y=obj->y; + int c,font; + int charw=vo.font->width[OSD_PB_0]+vo.font->charspace; + int elems=obj->params.progbar.elems; - if (vo_osd_progbar_value<=0) - mark=0; + if (vo.osd_progbar_value<=0) + mark=0; else { - int ev=vo_osd_progbar_value*elems; + int ev=vo.osd_progbar_value*elems; mark=ev>>8; if (ev & 0xFF) mark++; if (mark>elems) mark=elems; } - - c=vo_osd_progbar_type; - if(vo_osd_progbar_type>0 && (font=vo_font->font[c])>=0) { - int xp=x-vo_font->width[c]-vo_font->spacewidth; + c=vo.osd_progbar_type; + if(vo.osd_progbar_type>0 && (font=vo.font->font[c])>=0) { + int xp=x-vo.font->width[c]-vo.font->spacewidth; draw_alpha((xp<0?0:xp),y, - vo_font->width[c], - vo_font->pic_a[font]->h, - vo_font->pic_b[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); + vo.font->width[c], + vo.font->pic_a[font]->h, + vo.font->pic_b[font]->bmp+vo.font->start[c], + vo.font->pic_a[font]->bmp+vo.font->start[c], + vo.font->pic_a[font]->w); } - + c=OSD_PB_START; - if ((font=vo_font->font[c])>=0) + if ((font=vo.font->font[c])>=0) draw_alpha(x,y, - vo_font->width[c], - vo_font->pic_a[font]->h, - vo_font->pic_b[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); - x+=vo_font->width[c]+vo_font->charspace; + vo.font->width[c], + vo.font->pic_a[font]->h, + vo.font->pic_b[font]->bmp+vo.font->start[c], + vo.font->pic_a[font]->bmp+vo.font->start[c], + vo.font->pic_a[font]->w); + x+=vo.font->width[c]+vo.font->charspace; c=OSD_PB_0; - if ((font=vo_font->font[c])>=0){ - w=vo_font->width[c]; - h=vo_font->pic_a[font]->h; - s=vo_font->pic_b[font]->bmp+vo_font->start[c]; - sa=vo_font->pic_a[font]->bmp+vo_font->start[c]; - st=vo_font->pic_a[font]->w; + if ((font=vo.font->font[c])>=0){ + w=vo.font->width[c]; + h=vo.font->pic_a[font]->h; + s=vo.font->pic_b[font]->bmp+vo.font->start[c]; + sa=vo.font->pic_a[font]->bmp+vo.font->start[c]; + st=vo.font->pic_a[font]->w; if ((i=mark)) do { draw_alpha(x,y,w,h,s,sa,st); x+=charw; @@ -252,12 +243,12 @@ } c=OSD_PB_1; - if ((font=vo_font->font[c])>=0){ - w=vo_font->width[c]; - h=vo_font->pic_a[font]->h; - s =vo_font->pic_b[font]->bmp+vo_font->start[c]; - sa=vo_font->pic_a[font]->bmp+vo_font->start[c]; - st=vo_font->pic_a[font]->w; + if ((font=vo.font->font[c])>=0){ + w=vo.font->width[c]; + h=vo.font->pic_a[font]->h; + s =vo.font->pic_b[font]->bmp+vo.font->start[c]; + sa=vo.font->pic_a[font]->bmp+vo.font->start[c]; + st=vo.font->pic_a[font]->w; if ((i=elems-mark)) do { draw_alpha(x,y,w,h,s,sa,st); x+=charw; @@ -265,22 +256,20 @@ } c=OSD_PB_END; - if ((font=vo_font->font[c])>=0) + if ((font=vo.font->font[c])>=0) draw_alpha(x,y, - vo_font->width[c], - vo_font->pic_a[font]->h, - vo_font->pic_b[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); -// x+=vo_font->width[c]+vo_font->charspace; + vo.font->width[c], + vo.font->pic_a[font]->h, + vo.font->pic_b[font]->bmp+vo.font->start[c], + vo.font->pic_a[font]->bmp+vo.font->start[c], + vo.font->pic_a[font]->w); +// x+=vo.font->width[c]+vo.font->charspace; // vo_osd_progbar_value=(vo_osd_progbar_value+1)&0xFF; } -const subtitle* vo_sub=NULL; - // vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) inline static void __FASTCALL__ vo_update_text_sub(mp_osd_obj_t* obj,int dxs,int dys){ @@ -292,39 +281,39 @@ int xsize,lastxsize=0; int xmin=dxs,xmax=0; int h,lasth; - + obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE; - - if(!vo_sub || !vo_font){ + + if(!vo.sub || !vo.font){ obj->flags&=~OSDFLAG_VISIBLE; return; } - + obj->bbox.y2=obj->y=dys; obj->params.subtitle.lines=0; // too long lines divide into a smaller ones i=k=lasth=0; - h=vo_font->height; - xsize=-vo_font->charspace; + h=vo.font->height; + xsize=-vo.font->charspace; lastStripPosition=-1; - l=vo_sub->lines; + l=vo.sub->lines; while (l) { l--; - t=vo_sub->text[i++]; + t=vo.sub->text[i++]; len=strlen(t)-1; - + for (j=0;j<=len;j++){ if ((c=t[j])>=0x80){ - if (sub_utf8){ + if (sub_data.utf8){ if ((c & 0xe0) == 0xc0) /* 2 bytes U+00080..U+0007FF*/ c = (c & 0x1f)<<6 | (t[++j] & 0x3f); else if((c & 0xf0) == 0xe0)/* 3 bytes U+00800..U+00FFFF*/ c = ((c & 0x0f)<<6 | (t[++j] & 0x3f))<<6 | (t[++j] & 0x3f); - } else if (sub_unicode) - c = (c<<8) + t[++j]; + } else if (sub_data.unicode) + c = (c<<8) + t[++j]; } if (k==MAX_UCS){ len=j; // end here @@ -335,27 +324,27 @@ lastk=k; lastStripPosition=j; lastxsize=xsize; - } else if ((font=vo_font->font[c])>=0){ - if (vo_font->pic_a[font]->h > h){ - h=vo_font->pic_a[font]->h; + } else if ((font=vo.font->font[c])>=0){ + if (vo.font->pic_a[font]->h > h){ + h=vo.font->pic_a[font]->h; } } obj->params.subtitle.utbl[k++]=c; - xsize+=vo_font->width[c]+vo_font->charspace; + xsize+=vo.font->width[c]+vo.font->charspace; if (dxs<xsize){ if (lastStripPosition>0){ j=lastStripPosition; xsize=lastxsize; k=lastk; } else { - xsize -=vo_font->width[c]+vo_font->charspace; // go back + xsize -=vo.font->width[c]+vo.font->charspace; // go back k--; // cut line here while (t[j] && t[j]!=' ') j++; // jump to the nearest space } } else if (j<len) continue; if (h>obj->y){ // out of the screen so end parsing - obj->y -= lasth - vo_font->height; // correct the y position + obj->y -= lasth - vo.font->height; // correct the y position l=0; break; } @@ -367,27 +356,27 @@ l=0; len=j; // end parsing } else if(l || j<len){ // not the last line or not the last char lastStripPosition=-1; - xsize=-vo_font->charspace; + xsize=-vo.font->charspace; lasth=h; - h=vo_font->height; + h=vo.font->height; } - obj->y -=h; // according to max of vo_font->pic_a[font]->h + obj->y -=h; // according to max of vo.font->pic_a[font]->h } } - if (obj->y >= (dys * sub_pos / 100)){ + if (obj->y >= (dys * sub_data.pos / 100)){ int old=obj->y; - obj->y = dys * sub_pos /100; + obj->y = dys * sub_data.pos /100; obj->bbox.y2-=old-obj->y; } - + // calculate bbox: obj->bbox.x1=xmin; obj->bbox.x2=xmax; obj->bbox.y1=obj->y; -// obj->bbox.y2=obj->y+obj->params.subtitle.lines*vo_font->height; +// obj->bbox.y2=obj->y+obj->params.subtitle.lines*vo.font->height; obj->flags|=OSDFLAG_BBOX; - + } inline static void __FASTCALL__ vo_draw_text_sub(mp_osd_obj_t* obj,draw_osd_f draw_alpha){ @@ -396,29 +385,22 @@ i=j=0; if ((l=obj->params.subtitle.lines)) for (;;) { - x=obj->params.subtitle.xtbl[i++]; + x=obj->params.subtitle.xtbl[i++]; while ((c=obj->params.subtitle.utbl[j++])){ - if ((font=vo_font->font[c])>=0) + if ((font=vo.font->font[c])>=0) draw_alpha(x,y, - vo_font->width[c], - vo_font->pic_a[font]->h+y<obj->dys ? vo_font->pic_a[font]->h : obj->dys-y, - vo_font->pic_b[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); - x+=vo_font->width[c]+vo_font->charspace; + vo.font->width[c], + vo.font->pic_a[font]->h+y<obj->dys ? vo.font->pic_a[font]->h : obj->dys-y, + vo.font->pic_b[font]->bmp+vo.font->start[c], + vo.font->pic_a[font]->bmp+vo.font->start[c], + vo.font->pic_a[font]->w); + x+=vo.font->width[c]+vo.font->charspace; } if (!--l) break; - y+=vo_font->height; + y+=vo.font->height; } } -void *vo_spudec=NULL; -void *vo_vobsub=NULL; - -static int draw_alpha_init_flag=0; - -static mp_osd_obj_t* vo_osd_list=NULL; - mp_osd_obj_t* __FASTCALL__ new_osd_obj(int type){ mp_osd_obj_t* osd=malloc(sizeof(mp_osd_obj_t)); memset(osd,0,sizeof(mp_osd_obj_t)); @@ -456,19 +438,19 @@ vo_update_nav(obj,dxs,dys); break; case OSDTYPE_SPU: - if(vo_spudec && spudec_visible(vo_spudec)) + if(vo.spudec && spudec_visible(vo.spudec)) obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED; else obj->flags&=~OSDFLAG_VISIBLE; break; case OSDTYPE_VOBSUB: - if(vo_vobsub) + if(vo.vobsub) obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED; else obj->flags&=~OSDFLAG_VISIBLE; break; case OSDTYPE_OSD: - if(vo_font && vo_osd_text && vo_osd_text[0]){ + if(vo.font && vo.osd_text && vo.osd_text[0]){ vo_update_text_osd(obj,dxs,dys); // update bbox obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED; } else @@ -502,7 +484,7 @@ } if(obj->flags&OSDFLAG_CHANGED){ chg|=1<<obj->type; - MSG_DBG2("OSD chg: %d V: %s pb:%d \n",obj->type,(obj->flags&OSDFLAG_VISIBLE)?"yes":"no",vo_osd_progbar_type); + MSG_DBG2("OSD chg: %d V: %s pb:%d \n",obj->type,(obj->flags&OSDFLAG_VISIBLE)?"yes":"no",vo.osd_progbar_type); } obj=obj->next; } @@ -524,8 +506,6 @@ new_osd_obj(OSDTYPE_DVDNAV); } -int vo_osd_changed_flag=0; - void __FASTCALL__ vo_remove_text(int dxs,int dys,clear_osd_f remove){ mp_osd_obj_t* obj=vo_osd_list; vo_update_osd(dxs,dys); @@ -536,7 +516,7 @@ int w=obj->old_bbox.x2-obj->old_bbox.x1; int h=obj->old_bbox.y2-obj->old_bbox.y1; if(w>0 && h>0){ - vo_osd_changed_flag=obj->flags&OSDFLAG_CHANGED; // temp hack + vo.osd_changed_flag=obj->flags&OSDFLAG_CHANGED; // temp hack remove(obj->old_bbox.x1,obj->old_bbox.y1,w,h); } // obj->flags&=~OSDFLAG_OLD_BBOX; @@ -553,16 +533,17 @@ void __FASTCALL__ vo_draw_text(int dxs,int dys,draw_osd_f draw_alpha){ mp_osd_obj_t* obj=vo_osd_list; vo_update_osd(dxs,dys); + while(obj){ if(obj->flags&OSDFLAG_VISIBLE){ obj->cleared_frames=0; - vo_osd_changed_flag=obj->flags&OSDFLAG_CHANGED; // temp hack + vo.osd_changed_flag=obj->flags&OSDFLAG_CHANGED; // temp hack switch(obj->type){ case OSDTYPE_SPU: - spudec_draw_scaled(vo_spudec, dxs, dys, draw_alpha); // FIXME + spudec_draw_scaled(vo.spudec, dxs, dys, draw_alpha); // FIXME break; case OSDTYPE_VOBSUB: - if(vo_spudec) spudec_draw_scaled(vo_spudec, dxs, dys, draw_alpha); // FIXME + if(vo.spudec) spudec_draw_scaled(vo.spudec, dxs, dys, draw_alpha); // FIXME break; case OSDTYPE_OSD: vo_draw_text_osd(obj,draw_alpha); @@ -585,8 +566,6 @@ } } -static int vo_osd_changed_status = 0; - int __FASTCALL__ vo_osd_changed(int new_value) { mp_osd_obj_t* obj=vo_osd_list; Modified: mplayerxp/libvo/sub.h =================================================================== --- mplayerxp/libvo/sub.h 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libvo/sub.h 2012-10-16 16:31:36 UTC (rev 164) @@ -60,21 +60,6 @@ #else -#include "../subreader.h" -#include "font_load.h" - -extern font_desc_t* vo_font; - -extern char* vo_osd_text; - -extern int vo_osd_progbar_type; -extern int vo_osd_progbar_value; // 0..255 - -extern const subtitle* vo_sub; - -extern void* vo_spudec; -extern void* vo_vobsub; - #define OSD_PLAY 0x01 #define OSD_PAUSE 0x02 #define OSD_STOP 0x03 @@ -93,17 +78,16 @@ #define OSD_PB_END 0x12 #define OSD_PB_1 0x13 -extern int sub_unicode; -extern int sub_utf8; +typedef struct sub_data_s { + char * cp; + int unicode; + int utf8; + int pos; + int bg_color; /* subtitles background color */ + int bg_alpha; +}sub_data_t; +extern sub_data_t sub_data; -#ifdef USE_ICONV -extern char *sub_cp; -#endif -extern int sub_pos; -extern int spu_alignment; -extern int spu_aamode; -extern float spu_gaussvar; - typedef void (* __FASTCALL__ draw_osd_f)(int x0,int y0, int w,int h,const unsigned char* src,const unsigned char *srca, int stride); typedef void (* __FASTCALL__ clear_osd_f)(int x0,int y0, int w,int h); @@ -115,7 +99,6 @@ int __FASTCALL__ vo_osd_changed(int new_value); int __FASTCALL__ get_osd_height(int c,int h); void __FASTCALL__ osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey); -extern int vo_osd_changed_flag; #endif #endif Modified: mplayerxp/libvo/video_out.c =================================================================== --- mplayerxp/libvo/video_out.c 2012-10-15 16:05:13 UTC (rev 163) +++ mplayerxp/libvo/video_out.c 2012-10-16 16:31:36 UTC (rev 164) @@ -43,11 +43,7 @@ #include "sub.h" #include "vo_msg.h" -//int vo_flags=0; - -vo_priv_t vo = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, - { 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0, -1, 0, 0, 0.0, -1.0, }; -char *vo_subdevice = NULL; +vo_priv_t vo; static vo_format_desc vod; // @@ -119,22 +115,30 @@ #define VOFLG_VM 0x00000002UL #define VOFLG_ZOOM 0x00000004UL #define VOFLG_FLIP 0x00000008UL -static unsigned dri_flags; -static int has_dri=0; -static unsigned dri_bpp; -static dri_surface_cap_t dri_cap; -static dri_surface_t dri_surf[MAX_DRI_BUFFERS]; -static unsigned active_frame=0,xp_frame=0; -static unsigned dri_nframes=1; -static int dri_has_thread=0; -static uint32_t srcFourcc,image_format,image_width,image_height; -static uint32_t org_width,org_height,dri_d_width,dri_d_height; -static int dri_dr,dri_planes_eq,dri_is_planar,dri_accel; -static unsigned sstride=0; -static unsigned dri_off[4]; /* offsets for y,u,v if DR on non fully fitted surface */ -static unsigned ps_off[4]; /* offsets for y,u,v in panscan mode */ -static unsigned long long int frame_counter=0; +typedef struct dri_priv_s { + unsigned flags; + int has_dri; + unsigned bpp; + dri_surface_cap_t cap; + dri_surface_t surf[MAX_DRI_BUFFERS]; + unsigned active_frame,xp_frame; + unsigned nframes; + int has_thread; + int dr,planes_eq,is_planar,accel; + unsigned sstride; + uint32_t d_width,d_height; + unsigned off[4]; /* offsets for y,u,v if DR on non fully fitted surface */ +}dri_priv_t; +static dri_priv_t dri; +typedef struct vo_priv_data_s { + uint32_t srcFourcc,image_format,image_width,image_height; + uint32_t org_width,org_height; + unsigned ps_off[4]; /* offsets for y,u,v in panscan mode */ + unsigned long long int frame_counter; +}vo_priv_data_t; +static vo_priv_data_t vo_data; + void vo_print_help( void ) { unsigned i; @@ -167,10 +171,25 @@ return video_out->get_info(); } +void __FASTCALL__ vo_preinit_structs( void ) +{ + memset(&dri,0,sizeof(dri_priv_t)); + dri.nframes=1; + memset(&vo,0,sizeof(vo_priv_t)); + vo.doublebuffering=1; + vo.movie_aspect=-1.0; + vo.flip=-1; + vo.da_buffs=64; + vo.window = None; + vo.WinID=-1; + vo.osd_progbar_type=-1; + vo.osd_progbar_value=100; // 0..256 +} + int __FASTCALL__ vo_init(const char *subdevice) { MSG_DBG3("dri_vo_dbg: vo_init(%s)\n",subdevice); - frame_counter=0; + vo_data.frame_counter=0; return video_out->preinit(subdevice); } @@ -242,17 +261,17 @@ static void __FASTCALL__ dri_config(uint32_t fourcc) { unsigned i; - dri_is_planar = vo_describe_fourcc(fourcc,&vod); - dri_bpp=vod.bpp; - if(!dri_bpp) has_dri=0; /*unknown fourcc*/ - if(has_dri) + dri.is_planar = vo_describe_fourcc(fourcc,&vod); + dri.bpp=vod.bpp; + if(!dri.bpp) dri.has_dri=0; /*unknown fourcc*/ + if(dri.has_dri) { - video_out->control(VOCTRL_GET_NUM_FRAMES,&dri_nframes); - dri_nframes=min(dri_nframes,MAX_DRI_BUFFERS); - for(i=0;i<dri_nframes;i++) + video_out->control(VOCTRL_GET_NUM_FRAMES,&dri.nframes); + dri.nframes=min(dri.nframes,MAX_DRI_BUFFERS); + for(i=0;i<dri.nframes;i++) { - dri_surf[i].idx=i; - video_out->control(DRI_GET_SURFACE,&dri_surf[i]); + dri.surf[i].idx=i; + video_out->control(DRI_GET_SURFACE,&dri.surf[i]); } } } @@ -262,104 +281,104 @@ int src_is_planar; unsigned src_stride,ps_x,ps_y; vo_format_desc vd; - ps_x = (org_width - width)/2; - ps_y = (org_height - height)/2; - src_is_planar = vo_describe_fourcc(srcFourcc,&vd); - src_stride=src_is_planar?org_width:org_width*((vd.bpp+7)/8); - ps_off[0] = ps_off[1] = ps_off[2] = ps_off[3] = 0; + ps_x = (vo_data.org_width - width)/2; + ps_y = (vo_data.org_height - height)/2; + src_is_planar = vo_describe_fourcc(vo_data.srcFourcc,&vd); + src_stride=src_is_planar?vo_data.org_width:vo_data.org_width*((vd.bpp+7)/8); + vo_data.ps_off[0] = vo_data.ps_off[1] = vo_data.ps_off[2] = vo_data.ps_off[3] = 0; if(!src_is_planar) - ps_off[0] = ps_y*src_stride+ps_x*((vd.bpp+7)/8); + vo_data.ps_off[0] = ps_y*src_stride+ps_x*((vd.bpp+7)/8); else { - ps_off[0] = ps_y*src_stride+ps_x; + vo_data.ps_off[0] = ps_y*src_stride+ps_x; if(vd.bpp==12) /*YV12 series*/ { - ps_off[1] = (ps_y/2)*(src_stride/2)+ps_x/2; - ps_off[2] = (ps_y/2)*(src_stride/2)+ps_x/2; + vo_data.ps_off[1] = (ps_y/2)*(src_stride/2)+ps_x/2; + vo_data.ps_off[2] = (ps_y/2)*(src_stride/2)+ps_x/2; } else if(vd.bpp==9) /*YVU9 series*/ { - ps_off[1] = (ps_y/4)*(src_stride/4)+ps_x/4; - ps_off[2] = (ps_y/4)*(src_stride/4)+ps_x/4; + vo_data.ps_off[1] = (ps_y/4)*(src_stride/4)+ps_x/4; + vo_data.ps_off[2] = (ps_y/4)*(src_stride/4)+ps_x/4; } } } static void __FASTCALL__ dri_tune(unsigned width,unsigned height) { - sstride=dri_is_planar?width:width*((dri_bpp+7)/8); - dri_off[0] = dri_off[1] = dri_off[2] = dri_off[3] = 0; - if(!dri_is_planar) + dri.sstride=dri.is_planar?width:width*((dri.bpp+7)/8); + dri.off[0] = dri.off[1] = dri.off[2] = dri.off[3] = 0; + if(!dri.is_planar) { - dri_planes_eq = sstride == dri_cap.strides[0]; - dri_off[0] = dri_cap.y*dri_cap.strides[0]+dri_cap.x*((dri_bpp+7)/8); + dri.planes_eq = dri.sstride == dri.cap.strides[0]; + dri.off[0] = dri.cap.y*dri.cap.strides[0]+dri.cap.x*((dri.bpp+7)/8); } else { unsigned long y_off,u_off,v_off; - y_off = (unsigned long)dri_surf[0].planes[0]; - u_off = (unsigned long)min(dri_surf[0].planes[1],dri_surf[0].planes[2]); - v_off = (unsigned long)max(dri_surf[0].planes[1],dri_surf[0].planes[2]); - dri_off[0] = dri_cap.y*dri_cap.strides[0]+dri_cap.x; - if(dri_bpp==12) /*YV12 series*/ + y_off = (unsigned long)dri.surf[0].planes[0]; + u_off = (unsigned long)min(dri.surf[0].planes[1],dri.surf[0].planes[2]); + v_off = (unsigned long)max(dri.surf[0].planes[1],dri.surf[0].planes[2]); + dri.off[0] = dri.cap.y*dri.cap.strides[0]+dri.cap.x; + if(dri.bpp==12) /*YV12 series*/ { - dri_planes_eq = width == dri_cap.strides[0] && + dri.planes_eq = width == dri.cap.strides[0] && width*height == u_off - y_off && width*height*5/4 == v_off - y_off && - dri_cap.strides[0]/2 == dri_cap.strides[1] && - dri_cap.strides[0]/2 == dri_cap.strides[2]; - dri_off[1] = (dri_cap.y/2)*dri_cap.strides[1]+dri_cap.x/2; - dri_off[2] = (dri_cap.y/2)*dri_cap.strides[2]+dri_cap.x/2; + dri.cap.strides[0]/2 == dri.cap.strides[1] && + dri.cap.strides[0]/2 == dri.cap.strides[2]; + dri.off[1] = (dri.cap.y/2)*dri.cap.strides[1]+dri.cap.x/2; + dri.off[2] = (dri.cap.y/2)*dri.cap.strides[2]+dri.cap.x/2; } else - if(dri_bpp==9) /*YVU9 series*/ + if(dri.bpp==9) /*YVU9 series*/ { - dri_planes_eq = width == dri_cap.strides[0] && + dri.planes_eq = width == dri.cap.strides[0] && width*height == u_off - y_off && width*height*17/16 == v_off - y_off && - dri_cap.strides[0]/4 == dri_cap.strides[1] && - dri_cap.strides[0]/4 == dri_cap.strides[2]; - dri_off[1] = (dri_cap.y/4)*dri_cap.strides[1]+dri_cap.x/4; - dri_off[2] = (dri_cap.y/4)*dri_cap.strides[2]+dri_cap.x/4; + dri.cap.strides[0]/4 == dri.cap.strides[1] && + dri.cap.strides[0]/4 == dri.cap.strides[2]; + dri.off[1] = (dri.cap.y/4)*dri.cap.strides[1]+dri.cap.x/4; + dri.off[2] = (dri.cap.y/4)*dri.cap.strides[2]+dri.cap.x/4; } else - if(dri_bpp==8) /*Y800 series*/ - dri_planes_eq = width == dri_cap.strides[0]; + if(dri.bpp==8) /*Y800 series*/ + dri.planes_eq = width == dri.cap.strides[0]; } - dri_accel=(dri_cap.caps&(DRI_CAP_DOWNSCALER|DRI_CAP_HORZSCALER| + dri.accel=(dri.cap.caps&(DRI_CAP_DOWNSCALER|DRI_CAP_HORZSCALER| DRI_CAP_UPSCALER|DRI_CAP_VERTSCALER))== (DRI_CAP_DOWNSCALER|DRI_CAP_HORZSCALER| DRI_CAP_UPSCALER|DRI_CAP_VERTSCALER); - dri_dr = srcFourcc == dri_cap.fourcc && !(dri_flags & VOFLG_FLIP) && - !ps_off[0] && !ps_off[1] && !ps_off[2] && !ps_off[3]; - if(dri_dr && dri_cap.w < width) - dri_dr = dri_cap.caps&(DRI_CAP_DOWNSCALER|DRI_CAP_HORZSCALER)?1:0; - if(dri_dr && dri_cap.w > width) - dri_dr = dri_cap.caps&(DRI_CAP_UPSCALER|DRI_CAP_HORZSCALER)?1:0; - if(dri_dr && dri_cap.h < height) - dri_dr = dri_cap.caps&(DRI_CAP_DOWNSCALER|DRI_CAP_VERTSCALER)?1:0; - if(dri_dr && dri_cap.h > height) - dri_dr = dri_cap.caps&(DRI_CAP_UPSCALER|DRI_CAP_VERTSCALER)?1:0; + dri.dr = vo_data.srcFourcc == dri.cap.fourcc && !(dri.flags & VOFLG_FLIP) && + !vo_data.ps_off[0] && !vo_data.ps_off[1] && !vo_data.ps_off[2] && !vo_data.ps_off[3]; + if(dri.dr && dri.cap.w < width) + dri.dr = dri.cap.caps&(DRI_CAP_DOWNSCALER|DRI_CAP_HORZSCALER)?1:0; + if(dri.dr && dri.cap.w > width) + dri.dr = dri.cap.caps&(DRI_CAP_UPSCALER|DRI_CAP_HORZSCALER)?1:0; + if(dri.dr && dri.cap.h < height) + dri.dr = dri.cap.caps&(DRI_CAP_DOWNSCALER|DRI_CAP_VERTSCALER)?1:0; + if(dri.dr && dri.cap.h > height) + dri.dr = dri.cap.caps&(DRI_CAP_UPSCALER|DRI_CAP_VERTSCALER)?1:0; } static void __FASTCALL__ dri_reconfig( uint32_t event ) { - has_dri = 1; - video_out->control(DRI_GET_SURFACE_CAPS,&dri_cap); - dri_config(dri_cap.fourcc); + dri.has_dri = 1; + video_out->control(DRI_GET_SURFACE_CAPS,&dri.cap); + dri_config(dri.cap.fourcc); /* ugly workaround of swapped BGR-fourccs. Should be removed in the future */ - if(!has_dri) + if(!dri.has_dri) { - has_dri=1; - dri_cap.fourcc = bswap_32(dri_cap.fourcc); - dri_config(dri_cap.fourcc); + dri.has_dri=1; + dri.cap.fourcc = bswap_32(dri.cap.fourcc); + dri_config(dri.cap.fourcc); } - dri_tune(image_width,image_height); + dri_tune(vo_data.image_width,vo_data.image_height); /* TODO: smart analizer of scaling possibilities of vo_driver */ if((event & VO_EVENT_RESIZE) == VO_EVENT_RESIZE) { - vf_reinit_vo(dri_cap.w,dri_cap.h,dri_cap.fourcc,1); + vf_reinit_vo(dri.cap.w,dri.cap.h,dri.cap.fourcc,1); if(enable_xp) { UNLOCK_VDECODING(); @@ -367,7 +386,7 @@ MSG_V("dri_vo: vo_event_resize: UNLOCK_VDECODING was called\n"); } } - vf_reinit_vo(dri_cap.w,dri_cap.h,dri_cap.fourcc,0); + vf_reinit_vo(dri.cap.w,dri.cap.h,dri.cap.fourcc,0); } static int vo_inited=0; @@ -385,41 +404,41 @@ } vo_inited++; dest_fourcc = format; - org_width = width; - org_height = height; + vo_data.org_width = width; + vo_data.org_height = height; w = width; d_w = d_width; h = height; d_h = d_height; - dri_d_width = d_w; - dri_d_height = d_h; + dri.d_width = d_w; + dri.d_height = d_h; MSG_V("video_out->config(%u,%u,%u,%u,%u,'%s',%s)\n" ,w,h,d_w,d_h,fullscreen,title,vo_format_name(dest_fourcc)); retval = video_out->config(w,h,d_w,d_h,fullscreen,title,dest_fourcc,vti); - srcFourcc=format; + vo_data.srcFourcc=format; if(retval == 0) { int dri_retv; - active_frame=xp_frame=0; - dri_retv = video_out->control(DRI_GET_SURFACE_CAPS,&dri_cap); - image_format = format; - image_width = w; - image_height = h; - ps_tune(image_width,org_height); + dri.active_frame=dri.xp_frame=0; + dri_retv = video_out->control(DRI_GET_SURFACE_CAPS,&dri.cap); + vo_data.image_format = format; + vo_data.image_width = w; + vo_data.image_height = h; + ps_tune(vo_data.image_width,vo_data.org_height); if(dri_retv == VO_TRUE) dri_reconfig(0); - MSG_V("dri_vo_caps: driver does %s support DRI\n",has_dri?"":"not"); + MSG_V("dri_vo_caps: driver does %s support DRI\n",dri.has_dri?"":"not"); MSG_V("dri_vo_caps: caps=%08X fourcc=%08X(%s) x,y,w,h(%u %u %u %u)\n" - "dri_vo_caps: width_height(%u %u) strides(%u %u %u %u) dri_bpp=%u\n" - ,dri_cap.caps - ,dri_cap.fourcc - ,vo_format_name(dri_cap.fourcc) - ,dri_cap.x,dri_cap.y,dri_cap.w,dri_cap.h - ,dri_cap.width,dri_cap.height - ,dri_cap.strides[0],dri_cap.strides[1] - ,dri_cap.strides[2],dri_cap.strides[3] - ,dri_bpp); + "dri_vo_caps: width_height(%u %u) strides(%u %u %u %u) dri.bpp=%u\n" + ,dri.cap.caps + ,dri.cap.fourcc + ,vo_format_name(dri.cap.fourcc) + ,dri.cap.x,dri.cap.y,dri.cap.w,dri.cap.h + ,dri.cap.width,dri.cap.height + ,dri.cap.strides[0],dri.cap.strides[1] + ,dri.cap.strides[2],dri.cap.strides[3] + ,dri.bpp); MSG_V("dri_vo_src: w,h(%u %u) d_w,d_h(%u %u)\n" "dri_vo_src: flags=%08X fourcc=%08X(%s)\n" ,width,height @@ -427,7 +446,7 @@ ,fullscreen ,format ,vo_format_name(format)); - dri_flags = fullscreen; + dri.flags = fullscreen; } return retval; } @@ -458,8 +477,8 @@ { char buf[256]; MSG_DBG3("dri_vo_dbg: vo_screenshot\n"); - sprintf(buf,"%llu",frame_counter); - return gr_screenshot(buf,dri_surf[active_frame].planes,dri_cap.strides,dri_cap.fourcc,dri_cap.width,dri_cap.height); + sprintf(buf,"%llu",vo_data.frame_counter); + return gr_screenshot(buf,dri.surf[dri.active_frame].planes,dri.cap.strides,dri.cap.fourcc,dri.cap.width,dri.cap.height); } uint32_t vo_pause( void ) @@ -479,54 +498,54 @@ int width_less_stride; MSG_DBG2("dri_vo_dbg: vo_get_surface type=%X flg=%X\n",mpi->type,mpi->flags); width_less_stride = 0; - mpi->xp_idx = xp_frame; + mpi->xp_idx = dri.xp_frame; if(mpi->flags & MP_IMGFLAG_PLANAR) { - width_less_stride = mpi->w <= dri_cap.strides[0] && - (mpi->w>>mpi->chroma_x_shift) <= dri_cap.strides[1] && - (mpi->w>>mpi->chroma_x_shift) <= dri_cap.strides[2]; + width_less_stride = mpi->w <= dri.cap.strides[0] && + (mpi->w>>mpi->chroma_x_shift) <= dri.cap.strides[1] && + (mpi->w>>mpi->chroma_x_shift) <= dri.cap.strides[2]; } - else width_less_stride = mpi->w*mpi->bpp <= dri_cap.strides[0]; - if(has_dri) + else width_less_stride = mpi->w*mpi->bpp <= dri.cap.strides[0]; + if(dri.has_dri) { /* static is singlebuffered decoding */ - if(mpi->type==MP_IMGTYPE_STATIC && dri_nframes>1) + if(mpi->type==MP_IMGTYPE_STATIC && dri.nframes>1) { - MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL mpi->type==MP_IMGTYPE_STATIC && dri_nframes>1\n"); + MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL mpi->type==MP_IMGTYPE_STATIC && dri.nframes>1\n"); return VO_FALSE; } /*I+P requires 2+ static buffers for R/W */ - if(mpi->type==MP_IMGTYPE_IP && (dri_nframes < 2 || (dri_cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED)) + if(mpi->type==MP_IMGTYPE_IP && (dri.nframes < 2 || (dri.cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED)) { - MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL (mpi->type==MP_IMGTYPE_IP && dri_nframes < 2) || (dri_cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED\n"); + MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL (mpi->type==MP_IMGTYPE_IP && dri.nframes < 2) || (dri.cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED\n"); return VO_FALSE; } /*I+P+B requires 3+ static buffers for R/W */ - if(mpi->type==MP_IMGTYPE_IPB && (dri_nframes != 3 || (dri_cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED)) + if(mpi->type==MP_IMGTYPE_IPB && (dri.nframes != 3 || (dri.cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED)) { - MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL (mpi->type==MP_IMGTYPE_IPB && dri_nframes != 3) || (dri_cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED\n"); + MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL (mpi->type==MP_IMGTYPE_IPB && dri.nframes != 3) || (dri.cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED\n"); return VO_FALSE; } /* video surface is bad thing for reading */ - if(((mpi->flags&MP_IMGFLAG_READABLE)||(mpi->type==MP_IMGTYPE_TEMP)) && (dri_cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED) + if(((mpi->flags&MP_IMGFLAG_READABLE)||(mpi->type==MP_IMGTYPE_TEMP)) && (dri.cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED) { - MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL mpi->flags&MP_IMGFLAG_READABLE && (dri_cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED\n"); + MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL mpi->flags&MP_IMGFLAG_READABLE && (dri.cap.caps&DRI_CAP_VIDEO_MMAPED)==DRI_CAP_VIDEO_MMAPED\n"); return VO_FALSE; } /* it seems that surfaces are equal */ - if((((mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE) && width_less_stride) || dri_planes_eq) && dri_dr) + if((((mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE) && width_less_stride) || dri.planes_eq) && dri.dr) { - mpi->planes[0]=dri_surf[xp_frame].planes[0]+dri_off[0]; - mpi->planes[1]=dri_surf[xp_frame].planes[1]+dri_off[1]; - mpi->planes[2]=dri_surf[xp_frame].planes[2]+dri_off[2]; - mpi->stride[0]=dri_cap.strides[0]; - mpi->stride[1]=dri_cap.strides[1]; - mpi->stride[2]=dri_cap.strides[2]; + mpi->planes[0]=dri.surf[dri.xp_frame].planes[0]+dri.off[0]; + mpi->planes[1]=dri.surf[dri.xp_frame].planes[1]+dri.off[1]; + mpi->planes[2]=dri.surf[dri.xp_frame].planes[2]+dri.off[2]; + mpi->stride[0]=dri.cap.strides[0]; + mpi->stride[1]=dri.cap.strides[1]; + mpi->stride[2]=dri.cap.strides[2]; mpi->flags|=MP_IMGFLAG_DIRECT; MSG_DBG2("dri_vo_dbg: vo_get_surface OK\n"); return VO_TRUE; } - MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL (mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE && width_less_stride) || dri_planes_eq) && dri_dr\n"); + MSG_DBG2("dri_vo_dbg: vo_get_surface FAIL (mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE && width_less_stride) || dri.planes_eq) && dri.dr\n"); return VO_FALSE; } else return VO_FALSE; @@ -535,10 +554,10 @@ static int __FASTCALL__ adjust_size(unsigned cw,unsigned ch,unsigned *nw,unsigned *nh) { MSG_DBG3("dri_vo_dbg: adjust_size was called %u %u %u %u\n",cw,ch,*nw,*nh); - if((dri_flags & VOFLG_ZOOM) && (cw != *nw || ch != *nh) && !(dri_flags & VOFLG_FS)) + if((dri.flags & VOFLG_ZOOM) && (cw != *nw || ch != *nh) && !(dri.flags & VOFLG_FS)) { float aspect,newv; - aspect = (float)dri_d_width / (float)dri_d_height; + aspect = (float)dri.d_width / (float)dri.d_height; if(abs(cw-*nw) > abs(ch-*nh)) { newv = ((float)(*nw))/aspect; @@ -570,12 +589,12 @@ but there is only one driver (vo_x11) which changes surfaces on 'fullscreen' key */ need_repaint=0; - if(has_dri && retval == VO_TRUE && (vrest.event_type & VO_EVENT_RESIZE) == VO_EVENT_RESIZE) + if(dri.has_dri && retval == VO_TRUE && (vrest.event_type & VO_EVENT_RESIZE) == VO_EVENT_RESIZE) { need_repaint=1; dri_reconfig(vrest.event_type); } - return (need_repaint && !dri_accel) || (vrest.event_type&VO_EVENT_FORCE_UPDATE); + return (need_repaint && !dri.accel) || (vrest.event_type&VO_EVENT_FORCE_UPDATE); } uint32_t vo_fullscreen( void ) @@ -584,22 +603,22 @@ MSG_DBG3("dri_vo_dbg: vo_fullscreen\n"); etype = 0; retval = video_out->control(VOCTRL_FULLSCREEN,&etype); - if(has_dri && retval == VO_TRUE && (etype & VO_EVENT_RESIZE) == VO_EVENT_RESIZE) + if(dri.has_dri && retval == VO_TRUE && (etype & VO_EVENT_RESIZE) == VO_EVENT_RESIZE) dri_reconfig(etype); - if(retval == VO_TRUE) dri_flags ^= VOFLG_FS; + if(retval == VO_TRUE) dri.flags ^= VOFLG_FS; return retval; } uint32_t __FASTCALL__ vo_get_num_frames( unsigned *nfr ) { - *nfr = has_dri ? dri_nframes : 1; + *nfr = dri.has_dri ? dri.nframes : 1; MSG_DBG3("dri_vo_dbg: %u=vo_get_num_frames\n",*nfr); return VO_TRUE; } uint32_t __FASTCALL__ vo_get_decoding_frame_num( volatile unsigned * fr ) { - *fr = has_dri ? xp_frame : 0; + *fr = dri.has_dri ? dri.xp_frame : 0; MSG_DBG3("dri_vo_dbg: %u=vo_get_decoding_frame_num\n",*fr); return VO_TRUE; } @@ -607,28 +626,28 @@ unsigned __FASTCALL__ vo_get_decoding_next_frame( unsigned idx ) { unsigned rval; - rval = has_dri ? (idx+1)%dri_nframes : 0; + rval = dri.has_dri ? (idx+1)%dri.nframes : 0; return rval; } unsigned __FASTCALL__ vo_get_decoding_prev_frame( unsigned idx ) { unsigned rval; - rval = has_dri ? (idx-1+dri_nframes)%dri_nframes : 0; + rval = dri.has_dri ? (idx-1+dri.nframes)%dri.nframes : 0; return rval; } uint32_t __FASTCALL__ vo_set_decoding_frame_num( volatile unsigned * fr ) { MSG_DBG2("dri_vo_dbg: vo_set_decoding_frame_num(%u) for decoding to\n",*fr); - xp_frame = *fr; - dri_has_thread = 1; + dri.xp_frame = *fr; + dri.has_thread = 1; return VO_TRUE; } uint32_t __FASTCALL__ vo_get_active_frame( volatile unsigned * fr) { - *fr = has_dri ? active_frame : 0; + *fr = dri.has_dri ? dri.active_frame : 0; MSG_DBG3("dri_vo_dbg: %u=vo_get_active_frame\n",*fr); return VO_TRUE; } @@ -637,7 +656,7 @@ { unsigned i,_w[4],_h[4],x,y; MSG_DBG3("dri_vo_dbg: vo_draw_slice xywh=%i %i %i %i\n",mpi->x,mpi->y,mpi->w,mpi->h); - if(has_dri) + if(dri.has_dri) { uint8_t *dst[4]; const uint8_t *ps_src[4]; @@ -646,15 +665,15 @@ unsigned idx = mpi->xp_idx; for(i=0;i<4;i++) { - dst[i]=dri_surf[idx].planes[i]+dri_off[i]; - dstStride[i]=dri_cap.strides[i]; + dst[i]=dri.surf[idx].planes[i]+dri.off[i]; + dstStride[i]=dri.cap.strides[i]; dst[i]+=((mpi->y*dstStride[i])*vod.y_mul[i])/vod.y_div[i]; dst[i]+=(mpi->x*vod.x_mul[i])/vod.x_div[i]; _w[i]=(mpi->w*vod.x_mul[i])/vod.x_div[i]; _h[i]=(mpi->h*vod.y_mul[i])/vod.y_div[i]; y = i?(mpi->y>>mpi->chroma_y_shift):mpi->y; x = i?(mpi->x>>mpi->chroma_x_shift):mpi->x; - ps_src[i] = mpi->planes[i]+(y*mpi->stride[i])+x+ps_off[i]; + ps_src[i] = mpi->planes[i]+(y*mpi->stride[i])+x+vo_data.ps_off[i]; } for(i=0;i<4;i++) { if(mpi->stride[i]) { @@ -671,21 +690,21 @@ void vo_change_frame(void) { - MSG_DBG2("dri_vo_dbg: vo_change_frame [active_frame=%u]\n",active_frame); - if(vo.doublebuffering || (dri_cap.caps & DRI_CAP_VIDEO_MMAPED)!=DRI_CAP_VIDEO_MMAPED) + MSG_DBG2("dri_vo_dbg: vo_change_frame [dri.active_frame=%u]\n",dri.active_frame); + if(vo.doublebuffering || (dri.cap.caps & DRI_CAP_VIDEO_MMAPED)!=DRI_CAP_VIDEO_MMAPED) { - video_out->change_frame(active_frame); - active_frame = (active_frame+1)%dri_nframes; - if(!dri_has_thread) xp_frame = (xp_frame+1)%dri_nframes; + video_out->change_frame(dri.active_frame); + dri.active_frame = (dri.active_frame+1)%dri.nframes; + if(!dri.has_thread) dri.xp_frame = (dri.xp_frame+1)%dri.nframes; } } void vo_flush_pages(void) { - MSG_DBG3("dri_vo_dbg: vo_flush_pages [active_frame=%u]\n",active_frame); - frame_counter++; - if((dri_cap.caps & DRI_CAP_VIDEO_MMAPED)!=DRI_CAP_VIDEO_MMAPED) - video_out->control(VOCTRL_FLUSH_PAGES,&xp_frame); + MSG_DBG3("dri_vo_dbg: vo_flush_pages [dri.active_frame=%u]\n",dri.active_frame); + vo_data.frame_counter++; + if((dri.cap.caps & DRI_CAP_VIDEO_MMAPED)!=DRI_CAP_VIDEO_MMAPED) + video_out->control(VOCTRL_FLUSH_PAGES,&dri.xp_frame); } /* DRAW OSD */ @@ -695,7 +714,7 @@ unsigned i; for(i=0;i<h;i++) { - if(y0+i<dri_cap.y||y0+i>=dri_cap.y+dri_cap.h) memset(dest,filler,stride); + if(y0+i<dri.cap.y||y0+i>=dri.cap.y+dri.cap.h) memset(dest,filler,stride); dest += dstride; } } @@ -703,8 +722,8 @@ static void __FASTCALL__ clear_rect2(unsigned y0,unsigned h,uint8_t *dest,unsigned stride,unsigned dstride,uint8_t filler) { unsigned i; - unsigned y1 = dri_cap.y/2; - unsigned y2 = (dri_cap.y+dri_cap.h)/2; + unsigned y1 = dri.cap.y/2; + unsigned y2 = (dri.cap.y+dri.cap.h)/2; for(i=0;i<h;i++) { if(y0+i<y1||y0+i>=y2) memset(dest,filler,stride); @@ -715,8 +734,8 @@ static void __FASTCALL__ clear_rect4(unsigned y0,unsigned h,uint8_t *dest,unsigned stride,unsigned dstride,uint8_t filler) { unsigned i; - unsigned y1 = dri_cap.y/4; - unsigned y2 = (dri_cap.y+dri_cap.h)/4; + unsigned y1 = dri.cap.y/4; + unsigned y2 = (dri.cap.y+dri.cap.h)/4; for(i=0;i<h;i++) { if(y0+i<y1||y0+i>=y2) memset(dest,filler,stride); @@ -729,7 +748,7 @@ unsigned i; for(i=0;i<h;i++) { - if(y0+i<dri_cap.y||y0+i>=dri_cap.y+dri_cap.h) memset(dest,0,stride); + if(y0+i<dri.cap.y||y0+i>=dri.cap.y+dri.cap.h) memset(dest,0,stride); dest += dstride; } } @@ -739,7 +758,7 @@ unsigned i; for(i=0;i<h;i++) { - if(y0+i<dri_cap.y||y0+i>=dri_cap.y+dri_cap.h) + if(y0+i<dri.cap.y||y0+i>=dri.cap.y+dri.cap.h) { uint32_t *dst32; unsigned j,size32; @@ -756,8 +775,8 @@ static void __FASTCALL__ dri_remove_osd(int x0,int y0, int w,int h) { - if(x0+w<=dri_cap.width&&y0+h<=dri_cap.height) - switch(dri_cap.fourcc) + if(x0+w<=dri.cap.width&&y0+h<=dri.cap.height) + switch(dri.cap.fourcc) { case IMGFMT_RGB15: case IMGFMT_BGR15: @@ -767,40 +786,40 @@ case IMGFMT_BGR24: case IMGFMT_RGB32: case IMGFMT_BGR32: - clear_rect_rgb( y0,h,dri_surf[active_frame].planes[0]+y0*dri_c... [truncated message content] |