Exemple #1
0
 CCE(int frameLength)
 {
     ics         = new ICStream(frameLength);
     channelPair = new bool[8];
     idSelect    = new int[8];
     chSelect    = new int[8];
     gain        = new float[16, 120];
 }
        public void process(ICStream ics, float[] data, FilterBank filterBank, SampleFrequency sf)
        {
            var info = ics.getInfo();

            if (!info.isEightShortFrame())
            {
                int samples = frameLength << 1;
                var inf     = new float[2048];
                var outf    = new float[2048];

                for (int i = 0; i < samples; i++)
                {
                    inf[i] = states[samples + i - lag] * CODEBOOK[coef];
                }

                throw new NotImplementedException();

                //filterBank.processLTP(info.getWindowSequence(), info.getWindowShape(ICSInfo.CURRENT), info.getWindowShape(ICSInfo.PREVIOUS), inf, outf);

                //if (ics.isTNSDataPresent()) ics.getTNS().process(ics, outf, sf, true);

                var swbOffsets   = info.getSWBOffsets();
                int swbOffsetMax = info.getSWBOffsetMax();
                for (int sfb = 0; sfb < lastBand; sfb++)
                {
                    if (longUsed[sfb])
                    {
                        int low  = swbOffsets[sfb];
                        int high = Math.Min(swbOffsets[sfb + 1], swbOffsetMax);

                        for (int bin = low; bin < high; bin++)
                        {
                            data[bin] += outf[bin];
                        }
                    }
                }
            }
        }
 public CPE(int frameLength)
 {
     icsL = new ICStream(frameLength);
     icsR = new ICStream(frameLength);
 }