- Timestamp:
- 13 Jan 2015, 22:55:34 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r971 r980 2133 2133 } 2134 2134 #endif 2135 for(i = 1; i < vps->getMaxLayers(); i++) 2136 { 2137 for(j = 0; j < i; j++) 2135 #if VPS_FIX_TO_MATCH_SPEC 2136 for (i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++) 2137 #else 2138 for (i = 1; i < vps->getMaxLayers(); i++) 2139 #endif 2140 { 2141 #if VPS_FIX_TO_MATCH_SPEC 2142 for (j = vps->getBaseLayerInternalFlag() ? 0 : 1; j < i; j++) 2143 #else 2144 for (j = 0; j < i; j++) 2145 #endif 2138 2146 { 2139 2147 if (vps->getDirectDependencyFlag(i, j)) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r971 r980 755 755 { 756 756 #endif 757 const Bool subLayerOrderingInfoPresentFlag = 1;758 WRITE_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");759 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)760 {761 WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i) - 1, "sps_max_dec_pic_buffering_minus1[i]" );762 WRITE_UVLC( pcSPS->getNumReorderPics(i), "sps_num_reorder_pics[i]" );763 WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i), "sps_max_latency_increase_plus1[i]" );764 if (!subLayerOrderingInfoPresentFlag)765 {766 break;767 }768 }757 const Bool subLayerOrderingInfoPresentFlag = 1; 758 WRITE_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 759 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 760 { 761 WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i) - 1, "sps_max_dec_pic_buffering_minus1[i]" ); 762 WRITE_UVLC( pcSPS->getNumReorderPics(i), "sps_num_reorder_pics[i]" ); 763 WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i), "sps_max_latency_increase_plus1[i]" ); 764 if (!subLayerOrderingInfoPresentFlag) 765 { 766 break; 767 } 768 } 769 769 #if SPS_DPB_PARAMS 770 770 } … … 801 801 { 802 802 #endif 803 WRITE_FLAG( pcSPS->getScalingListPresentFlag() ? 1 : 0, "sps_scaling_list_data_present_flag" );804 if(pcSPS->getScalingListPresentFlag())805 {806 codeScalingList( m_pcSlice->getScalingList() );807 }803 WRITE_FLAG( pcSPS->getScalingListPresentFlag() ? 1 : 0, "sps_scaling_list_data_present_flag" ); 804 if(pcSPS->getScalingListPresentFlag()) 805 { 806 codeScalingList( m_pcSlice->getScalingList() ); 807 } 808 808 #if SCALINGLIST_INFERRING 809 809 } … … 1152 1152 if( !vps->getSplittingFlag() ) 1153 1153 { 1154 for(j = 0; j < vps->getNumScalabilityTypes(); j++)1155 {1156 UInt bits = vps->getDimensionIdLen(j);1157 WRITE_CODE( vps->getDimensionId(i, j), bits, "dimension_id[i][j]" );1158 }1159 }1154 for(j = 0; j < vps->getNumScalabilityTypes(); j++) 1155 { 1156 UInt bits = vps->getDimensionIdLen(j); 1157 WRITE_CODE( vps->getDimensionId(i, j), bits, "dimension_id[i][j]" ); 1158 } 1159 } 1160 1160 } 1161 1161 #endif … … 1176 1176 { 1177 1177 #endif 1178 for( i = 0; i < vps->getNumViews(); i++ )1179 {1178 for( i = 0; i < vps->getNumViews(); i++ ) 1179 { 1180 1180 #if O0109_VIEW_ID_LEN 1181 WRITE_CODE( vps->getViewIdVal( i ), vps->getViewIdLen( ), "view_id_val[i]" );1181 WRITE_CODE( vps->getViewIdVal( i ), vps->getViewIdLen( ), "view_id_val[i]" ); 1182 1182 #else 1183 1183 WRITE_CODE( vps->getViewIdVal( i ), vps->getViewIdLenMinus1( ) + 1, "view_id_val[i]" ); 1184 1184 #endif 1185 }1185 } 1186 1186 #if O0109_VIEW_ID_LEN 1187 1187 } … … 1352 1352 { 1353 1353 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i); 1354 if( i > (vps->getNumLayerSets() - 1) ) 1354 #if VPS_FIX_TO_MATCH_SPEC 1355 if (vps->getNumLayerSets() > 2 && i >= vps->getNumLayerSets()) 1356 #else 1357 if (i >(vps->getNumLayerSets() - 1)) 1358 #endif 1355 1359 { 1356 1360 Int numBits = 1; … … 1381 1385 for(j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet) ; j++) 1382 1386 { 1383 if( vps->getNecessaryLayerFlag(i, j) ) 1387 #if VPS_FIX_TO_MATCH_SPEC 1388 if (vps->getNecessaryLayerFlag(i, j) && (vps->getNumProfileTierLevel() - 1) > 0) 1389 #else 1390 if (vps->getNecessaryLayerFlag(i, j)) 1391 #endif 1384 1392 { 1385 1393 WRITE_CODE( vps->getProfileLevelTierIdx(i, j), numBitsForPtlIdx, "profile_level_tier_idx[i]" ); … … 1450 1458 if( vps->getRepFormatIdxPresentFlag() ) 1451 1459 { 1460 #if VPS_FIX_TO_MATCH_SPEC 1461 for (i = vps->getBaseLayerInternalFlag() ? 1 : 0; i < vps->getMaxLayers(); i++) 1462 #else 1452 1463 for(i = 1; i < vps->getMaxLayers(); i++) 1464 #endif 1453 1465 { 1454 1466 Int numBits = 1; … … 1542 1554 else 1543 1555 { 1544 for(i = 1; i < vps->getMaxLayers(); i++) 1545 { 1546 for(j = 0; j < i; j++) 1556 #if VPS_FIX_TO_MATCH_SPEC 1557 for (i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++) 1558 #else 1559 for (i = 1; i < vps->getMaxLayers(); i++) 1560 #endif 1561 { 1562 #if VPS_FIX_TO_MATCH_SPEC 1563 for (j = vps->getBaseLayerInternalFlag() ? 0 : 1; j < i; j++) 1564 #else 1565 for (j = 0; j < i; j++) 1566 #endif 1547 1567 { 1548 1568 if (vps->getDirectDependencyFlag(i, j)) … … 1757 1777 { 1758 1778 #if DPB_INTERNAL_BL_SIG 1759 if(vps->getBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) != 0 ) ) 1760 #endif 1761 WRITE_UVLC( vps->getMaxVpsDecPicBufferingMinus1( i, k, j), "max_vps_dec_pic_buffering_minus1[i][k][j]" ); 1762 } 1763 WRITE_UVLC( vps->getMaxVpsNumReorderPics( i, j), "max_vps_num_reorder_pics[i][j]" ); 1779 #if VPS_FIX_TO_MATCH_SPEC 1780 if (vps->getNecessaryLayerFlag(i, k) && (vps->getBaseLayerInternalFlag() || (vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) != 0))) 1781 #else 1782 if ((vps->getBaseLayerInternalFlag() || (vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) != 0))) 1783 #endif 1784 #endif 1785 WRITE_UVLC( vps->getMaxVpsDecPicBufferingMinus1( i, k, j), "max_vps_dec_pic_buffering_minus1[i][k][j]" ); 1786 } 1787 WRITE_UVLC( vps->getMaxVpsNumReorderPics( i, j), "max_vps_num_reorder_pics[i][j]" ); 1764 1788 #if RESOLUTION_BASED_DPB 1765 1789 if( vps->getNumSubDpbs(layerSetIdxForOutputLayerSet) != vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ) ) // NumSubDpbs … … 1887 1911 if (!vps->getTilesNotInUseFlag()) 1888 1912 { 1913 #if VPS_FIX_TO_MATCH_SPEC 1914 for (i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++) 1915 #else 1916 for (i = 0; i < vps->getMaxLayers(); i++) 1917 #endif 1889 1918 for(i = 0; i < vps->getMaxLayers(); i++) 1890 1919 { … … 1897 1926 #endif 1898 1927 1899 for(i = 1; i < vps->getMaxLayers(); i++) 1928 #if VPS_FIX_TO_MATCH_SPEC 1929 for (i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++) 1930 #else 1931 for (i = 1; i < vps->getMaxLayers(); i++) 1932 #endif 1900 1933 { 1901 1934 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) … … 1918 1951 if (!vps->getWppNotInUseFlag()) 1919 1952 { 1920 for(i = 0; i < vps->getMaxLayers(); i++) 1953 #if VPS_FIX_TO_MATCH_SPEC 1954 for (i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++) 1955 #else 1956 for (i = 0; i < vps->getMaxLayers(); i++) 1957 #endif 1921 1958 { 1922 1959 WRITE_FLAG( vps->getWppInUseFlag(i) ? 1 : 0 , "wpp_in_use_flag[ i ]" ); … … 1949 1986 { 1950 1987 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1951 { 1952 WRITE_UVLC(vps->getMinSpatialSegmentOffsetPlus1( i, j), "min_spatial_segment_offset_plus1[i][j]"); 1953 1954 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 )1955 {1956 WRITE_ FLAG( vps->getCtuBasedOffsetEnabledFlag( i, j) ? 1 : 0 , "ctu_based_offset_enabled_flag[i][j]" );1957 1958 if( vps->getCtuBasedOffsetEnabledFlag(i,j))1988 { 1989 #if VPS_FIX_TO_MATCH_SPEC 1990 if (vps->getBaseLayerInternalFlag() || vps->getRefLayerId(vps->getLayerIdInNuh(i), j)) 1991 { 1992 #endif 1993 WRITE_UVLC(vps->getMinSpatialSegmentOffsetPlus1( i, j), "min_spatial_segment_offset_plus1[i][j]"); 1994 1995 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 1959 1996 { 1960 WRITE_UVLC(vps->getMinHorizontalCtuOffsetPlus1( i, j), "min_horizontal_ctu_offset_plus1[i][j]"); 1997 WRITE_FLAG( vps->getCtuBasedOffsetEnabledFlag( i, j) ? 1 : 0 , "ctu_based_offset_enabled_flag[i][j]" ); 1998 1999 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 2000 { 2001 WRITE_UVLC(vps->getMinHorizontalCtuOffsetPlus1( i, j), "min_horizontal_ctu_offset_plus1[i][j]"); 2002 } 1961 2003 } 1962 } 1963 } 2004 #if VPS_FIX_TO_MATCH_SPEC 2005 } 2006 #endif 2007 } 1964 2008 } 1965 2009 } … … 3464 3508 codeHrdParameters(vps->getBspHrd(j), i == 0 ? true : vps->getCprmsAddPresentFlag(j), vps->getNumSubLayerHrdMinus1(j)); 3465 3509 } 3466 for( Int h = 1; h < vps->getNumOutputLayerSets(); h++ ) 3467 { 3468 Int lsIdx = vps->getOutputLayerSetIdx( h ); 3469 WRITE_UVLC( vps->getNumSignalledPartitioningSchemes(h), "num_signalled_partitioning_schemes[h]"); 3470 for( Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++ ) 3471 { 3472 WRITE_UVLC( vps->getNumPartitionsInSchemeMinus1(h, j), "num_partitions_in_scheme_minus1[h][j]" ); 3473 for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++ ) 3474 { 3475 for( Int r = 0; r < vps->getNumLayersInIdList( lsIdx ); r++ ) 3476 { 3477 WRITE_FLAG( vps->getLayerIncludedInPartitionFlag(h, j, k, r), "layer_included_in_partition_flag[h][j][k][r]" ); 3478 } 3479 } 3480 } 3481 for( Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++ ) 3482 { 3483 for( Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++ ) 3484 { 3485 WRITE_UVLC(vps->getNumBspSchedulesMinus1(h, i, t), "num_bsp_schedules_minus1[h][i][t]"); 3486 for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ ) 3487 { 3488 for( Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++ ) 3510 3511 #if VPS_FIX_TO_MATCH_SPEC 3512 if (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 0) 3513 { 3514 #endif 3515 for( Int h = 1; h < vps->getNumOutputLayerSets(); h++ ) 3516 { 3517 Int lsIdx = vps->getOutputLayerSetIdx( h ); 3518 WRITE_UVLC(vps->getNumSignalledPartitioningSchemes(h), "num_signalled_partitioning_schemes[h]"); 3519 #if VPS_FIX_TO_MATCH_SPEC 3520 for (Int j = 1; j < vps->getNumSignalledPartitioningSchemes(h) + 1; j++) 3521 #else 3522 for (Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++) 3523 #endif 3524 { 3525 WRITE_UVLC( vps->getNumPartitionsInSchemeMinus1(h, j), "num_partitions_in_scheme_minus1[h][j]" ); 3526 for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++ ) 3527 { 3528 for( Int r = 0; r < vps->getNumLayersInIdList( lsIdx ); r++ ) 3489 3529 { 3490 WRITE_UVLC( vps->getBspHrdIdx(h, i, t, j, k), "bsp_comb_hrd_idx[h][i][t][j][k]"); 3491 WRITE_UVLC( vps->getBspSchedIdx(h, i, t, j, k), "bsp_comb_sched_idx[h][i][t][j][k]"); 3530 WRITE_FLAG( vps->getLayerIncludedInPartitionFlag(h, j, k, r), "layer_included_in_partition_flag[h][j][k][r]" ); 3492 3531 } 3493 3532 } 3494 3533 } 3495 } 3496 } 3534 for( Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++ ) 3535 { 3536 for( Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++ ) 3537 { 3538 WRITE_UVLC(vps->getNumBspSchedulesMinus1(h, i, t), "num_bsp_schedules_minus1[h][i][t]"); 3539 for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ ) 3540 { 3541 #if VPS_FIX_TO_MATCH_SPEC 3542 for (Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++) 3543 #else 3544 for (Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++) 3545 #endif 3546 { 3547 #if VPS_FIX_TO_MATCH_SPEC 3548 if (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 1) 3549 { 3550 #endif 3551 #if VPS_FIX_TO_MATCH_SPEC 3552 Int numBits = 1; 3553 while ((1 << numBits) < (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams())) 3554 { 3555 numBits++; 3556 } 3557 WRITE_CODE(vps->getBspHrdIdx(h, i, t, j, k), numBits, "bsp_comb_hrd_idx[h][i][t][j][k]"); 3558 #else 3559 WRITE_UVLC( vps->getBspHrdIdx(h, i, t, j, k), "bsp_comb_hrd_idx[h][i][t][j][k]"); 3560 #endif 3561 #if VPS_FIX_TO_MATCH_SPEC 3562 } 3563 #endif 3564 WRITE_UVLC( vps->getBspSchedIdx(h, i, t, j, k), "bsp_comb_sched_idx[h][i][t][j][k]"); 3565 } 3566 } 3567 } 3568 } 3569 } 3570 #if VPS_FIX_TO_MATCH_SPEC 3571 } 3572 #endif 3497 3573 } 3498 3574 #endif
Note: See TracChangeset for help on using the changeset viewer.