Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/ #ifdef __GNUC__ __attribute__((noreturn)) #endif #define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Minimum 16-bit value. */ #define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Minimum 32-bit value. */ #define IMIN(a,b) ((a) < (b) ? (a) : (b)) /**< Minimum int value. */ #ifdef FIXED_POINT #else #endif celt_assert(tmp<=32767); celt_assert(x2<=32766); c=0; do { } while (++ceBands[i+1]-m->eBands[i])<0); c=0; do { int tcount[3] = {0,0,0}; } while (++c0); /*M*(eBands[end]-eBands[end-1]) <= 8 assures this*/ c=0; do { } while (++c0); int N, int b, int spread, int B, int intensity, int tf_change, celt_norm *lowband, ec_ctx *ec, #ifdef RESYNTH int resynth = 1; #else int resynth = !encode; #endif c=0; do { } while (++c<1+stereo); N >>= 1; Y = X+N; split = 1; LM -= 1; if (B==1) fill = (fill&1)|(fill<<1); B = (B+1)>>1; fill &= ((1<>B)<<((B0>>1)&(stereo-1)); next_lowband2, ec, remaining_bits, LM, NULL, NULL, next_level, seed, MULT16_16_P15(gain,side), NULL, fill>>B)<<((B0>>1)&(stereo-1)); lowband, ec, remaining_bits, LM, next_lowband_out1, { cm = alg_quant(X, N, K, spread, B, ec #ifdef RESYNTH , gain #endif ); } else { } X[j] = (celt_norm)((opus_int32)*seed>>20); int shortBlocks, int spread, int dual_stereo, int intensity, int *tf_res, #ifdef RESYNTH int resynth = 1; #else int resynth = !encode; #endif y_cm |= collapse_masks[fold_i*C+C-1]; effective_lowband != -1 ? norm+effective_lowband : NULL, ec, &remaining_bits, LM, effective_lowband != -1 ? norm2+effective_lowband : NULL, ec, &remaining_bits, LM, effective_lowband != -1 ? norm+effective_lowband : NULL, ec, &remaining_bits, LM, int time_domain, int fold, int dual_stereo, int intensity, int *tf_res, #ifdef CUSTOM_MODES #define OPUS_CUSTOM_NOSTATIC #else #define OPUS_CUSTOM_NOSTATIC static inline #endif #ifdef CUSTOM_MODES celt_assert(0); #endif int force_intra; opus_val32 preemph_memE[2]; opus_val32 preemph_memD[2]; OPUS_CUSTOM_NOSTATIC int opus_custom_encoder_get_size(const CELTMode *mode, int channels) int celt_encoder_init(CELTEncoder *st, opus_int32 sampling_rate, int channels) return OPUS_OK; OPUS_CUSTOM_NOSTATIC int opus_custom_encoder_init(CELTEncoder *st, const CELTMode *mode, int channels) st->force_intra = 0; { x = PSHR32(x, SIG_SHIFT); x = MAX32(x, -32768); x = MIN32(x, 32767); mem1 = x - .5f*y; c=0; do { } while (++c QCONST16(.995f,10)) else if (sum > QCONST16(.92f,10)) else if (sum > QCONST16(.8f,10)) c=0; do { for (i=0;imode->maxLM;LM++) if (LM>st->mode->maxLM) #ifdef CUSTOM_MODES #else celt_assert(st->signalling==0); #endif #ifdef CUSTOM_MODES #endif This is clamped to ensure we use at least two bytes if the encoder max_allowed = IMIN(IMAX(tell==1?2:0, (vbr_rate+vbr_bound-st->vbr_reservoir)>>(BITRES+3)), c=0; do { if (!(x==x)) x = 0; /*In VBR mode there is no need to send more than the minimum. */ if (vbr_rate>0) { total_bits=nbCompressedBytes*8; nbAvailableBytes=2; } qg = (int)floor(.5f+gain1*32/3)-1; c=0; do { tf_select = tf_analysis(st->mode, effEnd, C, isTransient, tf_res, effectiveBytes, X, N, LM, &tf_sum); for (i=st->start+1;iend-1;i++) st->end, LM, C, N); /* Variable bitrate */ { /* The target rate in 8th bits per frame */ int lm_diff = st->mode->maxLM - LM; target = vbr_rate + (st->vbr_offset>>lm_diff) - ((40*C+20)<>(BITRES+3)) + 2 - nbFilledBytes; nbAvailableBytes = (target+(1<<(BITRES+2)))>>(BITRES+3); nbAvailableBytes = IMAX(min_allowed,nbAvailableBytes); nbAvailableBytes = IMIN(nbCompressedBytes,nbAvailableBytes+nbFilledBytes) - nbFilledBytes; /* By how much did we "miss" the target on that frame */ delta = target - vbr_rate; target=nbAvailableBytes<<(BITRES+3); /*If the frame is silent we don't adjust our drift, otherwise the encoder will shoot to very high rates after hitting a span of silence, but we do allow the bitres to refill. This means that we'll undershoot our target in CVBR/VBR modes on files with lots of silence. */ if(silence) { nbAvailableBytes = 2; target = 2*8<vbr_count < 970) alpha = celt_rcp(SHL32(EXTEND32(st->vbr_count+20),16)); int adjust = (-st->vbr_reservoir)/(8<vbr_reservoir = 0; nbCompressedBytes = IMIN(nbCompressedBytes,nbAvailableBytes+nbFilledBytes); } bits = (((opus_int32)nbCompressedBytes*8)<=2&&bits>=((LM+2)<spread_decision, dual_stereo, intensity, tf_res, if (silence) { for (i=0;imode->nbEBands;i++) oldBandE[i] = -QCONST16(28.f,DB_SHIFT); } c=0; do while (++coverlap; c=0; do { #ifdef CUSTOM_MODES #endif #ifdef FIXED_POINT #ifndef DISABLE_FLOAT_API { if (pcm==NULL) for (j=0;j2) goto bad_arg; { goto bad_arg; } break; st->tonal_average = 256; #ifdef CUSTOM_MODES #endif OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_get_size(const CELTMode *mode, int channels) int celt_decoder_init(CELTDecoder *st, opus_int32 sampling_rate, int channels) OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_init(CELTDecoder *st, const CELTMode *mode, int channels) if (st==NULL) c=0; do { } while (++c>20); opus_val16 mem[LPC_ORDER]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; c=0; do { #ifdef CUSTOM_MODES #else { #endif c=0; do bits = (((opus_int32)len*8)<=2&&bits>=((LM+2)<st->mode->nbEBands) /** Controls the use of interframe prediction. 0=Independent frames 1=Short term interframe prediction allowed 2=Long term prediction allowed */ int celt_encoder_init(CELTEncoder *st, opus_int32 sampling_rate, int channels); int celt_decoder_init(CELTDecoder *st, opus_int32 sampling_rate, int channels); if (error<.001f*ac[0]) celt_assert(n>0); celt_assert(overlap>=0); if(val&(val-1)){ if(l>16)val=(val>>(l-16))+(((val&((1<<(l-16))-1))+(1<<(l-16))-1)>>(l-16)); l=(l-1)<>b; val=(val*val+0x7FFF)>>15; else return (l-1)<>shift]; ((_a*(_b&mask)+one-(_c&mask))>>shift)-1)*inv&MASK32; /*_k>52 doesn't work in the false branch due to the limits of INV_TABLE, but _k isn't tested here because k<=52 for n=7*/ if(_n<=6) _u[k]=um1=imusdiv32odd(n2m1,um2,um1,(k-1)>>1)+um1; #ifndef SMALL_FOOTPRINT _y[0]=(_k+s)^s; _k=(_i+1)>>1; _y[0]=(yj+s)^s; _k=_i>0?(isqrt32(2*_i-1)+1)>>1:0; _y[0]=(yj+s)^s; _k=(kl+kr)>>1; _y[0]=(yj+s)^s; _y[j]=(yj+s)^s; static inline opus_uint32 icwrs(int _n,int _k,opus_uint32 *_nc,const int *_y, switch(_n){ #endif #ifndef SMALL_FOOTPRINT #endif switch(_n){ #endif #ifndef SMALL_FOOTPRINT #endif #define FLOAT "%#0.8gf" fprintf(file, "/* The contents of this file was automatically generated by dump_modes.c\n"); fprintf(file, " with arguments:"); for (i=0;iFs,mode->shortMdctSize*mode->nbShortMdcts); } fprintf(file, "\n It contains static definitions for some pre-defined modes. */\n"); fprintf (file, WORD16 ",%c", mode->window[j],(j+6)%5==0?'\n':' '); fprintf (file, "%d,%c", mode->cache.index[j],(j+16)%15==0?'\n':' '); fprintf (file, "%d,%c", mode->cache.bits[j],(j+16)%15==0?'\n':' '); fprintf (file, "%d,%c", mode->cache.caps[j],(j+16)%15==0?'\n':' '); fprintf (file, "{" WORD16 ", " WORD16 "},%c", mode->mdct.kfft[0]->twiddles[j].r, mode->mdct.kfft[0]->twiddles[j].i,(j+3)%2==0?'\n':' '); fprintf (file, "%d,%c", mode->mdct.kfft[k]->bitrev[j],(j+16)%15==0?'\n':' '); fprintf (file, "%0.9ff,\t/* scale */\n", mode->mdct.kfft[k]->scale); fprintf (file, WORD16 ",%c", mode->mdct.trig[j],(j+6)%5==0?'\n':' '); fprintf(file, "%d,\t/* maxLM */\n", mode->maxLM); fprintf(file, "%d,\t/* nbShortMdcts */\n", mode->nbShortMdcts); fprintf(file, "%d,\t/* shortMdctSize */\n", mode->shortMdctSize); fprintf(file, "logN%d,\t/* logN */\n", framerate); fprintf(file, "window%d,\t/* window */\n", mode->overlap); # define EC_MINI(_a,_b) ((_a)+(((_b)-(_a))&-((_b)<(_a)))) r=_this->rng>>(l-16); sym=(sym<rem)>>(EC_SYM_BITS-EC_CODE_EXTRA); _this->val=((_this->val<val=_this->rng-1-(_this->rem>>(EC_SYM_BITS-EC_CODE_EXTRA)); return (1U<<_bits)-EC_MINI(s+1U,1U<<_bits); if((unsigned)available<_bits){ ret=(opus_uint32)window&(((opus_uint32)1<<_bits)-1U); sym=(EC_SYM_MAX+carry)&EC_SYM_MAX; _this->val=(_this->val<val+=_this->rng-IMUL32(r,((1U<<_bits)-_fl)); else _this->rng-=IMUL32(r,((1U<<_bits)-_fh)); ec_enc_bits(_this,_fl&(((opus_uint32)1<0); mask=((1<<_nbits)-1)<buf[0]=(unsigned char)((_this->buf[0]&~mask)|_val<rem=(_this->rem&~mask)|_val<val=(_this->val&~((opus_uint32)mask<>l; end=(_this->val+msk)&~msk; end=(_this->val+msk)&~msk; end=(end<buf[_this->storage-_this->end_offs-1]|=(unsigned char)window; This must be between 1 and 25, inclusive.*/ #if (defined(__GNUC__) && defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) /* supported by gcc in C99 mode, but not by all other compilers */ #endif /* __STDC_VERSION__ >= 199901L */ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/ int m, int i, k; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/ /*typedef struct kiss_fft_state* kiss_fft_cfg;*/ static unsigned ec_laplace_get_freq1(unsigned fs0, int decay) unsigned ft; void ec_laplace_encode(ec_enc *enc, int *value, unsigned fs, int decay) val = (val+s)^s; if (!fs) *value = (i+di+s)^s; int ec_laplace_decode(ec_dec *dec, unsigned fs, int decay) unsigned fm; void ec_laplace_encode(ec_enc *enc, int *value, unsigned fs, int decay); int ec_laplace_decode(ec_dec *dec, unsigned fs, int decay); bshift=(EC_ILOG(_val)-1)>>1; t=(((opus_uint32)g<<1)+b)<>1; #endif if (l->trig==NULL) trig[i] = (kiss_twiddle_scalar)cos(2*PI*i/N); sine = (kiss_twiddle_scalar)2*PI*(.125f)/N; sine = (kiss_twiddle_scalar)2*PI*(.125f)/N; # define EC_CODE_TOP (((opus_uint32)1U)<<(EC_CODE_BITS-1)) /* Find the number of critical bands supported by our sampling rate */ for (nBark=1;nBark= Fs) break; for (lin=0;linallocVectors==NULL) goto failure; if (window==NULL) goto failure; if (error) if (mode!=NULL) return NULL; #ifdef CUSTOM_MODES if (mode == NULL) return; int i; for (i=0;i0); celt_assert(max_pitch>0); #ifdef FIXED_POINT #endif find_best_pitch(xcorr, y_lp4, len>>2, max_pitch>>2, best_pitch #ifdef FIXED_POINT , 0, maxcorr #endif ); #ifdef FIXED_POINT #endif #ifdef FIXED_POINT #endif find_best_pitch(xcorr, y, len>>1, max_pitch>>1, best_pitch #ifdef FIXED_POINT , shift, maxcorr #endif ); int k, i, T, T0; g = g0 = xy/celt_sqrt(1+xx*yy); g1 = xy/celt_sqrt(1+2.f*xx*1.f*yy); c=0; do { } while (++c tell_intra))) OPUS_COPY(intra_buf, intra_bits, nintra_bytes - nstart_bytes); /* It would be better to express this invariant as a test on C at function entry, but that isn't enough to make the static analyzer happy. */ celt_assert(c<2); q = (opus_val32)SHL32(EXTEND32(qi),DB_SHIFT); celt_log2(SHL32(bandE[i+c*m->nbEBands],2)) { { { { } } } /* Even-sized bands bigger than N=2 can be split one more time. As of commit 44203907 all bands >1 are even, including custom modes.*/ if (N0 > 2) offset = ((m->logN[j]+((LM0+k)<>1)-QTHETA_OFFSET; offset = ((m->logN[j]+(i<>1)-(N==2?QTHETA_OFFSET_TWOPHASE:QTHETA_OFFSET); offset = ((m->logN[j] + (i<>1)-FINE_OFFSET; den = (ndof-1)<eBands[j+1]-m->eBands[j])<1; if (j<=skip_start) ebits[j] = bits[j] >> stereo >> BITRES; extra_fine = IMIN(excess>>(stereo+BITRES),MAX_FINE_BITS-ebits[j]); ebits[j] = bits[j] >> stereo >> BITRES; int skip_start; skip_start = start; int done = 0; for (j=end;j-->start;) { done = 1; /* Don't allocate more than we can actually use */ } else { psum += C<0) skip_start = j; #ifdef CELT_C char *global_stack=0; #else extern char *global_stack; #ifdef CELT_C char *global_stack_top=0; #else extern char *global_stack_top; #define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1)) #define PUSH(stack, size, type) (VALGRIND_MAKE_MEM_NOACCESS(stack, global_stack_top-stack),ALIGN((stack),sizeof(type)/sizeof(char)),VALGRIND_MAKE_MEM_UNDEFINED(stack, ((size)*sizeof(type)/sizeof(char))),(stack)+=(2*(size)*sizeof(type)/sizeof(char)),(type*)((stack)-(2*(size)*sizeof(type)/sizeof(char)))) #define RESTORE_STACK ((global_stack = _saved_stack),VALGRIND_MAKE_MEM_NOACCESS(global_stack, global_stack_top-global_stack)) /* The contents of this file was automatically generated by dump_modes.c with arguments: 48000 960 It contains static definitions for some pre-defined modes. */ 2, 20, 55, 108, 178, 266, 372, 494, 635, 792, 966, 1157, 1365, 1590, 1831, 2089, 2362, 2651, 2956, 3276, 3611, 3961, 4325, 4703, 5094, 5499, 5916, 6346, 6788, 7241, 7705, 8179, 8663, 9156, 9657, 10167, 10684, 11207, 11736, 12271, 12810, 13353, 13899, 14447, 14997, 15547, 16098, 16648, 17197, 17744, 18287, 18827, 19363, 19893, 20418, 20936, 21447, 21950, 22445, 22931, 23407, 23874, 24330, 24774, 25208, 25629, 26039, 26435, 26819, 27190, 27548, 27893, 28224, 28541, 28845, 29135, 29411, 29674, 29924, 30160, 30384, 30594, 30792, 30977, 31151, 31313, 31463, 31602, 31731, 31849, 31958, 32057, 32148, 32229, 32303, 32370, 32429, 32481, 32528, 32568, 32604, 32634, 32661, 32683, 32701, 32717, 32729, 32740, 32748, 32754, 32758, 32762, 32764, 32766, 32767, 32767, 32767, 32767, 32767, 32767, }; -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 41, 41, 41, 82, 82, 123, 164, 200, 222, 0, 0, 0, 0, 0, 0, 0, 0, 41, 41, 41, 41, 123, 123, 123, 164, 164, 240, 266, 283, 295, 41, 41, 41, 41, 41, 41, 41, 41, 123, 123, 123, 123, 240, 240, 240, 266, 266, 305, 318, 328, 336, 123, 123, 123, 123, 123, 123, 123, 123, 240, 240, 240, 240, 305, 305, 305, 318, 318, 343, 351, 358, 364, 240, 240, 240, 240, 240, 240, 240, 240, 305, 305, 305, 305, 343, 343, 343, 351, 351, 370, 376, 382, 387, }; 40, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 40, 15, 23, 28, 31, 34, 36, 38, 39, 41, 42, 43, 44, 45, 46, 47, 47, 49, 50, 51, 52, 53, 54, 55, 55, 57, 58, 59, 60, 61, 62, 63, 63, 65, 66, 67, 68, 69, 70, 71, 71, 40, 20, 33, 41, 48, 53, 57, 61, 64, 66, 69, 71, 73, 75, 76, 78, 80, 82, 85, 87, 89, 91, 92, 94, 96, 98, 101, 103, 105, 107, 108, 110, 112, 114, 117, 119, 121, 123, 124, 126, 128, 40, 23, 39, 51, 60, 67, 73, 79, 83, 87, 91, 94, 97, 100, 102, 105, 107, 111, 115, 118, 121, 124, 126, 129, 131, 135, 139, 142, 145, 148, 150, 153, 155, 159, 163, 166, 169, 172, 174, 177, 179, 35, 28, 49, 65, 78, 89, 99, 107, 114, 120, 126, 132, 136, 141, 145, 149, 153, 159, 165, 171, 176, 180, 185, 189, 192, 199, 205, 211, 216, 220, 225, 229, 232, 239, 245, 251, 21, 33, 58, 79, 97, 112, 125, 137, 148, 157, 166, 174, 182, 189, 195, 201, 207, 217, 227, 235, 243, 251, 17, 35, 63, 86, 106, 123, 139, 152, 165, 177, 187, 197, 206, 214, 222, 230, 237, 250, 25, 31, 55, 75, 91, 105, 117, 128, 138, 146, 154, 161, 168, 174, 180, 185, 190, 200, 208, 215, 222, 229, 235, 240, 245, 255, 16, 36, 65, 89, 110, 128, 144, 159, 173, 185, 196, 207, 217, 226, 234, 242, 250, 11, 41, 74, 103, 128, 151, 172, 191, 209, 225, 241, 255, 9, 43, 79, 110, 138, 163, 186, 207, 227, 246, 12, 39, 71, 99, 123, 144, 164, 182, 198, 214, 228, 241, 253, 9, 44, 81, 113, 142, 168, 192, 214, 235, 255, 7, 49, 90, 127, 160, 191, 220, 247, 6, 51, 95, 134, 170, 203, 234, 7, 47, 87, 123, 155, 184, 212, 237, 6, 52, 97, 137, 174, 208, 240, 5, 57, 106, 151, 192, 231, 5, 59, 111, 158, 202, 243, 5, 55, 103, 147, 187, 224, 5, 60, 113, 161, 206, 248, 4, 65, 122, 175, 224, 4, 67, 127, 182, 234, }; 224, 224, 224, 224, 224, 224, 224, 224, 160, 160, 160, 160, 185, 185, 185, 178, 178, 168, 134, 61, 37, 224, 224, 224, 224, 224, 224, 224, 224, 240, 240, 240, 240, 207, 207, 207, 198, 198, 183, 144, 66, 40, 160, 160, 160, 160, 160, 160, 160, 160, 185, 185, 185, 185, 193, 193, 193, 183, 183, 172, 138, 64, 38, 240, 240, 240, 240, 240, 240, 240, 240, 207, 207, 207, 207, 204, 204, 204, 193, 193, 180, 143, 66, 40, 185, 185, 185, 185, 185, 185, 185, 185, 193, 193, 193, 193, 193, 193, 193, 183, 183, 172, 138, 65, 39, 207, 207, 207, 207, 207, 207, 207, 207, 204, 204, 204, 204, 201, 201, 201, 188, 188, 176, 141, 66, 40, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, 194, 194, 184, 184, 173, 139, 65, 39, 204, 204, 204, 204, 204, 204, 204, 204, 201, 201, 201, 201, 198, 198, 198, 187, 187, 175, 140, 66, 40, }; {32767, 0}, {32766, -429}, {32757, -858}, {32743, -1287}, {32724, -1715}, {32698, -2143}, {32667, -2570}, {32631, -2998}, {32588, -3425}, {32541, -3851}, {32488, -4277}, {32429, -4701}, {32364, -5125}, {32295, -5548}, {32219, -5971}, {32138, -6393}, {32051, -6813}, {31960, -7231}, {31863, -7650}, {31760, -8067}, {31652, -8481}, {31539, -8895}, {31419, -9306}, {31294, -9716}, {31165, -10126}, {31030, -10532}, {30889, -10937}, {30743, -11340}, {30592, -11741}, {30436, -12141}, {30274, -12540}, {30107, -12935}, {29936, -13328}, {29758, -13718}, {29577, -14107}, {29390, -14493}, {29197, -14875}, {29000, -15257}, {28797, -15635}, {28590, -16010}, {28379, -16384}, {28162, -16753}, {27940, -17119}, {27714, -17484}, {27482, -17845}, {27246, -18205}, {27006, -18560}, {26760, -18911}, {26510, -19260}, {26257, -19606}, {25997, -19947}, {25734, -20286}, {25466, -20621}, {25194, -20952}, {24918, -21281}, {24637, -21605}, {24353, -21926}, {24063, -22242}, {23770, -22555}, {23473, -22865}, {23171, -23171}, {22866, -23472}, {22557, -23769}, {22244, -24063}, {21927, -24352}, {21606, -24636}, {21282, -24917}, {20954, -25194}, {20622, -25465}, {20288, -25733}, {19949, -25997}, {19607, -26255}, {19261, -26509}, {18914, -26760}, {18561, -27004}, {18205, -27246}, {17846, -27481}, {17485, -27713}, {17122, -27940}, {16755, -28162}, {16385, -28378}, {16012, -28590}, {15636, -28797}, {15258, -28999}, {14878, -29197}, {14494, -29389}, {14108, -29576}, {13720, -29757}, {13329, -29934}, {12937, -30107}, {12540, -30274}, {12142, -30435}, {11744, -30592}, {11342, -30743}, {10939, -30889}, {10534, -31030}, {10127, -31164}, {9718, -31294}, {9307, -31418}, {8895, -31537}, {8482, -31652}, {8067, -31759}, {7650, -31862}, {7233, -31960}, {6815, -32051}, {6393, -32138}, {5973, -32219}, {5549, -32294}, {5127, -32364}, {4703, -32429}, {4278, -32487}, {3852, -32541}, {3426, -32588}, {2999, -32630}, {2572, -32667}, {2144, -32698}, {1716, -32724}, {1287, -32742}, {860, -32757}, {430, -32766}, {0, -32767}, {-429, -32766}, {-858, -32757}, {-1287, -32743}, {-1715, -32724}, {-2143, -32698}, {-2570, -32667}, {-2998, -32631}, {-3425, -32588}, {-3851, -32541}, {-4277, -32488}, {-4701, -32429}, {-5125, -32364}, {-5548, -32295}, {-5971, -32219}, {-6393, -32138}, {-6813, -32051}, {-7231, -31960}, {-7650, -31863}, {-8067, -31760}, {-8481, -31652}, {-8895, -31539}, {-9306, -31419}, {-9716, -31294}, {-10126, -31165}, {-10532, -31030}, {-10937, -30889}, {-11340, -30743}, {-11741, -30592}, {-12141, -30436}, {-12540, -30274}, {-12935, -30107}, {-13328, -29936}, {-13718, -29758}, {-14107, -29577}, {-14493, -29390}, {-14875, -29197}, {-15257, -29000}, {-15635, -28797}, {-16010, -28590}, {-16384, -28379}, {-16753, -28162}, {-17119, -27940}, {-17484, -27714}, {-17845, -27482}, {-18205, -27246}, {-18560, -27006}, {-18911, -26760}, {-19260, -26510}, {-19606, -26257}, {-19947, -25997}, {-20286, -25734}, {-20621, -25466}, {-20952, -25194}, {-21281, -24918}, {-21605, -24637}, {-21926, -24353}, {-22242, -24063}, {-22555, -23770}, {-22865, -23473}, {-23171, -23171}, {-23472, -22866}, {-23769, -22557}, {-24063, -22244}, {-24352, -21927}, {-24636, -21606}, {-24917, -21282}, {-25194, -20954}, {-25465, -20622}, {-25733, -20288}, {-25997, -19949}, {-26255, -19607}, {-26509, -19261}, {-26760, -18914}, {-27004, -18561}, {-27246, -18205}, {-27481, -17846}, {-27713, -17485}, {-27940, -17122}, {-28162, -16755}, {-28378, -16385}, {-28590, -16012}, {-28797, -15636}, {-28999, -15258}, {-29197, -14878}, {-29389, -14494}, {-29576, -14108}, {-29757, -13720}, {-29934, -13329}, {-30107, -12937}, {-30274, -12540}, {-30435, -12142}, {-30592, -11744}, {-30743, -11342}, {-30889, -10939}, {-31030, -10534}, {-31164, -10127}, {-31294, -9718}, {-31418, -9307}, {-31537, -8895}, {-31652, -8482}, {-31759, -8067}, {-31862, -7650}, {-31960, -7233}, {-32051, -6815}, {-32138, -6393}, {-32219, -5973}, {-32294, -5549}, {-32364, -5127}, {-32429, -4703}, {-32487, -4278}, {-32541, -3852}, {-32588, -3426}, {-32630, -2999}, {-32667, -2572}, {-32698, -2144}, {-32724, -1716}, {-32742, -1287}, {-32757, -860}, {-32766, -430}, {-32767, 0}, {-32766, 429}, {-32757, 858}, {-32743, 1287}, {-32724, 1715}, {-32698, 2143}, {-32667, 2570}, {-32631, 2998}, {-32588, 3425}, {-32541, 3851}, {-32488, 4277}, {-32429, 4701}, {-32364, 5125}, {-32295, 5548}, {-32219, 5971}, {-32138, 6393}, {-32051, 6813}, {-31960, 7231}, {-31863, 7650}, {-31760, 8067}, {-31652, 8481}, {-31539, 8895}, {-31419, 9306}, {-31294, 9716}, {-31165, 10126}, {-31030, 10532}, {-30889, 10937}, {-30743, 11340}, {-30592, 11741}, {-30436, 12141}, {-30274, 12540}, {-30107, 12935}, {-29936, 13328}, {-29758, 13718}, {-29577, 14107}, {-29390, 14493}, {-29197, 14875}, {-29000, 15257}, {-28797, 15635}, {-28590, 16010}, {-28379, 16384}, {-28162, 16753}, {-27940, 17119}, {-27714, 17484}, {-27482, 17845}, {-27246, 18205}, {-27006, 18560}, {-26760, 18911}, {-26510, 19260}, {-26257, 19606}, {-25997, 19947}, {-25734, 20286}, {-25466, 20621}, {-25194, 20952}, {-24918, 21281}, {-24637, 21605}, {-24353, 21926}, {-24063, 22242}, {-23770, 22555}, {-23473, 22865}, {-23171, 23171}, {-22866, 23472}, {-22557, 23769}, {-22244, 24063}, {-21927, 24352}, {-21606, 24636}, {-21282, 24917}, {-20954, 25194}, {-20622, 25465}, {-20288, 25733}, {-19949, 25997}, {-19607, 26255}, {-19261, 26509}, {-18914, 26760}, {-18561, 27004}, {-18205, 27246}, {-17846, 27481}, {-17485, 27713}, {-17122, 27940}, {-16755, 28162}, {-16385, 28378}, {-16012, 28590}, {-15636, 28797}, {-15258, 28999}, {-14878, 29197}, {-14494, 29389}, {-14108, 29576}, {-13720, 29757}, {-13329, 29934}, {-12937, 30107}, {-12540, 30274}, {-12142, 30435}, {-11744, 30592}, {-11342, 30743}, {-10939, 30889}, {-10534, 31030}, {-10127, 31164}, {-9718, 31294}, {-9307, 31418}, {-8895, 31537}, {-8482, 31652}, {-8067, 31759}, {-7650, 31862}, {-7233, 31960}, {-6815, 32051}, {-6393, 32138}, {-5973, 32219}, {-5549, 32294}, {-5127, 32364}, {-4703, 32429}, {-4278, 32487}, {-3852, 32541}, {-3426, 32588}, {-2999, 32630}, {-2572, 32667}, {-2144, 32698}, {-1716, 32724}, {-1287, 32742}, {-860, 32757}, {-430, 32766}, {0, 32767}, {429, 32766}, {858, 32757}, {1287, 32743}, {1715, 32724}, {2143, 32698}, {2570, 32667}, {2998, 32631}, {3425, 32588}, {3851, 32541}, {4277, 32488}, {4701, 32429}, {5125, 32364}, {5548, 32295}, {5971, 32219}, {6393, 32138}, {6813, 32051}, {7231, 31960}, {7650, 31863}, {8067, 31760}, {8481, 31652}, {8895, 31539}, {9306, 31419}, {9716, 31294}, {10126, 31165}, {10532, 31030}, {10937, 30889}, {11340, 30743}, {11741, 30592}, {12141, 30436}, {12540, 30274}, {12935, 30107}, {13328, 29936}, {13718, 29758}, {14107, 29577}, {14493, 29390}, {14875, 29197}, {15257, 29000}, {15635, 28797}, {16010, 28590}, {16384, 28379}, {16753, 28162}, {17119, 27940}, {17484, 27714}, {17845, 27482}, {18205, 27246}, {18560, 27006}, {18911, 26760}, {19260, 26510}, {19606, 26257}, {19947, 25997}, {20286, 25734}, {20621, 25466}, {20952, 25194}, {21281, 24918}, {21605, 24637}, {21926, 24353}, {22242, 24063}, {22555, 23770}, {22865, 23473}, {23171, 23171}, {23472, 22866}, {23769, 22557}, {24063, 22244}, {24352, 21927}, {24636, 21606}, {24917, 21282}, {25194, 20954}, {25465, 20622}, {25733, 20288}, {25997, 19949}, {26255, 19607}, {26509, 19261}, {26760, 18914}, {27004, 18561}, {27246, 18205}, {27481, 17846}, {27713, 17485}, {27940, 17122}, {28162, 16755}, {28378, 16385}, {28590, 16012}, {28797, 15636}, {28999, 15258}, {29197, 14878}, {29389, 14494}, {29576, 14108}, {29757, 13720}, {29934, 13329}, {30107, 12937}, {30274, 12540}, {30435, 12142}, {30592, 11744}, {30743, 11342}, {30889, 10939}, {31030, 10534}, {31164, 10127}, {31294, 9718}, {31418, 9307}, {31537, 8895}, {31652, 8482}, {31759, 8067}, {31862, 7650}, {31960, 7233}, {32051, 6815}, {32138, 6393}, {32219, 5973}, {32294, 5549}, {32364, 5127}, {32429, 4703}, {32487, 4278}, {32541, 3852}, {32588, 3426}, {32630, 2999}, {32667, 2572}, {32698, 2144}, {32724, 1716}, {32742, 1287}, {32757, 860}, {32766, 430}, }; 0, 120, 240, 360, 30, 150, 270, 390, 60, 180, 300, 420, 90, 210, 330, 450, 15, 135, 255, 375, 45, 165, 285, 405, 75, 195, 315, 435, 105, 225, 345, 465, 5, 125, 245, 365, 35, 155, 275, 395, 65, 185, 305, 425, 95, 215, 335, 455, 20, 140, 260, 380, 50, 170, 290, 410, 80, 200, 320, 440, 110, 230, 350, 470, 10, 130, 250, 370, 40, 160, 280, 400, 70, 190, 310, 430, 100, 220, 340, 460, 25, 145, 265, 385, 55, 175, 295, 415, 85, 205, 325, 445, 115, 235, 355, 475, 1, 121, 241, 361, 31, 151, 271, 391, 61, 181, 301, 421, 91, 211, 331, 451, 16, 136, 256, 376, 46, 166, 286, 406, 76, 196, 316, 436, 106, 226, 346, 466, 6, 126, 246, 366, 36, 156, 276, 396, 66, 186, 306, 426, 96, 216, 336, 456, 21, 141, 261, 381, 51, 171, 291, 411, 81, 201, 321, 441, 111, 231, 351, 471, 11, 131, 251, 371, 41, 161, 281, 401, 71, 191, 311, 431, 101, 221, 341, 461, 26, 146, 266, 386, 56, 176, 296, 416, 86, 206, 326, 446, 116, 236, 356, 476, 2, 122, 242, 362, 32, 152, 272, 392, 62, 182, 302, 422, 92, 212, 332, 452, 17, 137, 257, 377, 47, 167, 287, 407, 77, 197, 317, 437, 107, 227, 347, 467, 7, 127, 247, 367, 37, 157, 277, 397, 67, 187, 307, 427, 97, 217, 337, 457, 22, 142, 262, 382, 52, 172, 292, 412, 82, 202, 322, 442, 112, 232, 352, 472, 12, 132, 252, 372, 42, 162, 282, 402, 72, 192, 312, 432, 102, 222, 342, 462, 27, 147, 267, 387, 57, 177, 297, 417, 87, 207, 327, 447, 117, 237, 357, 477, 3, 123, 243, 363, 33, 153, 273, 393, 63, 183, 303, 423, 93, 213, 333, 453, 18, 138, 258, 378, 48, 168, 288, 408, 78, 198, 318, 438, 108, 228, 348, 468, 8, 128, 248, 368, 38, 158, 278, 398, 68, 188, 308, 428, 98, 218, 338, 458, 23, 143, 263, 383, 53, 173, 293, 413, 83, 203, 323, 443, 113, 233, 353, 473, 13, 133, 253, 373, 43, 163, 283, 403, 73, 193, 313, 433, 103, 223, 343, 463, 28, 148, 268, 388, 58, 178, 298, 418, 88, 208, 328, 448, 118, 238, 358, 478, 4, 124, 244, 364, 34, 154, 274, 394, 64, 184, 304, 424, 94, 214, 334, 454, 19, 139, 259, 379, 49, 169, 289, 409, 79, 199, 319, 439, 109, 229, 349, 469, 9, 129, 249, 369, 39, 159, 279, 399, 69, 189, 309, 429, 99, 219, 339, 459, 24, 144, 264, 384, 54, 174, 294, 414, 84, 204, 324, 444, 114, 234, 354, 474, 14, 134, 254, 374, 44, 164, 284, 404, 74, 194, 314, 434, 104, 224, 344, 464, 29, 149, 269, 389, 59, 179, 299, 419, 89, 209, 329, 449, 119, 239, 359, 479, }; 0, 60, 120, 180, 15, 75, 135, 195, 30, 90, 150, 210, 45, 105, 165, 225, 5, 65, 125, 185, 20, 80, 140, 200, 35, 95, 155, 215, 50, 110, 170, 230, 10, 70, 130, 190, 25, 85, 145, 205, 40, 100, 160, 220, 55, 115, 175, 235, 1, 61, 121, 181, 16, 76, 136, 196, 31, 91, 151, 211, 46, 106, 166, 226, 6, 66, 126, 186, 21, 81, 141, 201, 36, 96, 156, 216, 51, 111, 171, 231, 11, 71, 131, 191, 26, 86, 146, 206, 41, 101, 161, 221, 56, 116, 176, 236, 2, 62, 122, 182, 17, 77, 137, 197, 32, 92, 152, 212, 47, 107, 167, 227, 7, 67, 127, 187, 22, 82, 142, 202, 37, 97, 157, 217, 52, 112, 172, 232, 12, 72, 132, 192, 27, 87, 147, 207, 42, 102, 162, 222, 57, 117, 177, 237, 3, 63, 123, 183, 18, 78, 138, 198, 33, 93, 153, 213, 48, 108, 168, 228, 8, 68, 128, 188, 23, 83, 143, 203, 38, 98, 158, 218, 53, 113, 173, 233, 13, 73, 133, 193, 28, 88, 148, 208, 43, 103, 163, 223, 58, 118, 178, 238, 4, 64, 124, 184, 19, 79, 139, 199, 34, 94, 154, 214, 49, 109, 169, 229, 9, 69, 129, 189, 24, 84, 144, 204, 39, 99, 159, 219, 54, 114, 174, 234, 14, 74, 134, 194, 29, 89, 149, 209, 44, 104, 164, 224, 59, 119, 179, 239, }; 0, 30, 60, 90, 15, 45, 75, 105, 5, 35, 65, 95, 20, 50, 80, 110, 10, 40, 70, 100, 25, 55, 85, 115, 1, 31, 61, 91, 16, 46, 76, 106, 6, 36, 66, 96, 21, 51, 81, 111, 11, 41, 71, 101, 26, 56, 86, 116, 2, 32, 62, 92, 17, 47, 77, 107, 7, 37, 67, 97, 22, 52, 82, 112, 12, 42, 72, 102, 27, 57, 87, 117, 3, 33, 63, 93, 18, 48, 78, 108, 8, 38, 68, 98, 23, 53, 83, 113, 13, 43, 73, 103, 28, 58, 88, 118, 4, 34, 64, 94, 19, 49, 79, 109, 9, 39, 69, 99, 24, 54, 84, 114, 14, 44, 74, 104, 29, 59, 89, 119, }; 0, 15, 30, 45, 5, 20, 35, 50, 10, 25, 40, 55, 1, 16, 31, 46, 6, 21, 36, 51, 11, 26, 41, 56, 2, 17, 32, 47, 7, 22, 37, 52, 12, 27, 42, 57, 3, 18, 33, 48, 8, 23, 38, 53, 13, 28, 43, 58, 4, 19, 34, 49, 9, 24, 39, 54, 14, 29, 44, 59, }; 32767, 32767, 32767, 32767, 32766, 32763, 32762, 32759, 32757, 32753, 32751, 32747, 32743, 32738, 32733, 32729, 32724, 32717, 32711, 32705, 32698, 32690, 32683, 32676, 32667, 32658, 32650, 32640, 32631, 32620, 32610, 32599, 32588, 32577, 32566, 32554, 32541, 32528, 32515, 32502, 32487, 32474, 32459, 32444, 32429, 32413, 32397, 32381, 32364, 32348, 32331, 32313, 32294, 32277, 32257, 32239, 32219, 32200, 32180, 32159, 32138, 32118, 32096, 32074, 32051, 32029, 32006, 31984, 31960, 31936, 31912, 31888, 31863, 31837, 31812, 31786, 31760, 31734, 31707, 31679, 31652, 31624, 31596, 31567, 31539, 31508, 31479, 31450, 31419, 31388, 31357, 31326, 31294, 31262, 31230, 31198, 31164, 31131, 31097, 31063, 31030, 30994, 30959, 30924, 30889, 30853, 30816, 30779, 30743, 30705, 30668, 30629, 30592, 30553, 30515, 30475, 30435, 30396, 30356, 30315, 30274, 30233, 30191, 30149, 30107, 30065, 30022, 29979, 29936, 29891, 29847, 29803, 29758, 29713, 29668, 29622, 29577, 29529, 29483, 29436, 29390, 29341, 29293, 29246, 29197, 29148, 29098, 29050, 29000, 28949, 28899, 28848, 28797, 28746, 28694, 28642, 28590, 28537, 28485, 28432, 28378, 28324, 28271, 28217, 28162, 28106, 28051, 27995, 27940, 27884, 27827, 27770, 27713, 27657, 27598, 27540, 27481, 27423, 27365, 27305, 27246, 27187, 27126, 27066, 27006, 26945, 26883, 26822, 26760, 26698, 26636, 26574, 26510, 26448, 26383, 26320, 26257, 26191, 26127, 26062, 25997, 25931, 25866, 25800, 25734, 25667, 25601, 25533, 25466, 25398, 25330, 25262, 25194, 25125, 25056, 24987, 24917, 24848, 24778, 24707, 24636, 24566, 24495, 24424, 24352, 24280, 24208, 24135, 24063, 23990, 23917, 23842, 23769, 23695, 23622, 23546, 23472, 23398, 23322, 23246, 23171, 23095, 23018, 22942, 22866, 22788, 22711, 22634, 22557, 22478, 22400, 22322, 22244, 22165, 22085, 22006, 21927, 21846, 21766, 21687, 21606, 21524, 21443, 21363, 21282, 21199, 21118, 21035, 20954, 20870, 20788, 20705, 20621, 20538, 20455, 20371, 20286, 20202, 20118, 20034, 19947, 19863, 19777, 19692, 19606, 19520, 19434, 19347, 19260, 19174, 19088, 18999, 18911, 18825, 18737, 18648, 18560, 18472, 18384, 18294, 18205, 18116, 18025, 17936, 17846, 17757, 17666, 17576, 17485, 17395, 17303, 17212, 17122, 17030, 16937, 16846, 16755, 16662, 16569, 16477, 16385, 16291, 16198, 16105, 16012, 15917, 15824, 15730, 15636, 15541, 15447, 15352, 15257, 15162, 15067, 14973, 14875, 14781, 14685, 14589, 14493, 14396, 14300, 14204, 14107, 14010, 13914, 13815, 13718, 13621, 13524, 13425, 13328, 13230, 13133, 13033, 12935, 12836, 12738, 12638, 12540, 12441, 12341, 12241, 12142, 12044, 11943, 11843, 11744, 11643, 11542, 11442, 11342, 11241, 11139, 11039, 10939, 10836, 10736, 10635, 10534, 10431, 10330, 10228, 10127, 10024, 9921, 9820, 9718, 9614, 9512, 9410, 9306, 9204, 9101, 8998, 8895, 8791, 8689, 8585, 8481, 8377, 8274, 8171, 8067, 7962, 7858, 7753, 7650, 7545, 7441, 7336, 7231, 7129, 7023, 6917, 6813, 6709, 6604, 6498, 6393, 6288, 6182, 6077, 5973, 5867, 5760, 5656, 5549, 5445, 5339, 5232, 5127, 5022, 4914, 4809, 4703, 4596, 4490, 4384, 4278, 4171, 4065, 3958, 3852, 3745, 3640, 3532, 3426, 3318, 3212, 3106, 2998, 2891, 2786, 2679, 2570, 2465, 2358, 2251, 2143, 2037, 1929, 1823, 1715, 1609, 1501, 1393, 1287, 1180, 1073, 964, 858, 751, 644, 535, 429, 322, 214, 107, 0, }; /* The contents of this file was automatically generated by dump_modes.c with arguments: 48000 960 It contains static definitions for some pre-defined modes. */ 6.7286966e-05f, 0.00060551348f, 0.0016815970f, 0.0032947962f, 0.0054439943f, 0.0081276923f, 0.011344001f, 0.015090633f, 0.019364886f, 0.024163635f, 0.029483315f, 0.035319905f, 0.041668911f, 0.048525347f, 0.055883718f, 0.063737999f, 0.072081616f, 0.080907428f, 0.090207705f, 0.099974111f, 0.11019769f, 0.12086883f, 0.13197729f, 0.14351214f, 0.15546177f, 0.16781389f, 0.18055550f, 0.19367290f, 0.20715171f, 0.22097682f, 0.23513243f, 0.24960208f, 0.26436860f, 0.27941419f, 0.29472040f, 0.31026818f, 0.32603788f, 0.34200931f, 0.35816177f, 0.37447407f, 0.39092462f, 0.40749142f, 0.42415215f, 0.44088423f, 0.45766484f, 0.47447104f, 0.49127978f, 0.50806798f, 0.52481261f, 0.54149077f, 0.55807973f, 0.57455701f, 0.59090049f, 0.60708841f, 0.62309951f, 0.63891306f, 0.65450896f, 0.66986776f, 0.68497077f, 0.69980010f, 0.71433873f, 0.72857055f, 0.74248043f, 0.75605424f, 0.76927895f, 0.78214257f, 0.79463430f, 0.80674445f, 0.81846456f, 0.82978733f, 0.84070669f, 0.85121779f, 0.86131698f, 0.87100183f, 0.88027111f, 0.88912479f, 0.89756398f, 0.90559094f, 0.91320904f, 0.92042270f, 0.92723738f, 0.93365955f, 0.93969656f, 0.94535671f, 0.95064907f, 0.95558353f, 0.96017067f, 0.96442171f, 0.96834849f, 0.97196334f, 0.97527906f, 0.97830883f, 0.98106616f, 0.98356480f, 0.98581869f, 0.98784191f, 0.98964856f, 0.99125274f, 0.99266849f, 0.99390969f, 0.99499004f, 0.99592297f, 0.99672162f, 0.99739874f, 0.99796667f, 0.99843728f, 0.99882195f, 0.99913147f, 0.99937606f, 0.99956527f, 0.99970802f, 0.99981248f, 0.99988613f, 0.99993565f, 0.99996697f, 0.99998518f, 0.99999457f, 0.99999859f, 0.99999982f, 1.0000000f, }; -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 41, 41, 41, 82, 82, 123, 164, 200, 222, 0, 0, 0, 0, 0, 0, 0, 0, 41, 41, 41, 41, 123, 123, 123, 164, 164, 240, 266, 283, 295, 41, 41, 41, 41, 41, 41, 41, 41, 123, 123, 123, 123, 240, 240, 240, 266, 266, 305, 318, 328, 336, 123, 123, 123, 123, 123, 123, 123, 123, 240, 240, 240, 240, 305, 305, 305, 318, 318, 343, 351, 358, 364, 240, 240, 240, 240, 240, 240, 240, 240, 305, 305, 305, 305, 343, 343, 343, 351, 351, 370, 376, 382, 387, }; 40, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 40, 15, 23, 28, 31, 34, 36, 38, 39, 41, 42, 43, 44, 45, 46, 47, 47, 49, 50, 51, 52, 53, 54, 55, 55, 57, 58, 59, 60, 61, 62, 63, 63, 65, 66, 67, 68, 69, 70, 71, 71, 40, 20, 33, 41, 48, 53, 57, 61, 64, 66, 69, 71, 73, 75, 76, 78, 80, 82, 85, 87, 89, 91, 92, 94, 96, 98, 101, 103, 105, 107, 108, 110, 112, 114, 117, 119, 121, 123, 124, 126, 128, 40, 23, 39, 51, 60, 67, 73, 79, 83, 87, 91, 94, 97, 100, 102, 105, 107, 111, 115, 118, 121, 124, 126, 129, 131, 135, 139, 142, 145, 148, 150, 153, 155, 159, 163, 166, 169, 172, 174, 177, 179, 35, 28, 49, 65, 78, 89, 99, 107, 114, 120, 126, 132, 136, 141, 145, 149, 153, 159, 165, 171, 176, 180, 185, 189, 192, 199, 205, 211, 216, 220, 225, 229, 232, 239, 245, 251, 21, 33, 58, 79, 97, 112, 125, 137, 148, 157, 166, 174, 182, 189, 195, 201, 207, 217, 227, 235, 243, 251, 17, 35, 63, 86, 106, 123, 139, 152, 165, 177, 187, 197, 206, 214, 222, 230, 237, 250, 25, 31, 55, 75, 91, 105, 117, 128, 138, 146, 154, 161, 168, 174, 180, 185, 190, 200, 208, 215, 222, 229, 235, 240, 245, 255, 16, 36, 65, 89, 110, 128, 144, 159, 173, 185, 196, 207, 217, 226, 234, 242, 250, 11, 41, 74, 103, 128, 151, 172, 191, 209, 225, 241, 255, 9, 43, 79, 110, 138, 163, 186, 207, 227, 246, 12, 39, 71, 99, 123, 144, 164, 182, 198, 214, 228, 241, 253, 9, 44, 81, 113, 142, 168, 192, 214, 235, 255, 7, 49, 90, 127, 160, 191, 220, 247, 6, 51, 95, 134, 170, 203, 234, 7, 47, 87, 123, 155, 184, 212, 237, 6, 52, 97, 137, 174, 208, 240, 5, 57, 106, 151, 192, 231, 5, 59, 111, 158, 202, 243, 5, 55, 103, 147, 187, 224, 5, 60, 113, 161, 206, 248, 4, 65, 122, 175, 224, 4, 67, 127, 182, 234, }; 224, 224, 224, 224, 224, 224, 224, 224, 160, 160, 160, 160, 185, 185, 185, 178, 178, 168, 134, 61, 37, 224, 224, 224, 224, 224, 224, 224, 224, 240, 240, 240, 240, 207, 207, 207, 198, 198, 183, 144, 66, 40, 160, 160, 160, 160, 160, 160, 160, 160, 185, 185, 185, 185, 193, 193, 193, 183, 183, 172, 138, 64, 38, 240, 240, 240, 240, 240, 240, 240, 240, 207, 207, 207, 207, 204, 204, 204, 193, 193, 180, 143, 66, 40, 185, 185, 185, 185, 185, 185, 185, 185, 193, 193, 193, 193, 193, 193, 193, 183, 183, 172, 138, 65, 39, 207, 207, 207, 207, 207, 207, 207, 207, 204, 204, 204, 204, 201, 201, 201, 188, 188, 176, 141, 66, 40, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, 194, 194, 184, 184, 173, 139, 65, 39, 204, 204, 204, 204, 204, 204, 204, 204, 201, 201, 201, 201, 198, 198, 198, 187, 187, 175, 140, 66, 40, }; {1.0000000f, -0.0000000f}, {0.99991433f, -0.013089596f}, {0.99965732f, -0.026176948f}, {0.99922904f, -0.039259816f}, {0.99862953f, -0.052335956f}, {0.99785892f, -0.065403129f}, {0.99691733f, -0.078459096f}, {0.99580493f, -0.091501619f}, {0.99452190f, -0.10452846f}, {0.99306846f, -0.11753740f}, {0.99144486f, -0.13052619f}, {0.98965139f, -0.14349262f}, {0.98768834f, -0.15643447f}, {0.98555606f, -0.16934950f}, {0.98325491f, -0.18223553f}, {0.98078528f, -0.19509032f}, {0.97814760f, -0.20791169f}, {0.97534232f, -0.22069744f}, {0.97236992f, -0.23344536f}, {0.96923091f, -0.24615329f}, {0.96592583f, -0.25881905f}, {0.96245524f, -0.27144045f}, {0.95881973f, -0.28401534f}, {0.95501994f, -0.29654157f}, {0.95105652f, -0.30901699f}, {0.94693013f, -0.32143947f}, {0.94264149f, -0.33380686f}, {0.93819134f, -0.34611706f}, {0.93358043f, -0.35836795f}, {0.92880955f, -0.37055744f}, {0.92387953f, -0.38268343f}, {0.91879121f, -0.39474386f}, {0.91354546f, -0.40673664f}, {0.90814317f, -0.41865974f}, {0.90258528f, -0.43051110f}, {0.89687274f, -0.44228869f}, {0.89100652f, -0.45399050f}, {0.88498764f, -0.46561452f}, {0.87881711f, -0.47715876f}, {0.87249601f, -0.48862124f}, {0.86602540f, -0.50000000f}, {0.85940641f, -0.51129309f}, {0.85264016f, -0.52249856f}, {0.84572782f, -0.53361452f}, {0.83867057f, -0.54463904f}, {0.83146961f, -0.55557023f}, {0.82412619f, -0.56640624f}, {0.81664156f, -0.57714519f}, {0.80901699f, -0.58778525f}, {0.80125381f, -0.59832460f}, {0.79335334f, -0.60876143f}, {0.78531693f, -0.61909395f}, {0.77714596f, -0.62932039f}, {0.76884183f, -0.63943900f}, {0.76040597f, -0.64944805f}, {0.75183981f, -0.65934582f}, {0.74314483f, -0.66913061f}, {0.73432251f, -0.67880075f}, {0.72537437f, -0.68835458f}, {0.71630194f, -0.69779046f}, {0.70710678f, -0.70710678f}, {0.69779046f, -0.71630194f}, {0.68835458f, -0.72537437f}, {0.67880075f, -0.73432251f}, {0.66913061f, -0.74314483f}, {0.65934582f, -0.75183981f}, {0.64944805f, -0.76040597f}, {0.63943900f, -0.76884183f}, {0.62932039f, -0.77714596f}, {0.61909395f, -0.78531693f}, {0.60876143f, -0.79335334f}, {0.59832460f, -0.80125381f}, {0.58778525f, -0.80901699f}, {0.57714519f, -0.81664156f}, {0.56640624f, -0.82412619f}, {0.55557023f, -0.83146961f}, {0.54463904f, -0.83867057f}, {0.53361452f, -0.84572782f}, {0.52249856f, -0.85264016f}, {0.51129309f, -0.85940641f}, {0.50000000f, -0.86602540f}, {0.48862124f, -0.87249601f}, {0.47715876f, -0.87881711f}, {0.46561452f, -0.88498764f}, {0.45399050f, -0.89100652f}, {0.44228869f, -0.89687274f}, {0.43051110f, -0.90258528f}, {0.41865974f, -0.90814317f}, {0.40673664f, -0.91354546f}, {0.39474386f, -0.91879121f}, {0.38268343f, -0.92387953f}, {0.37055744f, -0.92880955f}, {0.35836795f, -0.93358043f}, {0.34611706f, -0.93819134f}, {0.33380686f, -0.94264149f}, {0.32143947f, -0.94693013f}, {0.30901699f, -0.95105652f}, {0.29654157f, -0.95501994f}, {0.28401534f, -0.95881973f}, {0.27144045f, -0.96245524f}, {0.25881905f, -0.96592583f}, {0.24615329f, -0.96923091f}, {0.23344536f, -0.97236992f}, {0.22069744f, -0.97534232f}, {0.20791169f, -0.97814760f}, {0.19509032f, -0.98078528f}, {0.18223553f, -0.98325491f}, {0.16934950f, -0.98555606f}, {0.15643447f, -0.98768834f}, {0.14349262f, -0.98965139f}, {0.13052619f, -0.99144486f}, {0.11753740f, -0.99306846f}, {0.10452846f, -0.99452190f}, {0.091501619f, -0.99580493f}, {0.078459096f, -0.99691733f}, {0.065403129f, -0.99785892f}, {0.052335956f, -0.99862953f}, {0.039259816f, -0.99922904f}, {0.026176948f, -0.99965732f}, {0.013089596f, -0.99991433f}, {6.1230318e-17f, -1.0000000f}, {-0.013089596f, -0.99991433f}, {-0.026176948f, -0.99965732f}, {-0.039259816f, -0.99922904f}, {-0.052335956f, -0.99862953f}, {-0.065403129f, -0.99785892f}, {-0.078459096f, -0.99691733f}, {-0.091501619f, -0.99580493f}, {-0.10452846f, -0.99452190f}, {-0.11753740f, -0.99306846f}, {-0.13052619f, -0.99144486f}, {-0.14349262f, -0.98965139f}, {-0.15643447f, -0.98768834f}, {-0.16934950f, -0.98555606f}, {-0.18223553f, -0.98325491f}, {-0.19509032f, -0.98078528f}, {-0.20791169f, -0.97814760f}, {-0.22069744f, -0.97534232f}, {-0.23344536f, -0.97236992f}, {-0.24615329f, -0.96923091f}, {-0.25881905f, -0.96592583f}, {-0.27144045f, -0.96245524f}, {-0.28401534f, -0.95881973f}, {-0.29654157f, -0.95501994f}, {-0.30901699f, -0.95105652f}, {-0.32143947f, -0.94693013f}, {-0.33380686f, -0.94264149f}, {-0.34611706f, -0.93819134f}, {-0.35836795f, -0.93358043f}, {-0.37055744f, -0.92880955f}, {-0.38268343f, -0.92387953f}, {-0.39474386f, -0.91879121f}, {-0.40673664f, -0.91354546f}, {-0.41865974f, -0.90814317f}, {-0.43051110f, -0.90258528f}, {-0.44228869f, -0.89687274f}, {-0.45399050f, -0.89100652f}, {-0.46561452f, -0.88498764f}, {-0.47715876f, -0.87881711f}, {-0.48862124f, -0.87249601f}, {-0.50000000f, -0.86602540f}, {-0.51129309f, -0.85940641f}, {-0.52249856f, -0.85264016f}, {-0.53361452f, -0.84572782f}, {-0.54463904f, -0.83867057f}, {-0.55557023f, -0.83146961f}, {-0.56640624f, -0.82412619f}, {-0.57714519f, -0.81664156f}, {-0.58778525f, -0.80901699f}, {-0.59832460f, -0.80125381f}, {-0.60876143f, -0.79335334f}, {-0.61909395f, -0.78531693f}, {-0.62932039f, -0.77714596f}, {-0.63943900f, -0.76884183f}, {-0.64944805f, -0.76040597f}, {-0.65934582f, -0.75183981f}, {-0.66913061f, -0.74314483f}, {-0.67880075f, -0.73432251f}, {-0.68835458f, -0.72537437f}, {-0.69779046f, -0.71630194f}, {-0.70710678f, -0.70710678f}, {-0.71630194f, -0.69779046f}, {-0.72537437f, -0.68835458f}, {-0.73432251f, -0.67880075f}, {-0.74314483f, -0.66913061f}, {-0.75183981f, -0.65934582f}, {-0.76040597f, -0.64944805f}, {-0.76884183f, -0.63943900f}, {-0.77714596f, -0.62932039f}, {-0.78531693f, -0.61909395f}, {-0.79335334f, -0.60876143f}, {-0.80125381f, -0.59832460f}, {-0.80901699f, -0.58778525f}, {-0.81664156f, -0.57714519f}, {-0.82412619f, -0.56640624f}, {-0.83146961f, -0.55557023f}, {-0.83867057f, -0.54463904f}, {-0.84572782f, -0.53361452f}, {-0.85264016f, -0.52249856f}, {-0.85940641f, -0.51129309f}, {-0.86602540f, -0.50000000f}, {-0.87249601f, -0.48862124f}, {-0.87881711f, -0.47715876f}, {-0.88498764f, -0.46561452f}, {-0.89100652f, -0.45399050f}, {-0.89687274f, -0.44228869f}, {-0.90258528f, -0.43051110f}, {-0.90814317f, -0.41865974f}, {-0.91354546f, -0.40673664f}, {-0.91879121f, -0.39474386f}, {-0.92387953f, -0.38268343f}, {-0.92880955f, -0.37055744f}, {-0.93358043f, -0.35836795f}, {-0.93819134f, -0.34611706f}, {-0.94264149f, -0.33380686f}, {-0.94693013f, -0.32143947f}, {-0.95105652f, -0.30901699f}, {-0.95501994f, -0.29654157f}, {-0.95881973f, -0.28401534f}, {-0.96245524f, -0.27144045f}, {-0.96592583f, -0.25881905f}, {-0.96923091f, -0.24615329f}, {-0.97236992f, -0.23344536f}, {-0.97534232f, -0.22069744f}, {-0.97814760f, -0.20791169f}, {-0.98078528f, -0.19509032f}, {-0.98325491f, -0.18223553f}, {-0.98555606f, -0.16934950f}, {-0.98768834f, -0.15643447f}, {-0.98965139f, -0.14349262f}, {-0.99144486f, -0.13052619f}, {-0.99306846f, -0.11753740f}, {-0.99452190f, -0.10452846f}, {-0.99580493f, -0.091501619f}, {-0.99691733f, -0.078459096f}, {-0.99785892f, -0.065403129f}, {-0.99862953f, -0.052335956f}, {-0.99922904f, -0.039259816f}, {-0.99965732f, -0.026176948f}, {-0.99991433f, -0.013089596f}, {-1.0000000f, -1.2246064e-16f}, {-0.99991433f, 0.013089596f}, {-0.99965732f, 0.026176948f}, {-0.99922904f, 0.039259816f}, {-0.99862953f, 0.052335956f}, {-0.99785892f, 0.065403129f}, {-0.99691733f, 0.078459096f}, {-0.99580493f, 0.091501619f}, {-0.99452190f, 0.10452846f}, {-0.99306846f, 0.11753740f}, {-0.99144486f, 0.13052619f}, {-0.98965139f, 0.14349262f}, {-0.98768834f, 0.15643447f}, {-0.98555606f, 0.16934950f}, {-0.98325491f, 0.18223553f}, {-0.98078528f, 0.19509032f}, {-0.97814760f, 0.20791169f}, {-0.97534232f, 0.22069744f}, {-0.97236992f, 0.23344536f}, {-0.96923091f, 0.24615329f}, {-0.96592583f, 0.25881905f}, {-0.96245524f, 0.27144045f}, {-0.95881973f, 0.28401534f}, {-0.95501994f, 0.29654157f}, {-0.95105652f, 0.30901699f}, {-0.94693013f, 0.32143947f}, {-0.94264149f, 0.33380686f}, {-0.93819134f, 0.34611706f}, {-0.93358043f, 0.35836795f}, {-0.92880955f, 0.37055744f}, {-0.92387953f, 0.38268343f}, {-0.91879121f, 0.39474386f}, {-0.91354546f, 0.40673664f}, {-0.90814317f, 0.41865974f}, {-0.90258528f, 0.43051110f}, {-0.89687274f, 0.44228869f}, {-0.89100652f, 0.45399050f}, {-0.88498764f, 0.46561452f}, {-0.87881711f, 0.47715876f}, {-0.87249601f, 0.48862124f}, {-0.86602540f, 0.50000000f}, {-0.85940641f, 0.51129309f}, {-0.85264016f, 0.52249856f}, {-0.84572782f, 0.53361452f}, {-0.83867057f, 0.54463904f}, {-0.83146961f, 0.55557023f}, {-0.82412619f, 0.56640624f}, {-0.81664156f, 0.57714519f}, {-0.80901699f, 0.58778525f}, {-0.80125381f, 0.59832460f}, {-0.79335334f, 0.60876143f}, {-0.78531693f, 0.61909395f}, {-0.77714596f, 0.62932039f}, {-0.76884183f, 0.63943900f}, {-0.76040597f, 0.64944805f}, {-0.75183981f, 0.65934582f}, {-0.74314483f, 0.66913061f}, {-0.73432251f, 0.67880075f}, {-0.72537437f, 0.68835458f}, {-0.71630194f, 0.69779046f}, {-0.70710678f, 0.70710678f}, {-0.69779046f, 0.71630194f}, {-0.68835458f, 0.72537437f}, {-0.67880075f, 0.73432251f}, {-0.66913061f, 0.74314483f}, {-0.65934582f, 0.75183981f}, {-0.64944805f, 0.76040597f}, {-0.63943900f, 0.76884183f}, {-0.62932039f, 0.77714596f}, {-0.61909395f, 0.78531693f}, {-0.60876143f, 0.79335334f}, {-0.59832460f, 0.80125381f}, {-0.58778525f, 0.80901699f}, {-0.57714519f, 0.81664156f}, {-0.56640624f, 0.82412619f}, {-0.55557023f, 0.83146961f}, {-0.54463904f, 0.83867057f}, {-0.53361452f, 0.84572782f}, {-0.52249856f, 0.85264016f}, {-0.51129309f, 0.85940641f}, {-0.50000000f, 0.86602540f}, {-0.48862124f, 0.87249601f}, {-0.47715876f, 0.87881711f}, {-0.46561452f, 0.88498764f}, {-0.45399050f, 0.89100652f}, {-0.44228869f, 0.89687274f}, {-0.43051110f, 0.90258528f}, {-0.41865974f, 0.90814317f}, {-0.40673664f, 0.91354546f}, {-0.39474386f, 0.91879121f}, {-0.38268343f, 0.92387953f}, {-0.37055744f, 0.92880955f}, {-0.35836795f, 0.93358043f}, {-0.34611706f, 0.93819134f}, {-0.33380686f, 0.94264149f}, {-0.32143947f, 0.94693013f}, {-0.30901699f, 0.95105652f}, {-0.29654157f, 0.95501994f}, {-0.28401534f, 0.95881973f}, {-0.27144045f, 0.96245524f}, {-0.25881905f, 0.96592583f}, {-0.24615329f, 0.96923091f}, {-0.23344536f, 0.97236992f}, {-0.22069744f, 0.97534232f}, {-0.20791169f, 0.97814760f}, {-0.19509032f, 0.98078528f}, {-0.18223553f, 0.98325491f}, {-0.16934950f, 0.98555606f}, {-0.15643447f, 0.98768834f}, {-0.14349262f, 0.98965139f}, {-0.13052619f, 0.99144486f}, {-0.11753740f, 0.99306846f}, {-0.10452846f, 0.99452190f}, {-0.091501619f, 0.99580493f}, {-0.078459096f, 0.99691733f}, {-0.065403129f, 0.99785892f}, {-0.052335956f, 0.99862953f}, {-0.039259816f, 0.99922904f}, {-0.026176948f, 0.99965732f}, {-0.013089596f, 0.99991433f}, {-1.8369095e-16f, 1.0000000f}, {0.013089596f, 0.99991433f}, {0.026176948f, 0.99965732f}, {0.039259816f, 0.99922904f}, {0.052335956f, 0.99862953f}, {0.065403129f, 0.99785892f}, {0.078459096f, 0.99691733f}, {0.091501619f, 0.99580493f}, {0.10452846f, 0.99452190f}, {0.11753740f, 0.99306846f}, {0.13052619f, 0.99144486f}, {0.14349262f, 0.98965139f}, {0.15643447f, 0.98768834f}, {0.16934950f, 0.98555606f}, {0.18223553f, 0.98325491f}, {0.19509032f, 0.98078528f}, {0.20791169f, 0.97814760f}, {0.22069744f, 0.97534232f}, {0.23344536f, 0.97236992f}, {0.24615329f, 0.96923091f}, {0.25881905f, 0.96592583f}, {0.27144045f, 0.96245524f}, {0.28401534f, 0.95881973f}, {0.29654157f, 0.95501994f}, {0.30901699f, 0.95105652f}, {0.32143947f, 0.94693013f}, {0.33380686f, 0.94264149f}, {0.34611706f, 0.93819134f}, {0.35836795f, 0.93358043f}, {0.37055744f, 0.92880955f}, {0.38268343f, 0.92387953f}, {0.39474386f, 0.91879121f}, {0.40673664f, 0.91354546f}, {0.41865974f, 0.90814317f}, {0.43051110f, 0.90258528f}, {0.44228869f, 0.89687274f}, {0.45399050f, 0.89100652f}, {0.46561452f, 0.88498764f}, {0.47715876f, 0.87881711f}, {0.48862124f, 0.87249601f}, {0.50000000f, 0.86602540f}, {0.51129309f, 0.85940641f}, {0.52249856f, 0.85264016f}, {0.53361452f, 0.84572782f}, {0.54463904f, 0.83867057f}, {0.55557023f, 0.83146961f}, {0.56640624f, 0.82412619f}, {0.57714519f, 0.81664156f}, {0.58778525f, 0.80901699f}, {0.59832460f, 0.80125381f}, {0.60876143f, 0.79335334f}, {0.61909395f, 0.78531693f}, {0.62932039f, 0.77714596f}, {0.63943900f, 0.76884183f}, {0.64944805f, 0.76040597f}, {0.65934582f, 0.75183981f}, {0.66913061f, 0.74314483f}, {0.67880075f, 0.73432251f}, {0.68835458f, 0.72537437f}, {0.69779046f, 0.71630194f}, {0.70710678f, 0.70710678f}, {0.71630194f, 0.69779046f}, {0.72537437f, 0.68835458f}, {0.73432251f, 0.67880075f}, {0.74314483f, 0.66913061f}, {0.75183981f, 0.65934582f}, {0.76040597f, 0.64944805f}, {0.76884183f, 0.63943900f}, {0.77714596f, 0.62932039f}, {0.78531693f, 0.61909395f}, {0.79335334f, 0.60876143f}, {0.80125381f, 0.59832460f}, {0.80901699f, 0.58778525f}, {0.81664156f, 0.57714519f}, {0.82412619f, 0.56640624f}, {0.83146961f, 0.55557023f}, {0.83867057f, 0.54463904f}, {0.84572782f, 0.53361452f}, {0.85264016f, 0.52249856f}, {0.85940641f, 0.51129309f}, {0.86602540f, 0.50000000f}, {0.87249601f, 0.48862124f}, {0.87881711f, 0.47715876f}, {0.88498764f, 0.46561452f}, {0.89100652f, 0.45399050f}, {0.89687274f, 0.44228869f}, {0.90258528f, 0.43051110f}, {0.90814317f, 0.41865974f}, {0.91354546f, 0.40673664f}, {0.91879121f, 0.39474386f}, {0.92387953f, 0.38268343f}, {0.92880955f, 0.37055744f}, {0.93358043f, 0.35836795f}, {0.93819134f, 0.34611706f}, {0.94264149f, 0.33380686f}, {0.94693013f, 0.32143947f}, {0.95105652f, 0.30901699f}, {0.95501994f, 0.29654157f}, {0.95881973f, 0.28401534f}, {0.96245524f, 0.27144045f}, {0.96592583f, 0.25881905f}, {0.96923091f, 0.24615329f}, {0.97236992f, 0.23344536f}, {0.97534232f, 0.22069744f}, {0.97814760f, 0.20791169f}, {0.98078528f, 0.19509032f}, {0.98325491f, 0.18223553f}, {0.98555606f, 0.16934950f}, {0.98768834f, 0.15643447f}, {0.98965139f, 0.14349262f}, {0.99144486f, 0.13052619f}, {0.99306846f, 0.11753740f}, {0.99452190f, 0.10452846f}, {0.99580493f, 0.091501619f}, {0.99691733f, 0.078459096f}, {0.99785892f, 0.065403129f}, {0.99862953f, 0.052335956f}, {0.99922904f, 0.039259816f}, {0.99965732f, 0.026176948f}, {0.99991433f, 0.013089596f}, }; 0, 120, 240, 360, 30, 150, 270, 390, 60, 180, 300, 420, 90, 210, 330, 450, 15, 135, 255, 375, 45, 165, 285, 405, 75, 195, 315, 435, 105, 225, 345, 465, 5, 125, 245, 365, 35, 155, 275, 395, 65, 185, 305, 425, 95, 215, 335, 455, 20, 140, 260, 380, 50, 170, 290, 410, 80, 200, 320, 440, 110, 230, 350, 470, 10, 130, 250, 370, 40, 160, 280, 400, 70, 190, 310, 430, 100, 220, 340, 460, 25, 145, 265, 385, 55, 175, 295, 415, 85, 205, 325, 445, 115, 235, 355, 475, 1, 121, 241, 361, 31, 151, 271, 391, 61, 181, 301, 421, 91, 211, 331, 451, 16, 136, 256, 376, 46, 166, 286, 406, 76, 196, 316, 436, 106, 226, 346, 466, 6, 126, 246, 366, 36, 156, 276, 396, 66, 186, 306, 426, 96, 216, 336, 456, 21, 141, 261, 381, 51, 171, 291, 411, 81, 201, 321, 441, 111, 231, 351, 471, 11, 131, 251, 371, 41, 161, 281, 401, 71, 191, 311, 431, 101, 221, 341, 461, 26, 146, 266, 386, 56, 176, 296, 416, 86, 206, 326, 446, 116, 236, 356, 476, 2, 122, 242, 362, 32, 152, 272, 392, 62, 182, 302, 422, 92, 212, 332, 452, 17, 137, 257, 377, 47, 167, 287, 407, 77, 197, 317, 437, 107, 227, 347, 467, 7, 127, 247, 367, 37, 157, 277, 397, 67, 187, 307, 427, 97, 217, 337, 457, 22, 142, 262, 382, 52, 172, 292, 412, 82, 202, 322, 442, 112, 232, 352, 472, 12, 132, 252, 372, 42, 162, 282, 402, 72, 192, 312, 432, 102, 222, 342, 462, 27, 147, 267, 387, 57, 177, 297, 417, 87, 207, 327, 447, 117, 237, 357, 477, 3, 123, 243, 363, 33, 153, 273, 393, 63, 183, 303, 423, 93, 213, 333, 453, 18, 138, 258, 378, 48, 168, 288, 408, 78, 198, 318, 438, 108, 228, 348, 468, 8, 128, 248, 368, 38, 158, 278, 398, 68, 188, 308, 428, 98, 218, 338, 458, 23, 143, 263, 383, 53, 173, 293, 413, 83, 203, 323, 443, 113, 233, 353, 473, 13, 133, 253, 373, 43, 163, 283, 403, 73, 193, 313, 433, 103, 223, 343, 463, 28, 148, 268, 388, 58, 178, 298, 418, 88, 208, 328, 448, 118, 238, 358, 478, 4, 124, 244, 364, 34, 154, 274, 394, 64, 184, 304, 424, 94, 214, 334, 454, 19, 139, 259, 379, 49, 169, 289, 409, 79, 199, 319, 439, 109, 229, 349, 469, 9, 129, 249, 369, 39, 159, 279, 399, 69, 189, 309, 429, 99, 219, 339, 459, 24, 144, 264, 384, 54, 174, 294, 414, 84, 204, 324, 444, 114, 234, 354, 474, 14, 134, 254, 374, 44, 164, 284, 404, 74, 194, 314, 434, 104, 224, 344, 464, 29, 149, 269, 389, 59, 179, 299, 419, 89, 209, 329, 449, 119, 239, 359, 479, }; 0, 60, 120, 180, 15, 75, 135, 195, 30, 90, 150, 210, 45, 105, 165, 225, 5, 65, 125, 185, 20, 80, 140, 200, 35, 95, 155, 215, 50, 110, 170, 230, 10, 70, 130, 190, 25, 85, 145, 205, 40, 100, 160, 220, 55, 115, 175, 235, 1, 61, 121, 181, 16, 76, 136, 196, 31, 91, 151, 211, 46, 106, 166, 226, 6, 66, 126, 186, 21, 81, 141, 201, 36, 96, 156, 216, 51, 111, 171, 231, 11, 71, 131, 191, 26, 86, 146, 206, 41, 101, 161, 221, 56, 116, 176, 236, 2, 62, 122, 182, 17, 77, 137, 197, 32, 92, 152, 212, 47, 107, 167, 227, 7, 67, 127, 187, 22, 82, 142, 202, 37, 97, 157, 217, 52, 112, 172, 232, 12, 72, 132, 192, 27, 87, 147, 207, 42, 102, 162, 222, 57, 117, 177, 237, 3, 63, 123, 183, 18, 78, 138, 198, 33, 93, 153, 213, 48, 108, 168, 228, 8, 68, 128, 188, 23, 83, 143, 203, 38, 98, 158, 218, 53, 113, 173, 233, 13, 73, 133, 193, 28, 88, 148, 208, 43, 103, 163, 223, 58, 118, 178, 238, 4, 64, 124, 184, 19, 79, 139, 199, 34, 94, 154, 214, 49, 109, 169, 229, 9, 69, 129, 189, 24, 84, 144, 204, 39, 99, 159, 219, 54, 114, 174, 234, 14, 74, 134, 194, 29, 89, 149, 209, 44, 104, 164, 224, 59, 119, 179, 239, }; 0, 30, 60, 90, 15, 45, 75, 105, 5, 35, 65, 95, 20, 50, 80, 110, 10, 40, 70, 100, 25, 55, 85, 115, 1, 31, 61, 91, 16, 46, 76, 106, 6, 36, 66, 96, 21, 51, 81, 111, 11, 41, 71, 101, 26, 56, 86, 116, 2, 32, 62, 92, 17, 47, 77, 107, 7, 37, 67, 97, 22, 52, 82, 112, 12, 42, 72, 102, 27, 57, 87, 117, 3, 33, 63, 93, 18, 48, 78, 108, 8, 38, 68, 98, 23, 53, 83, 113, 13, 43, 73, 103, 28, 58, 88, 118, 4, 34, 64, 94, 19, 49, 79, 109, 9, 39, 69, 99, 24, 54, 84, 114, 14, 44, 74, 104, 29, 59, 89, 119, }; 0, 15, 30, 45, 5, 20, 35, 50, 10, 25, 40, 55, 1, 16, 31, 46, 6, 21, 36, 51, 11, 26, 41, 56, 2, 17, 32, 47, 7, 22, 37, 52, 12, 27, 42, 57, 3, 18, 33, 48, 8, 23, 38, 53, 13, 28, 43, 58, 4, 19, 34, 49, 9, 24, 39, 54, 14, 29, 44, 59, }; 1.0000000f, 0.99999465f, 0.99997858f, 0.99995181f, 0.99991433f, 0.99986614f, 0.99980724f, 0.99973764f, 0.99965732f, 0.99956631f, 0.99946459f, 0.99935216f, 0.99922904f, 0.99909521f, 0.99895068f, 0.99879546f, 0.99862953f, 0.99845292f, 0.99826561f, 0.99806761f, 0.99785892f, 0.99763955f, 0.99740949f, 0.99716875f, 0.99691733f, 0.99665524f, 0.99638247f, 0.99609903f, 0.99580493f, 0.99550016f, 0.99518473f, 0.99485864f, 0.99452190f, 0.99417450f, 0.99381646f, 0.99344778f, 0.99306846f, 0.99267850f, 0.99227791f, 0.99186670f, 0.99144486f, 0.99101241f, 0.99056934f, 0.99011566f, 0.98965139f, 0.98917651f, 0.98869104f, 0.98819498f, 0.98768834f, 0.98717112f, 0.98664333f, 0.98610497f, 0.98555606f, 0.98499659f, 0.98442657f, 0.98384600f, 0.98325491f, 0.98265328f, 0.98204113f, 0.98141846f, 0.98078528f, 0.98014159f, 0.97948742f, 0.97882275f, 0.97814760f, 0.97746197f, 0.97676588f, 0.97605933f, 0.97534232f, 0.97461487f, 0.97387698f, 0.97312866f, 0.97236992f, 0.97160077f, 0.97082121f, 0.97003125f, 0.96923091f, 0.96842019f, 0.96759909f, 0.96676764f, 0.96592582f, 0.96507367f, 0.96421118f, 0.96333837f, 0.96245523f, 0.96156180f, 0.96065806f, 0.95974403f, 0.95881973f, 0.95788517f, 0.95694034f, 0.95598526f, 0.95501995f, 0.95404440f, 0.95305864f, 0.95206267f, 0.95105651f, 0.95004016f, 0.94901364f, 0.94797697f, 0.94693013f, 0.94587315f, 0.94480604f, 0.94372882f, 0.94264149f, 0.94154406f, 0.94043656f, 0.93931897f, 0.93819133f, 0.93705365f, 0.93590592f, 0.93474818f, 0.93358042f, 0.93240268f, 0.93121493f, 0.93001722f, 0.92880955f, 0.92759193f, 0.92636438f, 0.92512690f, 0.92387953f, 0.92262225f, 0.92135509f, 0.92007809f, 0.91879121f, 0.91749449f, 0.91618795f, 0.91487161f, 0.91354545f, 0.91220952f, 0.91086382f, 0.90950836f, 0.90814316f, 0.90676824f, 0.90538363f, 0.90398929f, 0.90258528f, 0.90117161f, 0.89974828f, 0.89831532f, 0.89687273f, 0.89542055f, 0.89395877f, 0.89248742f, 0.89100652f, 0.88951606f, 0.88801610f, 0.88650661f, 0.88498764f, 0.88345918f, 0.88192125f, 0.88037390f, 0.87881711f, 0.87725090f, 0.87567531f, 0.87409035f, 0.87249599f, 0.87089232f, 0.86927933f, 0.86765699f, 0.86602540f, 0.86438453f, 0.86273437f, 0.86107503f, 0.85940641f, 0.85772862f, 0.85604161f, 0.85434547f, 0.85264014f, 0.85092572f, 0.84920218f, 0.84746955f, 0.84572781f, 0.84397704f, 0.84221721f, 0.84044838f, 0.83867056f, 0.83688375f, 0.83508799f, 0.83328325f, 0.83146961f, 0.82964704f, 0.82781562f, 0.82597530f, 0.82412620f, 0.82226820f, 0.82040144f, 0.81852589f, 0.81664154f, 0.81474847f, 0.81284665f, 0.81093620f, 0.80901698f, 0.80708914f, 0.80515262f, 0.80320752f, 0.80125378f, 0.79929149f, 0.79732067f, 0.79534125f, 0.79335335f, 0.79135691f, 0.78935204f, 0.78733867f, 0.78531691f, 0.78328674f, 0.78124818f, 0.77920122f, 0.77714595f, 0.77508232f, 0.77301043f, 0.77093026f, 0.76884183f, 0.76674517f, 0.76464026f, 0.76252720f, 0.76040593f, 0.75827656f, 0.75613907f, 0.75399349f, 0.75183978f, 0.74967807f, 0.74750833f, 0.74533054f, 0.74314481f, 0.74095112f, 0.73874950f, 0.73653993f, 0.73432251f, 0.73209718f, 0.72986405f, 0.72762307f, 0.72537438f, 0.72311787f, 0.72085359f, 0.71858162f, 0.71630192f, 0.71401459f, 0.71171956f, 0.70941701f, 0.70710677f, 0.70478900f, 0.70246363f, 0.70013079f, 0.69779041f, 0.69544260f, 0.69308738f, 0.69072466f, 0.68835458f, 0.68597709f, 0.68359229f, 0.68120013f, 0.67880072f, 0.67639404f, 0.67398011f, 0.67155892f, 0.66913059f, 0.66669509f, 0.66425240f, 0.66180265f, 0.65934581f, 0.65688191f, 0.65441092f, 0.65193298f, 0.64944801f, 0.64695613f, 0.64445727f, 0.64195160f, 0.63943902f, 0.63691954f, 0.63439328f, 0.63186019f, 0.62932037f, 0.62677377f, 0.62422055f, 0.62166055f, 0.61909394f, 0.61652065f, 0.61394081f, 0.61135435f, 0.60876139f, 0.60616195f, 0.60355593f, 0.60094349f, 0.59832457f, 0.59569929f, 0.59306758f, 0.59042957f, 0.58778523f, 0.58513460f, 0.58247766f, 0.57981452f, 0.57714518f, 0.57446961f, 0.57178793f, 0.56910013f, 0.56640624f, 0.56370623f, 0.56100023f, 0.55828818f, 0.55557020f, 0.55284627f, 0.55011641f, 0.54738067f, 0.54463901f, 0.54189157f, 0.53913828f, 0.53637921f, 0.53361450f, 0.53084398f, 0.52806787f, 0.52528601f, 0.52249852f, 0.51970543f, 0.51690688f, 0.51410279f, 0.51129310f, 0.50847793f, 0.50565732f, 0.50283139f, 0.49999997f, 0.49716321f, 0.49432122f, 0.49147383f, 0.48862118f, 0.48576340f, 0.48290042f, 0.48003216f, 0.47715876f, 0.47428025f, 0.47139677f, 0.46850813f, 0.46561448f, 0.46271584f, 0.45981235f, 0.45690383f, 0.45399042f, 0.45107214f, 0.44814915f, 0.44522124f, 0.44228868f, 0.43935137f, 0.43640926f, 0.43346247f, 0.43051104f, 0.42755511f, 0.42459449f, 0.42162932f, 0.41865964f, 0.41568558f, 0.41270697f, 0.40972393f, 0.40673661f, 0.40374494f, 0.40074884f, 0.39774844f, 0.39474390f, 0.39173501f, 0.38872193f, 0.38570469f, 0.38268343f, 0.37965796f, 0.37662842f, 0.37359496f, 0.37055739f, 0.36751585f, 0.36447038f, 0.36142122f, 0.35836797f, 0.35531089f, 0.35225000f, 0.34918544f, 0.34611704f, 0.34304493f, 0.33996926f, 0.33688983f, 0.33380680f, 0.33072019f, 0.32763015f, 0.32453650f, 0.32143936f, 0.31833890f, 0.31523503f, 0.31212767f, 0.30901696f, 0.30590306f, 0.30278577f, 0.29966524f, 0.29654150f, 0.29341470f, 0.29028464f, 0.28715147f, 0.28401522f, 0.28087605f, 0.27773376f, 0.27458861f, 0.27144052f, 0.26828940f, 0.26513541f, 0.26197859f, 0.25881907f, 0.25565666f, 0.25249152f, 0.24932367f, 0.24615327f, 0.24298012f, 0.23980436f, 0.23662604f, 0.23344530f, 0.23026206f, 0.22707623f, 0.22388809f, 0.22069744f, 0.21750443f, 0.21430908f, 0.21111156f, 0.20791165f, 0.20470953f, 0.20150520f, 0.19829884f, 0.19509024f, 0.19187955f, 0.18866692f, 0.18545227f, 0.18223552f, 0.17901681f, 0.17579631f, 0.17257380f, 0.16934945f, 0.16612328f, 0.16289546f, 0.15966577f, 0.15643437f, 0.15320141f, 0.14996669f, 0.14673037f, 0.14349260f, 0.14025329f, 0.13701235f, 0.13376995f, 0.13052612f, 0.12728101f, 0.12403442f, 0.12078650f, 0.11753740f, 0.11428693f, 0.11103523f, 0.10778234f, 0.10452842f, 0.10127326f, 0.098017137f, 0.094759842f, 0.091501652f, 0.088242363f, 0.084982129f, 0.081721103f, 0.078459084f, 0.075196224f, 0.071932560f, 0.068668243f, 0.065403073f, 0.062137201f, 0.058870665f, 0.055603617f, 0.052335974f, 0.049067651f, 0.045798921f, 0.042529582f, 0.039259788f, 0.035989573f, 0.032719092f, 0.029448142f, 0.026176876f, 0.022905329f, 0.019633657f, 0.016361655f, 0.013089478f, 0.0098171604f, 0.0065449764f, 0.0032724839f, -4.3711390e-08f, }; #ifndef CUSTOM_MODES #define CUSTOM_MODES #else #define TEST_CUSTOM_MODES #endif #define NMAX (240) #define KMAX (128) #ifdef TEST_CUSTOM_MODES #define NDIMS (46) static const int pn[NDIMS]={ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24, 26, 28, 30, 32, 36, 40, 44, 48, 52, 56, 60, 64, 72, 80, 88, 96, 104, 112, 120, 128, 144, 160, 176, 192, 208, 224, 240 static const int pkmax[NDIMS]={ 128, 128, 128, 128, 88, 52, 36, 26, 22, 18, 16, 15, 13, 12, 12, 11, 10, 9, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; #else /* TEST_CUSTOM_MODES */ #define NDIMS (22) static const int pn[NDIMS]={ 2, 3, 4, 6, 8, 9, 11, 12, 16, 18, 22, 24, 32, 36, 44, 48, 64, 72, 88, 96, 144, 176 }; static const int pkmax[NDIMS]={ 128, 128, 128, 88, 36, 26, 18, 16, 12, 11, 9, 9, 7, 7, 6, 6, 5, 5, 5, 5, 4, 4 }; #endif int main(void){ int t; ALLOC_STACK; for(t=0;tpkmax[t])break; inc=nc/20000; int sy; sy=0; for(j=0;j 2) { fprintf(stderr, "Usage: %s []\n", _argv[0]); return 1; } env_seed = getenv("SEED"); if (_argc > 1) seed = atoi(_argv[1]); else if (env_seed) seed = atoi(env_seed); else seed = time(NULL); for(ftb=1;ftb<16;ftb++){ if(sym!=(unsigned)i){ for(ftb=1;ftb<16;ftb++){ if(sym!=(unsigned)i){ srand(seed); fprintf(stderr,"Testing random streams... Random seed: %u (%.4X)\n", seed, rand() % 65536); unsigned tell_bits; ft=rand()/((RAND_MAX>>(rand()%11U))+1U)+10; sz=rand()/((RAND_MAX>>(rand()%9U))+1U); if(tell_bits!=(unsigned)ec_tell(&enc)){ "Decoded %i instead of %i with ft of %i at position %i of %i (Random seed: %u).\n", sym,data[j],ft,j,sz,seed); sz=rand()/((RAND_MAX>>(rand()%9U))+1U); if((ec_tell(&enc)+7U)/8Umax_d)max_d=d; if (dmax_d)max_d=d; if (d0.001 (x = %f, error = %f)\n", x,error); } } } void testexp2(void) { float x; for (x=-11.0;x<24.0;x+=0.0007) { float error = fabs(x-(1.442695040888963387*log(celt_exp2(x)))); { fprintf (stderr, "celt_exp2 failed: fabs(x-(1.442695040888963387*log(celt_exp2(x))))>0.0005 (x = %f, error = %f)\n", x,error); } } } void testexp2log2(void) { float x; for (x=-11.0;x<24.0;x+=0.0007) { float error = fabs(x-(celt_log2(celt_exp2(x)))); if (error>0.001) { fprintf (stderr, "celt_log2/celt_exp2 failed: fabs(x-(celt_log2(celt_exp2(x))))>0.001 (x = %f, error = %f)\n", x,error); } } } #else void testilog2(void) { for (x=1;x<=268435455;x+=127) { if (error!=0) { printf("celt_ilog2 failed: celt_ilog2(x)!=floor(log2(x)) (x = %d, error = %d)\n",x,error); ret = 1; } } } #endif testbitexactcos(); testbitexactlog2tan(); testlog2(); testexp2(); testexp2log2(); testilog2(); #endif long long celt_mips=0; #endif /*re *= 2;*/ #ifndef CUSTOM_MODES #define CUSTOM_MODES #endif unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc #ifdef RESYNTH , opus_val16 gain #endif ) celt_assert2(K>0, "alg_quant() needs at least one pulse"); celt_assert2(N>1, "alg_quant() needs at least two dimensions"); /* Prevents infinities and NaNs from causing too many pulses to be allocated. 64 is an approximation of infinity here. */ if (!(sum > EPSILON && sum < 64)) y[j] = (celt_norm)iy[j]; #ifdef RESYNTH normalise_residual(iy, X, N, yy, gain); exp_rotation(X, N, -1, B, K, spread); #endif celt_assert2(K>0, "alg_unquant() needs at least one pulse"); celt_assert2(N>1, "alg_unquant() needs at least two dimensions"); ec_enc *enc #ifdef RESYNTH , opus_val16 gain #endif ); /** @defgroup opusencoder Opus Encoder * @{ */ /** Opus encoder state. * This contains the complete state of an Opus encoder. * It is position independent and can be freely copied. * @see opus_encoder_create,opus_encoder_init */ */ /** Allocates and initializes an encoder state. * There are three coding modes: * disables the speech-optimized mode in exchange for slightly reduced delay. * This is useful when the caller knows that the speech-optimized modes will not be needed (use with caution). * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) * @param [in] channels int: Number of channels (1/2) in input signal opus_int32 Fs, int channels, int application, int *error /** Initializes a previously allocated encoder state * The memory pointed to by st must be the size returned by opus_encoder_get_size. * To reset a previously initialized state use the OPUS_RESET_STATE CTL. * @param [in] st OpusEncoder*: Encoder state * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) * @param [in] channels int: Number of channels (1/2) in input signal * @param [in] application int: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY) */ OpusEncoder *st, opus_int32 Fs, int channels, int application /** Encodes an Opus frame. * The passed frame_size must an opus frame size for the encoder's sampling rate. * For example, at 48kHz the permitted values are 120, 240, 480, or 960. * Passing in a duration of less than 10ms (480 samples at 48kHz) will * prevent the encoder from using the LPC or hybrid modes. * @param [in] st OpusEncoder*: Encoder state * @param [in] pcm opus_int16*: Input signal (interleaved if 2 channels). length is frame_size*channels*sizeof(opus_int16) * @param [in] frame_size int: Number of samples per frame of input signal * @param [out] data char*: Output payload (at least max_data_bytes long) * @param [in] max_data_bytes int: Allocated memory for payload; don't use for controlling bitrate */ OpusEncoder *st, const opus_int16 *pcm, int frame_size, unsigned char *data, int max_data_bytes /** Encodes an Opus frame from floating point input. * The passed frame_size must an opus frame size for the encoder's sampling rate. * For example, at 48kHz the permitted values are 120, 240, 480, or 960. * Passing in a duration of less than 10ms (480 samples at 48kHz) will * prevent the encoder from using the LPC or hybrid modes. * @param [in] st OpusEncoder*: Encoder state * @param [in] pcm float*: Input signal (interleaved if 2 channels). length is frame_size*channels*sizeof(float) * @param [in] frame_size int: Number of samples per frame of input signal * @param [out] data char*: Output payload (at least max_data_bytes long) * @param [in] max_data_bytes int: Allocated memory for payload; don't use for controlling bitrate */ OPUS_EXPORT int opus_encode_float( OpusEncoder *st, const float *pcm, int frame_size, unsigned char *data, int max_data_bytes ); /** Frees an OpusEncoder allocated by opus_encoder_create. * @param[in] st OpusEncoder*: State to be freed. */ /** Perform a CTL function on an Opus encoder. * @see encoderctls */ /**@}*/ /** @defgroup opusdecoder Opus Decoder * @{ /** Opus decoder state. * This contains the complete state of an Opus decoder. * It is position independent and can be freely copied. * @see opus_decoder_create,opus_decoder_init */ typedef struct OpusDecoder OpusDecoder; /** Gets the size of an OpusDecoder structure. * @param [in] channels int: Number of channels * @returns size */ /** Allocates and initializes a decoder state. * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) * @param [in] channels int: Number of channels (1/2) in input signal */ opus_int32 Fs, int channels, int *error /** Initializes a previously allocated decoder state. * The state must be the size returned by opus_decoder_get_size. * This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size * To reset a previously initialized state use the OPUS_RESET_STATE CTL. * @param [in] st OpusDecoder*: Decoder state. * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) * @param [in] channels int: Number of channels (1/2) in input signal */ OPUS_EXPORT int opus_decoder_init( OpusDecoder *st, opus_int32 Fs, int channels /** Decode an Opus frame * @param [in] st OpusDecoder*: Decoder state * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss * @param [in] len int: Number of bytes in payload* * @param [out] pcm opus_int16*: Output signal (interleaved if 2 channels). length * is frame_size*channels*sizeof(opus_int16) * @param [in] frame_size Number of samples per channel of available space in *pcm, * if less than the maximum frame size (120ms) some frames can not be decoded * @param [in] decode_fec int: Flag (0/1) to request that any in-band forward error correction data be * decoded. If no such data is available the frame is decoded as if it were lost. */ OpusDecoder *st, const unsigned char *data, int len, opus_int16 *pcm, int frame_size, int decode_fec ); /** Decode an opus frame with floating point output * @param [in] st OpusDecoder*: Decoder state * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss * @param [in] len int: Number of bytes in payload * @param [out] pcm float*: Output signal (interleaved if 2 channels). length * is frame_size*channels*sizeof(float) * @param [in] frame_size Number of samples per channel of available space in *pcm, * if less than the maximum frame size (120ms) some frames can not be decoded * @param [in] decode_fec int: Flag (0/1) to request that any in-band forward error correction data be * decoded. If no such data is available the frame is decoded as if it were lost. */ OPUS_EXPORT int opus_decode_float( OpusDecoder *st, const unsigned char *data, int len, float *pcm, int frame_size, int decode_fec /** Perform a CTL function on an Opus decoder. */ /** Frees an OpusDecoder allocated by opus_decoder_create. * @param[in] st OpusDecoder*: State to be freed. */ /** Parse an opus packet into one or more frames. * Opus_decode will perform this operation internally so most applications do * not need to use this function. * This function does not copy the frames, the returned pointers are pointers into * the input packet. * @param [in] data char*: Opus packet to be parsed * @param [in] len int: size of data * @param [out] out_toc char*: TOC pointer * @param [out] frames char*[48] encapsulated frames * @param [out] size short[48] sizes of the encapsulated frames * @returns number of frames */ OPUS_EXPORT int opus_packet_parse( const unsigned char *data, int len, unsigned char *out_toc, const unsigned char *frames[48], short size[48], int *payload_offset ); /** Gets the bandwidth of an Opus packet. * @param [in] data char*: Opus packet * @retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass) * @retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass) * @retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass) * @retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass) * @retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass) * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type */ /** Gets the number of samples per frame from an Opus packet. * @param [in] data char*: Opus packet * @param [in] Fs opus_int32: Sampling rate in Hz * @returns Number of samples per frame * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type */ OPUS_EXPORT int opus_packet_get_samples_per_frame(const unsigned char *data, opus_int32 Fs); /** Gets the number of channels from an Opus packet. * @param [in] data char*: Opus packet * @returns Number of channels * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type */ * @param [in] packet char*: Opus packet * @param [in] len int: Length of packet * @returns Number of frames * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type */ /** Gets the number of samples of an Opus packet. * @param [in] dec OpusDecoder*: Decoder state * @param [in] packet char*: Opus packet * @param [in] len int: Length of packet * @returns Number of samples * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type */ /**@}*/ /** @defgroup repacketizer Repacketizer * @{ */ OPUS_EXPORT opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end, unsigned char *data, int maxlen); OPUS_EXPORT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, int maxlen); /**@}*/ #define OPUS_CUSTOM_EXPORT_STATIC OPUS_EXPORT #ifdef CELT_C #define OPUS_CUSTOM_EXPORT_STATIC static inline #else #define OPUS_CUSTOM_EXPORT_STATIC #endif OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_get_size(const OpusCustomMode *mode, int channels); OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_init(OpusCustomEncoder *st, const OpusCustomMode *mode, int channels); OPUS_CUSTOM_EXPORT_STATIC int opus_custom_decoder_get_size(const OpusCustomMode *mode, int channels); OPUS_CUSTOM_EXPORT_STATIC int opus_custom_decoder_init(OpusCustomDecoder *st, const OpusCustomMode *mode, int channels); /** @defgroup errorcodes Error codes * @{ */ /** No error @hideinitializer*/ #define OPUS_OK 0 /** One or more invalid/out of range arguments @hideinitializer*/ #define OPUS_BAD_ARG -1 /** The mode struct passed is invalid @hideinitializer*/ #define OPUS_BUFFER_TOO_SMALL -2 /** An internal error was detected @hideinitializer*/ #define OPUS_INTERNAL_ERROR -3 /** The compressed data passed is corrupted @hideinitializer*/ #define OPUS_INVALID_PACKET -4 /** Invalid/unsupported request number @hideinitializer*/ #define OPUS_UNIMPLEMENTED -5 /** An encoder or decoder structure is invalid or already freed @hideinitializer*/ #define OPUS_INVALID_STATE -6 /** Memory allocation has failed @hideinitializer*/ #define OPUS_ALLOC_FAIL -7 /**@}*/ /** @cond OPUS_INTERNAL_DOC */ /**Export control for opus functions */ #if defined(__GNUC__) && defined(OPUS_BUILD) # define OPUS_EXPORT __attribute__ ((visibility ("default"))) /** These are the actual Encoder CTL ID numbers. * They should not be used directly by applications. */ #define OPUS_SET_BITRATE_REQUEST 4002 #define OPUS_GET_BITRATE_REQUEST 4003 #define OPUS_SET_VBR_REQUEST 4006 #define OPUS_GET_VBR_REQUEST 4007 #define OPUS_SET_BANDWIDTH_REQUEST 4008 #define OPUS_GET_BANDWIDTH_REQUEST 4009 #define OPUS_SET_INBAND_FEC_REQUEST 4012 #define OPUS_GET_INBAND_FEC_REQUEST 4013 #define OPUS_SET_PACKET_LOSS_PERC_REQUEST 4014 #define OPUS_GET_PACKET_LOSS_PERC_REQUEST 4015 #define OPUS_SET_DTX_REQUEST 4016 #define OPUS_GET_DTX_REQUEST 4017 #define OPUS_GET_FINAL_RANGE_REQUEST 4031 /* Macros to trigger compilation errors when the wrong types are provided to a CTL */ /** @endcond */ * @{ */ /* Values for the various encoder CTLs */ #define OPUS_BITRATE_MAX -1 /**int: 0-10, inclusive * @hideinitializer */ #define OPUS_SET_COMPLEXITY(x) OPUS_SET_COMPLEXITY_REQUEST, __opus_check_int(x) /** Gets the encoder's complexity configuration, @see OPUS_SET_COMPLEXITY * @param[out] x int*: 0-10, inclusive * @hideinitializer */ #define OPUS_GET_COMPLEXITY(x) OPUS_GET_COMPLEXITY_REQUEST, __opus_check_int_ptr(x) /** Configures the bitrate in the encoder. * Rates from 500 to 512000 bits per second are meaningful as well as the * special values OPUS_BITRATE_AUTO and OPUS_BITRATE_MAX. * The value OPUS_BITRATE_MAX can be used to cause the codec to use as much rate * as it can, which is useful for controlling the rate by adjusting the output * buffer size. * @param[in] x opus_int32: bitrate in bits per second. * @hideinitializer */ #define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __opus_check_int(x) /** Gets the encoder's bitrate configuration, @see OPUS_SET_BITRATE * @param[out] x opus_int32*: bitrate in bits per second. * @hideinitializer */ #define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __opus_check_int_ptr(x) /** Configures VBR in the encoder. * The following values are currently supported: * The configured bitrate may not be met exactly because frames must * be an integer number of bytes in length. * @warning Only the MDCT mode of Opus can provide hard CBR behavior. * @hideinitializer */ #define OPUS_SET_VBR(x) OPUS_SET_VBR_REQUEST, __opus_check_int(x) /** Gets the encoder's VBR configuration, @see OPUS_SET_VBR * @param[out] x int*: 0; 1 * @hideinitializer */ #define OPUS_GET_VBR(x) OPUS_GET_VBR_REQUEST, __opus_check_int_ptr(x) /** Configures constrained VBR in the encoder. * The following values are currently supported: * This setting is irrelevant when the encoder is in CBR mode. * @warning Only the MDCT mode of Opus currently heeds the constraint. * Speech mode ignores it completely, hybrid mode may fail to obey it * if the LPC layer uses more bitrate than the constraint would have * permitted. * @hideinitializer */ #define OPUS_SET_VBR_CONSTRAINT(x) OPUS_SET_VBR_CONSTRAINT_REQUEST, __opus_check_int(x) /** Gets the encoder's constrained VBR configuration @see OPUS_SET_VBR_CONSTRAINT * @param[out] x int*: 0; 1 * @hideinitializer */ #define OPUS_GET_VBR_CONSTRAINT(x) OPUS_GET_VBR_CONSTRAINT_REQUEST, __opus_check_int_ptr(x) * This is useful when the caller knows that the input signal is currently a mono * source embedded in a stereo stream. * @param[in] x int: OPUS_AUTO (default); 1 (forced mono); 2 (forced stereo) * @hideinitializer */ /** Gets the encoder's forced channel configuration, @see OPUS_SET_FORCE_CHANNELS * @param[out] x int*: OPUS_AUTO; 0; 1 * @hideinitializer */ /** Configures the encoder's bandpass, @see OPUS_GET_BANDWIDTH * The supported values are: * - OPUS_BANDWIDTH_NARROWBAND 4kHz passband * - OPUS_BANDWIDTH_MEDIUMBAND 6kHz passband * - OPUS_BANDWIDTH_WIDEBAND 8kHz passband * - OPUS_BANDWIDTH_SUPERWIDEBAND 12kHz passband * - OPUS_BANDWIDTH_FULLBAND 20kHz passband * @param[in] x int: Bandwidth value * @hideinitializer */ #define OPUS_SET_BANDWIDTH(x) OPUS_SET_BANDWIDTH_REQUEST, __opus_check_int(x) /** Configures the type of signal being encoded. * This is a hint which helps the encoder's mode selection. * The supported values are: * - OPUS_SIGNAL_AUTO (default) * - OPUS_SIGNAL_VOICE * - OPUS_SIGNAL_MUSIC * @param[in] x int: Signal type * @hideinitializer */ #define OPUS_SET_SIGNAL(x) OPUS_SET_SIGNAL_REQUEST, __opus_check_int(x) /** Gets the encoder's configured signal type, @see OPUS_SET_SIGNAL * * @param[out] x int*: Signal type * @hideinitializer */ #define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __opus_check_int_ptr(x) /** Configures the encoder's intended application. * The initial value is a mandatory argument to the encoder_create function. * The supported values are: * - OPUS_APPLICATION_VOIP Process signal for improved speech intelligibility * - OPUS_APPLICATION_AUDIO Favor faithfulness to the original input * @param[in] x int: Application value * @hideinitializer */ /** Gets the encoder's configured application, @see OPUS_SET_APPLICATION * * @param[out] x int*: Application value * @hideinitializer */ /** Gets the total samples of delay added by the entire codec. * This can be queried by the encoder and then the provided number of samples can be * skipped on from the start of the decoder's output to provide time aligned input * and output. From the perspective of a decoding application the real data begins this many * samples late. * * The decoder contribution to this delay is identical for all decoders, but the * encoder portion of the delay may vary from implementation to implementation, * version to version, or even depend on the encoder's initial configuration. * Applications needing delay compensation should call this CTL rather than * hard-coding a value. * @param[out] x int*: Number of lookahead samples * @hideinitializer */ #define OPUS_GET_LOOKAHEAD(x) OPUS_GET_LOOKAHEAD_REQUEST, __opus_check_int_ptr(x) /** Configures the encoder's use of inband forward error correction. * @note This is only applicable to the LPC layer * * @param[in] x int: FEC flag, 0 (disabled) is default * @hideinitializer */ /** Gets encoder's configured use of inband forward error correction, @see OPUS_SET_INBAND_FEC * * @param[out] x int*: FEC flag * @hideinitializer */ /** Configures the encoder's expected packet loss percentage. * Higher values with trigger progressively more loss resistant behavior in the encoder * at the expense of quality at a given bitrate in the lossless case, but greater quality * under loss. * * @param[in] x int: Loss percentage in the range 0-100, inclusive. * @hideinitializer */ /** Gets the encoder's configured packet loss percentage, @see OPUS_SET_PACKET_LOSS_PERC * * @param[out] x int*: Loss percentage in the range 0-100, inclusive. * @hideinitializer */ /** Configures the encoder's use of discontinuous transmission. * @note This is only applicable to the LPC layer * * @param[in] x int: DTX flag, 0 (disabled) is default * @hideinitializer */ /** Gets encoder's configured use of discontinuous transmission, @see OPUS_SET_DTX * * @param[out] x int*: DTX flag * @hideinitializer */ /**@}*/ /** @defgroup genericctls Generic CTLs * @{ */ /** Resets the codec state to be equivalent to a freshly initialized state. * This should be called when switching streams in order to prevent * the back to back decoding from giving different results from * one at a time decoding. * @hideinitializer */ /** Gets the final state of the codec's entropy coder. * This is used for testing purposes, * The encoder and decoder state should be identical after coding a payload * (assuming no data corruption or software bugs) * * * @hideinitializer */ /** Gets the encoder's configured bandpass or the decoder's last bandpass, @see OPUS_SET_BANDWIDTH * @param[out] x int*: Bandwidth value * @hideinitializer */ #define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) /**@}*/ /** @defgroup libinfo Opus library information functions * @{ */ /** Converts an opus error code into a human readable string. * * @param[in] error int: Error number * @returns Error string */ /** Gets the libopus version string. * * @returns Version string */ /**@}*/ /** Gets the size of an OpusMSEncoder structure. * @returns size */ OPUS_EXPORT opus_int32 opus_multistream_encoder_get_size( int streams, /**< Total number of coded streams */ int coupled_streams /**< Number of coupled (stereo) streams */ ); /** Gets the size of an OpusMSDecoder structure. * @returns size */ OPUS_EXPORT opus_int32 opus_multistream_decoder_get_size( int streams, /**< Total number of coded streams */ int coupled_streams /**< Number of coupled (stereo) streams */ ); silk_assert( d==10||d==16 ); static inline void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */ /* last sample: find winner, copy indices and return RD value */ ind_tmp = 0; min_Q25 = silk_int32_MAX; for( j = 0; j < 2 * NLSF_QUANT_DEL_DEC_STATES; j++ ) { if( min_Q25 > RD_Q25[ j ] ) { min_Q25 = RD_Q25[ j ]; ind_tmp = j; } } for( j = 0; j < order; j++ ) { indices[ j ] = ind[ ind_tmp & ( NLSF_QUANT_DEL_DEC_STATES - 1 ) ][ j ]; silk_assert( indices[ j ] >= -NLSF_QUANT_MAX_AMPLITUDE_EXT ); silk_assert( indices[ j ] <= NLSF_QUANT_MAX_AMPLITUDE_EXT ); } indices[ 0 ] += silk_RSHIFT( ind_tmp, NLSF_QUANT_DEL_DEC_STATES_LOG2 ); silk_assert( indices[ 0 ] <= NLSF_QUANT_MAX_AMPLITUDE_EXT ); silk_assert( min_Q25 >= 0 ); return min_Q25; r_Q10 = silk_LIMIT_32( r_Q10, -(31 << 10), 30 << 10 ); psEncC->nStatesDelayedDecision, LTP_scale_Q14, Gains_Q16, pitchL, psIndices->signalType, decisionDelay ); silk_assert( nStatesDelayedDecision > 0 ); static inline void silk_PLC_update( ); static inline void silk_PLC_conceal( ); silk_PLC_conceal( psDec, psDecCtrl, frame ); silk_PLC_update( psDec, psDecCtrl ); static inline void silk_PLC_update( static inline void silk_PLC_conceal( /* Silk VAD noise level estimation */ static inline void silk_VAD_GetNoiseLevels( const opus_int32 pX[ VAD_N_BANDS ], /* I subband energies */ silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */ ); static inline void silk_VAD_GetNoiseLevels( static opus_int16 A_fb1_20 = 5394 << 1; static opus_int16 A_fb1_21 = -24290; /* (opus_int16)(20623 << 1) */ X = silk_SMLAWB( Y, Y, A_fb1_21 ); X = silk_SMULWB( Y, A_fb1_20 ); opus_int32 MS_pred_Q13[ 2 ] = { 0 }; for( n = 0; n < 2; n++ ) { } psDec->channel_state[ 1 ].first_frame_after_reset = 1; silk_PLC( psDec, &sDecCtrl, pOut, 0 ); silk_PLC( psDec, &sDecCtrl, pOut, 1 ); silk_PLC_glue_frames( psDec, pOut, L ); &psEnc->state_Fxx[ 0 ].sCmn.inputBuf[ psEnc->state_Fxx[ 0 ].sCmn.inputBufIx + 2 ], buf, nSamplesFromInput ); &psEnc->state_Fxx[ 1 ].sCmn.inputBuf[ psEnc->state_Fxx[ 1 ].sCmn.inputBufIx + 2 ], buf, nSamplesFromInput ); &psEnc->state_Fxx[ 0 ].sCmn.inputBuf[ psEnc->state_Fxx[ 0 ].sCmn.inputBufIx + 2 ], buf, nSamplesFromInput ); silk_HP_variable_cutoff( psEnc->state_Fxx ); silk_stereo_LR_to_MS( &psEnc->sStereo, &psEnc->state_Fxx[ 0 ].sCmn.inputBuf[ 2 ], &psEnc->state_Fxx[ 1 ].sCmn.inputBuf[ 2 ], psEnc->state_Fxx[ 1 ].sCmn.first_frame_after_reset = 1; opus_uint8 ec_buf_copy[ 1275 ]; silk_LP_variable_cutoff( &psEnc->sCmn.sLP, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length ); opus_int32 gain_factor_Q16; gain_factor_Q16 = silk_log2lin( silk_LSHIFT( nBits - maxBits, 7 ) / psEnc->sCmn.frame_length + SILK_FIX_CONST( 16, 7 ) ); gainMult_Q8 = silk_SMULWB( gain_factor_Q16, gainMult_Q8 ); silk_assert( order==6||order==8||order==10||order==12||order==14||order==16 ); silk_assert( order==6||order==8||order==10||order==12||order==14||order==16 ); static inline void silk_LPC_analysis_filter16_FLP( static inline void silk_LPC_analysis_filter12_FLP( static inline void silk_LPC_analysis_filter10_FLP( static inline void silk_LPC_analysis_filter8_FLP( static inline void silk_LPC_analysis_filter6_FLP( static inline void silk_LBRR_encode_FLP( ); opus_uint8 ec_buf_copy[ 1275 ]; silk_LP_variable_cutoff( &psEnc->sCmn.sLP, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length ); opus_int32 gain_factor_Q16; gainMult_Q8 = silk_SMULWB( gain_factor_Q16, gainMult_Q8 ); static inline void silk_LBRR_encode_FLP( } else { /* Fs_kHz == 16 */ silk_assert( order==6||order==8||order==10||order==12||order==14||order==16 ); static inline void silk_LDL_FLP( static inline void silk_SolveWithLowerTriangularWdiagOnes_FLP( static inline void silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( static inline void silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( static inline void silk_SolveWithLowerTriangularWdiagOnes_FLP( static inline void silk_LDL_FLP( * Fs_out (kHz) * 8 C UF U UF UF * 12 AF C UF U UF * Fs_in (kHz) 16 D AF C UF UF S->resampler_function = USE_silk_resampler_private_up2_HQ_wrapper; S->resampler_function = USE_silk_resampler_private_IIR_FIR; /* None available */ silk_assert( 0 ); return -1; S->resampler_function = USE_silk_resampler_copy; case USE_silk_resampler_private_up2_HQ_wrapper: break; case USE_silk_resampler_private_IIR_FIR: break; case USE_silk_resampler_private_down_FIR: break; default: /* Upsample 2x */ # ifdef ENABLE_ASSERTIONS # include # include #define silk_fatal(str) _silk_fatal(str, __FILE__, __LINE__); #ifdef __GNUC__ __attribute__((noreturn)) #endif static inline void _silk_fatal(const char *str, const char *file, int line) { fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str); abort(); } # define silk_assert(COND) {if (!(COND)) {silk_fatal("assertion failed: " #COND);}} # else # define silk_assert(COND) # endif opus_int32 Fs; /** Sampling rate (at the API level) */ opus_uint32 rangeFinal; int silkDecSizeBytes, celtDecSizeBytes; int ret; if (channels<1 || channels > 2) return 0; ret = silk_Get_Decoder_Size( &silkDecSizeBytes ); if(ret) return 0; silkDecSizeBytes = align(silkDecSizeBytes); celtDecSizeBytes = celt_decoder_get_size(channels); return align(sizeof(OpusDecoder))+silkDecSizeBytes+celtDecSizeBytes; int opus_decoder_init(OpusDecoder *st, opus_int32 Fs, int channels) void *silk_dec; CELTDecoder *celt_dec; int ret, silkDecSizeBytes; return OPUS_BAD_ARG; OPUS_CLEAR((char*)st, opus_decoder_get_size(channels)); /* Initialize SILK encoder */ ret = silk_Get_Decoder_Size(&silkDecSizeBytes); silkDecSizeBytes = align(silkDecSizeBytes); st->silk_dec_offset = align(sizeof(OpusDecoder)); st->celt_dec_offset = st->silk_dec_offset+silkDecSizeBytes; silk_dec = (char*)st+st->silk_dec_offset; celt_dec = (CELTDecoder*)((char*)st+st->celt_dec_offset); st->stream_channels = st->channels = channels; st->Fs = Fs; /* Reset decoder */ ret = silk_InitDecoder( silk_dec ); if(ret)return OPUS_INTERNAL_ERROR; /* Initialize CELT decoder */ ret = celt_decoder_init(celt_dec, Fs, channels); if(ret!=OPUS_OK)return OPUS_INTERNAL_ERROR; celt_decoder_ctl(celt_dec, CELT_SET_SIGNALLING(0)); st->prev_mode = 0; st->frame_size = Fs/400; return OPUS_OK; OpusDecoder *opus_decoder_create(opus_int32 Fs, int channels, int *error) OpusDecoder *st; { if (error) *error = OPUS_BAD_ARG; return NULL; } st = (OpusDecoder *)opus_alloc(opus_decoder_get_size(channels)); if (error) *error = ret; if(frame_size<0)return OPUS_BAD_ARG; sizeof(OpusDecoder)- # include exit(EXIT_FAILURE); exit(EXIT_FAILURE); unsigned char *fbytes; opus_int32 sampling_rate; opus_int32 count=0, count_act=0; int k; frame_size = sampling_rate/200; fclose(fin); fclose(fin); fclose(fout); fclose(fin); fclose(fout); fbytes = (unsigned char*)malloc(max_frame_size*channels*sizeof(short)); if (feof(fin)) break; fprintf(stderr, "Invalid payload length: %d\n",len[toggle]); if (err0 && rand()%100 < packet_loss_perc); if (output_samples>skip) { int i; for(i=0;i<(output_samples-skip)*channels;i++) { short s; s=out[i+(skip*channels)]; fbytes[2*i]=s&0xFF; fbytes[2*i+1]=(s>>8)&0xFF; } if (fwrite(fbytes, sizeof(short)*channels, output_samples-skip, fout) != (unsigned)(output_samples-skip)){ fprintf(stderr, "Error writing.\n"); return EXIT_FAILURE; } } if (output_samples 2) return 0; int opus_encoder_init(OpusEncoder* st, opus_int32 Fs, int channels, int application) if((Fs!=48000&&Fs!=24000&&Fs!=16000&&Fs!=12000&&Fs!=8000)||(channels!=1&&channels!=2)|| (application != OPUS_APPLICATION_VOIP && application != OPUS_APPLICATION_AUDIO && application != OPUS_APPLICATION_RESTRICTED_LOWDELAY)) if(ret)return OPUS_INTERNAL_ERROR; if(err!=OPUS_OK)return OPUS_INTERNAL_ERROR; OpusEncoder *opus_encoder_create(opus_int32 Fs, int channels, int application, int *error) OpusEncoder *st; if((Fs!=48000&&Fs!=24000&&Fs!=16000&&Fs!=12000&&Fs!=8000)||(channels!=1&&channels!=2)|| (application != OPUS_APPLICATION_VOIP && application != OPUS_APPLICATION_AUDIO && application != OPUS_APPLICATION_RESTRICTED_LOWDELAY)) { if (error) *error = OPUS_BAD_ARG; return NULL; } st = (OpusEncoder *)opus_alloc(opus_encoder_get_size(channels)); ret = opus_encoder_init(st, Fs, channels, application); static opus_int32 user_bitrate_to_bitrate(OpusEncoder *st, int frame_size, int max_data_bytes) { if(!frame_size)frame_size=st->Fs/400; if (st->user_bitrate_bps==OPUS_AUTO) return 60*st->Fs/frame_size + st->Fs*st->channels; else if (st->user_bitrate_bps==OPUS_BITRATE_MAX) return max_data_bytes*8*st->Fs/frame_size; else return st->user_bitrate_bps; } st->bitrate_bps = user_bitrate_to_bitrate(st, frame_size, max_data_bytes); if (st->mode == MODE_HYBRID && (redundancy || ec_tell(&enc)+37 <= 8*nb_compr_bytes)) if (st->mode != MODE_CELT_ONLY)start_band=17; st->prev_framesize = frame_size; if(frame_size<0)return OPUS_BAD_ARG; *value = st->application; *value = user_bitrate_to_bitrate(st, st->prev_framesize, 1276); if((value<1 || value>st->channels) && value != OPUS_AUTO) return OPUS_BAD_ARG; } else if (st->user_bandwidth == OPUS_BANDWIDTH_MEDIUMBAND) { if(value<0 || value>1) return OPUS_BAD_ARG; if(value<0 || value>10) return OPUS_BAD_ARG; if(value<0 || value>1) return OPUS_BAD_ARG; if(value<0 || value>1) return OPUS_BAD_ARG; if(value<0 || value>1) return OPUS_BAD_ARG; if(value!=OPUS_AUTO && value!=OPUS_SIGNAL_VOICE && value!=OPUS_SIGNAL_MUSIC) return OPUS_BAD_ARG; sizeof(OpusEncoder)- if ((value < MODE_SILK_ONLY || value > MODE_CELT_ONLY) && value != OPUS_AUTO) if (layout->mapping[i]==stream_id+layout->nb_coupled_streams) opus_int32 opus_multistream_encoder_get_size(int nb_streams, int nb_coupled_streams) if(nb_streams<1||nb_coupled_streams>nb_streams||nb_coupled_streams<0)return 0; case OPUS_GET_FINAL_RANGE_REQUEST: { int s; opus_uint32 *value = va_arg(ap, opus_uint32*); opus_uint32 tmp; *value=0; for (s=0;slayout.nb_streams;s++) { OpusEncoder *enc; enc = (OpusEncoder*)ptr; if (s < st->layout.nb_coupled_streams) ptr += align(coupled_size); else ptr += align(mono_size); ret = opus_encoder_ctl(enc, request, &tmp); if (ret != OPUS_OK) break; *value ^= tmp; } } break; case OPUS_SET_FORCE_MODE_REQUEST: if (ret != OPUS_OK) opus_int32 opus_multistream_decoder_get_size(int nb_streams, int nb_coupled_streams) if(nb_streams<1||nb_coupled_streams>nb_streams||nb_coupled_streams<0)return 0; int i, ret; ptr = (char*)st + align(sizeof(OpusMSDecoder)); ret=opus_decoder_init((OpusDecoder*)ptr, Fs, 2); if(ret!=OPUS_OK)return ret; ret=opus_decoder_init((OpusDecoder*)ptr, Fs, 1); if(ret!=OPUS_OK)return ret; ptr = (char*)st + align(sizeof(OpusMSDecoder)); if (len < 0) return OPUS_BAD_ARG; packet_offset = 0; { OpusDecoder *dec; /* For int32* GET params, just query the first stream */ opus_int32 *value = va_arg(ap, opus_int32*); dec = (OpusDecoder*)ptr; ret = opus_decoder_ctl(dec, request, value); } break; opus_uint32 tmp; *value = 0; ret = opus_decoder_ctl(dec, request, &tmp); if (ret != OPUS_OK) break; *value ^= tmp; if (ret != OPUS_OK) /* Make sure everything's aligned to sizeof(void *) bytes */ return (i+sizeof(void *)-1)&-sizeof(void *); OpusRepacketizer *rp; rp=(OpusRepacketizer *)opus_alloc(opus_repacketizer_get_size()); if(rp==NULL)return NULL; return opus_repacketizer_init(rp); int curr_nb_frames,ret; if (len<1) return OPUS_INVALID_PACKET; rp->framesize = opus_packet_get_samples_per_frame(data, 8000); } else if ((rp->toc&0xFC) != (data[0]&0xFC)) if(curr_nb_frames<1) return OPUS_INVALID_PACKET; if ((curr_nb_frames+rp->nb_frames)*rp->framesize > 960) ret=opus_packet_parse(data, len, &tmp_toc, &rp->frames[rp->nb_frames], &rp->len[rp->nb_frames], NULL); if(ret<1)return ret; opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen, int self_delimited) int i, count; opus_int32 tot_size; tot_size = 1 + (len[count-1]>=252); if (self_delimited) { int sdlen = encode_size(len[count-1], data); data += sdlen; } opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen) opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) if(merge<1) { fprintf(stderr, "-merge parameter must be at least 1.\n"); return 1; } if(fin==NULL) { fprintf(stderr, "Error opening input file: %s\n", argv[argc-2]); return 1; } if(fout==NULL) { fprintf(stderr, "Error opening output file: %s\n", argv[argc-1]); fclose(fin); return 1; } { } else { fclose(fin); fclose(fout); return 1; }