Ticket #1358: pps(sps)_extension_flag.patch

File pps(sps)_extension_flag.patch, 2.0 KB (added by kolya, 10 years ago)
  • source/Lib/TLibDecoder/TDecCAVLC.cpp

    diff --git a/source/Lib/TLibDecoder/TDecCAVLC.cpp b/source/Lib/TLibDecoder/TDecCAVLC.cpp
    index f603ad1..975a269 100644
    a b  
    322322  READ_FLAG( uiCode, "pps_extension_present_flag");
    323323  if (uiCode)
    324324  {
    325     Bool pps_extension_flags[NUM_PPS_EXTENSION_FLAGS];
    326     for(Int i=0; i<NUM_PPS_EXTENSION_FLAGS; i++)
     325    Bool pps_extension_Xbits[NUM_PPS_EXTENSION_FLAGS];
     326
     327    READ_FLAG( uiCode, "pps_range_extensions_flag" );
     328    pps_extension_Xbits[0] = uiCode!=0;
     329
     330    for(Int i = 1; i < NUM_PPS_EXTENSION_FLAGS; i++)
    327331    {
    328       READ_FLAG( uiCode, "pps_extension_flag[]" );
    329       pps_extension_flags[i] = uiCode!=0;
     332      READ_FLAG( uiCode, "pps_extension_7bits" );
     333      pps_extension_Xbits[i] = uiCode!=0;
    330334    }
    331335
    332336    Bool bSkipTrailingExtensionBits=false;
    333337    for(Int i=0; i<NUM_PPS_EXTENSION_FLAGS; i++) // loop used so that the order is determined by the enum.
    334338    {
    335       if (pps_extension_flags[i])
     339      if (pps_extension_Xbits[i])
    336340      {
    337341        switch (PPSExtensionFlagIndex(i))
    338342        {
     
    754758  READ_FLAG( uiCode, "sps_extension_present_flag");
    755759  if (uiCode)
    756760  {
    757     Bool sps_extension_flags[NUM_SPS_EXTENSION_FLAGS];
    758     for(Int i=0; i<NUM_SPS_EXTENSION_FLAGS; i++)
     761    Bool sps_extension_Xbits[NUM_SPS_EXTENSION_FLAGS];
     762
     763    READ_FLAG( uiCode, "sps_range_extensions_flag" );
     764    sps_extension_Xbits[0] = uiCode!=0;
     765
     766    for(Int i=1; i<NUM_SPS_EXTENSION_FLAGS; i++)
    759767    {
    760       READ_FLAG( uiCode, "sps_extension_flag[]" );
    761       sps_extension_flags[i] = uiCode!=0;
     768      READ_FLAG( uiCode, "sps_extension_7bits" );
     769      sps_extension_Xbits[i] = uiCode!=0;
    762770    }
    763771
    764772    Bool bSkipTrailingExtensionBits=false;
    765773    for(Int i=0; i<NUM_SPS_EXTENSION_FLAGS; i++) // loop used so that the order is determined by the enum.
    766774    {
    767       if (sps_extension_flags[i])
     775      if (sps_extension_Xbits[i])
    768776      {
    769777        switch (SPSExtensionFlagIndex(i))
    770778        {