コード例 #1
0
        public VorbisFloor(ByteArray aByteArray)
        {
            count = aByteArray.ReadBitsAsByte(6) + 1;

            Logger.LogWarning("Vorbis Floor Count:" + count.ToString());

            header = new FloorHeader[count];

            for (int i = 0; i < count; i++)
            {
                header[i] = new FloorHeader(aByteArray);
            }
        }
コード例 #2
0
        private void DecodeFloor()
        {
            for (int i = 0; i < vorbisHeader.identification.audioChannels; i++)
            {
                Byte        lSubMapNumber = mappingHeader.mux[i];
                Byte        lFloorNumber  = mappingHeader.subMapFloor[lSubMapNumber];
                FloorHeader lFloorHeader  = vorbisHeader.setup.floor.header[lFloorNumber];

                int lReturnCode = lFloorHeader.DecodePacket(byteArray, vorbisHeader.setup.codebook.headerArray);

                if (lReturnCode == 1)
                {
                    noResidue[i] = 0x01;
                }
                else
                {
                    noResidue[i] = 0x00;
                }
            }
        }
コード例 #3
0
        private void ComputeCurve(double[][] aBufferArrayArray)
        {
            for (int i = 0; i < vorbisHeader.identification.audioChannels; i++)
            {
                if (noResidue[i] == 0x00)
                {
                    Byte        lSubMapNumber = mappingHeader.mux[i];
                    Byte        lFloorNumber  = mappingHeader.subMapFloor[lSubMapNumber];
                    FloorHeader lFloorHeader  = vorbisHeader.setup.floor.header[lFloorNumber];

                    double[] lFloorCurve = new double[window.n];
                    lFloorHeader.ComputeCurve(lFloorCurve, window.n);

                    for (int j = 0; j < window.n; j++)
                    {
                        lFloorCurve[j] *= residueArray[i][j];
                    }

                    MdctFloat mdct = MdctFloat.GetMdctFloat(window.n);
                    aBufferArrayArray[i] = new double[window.n];
                    mdct.imdct(lFloorCurve, window.windowArray, aBufferArrayArray[i]);
                }
            }
        }