=0;--f){var c=i[o+0][n][f],h=i[o+1][n][f];i[o+0][n][f]=(c+h)*J.SQRT2*.5,i[o+1][n][f]=(c-h)*J.SQRT2*.5}_[n][0]=i[o+0][n][0],_[n][0]*=_[n][0];for(var f=V.BLKSIZE_s/2-1;f>=0;--f){var u=i[o+0][n][V.BLKSIZE_s/2-f],b=i[o+0][n][V.BLKSIZE_s/2+f];_[n][V.BLKSIZE_s/2-f]=e(.5*(u*u+b*b))}}function T(e,t,s,r){var n=e.internal_flags;2==e.athaa_loudapprox&&s<2&&(n.loudness_sq[t][s]=n.loudness_sq_save[s],n.loudness_sq_save[s]=a(r,n))}function E(e,a,t,r,_,i,o,l,f,h){for(var u=n([2,576]),b=e.internal_flags,m=b.channels_out,p=e.mode==c.JOINT_STEREO?4:m,v=0;v2&&(i[r][v].en.assign(b.en[v+2]),i[r][v].thm.assign(b.thm[v+2]))}for(var v=0;v0;++g,--M){var y=u[0][g],P=u[1][g];u[0][g]=y+P,u[1][g]=y-P}for(var g=0;g<3;g++)B[g]=b.nsPsy.last_en_subshort[v][g+6],A[g]=B[g]/b.nsPsy.last_en_subshort[v][g+4],w[0]+=B[g];for(var g=0;g<9;g++){for(var I=E+64,H=1;EB[g+3-2]?H/=B[g+3-2]:H=B[g+3-2]>10*H?B[g+3-2]/(10*H):0,A[g+3]=H}for(var g=0;g<3;++g){var V=B[3*g+3]+B[3*g+4]+B[3*g+5],O=1;6*B[3*g+5]k&&(f[v][g/3]=g%3+1);for(var g=1;g<4;g++){var N=w[g-1],D=w[g];Math.max(N,D)<4e4&&N<1.7*D&&D<1.7*N&&(1==g&&f[v][0]<=f[v][g]&&(f[v][0]=0),f[v][g]=0)}f[v][0]<=b.nsPsy.lastAttacks[v]&&(f[v][0]=0),3!=b.nsPsy.lastAttacks[v]&&f[v][0]+f[v][1]+f[v][2]+f[v][3]==0||(x=0,0!=f[v][1]&&0!=f[v][0]&&(f[v][1]=0),0!=f[v][2]&&0!=f[v][1]&&(f[v][2]=0),0!=f[v][3]&&0!=f[v][2]&&(f[v][3]=0)),v<2?h[v]=x:0==x&&(h[0]=h[1]=0),o[v]=b.tot_ener[v]}}function k(e,a,t){if(0==t)for(var s=0;s0){var i=a[n];ir&&(o=r),s[n]=o}else s[n]=0;for(n=1;n0){var i=a[n-1];ir&&(o=r),s[n]=o}else s[n]=0;if((_=t[n-1]+t[n])>0){var i=a[n-1];ir&&(o=r),s[n]=o}else s[n]=0}function P(e,a,t,r,n,_){var i,l,f,c=e.internal_flags,h=new float[V.CBANDS],u=s(V.CBANDS),b=new int[V.CBANDS];for(f=l=0;fR&&(r[f]=R),c.masking_lower>1&&(r[f]*=c.masking_lower),r[f]>t[f]&&(r[f]=t[f]),c.masking_lower<1&&(r[f]*=c.masking_lower)}for(;f0?Math.min(b,R):Math.min(b,r[i]*_e)}else{var R,B=ae*e.nb_2[_][i],w=ee*e.nb_1[_][i];B<=0&&(B=b),w<=0&&(w=b),R=e.blocktype_old[1&_]==V.NORM_TYPE?Math.min(w,B):w,n[i]=Math.min(b,R)}e.nb_2[_][i]=e.nb_1[_][i],e.nb_1[_][i]=b,u=l[i],u*=e.minval_l[i],u*=m,n[i]>u&&(n[i]=u),e.masking_lower>1&&(n[i]*=e.masking_lower),n[i]>r[i]&&(n[i]=r[i]),e.masking_lower<1&&(n[i]*=e.masking_lower)}for(;i0?Math.pow(10,r):1,c=0;c<_;++c){var h=e[2][c],u=e[3][c],b=a[0][c],m=a[1][c],p=a[2][c],v=a[3][c];if(b<=1.58*m&&m<=1.58*b){var d=t[c]*u,g=t[c]*h;o=Math.max(p,Math.min(v,d)),i=Math.max(v,Math.min(p,g))}else o=p,i=v;if(n>0){var S,R,M=s[c]*f;if(S=Math.min(Math.max(b,M),Math.max(m,M)),p=Math.max(o,M),v=Math.max(i,M),(R=p+v)>0&&S*lh&&(o=h),i>u&&(i=u),a[2][c]=o,a[3][c]=i}}function N(e,a){var t,s=e;return t=s>=0?27*-s:s*a,t<=-72?0:Math.exp(t*oe)}function D(e){var a,t,s=0,r=0,n=0;for(n=0;N(n,e)>1e-20;n-=1);for(a=n,t=0;Math.abs(t-a)>1e-12;)n=(t+a)/2,N(n,e)>0?t=n:a=n;s=a;var a,t,n=0;for(n=0;N(n,e)>1e-20;n+=1);for(a=0,t=n;Math.abs(t-a)>1e-12;)n=(t+a)/2,N(n,e)>0?a=n:t=n;r=t;var _,i=0;for(_=0;_<=1e3;++_){var n=s+_*(r-s)/1e3;i+=N(n,e)}return 1001/(i*(r-s))}function X(e){var a,t,s,r;return a=e,a*=a>=0?3:1.5,a>=.5&&a<=2.5?(r=a-.5,t=8*(r*r-2*r)):t=0,a+=.474,(s=15.811389+7.5*a-17.5*Math.sqrt(1+a*a))<=-60?0:(a=Math.exp((t+s)*oe),a/=.6609193)}function q(e){return e<0&&(e=0),e*=.001,13*Math.atan(.76*e)+3.5*Math.atan(e*e/56.25)}function C(e,a,r,n,_,i,o,l,f,c,h,u){var b,m=s(V.CBANDS+1),p=l/(u>15?1152:384),v=t(V.HBLKSIZE);l/=f;var d=0,g=0;for(b=0;bf/2){d=f/2,++b;break}}m[b]=l*d;for(var M=0;Mf/2&&(B=f/2),r[M]=(v[A]+v[B])/2,a[M]=v[B];var k=p*T;o[M]=(k-m[a[M]])/(m[a[M]+1]-m[a[M]]),o[M]<0?o[M]=0:o[M]>1&&(o[M]=1),E=q(l*c[M]*h),E=Math.min(E,15.5)/15.5,i[M]=Math.pow(10,1.25*(1-Math.cos(Math.PI*E))-2.5)}d=0;for(var x=0;x0);o++);for(e[c][0]=o,o=a-1;o>0&&!(l[c][o]>0);o--);e[c][1]=o,f+=e[c][1]-e[c][0]+1}for(var m=s(f),p=0,c=0;c2&&(B[o][y].en.assign(X.en[y+2]),B[o][y].thm.assign(X.thm[y+2]))}for(y=0;yoe[I+3-2]?Be/=oe[I+3-2]:Be=oe[I+3-2]>10*Be?oe[I+3-2]/(10*Be):0,fe[I+3]=Be}if(e.analysis){var we=fe[0];for(I=1;I<12;I++)wene&&(me[I/3]=I%3+1);for(I=1;I<4;I++){var Te;Te=le[I-1]>le[I]?le[I-1]/le[I]:le[I]/le[I-1],Te<1.7&&(me[I]=0,1==I&&(me[0]=0))}for(0!=me[0]&&0!=X.nsPsy.lastAttacks[y]&&(me[0]=0),3!=X.nsPsy.lastAttacks[y]&&me[0]+me[1]+me[2]+me[3]==0||(ce=0,0!=me[1]&&0!=me[0]&&(me[1]=0),0!=me[2]&&0!=me[1]&&(me[2]=0),0!=me[3]&&0!=me[2]&&(me[3]=0)),y<2?z[y]=ce:0==ce&&(z[0]=z[1]=0),E[y]=X.tot_ener[y],re=q,se=Y,r(e,pe,ve,se,1&y,re,1&y,o,y,a,_),M(X,pe,C,ue,be),A(X,ue,be,Z),N=0;N<3;N++){var Ee,ke;for(v(e,ve,F,j,y,N),m(X,F,j,y,N),L=0;L=2||1==me[N+1]){var xe=0!=N?N-1:2,Be=g(X.thm[y].s[L][xe],ke,.6*D);ke=Math.min(ke,Be)}if(1==me[N]){var xe=0!=N?N-1:2,Be=g(X.thm[y].s[L][xe],ke,_e*D);ke=Math.min(ke,Be)}else if(0!=N&&3==me[N-1]||0==N&&3==X.nsPsy.lastAttacks[y]){var xe=2!=N?N+1:0,Be=g(X.thm[y].s[L][xe],ke,_e*D);ke=Math.min(ke,Be)}Ee=oe[3*N+3]+oe[3*N+4]+oe[3*N+5],6*oe[3*N+5]0&&h(e,e.interChRatio),e.mode==c.JOINT_STEREO){var He;u(X),He=e.msfix,Math.abs(He)>0&&b(X,He,e.ATHlower*X.ATH.adjust)}for(d(e,z,k,G),y=0;y1?(Ve=T,Ne=-2,Oe=V.NORM_TYPE,k[0]!=V.SHORT_TYPE&&k[1]!=V.SHORT_TYPE||(Oe=V.SHORT_TYPE),Le=B[o][y-2]):(Ve=w,Ne=0,Oe=k[y],Le=l[o][y]),Oe==V.SHORT_TYPE?Ve[Ne+y]=S(Le,X.masking_lower):Ve[Ne+y]=R(Le,X.masking_lower),e.analysis&&(X.pinfo.pe[o][y]=Ve[Ne+y])}return 0};var Se=[-1.730326e-17,-.01703172,-1.349528e-17,.0418072,-6.73278e-17,-.0876324,-3.0835e-17,.1863476,-1.104424e-16,-.627638];this.L3psycho_anal_vbr=function(e,a,r,_,i,o,l,f,h,u){var b,v,d=e.internal_flags,M=s(V.HBLKSIZE),A=n([3,V.HBLKSIZE_s]),y=n([2,V.BLKSIZE]),N=n([2,3,V.BLKSIZE_s]),D=n([4,V.CBANDS]),X=n([4,V.CBANDS]),Y=n([4,3]),q=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],C=t(2),F=e.mode==c.JOINT_STEREO?4:d.channels_out;E(e,a,r,_,i,o,h,Y,q,C),H(e,C);for(var j=0;j=2||1==q[j][z+1]){var U=0!=z?z-1:2,W=g(d.thm[j].s[K][U],Q,.36);Q=Math.min(Q,W)}else if(1==q[j][z]){var U=0!=z?z-1:2,W=g(d.thm[j].s[K][U],Q,.6*_e);Q=Math.min(Q,W)}else if(0!=z&&3==q[j][z-1]||0==z&&3==d.nsPsy.lastAttacks[j]){var U=2!=z?z+1:0,W=g(d.thm[j].s[K][U],Q,.6*_e);Q=Math.min(Q,W)}Q*=Y[j][z],Z[z]=Q}for(var z=0;z<3;z++)d.thm[j].s[K][z]=Z[z]}}for(var j=0;j1?(J=f,$=-2,ee=V.NORM_TYPE,u[0]!=V.SHORT_TYPE&&u[1]!=V.SHORT_TYPE||(ee=V.SHORT_TYPE),ae=o[_][j-2]):(J=l,$=0,ee=u[j],ae=i[_][j]),ee==V.SHORT_TYPE?J[$+j]=S(ae,d.masking_lower):J[$+j]=R(ae,d.masking_lower),e.analysis&&(d.pinfo.pe[_][j]=J[$+j])}return 0},this.psymodel_init=function(e){var a,t=e.internal_flags,r=!0,n=13,i=0,o=0,l=-8.25,c=-4.5,h=s(V.CBANDS),u=s(V.CBANDS),b=s(V.CBANDS),m=e.out_samplerate;switch(e.experimentalZ){default:case 0:r=!0;break;case 1:r=e.VBR!=f.vbr_mtrh&&e.VBR!=f.vbr_mt;break;case 2:r=!1;break;case 3:n=8,i=-1.75,o=-.0125,l=-8.25,c=-2.25}for(t.ms_ener_ratio_old=.25,t.blocktype_old[0]=t.blocktype_old[1]=V.NORM_TYPE,a=0;a<4;++a){for(var p=0;p=n&&(d=o*(h[a]-n)/(24-n)+i*(24-h[a])/(24-n)),b[a]=Math.pow(10,d/10),t.numlines_l[a]>0?t.rnumlines_l[a]=1/t.numlines_l[a]:t.rnumlines_l[a]=0}t.s3_ll=F(t.s3ind,t.npart_l,h,u,b,r);var p=0;for(a=0;aR&&(g=R)}t.ATH.cb_l[a]=g,g=20*h[a]/10-20,g>6&&(g=100),g<-15&&(g=-15),g-=8,t.minval_l[a]=Math.pow(10,g/10)*t.numlines_l[a]}for(t.npart_s=C(t.numlines_s,t.bo_s,t.bm_s,h,u,t.mld_s,t.PSY.bo_s_weight,m,V.BLKSIZE_s,t.scalefac_band.s,V.BLKSIZE_s/384,V.SBMAX_s),p=0,a=0;a=n&&(d=c*(h[a]-n)/(24-n)+l*(24-h[a])/(24-n)),b[a]=Math.pow(10,d/10),g=$.MAX_VALUE;for(var S=0;SR&&(g=R)}t.ATH.cb_s[a]=g,g=7*h[a]/12-7,h[a]>12&&(g*=1+3.1*Math.log(1+g)),h[a]<12&&(g*=1+2.3*Math.log(1-g)),g<-15&&(g=-15),g-=8,t.minval_s[a]=Math.pow(10,g/10)*t.numlines_s[a]}t.s3_ss=F(t.s3ind_s,t.npart_s,h,u,b,r),_(),Q.init_fft(t),t.decay=Math.exp(-1*W/(.01*m/192));var A;A=3.5,0!=(2&e.exp_nspsytune)&&(A=1),Math.abs(e.msfix)>0&&(A=e.msfix),e.msfix=A;for(var B=0;Bt.npart_l-1&&(t.s3ind[B][1]=t.npart_l-1);var w=576*t.mode_gr/m;if(t.ATH.decay=Math.pow(10,-1.2*w),t.ATH.adjust=.01,t.ATH.adjustLimit=1,-1!=e.ATHtype){var M,T=e.out_samplerate/V.BLKSIZE,E=0;for(M=0,a=0;a=0;)t.ATH.eql_w[a]*=E}for(var B=p=0;B1?0:e<=0?1:Math.cos(Math.PI/2*e)}function o(e,a){var t=44100;return a>=48e3?t=48e3:a>=44100?t=44100:a>=32e3?t=32e3:a>=24e3?t=24e3:a>=22050?t=22050:a>=16e3?t=16e3:a>=12e3?t=12e3:a>=11025?t=11025:a>=8e3&&(t=8e3),-1==e?t:(e<=15960&&(t=44100),e<=15250&&(t=32e3),e<=11220&&(t=24e3),e<=9970&&(t=22050),e<=7230&&(t=16e3),e<=5420&&(t=12e3),e<=4510&&(t=11025),e<=3970&&(t=8e3),a44100?48e3:a>32e3?44100:a>24e3?32e3:a>22050?24e3:a>16e3?22050:a>12e3?16e3:a>11025?12e3:a>8e3?11025:8e3:t)}function h(e,a){switch(e){case 44100:return a.version=1,0;case 48e3:return a.version=1,1;case 32e3:return a.version=1,2;case 22050:return a.version=0,0;case 24e3:return a.version=0,1;case 16e3:return a.version=0,2;case 11025:return a.version=0,0;case 12e3:return a.version=0,1;case 8e3:return a.version=0,2;default:return a.version=0,-1}}function u(e,a,t){t<16e3&&(a=2);for(var s=ee.bitrate_table[a][1],r=2;r<=14;r++)ee.bitrate_table[a][r]>0&&Math.abs(ee.bitrate_table[a][r]-e)0&&ee.bitrate_table[a][s]==e)return s;return-1}function p(e,a){var s=[new t(8,2e3),new t(16,3700),new t(24,3900),new t(32,5500),new t(40,7e3),new t(48,7500),new t(56,1e4),new t(64,11e3),new t(80,13500),new t(96,15100),new t(112,15600),new t(128,17e3),new t(160,17500),new t(192,18600),new t(224,19400),new t(256,19700),new t(320,20500)],r=L.nearestBitrateFullIndex(a);e.lowerlimit=s[r].lowpass}function d(e){var a=e.internal_flags,t=32,s=-1;if(a.lowpass1>0){for(var r=999,_=0;_<=31;_++){var i=_/31;i>=a.lowpass2&&(t=Math.min(t,_)),a.lowpass10&&a.highpass2<.75/31*.9&&(a.highpass1=0,a.highpass2=0,W.err.println("Warning: highpass filter disabled. highpass frequency too small\n")),a.highpass2>0){for(var o=-1,_=0;_<=31;_++){var i=_/31;i<=a.highpass1&&(s=Math.max(s,_)),a.highpass1a.highpass1?n((a.highpass2-i)/(a.highpass2-a.highpass1+1e-20)):1,f=a.lowpass2>a.lowpass1?n((i-a.lowpass1)/(a.lowpass2-a.lowpass1+1e-20)):1,a.amp_filter[_]=l*f}}function g(e){var a=e.internal_flags;switch(e.quality){default:case 9:a.psymodel=0,a.noise_shaping=0,a.noise_shaping_amp=0,a.noise_shaping_stop=0,a.use_best_huffman=0,a.full_outer_loop=0;break;case 8:e.quality=7;case 7:a.psymodel=1,a.noise_shaping=0,a.noise_shaping_amp=0,a.noise_shaping_stop=0,a.use_best_huffman=0,a.full_outer_loop=0;break;case 6:case 5:a.psymodel=1,0==a.noise_shaping&&(a.noise_shaping=1),a.noise_shaping_amp=0,a.noise_shaping_stop=0,-1==a.subblock_gain&&(a.subblock_gain=1),a.use_best_huffman=0,a.full_outer_loop=0;break;case 4:a.psymodel=1,0==a.noise_shaping&&(a.noise_shaping=1),a.noise_shaping_amp=0,a.noise_shaping_stop=0,-1==a.subblock_gain&&(a.subblock_gain=1),a.use_best_huffman=1,a.full_outer_loop=0;break;case 3:a.psymodel=1,0==a.noise_shaping&&(a.noise_shaping=1),a.noise_shaping_amp=1,a.noise_shaping_stop=1,-1==a.subblock_gain&&(a.subblock_gain=1),a.use_best_huffman=1,a.full_outer_loop=0;break;case 2:a.psymodel=1,0==a.noise_shaping&&(a.noise_shaping=1),0==a.substep_shaping&&(a.substep_shaping=2),a.noise_shaping_amp=1,
a.noise_shaping_stop=1,-1==a.subblock_gain&&(a.subblock_gain=1),a.use_best_huffman=1,a.full_outer_loop=0;break;case 1:case 0:a.psymodel=1,0==a.noise_shaping&&(a.noise_shaping=1),0==a.substep_shaping&&(a.substep_shaping=2),a.noise_shaping_amp=2,a.noise_shaping_stop=1,-1==a.subblock_gain&&(a.subblock_gain=1),a.use_best_huffman=1,a.full_outer_loop=0}}function S(e){var a=e.internal_flags;e.frameNum=0,e.write_id3tag_automatic&&K.id3tag_write_v2(e),a.bitrate_stereoMode_Hist=_([16,5]),a.bitrate_blockType_Hist=_([16,6]),a.PeakSample=0,e.bWriteVbrTag&&G.InitVbrTag(e)}function R(e,a){(null==e.in_buffer_0||e.in_buffer_nsamples0;){var g=[null,null],S=0,R=0;g[0]=p[0],g[1]=p[1];var A=new x;if(O(e,m,g,d,s,A),S=A.n_in,R=A.n_out,h.findReplayGain&&!h.decode_on_the_fly&&N.AnalyzeSamples(h.rgdata,m[0],h.mf_size,m[1],h.mf_size,R,h.channels_out)==b.GAIN_ANALYSIS_ERROR)return-6;if(s-=S,d+=S,h.channels_out,h.mf_size+=R,h.mf_samples_to_encode<1&&(h.mf_samples_to_encode=V.ENCDELAY+V.POSTDELAY),h.mf_samples_to_encode+=R,h.mf_size>=f){var B=_-u;if(0==_&&(B=0),(i=k(e,m[0],m[1],r,n,B))<0)return i;for(n+=i,u+=i,h.mf_size-=e.framesize,h.mf_samples_to_encode-=e.framesize,l=0;l1&&(e=1);var r=e-.5,n=.42-.5*Math.cos(2*e*Math.PI)+.08*Math.cos(4*e*Math.PI);return Math.abs(r)<1e-9?s/Math.PI:n*Math.sin(t*s*r)/(Math.PI*t*r)}function H(e,a,t,r,n,_,i,o,l){var f,c,h=e.internal_flags,u=0,b=e.out_samplerate/P(e.out_samplerate,e.in_samplerate);b>X.BPC&&(b=X.BPC);var m=Math.abs(h.resample_ratio-Math.floor(.5+h.resample_ratio))<1e-4?1:0,p=1/h.resample_ratio;p>1&&(p=1);var v=31;0==v%2&&--v,v+=m;var d=v+1;if(0==h.fill_buffer_resample_init){for(h.inbuf_old[0]=s(d),h.inbuf_old[1]=s(d),f=0;f<=2*b;++f)h.blackfilt[f]=s(d);for(h.itime[0]=0,h.itime[1]=0,u=0;u<=2*b;u++){var g=0,S=(u-b)/(2*b);for(f=0;f<=v;f++)g+=h.blackfilt[u][f]=I(f-S,p,v);for(f=0;f<=v;f++)h.blackfilt[u][f]/=g}h.fill_buffer_resample_init=1}var R=h.inbuf_old[l];for(c=0;c=i)break;var S=M-h.itime[l]-(u+v%2*.5);A=0|Math.floor(2*S*b+b+.5);var B=0;for(f=0;f<=v;++f){var w,T=f+u-v/2;w=T<0?R[d+T]:n[_+T],B+=w*h.blackfilt[A][f]}a[t+c]=B}if(o.num_used=Math.min(i,v+u-v/2),h.itime[l]+=o.num_used-c*h.resample_ratio,o.num_used>=d)for(f=0;f1.0001)for(var i=0;i<_.channels_out;i++){var o=new y;n.n_out=H(e,a[i],_.mf_size,e.framesize,t[i],s,r,o,i),n.n_in=o.num_used}else{n.n_out=Math.min(e.framesize,r),n.n_in=n.n_out;for(var l=0;le-s?t:r},this.lame_init_params=function(t){var s=t.internal_flags;if(s.Class_ID=0,null==s.ATH&&(s.ATH=new B),null==s.PSY&&(s.PSY=new e),null==s.rgdata&&(s.rgdata=new w),s.channels_in=t.num_channels,1==s.channels_in&&(t.mode=c.MONO),s.channels_out=t.mode==c.MONO?1:2,s.mode_ext=V.MPG_MD_MS_LR,t.mode==c.MONO&&(t.force_ms=!1),t.VBR==f.vbr_off&&128!=t.VBR_mean_bitrate_kbps&&0==t.brate&&(t.brate=t.VBR_mean_bitrate_kbps),t.VBR==f.vbr_off||t.VBR==f.vbr_mtrh||t.VBR==f.vbr_mt||(t.free_format=!1),t.VBR==f.vbr_off&&0==t.brate&&v.EQ(t.compression_ratio,0)&&(t.compression_ratio=11.025),t.VBR==f.vbr_off&&t.compression_ratio>0&&(0==t.out_samplerate&&(t.out_samplerate=map2MP3Frequency(int(.97*t.in_samplerate))),t.brate=0|16*t.out_samplerate*s.channels_out/(1e3*t.compression_ratio),s.samplerate_index=h(t.out_samplerate,t),t.free_format||(t.brate=u(t.brate,t.version,t.out_samplerate))),0!=t.out_samplerate&&(t.out_samplerate<16e3?(t.VBR_mean_bitrate_kbps=Math.max(t.VBR_mean_bitrate_kbps,8),t.VBR_mean_bitrate_kbps=Math.min(t.VBR_mean_bitrate_kbps,64)):t.out_samplerate<32e3?(t.VBR_mean_bitrate_kbps=Math.max(t.VBR_mean_bitrate_kbps,8),t.VBR_mean_bitrate_kbps=Math.min(t.VBR_mean_bitrate_kbps,160)):(t.VBR_mean_bitrate_kbps=Math.max(t.VBR_mean_bitrate_kbps,32),t.VBR_mean_bitrate_kbps=Math.min(t.VBR_mean_bitrate_kbps,320))),0==t.lowpassfreq){var r=16e3;switch(t.VBR){case f.vbr_off:var n=new a;p(n,t.brate),r=n.lowerlimit;break;case f.vbr_abr:var n=new a;p(n,t.VBR_mean_bitrate_kbps),r=n.lowerlimit;break;case f.vbr_rh:var _=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=t.VBR_q&&t.VBR_q<=9){var i=_[t.VBR_q],R=_[t.VBR_q+1],M=t.VBR_q_frac;r=linear_int(i,R,M)}else r=19500;break;default:var _=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=t.VBR_q&&t.VBR_q<=9){var i=_[t.VBR_q],R=_[t.VBR_q+1],M=t.VBR_q_frac;r=linear_int(i,R,M)}else r=19500}t.mode!=c.MONO||t.VBR!=f.vbr_off&&t.VBR!=f.vbr_abr||(r*=1.5),t.lowpassfreq=0|r}if(0==t.out_samplerate&&(2*t.lowpassfreq>t.in_samplerate&&(t.lowpassfreq=t.in_samplerate/2),t.out_samplerate=o(0|t.lowpassfreq,t.in_samplerate)),t.lowpassfreq=Math.min(20500,t.lowpassfreq),t.lowpassfreq=Math.min(t.out_samplerate/2,t.lowpassfreq),t.VBR==f.vbr_off&&(t.compression_ratio=16*t.out_samplerate*s.channels_out/(1e3*t.brate)),t.VBR==f.vbr_abr&&(t.compression_ratio=16*t.out_samplerate*s.channels_out/(1e3*t.VBR_mean_bitrate_kbps)),t.bWriteVbrTag||(t.findReplayGain=!1,t.decode_on_the_fly=!1,s.findPeakSample=!1),s.findReplayGain=t.findReplayGain,s.decode_on_the_fly=t.decode_on_the_fly,s.decode_on_the_fly&&(s.findPeakSample=!0),s.findReplayGain&&N.InitGainAnalysis(s.rgdata,t.out_samplerate)==b.INIT_GAIN_ANALYSIS_ERROR)return t.internal_flags=null,-6;switch(s.decode_on_the_fly&&!t.decode_only&&(null!=s.hip&&Z.hip_decode_exit(s.hip),s.hip=Z.hip_decode_init()),s.mode_gr=t.out_samplerate<=24e3?1:2,t.framesize=576*s.mode_gr,t.encoder_delay=V.ENCDELAY,s.resample_ratio=t.in_samplerate/t.out_samplerate,t.VBR){case f.vbr_mt:case f.vbr_rh:case f.vbr_mtrh:var A=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5];t.compression_ratio=A[t.VBR_q];break;case f.vbr_abr:t.compression_ratio=16*t.out_samplerate*s.channels_out/(1e3*t.VBR_mean_bitrate_kbps);break;default:t.compression_ratio=16*t.out_samplerate*s.channels_out/(1e3*t.brate)}if(t.mode==c.NOT_SET&&(t.mode=c.JOINT_STEREO),t.highpassfreq>0?(s.highpass1=2*t.highpassfreq,t.highpasswidth>=0?s.highpass2=2*(t.highpassfreq+t.highpasswidth):s.highpass2=2*t.highpassfreq,s.highpass1/=t.out_samplerate,s.highpass2/=t.out_samplerate):(s.highpass1=0,s.highpass2=0),t.lowpassfreq>0?(s.lowpass2=2*t.lowpassfreq,t.lowpasswidth>=0?(s.lowpass1=2*(t.lowpassfreq-t.lowpasswidth),s.lowpass1<0&&(s.lowpass1=0)):s.lowpass1=2*t.lowpassfreq,s.lowpass1/=t.out_samplerate,s.lowpass2/=t.out_samplerate):(s.lowpass1=0,s.lowpass2=0),d(t),s.samplerate_index=h(t.out_samplerate,t),s.samplerate_index<0)return t.internal_flags=null,-1;if(t.VBR==f.vbr_off){if(t.free_format)s.bitrate_index=0;else if(t.brate=u(t.brate,t.version,t.out_samplerate),s.bitrate_index=m(t.brate,t.version,t.out_samplerate),s.bitrate_index<=0)return t.internal_flags=null,-1}else s.bitrate_index=1;t.analysis&&(t.bWriteVbrTag=!1),null!=s.pinfo&&(t.bWriteVbrTag=!1),D.init_bit_stream_w(s);for(var E=s.samplerate_index+3*t.version+6*(t.out_samplerate<16e3?1:0),k=0;k5&&(t.quality=5),s.PSY.mask_adjust=t.maskingadjust,s.PSY.mask_adjust_short=t.maskingadjust_short,t.experimentalY?s.sfb21_extra=!1:s.sfb21_extra=t.out_samplerate>44e3,s.iteration_loop=new VBRNewIterationLoop(j);break;case f.vbr_rh:Y.apply_preset(t,500-10*t.VBR_q,0),s.PSY.mask_adjust=t.maskingadjust,s.PSY.mask_adjust_short=t.maskingadjust_short,t.experimentalY?s.sfb21_extra=!1:s.sfb21_extra=t.out_samplerate>44e3,t.quality>6&&(t.quality=6),t.quality<0&&(t.quality=LAME_DEFAULT_QUALITY),s.iteration_loop=new VBROldIterationLoop(j);break;default:var I;s.sfb21_extra=!1,t.quality<0&&(t.quality=LAME_DEFAULT_QUALITY),I=t.VBR,I==f.vbr_off&&(t.VBR_mean_bitrate_kbps=t.brate),Y.apply_preset(t,t.VBR_mean_bitrate_kbps,0),t.VBR=I,s.PSY.mask_adjust=t.maskingadjust,s.PSY.mask_adjust_short=t.maskingadjust_short,I==f.vbr_off?s.iteration_loop=new T(j):s.iteration_loop=new ABRIterationLoop(j)}if(t.VBR!=f.vbr_off){if(s.VBR_min_bitrate=1,s.VBR_max_bitrate=14,t.out_samplerate<16e3&&(s.VBR_max_bitrate=8),0!=t.VBR_min_bitrate_kbps&&(t.VBR_min_bitrate_kbps=u(t.VBR_min_bitrate_kbps,t.version,t.out_samplerate),s.VBR_min_bitrate=m(t.VBR_min_bitrate_kbps,t.version,t.out_samplerate),s.VBR_min_bitrate<0))return-1;if(0!=t.VBR_max_bitrate_kbps&&(t.VBR_max_bitrate_kbps=u(t.VBR_max_bitrate_kbps,t.version,t.out_samplerate),s.VBR_max_bitrate=m(t.VBR_max_bitrate_kbps,t.version,t.out_samplerate),s.VBR_max_bitrate<0))return-1;t.VBR_min_bitrate_kbps=ee.bitrate_table[t.version][s.VBR_min_bitrate],t.VBR_max_bitrate_kbps=ee.bitrate_table[t.version][s.VBR_max_bitrate],t.VBR_mean_bitrate_kbps=Math.min(ee.bitrate_table[t.version][s.VBR_max_bitrate],t.VBR_mean_bitrate_kbps),t.VBR_mean_bitrate_kbps=Math.max(ee.bitrate_table[t.version][s.VBR_min_bitrate],t.VBR_mean_bitrate_kbps)}return t.tune&&(s.PSY.mask_adjust+=t.tune_value_a,s.PSY.mask_adjust_short+=t.tune_value_a),g(t),t.athaa_type<0?s.ATH.useAdjust=3:s.ATH.useAdjust=t.athaa_type,s.ATH.aaSensitivityP=Math.pow(10,t.athaa_sensitivity/-10),null==t.short_blocks&&(t.short_blocks=l.short_block_allowed),t.short_blocks!=l.short_block_allowed||t.mode!=c.JOINT_STEREO&&t.mode!=c.STEREO||(t.short_blocks=l.short_block_coupled),t.quant_comp<0&&(t.quant_comp=1),t.quant_comp_short<0&&(t.quant_comp_short=0),t.msfix<0&&(t.msfix=0),t.exp_nspsytune=1|t.exp_nspsytune,t.internal_flags.nsPsy.attackthre<0&&(t.internal_flags.nsPsy.attackthre=q.NSATTACKTHRE),t.internal_flags.nsPsy.attackthre_s<0&&(t.internal_flags.nsPsy.attackthre_s=q.NSATTACKTHRE_S),t.scale<0&&(t.scale=1),t.ATHtype<0&&(t.ATHtype=4),t.ATHcurve<0&&(t.ATHcurve=4),t.athaa_loudapprox<0&&(t.athaa_loudapprox=2),t.interChRatio<0&&(t.interChRatio=0),null==t.useTemporal&&(t.useTemporal=!0),s.slot_lag=s.frac_SpF=0,t.VBR==f.vbr_off&&(s.slot_lag=s.frac_SpF=72e3*(t.version+1)*t.brate%t.out_samplerate|0),F.iteration_init(t),Q.psymodel_init(t),0},this.lame_encode_flush=function(e,a,t,s){var r,n,_,o,l=e.internal_flags,f=i([2,1152]),c=0,h=l.mf_samples_to_encode-V.POSTDELAY,u=M(e);if(l.mf_samples_to_encode<1)return 0;for(r=0,e.in_samplerate!=e.out_samplerate&&(h+=16*e.out_samplerate/e.in_samplerate),_=e.framesize-h%e.framesize,_<576&&(_+=e.framesize),e.encoder_padding=_,o=(h+_)/e.framesize;o>0&&c>=0;){var b=u-l.mf_size,m=e.frameNum;b*=e.in_samplerate,b/=e.out_samplerate,b>1152&&(b=1152),b<1&&(b=1),n=s-r,0==s&&(n=0),c=this.lame_encode_buffer(e,f[0],f[1],b,a,t,n),t+=c,r+=c,o-=m!=e.frameNum?1:0}if(l.mf_samples_to_encode=0,c<0)return c;if(n=s-r,0==s&&(n=0),D.flush_bitstream(e),(c=D.copy_buffer(l,a,t,n,1))<0)return c;if(t+=c,r+=c,n=s-r,0==s&&(n=0),e.write_id3tag_automatic){if(K.id3tag_write_v1(e),(c=D.copy_buffer(l,a,t,n,0))<0)return c;r+=c}return r},this.lame_encode_buffer=function(e,a,t,s,r,n,_){var i=e.internal_flags,o=[null,null];if(i.Class_ID!=U)return-3;if(0==s)return 0;R(i,s),o[0]=i.in_buffer_0,o[1]=i.in_buffer_1;for(var l=0;l1&&(o[1][l]=t[l]);return E(e,o[0],o[1],s,r,n,_)}}function F(){var e,a;this.setModules=function(t,s){e=t,a=s}}function j(){var e,a,t;this.setModules=function(s,r,n){e=s,a=r,t=n}}function G(){}function z(){var e,a;this.setModules=function(t,s){e=t,a=s}}function K(a,t,s){3!=arguments.length&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),a=1,t=44100,s=128);var r=new C,n=new F,_=new b,i=new v,o=new u,l=new k,f=new P,g=new d,S=new h,R=new z,M=new m,A=new p,B=new j,w=new G;r.setModules(_,i,o,l,f,g,S,R,w),i.setModules(_,w,S,g),R.setModules(i,S),o.setModules(r),f.setModules(i,M,l,A),l.setModules(A,M,r.enc.psy),M.setModules(i),A.setModules(l),g.setModules(r,i,S),n.setModules(B,w),B.setModules(S,R,o);var T=r.lame_init();T.num_channels=a,T.in_samplerate=t,T.brate=s,T.mode=c.STEREO,T.quality=3,T.bWriteVbrTag=!1,T.disable_reservoir=!0,T.write_id3tag_automatic=!1;var E=(r.lame_init_params(T),1152),x=0|1.25*E+7200,y=e(x);this.encodeBuffer=function(t,s){1==a&&(s=t),t.length>E&&(E=t.length,x=0|1.25*E+7200,y=e(x));var n=r.lame_encode_buffer(T,t,s,t.length,y,0,x);return new Int8Array(y.subarray(0,n))},this.flush=function(){var e=r.lame_encode_flush(T,y,0,x);return new Int8Array(y.subarray(0,e))}}function Z(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function Q(e){return e.charCodeAt(0)<<24|e.charCodeAt(1)<<16|e.charCodeAt(2)<<8|e.charCodeAt(3)}var U={};U.fill=function(e,a,t,s){if(2==arguments.length)for(var r=0;rMath.abs(a)?Math.abs(e-a)<=1e-6*Math.abs(e):Math.abs(e-a)<=1e-6*Math.abs(a)},v.NEQ=function(e,a){return!v.EQ(e,a)},d.NUMTOCENTRIES=100,d.MAXFRAMESIZE=2880;var ee={};ee.t1HB=[1,1,1,0],ee.t2HB=[1,2,1,3,1,1,3,2,0],ee.t3HB=[3,2,1,1,1,1,3,2,0],ee.t5HB=[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],ee.t6HB=[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],ee.t7HB=[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],ee.t8HB=[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],ee.t9HB=[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],ee.t10HB=[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34,46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],ee.t11HB=[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],ee.t12HB=[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],ee.t13HB=[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19,3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51,36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],ee.t15HB=[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40,38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],ee.t16HB=[1,5,14,44,74,63,110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73,141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,865,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],ee.t24HB=[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216,209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289,275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],ee.t32HB=[1,10,8,20,12,20,16,32,14,12,24,0,28,16,24,16],ee.t33HB=[15,28,26,48,22,40,36,64,14,24,20,32,12,16,8,0],ee.t1l=[1,4,3,5],ee.t2l=[1,4,7,4,5,7,6,7,8],ee.t3l=[2,3,7,4,4,7,6,7,8],ee.t5l=[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],ee.t6l=[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],ee.t7l=[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],ee.t8l=[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],ee.t9l=[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],ee.t10l=[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12,12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],ee.t11l=[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],ee.t12l=[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],ee.t13l=[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11,12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14,14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],ee.t15l=[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],ee.t16_5l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],ee.t16l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],ee.t24l=[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8,9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],ee.t32l=[1,5,5,7,5,8,7,9,5,7,7,9,7,9,9,10],ee.t33l=[4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8],ee.ht=[new g(0,0,null,null),new g(2,0,ee.t1HB,ee.t1l),new g(3,0,ee.t2HB,ee.t2l),new g(3,0,ee.t3HB,ee.t3l),new g(0,0,null,null),new g(4,0,ee.t5HB,ee.t5l),new g(4,0,ee.t6HB,ee.t6l),new g(6,0,ee.t7HB,ee.t7l),new g(6,0,ee.t8HB,ee.t8l),new g(6,0,ee.t9HB,ee.t9l),new g(8,0,ee.t10HB,ee.t10l),new g(8,0,ee.t11HB,ee.t11l),new g(8,0,ee.t12HB,ee.t12l),new g(16,0,ee.t13HB,ee.t13l),new g(0,0,null,ee.t16_5l),new g(16,0,ee.t15HB,ee.t15l),new g(1,1,ee.t16HB,ee.t16l),new g(2,3,ee.t16HB,ee.t16l),new g(3,7,ee.t16HB,ee.t16l),new g(4,15,ee.t16HB,ee.t16l),new g(6,63,ee.t16HB,ee.t16l),new g(8,255,ee.t16HB,ee.t16l),new g(10,1023,ee.t16HB,ee.t16l),new g(13,8191,ee.t16HB,ee.t16l),new g(4,15,ee.t24HB,ee.t24l),new g(5,31,ee.t24HB,ee.t24l),new g(6,63,ee.t24HB,ee.t24l),new g(7,127,ee.t24HB,ee.t24l),new g(8,255,ee.t24HB,ee.t24l),new g(9,511,ee.t24HB,ee.t24l),new g(11,2047,ee.t24HB,ee.t24l),new g(13,8191,ee.t24HB,ee.t24l),new g(0,0,ee.t32HB,ee.t32l),new g(0,0,ee.t33HB,ee.t33l)],ee.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832,655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052,983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589,851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366],ee.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],ee.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],ee.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]],ee.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],ee.scfsi_band=[0,6,11,16,21],k.Q_MAX=257,k.Q_MAX2=116,k.LARGE_BITS=1e5,k.IXMAX_VAL=8206;var ae={};ae.SFBMAX=3*V.SBMAX_s,V.ENCDELAY=576,V.POSTDELAY=1152,V.MDCTDELAY=48,V.FFTOFFSET=224+V.MDCTDELAY,V.DECDELAY=528,V.SBLIMIT=32,V.CBANDS=64,V.SBPSY_l=21,V.SBPSY_s=12,V.SBMAX_l=22,V.SBMAX_s=13,V.PSFB21=6,V.PSFB12=6,V.BLKSIZE=1024,V.HBLKSIZE=V.BLKSIZE/2+1,V.BLKSIZE_s=256,V.HBLKSIZE_s=V.BLKSIZE_s/2+1,V.NORM_TYPE=0,V.START_TYPE=1,V.SHORT_TYPE=2,V.STOP_TYPE=3,V.MPG_MD_LR_LR=0,V.MPG_MD_LR_I=1,V.MPG_MD_MS_LR=2,V.MPG_MD_MS_I=3,V.fircoef=[-.1039435,-.1892065,5*-.0432472,-.155915,3.898045e-17,.0467745*5,.50455,.756825,.187098*5],X.MFSIZE=3456+V.ENCDELAY-V.MDCTDELAY,X.MAX_HEADER_BUF=256,X.MAX_BITS_PER_CHANNEL=4095,X.MAX_BITS_PER_GRANULE=7680,X.BPC=320,Z.RIFF=Q("RIFF"),Z.WAVE=Q("WAVE"),Z.fmt_=Q("fmt "),Z.data=Q("data"),Z.readHeader=function(e){var a=new Z,t=e.getUint32(0,!1);if(Z.RIFF==t){e.getUint32(4,!0);if(Z.WAVE==e.getUint32(8,!1)&&Z.fmt_==e.getUint32(12,!1)){var s=e.getUint32(16,!0),r=20;switch(s){case 16:case 18:a.channels=e.getUint16(r+2,!0),a.sampleRate=e.getUint32(r+4,!0);break;default:throw"extended fmt chunk not implemented"}r+=s;for(var n=Z.data,_=0;n!=t&&(t=e.getUint32(r,!1),_=e.getUint32(r+4,!0),n!=t);)r+=_+8;return a.dataLen=_,a.dataOffset=r+8,a}}},ae.SFBMAX=3*V.SBMAX_s,lamejs.Mp3Encoder=K,lamejs.WavHeader=Z}lamejs();