Changeset 964 in 3DVCSoftware for trunk/source/Lib/TLibEncoder
- Timestamp:
- 5 Jul 2014, 05:16:45 (11 years ago)
- Location:
- trunk/source/Lib/TLibEncoder
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/AnnexBwrite.h
r872 r964 58 58 59 59 static const Char start_code_prefix[] = {0,0,0,1}; 60 if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_ SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)60 if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS) 61 61 { 62 62 /* From AVC, When any of the following conditions are fulfilled, the -
trunk/source/Lib/TLibEncoder/NALwrite.cpp
r884 r964 91 91 vector<uint8_t>& rbsp = nalu.m_Bitstream.getFIFO(); 92 92 93 #if H_MV // This will handle situation when writing NAL with zero payload 94 if (rbsp.size() == 0) return; 95 #endif 93 if (rbsp.size() == 0) 94 { 95 return; 96 } 96 97 97 98 for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();) -
trunk/source/Lib/TLibEncoder/SEIwrite.cpp
r884 r964 267 267 Void SEIWriter::xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei) 268 268 { 269 WRITE_CODE(sei.activeVPSId, 4, "active_vps_id");270 WRITE_FLAG(sei.m_ fullRandomAccessFlag, "full_random_access_flag");271 WRITE_FLAG(sei.m_noParam SetUpdateFlag, "no_param_set_update_flag");269 WRITE_CODE(sei.activeVPSId, 4, "active_video_parameter_set_id"); 270 WRITE_FLAG(sei.m_selfContainedCvsFlag, "self_contained_cvs_flag"); 271 WRITE_FLAG(sei.m_noParameterSetUpdateFlag, "no_parameter_set_update_flag"); 272 272 WRITE_UVLC(sei.numSpsIdsMinus1, "num_sps_ids_minus1"); 273 273 274 assert (sei.activeSeqParamSetId.size() == (sei.numSpsIdsMinus1 + 1)); 275 276 for (Int i = 0; i < sei.activeSeqParamSetId.size(); i++) 277 { 278 WRITE_UVLC(sei.activeSeqParamSetId[i], "active_seq_param_set_id"); 279 } 280 281 UInt uiBits = m_pcBitIf->getNumberOfWrittenBits(); 282 UInt uiAlignedBits = ( 8 - (uiBits&7) ) % 8; 283 if(uiAlignedBits) 284 { 285 WRITE_FLAG(1, "alignment_bit" ); 286 uiAlignedBits--; 287 while(uiAlignedBits--) 288 { 289 WRITE_FLAG(0, "alignment_bit" ); 290 } 291 } 274 assert (sei.activeSeqParameterSetId.size() == (sei.numSpsIdsMinus1 + 1)); 275 276 for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++) 277 { 278 WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 279 } 280 xWriteByteAlign(); 292 281 } 293 282 … … 478 467 { 479 468 WRITE_CODE( sei.m_cameraIsoSpeedValue, 32, "camera_iso_speed_value" ); 469 } 470 WRITE_CODE( sei.m_exposureIndexIdc, 8, "exposure_index_idc" ); 471 if( sei.m_exposureIndexIdc == 255) //Extended_ISO 472 { 473 WRITE_CODE( sei.m_exposureIndexValue, 32, "exposure_index_value" ); 480 474 } 481 475 WRITE_FLAG( sei.m_exposureCompensationValueSignFlag, "exposure_compensation_value_sign_flag" ); -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r950 r964 140 140 WRITE_UVLC( rps->getNumberOfNegativePictures(), "num_negative_pics" ); 141 141 WRITE_UVLC( rps->getNumberOfPositivePictures(), "num_positive_pics" ); 142 142 143 Int prev = 0; 143 144 for(Int j=0 ; j < rps->getNumberOfNegativePictures(); j++) … … 276 277 pcPPS->getLayerId() != 1 ) 277 278 { 278 pcPPS->setPpsExtensionTypeFlag( PPS_EX_T_3D, false ); 279 #if H_MV_HLS_8_SPS_NODOC_48 280 pcPPS->setPps3dExtensionFlag( false ); 281 #else 282 pcPPS->setPpsExtensionTypeFlag( PPS_EX_T_3D, false ); 283 #endif 279 284 } 280 285 #endif … … 283 288 WRITE_FLAG( 0, "pps_extension_flag" ); 284 289 #else 285 WRITE_FLAG( 1, "pps_extension_flag" ); 286 290 WRITE_FLAG( 1, "pps_extension_present_flag" ); 291 292 #if H_MV_HLS_8_SPS_NODOC_48 293 WRITE_FLAG( pcPPS->getPpsRangeExtensionsFlag( ) ? 1 : 0 , "pps_range_extensions_flag" ); 294 WRITE_FLAG( pcPPS->getPpsMultilayerExtensionFlag( ) ? 1 : 0 , "pps_multilayer_extension_flag" ); 295 #if !H_3D 296 WRITE_CODE( pcPPS->getPpsExtension6bits( ), 6, "pps_extension_6bits" ); 297 #else 298 WRITE_FLAG( pcPPS->getPps3dExtensionFlag( ) ? 1 : 0 , "pps_3d_extension_flag" ); 299 WRITE_CODE( pcPPS->getPpsExtension5bits( ), 5, "pps_extension_5bits" ); 300 #endif 301 if ( pcPPS->getPpsRangeExtensionsFlag() ) 302 { 303 assert(0); 304 } 305 306 if ( pcPPS->getPpsMultilayerExtensionFlag() ) 307 { 308 WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" ); 309 #if H_MV_HLS_8_PPS_NODOC_NN 310 WRITE_FLAG( 0, "pps_extension_reserved_zero_flag" ); 311 #endif 312 } 313 314 #if H_3D 315 if( pcPPS->getPps3dExtensionFlag( ) ) // This probably needs to be aligned with Rext and SHVC 316 { 317 codePPSExtension( pcPPS ); 318 } 319 #endif 320 #else 287 321 for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ ) 288 322 { … … 305 339 codePPSExtension( pcPPS ); 306 340 } 341 #endif 307 342 #endif 308 343 … … 822 857 WRITE_FLAG( 0, "sps_extension_flag" ); 823 858 #else 824 WRITE_FLAG( pcSPS->getSpsExtensionFlag(), "sps_extension_flag" ); 825 826 if ( pcSPS->getSpsExtensionFlag() ) 827 { 859 WRITE_FLAG( pcSPS->getSpsExtensionPresentFlag(), "sps_extension_present_flag" ); 860 861 if ( pcSPS->getSpsExtensionPresentFlag() ) 862 { 863 #if H_MV_HLS_8_SPS_NODOC_48 864 WRITE_FLAG( pcSPS->getSpsRangeExtensionsFlag( ) ? 1 : 0 , "sps_range_extensions_flag" ); 865 WRITE_FLAG( pcSPS->getSpsMultilayerExtensionFlag( ) ? 1 : 0 , "sps_multilayer_extension_flag" ); 866 #if !H_3D 867 WRITE_CODE( pcSPS->getSpsExtension6bits( ), 6, "sps_extension_6bits" ); 868 #else 869 WRITE_FLAG( pcSPS->getSps3dExtensionFlag( ) ? 1 : 0 , "sps_3d_extension_flag" ); 870 WRITE_CODE( pcSPS->getSpsExtension5bits( ), 5, "sps_extension_5bits" ); 871 #endif 872 } 873 874 if ( pcSPS->getSpsRangeExtensionsFlag() ) 875 { 876 assert( 0 ); 877 } 878 879 if ( pcSPS->getSpsMultilayerExtensionFlag() ) 880 { 881 codeSPSExtension( pcSPS ); 882 } 883 884 #if H_3D 885 if ( pcSPS->getSps3dExtensionFlag() ) 886 { 887 codeSPSExtension2( pcSPS, viewIndex, depthFlag ); 888 } 889 890 #endif 891 #else 828 892 for (Int i = 0; i < PS_EX_T_MAX_NUM; i++) 829 893 { … … 848 912 #endif 849 913 } 914 #endif 850 915 #endif 851 916 } … … 890 955 { 891 956 WRITE_CODE( pcVPS->getVPSId(), 4, "vps_video_parameter_set_id" ); 957 #if H_MV_HLS_8_SYN_Q0041_03 958 WRITE_FLAG( pcVPS->getVpsBaseLayerInternalFlag( ) ? 1 : 0 , "vps_base_layer_internal_flag" ); 959 WRITE_FLAG( 1 , "vps_reserved_one_bit" ); 960 #else 892 961 WRITE_CODE( 3, 2, "vps_reserved_three_2bits" ); 962 #endif 893 963 #if H_MV 894 964 WRITE_CODE( pcVPS->getMaxLayersMinus1(), 6, "vps_max_layers_minus1" ); … … 972 1042 } 973 1043 #if H_MV 1044 #if H_MV_HLS_8_RPS_Q0100_36 1045 WRITE_FLAG( pcVPS->getVpsExtensionFlag(), "vps_extension_flag" ); 1046 #else 974 1047 WRITE_FLAG( 1, "vps_extension_flag" ); 1048 #endif 975 1049 m_pcBitIf->writeAlignOne(); 976 1050 codeVPSExtension( pcVPS ); … … 996 1070 Void TEncCavlc::codeVPSExtension( TComVPS *pcVPS ) 997 1071 { 1072 1073 #if !H_MV_HLS_8_SYN_Q0041_03 998 1074 WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0, "avc_base_layer_flag" ); 1075 #endif 1076 999 1077 WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0, "splitting_flag" ); 1000 1078 … … 1010 1088 1011 1089 if ( pcVPS->getSplittingFlag() ) 1012 { // Ignore old dimension id length1090 { 1013 1091 pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1 ,pcVPS->inferLastDimsionIdLenMinus1() + 1 ); 1014 1092 } … … 1042 1120 } 1043 1121 1044 1045 1122 WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" ); 1046 1123 … … 1068 1145 } 1069 1146 } 1147 1070 1148 WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" ); 1071 1149 if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() ) … … 1109 1187 } 1110 1188 1111 WRITE_UVLC( pcVPS->getNumAddOutputLayerSets( ), "num_add_output_layer_sets" ); 1189 #if H_MV_HLS_8_SYN_39_19 1190 if ( pcVPS->getNumIndependentLayers() > 1 ) 1191 { 1192 WRITE_UVLC( pcVPS->getNumAddLayerSets( ), "num_add_layer_sets" ); 1193 } 1194 for (Int i = 0; i < pcVPS->getNumAddLayerSets(); i++) 1195 { 1196 for (Int j = 0; j < pcVPS->getNumIndependentLayers(); j++) 1197 { 1198 WRITE_CODE( pcVPS->getHighestLayerIdxPlus1( i, j ), pcVPS->getHighestLayerIdxPlus1Len( j ) , "highest_layer_idx_plus1" ); 1199 } 1200 } 1201 if (pcVPS->getNumLayerSets() > 1) 1202 { 1203 WRITE_UVLC( pcVPS->getNumAddOlss( ), "num_add_olss" ); 1204 WRITE_CODE( pcVPS->getDefaultOutputLayerIdc( ), 2, "default_output_layer_idc" ); 1205 } 1206 #else 1207 WRITE_UVLC( pcVPS->getNumAddLayerSets( ), "num_add_layer_sets" ); 1112 1208 1113 1209 if( pcVPS->getNumOutputLayerSets() > 1) 1114 1210 { 1115 WRITE_CODE( pcVPS->getDefault TargetOutputLayerIdc( ), 2, "default_target_output_layer_idc" );1211 WRITE_CODE( pcVPS->getDefaultOutputLayerIdc( ), 2, "default_output_layer_idc" ); 1116 1212 } 1117 1213 #endif 1118 1214 1119 1215 assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 )); 1120 assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 ); 1216 assert( pcVPS->getLayerSetIdxForOlsMinus1( 0 ) == -1 ); 1217 1218 1219 1121 1220 1122 1221 for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ ) 1123 1222 { 1223 #if H_MV_HLS_8_SYN_39_19 1224 if( i >= pcVPS->getNumLayerSets( ) ) 1225 #else 1124 1226 if( i > pcVPS->getVpsNumLayerSetsMinus1( ) ) 1227 #endif 1125 1228 { 1126 WRITE_UVLC( pcVPS->get OutputLayerSetIdxMinus1( i ), "output_layer_set_idx_minus1[i]" );1127 } 1128 1129 if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefault TargetOutputLayerIdc() == 2 )1229 WRITE_UVLC( pcVPS->getLayerSetIdxForOlsMinus1( i ), "layer_set_idx_for_ols_minus1[i]" ); 1230 } 1231 1232 if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultOutputLayerIdc() == 2 ) 1130 1233 { 1131 for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS-> getLayerSetIdxForOutputLayerSet( i ) ); j++ )1234 for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx( i ) ); j++ ) 1132 1235 { 1133 1236 WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" ); … … 1136 1239 else 1137 1240 { 1138 for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS-> getLayerSetIdxForOutputLayerSet( i ) ) - 1; j++ )1241 for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx( i ) ) - 1; j++ ) 1139 1242 { 1140 1243 assert( pcVPS->getOutputLayerFlag( i , j ) == pcVPS->inferOutputLayerFlag( i, j )); 1141 1244 } 1142 1245 } 1246 1143 1247 1144 1248 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) … … 1152 1256 } 1153 1257 1258 #if !H_MV_HLS_8_PMS_Q0195_20 1154 1259 WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" ); 1155 1260 if ( pcVPS->getRepFormatIdxPresentFlag() ) … … 1157 1262 WRITE_UVLC( pcVPS->getVpsNumRepFormatsMinus1( ), "vps_num_rep_formats_minus1" ); 1158 1263 } 1264 #else 1265 WRITE_UVLC( pcVPS->getVpsNumRepFormatsMinus1( ), "vps_num_rep_formats_minus1" ); 1266 #endif 1159 1267 1160 1268 for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ ) 1161 1269 { 1270 1162 1271 TComRepFormat* curRepFormat = pcVPS->getRepFormat(i); 1163 1272 TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL; 1164 1273 codeRepFormat( i, curRepFormat , prevRepFormat); 1165 } 1166 1274 1275 } 1276 1277 #if H_MV_HLS_8_PMS_Q0195_20 1278 if ( pcVPS->getVpsNumRepFormatsMinus1() > 0 ) 1279 { 1280 WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" ); 1281 } 1282 #endif 1167 1283 if( pcVPS->getRepFormatIdxPresentFlag() ) 1168 1284 { 1285 #if H_MV_HLS_8_SYN_Q0041_03 1286 for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1287 #else 1169 1288 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1170 { 1289 #endif 1290 { 1291 #if !H_MV_HLS_8_PMS_Q0195_20 1171 1292 if( pcVPS->getVpsNumRepFormatsMinus1() > 0 ) 1172 1293 { 1294 #endif 1173 1295 WRITE_CODE( pcVPS->getVpsRepFormatIdx(i), pcVPS->getVpsRepFormatIdxLen(), "vps_rep_format_idx[i]" ); 1174 } 1175 } 1176 } 1296 #if !H_MV_HLS_8_PMS_Q0195_20 1297 } 1298 #endif 1299 } 1300 } 1301 #if H_MV_HLS_8_PMS_Q0195_20 1302 else 1303 { 1304 #if H_MV_HLS_8_SYN_Q0041_03 1305 for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1306 #else 1307 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1308 #endif 1309 { 1310 assert( pcVPS->getVpsRepFormatIdx( i ) == pcVPS->inferVpsRepFormatIdx( i ) ); 1311 } 1312 } 1313 #endif 1314 1177 1315 1178 1316 WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" ); … … 1187 1325 } 1188 1326 } 1327 1189 1328 WRITE_FLAG( 0, "vps_reserved_zero_flag" ); 1190 1329 codeDpbSize( pcVPS ); … … 1193 1332 1194 1333 WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" ); 1195 1196 1334 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1197 1335 { … … 1199 1337 } 1200 1338 1339 #if H_MV_HLS_8_SYN_Q0041_03 1340 for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 2; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1341 { 1342 for( Int j = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; j < i; j++ ) 1343 #else 1201 1344 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1202 1345 { 1203 1346 for( Int j = 0; j < i; j++ ) 1347 #endif 1204 1348 { 1205 1349 if (pcVPS->getDirectDependencyFlag( i, j) ) … … 1218 1362 } 1219 1363 WRITE_UVLC( 0, "vps_non_vui_extension_length" ); 1220 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" ); 1364 1365 1366 1367 1368 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" ); 1221 1369 if( pcVPS->getVpsVuiPresentFlag() ) 1222 1370 { … … 1229 1377 pcVPSVUI->inferVpsVui( true ); 1230 1378 } 1379 1231 1380 } 1232 1381 … … 1248 1397 for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1249 1398 { 1399 #if H_MV_HLS_8_MIS_Q0102_30 1400 Int currLsIdx = vps->olsIdxToLsIdx( i ); 1401 #endif 1250 1402 WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" ); 1403 #if H_MV_HLS_8_MIS_Q0102_30 1404 for( Int j = 0; j <= vps->getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ ) 1405 #else 1251 1406 for( Int j = 0; j <= vps->getMaxSubLayersInLayerSetMinus1( i ); j++ ) 1407 #endif 1252 1408 { 1253 1409 if( j > 0 && dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) … … 1257 1413 if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1258 1414 { 1259 for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i )); k++ ) 1415 #if H_MV_HLS_8_MIS_Q0102_30 1416 for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ ) 1417 #else 1418 for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i )); k++ ) 1419 #endif 1260 1420 { 1261 1421 WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" ); 1262 1422 } 1263 1423 WRITE_UVLC( dpbSize->getMaxVpsNumReorderPics( i, j ), "max_vps_num_reorder_pics" ); 1264 #if H_MV_HLS7_GEN1265 if( vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i ) ) != vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ) )1266 {1267 for( Int k = 0; k < vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ); k++ )1268 {1269 WRITE_UVLC( dpbSize->getMaxVpsLayerDecPicBuffMinus1( i, k, j ), "max_vps_layer_dec_pic_buff_minus1" );1270 }1271 }1272 #endif1273 1424 WRITE_UVLC( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ), "max_vps_latency_increase_plus1" ); 1274 1425 } … … 1277 1428 if ( j > 0 ) 1278 1429 { 1279 for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i ) ); k++ ) 1430 #if H_MV_HLS_8_DBP_NODOC_42 1431 for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ ) 1432 #else 1433 for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i ) ); k++ ) 1434 #endif 1280 1435 { 1281 1436 assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) ); … … 1285 1440 } 1286 1441 } 1287 } 1288 } 1442 } 1443 } 1289 1444 } 1290 1445 … … 1324 1479 assert( pcVPSVUI ); 1325 1480 1481 1326 1482 WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" ); 1327 1483 if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() ) … … 1337 1493 if( pcVPSVUI->getBitRatePresentVpsFlag( ) || pcVPSVUI->getPicRatePresentVpsFlag( ) ) 1338 1494 { 1495 #if H_MV_HLS_8_SYN_Q0041_03 1496 for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i <= pcVPS->getVpsNumLayerSetsMinus1(); i++ ) 1497 #else 1339 1498 for( Int i = 0; i <= pcVPS->getVpsNumLayerSetsMinus1(); i++ ) 1340 { 1499 #endif 1500 { 1501 #if H_MV_HLS_8_MIS_Q0102_30 1502 for( Int j = 0; j <= pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ ) 1503 #else 1341 1504 for( Int j = 0; j <= pcVPS->getMaxTLayers(); j++ ) 1505 #endif 1342 1506 { 1343 1507 if( pcVPSVUI->getBitRatePresentVpsFlag( ) ) … … 1399 1563 if( !pcVPSVUI->getTilesNotInUseFlag() ) 1400 1564 { 1565 #if H_MV_HLS_8_SYN_Q0041_03 1566 for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1567 #else 1401 1568 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1569 #endif 1402 1570 { 1403 1571 WRITE_FLAG( pcVPSVUI->getTilesInUseFlag( i ) ? 1 : 0 , "tiles_in_use_flag[i]" ); … … 1407 1575 } 1408 1576 } 1409 1577 #if H_MV_HLS_8_SYN_Q0041_03 1578 for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 2; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1579 #else 1410 1580 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1581 #endif 1411 1582 { 1412 1583 for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ ) … … 1439 1610 for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ ) 1440 1611 { 1612 #if H_MV_HLS_8_SYN_Q0041_03 1613 if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 ) 1614 { 1615 #endif 1441 1616 WRITE_UVLC( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ), "min_spatial_segment_offset_plus1" ); 1442 1617 if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 ) … … 1448 1623 } 1449 1624 } 1625 #if H_MV_HLS_8_SYN_Q0041_03 1626 } 1627 #endif 1450 1628 } 1451 1629 } … … 1495 1673 for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 1496 1674 { 1675 #if H_MV_HLS_8_HRD_Q0101_04 1676 for( Int j = 0; j < pcVPS->getNumLayersInIdList( h ); j++ ) 1677 { 1678 WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" ); 1679 #else 1497 1680 for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 1498 1681 { … … 1505 1688 vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec 1506 1689 } 1690 #endif 1507 1691 } 1508 1692 } … … 1510 1694 1511 1695 if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) ) 1512 { 1513 WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinations( h ), "num_bsp_sched_combinations" ); 1514 for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ ) 1696 { 1697 WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ), "num_bsp_sched_combinations_minus1" ); 1698 #if H_MV_HLS_8_HRD_Q0182_05 1699 for( Int i = 0; i <= vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ ) 1700 #else 1701 for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ ) 1702 #endif 1515 1703 { 1516 1704 for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ ) 1517 1705 { 1706 #if H_MV_HLS_8_HRD_Q0101_04 1707 WRITE_CODE( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), vpsVuiBspHrdP->getBspCombHrdIdxLen(), "bsp_comb_hrd_idx" ); 1708 #else 1518 1709 WRITE_UVLC( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), "bsp_comb_hrd_idx" ); 1710 #endif 1519 1711 WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" ); 1712 1713 #if H_MV_HLS_8_HRD_Q0101_04 1714 vpsVuiBspHrdP->checkBspCombHrdAndShedIdx( pcVPS, h, i, j ); 1715 #endif 1520 1716 } 1521 1717 } … … 1636 1832 if ( pcSlice->getRapPicFlag() ) 1637 1833 { 1834 #if SETTING_NO_OUT_PIC_PRIOR 1835 WRITE_FLAG( pcSlice->getNoOutputPriorPicsFlag() ? 1 : 0, "no_output_of_prior_pics_flag" ); 1836 #else 1638 1837 WRITE_FLAG( 0, "no_output_of_prior_pics_flag" ); 1838 #endif 1639 1839 } 1640 1840 #if PPS_FIX_DEPTH … … 1707 1907 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1708 1908 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "slice_pic_order_cnt_lsb"); 1709 } 1909 #if H_MV_HLS_8_POC_Q0142_32 1910 pcSlice->setSlicePicOrderCntLsb( picOrderCntLSB ); 1911 #endif 1912 } 1913 1710 1914 #endif 1711 1915 if( !pcSlice->getIdrPicFlag() ) … … 2137 2341 } 2138 2342 2343 #if H_MV_HLS_8_POC_Q0142_32 2344 pcSlice->checkPocResetIdc(); 2345 #endif 2346 2139 2347 if( pcSlice->getPocResetIdc() != 0 ) 2140 2348 { … … 2147 2355 WRITE_CODE( pcSlice->getPocLsbVal( ), pcSlice->getPocLsbValLen() , "poc_lsb_val" ); 2148 2356 } 2149 2357 #if H_MV_HLS_8_POC_Q0142_32 2358 pcSlice->checkPocLsbVal(); 2359 #endif 2360 2150 2361 if( !pcSlice->getPocMsbValRequiredFlag() /* TODO && pcSlice->getVPS()->getVpsPocLsbAlignedFlag() */ ) 2151 2362 { 2152 2363 WRITE_FLAG( pcSlice->getPocMsbValPresentFlag( ) ? 1 : 0 , "poc_msb_val_present_flag" ); 2153 2364 } 2365 #if H_MV_HLS_8_POC_Q0146_15 2366 else 2367 { 2368 assert( pcSlice->getPocMsbValPresentFlag() == pcSlice->inferPocMsbValPresentFlag( ) ); 2369 } 2370 #endif 2154 2371 2155 2372 if( pcSlice->getPocMsbValPresentFlag() ) -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r950 r964 256 256 Int m_cameraIsoSpeedIdc; 257 257 Int m_cameraIsoSpeedValue; 258 Int m_exposureIndexIdc; 259 Int m_exposureIndexValue; 258 260 Int m_exposureCompensationValueSignFlag; 259 261 Int m_exposureCompensationValueNumerator; … … 495 497 Void setMaxRefPicNum ( Int iMaxRefPicNum ) { m_iMaxRefPicNum = iMaxRefPicNum; } 496 498 497 BoolgetMaxTempLayer () { return m_maxTempLayer; }499 Int getMaxTempLayer () { return m_maxTempLayer; } 498 500 Void setMaxTempLayer ( Int maxTempLayer ) { m_maxTempLayer = maxTempLayer; } 499 501 … … 753 755 Void setTMISEICameraIsoSpeedValue(Int b) { m_cameraIsoSpeedValue = b; } 754 756 Int getTMISEICameraIsoSpeedValue() { return m_cameraIsoSpeedValue; } 757 Void setTMISEIExposureIndexIdc(Int b) { m_exposureIndexIdc = b; } 758 Int getTMISEIExposurIndexIdc() { return m_exposureIndexIdc; } 759 Void setTMISEIExposureIndexValue(Int b) { m_exposureIndexValue = b; } 760 Int getTMISEIExposurIndexValue() { return m_exposureIndexValue; } 755 761 Void setTMISEIExposureCompensationValueSignFlag(Int b) { m_exposureCompensationValueSignFlag = b; } 756 762 Int getTMISEIExposureCompensationValueSignFlag() { return m_exposureCompensationValueSignFlag; } -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r884 r964 75 75 m_iNumPicCoded = 0; //Niko 76 76 m_bFirst = true; 77 #if ALLOW_RECOVERY_POINT_AS_RAP 78 m_iLastRecoveryPicPOC = 0; 79 #endif 77 80 78 81 m_pcCfg = NULL; … … 167 170 SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets(); 168 171 seiActiveParameterSets->activeVPSId = m_pcCfg->getVPS()->getVPSId(); 169 seiActiveParameterSets->m_ fullRandomAccessFlag = false;170 seiActiveParameterSets->m_noParam SetUpdateFlag = false;172 seiActiveParameterSets->m_selfContainedCvsFlag = false; 173 seiActiveParameterSets->m_noParameterSetUpdateFlag = false; 171 174 seiActiveParameterSets->numSpsIdsMinus1 = 0; 172 seiActiveParameterSets->activeSeqParam SetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1);173 seiActiveParameterSets->activeSeqParam SetId[0] = sps->getSPSId();175 seiActiveParameterSets->activeSeqParameterSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1); 176 seiActiveParameterSets->activeSeqParameterSetId[0] = sps->getSPSId(); 174 177 return seiActiveParameterSets; 175 178 } … … 274 277 seiToneMappingInfo->m_cameraIsoSpeedValue = m_pcCfg->getTMISEICameraIsoSpeedValue(); 275 278 assert( seiToneMappingInfo->m_cameraIsoSpeedValue !=0 ); 279 seiToneMappingInfo->m_exposureIndexIdc = m_pcCfg->getTMISEIExposurIndexIdc(); 280 seiToneMappingInfo->m_exposureIndexValue = m_pcCfg->getTMISEIExposurIndexValue(); 281 assert( seiToneMappingInfo->m_exposureIndexValue !=0 ); 276 282 seiToneMappingInfo->m_exposureCompensationValueSignFlag = m_pcCfg->getTMISEIExposureCompensationValueSignFlag(); 277 283 seiToneMappingInfo->m_exposureCompensationValueNumerator = m_pcCfg->getTMISEIExposureCompensationValueNumerator(); … … 428 434 UInt *accumNalsDU = NULL; 429 435 SEIDecodingUnitInfo decodingUnitInfoSEI; 436 #if EFFICIENT_FIELD_IRAP 437 Int IRAPGOPid = -1; 438 Bool IRAPtoReorder = false; 439 Bool swapIRAPForward = false; 440 if(isField) 441 { 442 Int pocCurr; 443 #if !H_MV 444 for ( Int iGOPid=0; iGOPid < m_iGopSize; iGOPid++ ) 445 #endif 446 { 447 // determine actual POC 448 if(iPOCLast == 0) //case first frame or first top field 449 { 450 pocCurr=0; 451 } 452 else if(iPOCLast == 1 && isField) //case first bottom field, just like the first frame, the poc computation is not right anymore, we set the right value 453 { 454 pocCurr = 1; 455 } 456 else 457 { 458 pocCurr = iPOCLast - iNumPicRcvd + m_pcCfg->getGOPEntry(iGOPid).m_POC - isField; 459 } 460 461 // check if POC corresponds to IRAP 462 NalUnitType tmpUnitType = getNalUnitType(pocCurr, m_iLastIDR, isField); 463 if(tmpUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && tmpUnitType <= NAL_UNIT_CODED_SLICE_CRA) // if picture is an IRAP 464 { 465 if(pocCurr%2 == 0 && iGOPid < m_iGopSize-1 && m_pcCfg->getGOPEntry(iGOPid).m_POC == m_pcCfg->getGOPEntry(iGOPid+1).m_POC-1) 466 { // if top field and following picture in enc order is associated bottom field 467 IRAPGOPid = iGOPid; 468 IRAPtoReorder = true; 469 swapIRAPForward = true; 470 break; 471 } 472 if(pocCurr%2 != 0 && iGOPid > 0 && m_pcCfg->getGOPEntry(iGOPid).m_POC == m_pcCfg->getGOPEntry(iGOPid-1).m_POC+1) 473 { 474 // if picture is an IRAP remember to process it first 475 IRAPGOPid = iGOPid; 476 IRAPtoReorder = true; 477 swapIRAPForward = false; 478 break; 479 } 480 } 481 } 482 } 483 #endif 430 484 #if !H_MV 431 485 for ( Int iGOPid=0; iGOPid < m_iGopSize; iGOPid++ ) 432 486 #endif 433 487 { 488 #if EFFICIENT_FIELD_IRAP 489 if(IRAPtoReorder) 490 { 491 if(swapIRAPForward) 492 { 493 if(iGOPid == IRAPGOPid) 494 { 495 iGOPid = IRAPGOPid +1; 496 } 497 else if(iGOPid == IRAPGOPid +1) 498 { 499 iGOPid = IRAPGOPid; 500 } 501 } 502 else 503 { 504 if(iGOPid == IRAPGOPid -1) 505 { 506 iGOPid = IRAPGOPid; 507 } 508 else if(iGOPid == IRAPGOPid) 509 { 510 iGOPid = IRAPGOPid -1; 511 } 512 } 513 } 514 #endif 434 515 UInt uiColDir = 1; 435 516 //-- For time output for each slice … … 500 581 if(pocCurr>=m_pcCfg->getFramesToBeEncoded()) 501 582 { 583 #if EFFICIENT_FIELD_IRAP 584 if(IRAPtoReorder) 585 { 586 if(swapIRAPForward) 587 { 588 if(iGOPid == IRAPGOPid) 589 { 590 iGOPid = IRAPGOPid +1; 591 IRAPtoReorder = false; 592 } 593 else if(iGOPid == IRAPGOPid +1) 594 { 595 iGOPid --; 596 } 597 } 598 else 599 { 600 if(iGOPid == IRAPGOPid) 601 { 602 iGOPid = IRAPGOPid -1; 603 } 604 else if(iGOPid == IRAPGOPid -1) 605 { 606 iGOPid = IRAPGOPid; 607 IRAPtoReorder = false; 608 } 609 } 610 } 611 #endif 502 612 #if H_MV 503 613 delete pcBitstreamRedirect; … … 635 745 } 636 746 637 // Do decoding refresh marking if any 638 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic); 639 m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); 640 pcSlice->getRPS()->setNumberOfLongtermPictures(0); 747 #if EFFICIENT_FIELD_IRAP 641 748 #if FIX1172 642 749 if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP … … 653 760 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 654 761 #endif 655 762 #endif 763 // Do decoding refresh marking if any 764 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic); 765 m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); 766 pcSlice->getRPS()->setNumberOfLongtermPictures(0); 767 #if EFFICIENT_FIELD_IRAP 768 #else 769 #if FIX1172 770 if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 771 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 772 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 773 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 774 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 775 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // IRAP picture 776 { 777 m_associatedIRAPType = pcSlice->getNalUnitType(); 778 m_associatedIRAPPOC = pocCurr; 779 } 780 pcSlice->setAssociatedIRAPType(m_associatedIRAPType); 781 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 782 #endif 783 #endif 784 785 #if ALLOW_RECOVERY_POINT_AS_RAP 786 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 787 #if EFFICIENT_FIELD_IRAP 788 || (isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1) 789 #endif 790 ) 791 { 792 pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP(), m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3); 793 } 794 #else 656 795 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0) || (pcSlice->isIRAP())) 657 796 { 658 797 pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP()); 659 798 } 799 #endif 660 800 pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS()); 661 801 … … 1411 1551 } 1412 1552 pictureTimingSEI.m_auCpbRemovalDelay = std::min<Int>(std::max<Int>(1, m_totalCoded - m_lastBPSEI), static_cast<Int>(pow(2, static_cast<double>(pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getCpbRemovalDelayLengthMinus1()+1)))); // Syntax element signalled as minus, hence the . 1413 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pcSlice->getPOC() - m_totalCoded; 1553 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pcSlice->getPOC() - m_totalCoded; 1554 #if EFFICIENT_FIELD_IRAP 1555 if(IRAPGOPid > 0 && IRAPGOPid < m_iGopSize) 1556 { 1557 // if pictures have been swapped there is likely one more picture delay on their tid. Very rough approximation 1558 pictureTimingSEI.m_picDpbOutputDelay ++; 1559 } 1560 #endif 1414 1561 Int factor = pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2; 1415 1562 pictureTimingSEI.m_picDpbOutputDuDelay = factor * pictureTimingSEI.m_picDpbOutputDelay; … … 1518 1665 sei_recovery_point.m_exactMatchingFlag = ( pcSlice->getPOC() == 0 ) ? (true) : (false); 1519 1666 sei_recovery_point.m_brokenLinkFlag = false; 1667 #if ALLOW_RECOVERY_POINT_AS_RAP 1668 if(m_pcCfg->getDecodingRefreshType() == 3) 1669 { 1670 m_iLastRecoveryPicPOC = pocCurr; 1671 } 1672 #endif 1520 1673 1521 1674 m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_recovery_point, pcSlice->getSPS() ); … … 1641 1794 } 1642 1795 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 1796 1797 #if SETTING_NO_OUT_PIC_PRIOR 1798 if (pcSlice->isIRAP()) 1799 { 1800 if (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) 1801 { 1802 pcSlice->setNoRaslOutputFlag(true); 1803 } 1804 //the inference for NoOutputPriorPicsFlag 1805 if (!m_bFirst && pcSlice->isIRAP() && pcSlice->getNoRaslOutputFlag()) 1806 { 1807 if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 1808 { 1809 pcSlice->setNoOutputPriorPicsFlag(true); 1810 } 1811 } 1812 } 1813 #endif 1814 1643 1815 tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits(); 1644 1816 m_pcEntropyCoder->encodeSliceHeader(pcSlice); … … 2153 2325 std::vector<Int> temp; 2154 2326 TComSlice::markCurrPic( pcPic ); 2327 #if !H_MV_HLS_8_DBP_NODOC_42 2155 2328 TComSlice::markIvRefPicsAsUnused ( m_ivPicLists, temp, pcPic->getSlice(0)->getVPS(), m_layerId, pcPic->getPOC() ); 2329 #endif 2156 2330 #endif 2157 2331 m_bFirst = false; … … 2163 2337 2164 2338 delete[] pcSubstreamsOut; 2339 2340 #if EFFICIENT_FIELD_IRAP 2341 if(IRAPtoReorder) 2342 { 2343 if(swapIRAPForward) 2344 { 2345 if(iGOPid == IRAPGOPid) 2346 { 2347 iGOPid = IRAPGOPid +1; 2348 IRAPtoReorder = false; 2349 } 2350 else if(iGOPid == IRAPGOPid +1) 2351 { 2352 iGOPid --; 2353 } 2354 } 2355 else 2356 { 2357 if(iGOPid == IRAPGOPid) 2358 { 2359 iGOPid = IRAPGOPid -1; 2360 } 2361 else if(iGOPid == IRAPGOPid -1) 2362 { 2363 iGOPid = IRAPGOPid; 2364 IRAPtoReorder = false; 2365 } 2366 } 2367 } 2368 #endif 2165 2369 } 2166 2370 delete pcBitstreamRedirect; … … 2435 2639 case NAL_UNIT_CODED_SLICE_CRA: return "CRA"; 2436 2640 case NAL_UNIT_CODED_SLICE_RADL_R: return "RADL_R"; 2641 case NAL_UNIT_CODED_SLICE_RADL_N: return "RADL_N"; 2437 2642 case NAL_UNIT_CODED_SLICE_RASL_R: return "RASL_R"; 2643 case NAL_UNIT_CODED_SLICE_RASL_N: return "RASL_N"; 2438 2644 case NAL_UNIT_VPS: return "VPS"; 2439 2645 case NAL_UNIT_SPS: return "SPS"; … … 2838 3044 return NAL_UNIT_CODED_SLICE_IDR_W_RADL; 2839 3045 } 3046 #if EFFICIENT_FIELD_IRAP 3047 if(isField && pocCurr == 1) 3048 { 3049 // to avoid the picture becoming an IRAP 3050 return NAL_UNIT_CODED_SLICE_TRAIL_R; 3051 } 3052 #endif 3053 3054 #if ALLOW_RECOVERY_POINT_AS_RAP 3055 if(m_pcCfg->getDecodingRefreshType() != 3 && (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0) 3056 #else 2840 3057 if ((pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0) 3058 #endif 2841 3059 { 2842 3060 if (m_pcCfg->getDecodingRefreshType() == 1) -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r884 r964 85 85 Int m_iNumPicCoded; 86 86 Bool m_bFirst; 87 #if ALLOW_RECOVERY_POINT_AS_RAP 88 Int m_iLastRecoveryPicPOC; 89 #endif 87 90 88 91 // Access channel -
trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r872 r964 920 920 for (y=0; y<endY; y++) 921 921 { 922 #if SAO_SGN_FUNC 923 signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]); 924 #else 922 925 signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]]; 926 #endif 923 927 for (x=startX; x<endX; x++) 924 928 { 929 #if SAO_SGN_FUNC 930 signRight = (Char)sgn(srcLine[x] - srcLine[x+1]); 931 #else 925 932 signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]]; 933 #endif 926 934 edgeType = signRight + signLeft; 927 935 signLeft = -signRight; … … 943 951 for(y=0; y<skipLinesB[typeIdx]; y++) 944 952 { 953 #if SAO_SGN_FUNC 954 signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]); 955 #else 945 956 signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]]; 957 #endif 946 958 for (x=startX; x<endX; x++) 947 959 { 960 #if SAO_SGN_FUNC 961 signRight = (Char)sgn(srcLine[x] - srcLine[x+1]); 962 #else 948 963 signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]]; 964 #endif 949 965 edgeType = signRight + signLeft; 950 966 signLeft = -signRight; … … 994 1010 #endif 995 1011 { 1012 #if SAO_SGN_FUNC 1013 signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]); 1014 #else 996 1015 signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]]; 1016 #endif 997 1017 } 998 1018 … … 1008 1028 #endif 1009 1029 { 1030 #if SAO_SGN_FUNC 1031 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x]); 1032 #else 1010 1033 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x]]; 1034 #endif 1011 1035 edgeType = signDown + signUpLine[x]; 1012 1036 signUpLine[x]= -signDown; … … 1033 1057 for (x=startX; x<endX; x++) 1034 1058 { 1059 #if SAO_SGN_FUNC 1060 edgeType = sgn(srcLine[x] - srcLineBelow[x]) + sgn(srcLine[x] - srcLineAbove[x]); 1061 #else 1035 1062 edgeType = m_sign[srcLine[x] - srcLineBelow[x]] + m_sign[srcLine[x] - srcLineAbove[x]]; 1063 #endif 1036 1064 diff [edgeType] += (orgLine[x] - srcLine[x]); 1037 1065 count[edgeType] ++; … … 1076 1104 for (x=startX; x<endX+1; x++) 1077 1105 { 1106 #if SAO_SGN_FUNC 1107 signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x-1]); 1108 #else 1078 1109 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x-1]]; 1110 #endif 1079 1111 } 1080 1112 … … 1090 1122 for(x=firstLineStartX; x<firstLineEndX; x++) 1091 1123 { 1124 #if SAO_SGN_FUNC 1125 edgeType = sgn(srcLine[x] - srcLineAbove[x-1]) - signUpLine[x+1]; 1126 #else 1092 1127 edgeType = m_sign[srcLine[x] - srcLineAbove[x-1]] - signUpLine[x+1]; 1128 #endif 1093 1129 diff [edgeType] += (orgLine[x] - srcLine[x]); 1094 1130 count[edgeType] ++; … … 1105 1141 for (x=startX; x<endX; x++) 1106 1142 { 1143 #if SAO_SGN_FUNC 1144 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x+1]); 1145 #else 1107 1146 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x+1]] ; 1147 #endif 1108 1148 edgeType = signDown + signUpLine[x]; 1109 1149 diff [edgeType] += (orgLine[x] - srcLine[x]); … … 1112 1152 signDownLine[x+1] = -signDown; 1113 1153 } 1154 #if SAO_SGN_FUNC 1155 signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]); 1156 #else 1114 1157 signDownLine[startX] = (Char)m_sign[srcLineBelow[startX] - srcLine[startX-1]]; 1158 #endif 1115 1159 1116 1160 signTmpLine = signUpLine; … … 1136 1180 for (x=startX; x< endX; x++) 1137 1181 { 1182 #if SAO_SGN_FUNC 1183 edgeType = sgn(srcLine[x] - srcLineBelow[x+1]) + sgn(srcLine[x] - srcLineAbove[x-1]); 1184 #else 1138 1185 edgeType = m_sign[srcLine[x] - srcLineBelow[x+1]] + m_sign[srcLine[x] - srcLineAbove[x-1]]; 1186 #endif 1139 1187 diff [edgeType] += (orgLine[x] - srcLine[x]); 1140 1188 count[edgeType] ++; … … 1174 1222 for (x=startX-1; x<endX; x++) 1175 1223 { 1224 #if SAO_SGN_FUNC 1225 signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]); 1226 #else 1176 1227 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x+1]]; 1228 #endif 1177 1229 } 1178 1230 … … 1193 1245 for(x=firstLineStartX; x<firstLineEndX; x++) 1194 1246 { 1247 #if SAO_SGN_FUNC 1248 edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) - signUpLine[x-1]; 1249 #else 1195 1250 edgeType = m_sign[srcLine[x] - srcLineAbove[x+1]] - signUpLine[x-1]; 1251 #endif 1196 1252 diff [edgeType] += (orgLine[x] - srcLine[x]); 1197 1253 count[edgeType] ++; … … 1208 1264 for(x=startX; x<endX; x++) 1209 1265 { 1266 #if SAO_SGN_FUNC 1267 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x-1]); 1268 #else 1210 1269 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x-1]] ; 1270 #endif 1211 1271 edgeType = signDown + signUpLine[x]; 1212 1272 … … 1216 1276 signUpLine[x-1] = -signDown; 1217 1277 } 1278 #if SAO_SGN_FUNC 1279 signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]); 1280 #else 1218 1281 signUpLine[endX-1] = (Char)m_sign[srcLineBelow[endX-1] - srcLine[endX]]; 1282 #endif 1219 1283 srcLine += srcStride; 1220 1284 orgLine += orgStride; … … 1235 1299 for (x=startX; x<endX; x++) 1236 1300 { 1301 #if SAO_SGN_FUNC 1302 edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + sgn(srcLine[x] - srcLineAbove[x+1]); 1303 #else 1237 1304 edgeType = m_sign[srcLine[x] - srcLineBelow[x-1]] + m_sign[srcLine[x] - srcLineAbove[x+1]]; 1305 #endif 1238 1306 diff [edgeType] += (orgLine[x] - srcLine[x]); 1239 1307 count[edgeType] ++; -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r950 r964 2809 2809 { 2810 2810 UInt uiDepth = pcCU->getDepth(0); 2811 UInt uiNumPU = pcCU->getNumPart Inter();2811 UInt uiNumPU = pcCU->getNumPartitions(); 2812 2812 UInt uiInitTrDepth = pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1; 2813 2813 UInt uiWidth = pcCU->getWidth (0) >> uiInitTrDepth; … … 3971 3971 TComMv cMvTemp[2][33]; 3972 3972 3973 Int iNumPart = pcCU->getNumPart Inter();3973 Int iNumPart = pcCU->getNumPartitions(); 3974 3974 Int iNumPredDir = pcCU->getSlice()->isInterP() ? 1 : 2; 3975 3975 … … 5644 5644 5645 5645 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] ); 5646 #if 0 // check 5647 { 5648 m_pcEntropyCoder->resetBits(); 5649 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0) ); 5650 const UInt uiBitsForCoeff = m_pcEntropyCoder->getNumberOfWrittenBits(); 5651 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] ); 5652 if( uiBitsForCoeff != uiBits ) 5653 assert( 0 ); 5654 } 5655 #endif 5646 5656 5647 uiBits = 0; 5657 5648 { -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r950 r964 221 221 Int depth; 222 222 { 223 #if FIX_FIELD_DEPTH 224 Int poc = rpcSlice->getPOC(); 225 if(isField) 226 { 227 poc = (poc/2)%(m_pcCfg->getGOPSize()/2); 228 } 229 else 230 { 231 poc = poc%m_pcCfg->getGOPSize(); 232 } 233 #else 223 234 Int poc = rpcSlice->getPOC()%m_pcCfg->getGOPSize(); 235 #endif 224 236 if ( poc == 0 ) 225 237 { … … 244 256 } 245 257 } 258 #if FIX_FIELD_DEPTH 259 #if HARMONIZE_GOP_FIRST_FIELD_COUPLE 260 if(poc != 0) 261 { 262 #endif 263 if(isField && rpcSlice->getPOC()%2 == 1) 264 { 265 depth ++; 266 } 267 #if HARMONIZE_GOP_FIRST_FIELD_COUPLE 268 } 269 #endif 270 #endif 246 271 } 247 272 … … 266 291 267 292 eSliceType=B_SLICE; 293 #if EFFICIENT_FIELD_IRAP 294 if(!(isField && pocLast == 1)) 295 { 296 #endif // EFFICIENT_FIELD_IRAP 297 #if ALLOW_RECOVERY_POINT_AS_RAP 298 if(m_pcCfg->getDecodingRefreshType() == 3) 299 { 300 eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 301 } 302 else 303 { 304 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 305 } 306 #else 268 307 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 308 #endif 309 #if EFFICIENT_FIELD_IRAP 310 } 311 #endif 312 #endif 269 313 270 314 rpcSlice->setSliceType ( eSliceType ); 271 #endif272 315 273 316 // ------------------------------------------------------------------------------------------------------------------ … … 450 493 } 451 494 #else 452 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 495 #if EFFICIENT_FIELD_IRAP 496 if(!(isField && pocLast == 1)) 497 { 498 #endif // EFFICIENT_FIELD_IRAP 499 #if ALLOW_RECOVERY_POINT_AS_RAP 500 if(m_pcCfg->getDecodingRefreshType() == 3) 501 { 502 eSliceType = (pocLast == 0 || (pocCurr) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 503 504 } 505 else 506 { 507 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 508 } 509 #else 510 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 511 #endif 512 #if EFFICIENT_FIELD_IRAP 513 } 514 #endif // EFFICIENT_FIELD_IRAP 453 515 #endif 454 516 … … 566 628 // store lambda 567 629 slice->setSliceQp( sliceQP ); 630 #if ADAPTIVE_QP_SELECTION 568 631 slice->setSliceQpBase ( sliceQP ); 632 #endif 569 633 m_pcRdCost ->setLambda( lambda ); 570 634 // for RDO … … 1105 1169 1106 1170 m_pcRateCtrl->setRCQP( estQP ); 1171 #if ADAPTIVE_QP_SELECTION 1107 1172 pcCU->getSlice()->setSliceQpBase( estQP ); 1173 #endif 1108 1174 } 1109 1175 -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r884 r964 697 697 m_cSPS.setSpsInferScalingListFlag ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) ); 698 698 m_cSPS.setSpsScalingListRefLayerId ( 0 ); 699 m_cSPS.setSpsExtensionFlag ( true ); 699 m_cSPS.setSpsExtensionPresentFlag ( true ); 700 #if H_MV_HLS_8_SPS_NODOC_48 701 m_cSPS.setSpsMultilayerExtensionFlag ( true ); 702 #else 700 703 m_cSPS.setSpsExtensionTypeFlag ( PS_EX_T_MV ,true ); 704 #endif 701 705 #if H_3D 706 #if H_MV_HLS_8_SPS_NODOC_48 707 m_cSPS.setSps3dExtensionFlag ( true ); 708 #else 702 709 m_cSPS.setSpsExtensionTypeFlag ( PS_EX_T_3D ,true ); 710 #endif 703 711 #endif 704 712 #endif … … 769 777 m_cSPS.setNumReorderPics(m_numReorderPics[i], i); 770 778 } 779 #if H_MV_HLS_8_HRD_Q0102_08 780 for ( Int ols = 0; ols < m_cVPS->getNumOutputLayerSets(); ols++) 781 { 782 // Check MaxDecPicBuffering 783 const std::vector<Int>& targetDecLayerIdList = m_cVPS->getTargetDecLayerIdList( m_cVPS->olsIdxToLsIdx( ols )); 784 for( Int is = 0; is < targetDecLayerIdList.size(); is++ ) 785 { 786 m_cSPS.inferSpsMaxDecPicBufferingMinus1( m_cVPS, ols, targetDecLayerIdList[is], true ); 787 } 788 } 789 790 #if H_MV_HLS_8_RPS_Q0100_36 791 m_cVPS->inferDbpSizeLayerSetZero( &m_cSPS, true ); 792 #endif 793 794 #endif 771 795 m_cSPS.setPCMBitDepthLuma (g_uiPCMBitDepthLuma); 772 796 m_cSPS.setPCMBitDepthChroma (g_uiPCMBitDepthChroma); … … 829 853 m_cPPS.setPPSId( getLayerIdInVps() ); 830 854 m_cPPS.setSPSId( getLayerIdInVps() ); 831 855 #if H_MV_HLS_8_SPS_NODOC_48 856 m_cPPS.setPpsMultilayerExtensionFlag ( true ); 857 #if H_3D 858 m_cPPS.setPps3dExtensionFlag ( true ); 859 #endif 860 #else 832 861 m_cPPS.setPpsExtensionTypeFlag ( PPS_EX_T_MV ,true ); 833 862 #if H_3D 834 863 m_cPPS.setPpsExtensionTypeFlag ( PPS_EX_T_3D ,true ); 864 #endif 835 865 #endif 836 866 #endif
Note: See TracChangeset for help on using the changeset viewer.