Exemplo n.º 1
0
  bool init ( BitReader br )
  {
    br.reset();
    if ( br.getByte() != 0x64
        || br.getByte() != 0x58
        || br.getByte() != 0x20
        || br.getByte() != 0x25 )
    {
        return false;
    }

    // * dca.c dca_exss_parse_header

    br.skip(8); // user data
    _ssIndex = br.getInt(2);
    bool blownUp(br.getBool());
    _headerSize = br.getInt(blownUp ? 12 : 8);
    //hdLen = ((hdHdr[6] & 0xf) << 11) + (hdHdr[7] << 3) + ((hdHdr[8] >> 5) & 7) + 1;
    _hdSize = br.getInt(blownUp ? 20: 16) + 1;

    return true;
  }
Exemplo n.º 2
0
  bool init ( BitReader br )
  {
    br.reset();
    // 16 bit formats
    if ( br.getByte() == 0x7f
            && br.getByte() == 0xfe
            && br.getByte() == 0x80
            && br.getByte() == 0x01 )
    {
        _is14Bit = false;
    }
    else
    {
      // 14 bit formats
      br.reset();
      if (br.getByte() == 0x1f
        && br.getByte() == 0xff
        && br.getByte() == 0xe8
        && br.getByte() == 0x00
        && br.getByte() == 0x07
        && br.getByte(4) == 0xf)
      {
        _is14Bit = true;
/*
 * The original code was this, not sure I can parse the 14bit the same as the
 * 16 bit, but I can look at that later if there are problems
    sampleBlocks = ((be2uint16(hdr16[2]) << 4)  & 0x70)
            | ((be2uint16(hdr16[3]) >> 10) & 0x0f);
    ++sampleBlocks;
    amode = (be2uint16(hdr16[4]) >> 4)  & 0x3f;
    sfreq = (be2uint16(hdr16[4]) >> 0)  & 0x0f;
    lfe   = (be2uint16(hdr16[6]) >> 11) & 0x03;
*/
      }
      else
      {
        return false; // invalid frame data
      }
    }

    _isNormalFrame = br.getBool(); // 1
    _shortSamples = br.getInt(5); // 6
    _isCrcPresent = br.getBool(); // 7
    _sampleBlocks = br.getInt(7) + 1; // 14
    _frameSize = br.getInt(14) + 1; // 28
    _channelLayout = br.getInt(6);
    _sampleIndex = br.getInt(4);
    _bitRate = br.getInt(5);
    _downMix = br.getBool();
    _dynamicRange = br.getBool();
    _timeStamp = br.getBool();
    _auxiliaryData = br.getBool();
    _hdcd = br.getBool();
    _externalDescription = br.getInt(3);
    _externalCoding = br.getBool();
    _aspf = br.getBool();
    _lfe = br.getInt(2);
    _predictorHistory = br.getBool();

    if ( _isCrcPresent )
      _crc = br.getInt(16);

    _multirateInter = br.getBool();
    _version = br.getInt(4);
    _copyHistory = br.getInt(2);
    _sourcePcmResolution = br.getInt(3);
    _frontSum = br.getBool();
    _surroundSum = br.getBool();
    _dialogNormalization = br.getInt(4);
    return true;
  }