int VvcSpsUnit::vui_parameters()
{
    bool progressive_source_flag = m_reader.getBit();
    bool interlaced_source_flag = m_reader.getBit();
    m_reader.skipBit();  // non_packed_constraint_flag
    m_reader.skipBit();  // non_projected_constraint_flag

    if (m_reader.getBit())  // aspect_ratio_info_present_flag
    {
        if (m_reader.getBits(8) == EXTENDED_SAR)  // aspect_ratio_idc
            m_reader.skipBits(32);                // sar_width, sar_height
    }

    if (m_reader.getBit())   // overscan_info_present_flag
        m_reader.skipBit();  // overscan_appropriate_flag
    if (m_reader.getBit())   // colour_description_present_flag
    {
        colour_primaries = m_reader.getBits(8);
        transfer_characteristics = m_reader.getBits(8);
        matrix_coeffs = m_reader.getBits(8);
        full_range_flag = m_reader.getBit();
    }

    if (m_reader.getBit())  // chroma_loc_info_present_flag
    {
        if (progressive_source_flag && !interlaced_source_flag)
            chroma_sample_loc_type_frame = extractUEGolombCode();
        else
        {
            chroma_sample_loc_type_top_field = extractUEGolombCode();
            if (chroma_sample_loc_type_top_field > 5)
                return 1;
            chroma_sample_loc_type_bottom_field = extractUEGolombCode();
            if (chroma_sample_loc_type_bottom_field > 5)
                return 1;
        }
    }
    return 0;
}
int VvcSpsUnit::vui_parameters()
{
    bool progressive_source_flag = m_reader.getBit();
    bool interlaced_source_flag = m_reader.getBit();
    m_reader.skipBit();   
    m_reader.skipBit();   

    if (m_reader.getBit())   
    {
        if (m_reader.getBits(8) == EXTENDED_SAR)   
            m_reader.skipBits(32);                 
    }

    if (m_reader.getBit())    
        m_reader.skipBit();   
    if (m_reader.getBit())    
    {
        colour_primaries = m_reader.getBits(8);
        transfer_characteristics = m_reader.getBits(8);
        matrix_coeffs = m_reader.getBits(8);
        full_range_flag = m_reader.getBit();
    }

    if (m_reader.getBit())   
    {
        if (progressive_source_flag && !interlaced_source_flag)
            chroma_sample_loc_type_frame = extractUEGolombCode();
        else
        {
            chroma_sample_loc_type_top_field = extractUEGolombCode();
            if (chroma_sample_loc_type_top_field > 5)
                return 1;
            chroma_sample_loc_type_bottom_field = extractUEGolombCode();
            if (chroma_sample_loc_type_bottom_field > 5)
                return 1;
        }
    }
    return 0;
}