Ticket #44: VPS_Fix_jpadia_vidyo_150105.2.patch
File VPS_Fix_jpadia_vidyo_150105.2.patch, 10.5 KB (added by jaypadia, 10 years ago) |
---|
-
source/Lib/TLibCommon/TypeDef.h
292 292 #endif 293 293 #define R0157_RESTRICT_PPSID_FOR_CGS_LUT 1 ///< JCTVC-R0157: when pps_pic_parameter_set_id greater than or equal to 8, colour_mapping_enabled_flag shall be equal to 0 294 294 295 #define VPS_FIX_TO_MATCH_SPEC 1 296 295 297 /// scalability types 296 298 enum ScalabilityType 297 299 { -
source/Lib/TLibDecoder/TDecCAVLC.cpp
1724 1724 #endif 1725 1725 for(i = 1; i < numOutputLayerSets; i++) 1726 1726 { 1727 if( i > (vps->getNumLayerSets() - 1) ) 1727 if ( 1728 #if VPS_FIX_TO_MATCH_SPEC 1729 (vps->getNumLayerSets() > 2) && 1730 #endif 1731 (i > (vps->getNumLayerSets() - 1))) 1728 1732 { 1729 1733 Int numBits = 1; 1730 1734 while ((1 << numBits) < (vps->getNumLayerSets() - 1)) … … 1739 1743 } 1740 1744 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i); 1741 1745 #if Q0078_ADD_LAYER_SETS 1746 #if VPS_FIX_TO_MATCH_SPEC 1747 if (i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() == 2) 1748 #else 1742 1749 if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 1750 #endif 1743 1751 #else 1744 if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 1752 #if VPS_FIX_TO_MATCH_SPEC 1753 if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() == 2 ) 1754 #else 1755 if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 1745 1756 #endif 1757 #endif 1746 1758 { 1747 1759 #if NUM_OL_FLAGS 1748 1760 for(j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++) … … 1784 1796 vps->getProfileLevelTierIdx(i)->assign(vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet), -1); 1785 1797 for(j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet) ; j++) 1786 1798 { 1787 if( vps->getNecessaryLayerFlag(i, j) ) 1799 if (vps->getNecessaryLayerFlag(i, j) 1800 #if VPS_FIX_TO_MATCH_SPEC 1801 && (vps->getNumProfileTierLevel()-1) > 0 1802 #endif 1803 ) 1788 1804 { 1789 1805 READ_CODE( numBitsForPtlIdx, uiCode, "profile_level_tier_idx[i]" ); 1790 1806 vps->setProfileLevelTierIdx(i, j, uiCode ); … … 1975 1991 1976 1992 if( vps->getRepFormatIdxPresentFlag() ) 1977 1993 { 1978 for(i = 1; i < vps->getMaxLayers(); i++) 1994 #if VPS_FIX_TO_MATCH_SPEC 1995 for (i = vps->getBaseLayerInternalFlag() ? 1 : 0; i < vps->getMaxLayers(); i++) 1996 #else 1997 for (i = 1; i < vps->getMaxLayers(); i++) 1998 #endif 1979 1999 { 1980 2000 Int numBits = 1; 1981 2001 while ((1 << numBits) < (vps->getVpsNumRepFormats())) … … 2464 2484 { 2465 2485 #if DPB_INTERNAL_BL_SIG 2466 2486 uiCode=0; 2467 if(vps->getBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) != 0 ) ) 2487 if ( 2488 #if VPS_FIX_TO_MATCH_SPEC 2489 vps->getNecessaryLayerFlag(i, k) && 2468 2490 #endif 2469 READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode ); 2491 (vps->getBaseLayerInternalFlag() || (vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) != 0))) 2492 #endif 2493 READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode ); 2470 2494 } 2471 2495 READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" ); vps->setMaxVpsNumReorderPics( i, j, uiCode); 2472 2496 #if RESOLUTION_BASED_DPB … … 2735 2759 READ_FLAG( uiCode, "tiles_not_in_use_flag" ); vps->setTilesNotInUseFlag(uiCode == 1); 2736 2760 if (!uiCode) 2737 2761 { 2738 for(i = 0; i < vps->getMaxLayers(); i++) 2762 #if VPS_FIX_TO_MATCH_SPEC 2763 for (i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++) 2764 #else 2765 for (i = 0; i < vps->getMaxLayers(); i++) 2766 #endif 2739 2767 { 2740 2768 READ_FLAG( uiCode, "tiles_in_use_flag[ i ]" ); vps->setTilesInUseFlag(i, (uiCode == 1)); 2741 2769 if (uiCode) … … 2749 2777 } 2750 2778 #endif 2751 2779 2752 for(i = 1; i < vps->getMaxLayers(); i++) 2780 #if VPS_FIX_TO_MATCH_SPEC 2781 for (i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++) 2782 #else 2783 for (i = 1; i < vps->getMaxLayers(); i++) 2784 #endif 2753 2785 { 2754 2786 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 2755 2787 { … … 2770 2802 READ_FLAG( uiCode, "wpp_not_in_use_flag" ); vps->setWppNotInUseFlag(uiCode == 1); 2771 2803 if (!uiCode) 2772 2804 { 2773 for(i = 0; i < vps->getMaxLayers(); i++) 2805 #if VPS_FIX_TO_MATCH_SPEC 2806 for (i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++) //Added baselayerInternalFlagCondition: jpadia_vidyo 2807 #else 2808 for (i = 0; i < vps->getMaxLayers(); i++) //Added baselayerInternalFlagCondition: jpadia_vidyo 2809 #endif 2774 2810 { 2775 2811 READ_FLAG( uiCode, "wpp_in_use_flag[ i ]" ); vps->setWppInUseFlag(i, (uiCode == 1)); 2776 2812 } … … 2802 2838 { 2803 2839 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 2804 2840 { 2805 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 2806 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 2807 { 2808 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 2809 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 2841 #if VPS_FIX_TO_MATCH_SPEC 2842 if (vps->getBaseLayerInternalFlag() || vps->getRefLayerId(vps->getLayerIdInNuh(i), j)) 2843 { 2844 #endif 2845 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 2846 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 2810 2847 { 2811 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 2848 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 2849 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 2850 { 2851 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 2852 } 2812 2853 } 2813 } 2854 #if VPS_FIX_TO_MATCH_SPEC 2855 } 2856 #endif 2814 2857 } 2815 2858 } 2816 2859 } … … 4795 4838 } 4796 4839 } 4797 4840 } 4798 for (Int h = 1; h < vps->getNumOutputLayerSets(); h++) 4841 #if VPS_FIX_TO_MATCH_SPEC 4842 if (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 0) 4799 4843 { 4800 Int lsIdx = vps->getOutputLayerSetIdx( h ); 4801 READ_UVLC( uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode); 4802 for( Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++ ) 4803 { 4804 READ_UVLC( uiCode, "num_partitions_in_scheme_minus1[h][j]" ); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode); 4805 for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++ ) 4806 { 4807 for( Int r = 0; r < vps->getNumLayersInIdList( lsIdx ); r++ ) 4808 { 4809 READ_FLAG( uiCode, "layer_included_in_partition_flag[h][j][k][r]" ); vps->setLayerIncludedInPartitionFlag(h, j, k, r, uiCode ? true : false); 4810 } 4811 } 4812 } 4813 for( Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++ ) 4814 { 4815 for( Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++ ) 4816 { 4817 READ_UVLC( uiCode, "num_bsp_schedules_minus1[h][i][t]"); vps->setNumBspSchedulesMinus1(h, i, t, uiCode); 4818 for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ ) 4819 { 4820 for( Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++ ) 4821 { 4822 READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode); 4823 READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][t][j][k]"); vps->setBspSchedIdx(h, i, t, j, k, uiCode); 4824 } 4825 } 4826 } 4827 } 4844 #endif 4845 for (Int h = 1; h < vps->getNumOutputLayerSets(); h++) 4846 { 4847 Int lsIdx = vps->getOutputLayerSetIdx(h); 4848 READ_UVLC(uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode); 4849 #if VPS_FIX_TO_MATCH_SPEC 4850 for (Int j = 1; j < vps->getNumSignalledPartitioningSchemes(h) + 1; j++) 4851 #else 4852 for (Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++) 4853 #endif 4854 { 4855 READ_UVLC(uiCode, "num_partitions_in_scheme_minus1[h][j]"); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode); 4856 for (Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++) 4857 { 4858 for (Int r = 0; r < vps->getNumLayersInIdList(lsIdx); r++) 4859 { 4860 READ_FLAG(uiCode, "layer_included_in_partition_flag[h][j][k][r]"); vps->setLayerIncludedInPartitionFlag(h, j, k, r, uiCode ? true : false); 4861 } 4862 } 4863 } 4864 for (Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++) 4865 { 4866 for (Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++) 4867 { 4868 READ_UVLC(uiCode, "num_bsp_schedules_minus1[h][i][t]"); vps->setNumBspSchedulesMinus1(h, i, t, uiCode); 4869 for (Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++) 4870 { 4871 #if VPS_FIX_TO_MATCH_SPEC 4872 for (Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++) 4873 #else 4874 for (Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++) 4875 #endif 4876 { 4877 #if VPS_FIX_TO_MATCH_SPEC 4878 if (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 1) 4879 { 4880 #endif 4881 #if VPS_FIX_TO_MATCH_SPEC 4882 Int numBits = 1; 4883 while ((1 << numBits) < (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams())) 4884 { 4885 numBits++; 4886 } 4887 READ_CODE(numBits, uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode); 4888 #else 4889 READ_UVLC(uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode); 4890 #endif 4891 #if VPS_FIX_TO_MATCH_SPEC 4892 } 4893 #endif 4894 READ_UVLC(uiCode, "bsp_comb_sched_idx[h][i][t][j][k]"); vps->setBspSchedIdx(h, i, t, j, k, uiCode); 4895 } 4896 } 4897 } 4898 } 4828 4899 4829 4830 4900 // To be done: Check each layer included in not more than one BSP in every partitioning scheme, 4901 // and other related checks associated with layers in bitstream partitions. 4831 4902 4903 } 4904 #if VPS_FIX_TO_MATCH_SPEC 4832 4905 } 4906 #endif 4833 4907 } 4834 4908 #endif 4835 4909 #endif