123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509 |
- function setCookie( name, value, expiredays )
- {
- var todayDate = new Date();
- todayDate.setDate( todayDate.getDate() + expiredays );
- document.cookie = name + '=' + escape( value ) + '; domain=' + location.hostname + ';path=/; expires=' + todayDate.toGMTString() + ';';
- }
- function getCookie( name )
- {
- var nameOfCookie = name + '=';
- var x = 0;
- while ( x <= document.cookie.length )
- {
- var y = (x+nameOfCookie.length);
- if ( document.cookie.substring( x, y ) == nameOfCookie )
- {
- if ( (endOfCookie=document.cookie.indexOf( ';', y )) == -1 )
- endOfCookie = document.cookie.length;
- return unescape( document.cookie.substring( y, endOfCookie ) );
- }
- x = document.cookie.indexOf( ' ', x ) + 1;
- if ( x == 0 )
- break;
- }
- return '';
- }
- function fnCut(str,lengths)
- {
- var len = 0;
- var newStr = '';
- for (var i=0;i<str.length; i++){
- var n = str.charCodeAt(i);
- var nv = str.charAt(i);
- if(n < 128){
- len++;
- }
- else if(n < 2048){
- len +=2;
- }
- else if(n < 65536){
- len +=3;
- }
- else{
- len +=4;
- }
- if (len>lengths) break;
- else newStr = newStr + nv;
- }
- return newStr;
- }
- function getBytes(sString) {
- var c = 0;
- for(var i= 0; i <sString.length;i++){
- c +=parseInt(getByte(sString.charAt(i)));
- }
- return c;
- }
- function getByte(sChar) {
- var c = 0;
- var s = parseInt(sChar.charCodeAt(0));
- if(s < 128){
- c++;
- }
- else if(s < 2048){
- c +=2;
- }
- else if(s < 65536){
- c +=3;
- }
- else{
- c +=4;
- }
- return c;
- }
- function checkInputBox(type, e)
- {
- var unicode = e.charCode ? e.charCode : e.keyCode;
- //document.getElementById("console").innerHTML += unicode + ", ";
- if(unicode == 9)
- return true;
- if(unicode != 8 && unicode != 39 && unicode != 46)
- {
- if(type == "num")
- {
- if(unicode >= 48 && unicode <= 57)
- {
- return true;
- }
- if(unicode >= 96 && unicode <= 105)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- else if(type == "ip")
- {
- if(unicode < 48 ||
- (unicode > 57 && unicode < 96) ||
- (unicode > 105 && unicode < 110) ||
- (unicode > 110 && unicode < 190) ||
- unicode > 190)
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- else if(type == "alnum")
- {
- if(unicode < 48 ||
- (unicode > 57 && unicode < 65) ||
- (unicode > 90 && unicode < 96) ||
- (unicode > 107 && unicode < 109) ||
- (unicode > 111 && unicode < 186) ||
- (unicode > 192 && unicode < 219) ||
- unicode > 222)
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- else if(type == "webchar")
- {
- //if(unicode != 16){
- // alert("aa"+unicode+"bb");
- //}
- if(unicode == 222 || unicode == 220)
- {
- return true;
- }
- else
- {
- return true;
- }
- }
- else
- {
- return false;
- }
- }
- else
- {
- return true;
- }
- }
- function isValidMulticastIP(value)
- {
- var iplength = (value.split(/\./)).length;
- if(iplength == 4)
- {
- if(value.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) != -1)
- { // ip 4
- var myArray = value.split(/\./);
- if(Number(myArray[1]) > 255 ||
- Number(myArray[2]) > 255 ||
- Number(myArray[3]) > 255)
- {
- return false;
- }
- if(Number(myArray[0]) < 224 || Number(myArray[0]) > 239)
- {
- return false;
- }
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
- }
- function IPMaskCheck(ip, gw, sm)
- {
- if((ip.split(/\./)).length == 4 && (gw.split(/\./)).length == 4 && (sm.split(/\./)).length == 4){
- var IPArray = ip.split(/\./);
- var GWArray = gw.split(/\./);
- var SMArray = sm.split(/\./);
- for(var i= 0; i < 4; i++){
- if((Number(IPArray[i]) & Number(SMArray[i])) != (Number(GWArray[i]) & Number(SMArray[i]))){
- return false;
- }
- }
- return true;
- }
-
- return false;
- }
- function CheckLocalIPv4Setting(ip, gw, sm)
- {
- if( ((ip.split(/\./)).length != 4) ||
- ((gw.split(/\./)).length != 4) ||
- ((sm.split(/\./)).length != 4) ) {
- return false;
- }
- if( (ip.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) == -1) ||
- (gw.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) == -1) ||
- (sm.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) == -1) ) {
- return false;
- }
- var ipArray = ip.split(/\./);
- var gwArray = gw.split(/\./);
- var smArray = sm.split(/\./);
- // check ip
- if(Number(ipArray[0] >= 224)) {
- return false;
- }
- var ip2 = ((Number(ipArray[0]) << 24) + (Number(ipArray[1]) << 16) + (Number(ipArray[2]) << 8) + (Number(ipArray[3]))) >>> 0;
- var gw2 = ((Number(gwArray[0]) << 24) + (Number(gwArray[1]) << 16) + (Number(gwArray[2]) << 8) + (Number(gwArray[3]))) >>> 0;
- var sm2 = ((Number(smArray[0]) << 24) + (Number(smArray[1]) << 16) + (Number(smArray[2]) << 8) + (Number(smArray[3]))) >>> 0;
- // check subnetmask
- if(sm2 == 0) {
- return false;
- } else {
- for(var i = 31; i >= 0; i--) {
- if(((sm2 >>> i) & 0x1) == 0) {
- for(var j = i; j >= 0; j--) {
- if(((sm2 >>> j) & 0x1) != 0) {
- return false;
- }
- }
- }
- }
- }
- // check gateway
- var networkip, broadcastip;
- networkip = (ip2 & sm2) >>> 0;
- broadcastip = (networkip | (~sm2)) >>> 0;
- if((gw2 == ip2) || (gw2 == networkip) || (gw2 == broadcastip)) {
- return false;
- }
- return true;
- }
- function isValidIP(value)
- {
- var iplength = (value.split(/\./)).length;
- if(iplength == 4)
- {
- if(value.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) != -1)
- { // ip 4
- var myArray = value.split(/\./);
- if(Number(myArray[0]) > 255 ||
- Number(myArray[1]) > 255 ||
- Number(myArray[2]) > 255 ||
- Number(myArray[3]) > 255)
- {
- return false;
- }
- if(Number(myArray[0]) == 0 &&
- Number(myArray[1]) == 0 &&
- Number(myArray[2]) == 0 &&
- Number(myArray[3]) == 0)
- {
- return true;
- }
- return true;
- }
- else
- {
- return false;
- }
- }
- else if(iplength == 6)
- {
- if(value.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}.\d{1,3}.\d{1,3}$/) != -1)
- { // ip 6
- var myArray2 = value.split(/\./);
- //alert(myArray2);
- if(Number(myArray2[0]) > 255 ||
- Number(myArray2[1]) > 255 ||
- Number(myArray2[2]) > 255 ||
- Number(myArray2[3]) > 255 ||
- Number(myArray2[4]) > 255 ||
- Number(myArray2[5]) > 255)
- {
- return false;
- }
- if(Number(myArray2[0]) == 0 &&
- Number(myArray2[1]) == 0 &&
- Number(myArray2[2]) == 0 &&
- Number(myArray2[3]) == 0 &&
- Number(myArray2[4]) == 0 &&
- Number(myArray2[5]) == 0)
- {
- return false;
- }
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
- }
- alpha_numeric = new String("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
- function check_alphanumber(str)
- {
- if(str.length == 0){
- return false;
- }
- for(j = 0 ; j < str.length; j++)
- {
- rtn = is_alpha_numeric(str.charAt(j));
- if(rtn == false)
- {
- return rtn;
- }
- }
- return true;
- }
- function is_alpha_numeric(cha1)
- {
- for(i=0;i<alpha_numeric.length;i++)
- {
- if(alpha_numeric.charAt(i) == cha1)
- return true;
- }
- return false;
- }
- function IsAlpha(c)
- {
- if (c >= '0' && c <= '9')
- return 1;
- if (c >= 'a' && c <= 'z')
- return 1;
- if (c >= 'A' && c <= 'Z')
- return 1;
- else return 0;
- }
- network_address = new String("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-")
- function check_network_address(str)
- {
- if(str.length == 0){
- return false;
- }
- if(str.length == 1){
- return false;
- }
- if(is_alpha_numeric(str.charAt(0)) == false){
- return false;
- }
- for(j = 1 ; j < str.length; j++)
- {
- rtn = is_network_address(str.charAt(j));
- if(rtn == false)
- {
- return rtn;
- }
- }
- return true;
- }
- function is_network_address(cha1)
- {
- for(i=0;i<network_address.length;i++)
- {
- if(network_address.charAt(i) == cha1)
- return true;
- }
- return false;
- }
- password_string = new String("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+|-\\`~[]{},./:;\"\'")
- function check_password(str)
- {
- if(str.length == 0){
- return false;
- }
- if(str.length == 1){
- return false;
- }
- for(j = 0 ; j < str.length; j++)
- {
- rtn = is_password_string(str.charAt(j));
- if(rtn == false)
- {
- alert("Password string cannot contain \'" + str.charAt(j) + "\'");
- return rtn;
- }
- }
- return true;
- }
- function is_password_string(cha1)
- {
- for(i=0;i<password_string.length;i++)
- {
- if(password_string.charAt(i) == cha1)
- return true;
- }
- return false;
- }
- password_special_char = new String("!@#$%^&*()_+|-\\`~[]{},./:;\"\'")
- function check_password_special_char(str)
- {
- if(str.length == 0){
- return false;
- }
- if(str.length == 1){
- return false;
- }
- for(j = 0 ; j < str.length; j++)
- {
- rtn = is_password_special_char_string(str.charAt(j));
- if(rtn == true)
- {
- return rtn;
- }
- }
- return false;
- }
- function is_password_special_char_string(cha1)
- {
- for(i=0;i<password_special_char.length;i++)
- {
- if(password_special_char.charAt(i) == cha1)
- return true;
- }
- return false;
- }
- function check_password_len(str, min_len)
- {
- if(str.length < min_len) {
- return false;
- }
- return true;
- }
- function check_password_char_type_num(str, min_num)
- {
- var num = -1, upper = -1, lower = -1, special = -1;
- var type_count = 0;
- if((num = str.search(/[0-9]/g)) != -1) {
- type_count++;
- }
- if((upper = str.search(/[A-Z]/g)) != -1) {
- type_count++;
- }
- if((lower = str.search(/[a-z]/g)) != -1) {
- type_count++;
- }
- for(j = 0; j < str.length; j++) {
- if(is_password_special_char_string(str.charAt(j))) {
- special = j;
- type_count++;
- break;
- }
- }
- //console.log(num + ", " + upper + ", " + lower + ", " + special + ", " + min_num);
- if(type_count < min_num) {
- return false;
- }
- return true;
- }
- function Tencryption(s) {
- var key = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
- var i = 0, len = s.length,
- c1, c2, c3,
- e1, e2, e3, e4,
- result = [];
-
- while (i < len) {
- c1 = s.charCodeAt(i++);
- c2 = s.charCodeAt(i++);
- c3 = s.charCodeAt(i++);
-
- e1 = c1 >> 2;
- e2 = ((c1 & 3) << 4) | (c2 >> 4);
- e3 = ((c2 & 15) << 2) | (c3 >> 6);
- e4 = c3 & 63;
-
- if (isNaN(c2)) {
- e3 = e4 = 64;
- } else if (isNaN(c3)) {
- e4 = 64;
- }
-
- result.push(e1, e2, e3, e4);
- }
-
- return jQuery.map(result, function (e) { return key.charAt(e); }).join('');
- }
- function TEncodeUrl(str){
- // return str.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=+$/, '');
- var pass = str.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=+$/, '');
- var ln = pass.length;
- return str.substr(ln-1,1) + str.substr(ln/2,1) + pass;
- }
- function macro_16(length)
- {
- return ((length+0xF) & ~(0xF))/16;
- }
- function getperformance_macroblock(res, fps)
- {
- var m_width = 0;
- var m_height = 0;
- var weight = 0;
- switch(res) {
- case 0: //720x480
- m_width = macro_16(720);
- m_height = macro_16(480);
- break;
- case 1: //720x240
- m_width = macro_16(720);
- m_height = macro_16(240);
- break;
- case 2: //352x480
- m_width = macro_16(352);
- m_height = macro_16(480);
- break;
- case 3: //352x240
- m_width = macro_16(352);
- m_height = macro_16(240);
- break;
- case 4: //720x576
- m_width = macro_16(720);
- m_height = macro_16(576);
- break;
- case 5: //720x288
- m_width = macro_16(720);
- m_height = macro_16(288);
- break;
- case 6: //352x576
- m_width = macro_16(352);
- m_height = macro_16(576);
- break;
- case 7: //352x288
- m_width = macro_16(352);
- m_height = macro_16(288);
- break;
- case 8: //640x480
- m_width = macro_16(640);
- m_height = macro_16(480);
- break;
- case 9: //800x600
- m_width = macro_16(800);
- m_height = macro_16(600);
- break;
- case 10: //1024x768
- m_width = macro_16(1024);
- m_height = macro_16(768);
- break;
- case 11: //1280x960
- m_width = macro_16(1280);
- m_height = macro_16(960);
- break;
- case 12: //1280x1024
- m_width = macro_16(1280);
- m_height = macro_16(1024);
- break;
- case 13: //1440x900
- m_width = macro_16(1440);
- m_height = macro_16(900);
- break;
- case 14: //1600x900
- m_width = macro_16(1600);
- m_height = macro_16(900);
- break;
- case 15: //1680x1050
- m_width = macro_16(1680);
- m_height = macro_16(1050);
- break;
- case 16: //1280x720
- m_width = macro_16(1280);
- m_height = macro_16(720);
- break;
- case 17: //1920x1080
- m_width = macro_16(1920);
- m_height = macro_16(1080);
- break;
- case 18: //176x128
- m_width = macro_16(176);
- m_height = macro_16(128);
- break;
- case 19: //176x144
- m_width = macro_16(176);
- m_height = macro_16(144);
- break;
- case 22: //320x240
- m_width = macro_16(320);
- m_height = macro_16(240);
- break;
- case 23: //2048x1536
- m_width = macro_16(2048);
- m_height = macro_16(1536);
- break;
- case 24: //2560x1600
- m_width = macro_16(2560);
- m_height = macro_16(1600);
- break;
- case 25: //2592x1936
- m_width = macro_16(2592);
- m_height = macro_16(1936);
- break;
- case 26: //1920x1056
- m_width = macro_16(1920);
- m_height = macro_16(1056);
- break;
- case 27: //640x360
- m_width = macro_16(640);
- m_height = macro_16(360);
- break;
- case 28: //1440x540
- m_width = macro_16(1440);
- m_height = macro_16(540);
- break;
- case 29: //1792x1344
- m_width = macro_16(1792);
- m_height = macro_16(1344);
- break;
- case 30: //1440x1080
- m_width = macro_16(1440);
- m_height = macro_16(1080);
- break;
- case 47: //1600x1200
- m_width = macro_16(1600);
- m_height = macro_16(1200);
- break;
- case 48: //1920x1200
- m_width = macro_16(1920);
- m_height = macro_16(1200);
- break;
- case 49: //704x480
- m_width = macro_16(704);
- m_height = macro_16(480);
- break;
- case 50: //3840x2160
- m_width = macro_16(3840);
- m_height = macro_16(2160);
- break;
- case 51: //4096x2160
- m_width = macro_16(4096);
- m_height = macro_16(2160);
- break;
- case 52: //4000x3000
- m_width = macro_16(4000);
- m_height = macro_16(3000);
- break;
- case 53: //1280x768
- m_width = macro_16(1280);
- m_height = macro_16(768);
- break;
- case 54: //1152x864
- m_width = macro_16(1152);
- m_height = macro_16(864);
- break;
- case 55: //1360x768
- m_width = macro_16(1360);
- m_height = macro_16(768);
- break;
- case 56: //1400x1050
- m_width = macro_16(1400);
- m_height = macro_16(1050);
- break;
- case 57: //2048x2048
- m_width = macro_16(2048);
- m_height = macro_16(2048);
- break;
- case 58: //2592x1944
- m_width = macro_16(2592);
- m_height = macro_16(1944);
- break;
- case 59: //960x540
- m_width = macro_16(960);
- m_height = macro_16(540);
- break;
- case 60: //768x432
- m_width = macro_16(768);
- m_height = macro_16(432);
- break;
- case 67: //1080x1920
- m_width = macro_16(1080);
- m_height = macro_16(1920);
- break;
- case 68: //720x1280
- m_width = macro_16(720);
- m_height = macro_16(1280);
- break;
- case 69: //360x640
- m_width = macro_16(360);
- m_height = macro_16(640);
- break;
- case 70: //1944X2592
- m_width = macro_16(1944);
- m_height = macro_16(2592);
- break;
- case 71: //1600X2560
- m_width = macro_16(1600);
- m_height = macro_16(2560);
- break;
- case 72: //1536X2048
- m_width = macro_16(1536);
- m_height = macro_16(2048);
- break;
- case 73: //1366X768
- m_width = macro_16(1366);
- m_height = macro_16(768);
- break;
- case 74: //2560X1440
- m_width = macro_16(2560);
- m_height = macro_16(1440);
- break;
- case 75: //800X448
- m_width = macro_16(800);
- m_height = macro_16(448);
- break;
- case 77: //3200x1800
- m_width = macro_16(3200);
- m_height = macro_16(1800);
- break;
- case 78: //3072x1728
- m_width = macro_16(3072);
- m_height = macro_16(1728);
- break;
- case 81: //2160x3840
- m_width = macro_16(2160);
- m_height = macro_16(3840);
- break;
- case 82: //1296x2304
- m_width = macro_16(1296);
- m_height = macro_16(2304);
- break;
- case 83: //1808x3200
- m_width = macro_16(1808);
- m_height = macro_16(3200);
- break;
- case 84: //1728x3072
- m_width = macro_16(1728);
- m_height = macro_16(3072);
- break;
- default:
- m_width = macro_16(720);
- m_height = macro_16(480);
- break;
- }
- switch(fps){
- case 0 :
- weight = 30;
- break;
- case 1 :
- weight = 25;
- break;
- case 2 :
- weight = 20;
- break;
- case 3 :
- weight = 15;
- break;
- case 4 :
- weight = 10;
- break;
- case 5 :
- weight = 8;
- break;
- case 6 :
- weight = 6;
- break;
- case 7 :
- weight = 5;
- break;
- case 8 :
- weight = 4;
- break;
- case 9 :
- weight = 3;
- break;
- case 10 :
- weight = 2;
- break;
- case 11 :
- weight = 1;
- break;
- case 150 :
- weight = 50;
- break;
- case 160 :
- weight = 60;
- break;
- case 175:
- weight = 75;
- break;
- case 185:
- weight = 85;
- break;
- }
- return (m_width*m_height*weight);
- }
- function getperformance_res(res) {
- var weight1 = 0;
- switch(res){
- case 2 :
- case 3 :
- case 6 :
- case 7 :
- case 22 :
- weight1 = 2;
- break;
- case 0 :
- case 1 :
- case 4 :
- case 5 :
- case 8 :
- case 18 :
- case 19 :
- case 27 :
- case 49 :
- case 60 :
- case 69 :
- case 80 :
- weight1 = 4;
- break;
- case 9 :
- case 10 :
- case 16 :
- case 28 :
- case 54 :
- case 59 :
- case 68 :
- case 75 :
- weight1 = 10;
- break;
- case 53 :
- weight1 = 12;
- break;
- case 12 :
- weight1 = 14;
- break;
- case 30 :
- weight1 = 15;
- break;
- case 11 :
- case 13 :
- case 14 :
- case 15 :
- case 17 :
- case 26 :
- case 30 :
- case 47 :
- case 48 :
- case 55 :
- case 56 :
- case 67 :
- case 73 :
- case 79 :
- weight1 = 20;
- break;
- case 29 :
- weight1 = 25;
- break;
- case 23 :
- case 76 :
- case 82 : //1296x2304
- weight1 = 30;
- break;
- case 74 : //2560X1440
- weight1 = 35;
- break;
- case 24:
- case 57:
- weight1 = 40;
- break;
- case 25:
- case 58: // 2592x1944
- weight1 = 50;
- break;
- case 77: //3200x1800
- case 83: //1808x3200
- weight1 = 57;
- break;
- case 78: //3072x1728
- case 84: //1728x3072
- weight1 = 53;
- break;
- case 50: //3840x2160
- case 81: //2160x3840
- weight1 = 80;
- break;
- case 51:
- weight1 = 85;
- break;
- case 52:
- weight1 = 120;
- break;
- default:
- weight1 = 20;
- break;
- }
-
- return weight1;
- }
- function getperformance_fps(fps) {
- var weight2 = 0;
- switch(fps){
- case 0 :
- weight2 = 30;
- break;
- case 1 :
- weight2 = 25;
- break;
- case 2 :
- weight2 = 20;
- break;
- case 3 :
- weight2 = 15;
- break;
- case 4 :
- weight2 = 10;
- break;
- case 5 :
- weight2 = 8;
- break;
- case 6 :
- weight2 = 6;
- break;
- case 7 :
- weight2 = 5;
- break;
- case 8 :
- weight2 = 4;
- break;
- case 9 :
- weight2 = 3;
- break;
- case 10 :
- weight2 = 2;
- break;
- case 11 :
- weight2 = 1;
- break;
- case 150 :
- weight2 = 50;
- break;
- case 160 :
- weight2 = 60;
- break;
- case 175:
- weight2 = 75;
- break;
- case 185:
- weight2 = 85;
- break;
- }
-
- return weight2;
- }
- function getperformance(res, fps, _force_4k_calculation)
- {
- var weight1 = 0;
- var weight2 = 0;
- switch(res){
- case 0 :
- case 1 :
- case 2 :
- case 3 :
- case 4 :
- case 5 :
- case 6 :
- case 7 :
- case 8 :
- case 18 :
- case 19 :
- case 22 :
- case 27 :
- case 49 :
- case 60 :
- case 69 :
- case 80 :
- weight1 = 4;
- break;
- case 9 :
- case 10 :
- case 16 :
- case 28 :
- case 54 :
- case 59 :
- case 68 :
- case 75 :
- weight1 = 10;
- break;
- case 53 :
- weight1 = 12;
- break;
- case 30 :
- weight1 = 15;
- break;
- case 11 :
- case 12 :
- case 13 :
- case 14 :
- case 15 :
- case 17 :
- case 26 :
- case 30 :
- case 47 :
- case 48 :
- case 55 :
- case 56 :
- case 67 :
- case 73 :
- case 79 :
- weight1 = 20;
- break;
- case 29 :
- weight1 = 25;
- break;
- case 23 :
- case 76 :
- case 82 : //1296x2304
- weight1 = 30;
- break;
- case 74 : //2560X1440
- if(_force_4k_calculation) {
- weight1 = 80;
- }
- else {
- weight1 = 35;
- }
- break;
- case 24:
- case 57:
- weight1 = 40;
- break;
- case 25:
- case 58: // 2592x1944
- if(_force_4k_calculation) {
- weight1 = 80;
- }
- else {
- weight1 = 50;
- }
- break;
- case 77: //3200x1800
- case 83: //1808x3200
- if(_force_4k_calculation) {
- weight1 = 80;
- }
- else {
- weight1 = 57;
- }
- break;
- case 78: //3072x1728
- case 84: //1728x3072
- if(_force_4k_calculation) {
- weight1 = 80;
- }
- else {
- weight1 = 53;
- }
- break;
- case 50: //3840x2160
- case 81: //2160x3840
- weight1 = 80;
- break;
- case 51:
- weight1 = 85;
- break;
- case 52:
- weight1 = 120;
- break;
- default:
- weight1 = 20;
- break;
- }
- switch(fps){
- case 0 :
- weight2 = 30;
- break;
- case 1 :
- weight2 = 25;
- break;
- case 2 :
- weight2 = 20;
- break;
- case 3 :
- weight2 = 15;
- break;
- case 4 :
- weight2 = 10;
- break;
- case 5 :
- weight2 = 8;
- break;
- case 6 :
- weight2 = 6;
- break;
- case 7 :
- weight2 = 5;
- break;
- case 8 :
- weight2 = 4;
- break;
- case 9 :
- weight2 = 3;
- break;
- case 10 :
- weight2 = 2;
- break;
- case 11 :
- weight2 = 1;
- break;
- case 150 :
- weight2 = 50;
- break;
- case 160 :
- weight2 = 60;
- break;
- case 175:
- weight2 = 75;
- break;
- case 185:
- weight2 = 85;
- break;
- }
-
- return (weight1*weight2);
- }
- function DBG(str)
- {
- if(window.console == undefined) {
- console = { log : function() {} };
- }
- console.log(str);
- }
- function getwidth(res,real)
- {
- if(real) {
- switch(res) {
- case 0:
- return 720 ; // 720x480
- case 1:
- return 720 ; // 720x240
- case 2:
- return 352; // 352x480
- case 3:
- return 352; // 352x240
- case 4:
- return 720; // 720x576
- case 5:
- return 720; // 720x288
- case 6:
- return 352; // 352x576
- case 7:
- return 352; // 352x288
- case 8:
- return 640; // 640x480
- case 18:
- return 176; // 176x128
- case 19:
- return 176; // 176x144
- case 22:
- return 320; // 320x240
- };
- }
-
- switch(res){
- case 0 :
- case 1 :
- case 2 :
- case 3 :
- case 18 :
- return 720;
- case 4 :
- case 5 :
- case 6 :
- case 7 :
- case 19 :
- return 720;
- case 8 :
- return 640;
- case 9 :
- return 800;
- case 10 :
- return 1024;
- case 11 :
- return 1280;
- case 12 :
- return 1280;
- case 13 :
- return 1440;
- case 14 :
- return 1600;
- case 15 :
- return 1680;
- case 16 :
- return 1280;
- case 17 :
- return 1920;
- case 23 :
- return 2048;
- case 26 :
- return 1920;
- case 24 :
- return 2560;
- case 25 :
- return 2592;
- case 27 :
- return 640;
- case 28 :
- return 1440;
- case 29 :
- return 1792;
- case 30 :
- return 1440;
- case 47:
- return 1600;
- case 48:
- return 1920;
- case 50:
- return 3840;
- case 51:
- return 4096;
- case 52:
- return 4000;
- case 53:
- return 1280;
- case 54:
- return 1152;
- case 55:
- return 1360;
- case 56:
- return 1400;
- case 57:
- return 2048;
- case 58:
- return 2592;
- case 59:
- return 960;
- case 60:
- return 768;
- case 66:
- return 960;
- case 67:
- return 1080;
- case 68:
- return 720;
- case 69:
- return 360;
- case 70:
- return 1944;
- case 71:
- return 1600;
- case 72:
- return 1536;
- case 73:
- return 1366;
- case 74:
- return 2560;
- case 76:
- return 2304;
- case 77:
- return 3200;
- case 78:
- return 3072;
- case 79:
- return 1088;
- case 80:
- return 368;
- case 81:
- return 2160;
- case 82:
- return 1296;
- case 83:
- return 1808;
- case 84:
- return 1728;
- default :
- return 720;
- }
- }
- function getheight(res,real)
- {
- if(real) {
- switch(res) {
- case 0:
- return 480 ; // 720x480
- case 1:
- return 240 ; // 720x240
- case 2:
- return 480; // 352x480
- case 3:
- return 240; // 352x240
- case 4:
- return 576; // 720x576
- case 5:
- return 288; // 720x288
- case 6:
- return 576; // 352x576
- case 7:
- return 288; // 352x288
- case 8:
- return 480; // 640x480
- case 18:
- return 128; // 176x128
- case 19:
- return 144; // 176x144
- case 22:
- return 240; // 320x240
- };
- }
- switch(res){
- case 0 :
- case 1 :
- case 2 :
- case 3 :
- case 8 :
- case 18 :
- return 480;
- case 4 :
- case 5 :
- case 6 :
- case 7 :
- case 19 :
- return 576;
- case 9 :
- return 600;
- case 10 :
- return 768;
- case 11 :
- return 960;
- case 12 :
- return 1024;
- case 13 :
- return 900;
- case 14 :
- return 900;
- case 15 :
- return 1050;
- case 16 :
- return 720;
- case 17 :
- return 1080;
- case 23 :
- return 1536;
- case 26 :
- return 1056;
- case 24 :
- return 1600;
- case 25 :
- return 1936;
- case 27 :
- return 360;
- case 28 :
- return 540;
- case 29 :
- return 1344;
- case 30:
- return 1080;
- case 47:
- case 48:
- return 1200;
- case 50:
- return 2160;
- case 51:
- return 2160;
- case 52:
- return 3000;
- case 53:
- return 768;
- case 54:
- return 864;
- case 55:
- return 768;
- case 56:
- return 1050;
- case 57:
- return 2048;
- case 58:
- return 1944;
- case 59:
- return 540;
- case 60:
- return 432;
- case 66:
- return 600;
- case 67:
- return 1920;
- case 68:
- return 1280;
- case 69:
- return 640;
- case 70:
- return 2592;
- case 71:
- return 2560;
- case 72:
- return 2048;
- case 73:
- return 768;
- case 74:
- return 1440;
- case 76:
- return 1296;
- case 77:
- return 1800;
- case 78:
- return 1728;
- case 79:
- return 1920;
- case 80:
- return 640;
- case 81:
- return 3840;
- case 82:
- return 2304;
- case 83:
- return 3200;
- case 84:
- return 3072;
- default :
- return 360;
- }
- }
|