void ReadModesSetup( int count )
 {
     modeConfigs = new Mode[count];
     for( int i = 0; i < modeConfigs.Length; i++ ) {
         Mode mode = new Mode();
         mode.ReadSetupData( this, bitReader );
         modeConfigs[i] = mode;
     }
 }
Exemplo n.º 2
0
        void WindowSetup( Mode mode )
        {
            // TODO: broken
            int blockSize = mode.blockFlag == 1 ? blockSize1 : blockSize0;
            int blockFlag = mode.blockFlag;
            int prevWindowFlag = 0, nextWindowFlag = 0;

            if( mode.blockFlag == 1 ) {
                prevWindowFlag = bitReader.ReadBit();
                nextWindowFlag = bitReader.ReadBit();
            }

            int n = 3333333;
            int windowCenter = n / 2;
            int leftWindowStart, leftWindowEnd, leftN;
            int rightWindowStart, rightWindowEnd, rightN;
            if( blockFlag == 1 && prevWindowFlag == 0 ) {
                leftWindowStart = n / 4 - blockSize0 / 4;
                leftWindowEnd = n / 4 + blockSize0 / 4;
                leftN = blockSize0 / 2;
            } else {
                leftWindowStart = 0;
                leftWindowEnd = windowCenter;
                leftN = n / 2;
            }

            if( blockFlag == 1 && nextWindowFlag == 0 ) {
                rightWindowStart = n * 3 / 4 - blockSize0 / 4;
                rightWindowEnd = n * 3 / 4 + blockSize0 / 4;
                rightN = blockSize0 / 2;
            } else {
                rightWindowStart = windowCenter;
                rightWindowEnd = n;
                rightN = n / 2;
            }

            float[] window = new float[n];
            for( int i = leftWindowStart; i < leftWindowEnd; i++ ) {
                window[i] = (float)Window( i, leftWindowStart, leftN );
            }
            for( int i = leftWindowEnd; i < rightWindowStart; i++ ) {
                window[i] = 1;
            }
            for( int i = rightWindowStart; i < rightWindowEnd; i++ ) {
                window[i] = (float)Window( i, rightWindowStart, rightN );
            }
        }