Changeset 806 in SHVCSoftware for branches/SHM-6-dev/source/App
- Timestamp:
- 20 Jun 2014, 21:17:30 (11 years ago)
- Location:
- branches/SHM-6-dev/source/App/TAppEncoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r804 r806 1018 1018 #if Q0108_TSA_STSA 1019 1019 for (Int i=1; i<MAX_LAYERS; i++) 1020 for(Int j=1; j<MAX_GOP+1; j++){ 1021 std::ostringstream cOSS; 1022 cOSS<<"Layer"<<i<<"Frame"<<j; 1023 opts.addOptions()(cOSS.str(), m_EH_GOPList[i][j-1], GOPEntry()); 1020 { 1021 for(Int j=1; j<MAX_GOP+1; j++) 1022 { 1023 std::ostringstream cOSS; 1024 cOSS<<"Layer"<<i<<"Frame"<<j; 1025 opts.addOptions()(cOSS.str(), m_EhGOPList[i][j-1], GOPEntry()); 1026 } 1024 1027 } 1025 1028 #endif … … 1035 1038 for(Int j=1; j<MAX_GOP+1; j++) 1036 1039 { 1037 m_E H_GOPList[i][j-1] = m_GOPList[j-1];1040 m_EhGOPList[i][j-1] = m_GOPList[j-1]; 1038 1041 } 1039 1042 } … … 1042 1045 for(Int j=1; j<MAX_GOP+1; j++) 1043 1046 { 1044 m_E H_GOPList[i][j-1] = m_EH_GOPList[m_inheritCodingStruct[i]][j-1];1047 m_EhGOPList[i][j-1] = m_EhGOPList[m_inheritCodingStruct[i]][j-1]; 1045 1048 } 1046 1049 } … … 1887 1890 } 1888 1891 #endif 1889 1890 1892 1891 1893 Bool verifiedGOP=false; … … 1920 1922 xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" ); 1921 1923 m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers; 1922 1923 1924 1924 1925 // it can be updated after AVC BL support will be added to the WD … … 1960 1961 m_extraRPSs = 0; 1961 1962 #else 1962 for (Int i = 0; i< MAX_LAYERS; i++) 1963 { 1964 m_extraRPSs[i] = 0; 1965 } 1963 memset( m_extraRPSs, 0, sizeof( m_extraRPSs ) ); 1966 1964 #endif 1967 1965 //start looping through frames in coding order until we can verify that the GOP structure is correct. … … 2231 2229 xConfirmPara(errorGOP,"Invalid GOP structure given"); 2232 2230 2233 #if Q0108_TSA_STSA2234 for ( Int layer _index = 1; layer_index<m_numLayers; layer_index++)2231 #if SVC_EXTENSION && Q0108_TSA_STSA 2232 for ( Int layerId = 1; layerId < m_numLayers; layerId++ ) 2235 2233 { 2236 2234 verifiedGOP=false; … … 2239 2237 numRefs = m_isField ? 2 : 1; 2240 2238 refList[0]=0; 2239 2241 2240 if(m_isField) 2242 2241 { 2243 2242 refList[1] = 1; 2244 2243 } 2245 for(Int i=0; i<MAX_GOP; i++) 2246 { 2247 isOK[i]=false; 2248 } 2244 2245 memset( isOK, 0, sizeof( isOK ) ); 2249 2246 numOK=0; 2250 #if !SVC_EXTENSION 2251 xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" ); 2252 #endif 2253 2254 for(Int i=0; i<m_iGOPSize; i++) 2255 { 2256 if(m_EH_GOPList[layer_index][i].m_POC==m_iGOPSize) 2257 { 2258 xConfirmPara( m_EH_GOPList[layer_index][i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " ); 2259 } 2260 } 2261 2262 #if SVC_EXTENSION 2263 xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" ); 2264 m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers; 2265 2266 // verify layer configuration parameters 2267 for(UInt layer=0; layer<m_numLayers; layer++) 2268 { 2269 Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod; 2270 #endif 2271 if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) ) 2272 { 2247 2273 2248 for(Int i=0; i<m_iGOPSize; i++) 2274 2249 { 2275 xConfirmPara( (m_EH_GOPList[layer_index][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_EH_GOPList[layer_index][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" ); 2276 xConfirmPara( (m_EH_GOPList[layer_index][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_EH_GOPList[layer_index][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" ); 2277 } 2278 } 2279 #if SVC_EXTENSION 2280 } 2281 #endif 2282 2283 //start looping through frames in coding order until we can verify that the GOP structure is correct. 2284 while(!verifiedGOP&&!errorGOP) 2285 { 2286 Int curGOP = (checkGOP-1)%m_iGOPSize; 2287 Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_EH_GOPList[layer_index][curGOP].m_POC; 2288 if(m_EH_GOPList[layer_index][curGOP].m_POC<0) 2289 { 2290 printf("\nError: found fewer Reference Picture Sets than GOPSize\n"); 2291 errorGOP=true; 2292 } 2293 else 2294 { 2295 //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP. 2296 Bool beforeI = false; 2297 for(Int i = 0; i< m_EH_GOPList[layer_index][curGOP].m_numRefPics; i++) 2298 { 2299 Int absPOC = curPOC+m_EH_GOPList[layer_index][curGOP].m_referencePics[i]; 2300 if(absPOC < 0) 2301 { 2302 beforeI=true; 2303 } 2304 else 2305 { 2306 Bool found=false; 2307 for(Int j=0; j<numRefs; j++) 2250 if(m_EhGOPList[layerId][i].m_POC==m_iGOPSize) 2251 { 2252 xConfirmPara( m_EhGOPList[layerId][i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " ); 2253 } 2254 } 2255 2256 xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" ); 2257 m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers; 2258 2259 // verify layer configuration parameters 2260 for(UInt layer=0; layer<m_numLayers; layer++) 2261 { 2262 Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod; 2263 if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) ) 2264 { 2265 for(Int i=0; i<m_iGOPSize; i++) 2266 { 2267 xConfirmPara( (m_EhGOPList[layerId][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_EhGOPList[layerId][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" ); 2268 xConfirmPara( (m_EhGOPList[layerId][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_EhGOPList[layerId][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" ); 2269 } 2270 } 2271 } 2272 2273 //start looping through frames in coding order until we can verify that the GOP structure is correct. 2274 while(!verifiedGOP&&!errorGOP) 2275 { 2276 Int curGOP = (checkGOP-1)%m_iGOPSize; 2277 Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerId][curGOP].m_POC; 2278 if(m_EhGOPList[layerId][curGOP].m_POC<0) 2279 { 2280 printf("\nError: found fewer Reference Picture Sets than GOPSize\n"); 2281 errorGOP=true; 2282 } 2283 else 2284 { 2285 //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP. 2286 Bool beforeI = false; 2287 for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++) 2288 { 2289 Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2290 if(absPOC < 0) 2308 2291 { 2309 if(refList[j]==absPOC) 2292 beforeI=true; 2293 } 2294 else 2295 { 2296 Bool found=false; 2297 for(Int j=0; j<numRefs; j++) 2310 2298 { 2311 found=true; 2312 for(Int k=0; k<m_iGOPSize; k++) 2299 if(refList[j]==absPOC) 2313 2300 { 2314 if(absPOC%m_iGOPSize == m_EH_GOPList[layer_index][k].m_POC%m_iGOPSize) 2301 found=true; 2302 for(Int k=0; k<m_iGOPSize; k++) 2315 2303 { 2316 if( m_EH_GOPList[layer_index][k].m_temporalId==m_EH_GOPList[layer_index][curGOP].m_temporalId)2304 if(absPOC%m_iGOPSize == m_EhGOPList[layerId][k].m_POC%m_iGOPSize) 2317 2305 { 2318 m_EH_GOPList[layer_index][k].m_refPic = true; 2306 if(m_EhGOPList[layerId][k].m_temporalId==m_EhGOPList[layerId][curGOP].m_temporalId) 2307 { 2308 m_EhGOPList[layerId][k].m_refPic = true; 2309 } 2310 m_EhGOPList[layerId][curGOP].m_usedByCurrPic[i]=m_EhGOPList[layerId][k].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId; 2319 2311 } 2320 m_EH_GOPList[layer_index][curGOP].m_usedByCurrPic[i]=m_EH_GOPList[layer_index][k].m_temporalId<=m_EH_GOPList[layer_index][curGOP].m_temporalId;2321 2312 } 2322 2313 } 2323 2314 } 2315 if(!found) 2316 { 2317 printf("\nError: ref pic %d is not available for GOP frame %d\n",m_EhGOPList[layerId][curGOP].m_referencePics[i],curGOP+1); 2318 errorGOP=true; 2319 } 2324 2320 } 2325 if(!found) 2321 } 2322 if(!beforeI&&!errorGOP) 2323 { 2324 //all ref frames were present 2325 if(!isOK[curGOP]) 2326 2326 { 2327 printf("\nError: ref pic %d is not available for GOP frame %d\n",m_EH_GOPList[layer_index][curGOP].m_referencePics[i],curGOP+1); 2328 errorGOP=true; 2327 numOK++; 2328 isOK[curGOP]=true; 2329 if(numOK==m_iGOPSize) 2330 { 2331 verifiedGOP=true; 2332 } 2329 2333 } 2330 2334 } 2331 } 2332 if(!beforeI&&!errorGOP) 2333 { 2334 //all ref frames were present 2335 if(!isOK[curGOP]) 2336 { 2337 numOK++; 2338 isOK[curGOP]=true; 2339 if(numOK==m_iGOPSize) 2335 else 2336 { 2337 //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0) 2338 2339 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]]=m_EhGOPList[layerId][curGOP]; 2340 Int newRefs=0; 2341 for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++) 2340 2342 { 2341 verifiedGOP=true; 2342 } 2343 } 2344 } 2345 else 2346 { 2347 //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0) 2348 2349 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]]=m_EH_GOPList[layer_index][curGOP]; 2350 Int newRefs=0; 2351 for(Int i = 0; i< m_EH_GOPList[layer_index][curGOP].m_numRefPics; i++) 2352 { 2353 Int absPOC = curPOC+m_EH_GOPList[layer_index][curGOP].m_referencePics[i]; 2354 if(absPOC>=0) 2355 { 2356 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_referencePics[newRefs]=m_EH_GOPList[layer_index][curGOP].m_referencePics[i]; 2357 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_usedByCurrPic[newRefs]=m_EH_GOPList[layer_index][curGOP].m_usedByCurrPic[i]; 2358 newRefs++; 2359 } 2360 } 2361 Int numPrefRefs = m_EH_GOPList[layer_index][curGOP].m_numRefPicsActive; 2362 2363 for(Int offset = -1; offset>-checkGOP; offset--) 2364 { 2365 //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0. 2366 Int offGOP = (checkGOP-1+offset)%m_iGOPSize; 2367 Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_EH_GOPList[layer_index][offGOP].m_POC; 2368 if(offPOC>=0&&m_EH_GOPList[layer_index][offGOP].m_temporalId<=m_EH_GOPList[layer_index][curGOP].m_temporalId) 2369 { 2370 Bool newRef=false; 2371 for(Int i=0; i<numRefs; i++) 2343 Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2344 if(absPOC>=0) 2372 2345 { 2373 if(refList[i]==offPOC) 2374 { 2375 newRef=true; 2376 } 2377 } 2378 for(Int i=0; i<newRefs; i++) 2379 { 2380 if(m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_referencePics[i]==offPOC-curPOC) 2381 { 2382 newRef=false; 2383 } 2384 } 2385 if(newRef) 2386 { 2387 Int insertPoint=newRefs; 2388 //this picture can be added, find appropriate place in list and insert it. 2389 if(m_EH_GOPList[layer_index][offGOP].m_temporalId==m_EH_GOPList[layer_index][curGOP].m_temporalId) 2390 { 2391 m_EH_GOPList[layer_index][offGOP].m_refPic = true; 2392 } 2393 for(Int j=0; j<newRefs; j++) 2394 { 2395 if(m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_referencePics[j]<offPOC-curPOC||m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_referencePics[j]>0) 2396 { 2397 insertPoint = j; 2398 break; 2399 } 2400 } 2401 Int prev = offPOC-curPOC; 2402 Int prevUsed = m_EH_GOPList[layer_index][offGOP].m_temporalId<=m_EH_GOPList[layer_index][curGOP].m_temporalId; 2403 for(Int j=insertPoint; j<newRefs+1; j++) 2404 { 2405 Int newPrev = m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_referencePics[j]; 2406 Int newUsed = m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_usedByCurrPic[j]; 2407 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_referencePics[j]=prev; 2408 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_usedByCurrPic[j]=prevUsed; 2409 prevUsed=newUsed; 2410 prev=newPrev; 2411 } 2346 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[newRefs]=m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2347 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[newRefs]=m_EhGOPList[layerId][curGOP].m_usedByCurrPic[i]; 2412 2348 newRefs++; 2413 2349 } 2414 2350 } 2415 if(newRefs>=numPrefRefs) 2351 Int numPrefRefs = m_EhGOPList[layerId][curGOP].m_numRefPicsActive; 2352 2353 for(Int offset = -1; offset>-checkGOP; offset--) 2416 2354 { 2417 break; 2418 } 2419 } 2420 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_numRefPics=newRefs; 2421 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_POC = curPOC; 2422 if (m_extraRPSs[layer_index] == 0) 2423 { 2424 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_interRPSPrediction = 0; 2425 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_numRefIdc = 0; 2426 } 2427 else 2428 { 2429 Int rIdx = m_iGOPSize + m_extraRPSs[layer_index] - 1; 2430 Int refPOC = m_EH_GOPList[layer_index][rIdx].m_POC; 2431 Int refPics = m_EH_GOPList[layer_index][rIdx].m_numRefPics; 2432 Int newIdc=0; 2433 for(Int i = 0; i<= refPics; i++) 2434 { 2435 Int deltaPOC = ((i != refPics)? m_EH_GOPList[layer_index][rIdx].m_referencePics[i] : 0); // check if the reference abs POC is >= 0 2436 Int absPOCref = refPOC+deltaPOC; 2437 Int refIdc = 0; 2438 for (Int j = 0; j < m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_numRefPics; j++) 2355 //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0. 2356 Int offGOP = (checkGOP-1+offset)%m_iGOPSize; 2357 Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerId][offGOP].m_POC; 2358 if(offPOC>=0&&m_EhGOPList[layerId][offGOP].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId) 2439 2359 { 2440 if ( (absPOCref - curPOC) == m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_referencePics[j]) 2360 Bool newRef=false; 2361 for(Int i=0; i<numRefs; i++) 2441 2362 { 2442 if (m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_usedByCurrPic[j])2363 if(refList[i]==offPOC) 2443 2364 { 2444 refIdc = 1; 2445 } 2446 else 2447 { 2448 refIdc = 2; 2365 newRef=true; 2449 2366 } 2450 2367 } 2368 for(Int i=0; i<newRefs; i++) 2369 { 2370 if(m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[i]==offPOC-curPOC) 2371 { 2372 newRef=false; 2373 } 2374 } 2375 if(newRef) 2376 { 2377 Int insertPoint=newRefs; 2378 //this picture can be added, find appropriate place in list and insert it. 2379 if(m_EhGOPList[layerId][offGOP].m_temporalId==m_EhGOPList[layerId][curGOP].m_temporalId) 2380 { 2381 m_EhGOPList[layerId][offGOP].m_refPic = true; 2382 } 2383 for(Int j=0; j<newRefs; j++) 2384 { 2385 if(m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]<offPOC-curPOC||m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]>0) 2386 { 2387 insertPoint = j; 2388 break; 2389 } 2390 } 2391 Int prev = offPOC-curPOC; 2392 Int prevUsed = m_EhGOPList[layerId][offGOP].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId; 2393 for(Int j=insertPoint; j<newRefs+1; j++) 2394 { 2395 Int newPrev = m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]; 2396 Int newUsed = m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]; 2397 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]=prev; 2398 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]=prevUsed; 2399 prevUsed=newUsed; 2400 prev=newPrev; 2401 } 2402 newRefs++; 2403 } 2451 2404 } 2452 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_refIdc[newIdc]=refIdc; 2453 newIdc++; 2405 if(newRefs>=numPrefRefs) 2406 { 2407 break; 2408 } 2454 2409 } 2455 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_interRPSPrediction = 1; 2456 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_numRefIdc = newIdc; 2457 m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_deltaRPS = refPOC - m_EH_GOPList[layer_index][m_iGOPSize+m_extraRPSs[layer_index]].m_POC; 2458 } 2459 curGOP=m_iGOPSize+m_extraRPSs[layer_index]; 2460 m_extraRPSs[layer_index]++; 2461 } 2462 numRefs=0; 2463 for(Int i = 0; i< m_EH_GOPList[layer_index][curGOP].m_numRefPics; i++) 2464 { 2465 Int absPOC = curPOC+m_EH_GOPList[layer_index][curGOP].m_referencePics[i]; 2466 if(absPOC >= 0) 2467 { 2468 refList[numRefs]=absPOC; 2469 numRefs++; 2470 } 2471 } 2472 refList[numRefs]=curPOC; 2473 numRefs++; 2474 } 2475 checkGOP++; 2476 } 2477 xConfirmPara(errorGOP,"Invalid GOP structure given"); 2410 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefPics=newRefs; 2411 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_POC = curPOC; 2412 if (m_extraRPSs[layerId] == 0) 2413 { 2414 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_interRPSPrediction = 0; 2415 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefIdc = 0; 2416 } 2417 else 2418 { 2419 Int rIdx = m_iGOPSize + m_extraRPSs[layerId] - 1; 2420 Int refPOC = m_EhGOPList[layerId][rIdx].m_POC; 2421 Int refPics = m_EhGOPList[layerId][rIdx].m_numRefPics; 2422 Int newIdc=0; 2423 for(Int i = 0; i<= refPics; i++) 2424 { 2425 Int deltaPOC = ((i != refPics)? m_EhGOPList[layerId][rIdx].m_referencePics[i] : 0); // check if the reference abs POC is >= 0 2426 Int absPOCref = refPOC+deltaPOC; 2427 Int refIdc = 0; 2428 for (Int j = 0; j < m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefPics; j++) 2429 { 2430 if ( (absPOCref - curPOC) == m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]) 2431 { 2432 if (m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]) 2433 { 2434 refIdc = 1; 2435 } 2436 else 2437 { 2438 refIdc = 2; 2439 } 2440 } 2441 } 2442 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_refIdc[newIdc]=refIdc; 2443 newIdc++; 2444 } 2445 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_interRPSPrediction = 1; 2446 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefIdc = newIdc; 2447 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_deltaRPS = refPOC - m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_POC; 2448 } 2449 curGOP=m_iGOPSize+m_extraRPSs[layerId]; 2450 m_extraRPSs[layerId]++; 2451 } 2452 numRefs=0; 2453 for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++) 2454 { 2455 Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2456 if(absPOC >= 0) 2457 { 2458 refList[numRefs]=absPOC; 2459 numRefs++; 2460 } 2461 } 2462 refList[numRefs]=curPOC; 2463 numRefs++; 2464 } 2465 checkGOP++; 2466 } 2467 xConfirmPara(errorGOP,"Invalid GOP structure given"); 2478 2468 } 2479 2469 #endif 2480 2481 2470 2482 2471 m_maxTempLayer = 1; … … 2491 2480 2492 2481 #if Q0108_TSA_STSA 2493 for ( Int layer _index = 1; layer_index<m_numLayers; layer_index++)2494 { 2495 m_E H_maxTempLayer[layer_index] = 1;2482 for ( Int layerId = 1; layerId < m_numLayers; layerId++) 2483 { 2484 m_EhMaxTempLayer[layerId] = 1; 2496 2485 for(Int i=0; i<m_iGOPSize; i++) 2497 2486 { 2498 if(m_E H_GOPList[layer_index][i].m_temporalId >= m_EH_maxTempLayer[layer_index] )2499 { 2500 m_E H_maxTempLayer[layer_index] = m_EH_GOPList[layer_index][i].m_temporalId;2487 if(m_EhGOPList[layerId][i].m_temporalId >= m_EhMaxTempLayer[layerId] ) 2488 { 2489 m_EhMaxTempLayer[layerId] = m_EhGOPList[layerId][i].m_temporalId; 2501 2490 } 2502 2491 xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I"); -
branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.h
r804 r806 129 129 Int m_extraRPSs; ///< extra RPSs added to handle CRA 130 130 #else 131 Int m_extraRPSs[MAX_LAYERS]; 131 Int m_extraRPSs[MAX_LAYERS]; ///< extra RPSs added to handle CRA 132 132 #endif 133 133 134 134 GOPEntry m_GOPList[MAX_GOP]; ///< the coding structure entries from the config file 135 135 #if Q0108_TSA_STSA 136 GOPEntry m_E H_GOPList[MAX_LAYERS][MAX_GOP];///< the enhancement layer coding structure entries from the config file136 GOPEntry m_EhGOPList[MAX_LAYERS][MAX_GOP]; ///< the enhancement layer coding structure entries from the config file 137 137 Int m_inheritCodingStruct[MAX_LAYERS]; 138 138 #endif … … 166 166 Int m_maxTempLayer; ///< Max temporal layer 167 167 #if Q0108_TSA_STSA 168 Int m_E H_maxTempLayer[MAX_LAYERS];///< Max temporal layer168 Int m_EhMaxTempLayer[MAX_LAYERS]; ///< Max temporal layer 169 169 #endif 170 170 -
branches/SHM-6-dev/source/App/TAppEncoder/TAppEncTop.cpp
r805 r806 241 241 m_acTEncTop[layer].setGOPSize ( m_iGOPSize ); 242 242 #if Q0108_TSA_STSA 243 if(layer == 0) 244 m_acTEncTop[layer].setGopList ( m_GOPList ); 245 else 246 m_acTEncTop[layer].setGopList ( m_EH_GOPList[layer] ); 243 m_acTEncTop[layer].setGopList ( layer ? m_EhGOPList[layer] : m_GOPList ); 247 244 #else 248 245 m_acTEncTop[layer].setGopList ( m_GOPList ); … … 275 272 else 276 273 { 277 m_acTEncTop[layer].setMaxTempLayer ( m_E H_maxTempLayer[layer] );274 m_acTEncTop[layer].setMaxTempLayer ( m_EhMaxTempLayer[layer] ); 278 275 } 279 276 #endif
Note: See TracChangeset for help on using the changeset viewer.