Changeset 288 in SHVCSoftware for branches/SHM-2.1-dev/source/App/TAppEncoder
- Timestamp:
- 12 Jun 2013, 03:37:28 (12 years ago)
- Location:
- branches/SHM-2.1-dev/source/App/TAppEncoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r282 r288 345 345 #endif 346 346 #if SCALED_REF_LAYER_OFFSETS 347 Int* cfg_scaledRefLayerLeftOffset [MAX_LAYERS]; 348 Int* cfg_scaledRefLayerTopOffset [MAX_LAYERS]; 349 Int* cfg_scaledRefLayerRightOffset [MAX_LAYERS]; 350 Int* cfg_scaledRefLayerBottomOffset [MAX_LAYERS]; 347 string cfg_scaledRefLayerLeftOffset [MAX_LAYERS]; 348 string cfg_scaledRefLayerTopOffset [MAX_LAYERS]; 349 string cfg_scaledRefLayerRightOffset [MAX_LAYERS]; 350 string cfg_scaledRefLayerBottomOffset [MAX_LAYERS]; 351 Int* cfg_numScaledRefLayerOffsets[MAX_LAYERS]; 352 353 string* cfg_scaledRefLayerLeftOffsetPtr [MAX_LAYERS]; 354 string* cfg_scaledRefLayerTopOffsetPtr [MAX_LAYERS]; 355 string* cfg_scaledRefLayerRightOffsetPtr [MAX_LAYERS]; 356 string* cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS]; 351 357 #endif 352 358 #if RC_SHVC_HARMONIZATION … … 376 382 #endif 377 383 #if SCALED_REF_LAYER_OFFSETS 378 cfg_scaledRefLayerLeftOffset [layer] = &m_acLayerCfg[layer].m_scaledRefLayerLeftOffset; 379 cfg_scaledRefLayerTopOffset [layer] = &m_acLayerCfg[layer].m_scaledRefLayerTopOffset; 380 cfg_scaledRefLayerRightOffset [layer] = &m_acLayerCfg[layer].m_scaledRefLayerRightOffset; 381 cfg_scaledRefLayerBottomOffset[layer] = &m_acLayerCfg[layer].m_scaledRefLayerBottomOffset; 384 cfg_numScaledRefLayerOffsets [layer] = &m_acLayerCfg[layer].m_numScaledRefLayerOffsets; 385 for(Int i = 0; i < MAX_LAYERS; i++) 386 { 387 cfg_scaledRefLayerLeftOffsetPtr [layer] = &cfg_scaledRefLayerLeftOffset[layer] ; 388 cfg_scaledRefLayerTopOffsetPtr [layer] = &cfg_scaledRefLayerTopOffset[layer] ; 389 cfg_scaledRefLayerRightOffsetPtr [layer] = &cfg_scaledRefLayerRightOffset[layer] ; 390 cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer]; 391 } 382 392 #endif 383 393 #if RC_SHVC_HARMONIZATION … … 452 462 ("InternalBitDepthC", m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)") 453 463 #if SCALED_REF_LAYER_OFFSETS 454 ("ScaledRefLayerLeftOffset%d", cfg_scaledRefLayerLeftOffset, 0, MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to" 464 ("NumScaledRefLayerOffsets%d", cfg_numScaledRefLayerOffsets, 0, MAX_LAYERS, "Number of scaled offset layer sets ") 465 ("ScaledRefLayerLeftOffset%d", cfg_scaledRefLayerLeftOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to" 455 466 " top-left luma sample of the EL picture, in units of two luma samples") 456 ("ScaledRefLayerTopOffset%d", cfg_scaledRefLayerTopOffset , 0, MAX_LAYERS, "Vertical offset of top-left luma sample of scaled base layer picture with respect to"467 ("ScaledRefLayerTopOffset%d", cfg_scaledRefLayerTopOffsetPtr, string(""), MAX_LAYERS, "Vertical offset of top-left luma sample of scaled base layer picture with respect to" 457 468 " top-left luma sample of the EL picture, in units of two luma samples") 458 ("ScaledRefLayerRightOffset%d", cfg_scaledRefLayerRightOffset , 0, MAX_LAYERS, "Horizontal offset of bottom-right luma sample of scaled base layer picture with respect to"469 ("ScaledRefLayerRightOffset%d", cfg_scaledRefLayerRightOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of bottom-right luma sample of scaled base layer picture with respect to" 459 470 " bottom-right luma sample of the EL picture, in units of two luma samples") 460 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffset ,0, MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to"471 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" 461 472 " bottom-right luma sample of the EL picture, in units of two luma samples") 462 473 #endif … … 892 903 m_pRowHeight = NULL; 893 904 } 905 #if SCALED_REF_LAYER_OFFSETS 906 for(Int layer = 0; layer < MAX_LAYERS; layer++) 907 { 908 // If number of scaled ref. layer offsets is non-zero, at least one of the offsets should be specified 909 if(m_acLayerCfg[layer].m_numScaledRefLayerOffsets) 910 { 911 assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "") || 912 strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") || 913 strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(), "") || 914 strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") 915 ); 916 } 917 918 Int *tempArray = NULL; // Contain the value 919 // Left offset // 920 if(strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "")) 921 { 922 cfgStringToArray( &tempArray, cfg_scaledRefLayerLeftOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "LeftOffset"); 923 if(tempArray) 924 { 925 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 926 { 927 m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i] = tempArray[i]; 928 } 929 delete [] tempArray; tempArray = NULL; 930 } 931 } 932 933 // Top offset // 934 if(strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(), "")) 935 { 936 cfgStringToArray( &tempArray, cfg_scaledRefLayerTopOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "TopOffset"); 937 if(tempArray) 938 { 939 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 940 { 941 m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i] = tempArray[i]; 942 } 943 delete [] tempArray; tempArray = NULL; 944 } 945 } 946 947 // Right offset // 948 if(strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "")) 949 { 950 cfgStringToArray( &tempArray, cfg_scaledRefLayerRightOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RightOffset"); 951 if(tempArray) 952 { 953 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 954 { 955 m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i] = tempArray[i]; 956 } 957 delete [] tempArray; tempArray = NULL; 958 } 959 } 960 961 // Bottom offset // 962 if(strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(), "")) 963 { 964 cfgStringToArray( &tempArray, cfg_scaledRefLayerBottomOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "BottomOffset"); 965 if(tempArray) 966 { 967 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 968 { 969 m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i] = tempArray[i]; 970 } 971 delete [] tempArray; tempArray = NULL; 972 } 973 } 974 } 975 #endif 894 976 #if VPS_EXTN_DIRECT_REF_LAYERS 895 977 for(Int layer = 0; layer < MAX_LAYERS; layer++) … … 2096 2178 } 2097 2179 2180 #if SCALED_REF_LAYER_OFFSETS 2181 Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString) 2182 { 2183 Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str()); 2184 if( numEntries > 0 ) 2185 { 2186 Char *arrayEntry; 2187 Int i = 0; 2188 *arr = new Int[numEntries]; 2189 2190 arrayEntry = strtok( tempChar, " ,"); 2191 while(arrayEntry != NULL) 2192 { 2193 if( i >= numEntries ) 2194 { 2195 printf( "%c: The number of entries specified is larger than the allowed number.\n", logString ); 2196 exit( EXIT_FAILURE ); 2197 } 2198 *( *arr + i ) = atoi( arrayEntry ); 2199 arrayEntry = strtok(NULL, " ,"); 2200 i++; 2201 } 2202 if( i < numEntries ) 2203 { 2204 printf( "%c: Some entries are not specified.\n", logString ); 2205 exit( EXIT_FAILURE ); 2206 } 2207 } 2208 else 2209 { 2210 *arr = NULL; 2211 } 2212 } 2213 #endif 2098 2214 //! \} -
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.h
r245 r288 390 390 Char* getBLSyntaxFile() { return m_BLSyntaxFile; } 391 391 #endif 392 #if SCALED_REF_LAYER_OFFSETS 393 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); 394 #endif 392 395 #endif 393 396 };// END CLASS DEFINITION TAppEncCfg -
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r211 r288 35 35 m_confLeft = m_confRight = m_confTop = m_confBottom = 0; 36 36 m_aiPad[1] = m_aiPad[0] = 0; 37 #if SCALED_REF_LAYER_OFFSETS 38 m_numScaledRefLayerOffsets = 0; 39 ::memset(m_scaledRefLayerLeftOffset, 0, sizeof(m_scaledRefLayerLeftOffset)); 40 ::memset(m_scaledRefLayerTopOffset, 0, sizeof(m_scaledRefLayerTopOffset)); 41 ::memset(m_scaledRefLayerRightOffset, 0, sizeof(m_scaledRefLayerRightOffset)); 42 ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset)); 43 #endif 37 44 } 38 45 -
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r282 r288 68 68 TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config 69 69 #if SCALED_REF_LAYER_OFFSETS 70 Int m_scaledRefLayerLeftOffset; 71 Int m_scaledRefLayerTopOffset; 72 Int m_scaledRefLayerRightOffset; 73 Int m_scaledRefLayerBottomOffset; 70 Int m_numScaledRefLayerOffsets ; 71 Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; 72 Int m_scaledRefLayerTopOffset [MAX_LAYERS]; 73 Int m_scaledRefLayerRightOffset [MAX_LAYERS]; 74 Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; 74 75 #endif 75 76 public: -
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncTop.cpp
r282 r288 451 451 if( layer > 0 ) 452 452 { 453 m_acTEncTop[layer].getScaledRefLayerWindow().setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset, 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset, 454 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset, 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset); 453 m_acTEncTop[layer].setNumScaledRefLayerOffsets( m_acLayerCfg[layer].m_numScaledRefLayerOffsets ); 454 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 455 { 456 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 457 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 458 } 455 459 } 456 460 #endif
Note: See TracChangeset for help on using the changeset viewer.