/// <summary>
 /// *
 /// </summary>
 internal override void ReadAllocation(Bitstream stream, Header header, Crc16 crc)
 {
     Allocation = stream.GetBitsFromBuffer(4);
     if (Allocation > 14)
     {
         return;
     }
     Channel2Allocation = stream.GetBitsFromBuffer(4);
     if (Channel2Allocation > 14)
     {
         return;
     }
     if (crc != null)
     {
         crc.AddBits(Allocation, 4);
         crc.AddBits(Channel2Allocation, 4);
     }
     if (Allocation != 0)
     {
         Samplelength = Allocation + 1;
         Factor       = TableFactor[Allocation];
         Offset       = TableOffset[Allocation];
     }
     if (Channel2Allocation != 0)
     {
         Channel2Samplelength = Channel2Allocation + 1;
         Channel2Factor       = TableFactor[Channel2Allocation];
         Channel2Offset       = TableOffset[Channel2Allocation];
     }
 }
Exemple #2
0
        /// <summary>
        /// *
        /// </summary>
        internal override void ReadAllocation(Bitstream stream, Header header, Crc16 crc)
        {
            int length = GetAllocationLength(header);

            Allocation         = stream.GetBitsFromBuffer(length);
            Channel2Allocation = stream.GetBitsFromBuffer(length);
            if (crc != null)
            {
                crc.AddBits(Allocation, length);
                crc.AddBits(Channel2Allocation, length);
            }
        }
Exemple #3
0
 /// <summary>
 /// *
 /// </summary>
 internal override void ReadScaleFactorSelection(Bitstream stream, Crc16 crc)
 {
     if (Allocation != 0)
     {
         Scfsi         = stream.GetBitsFromBuffer(2);
         Channel2Scfsi = stream.GetBitsFromBuffer(2);
         if (crc != null)
         {
             crc.AddBits(Scfsi, 2);
             crc.AddBits(Channel2Scfsi, 2);
         }
     }
 }
Exemple #4
0
 /// <summary>
 /// *
 /// </summary>
 internal override void ReadAllocation(Bitstream stream, Header header, Crc16 crc)
 {
     if ((Allocation = stream.GetBitsFromBuffer(4)) == 15)
     {
     }
     // cerr << "WARNING: stream contains an illegal allocation!\n";
     // MPEG-stream is corrupted!
     crc?.AddBits(Allocation, 4);
     if (Allocation != 0)
     {
         Samplelength = Allocation + 1;
         Factor       = TableFactor[Allocation];
         Offset       = TableOffset[Allocation];
     }
 }