Changeset 967 in SHVCSoftware
- Timestamp:
- 6 Jan 2015, 19:22:06 (10 years ago)
- Location:
- branches/SHM-upgrade/source/Lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-upgrade/source/Lib/TLibCommon/TypeDef.h
r965 r967 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 -
branches/SHM-upgrade/source/Lib/TLibDecoder/TDecCAVLC.cpp
r965 r967 3119 3119 for(i = 1; i < numOutputLayerSets; i++) 3120 3120 { 3121 #if VPS_FIX_TO_MATCH_SPEC 3122 if( vps->getNumLayerSets() > 2 && i >= vps->getNumLayerSets() ) 3123 #else 3121 3124 if( i > (vps->getNumLayerSets() - 1) ) 3125 #endif 3122 3126 { 3123 3127 Int numBits = 1; … … 3134 3138 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i); 3135 3139 #if Q0078_ADD_LAYER_SETS 3136 if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 3137 #else 3138 if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 3140 #if VPS_FIX_TO_MATCH_SPEC 3141 if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() == 2 ) 3142 #else 3143 if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 3144 #endif 3145 #else 3146 #if VPS_FIX_TO_MATCH_SPEC 3147 if( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() == 2 ) 3148 #else 3149 if( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 3150 #endif 3139 3151 #endif 3140 3152 { … … 3179 3191 for(j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet) ; j++) 3180 3192 { 3193 #if VPS_FIX_TO_MATCH_SPEC 3194 if( vps->getNecessaryLayerFlag(i, j) && (vps->getNumProfileTierLevel()-1) > 0 ) 3195 #else 3181 3196 if( vps->getNecessaryLayerFlag(i, j) ) 3182 { 3183 READ_CODE( numBitsForPtlIdx, uiCode, "profile_level_tier_idx[i]" ); 3197 #endif 3198 { 3199 READ_CODE( numBitsForPtlIdx, uiCode, "profile_level_tier_idx[i]" ); 3184 3200 vps->setProfileLevelTierIdx(i, j, uiCode ); 3185 3201 … … 3371 3387 if( vps->getRepFormatIdxPresentFlag() ) 3372 3388 { 3373 for(i = 1; i < vps->getMaxLayers(); i++) 3389 #if VPS_FIX_TO_MATCH_SPEC 3390 for( i = vps->getBaseLayerInternalFlag() ? 1 : 0; i < vps->getMaxLayers(); i++ ) 3391 #else 3392 for (i = 1; i < vps->getMaxLayers(); i++) 3393 #endif 3374 3394 { 3375 3395 Int numBits = 1; … … 3860 3880 #if DPB_INTERNAL_BL_SIG 3861 3881 uiCode=0; 3862 if(vps->getBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) != 0 ) ) 3882 3883 #if VPS_FIX_TO_MATCH_SPEC 3884 if( vps->getNecessaryLayerFlag(i, k) && ( vps->getBaseLayerInternalFlag() || vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) ) ) 3885 #else 3886 if(vps->getBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) != 0 ) ) 3887 #endif 3863 3888 #endif 3864 3889 READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode ); … … 4131 4156 if (!uiCode) 4132 4157 { 4133 for(i = 0; i < vps->getMaxLayers(); i++) 4158 #if VPS_FIX_TO_MATCH_SPEC 4159 for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++ ) 4160 #else 4161 for (i = 0; i < vps->getMaxLayers(); i++) 4162 #endif 4134 4163 { 4135 4164 READ_FLAG( uiCode, "tiles_in_use_flag[ i ]" ); vps->setTilesInUseFlag(i, (uiCode == 1)); … … 4145 4174 #endif 4146 4175 4147 for(i = 1; i < vps->getMaxLayers(); i++) 4176 #if VPS_FIX_TO_MATCH_SPEC 4177 for( i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++ ) 4178 #else 4179 for (i = 1; i < vps->getMaxLayers(); i++) 4180 #endif 4148 4181 { 4149 4182 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) … … 4166 4199 if (!uiCode) 4167 4200 { 4168 for(i = 0; i < vps->getMaxLayers(); i++) 4201 #if VPS_FIX_TO_MATCH_SPEC 4202 for (i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++) 4203 #else 4204 for (i = 0; i < vps->getMaxLayers(); i++) 4205 #endif 4169 4206 { 4170 4207 READ_FLAG( uiCode, "wpp_in_use_flag[ i ]" ); vps->setWppInUseFlag(i, (uiCode == 1)); … … 4198 4235 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 4199 4236 { 4200 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 4201 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 4202 { 4203 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 4204 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 4237 #if VPS_FIX_TO_MATCH_SPEC 4238 if( vps->getBaseLayerInternalFlag() || vps->getRefLayerId(vps->getLayerIdInNuh(i), j) ) 4239 { 4240 #endif 4241 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 4242 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 4205 4243 { 4206 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 4244 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 4245 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 4246 { 4247 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 4248 } 4207 4249 } 4208 } 4250 #if VPS_FIX_TO_MATCH_SPEC 4251 } 4252 #endif 4209 4253 } 4210 4254 } … … 4642 4686 } 4643 4687 } 4644 for (Int h = 1; h < vps->getNumOutputLayerSets(); h++) 4645 { 4646 Int lsIdx = vps->getOutputLayerSetIdx( h ); 4647 READ_UVLC( uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode); 4648 for( Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++ ) 4649 { 4650 READ_UVLC( uiCode, "num_partitions_in_scheme_minus1[h][j]" ); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode); 4651 for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++ ) 4652 { 4653 for( Int r = 0; r < vps->getNumLayersInIdList( lsIdx ); r++ ) 4654 { 4655 READ_FLAG( uiCode, "layer_included_in_partition_flag[h][j][k][r]" ); vps->setLayerIncludedInPartitionFlag(h, j, k, r, uiCode ? true : false); 4656 } 4657 } 4658 } 4659 for( Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++ ) 4660 { 4661 for( Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++ ) 4662 { 4663 READ_UVLC( uiCode, "num_bsp_schedules_minus1[h][i][t]"); vps->setNumBspSchedulesMinus1(h, i, t, uiCode); 4664 for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ ) 4665 { 4666 for( Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++ ) 4688 #if VPS_FIX_TO_MATCH_SPEC 4689 if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 0 ) 4690 { 4691 #endif 4692 for (Int h = 1; h < vps->getNumOutputLayerSets(); h++) 4693 { 4694 Int lsIdx = vps->getOutputLayerSetIdx(h); 4695 READ_UVLC(uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode); 4696 #if VPS_FIX_TO_MATCH_SPEC 4697 for (Int j = 1; j < vps->getNumSignalledPartitioningSchemes(h) + 1; j++) 4698 #else 4699 for (Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++) 4700 #endif 4701 { 4702 READ_UVLC(uiCode, "num_partitions_in_scheme_minus1[h][j]"); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode); 4703 for (Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++) 4704 { 4705 for (Int r = 0; r < vps->getNumLayersInIdList(lsIdx); r++) 4667 4706 { 4668 READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode); 4669 READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][t][j][k]"); vps->setBspSchedIdx(h, i, t, j, k, uiCode); 4707 READ_FLAG(uiCode, "layer_included_in_partition_flag[h][j][k][r]"); vps->setLayerIncludedInPartitionFlag(h, j, k, r, uiCode ? true : false); 4670 4708 } 4671 4709 } 4672 4710 } 4673 } 4674 4675 // To be done: Check each layer included in not more than one BSP in every partitioning scheme, 4676 // and other related checks associated with layers in bitstream partitions. 4677 4678 } 4711 for (Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++) 4712 { 4713 for (Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++) 4714 { 4715 READ_UVLC(uiCode, "num_bsp_schedules_minus1[h][i][t]"); vps->setNumBspSchedulesMinus1(h, i, t, uiCode); 4716 for (Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++) 4717 { 4718 #if VPS_FIX_TO_MATCH_SPEC 4719 for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++ ) 4720 #else 4721 for (Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++) 4722 #endif 4723 { 4724 #if VPS_FIX_TO_MATCH_SPEC 4725 if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 1 ) 4726 { 4727 #endif 4728 #if VPS_FIX_TO_MATCH_SPEC 4729 Int numBits = 1; 4730 while ((1 << numBits) < (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams())) 4731 { 4732 numBits++; 4733 } 4734 READ_CODE(numBits, uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode); 4735 #else 4736 READ_UVLC(uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode); 4737 #endif 4738 #if VPS_FIX_TO_MATCH_SPEC 4739 } 4740 #endif 4741 READ_UVLC(uiCode, "bsp_comb_sched_idx[h][i][t][j][k]"); vps->setBspSchedIdx(h, i, t, j, k, uiCode); 4742 } 4743 } 4744 } 4745 } 4746 4747 // To be done: Check each layer included in not more than one BSP in every partitioning scheme, 4748 // and other related checks associated with layers in bitstream partitions. 4749 4750 } 4751 #if VPS_FIX_TO_MATCH_SPEC 4752 } 4753 #endif 4679 4754 } 4680 4755 #endif
Note: See TracChangeset for help on using the changeset viewer.