Changeset 1434 in SHVCSoftware
- Timestamp:
- 11 Aug 2015, 20:47:57 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1433 r1434 1563 1563 ("SEIToneMapNominalWhiteLevelLumaCodeValue", m_nominalWhiteLevelLumaCodeValue, 235, "Specifies luma sample value of the nominal white level assigned decoded pictures") 1564 1564 ("SEIToneMapExtendedWhiteLevelLumaCodeValue", m_extendedWhiteLevelLumaCodeValue, 300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures") 1565 ("SEIChroma SamplingFilterHint", m_chromaSamplingFilterSEIenabled,false, "Control generation of the chroma sampling filter hint SEI message")1566 ("SEIChroma SamplingHorizontalFilterType", m_chromaSamplingHorFilterIdc,2, "Defines the Index of the chroma sampling horizontal filter\n"1565 ("SEIChromaResamplingFilterHint", m_chromaResamplingFilterSEIenabled, false, "Control generation of the chroma sampling filter hint SEI message") 1566 ("SEIChromaResamplingHorizontalFilterType", m_chromaResamplingHorFilterIdc, 2, "Defines the Index of the chroma sampling horizontal filter\n" 1567 1567 "\t0: unspecified - Chroma filter is unknown or is determined by the application" 1568 1568 "\t1: User-defined - Filter coefficients are specified in the chroma sampling filter hint SEI message" 1569 1569 "\t2: Standards-defined - ITU-T Rec. T.800 | ISO/IEC15444-1, 5/3 filter") 1570 ("SEIChroma SamplingVerticalFilterType", m_chromaSamplingVerFilterIdc, 2, "Defines the Index of the chroma sampling vertical filter\n"1570 ("SEIChromaResamplingVerticalFilterType", m_chromaResamplingVerFilterIdc, 2, "Defines the Index of the chroma sampling vertical filter\n" 1571 1571 "\t0: unspecified - Chroma filter is unknown or is determined by the application" 1572 1572 "\t1: User-defined - Filter coefficients are specified in the chroma sampling filter hint SEI message" … … 4196 4196 } 4197 4197 4198 if (m_chromaResamplingFilterSEIenabled) 4199 { 4200 xConfirmPara( (m_chromaFormatIDC == CHROMA_400 ), "chromaResamplingFilterSEI is not allowed to be present when ChromaFormatIDC is equal to zero (4:0:0)" ); 4201 xConfirmPara(m_vuiParametersPresentFlag && m_chromaLocInfoPresentFlag && (m_chromaSampleLocTypeTopField != m_chromaSampleLocTypeBottomField ), "When chromaResamplingFilterSEI is enabled, ChromaSampleLocTypeTopField has to be equal to ChromaSampleLocTypeBottomField" ); 4202 } 4203 4198 4204 #if P0123_ALPHA_CHANNEL_SEI 4199 4205 if( m_alphaSEIEnabled && !m_alphaCancelFlag ) -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1433 r1434 329 329 Int m_pictureTimingSEIEnabled; 330 330 Bool m_toneMappingInfoSEIEnabled; 331 Bool m_chroma SamplingFilterSEIenabled;332 Int m_chroma SamplingHorFilterIdc;333 Int m_chroma SamplingVerFilterIdc;331 Bool m_chromaResamplingFilterSEIenabled; 332 Int m_chromaResamplingHorFilterIdc; 333 Int m_chromaResamplingVerFilterIdc; 334 334 Int m_toneMapId; 335 335 Bool m_toneMapCancelFlag; -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1433 r1434 729 729 m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 730 730 m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 731 m_cTEncTop.setChroma SamplingFilterHintEnabled ( m_chromaSamplingFilterSEIenabled );732 m_cTEncTop.setChroma SamplingHorFilterIdc ( m_chromaSamplingHorFilterIdc );733 m_cTEncTop.setChroma SamplingVerFilterIdc ( m_chromaSamplingVerFilterIdc );731 m_cTEncTop.setChromaResamplingFilterHintEnabled ( m_chromaResamplingFilterSEIenabled ); 732 m_cTEncTop.setChromaResamplingHorFilterIdc ( m_chromaResamplingHorFilterIdc ); 733 m_cTEncTop.setChromaResamplingVerFilterIdc ( m_chromaResamplingVerFilterIdc ); 734 734 m_cTEncTop.setFramePackingArrangementSEIEnabled ( m_framePackingSEIEnabled ); 735 735 m_cTEncTop.setFramePackingArrangementSEIType ( m_framePackingSEIType ); -
branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp
r1286 r1434 148 148 case SEI::SEGM_RECT_FRAME_PACKING: return "Segmented rectangular frame packing arrangement"; 149 149 case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS: return "Temporal motion constrained tile sets"; 150 case SEI::CHROMA_ SAMPLING_FILTER_HINT:return "Chroma sampling filter hint";150 case SEI::CHROMA_RESAMPLING_FILTER_HINT: return "Chroma sampling filter hint"; 151 151 #if Q0074_COLOUR_REMAPPING_SEI 152 152 case SEI::COLOUR_REMAPPING_INFO: return "Colour Remapping Information"; -
branches/SHM-dev/source/Lib/TLibCommon/SEI.h
r1335 r1434 89 89 SEGM_RECT_FRAME_PACKING = 138, 90 90 TEMP_MOTION_CONSTRAINED_TILE_SETS = 139, 91 CHROMA_ SAMPLING_FILTER_HINT= 140,91 CHROMA_RESAMPLING_FILTER_HINT = 140, 92 92 KNEE_FUNCTION_INFO = 141, 93 93 #if Q0074_COLOUR_REMAPPING_SEI … … 465 465 }; 466 466 467 class SEIChromaSamplingFilterHint : public SEI 468 { 469 public: 470 PayloadType payloadType() const {return CHROMA_SAMPLING_FILTER_HINT;} 471 SEIChromaSamplingFilterHint() {} 472 virtual ~SEIChromaSamplingFilterHint() { 473 if(m_verChromaFilterIdc == 1) 474 { 475 for(Int i = 0; i < m_numVerticalFilters; i ++) 476 { 477 free(m_verFilterCoeff[i]); 478 } 479 free(m_verFilterCoeff); 480 free(m_verTapLengthMinus1); 481 } 482 if(m_horChromaFilterIdc == 1) 483 { 484 for(Int i = 0; i < m_numHorizontalFilters; i ++) 485 { 486 free(m_horFilterCoeff[i]); 487 } 488 free(m_horFilterCoeff); 489 free(m_horTapLengthMinus1); 490 } 491 } 492 493 Int m_verChromaFilterIdc; 494 Int m_horChromaFilterIdc; 495 Bool m_verFilteringProcessFlag; 496 Int m_targetFormatIdc; 497 Bool m_perfectReconstructionFlag; 498 Int m_numVerticalFilters; 499 Int* m_verTapLengthMinus1; 500 Int** m_verFilterCoeff; 501 Int m_numHorizontalFilters; 502 Int* m_horTapLengthMinus1; 503 Int** m_horFilterCoeff; 467 class SEIChromaResamplingFilterHint : public SEI 468 { 469 public: 470 PayloadType payloadType() const {return CHROMA_RESAMPLING_FILTER_HINT;} 471 SEIChromaResamplingFilterHint() {} 472 virtual ~SEIChromaResamplingFilterHint() {} 473 474 Int m_verChromaFilterIdc; 475 Int m_horChromaFilterIdc; 476 Bool m_verFilteringFieldProcessingFlag; 477 Int m_targetFormatIdc; 478 Bool m_perfectReconstructionFlag; 479 std::vector<std::vector<Int> > m_verFilterCoeff; 480 std::vector<std::vector<Int> > m_horFilterCoeff; 504 481 }; 505 482 -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
r1379 r1434 299 299 xParseSEITimeCode((SEITimeCode&) *sei, payloadSize, pDecodedMessageOutputStream); 300 300 break; 301 case SEI::CHROMA_ SAMPLING_FILTER_HINT:302 sei = new SEIChroma SamplingFilterHint;303 xParseSEIChroma SamplingFilterHint((SEIChromaSamplingFilterHint&) *sei, payloadSize/*, sps*/, pDecodedMessageOutputStream);301 case SEI::CHROMA_RESAMPLING_FILTER_HINT: 302 sei = new SEIChromaResamplingFilterHint; 303 xParseSEIChromaResamplingFilterHint((SEIChromaResamplingFilterHint&) *sei, payloadSize, pDecodedMessageOutputStream); 304 304 //} 305 305 break; … … 1260 1260 } 1261 1261 1262 Void SEIReader::xParseSEIChroma SamplingFilterHint(SEIChromaSamplingFilterHint& sei, UInt payloadSize/*, TComSPS* sps*/, std::ostream *pDecodedMessageOutputStream)1262 Void SEIReader::xParseSEIChromaResamplingFilterHint(SEIChromaResamplingFilterHint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1263 1263 { 1264 1264 UInt uiCode; … … 1267 1267 sei_read_code( pDecodedMessageOutputStream, 8, uiCode, "ver_chroma_filter_idc"); sei.m_verChromaFilterIdc = uiCode; 1268 1268 sei_read_code( pDecodedMessageOutputStream, 8, uiCode, "hor_chroma_filter_idc"); sei.m_horChromaFilterIdc = uiCode; 1269 sei_read_flag( pDecodedMessageOutputStream, uiCode, "ver_filtering_ process_flag"); sei.m_verFilteringProcessFlag = uiCode;1269 sei_read_flag( pDecodedMessageOutputStream, uiCode, "ver_filtering_field_processing_flag"); sei.m_verFilteringFieldProcessingFlag = uiCode; 1270 1270 if(sei.m_verChromaFilterIdc == 1 || sei.m_horChromaFilterIdc == 1) 1271 1271 { … … 1273 1273 if(sei.m_verChromaFilterIdc == 1) 1274 1274 { 1275 sei_read_uvlc( pDecodedMessageOutputStream, uiCode, "num_vertical_filters"); sei.m_numVerticalFilters = uiCode; 1276 if(sei.m_numVerticalFilters > 0) 1277 { 1278 sei.m_verTapLengthMinus1 = (Int*)malloc(sei.m_numVerticalFilters * sizeof(Int)); 1279 sei.m_verFilterCoeff = (Int**)malloc(sei.m_numVerticalFilters * sizeof(Int*)); 1280 for(Int i = 0; i < sei.m_numVerticalFilters; i ++) 1281 { 1282 sei_read_uvlc( pDecodedMessageOutputStream, uiCode, "ver_tap_length_minus_1"); sei.m_verTapLengthMinus1[i] = uiCode; 1283 sei.m_verFilterCoeff[i] = (Int*)malloc(sei.m_verTapLengthMinus1[i] * sizeof(Int)); 1284 for(Int j = 0; j < sei.m_verTapLengthMinus1[i]; j ++) 1275 UInt numVerticalFilters; 1276 sei_read_uvlc( pDecodedMessageOutputStream, numVerticalFilters, "num_vertical_filters"); sei.m_verFilterCoeff.resize(numVerticalFilters); 1277 if(numVerticalFilters > 0) 1278 { 1279 for(Int i = 0; i < numVerticalFilters; i++) 1280 { 1281 UInt verTapLengthMinus1; 1282 sei_read_uvlc( pDecodedMessageOutputStream, verTapLengthMinus1, "ver_tap_length_minus_1"); sei.m_verFilterCoeff[i].resize(verTapLengthMinus1+1); 1283 for(Int j = 0; j < (verTapLengthMinus1 + 1); j++) 1285 1284 { 1286 1285 sei_read_svlc( pDecodedMessageOutputStream, sei.m_verFilterCoeff[i][j], "ver_filter_coeff"); … … 1291 1290 if(sei.m_horChromaFilterIdc == 1) 1292 1291 { 1293 sei_read_uvlc( pDecodedMessageOutputStream, uiCode, "num_horizontal_filters"); sei.m_numHorizontalFilters = uiCode; 1294 if(sei.m_numHorizontalFilters > 0) 1295 { 1296 sei.m_horTapLengthMinus1 = (Int*)malloc(sei.m_numHorizontalFilters * sizeof(Int)); 1297 sei.m_horFilterCoeff = (Int**)malloc(sei.m_numHorizontalFilters * sizeof(Int*)); 1298 for(Int i = 0; i < sei.m_numHorizontalFilters; i ++) 1299 { 1300 sei_read_uvlc( pDecodedMessageOutputStream, uiCode, "hor_tap_length_minus_1"); sei.m_horTapLengthMinus1[i] = uiCode; 1301 sei.m_horFilterCoeff[i] = (Int*)malloc(sei.m_horTapLengthMinus1[i] * sizeof(Int)); 1302 for(Int j = 0; j < sei.m_horTapLengthMinus1[i]; j ++) 1292 UInt numHorizontalFilters; 1293 sei_read_uvlc( pDecodedMessageOutputStream, numHorizontalFilters, "num_horizontal_filters"); sei.m_horFilterCoeff.resize(numHorizontalFilters); 1294 if(numHorizontalFilters > 0) 1295 { 1296 for(Int i = 0; i < numHorizontalFilters; i++) 1297 { 1298 UInt horTapLengthMinus1; 1299 sei_read_uvlc( pDecodedMessageOutputStream, horTapLengthMinus1, "hor_tap_length_minus_1"); sei.m_horFilterCoeff[i].resize(horTapLengthMinus1+1); 1300 for(Int j = 0; j < (horTapLengthMinus1 + 1); j++) 1303 1301 { 1304 1302 sei_read_svlc( pDecodedMessageOutputStream, sei.m_horFilterCoeff[i][j], "hor_filter_coeff"); -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h
r1259 r1434 61 61 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 62 62 #endif 63 63 64 protected: 64 65 #if O0164_MULTI_LAYER_HRD … … 77 78 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 78 79 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 80 #if SVC_EXTENSION 81 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 82 #else 83 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 84 #endif 79 85 Void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 80 86 #if SVC_EXTENSION 81 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream);82 87 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 83 88 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 84 89 #else 85 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);86 90 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 87 91 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); … … 101 105 Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 102 106 Void xParseSEITimeCode (SEITimeCode& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 103 Void xParseSEIChroma SamplingFilterHint (SEIChromaSamplingFilterHint& sei, UInt payloadSize/*,TComSPS* */,std::ostream *pDecodedMessageOutputStream);107 Void xParseSEIChromaResamplingFilterHint (SEIChromaResamplingFilterHint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 104 108 Void xParseSEIKneeFunctionInfo (SEIKneeFunctionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 105 109 Void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); -
branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.cpp
r1307 r1434 416 416 } 417 417 418 Void SEIEncoder::initSEIChromaSamplingFilterHint(SEIChromaSamplingFilterHint *seiChromaSamplingFilterHint, Int iHorFilterIndex, Int iVerFilterIndex) 419 { 420 assert (m_isInitialized); 421 assert (seiChromaSamplingFilterHint!=NULL); 422 423 seiChromaSamplingFilterHint->m_verChromaFilterIdc = iVerFilterIndex; 424 seiChromaSamplingFilterHint->m_horChromaFilterIdc = iHorFilterIndex; 425 seiChromaSamplingFilterHint->m_verFilteringProcessFlag = 1; 426 seiChromaSamplingFilterHint->m_targetFormatIdc = 3; 427 seiChromaSamplingFilterHint->m_perfectReconstructionFlag = false; 428 if(seiChromaSamplingFilterHint->m_verChromaFilterIdc == 1) 429 { 430 seiChromaSamplingFilterHint->m_numVerticalFilters = 1; 431 seiChromaSamplingFilterHint->m_verTapLengthMinus1 = (Int*)malloc(seiChromaSamplingFilterHint->m_numVerticalFilters * sizeof(Int)); 432 seiChromaSamplingFilterHint->m_verFilterCoeff = (Int**)malloc(seiChromaSamplingFilterHint->m_numVerticalFilters * sizeof(Int*)); 433 for(Int i = 0; i < seiChromaSamplingFilterHint->m_numVerticalFilters; i ++) 434 { 435 seiChromaSamplingFilterHint->m_verTapLengthMinus1[i] = 0; 436 seiChromaSamplingFilterHint->m_verFilterCoeff[i] = (Int*)malloc(seiChromaSamplingFilterHint->m_verTapLengthMinus1[i] * sizeof(Int)); 437 for(Int j = 0; j < seiChromaSamplingFilterHint->m_verTapLengthMinus1[i]; j ++) 438 { 439 seiChromaSamplingFilterHint->m_verFilterCoeff[i][j] = 0; 440 } 441 } 418 Void SEIEncoder::initSEIChromaResamplingFilterHint(SEIChromaResamplingFilterHint *seiChromaResamplingFilterHint, Int iHorFilterIndex, Int iVerFilterIndex) 419 { 420 assert (m_isInitialized); 421 assert (seiChromaResamplingFilterHint!=NULL); 422 423 seiChromaResamplingFilterHint->m_verChromaFilterIdc = iVerFilterIndex; 424 seiChromaResamplingFilterHint->m_horChromaFilterIdc = iHorFilterIndex; 425 seiChromaResamplingFilterHint->m_verFilteringFieldProcessingFlag = 1; 426 seiChromaResamplingFilterHint->m_targetFormatIdc = 3; 427 seiChromaResamplingFilterHint->m_perfectReconstructionFlag = false; 428 429 // this creates some example filter values, if explicit filter definition is selected 430 if (seiChromaResamplingFilterHint->m_verChromaFilterIdc == 1) 431 { 432 const Int numVerticalFilters = 3; 433 const Int verTapLengthMinus1[] = {5,3,3}; 434 435 seiChromaResamplingFilterHint->m_verFilterCoeff.resize(numVerticalFilters); 436 for(Int i = 0; i < numVerticalFilters; i ++) 437 { 438 seiChromaResamplingFilterHint->m_verFilterCoeff[i].resize(verTapLengthMinus1[i]+1); 439 } 440 // Note: C++11 -> seiChromaResamplingFilterHint->m_verFilterCoeff[0] = {-3,13,31,23,3,-3}; 441 seiChromaResamplingFilterHint->m_verFilterCoeff[0][0] = -3; 442 seiChromaResamplingFilterHint->m_verFilterCoeff[0][1] = 13; 443 seiChromaResamplingFilterHint->m_verFilterCoeff[0][2] = 31; 444 seiChromaResamplingFilterHint->m_verFilterCoeff[0][3] = 23; 445 seiChromaResamplingFilterHint->m_verFilterCoeff[0][4] = 3; 446 seiChromaResamplingFilterHint->m_verFilterCoeff[0][5] = -3; 447 448 seiChromaResamplingFilterHint->m_verFilterCoeff[1][0] = -1; 449 seiChromaResamplingFilterHint->m_verFilterCoeff[1][1] = 25; 450 seiChromaResamplingFilterHint->m_verFilterCoeff[1][2] = 247; 451 seiChromaResamplingFilterHint->m_verFilterCoeff[1][3] = -15; 452 453 seiChromaResamplingFilterHint->m_verFilterCoeff[2][0] = -20; 454 seiChromaResamplingFilterHint->m_verFilterCoeff[2][1] = 186; 455 seiChromaResamplingFilterHint->m_verFilterCoeff[2][2] = 100; 456 seiChromaResamplingFilterHint->m_verFilterCoeff[2][3] = -10; 442 457 } 443 458 else 444 459 { 445 seiChromaSamplingFilterHint->m_numVerticalFilters = 0; 446 seiChromaSamplingFilterHint->m_verTapLengthMinus1 = NULL; 447 seiChromaSamplingFilterHint->m_verFilterCoeff = NULL; 448 } 449 if(seiChromaSamplingFilterHint->m_horChromaFilterIdc == 1) 450 { 451 seiChromaSamplingFilterHint->m_numHorizontalFilters = 1; 452 seiChromaSamplingFilterHint->m_horTapLengthMinus1 = (Int*)malloc(seiChromaSamplingFilterHint->m_numHorizontalFilters * sizeof(Int)); 453 seiChromaSamplingFilterHint->m_horFilterCoeff = (Int**)malloc(seiChromaSamplingFilterHint->m_numHorizontalFilters * sizeof(Int*)); 454 for(Int i = 0; i < seiChromaSamplingFilterHint->m_numHorizontalFilters; i ++) 455 { 456 seiChromaSamplingFilterHint->m_horTapLengthMinus1[i] = 0; 457 seiChromaSamplingFilterHint->m_horFilterCoeff[i] = (Int*)malloc(seiChromaSamplingFilterHint->m_horTapLengthMinus1[i] * sizeof(Int)); 458 for(Int j = 0; j < seiChromaSamplingFilterHint->m_horTapLengthMinus1[i]; j ++) 459 { 460 seiChromaSamplingFilterHint->m_horFilterCoeff[i][j] = 0; 461 } 462 } 460 seiChromaResamplingFilterHint->m_verFilterCoeff.resize(0); 461 } 462 463 if (seiChromaResamplingFilterHint->m_horChromaFilterIdc == 1) 464 { 465 Int const numHorizontalFilters = 1; 466 const Int horTapLengthMinus1[] = {3}; 467 468 seiChromaResamplingFilterHint->m_horFilterCoeff.resize(numHorizontalFilters); 469 for(Int i = 0; i < numHorizontalFilters; i ++) 470 { 471 seiChromaResamplingFilterHint->m_horFilterCoeff[i].resize(horTapLengthMinus1[i]+1); 472 } 473 seiChromaResamplingFilterHint->m_horFilterCoeff[0][0] = 1; 474 seiChromaResamplingFilterHint->m_horFilterCoeff[0][1] = 6; 475 seiChromaResamplingFilterHint->m_horFilterCoeff[0][2] = 1; 463 476 } 464 477 else 465 478 { 466 seiChromaSamplingFilterHint->m_numHorizontalFilters = 0; 467 seiChromaSamplingFilterHint->m_horTapLengthMinus1 = NULL; 468 seiChromaSamplingFilterHint->m_horFilterCoeff = NULL; 479 seiChromaResamplingFilterHint->m_horFilterCoeff.resize(0); 469 480 } 470 481 } -
branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.h
r1307 r1434 79 79 Void initSEITempMotionConstrainedTileSets (SEITempMotionConstrainedTileSets *sei, const TComPPS *pps); 80 80 Void initSEIKneeFunctionInfo(SEIKneeFunctionInfo *sei); 81 Void initSEIChroma SamplingFilterHint(SEIChromaSamplingFilterHint *sei, Int iHorFilterIndex, Int iVerFilterIndex);81 Void initSEIChromaResamplingFilterHint(SEIChromaResamplingFilterHint *sei, Int iHorFilterIndex, Int iVerFilterIndex); 82 82 Void initSEITimeCode(SEITimeCode *sei); 83 83 -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
r1379 r1434 140 140 #endif 141 141 break; 142 case SEI::CHROMA_ SAMPLING_FILTER_HINT:143 xWriteSEIChroma SamplingFilterHint(*static_cast<const SEIChromaSamplingFilterHint*>(&sei)/*, sps*/);142 case SEI::CHROMA_RESAMPLING_FILTER_HINT: 143 xWriteSEIChromaResamplingFilterHint(*static_cast<const SEIChromaResamplingFilterHint*>(&sei)); 144 144 break; 145 145 case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS: … … 206 206 #endif //SVC_EXTENSION 207 207 default: 208 assert(!" Unhandled SEI message");208 assert(!"Trying to write unhandled SEI message"); 209 209 break; 210 210 } … … 922 922 } 923 923 924 Void SEIWriter::xWriteSEIChroma SamplingFilterHint(const SEIChromaSamplingFilterHint &sei/*, TComSPS* sps*/)924 Void SEIWriter::xWriteSEIChromaResamplingFilterHint(const SEIChromaResamplingFilterHint &sei) 925 925 { 926 926 WRITE_CODE(sei.m_verChromaFilterIdc, 8, "ver_chroma_filter_idc"); 927 927 WRITE_CODE(sei.m_horChromaFilterIdc, 8, "hor_chroma_filter_idc"); 928 WRITE_FLAG(sei.m_verFiltering ProcessFlag, "ver_filtering_process_flag");928 WRITE_FLAG(sei.m_verFilteringFieldProcessingFlag, "ver_filtering_field_processing_flag"); 929 929 if(sei.m_verChromaFilterIdc == 1 || sei.m_horChromaFilterIdc == 1) 930 930 { 931 writeUserDefinedCoefficients(sei); 932 } 933 } 934 935 // write hardcoded chroma filter coefficients in the SEI messages 936 Void SEIWriter::writeUserDefinedCoefficients(const SEIChromaSamplingFilterHint &sei) 937 { 938 Int const iNumVerticalFilters = 3; 939 Int verticalTapLength_minus1[iNumVerticalFilters] = {5,3,3}; 940 Int* userVerticalCoefficients[iNumVerticalFilters]; 941 for(Int i = 0; i < iNumVerticalFilters; i ++) 942 { 943 userVerticalCoefficients[i] = (Int*)malloc( (verticalTapLength_minus1[i]+1) * sizeof(Int)); 944 } 945 userVerticalCoefficients[0][0] = -3; 946 userVerticalCoefficients[0][1] = 13; 947 userVerticalCoefficients[0][2] = 31; 948 userVerticalCoefficients[0][3] = 23; 949 userVerticalCoefficients[0][4] = 3; 950 userVerticalCoefficients[0][5] = -3; 951 952 userVerticalCoefficients[1][0] = -1; 953 userVerticalCoefficients[1][1] = 25; 954 userVerticalCoefficients[1][2] = 247; 955 userVerticalCoefficients[1][3] = -15; 956 957 userVerticalCoefficients[2][0] = -20; 958 userVerticalCoefficients[2][1] = 186; 959 userVerticalCoefficients[2][2] = 100; 960 userVerticalCoefficients[2][3] = -10; 961 962 Int const iNumHorizontalFilters = 1; 963 Int horizontalTapLength_minus1[iNumHorizontalFilters] = {3}; 964 Int* userHorizontalCoefficients[iNumHorizontalFilters]; 965 for(Int i = 0; i < iNumHorizontalFilters; i ++) 966 { 967 userHorizontalCoefficients[i] = (Int*)malloc( (horizontalTapLength_minus1[i]+1) * sizeof(Int)); 968 } 969 userHorizontalCoefficients[0][0] = 1; 970 userHorizontalCoefficients[0][1] = 6; 971 userHorizontalCoefficients[0][2] = 1; 972 973 WRITE_UVLC(3, "target_format_idc"); 974 if(sei.m_verChromaFilterIdc == 1) 975 { 976 WRITE_UVLC(iNumVerticalFilters, "num_vertical_filters"); 977 if(iNumVerticalFilters > 0) 978 { 979 for(Int i = 0; i < iNumVerticalFilters; i ++) 980 { 981 WRITE_UVLC(verticalTapLength_minus1[i], "ver_tap_length_minus_1"); 982 for(Int j = 0; j < verticalTapLength_minus1[i]; j ++) 983 { 984 WRITE_SVLC(userVerticalCoefficients[i][j], "ver_filter_coeff"); 985 } 986 } 987 } 988 } 989 if(sei.m_horChromaFilterIdc == 1) 990 { 991 WRITE_UVLC(iNumHorizontalFilters, "num_horizontal_filters"); 992 if(iNumHorizontalFilters > 0) 993 { 994 for(Int i = 0; i < iNumHorizontalFilters; i ++) 995 { 996 WRITE_UVLC(horizontalTapLength_minus1[i], "hor_tap_length_minus_1"); 997 for(Int j = 0; j < horizontalTapLength_minus1[i]; j ++) 998 { 999 WRITE_SVLC(userHorizontalCoefficients[i][j], "hor_filter_coeff"); 931 WRITE_UVLC(sei.m_targetFormatIdc, "target_format_idc"); 932 if(sei.m_verChromaFilterIdc == 1) 933 { 934 const Int numVerticalFilter = (Int)sei.m_verFilterCoeff.size(); 935 WRITE_UVLC(numVerticalFilter, "num_vertical_filters"); 936 if(numVerticalFilter > 0) 937 { 938 for(Int i = 0; i < numVerticalFilter; i ++) 939 { 940 const Int verTapLengthMinus1 = (Int) sei.m_verFilterCoeff[i].size() - 1; 941 WRITE_UVLC(verTapLengthMinus1, "ver_tap_length_minus_1"); 942 for(Int j = 0; j < (verTapLengthMinus1 + 1); j ++) 943 { 944 WRITE_SVLC(sei.m_verFilterCoeff[i][j], "ver_filter_coeff"); 945 } 946 } 947 } 948 } 949 if(sei.m_horChromaFilterIdc == 1) 950 { 951 const Int numHorizontalFilter = (Int) sei.m_horFilterCoeff.size(); 952 WRITE_UVLC(numHorizontalFilter, "num_horizontal_filters"); 953 if(numHorizontalFilter > 0) 954 { 955 for(Int i = 0; i < numHorizontalFilter; i ++) 956 { 957 const Int horTapLengthMinus1 = (Int) sei.m_horFilterCoeff[i].size() - 1; 958 WRITE_UVLC(horTapLengthMinus1, "hor_tap_length_minus_1"); 959 for(Int j = 0; j < (horTapLengthMinus1 + 1); j ++) 960 { 961 WRITE_SVLC(sei.m_horFilterCoeff[i][j], "hor_filter_coeff"); 962 } 1000 963 } 1001 964 } -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h
r1352 r1434 57 57 58 58 protected: 59 #if O0164_MULTI_LAYER_HRD60 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei);61 #else62 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSPS *sps);63 #endif64 59 Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei); 65 60 Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei); … … 75 70 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps); 76 71 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps); 77 #endif 78 TComSPS *m_pSPS; 72 #endif 79 73 Void xWriteSEIRecoveryPoint(const SEIRecoveryPoint& sei); 80 74 Void xWriteSEIFramePacking(const SEIFramePacking& sei); … … 93 87 Void xWriteSEITempMotionConstrainedTileSets(const SEITempMotionConstrainedTileSets& sei); 94 88 Void xWriteSEITimeCode(const SEITimeCode& sei); 95 Void xWriteSEIChromaSamplingFilterHint(const SEIChromaSamplingFilterHint& sei/*, TComSPS *sps*/); 96 Void writeUserDefinedCoefficients(const SEIChromaSamplingFilterHint& sei); 89 Void xWriteSEIChromaResamplingFilterHint(const SEIChromaResamplingFilterHint& sei); 97 90 Void xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei); 98 91 Void xWriteSEIMasteringDisplayColourVolume( const SEIMasteringDisplayColourVolume& sei); 92 93 #if O0164_MULTI_LAYER_HRD 94 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei); 95 #else 96 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSPS *sps); 97 #endif 99 98 Void xWriteByteAlign(); 100 99 #if Q0074_COLOUR_REMAPPING_SEI -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1417 r1434 65 65 } 66 66 67 Void xTraceAccessUnitDelimiter () 68 { 69 fprintf( g_hTrace, "=========== Access Unit Delimiter ===========\n"); 70 } 71 67 72 #endif 68 73 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1433 r1434 357 357 Bool m_vuiParametersPresentFlag; ///< enable generation of VUI parameters 358 358 Bool m_aspectRatioInfoPresentFlag; ///< Signals whether aspect_ratio_idc is present 359 Bool m_chroma SamplingFilterHintEnabled;///< Signals whether chroma sampling filter hint data is present360 Int m_chroma SamplingHorFilterIdc;///< Specifies the Index of filter to use361 Int m_chroma SamplingVerFilterIdc;///< Specifies the Index of filter to use359 Bool m_chromaResamplingFilterHintEnabled; ///< Signals whether chroma sampling filter hint data is present 360 Int m_chromaResamplingHorFilterIdc; ///< Specifies the Index of filter to use 361 Int m_chromaResamplingVerFilterIdc; ///< Specifies the Index of filter to use 362 362 Int m_aspectRatioIdc; ///< aspect_ratio_idc 363 363 Int m_sarWidth; ///< horizontal size of the sample aspect ratio … … 1059 1059 Bool getLowerBitRateConstraintFlag() const { return m_lowerBitRateConstraintFlag; } 1060 1060 Void setLowerBitRateConstraintFlag(Bool b) { m_lowerBitRateConstraintFlag=b; } 1061 Bool getChromaSamplingFilterHintEnabled() { return m_chromaSamplingFilterHintEnabled;} 1062 Void setChromaSamplingFilterHintEnabled(Bool i) { m_chromaSamplingFilterHintEnabled = i;} 1063 Int getChromaSamplingHorFilterIdc() { return m_chromaSamplingHorFilterIdc;} 1064 Void setChromaSamplingHorFilterIdc(Int i) { m_chromaSamplingHorFilterIdc = i;} 1065 Int getChromaSamplingVerFilterIdc() { return m_chromaSamplingVerFilterIdc;} 1066 Void setChromaSamplingVerFilterIdc(Int i) { m_chromaSamplingVerFilterIdc = i;} 1061 1062 Bool getChromaResamplingFilterHintEnabled() { return m_chromaResamplingFilterHintEnabled;} 1063 Void setChromaResamplingFilterHintEnabled(Bool i) { m_chromaResamplingFilterHintEnabled = i;} 1064 Int getChromaResamplingHorFilterIdc() { return m_chromaResamplingHorFilterIdc;} 1065 Void setChromaResamplingHorFilterIdc(Int i) { m_chromaResamplingHorFilterIdc = i;} 1066 Int getChromaResamplingVerFilterIdc() { return m_chromaResamplingVerFilterIdc;} 1067 Void setChromaResamplingVerFilterIdc(Int i) { m_chromaResamplingVerFilterIdc = i;} 1067 1068 1068 1069 Void setSummaryOutFilename(const std::string &s) { m_summaryOutFilename = s; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1433 r1434 635 635 seiMessages.push_back(sei); 636 636 } 637 if(m_pcCfg->getChromaResamplingFilterHintEnabled()) 638 { 639 SEIChromaResamplingFilterHint *seiChromaResamplingFilterHint = new SEIChromaResamplingFilterHint; 640 m_seiEncoder.initSEIChromaResamplingFilterHint(seiChromaResamplingFilterHint, m_pcCfg->getChromaResamplingHorFilterIdc(), m_pcCfg->getChromaResamplingVerFilterIdc()); 641 seiMessages.push_back(seiChromaResamplingFilterHint); 642 } 637 643 638 644 #if SVC_EXTENSION … … 890 896 m_seiEncoder.initSEIRecoveryPoint(recoveryPointSEI, slice); 891 897 seiMessages.push_back(recoveryPointSEI); 892 893 if(m_pcCfg->getDecodingRefreshType() == 3)894 {895 m_iLastRecoveryPicPOC = slice->getPOC();896 }897 898 } 898 899 if (m_pcCfg->getTemporalLevel0IndexSEIEnabled()) … … 901 902 m_seiEncoder.initTemporalLevel0IndexSEI(temporalLevel0IndexSEI, slice); 902 903 seiMessages.push_back(temporalLevel0IndexSEI); 903 }904 905 if(slice->getSPS()->getVuiParametersPresentFlag() && m_pcCfg->getChromaSamplingFilterHintEnabled() && ( slice->getSliceType() == I_SLICE ))906 {907 SEIChromaSamplingFilterHint *seiChromaSamplingFilterHint = new SEIChromaSamplingFilterHint;908 m_seiEncoder.initSEIChromaSamplingFilterHint(seiChromaSamplingFilterHint, m_pcCfg->getChromaSamplingHorFilterIdc(), m_pcCfg->getChromaSamplingVerFilterIdc());909 seiMessages.push_back(seiChromaSamplingFilterHint);910 904 } 911 905 … … 1714 1708 pcSlice->setMFMEnabledFlag(false); 1715 1709 } 1716 #endif //SVC_EXTENSION 1710 #endif //SVC_EXTENSION 1711 1717 1712 pcSlice->setLastIDR(m_iLastIDR); 1718 1713 pcSlice->setSliceIdx(0); … … 1916 1911 } 1917 1912 } 1913 1918 1914 if (m_pcCfg->getEfficientFieldIRAPEnabled()) 1919 1915 {
Note: See TracChangeset for help on using the changeset viewer.