private void parseSequenceHeader()
        throws MpegVideoDecodeException, IOException
    {
        Statistics.startLog(PARSE_SEQ_HEADER_STRING);

	if( m_ioTool.isEOF() )
	    return;
	
        if( m_ioTool.getBits(32) != SEQ_START_CODE )
        {
            throw new MpegVideoDecodeException("SEQ_START_CODE expected");
        }

	Debug.println(Debug.INFO, "SEQ_START_CODE");

        m_iWidth = m_ioTool.getBits(12);
        m_iHeight = m_ioTool.getBits(12);

	//System.out.println(m_iWidth + "x" + m_iHeight );
	
        m_iMbWidth = (m_iWidth + 15 ) / 16;
        m_iMbHeight = (m_iHeight + 16 ) / 16;

        m_iAspectRatio = m_ioTool.getBits(4);
        m_iPicRate = m_ioTool.getBits(4);
        m_iBitRate = m_ioTool.getBits(18);

        m_ioTool.skipBits(1);

        m_iVBVbuffer = m_ioTool.getBits(10);
        m_bConstParam = m_ioTool.getBits(1) == 1;
        m_bQuantMatrix = m_ioTool.getBits(1) == 1;

        if( m_bQuantMatrix )
        {
            for(int i = 0 ; i < 64 ; ++i)
                m_intraMatrix[i] = m_ioTool.getBits(8) & 0xFF;
            m_IDCT.norm(m_intraMatrix);
        }

        m_bQuantMatrix = m_ioTool.getBits(1) == 1;

        if( m_bQuantMatrix )
        {
            for( int i = 0 ; i < 64 ; ++i)
                m_nonIntraMatrix[i] = m_ioTool.getBits(8) & 0xFF;
            m_IDCT.norm(m_nonIntraMatrix);
        }
        m_ioTool.nextStartCode();
        while( m_ioTool.nextBits(USER_START_CODE, 32 ) )
        {
            m_ioTool.skipBits(32);
            while( ! m_ioTool.nextBits(0x1, 24 ) )
            {
                m_ioTool.skipBits(8);
            }
        }

        Statistics.endLog(PARSE_SEQ_HEADER_STRING);
    }