Changeset 442 in SHVCSoftware
- Timestamp:
- 21 Oct 2013, 13:41:29 (11 years ago)
- Location:
- trunk
- Files:
-
- 110 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev merged: 350-351,357-360 /branches/SHM-3.1-dev (added) merged: 354-356,361-403,405-441 /trunk merged: 352 reverse-merged: 312-314
- Property svn:mergeinfo changed
-
trunk/cfg
- Property svn:mergeinfo changed
/branches/SHM-3.1-dev/cfg (added) merged: 362,365,389,397-398,406
- Property svn:mergeinfo changed
-
trunk/cfg/encoder_lowdelay_P_main.cfg
r310 r442 22 22 DecodingRefreshType : 0 # Random Accesss 0:none, 1:CDR, 2:IDR 23 23 GOPSize : 4 # GOP Size (number of B slice = GOPSize-1) 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs 25 Frame1: P 1 3 0.4624 0 0 0 4 4 -1 -5 -9 -13 0 26 Frame2: P 2 2 0.4624 0 0 0 4 4 -1 -2 -6 -10 1 -1 5 1 1 1 0 1 27 Frame3: P 3 3 0.4624 0 0 0 4 4 -1 -3 -7 -11 1 -1 5 0 1 1 1 1 28 Frame4: P 4 1 0.578 0 0 0 4 4 -1 -4 -8 -12 1 -1 5 0 1 1 1 1 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs #UseExtUsedByCurr ExtUsedByCurr(for each ref pic) 25 Frame1: P 1 3 0.4624 0 0 0 4 4 -1 -5 -9 -13 0 0 26 Frame2: P 2 2 0.4624 0 0 0 4 4 -1 -2 -6 -10 1 -1 5 1 1 1 0 1 0 27 Frame3: P 3 3 0.4624 0 0 0 4 4 -1 -3 -7 -11 1 -1 5 0 1 1 1 1 0 28 Frame4: P 4 1 0.578 0 0 0 4 4 -1 -4 -8 -12 1 -1 5 0 1 1 1 1 0 29 29 30 30 #=========== Motion Search ============= -
trunk/cfg/encoder_lowdelay_P_main10.cfg
r310 r442 22 22 DecodingRefreshType : 0 # Random Accesss 0:none, 1:CDR, 2:IDR 23 23 GOPSize : 4 # GOP Size (number of B slice = GOPSize-1) 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs 25 Frame1: P 1 3 0.4624 0 0 0 4 4 -1 -5 -9 -13 0 26 Frame2: P 2 2 0.4624 0 0 0 4 4 -1 -2 -6 -10 1 -1 5 1 1 1 0 1 27 Frame3: P 3 3 0.4624 0 0 0 4 4 -1 -3 -7 -11 1 -1 5 0 1 1 1 1 28 Frame4: P 4 1 0.578 0 0 0 4 4 -1 -4 -8 -12 1 -1 5 0 1 1 1 1 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs #UseExtUsedByCurr ExtUsedByCurr(for each ref pic) 25 Frame1: P 1 3 0.4624 0 0 0 4 4 -1 -5 -9 -13 0 0 26 Frame2: P 2 2 0.4624 0 0 0 4 4 -1 -2 -6 -10 1 -1 5 1 1 1 0 1 0 27 Frame3: P 3 3 0.4624 0 0 0 4 4 -1 -3 -7 -11 1 -1 5 0 1 1 1 1 0 28 Frame4: P 4 1 0.578 0 0 0 4 4 -1 -4 -8 -12 1 -1 5 0 1 1 1 1 0 29 29 30 30 #=========== Motion Search ============= -
trunk/cfg/encoder_lowdelay_main.cfg
r310 r442 22 22 DecodingRefreshType : 0 # Random Accesss 0:none, 1:CDR, 2:IDR 23 23 GOPSize : 4 # GOP Size (number of B slice = GOPSize-1) 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs 25 Frame1: B 1 3 0.4624 0 0 0 4 4 -1 -5 -9 -13 0 26 Frame2: B 2 2 0.4624 0 0 0 4 4 -1 -2 -6 -10 1 -1 5 1 1 1 0 1 27 Frame3: B 3 3 0.4624 0 0 0 4 4 -1 -3 -7 -11 1 -1 5 0 1 1 1 1 28 Frame4: B 4 1 0.578 0 0 0 4 4 -1 -4 -8 -12 1 -1 5 0 1 1 1 1 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs #UseExtUsedByCurr ExtUsedByCurr(for each ref pic) 25 Frame1: B 1 3 0.4624 0 0 0 4 4 -1 -5 -9 -13 0 0 26 Frame2: B 2 2 0.4624 0 0 0 4 4 -1 -2 -6 -10 1 -1 5 1 1 1 0 1 0 27 Frame3: B 3 3 0.4624 0 0 0 4 4 -1 -3 -7 -11 1 -1 5 0 1 1 1 1 0 28 Frame4: B 4 1 0.578 0 0 0 4 4 -1 -4 -8 -12 1 -1 5 0 1 1 1 1 0 29 29 30 30 #=========== Motion Search ============= -
trunk/cfg/encoder_lowdelay_main10.cfg
r310 r442 22 22 DecodingRefreshType : 0 # Random Accesss 0:none, 1:CDR, 2:IDR 23 23 GOPSize : 4 # GOP Size (number of B slice = GOPSize-1) 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs 25 Frame1: B 1 3 0.4624 0 0 0 4 4 -1 -5 -9 -13 0 26 Frame2: B 2 2 0.4624 0 0 0 4 4 -1 -2 -6 -10 1 -1 5 1 1 1 0 1 27 Frame3: B 3 3 0.4624 0 0 0 4 4 -1 -3 -7 -11 1 -1 5 0 1 1 1 1 28 Frame4: B 4 1 0.578 0 0 0 4 4 -1 -4 -8 -12 1 -1 5 0 1 1 1 1 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs #UseExtUsedByCurr ExtUsedByCurr(for each ref pic) 25 Frame1: B 1 3 0.4624 0 0 0 4 4 -1 -5 -9 -13 0 0 26 Frame2: B 2 2 0.4624 0 0 0 4 4 -1 -2 -6 -10 1 -1 5 1 1 1 0 1 0 27 Frame3: B 3 3 0.4624 0 0 0 4 4 -1 -3 -7 -11 1 -1 5 0 1 1 1 1 0 28 Frame4: B 4 1 0.578 0 0 0 4 4 -1 -4 -8 -12 1 -1 5 0 1 1 1 1 0 29 29 30 30 #=========== Motion Search ============= -
trunk/cfg/encoder_randomaccess_main.cfg
r345 r442 22 22 DecodingRefreshType : 1 # Random Accesss 0:none, 1:CDR, 2:IDR 23 23 GOPSize : 8 # GOP Size (number of B slice = GOPSize-1) 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs 25 Frame1: B 8 1 0.442 0 0 0 4 4 -8 -10 -12 -16 0 26 Frame2: B 4 2 0.3536 0 0 0 2 3 -4 -6 4 1 4 5 1 1 0 0 1 27 Frame3: B 2 3 0.3536 0 0 0 2 4 -2 -4 2 6 1 2 4 1 1 1 1 28 Frame4: B 1 4 0.68 0 0 0 2 4 -1 1 3 7 1 1 5 1 0 1 1 1 29 Frame5: B 3 4 0.68 0 0 0 2 4 -1 -3 1 5 1 -2 5 1 1 1 1 0 30 Frame6: B 6 3 0.3536 0 0 0 2 4 -2 -4 -6 2 1 -3 5 1 1 1 1 0 31 Frame7: B 5 4 0.68 0 0 0 2 4 -1 -5 1 3 1 1 5 1 0 1 1 1 32 Frame8: B 7 4 0.68 0 0 0 2 4 -1 -3 -7 1 1 -2 5 1 1 1 1 0 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs #UseExtUsedByCurr ExtUsedByCurr(for each ref pic) 25 Frame1: B 8 1 0.442 0 0 0 4 4 -8 -10 -12 -16 0 0 26 Frame2: B 4 2 0.3536 0 0 0 2 3 -4 -6 4 1 4 5 1 1 0 0 1 0 27 Frame3: B 2 3 0.3536 0 0 0 2 4 -2 -4 2 6 1 2 4 1 1 1 1 0 28 Frame4: B 1 4 0.68 0 0 0 2 4 -1 1 3 7 1 1 5 1 0 1 1 1 0 29 Frame5: B 3 4 0.68 0 0 0 2 4 -1 -3 1 5 1 -2 5 1 1 1 1 0 0 30 Frame6: B 6 3 0.3536 0 0 0 2 4 -2 -4 -6 2 1 -3 5 1 1 1 1 0 0 31 Frame7: B 5 4 0.68 0 0 0 2 4 -1 -5 1 3 1 1 5 1 0 1 1 1 0 32 Frame8: B 7 4 0.68 0 0 0 2 4 -1 -3 -7 1 1 -2 5 1 1 1 1 0 0 33 33 34 FrameEL1: B 8 1 0.442 0 0 0 4 4 -8 -10 -12 -16 0 35 FrameEL2: B 4 2 0.3536 0 0 0 2 3 -4 -6 4 1 4 5 1 1 0 0 1 36 FrameEL3: B 2 3 0.3536 0 0 0 2 4 -2 -4 2 6 1 2 4 1 1 1 1 37 FrameEL4: B 1 4 0.68 0 0 0 2 4 -1 1 3 7 1 1 5 1 0 1 1 1 38 FrameEL5: B 3 4 0.68 0 0 0 2 4 -1 -3 1 5 1 -2 5 1 1 1 1 0 39 FrameEL6: B 6 3 0.3536 0 0 0 2 4 -2 -4 -6 2 0 40 FrameEL7: B 5 4 0.68 0 0 0 2 4 -1 -5 1 3 0 41 FrameEL8: B 7 4 0.68 0 0 0 2 4 -1 -3 -7 1 0 34 FrameEL1: B 8 1 0.442 0 0 0 4 4 -8 -10 -12 -16 0 0 35 FrameEL2: B 4 2 0.3536 0 0 0 2 3 -4 -6 4 1 4 5 1 1 0 0 1 0 36 FrameEL3: B 2 3 0.3536 0 0 0 2 4 -2 -4 2 6 1 2 4 1 1 1 1 0 37 FrameEL4: B 1 4 0.68 0 0 0 2 4 -1 1 3 7 1 1 5 1 0 1 1 1 0 38 FrameEL5: B 3 4 0.68 0 0 0 2 4 -1 -3 1 5 1 -2 5 1 1 1 1 0 0 39 FrameEL6: B 6 3 0.3536 0 0 0 2 4 -2 -4 -6 2 0 1 1 1 0 1 40 FrameEL7: B 5 4 0.68 0 0 0 2 4 -1 -5 1 3 0 0 41 FrameEL8: B 7 4 0.68 0 0 0 2 4 -1 -3 -7 1 0 1 1 1 0 1 42 42 #=========== Motion Search ============= 43 43 FastSearch : 1 # 0:Full search 1:TZ search -
trunk/cfg/encoder_randomaccess_main10.cfg
r345 r442 22 22 DecodingRefreshType : 1 # Random Accesss 0:none, 1:CDR, 2:IDR 23 23 GOPSize : 8 # GOP Size (number of B slice = GOPSize-1) 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs 25 Frame1: B 8 1 0.442 0 0 0 4 4 -8 -10 -12 -16 0 26 Frame2: B 4 2 0.3536 0 0 0 2 3 -4 -6 4 1 4 5 1 1 0 0 1 27 Frame3: B 2 3 0.3536 0 0 0 2 4 -2 -4 2 6 1 2 4 1 1 1 1 28 Frame4: B 1 4 0.68 0 0 0 2 4 -1 1 3 7 1 1 5 1 0 1 1 1 29 Frame5: B 3 4 0.68 0 0 0 2 4 -1 -3 1 5 1 -2 5 1 1 1 1 0 30 Frame6: B 6 3 0.3536 0 0 0 2 4 -2 -4 -6 2 1 -3 5 1 1 1 1 0 31 Frame7: B 5 4 0.68 0 0 0 2 4 -1 -5 1 3 1 1 5 1 0 1 1 1 32 Frame8: B 7 4 0.68 0 0 0 2 4 -1 -3 -7 1 1 -2 5 1 1 1 1 0 24 # Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs #UseExtUsedByCurr ExtUsedByCurr(for each ref pic) 25 Frame1: B 8 1 0.442 0 0 0 4 4 -8 -10 -12 -16 0 0 26 Frame2: B 4 2 0.3536 0 0 0 2 3 -4 -6 4 1 4 5 1 1 0 0 1 0 27 Frame3: B 2 3 0.3536 0 0 0 2 4 -2 -4 2 6 1 2 4 1 1 1 1 0 28 Frame4: B 1 4 0.68 0 0 0 2 4 -1 1 3 7 1 1 5 1 0 1 1 1 0 29 Frame5: B 3 4 0.68 0 0 0 2 4 -1 -3 1 5 1 -2 5 1 1 1 1 0 0 30 Frame6: B 6 3 0.3536 0 0 0 2 4 -2 -4 -6 2 1 -3 5 1 1 1 1 0 0 31 Frame7: B 5 4 0.68 0 0 0 2 4 -1 -5 1 3 1 1 5 1 0 1 1 1 0 32 Frame8: B 7 4 0.68 0 0 0 2 4 -1 -3 -7 1 1 -2 5 1 1 1 1 0 0 33 33 34 FrameEL1: B 8 1 0.442 0 0 0 4 4 -8 -10 -12 -16 0 35 FrameEL2: B 4 2 0.3536 0 0 0 2 3 -4 -6 4 1 4 5 1 1 0 0 1 36 FrameEL3: B 2 3 0.3536 0 0 0 2 4 -2 -4 2 6 1 2 4 1 1 1 1 37 FrameEL4: B 1 4 0.68 0 0 0 2 4 -1 1 3 7 1 1 5 1 0 1 1 1 38 FrameEL5: B 3 4 0.68 0 0 0 2 4 -1 -3 1 5 1 -2 5 1 1 1 1 0 39 FrameEL6: B 6 3 0.3536 0 0 0 2 4 -2 -4 -6 2 0 40 FrameEL7: B 5 4 0.68 0 0 0 2 4 -1 -5 1 3 0 41 FrameEL8: B 7 4 0.68 0 0 0 2 4 -1 -3 -7 1 0 34 FrameEL1: B 8 1 0.442 0 0 0 4 4 -8 -10 -12 -16 0 0 35 FrameEL2: B 4 2 0.3536 0 0 0 2 3 -4 -6 4 1 4 5 1 1 0 0 1 0 36 FrameEL3: B 2 3 0.3536 0 0 0 2 4 -2 -4 2 6 1 2 4 1 1 1 1 0 37 FrameEL4: B 1 4 0.68 0 0 0 2 4 -1 1 3 7 1 1 5 1 0 1 1 1 0 38 FrameEL5: B 3 4 0.68 0 0 0 2 4 -1 -3 1 5 1 -2 5 1 1 1 1 0 0 39 FrameEL6: B 6 3 0.3536 0 0 0 2 4 -2 -4 -6 2 0 1 1 1 0 1 40 FrameEL7: B 5 4 0.68 0 0 0 2 4 -1 -5 1 3 0 0 41 FrameEL8: B 7 4 0.68 0 0 0 2 4 -1 -3 -7 1 0 1 1 1 0 1 42 42 #=========== Motion Search ============= 43 43 FastSearch : 1 # 0:Full search 1:TZ search -
trunk/cfg/layers.cfg
r310 r442 1 1 NumLayers : 2 2 2 AvcBase : 0 3 ScalabilityMask 0: 0 # Multiview4 ScalabilityMask 1: 1 # Scalable3 ScalabilityMask1 : 0 # Multiview 4 ScalabilityMask2 : 1 # Scalable 5 5 AdaptiveResolutionChange : 0 # Resolution change frame (0: disable) 6 6 MaxTidRefPresentFlag : 1 # max_tid_ref_present_flag (0=not present, 1=present(default)) 7 7 #============= LAYER 0 ================== 8 8 QP0 : 22 9 9 MaxTidIlRefPicsPlus10 : 1 # max_tid_il_ref_pics_plus1 for layer0 10 10 #============ Rate Control ============== 11 11 RateControl0 : 0 # Rate control: enable rate control for layer 0 -
trunk/cfg/layers_avcbase.cfg
r310 r442 1 1 NumLayers : 2 2 2 AvcBase : 1 3 ScalabilityMask 0: 0 # Multiview4 ScalabilityMask 1: 1 # Scalable3 ScalabilityMask1 : 0 # Multiview 4 ScalabilityMask2 : 1 # Scalable 5 5 AdaptiveResolutionChange : 0 # Resolution change frame (0: disable) 6 6 -
trunk/cfg/per-sequence-svc-avcbase/BQTerrace-1.5x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 720 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 64 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 64 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/BQTerrace-2x.cfg
r310 r442 8 8 SourceWidth0 : 960 # Input frame width 9 9 SourceHeight0 : 544 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 64 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 64 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/BQTerrace-SNR.cfg
r310 r442 8 8 SourceWidth0 : 1920 # Input frame width 9 9 SourceHeight0 : 1088 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 64 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 64 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode 22 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer 20 23 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers 21 24 QP1 : 20 -
trunk/cfg/per-sequence-svc-avcbase/BasketballDrive-1.5x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 720 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/BasketballDrive-2x.cfg
r310 r442 8 8 SourceWidth0 : 960 # Input frame width 9 9 SourceHeight0 : 544 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/BasketballDrive-SNR.cfg
r310 r442 8 8 SourceWidth0 : 1920 # Input frame width 9 9 SourceHeight0 : 1088 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode 22 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer 20 23 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers 21 24 QP1 : 20 -
trunk/cfg/per-sequence-svc-avcbase/Cactus-1.5x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 720 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/Cactus-2x.cfg
r310 r442 8 8 SourceWidth0 : 960 # Input frame width 9 9 SourceHeight0 : 544 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/Cactus-SNR.cfg
r310 r442 8 8 SourceWidth0 : 1920 # Input frame width 9 9 SourceHeight0 : 1088 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode 22 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer 20 23 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers 21 24 QP1 : 20 -
trunk/cfg/per-sequence-svc-avcbase/Kimono-1.5x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 720 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/Kimono-2x.cfg
r310 r442 8 8 SourceWidth0 : 960 # Input frame width 9 9 SourceHeight0 : 544 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/Kimono-SNR.cfg
r310 r442 8 8 SourceWidth0 : 1920 # Input frame width 9 9 SourceHeight0 : 1088 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode 22 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer 20 23 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers 21 24 QP1 : 20 -
trunk/cfg/per-sequence-svc-avcbase/ParkScene-1.5x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 720 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/ParkScene-2x.cfg
r310 r442 8 8 SourceWidth0 : 960 # Input frame width 9 9 SourceHeight0 : 544 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/ParkScene-SNR.cfg
r310 r442 8 8 SourceWidth0 : 1920 # Input frame width 9 9 SourceHeight0 : 1088 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode 22 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer 20 23 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers 21 24 QP1 : 20 -
trunk/cfg/per-sequence-svc-avcbase/PeopleOnStreet-2x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 800 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 32 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 2560 # Input frame width 17 18 SourceHeight1 : 1600 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 32 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/PeopleOnStreet-SNR.cfg
r310 r442 8 8 SourceWidth0 : 2560 # Input frame width 9 9 SourceHeight0 : 1600 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 32 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 2560 # Input frame width 17 18 SourceHeight1 : 1600 # Input frame height 19 RepFormatIdx1 : 0 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 32 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/Traffic-2x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 800 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 32 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 2560 # Input frame width 17 18 SourceHeight1 : 1600 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 32 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc-avcbase/Traffic-SNR.cfg
r310 r442 8 8 SourceWidth0 : 2560 # Input frame width 9 9 SourceHeight0 : 1600 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 32 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 2560 # Input frame width 17 18 SourceHeight1 : 1600 # Input frame height 19 RepFormatIdx1 : 0 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 32 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/BQTerrace-1.5x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 720 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 64 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 64 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/BQTerrace-2x.cfg
r310 r442 8 8 SourceWidth0 : 960 # Input frame width 9 9 SourceHeight0 : 540 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 64 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 64 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/BQTerrace-SNR.cfg
r310 r442 8 8 SourceWidth0 : 1920 # Input frame width 9 9 SourceHeight0 : 1080 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 64 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 0 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 64 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/BasketballDrive-1.5x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 720 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/BasketballDrive-2x.cfg
r310 r442 8 8 SourceWidth0 : 960 # Input frame width 9 9 SourceHeight0 : 540 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/BasketballDrive-SNR.cfg
r310 r442 8 8 SourceWidth0 : 1920 # Input frame width 9 9 SourceHeight0 : 1080 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 0 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/Cactus-1.5x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 720 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/Cactus-2x.cfg
r310 r442 8 8 SourceWidth0 : 960 # Input frame width 9 9 SourceHeight0 : 540 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/Cactus-SNR.cfg
r310 r442 8 8 SourceWidth0 : 1920 # Input frame width 9 9 SourceHeight0 : 1080 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 48 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 0 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/Kimono-1.5x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 720 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/Kimono-2x.cfg
r310 r442 8 8 SourceWidth0 : 960 # Input frame width 9 9 SourceHeight0 : 540 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/Kimono-SNR.cfg
r310 r442 8 8 SourceWidth0 : 1920 # Input frame width 9 9 SourceHeight0 : 1080 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 0 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/ParkScene-1.5x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 720 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/ParkScene-2x.cfg
r310 r442 8 8 SourceWidth0 : 960 # Input frame width 9 9 SourceHeight0 : 540 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/ParkScene-SNR.cfg
r310 r442 8 8 SourceWidth0 : 1920 # Input frame width 9 9 SourceHeight0 : 1080 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 24 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 1920 # Input frame width 17 18 SourceHeight1 : 1080 # Input frame height 19 RepFormatIdx1 : 0 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/PeopleOnStreet-2x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 800 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 32 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 2560 # Input frame width 17 18 SourceHeight1 : 1600 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 32 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/PeopleOnStreet-SNR.cfg
r310 r442 8 8 SourceWidth0 : 2560 # Input frame width 9 9 SourceHeight0 : 1600 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 32 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 2560 # Input frame width 17 18 SourceHeight1 : 1600 # Input frame height 19 RepFormatIdx1 : 0 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 32 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/Traffic-2x.cfg
r310 r442 8 8 SourceWidth0 : 1280 # Input frame width 9 9 SourceHeight0 : 800 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 32 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 2560 # Input frame width 17 18 SourceHeight1 : 1600 # Input frame height 19 RepFormatIdx1 : 1 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 32 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/cfg/per-sequence-svc/Traffic-SNR.cfg
r310 r442 8 8 SourceWidth0 : 2560 # Input frame width 9 9 SourceHeight0 : 1600 # Input frame height 10 RepFormatIdx0 : 0 # Index of corresponding rep_format() in the VPS 10 11 IntraPeriod0 : 32 # Period of I-Frame ( -1 = only first) 11 12 ConformanceMode0 : 1 # conformance mode … … 16 17 SourceWidth1 : 2560 # Input frame width 17 18 SourceHeight1 : 1600 # Input frame height 19 RepFormatIdx1 : 0 # Index of corresponding rep_format() in the VPS 18 20 IntraPeriod1 : 32 # Period of I-Frame ( -1 = only first) 19 21 ConformanceMode1 : 1 # conformance mode -
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev/source merged: 357-360 /branches/SHM-3.1-dev/source (added) merged: 355-356,361-364,366-403,405,407-441 /trunk/source merged: 352 reverse-merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r313 r442 56 56 TAppDecTop::TAppDecTop() 57 57 { 58 ::memset (m_abDecFlag, 0, sizeof (m_abDecFlag));59 58 for(UInt layer=0; layer < MAX_LAYERS; layer++) 60 59 { … … 67 66 : m_iPOCLastDisplay(-MAX_INT) 68 67 { 69 ::memset (m_abDecFlag, 0, sizeof (m_abDecFlag));70 68 } 71 69 #endif … … 146 144 147 145 // main decoder loop 148 Bool recon_opened[MAX_LAYERS]; // reconstruction file not yet opened. (must be performed after SPS is seen)146 Bool openedReconFile[MAX_LAYERS]; // reconstruction file not yet opened. (must be performed after SPS is seen) 149 147 for(UInt layer=0; layer<=m_tgtLayerId; layer++) 150 148 { 151 recon_opened[layer] = false;149 openedReconFile[layer] = false; 152 150 m_aiPOCLastDisplay[layer] += m_iSkipFrame; // set the last displayed POC correctly for skip forward. 153 151 } … … 228 226 { 229 227 m_acTDecTop[curLayerId].executeLoopFilters(poc, pcListPic); 228 #if EARLY_REF_PIC_MARKING 229 m_acTDecTop[curLayerId].earlyPicMarking(m_iMaxTemporalLayer, m_targetDecLayerIdSet); 230 #endif 230 231 } 231 232 232 233 if( pcListPic ) 233 234 { 234 if ( m_pchReconFile[curLayerId] && ! recon_opened[curLayerId] )235 if ( m_pchReconFile[curLayerId] && !openedReconFile[curLayerId] ) 235 236 { 236 237 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } … … 239 240 m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 240 241 241 recon_opened[curLayerId] = true;242 openedReconFile[curLayerId] = true; 242 243 } 243 244 if ( bNewPicture && bNewPOC && … … 263 264 // delete buffers 264 265 #if AVC_BASE 266 UInt layerIdmin = m_acTDecTop[0].getBLReconFile()->is_open() ? 1 : 0; 267 265 268 if( streamYUV.is_open() ) 266 269 { … … 273 276 } 274 277 #endif 275 pcBLPic.destroy(); 276 277 for(UInt layer = 1; layer <= m_tgtLayerId; layer++)278 pcBLPic.destroy(); 279 280 for(UInt layer = layerIdmin; layer <= m_tgtLayerId; layer++) 278 281 #else 279 282 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) … … 307 310 308 311 // main decoder loop 309 Bool recon_opened= false; // reconstruction file not yet opened. (must be performed after SPS is seen)312 Bool openedReconFile = false; // reconstruction file not yet opened. (must be performed after SPS is seen) 310 313 311 314 #if SYNTAX_OUTPUT … … 338 341 streampos location = bitstreamFile.tellg(); 339 342 AnnexBStats stats = AnnexBStats(); 340 Bool bPreviousPictureDecoded = false;341 343 342 344 vector<uint8_t> nalUnit; … … 360 362 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) ) 361 363 { 362 if(bPreviousPictureDecoded)363 {364 bNewPicture = true;365 bPreviousPictureDecoded = false;366 }367 else368 {369 364 bNewPicture = false; 370 365 } 371 }372 366 else 373 367 { … … 383 377 bytestream.reset(); 384 378 } 385 bPreviousPictureDecoded = true;386 379 } 387 380 } … … 393 386 if( pcListPic ) 394 387 { 395 if ( m_pchReconFile && ! recon_opened)388 if ( m_pchReconFile && !openedReconFile ) 396 389 { 397 390 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } … … 399 392 400 393 m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 401 recon_opened= true;394 openedReconFile = true; 402 395 } 403 396 if ( bNewPicture && … … 470 463 if ( m_pchReconFile[layer] ) 471 464 { 472 m_acTVideoIOYuvReconFile[layer]. 465 m_acTVideoIOYuvReconFile[layer].close(); 473 466 } 474 467 … … 505 498 506 499 /** \param pcListPic list of pictures to be written to file 507 508 500 \todo DYN_REF_FREE should be revised 501 */ 509 502 #if SVC_EXTENSION 510 503 Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic, UInt layerId, UInt tId ) … … 514 507 { 515 508 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 516 Int n ot_displayed = 0;509 Int numPicsNotYetDisplayed = 0; 517 510 518 511 while (iterPic != pcListPic->end()) … … 525 518 #endif 526 519 { 527 not_displayed++;520 numPicsNotYetDisplayed++; 528 521 } 529 522 iterPic++; 530 523 } 531 524 iterPic = pcListPic->begin(); 532 533 while (iterPic != pcListPic->end()) 534 { 535 TComPic* pcPic = *(iterPic); 536 537 #if SVC_EXTENSION 538 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_aiPOCLastDisplay[layerId])) 539 #else 540 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 541 #endif 542 { 543 // write to file 544 not_displayed--; 545 #if SVC_EXTENSION 546 if ( m_pchReconFile[layerId] ) 547 { 548 const Window &conf = pcPic->getConformanceWindow(); 549 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 550 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 551 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 552 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 553 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 554 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 555 } 556 557 // update POC of display order 558 m_aiPOCLastDisplay[layerId] = pcPic->getPOC(); 559 #else 560 if ( m_pchReconFile ) 561 { 562 #if SYNTAX_OUTPUT && ILP_DECODED_PICTURE 563 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec() ); 564 #else 565 const Window &conf = pcPic->getConformanceWindow(); 566 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 567 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 568 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 569 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 570 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 571 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 572 #endif 573 } 574 575 // update POC of display order 576 m_iPOCLastDisplay = pcPic->getPOC(); 577 #endif 578 579 // erase non-referenced picture in the reference picture list after display 580 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 581 { 525 if (numPicsNotYetDisplayed>2) 526 { 527 iterPic++; 528 } 529 530 TComPic* pcPic = *(iterPic); 531 if (numPicsNotYetDisplayed>2 && pcPic->isField()) //Field Decoding 532 { 533 TComList<TComPic*>::iterator endPic = pcListPic->end(); 534 endPic--; 535 iterPic = pcListPic->begin(); 536 while (iterPic != endPic) 537 { 538 TComPic* pcPicTop = *(iterPic); 539 iterPic++; 540 TComPic* pcPicBottom = *(iterPic); 541 542 #if SVC_EXTENSION 543 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 544 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0))) 545 #else 546 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 547 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay<0))) 548 #endif 549 { 550 // write to file 551 numPicsNotYetDisplayed = numPicsNotYetDisplayed-2; 552 #if SVC_EXTENSION 553 if ( m_pchReconFile[layerId] ) 554 { 555 const Window &conf = pcPicTop->getConformanceWindow(); 556 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 557 const Bool isTff = pcPicTop->isTopField(); 558 #if REPN_FORMAT_IN_VPS 559 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 560 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 561 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 562 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 563 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 564 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 565 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset(), isTff ); 566 567 #else 568 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 569 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 570 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 571 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 572 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 573 #endif 574 } 575 576 // update POC of display order 577 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 578 #else 579 if ( m_pchReconFile ) 580 { 581 const Window &conf = pcPicTop->getConformanceWindow(); 582 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 583 const Bool isTff = pcPicTop->isTopField(); 584 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 585 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 586 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 587 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 588 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 589 } 590 591 // update POC of display order 592 m_iPOCLastDisplay = pcPicBottom->getPOC(); 593 #endif 594 595 // erase non-referenced picture in the reference picture list after display 596 if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true ) 597 { 582 598 #if !DYN_REF_FREE 583 pcPic->setReconMark(false); 584 585 // mark it should be extended later 586 pcPic->getPicYuvRec()->setBorderExtension( false ); 587 588 #else 589 pcPic->destroy(); 590 pcListPic->erase( iterPic ); 591 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 592 continue; 593 #endif 594 } 595 pcPic->setOutputMark(false); 596 } 597 598 iterPic++; 599 pcPicTop->setReconMark(false); 600 601 // mark it should be extended later 602 pcPicTop->getPicYuvRec()->setBorderExtension( false ); 603 604 #else 605 pcPicTop->destroy(); 606 pcListPic->erase( iterPic ); 607 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 608 continue; 609 #endif 610 } 611 if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true ) 612 { 613 #if !DYN_REF_FREE 614 pcPicBottom->setReconMark(false); 615 616 // mark it should be extended later 617 pcPicBottom->getPicYuvRec()->setBorderExtension( false ); 618 619 #else 620 pcPicBottom->destroy(); 621 pcListPic->erase( iterPic ); 622 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 623 continue; 624 #endif 625 } 626 pcPicTop->setOutputMark(false); 627 pcPicBottom->setOutputMark(false); 628 } 629 } 630 } 631 else if (!pcPic->isField()) //Frame Decoding 632 { 633 iterPic = pcListPic->begin(); 634 while (iterPic != pcListPic->end()) 635 { 636 pcPic = *(iterPic); 637 638 #if SVC_EXTENSION 639 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_aiPOCLastDisplay[layerId])) 640 #else 641 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 642 #endif 643 { 644 // write to file 645 numPicsNotYetDisplayed--; 646 #if SVC_EXTENSION 647 if ( m_pchReconFile[layerId] ) 648 { 649 const Window &conf = pcPic->getConformanceWindow(); 650 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 651 #if REPN_FORMAT_IN_VPS 652 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 653 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 654 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 655 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 656 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 657 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 658 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 659 660 #else 661 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 662 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 663 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 664 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 665 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 666 #endif 667 } 668 669 // update POC of display order 670 m_aiPOCLastDisplay[layerId] = pcPic->getPOC(); 671 #else 672 if ( m_pchReconFile ) 673 { 674 #if SYNTAX_OUTPUT 675 const Window &conf = pcPic->getConformanceWindow(); 676 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 677 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 678 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 679 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 680 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 681 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 682 #endif 683 } 684 685 // update POC of display order 686 m_iPOCLastDisplay = pcPic->getPOC(); 687 #endif 688 689 // erase non-referenced picture in the reference picture list after display 690 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 691 { 692 #if !DYN_REF_FREE 693 pcPic->setReconMark(false); 694 695 // mark it should be extended later 696 pcPic->getPicYuvRec()->setBorderExtension( false ); 697 698 #else 699 pcPic->destroy(); 700 pcListPic->erase( iterPic ); 701 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 702 continue; 703 #endif 704 } 705 pcPic->setOutputMark(false); 706 } 707 708 iterPic++; 709 } 599 710 } 600 711 } … … 616 727 617 728 iterPic = pcListPic->begin(); 618 619 while (iterPic != pcListPic->end()) 620 { 621 TComPic* pcPic = *(iterPic); 622 623 if ( pcPic->getOutputMark() ) 624 { 625 // write to file 626 #if SVC_EXTENSION 627 if ( m_pchReconFile[layerId] ) 628 { 629 const Window &conf = pcPic->getConformanceWindow(); 630 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 631 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 632 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 633 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 634 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 635 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 636 } 637 638 // update POC of display order 639 m_aiPOCLastDisplay[layerId] = pcPic->getPOC(); 640 #else 641 if ( m_pchReconFile ) 642 { 643 const Window &conf = pcPic->getConformanceWindow(); 644 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 645 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 646 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 647 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 648 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 649 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 650 } 651 652 // update POC of display order 653 m_iPOCLastDisplay = pcPic->getPOC(); 654 #endif 655 656 // erase non-referenced picture in the reference picture list after display 657 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 658 { 729 TComPic* pcPic = *(iterPic); 730 731 if (pcPic->isField()) //Field Decoding 732 { 733 TComList<TComPic*>::iterator endPic = pcListPic->end(); 734 endPic--; 735 TComPic *pcPicTop, *pcPicBottom = NULL; 736 while (iterPic != endPic) 737 { 738 pcPicTop = *(iterPic); 739 iterPic++; 740 pcPicBottom = *(iterPic); 741 742 if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) ) 743 { 744 // write to file 745 #if SVC_EXTENSION 746 if ( m_pchReconFile[layerId] ) 747 { 748 const Window &conf = pcPicTop->getConformanceWindow(); 749 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 750 const Bool isTff = pcPicTop->isTopField(); 751 #if REPN_FORMAT_IN_VPS 752 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 753 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 754 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 755 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 756 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), 757 conf.getWindowTopOffset() *yScal + defDisp.getWindowTopOffset(), 758 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset(), isTff ); 759 760 #else 761 m_cTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 762 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 763 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 764 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 765 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 766 #endif 767 } 768 769 // update POC of display order 770 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 771 #else 772 if ( m_pchReconFile ) 773 { 774 const Window &conf = pcPicTop->getConformanceWindow(); 775 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 776 const Bool isTff = pcPicTop->isTopField(); 777 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 778 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 779 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 780 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 781 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 782 } 783 784 // update POC of display order 785 m_iPOCLastDisplay = pcPicBottom->getPOC(); 786 #endif 787 788 // erase non-referenced picture in the reference picture list after display 789 if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true ) 790 { 659 791 #if !DYN_REF_FREE 660 pcPic->setReconMark(false); 661 662 // mark it should be extended later 663 pcPic->getPicYuvRec()->setBorderExtension( false ); 664 665 #else 666 pcPic->destroy(); 667 pcListPic->erase( iterPic ); 668 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 669 continue; 670 #endif 671 } 672 pcPic->setOutputMark(false); 673 } 792 pcPicTop->setReconMark(false); 793 794 // mark it should be extended later 795 pcPicTop->getPicYuvRec()->setBorderExtension( false ); 796 797 #else 798 pcPicTop->destroy(); 799 pcListPic->erase( iterPic ); 800 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 801 continue; 802 #endif 803 } 804 if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true ) 805 { 806 #if !DYN_REF_FREE 807 pcPicBottom->setReconMark(false); 808 809 // mark it should be extended later 810 pcPicBottom->getPicYuvRec()->setBorderExtension( false ); 811 812 #else 813 pcPicBottom->destroy(); 814 pcListPic->erase( iterPic ); 815 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 816 continue; 817 #endif 818 } 819 pcPicTop->setOutputMark(false); 820 pcPicBottom->setOutputMark(false); 821 822 #if !DYN_REF_FREE 823 if(pcPicTop) 824 { 825 pcPicTop->destroy(); 826 delete pcPicTop; 827 pcPicTop = NULL; 828 } 829 #endif 830 } 831 } 832 if(pcPicBottom) 833 { 834 pcPicBottom->destroy(); 835 delete pcPicBottom; 836 pcPicBottom = NULL; 837 } 838 } 839 else //Frame decoding 840 { 841 while (iterPic != pcListPic->end()) 842 { 843 pcPic = *(iterPic); 844 845 if ( pcPic->getOutputMark() ) 846 { 847 // write to file 848 #if SVC_EXTENSION 849 if ( m_pchReconFile[layerId] ) 850 { 851 const Window &conf = pcPic->getConformanceWindow(); 852 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 853 #if REPN_FORMAT_IN_VPS 854 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 855 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 856 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 857 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 858 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), 859 conf.getWindowTopOffset() *yScal + defDisp.getWindowTopOffset(), 860 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset() ); 861 862 #else 863 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 864 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 865 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 866 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 867 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 868 #endif 869 } 870 871 // update POC of display order 872 m_aiPOCLastDisplay[layerId] = pcPic->getPOC(); 873 #else 874 if ( m_pchReconFile ) 875 { 876 const Window &conf = pcPic->getConformanceWindow(); 877 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 878 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 879 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 880 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 881 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 882 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 883 } 884 885 // update POC of display order 886 m_iPOCLastDisplay = pcPic->getPOC(); 887 #endif 888 889 // erase non-referenced picture in the reference picture list after display 890 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 891 { 892 #if !DYN_REF_FREE 893 pcPic->setReconMark(false); 894 895 // mark it should be extended later 896 pcPic->getPicYuvRec()->setBorderExtension( false ); 897 898 #else 899 pcPic->destroy(); 900 pcListPic->erase( iterPic ); 901 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 902 continue; 903 #endif 904 } 905 pcPic->setOutputMark(false); 906 } 674 907 #if !SVC_EXTENSION 675 908 #if !DYN_REF_FREE 676 if(pcPic)677 {678 pcPic->destroy();679 delete pcPic;680 pcPic = NULL;681 }909 if(pcPic) 910 { 911 pcPic->destroy(); 912 delete pcPic; 913 pcPic = NULL; 914 } 682 915 #endif 683 916 #endif 684 iterPic++; 917 iterPic++; 918 } 685 919 } 686 920 #if SVC_EXTENSION -
trunk/source/App/TAppDecoder/TAppDecTop.h
r313 r442 70 70 #endif 71 71 72 // for output control 73 Bool m_abDecFlag[ MAX_GOP ]; ///< decoded flag in one GOP 72 // for output control 74 73 #if SVC_EXTENSION 75 74 Int m_aiPOCLastDisplay [MAX_LAYERS]; ///< last POC in display order -
trunk/source/App/TAppDownConvert/TAppDownConvert.cpp
r340 r442 270 270 FILE * outfile; 271 271 272 int M ,N;273 int ratio ;272 int M = -1 ,N = -1; 273 int ratio = -1; 274 274 int Frames=0; 275 275 int totalFrames=0; … … 326 326 return -1; 327 327 } 328 if ( ratio > 1 || ratio < 0) 329 { 328 329 switch( ratio ) 330 { 331 default: 330 332 printf("\ndown sampling parameter %d is not supported (0: 2x downsampling, 1: 1.5x downsampling)\n", ratio); 331 333 return -1; 332 } 333 334 if (ratio==0) 335 { 334 case 0: 336 335 M=4; 337 336 N=8; 338 } 339 else if (ratio==1) 340 { 337 break; 338 case 1: 341 339 M=8; 342 340 N=12; 341 break; 343 342 } 344 343 -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r345 r442 69 69 , m_avcBaseLayerFlag(0) 70 70 #endif 71 #if N0120_MAX_TID_REF_CFG 72 , m_maxTidRefPresentFlag(1) 73 #endif 71 74 , m_pColumnWidth() 72 75 , m_pRowHeight() 73 76 , m_scalingListFile() 74 #if REF_IDX_FRAMEWORK75 77 , m_elRapSliceBEnabled(0) 76 #endif77 78 { 78 79 for(UInt layer=0; layer<MAX_LAYERS; layer++) … … 217 218 { 218 219 in>>entry.m_refIdc[i]; 220 } 221 } 222 #endif 223 #if EXTERNAL_USEDBYCURR_N0082 224 if(entry.m_numRefPics>0){ 225 in>>entry.m_UseExtusedByCurrPic; 226 if(entry.m_UseExtusedByCurrPic) 227 { 228 for ( Int i = 0; i < entry.m_numRefPics; i++ ) 229 { 230 in>>entry.m_ExtusedByCurrPic[i]; 231 } 219 232 } 220 233 } … … 335 348 336 349 #if SVC_EXTENSION 337 string cfg_LayerCfgFile [MAX_LAYERS];350 string cfg_LayerCfgFile [MAX_LAYERS]; 338 351 string cfg_BitstreamFile; 339 string* cfg_InputFile [MAX_LAYERS]; 340 string* cfg_ReconFile [MAX_LAYERS]; 341 Double* cfg_fQP [MAX_LAYERS]; 342 352 string* cfg_InputFile [MAX_LAYERS]; 353 string* cfg_ReconFile [MAX_LAYERS]; 354 Double* cfg_fQP [MAX_LAYERS]; 355 356 #if REPN_FORMAT_IN_VPS 357 Int* cfg_repFormatIdx [MAX_LAYERS]; 358 #endif 343 359 Int* cfg_SourceWidth [MAX_LAYERS]; 344 360 Int* cfg_SourceHeight [MAX_LAYERS]; … … 384 400 Bool* cfg_RCForceIntraQP [MAX_LAYERS]; 385 401 #endif 402 #if N0120_MAX_TID_REF_CFG 403 Int* cfg_maxTidIlRefPicsPlus1[MAX_LAYERS]; 404 #endif 386 405 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 387 406 { … … 389 408 cfg_ReconFile[layer] = &m_acLayerCfg[layer].m_cReconFile; 390 409 cfg_fQP[layer] = &m_acLayerCfg[layer].m_fQP; 410 #if REPN_FORMAT_IN_VPS 411 cfg_repFormatIdx[layer] = &m_acLayerCfg[layer].m_repFormatIdx; 412 #endif 391 413 cfg_SourceWidth[layer] = &m_acLayerCfg[layer].m_iSourceWidth; 392 414 cfg_SourceHeight[layer] = &m_acLayerCfg[layer].m_iSourceHeight; … … 426 448 cfg_RCForceIntraQP[layer] = &m_acLayerCfg[layer].m_RCForceIntraQP; 427 449 #endif 450 #if N0120_MAX_TID_REF_CFG 451 cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1; 452 #endif 428 453 } 429 454 #if AVC_BASE … … 432 457 #if AVC_SYNTAX 433 458 string cfg_BLSyntaxFile; 459 #endif 460 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 461 string cfg_tileSets; 434 462 #endif 435 463 #else … … 459 487 ("FrameRate%d,-fr%d", cfg_FrameRate, 0, MAX_LAYERS, "Frame rate for layer %d") 460 488 ("LambdaModifier%d,-LM%d", m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d") 489 #if REPN_FORMAT_IN_VPS 490 ("RepFormatIdx%d", cfg_repFormatIdx, -1, MAX_LAYERS, "Index to the representation format structure used from the VPS") 491 #endif 461 492 #if VPS_EXTN_DIRECT_REF_LAYERS 462 493 #if M0457_PREDICTION_INDICATIONS … … 474 505 ("NumLayers", m_numLayers, 1, "Number of layers to code") 475 506 ("ConformanceMode%d", cfg_conformanceMode,0, MAX_LAYERS, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") 507 #if SCALABILITY_MASK_E0104 508 ("ScalabilityMask1", m_scalabilityMask[1], 0, "scalability_mask[1] (multiview)") 509 ("ScalabilityMask2", m_scalabilityMask[2], 1, "scalability_mask[2] (scalable)" ) 510 #else 476 511 ("ScalabilityMask0", m_scalabilityMask[0], 0, "scalability_mask[0] (multiview)") 477 512 ("ScalabilityMask1", m_scalabilityMask[1], 1, "scalability_mask[1] (scalable)" ) 513 #endif 478 514 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") 479 515 ("InputBitDepth", m_inputBitDepthY, 8, "Bit-depth of input file") … … 495 531 " bottom-right luma sample of the EL picture, in units of two luma samples") 496 532 #endif 533 #if N0120_MAX_TID_REF_CFG 534 ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, true, "max_tid_ref_present_flag (0: not present, 1: present(default)) " ) 535 ("MaxTidIlRefPicsPlus1%d", cfg_maxTidIlRefPicsPlus1, 1, MAX_LAYERS, "allowed maximum temporal_id for inter-layer prediction") 536 #endif 497 537 #if AVC_BASE 498 538 ("AvcBase,-avc", m_avcBaseLayerFlag, 0, "avc_base_layer_flag") … … 502 542 #endif 503 543 #endif 504 #if REF_IDX_FRAMEWORK505 544 ("EnableElRapB,-use-rap-b", m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)") 506 #endif507 545 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 508 546 ("IlSampleOnlyPred%d", m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices") 509 547 #endif 510 #else 548 #else 511 549 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") 512 550 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") … … 530 568 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") 531 569 #endif 570 571 //Field coding parameters 572 ("FieldCoding", m_isField, false, "Signals if it's a field based coding") 573 ("TopFieldFirst, Tff", m_isTopFieldFirst, false, "In case of field based coding, signals whether if it's a top field first or not") 532 574 ("FrameSkip,-fs", m_FrameSkip, 0u, "Number of frames to skip at start of input YUV") 533 575 ("FramesToBeEncoded,f", m_framesToBeEncoded, 0, "Number of frames to be encoded (default=all)") … … 810 852 ("AdaptiveResolutionChange", m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)") 811 853 #endif 854 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 855 ("SEIInterLayerConstrainedTileSets", m_interLayerConstrainedTileSetsSEIEnabled, false, "Control generation of inter layer constrained tile sets SEI message") 856 ("IlNumSetsInMessage", m_ilNumSetsInMessage, 0u, "Number of inter layer constrained tile sets") 857 ("TileSetsArray", cfg_tileSets, string(""), "Array containing tile sets params (TopLeftTileIndex, BottonRightTileIndex and ilcIdc for each set) ") 858 #endif 812 859 ; 813 860 … … 827 874 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); 828 875 876 if(m_isField) 877 { 878 #if SVC_EXTENSION 879 for(Int layer = 0; layer < MAX_LAYERS; layer++) 880 { 881 //Frame height 882 m_acLayerCfg[layer].m_iSourceHeightOrg = m_acLayerCfg[layer].m_iSourceHeight; 883 //Field height 884 m_acLayerCfg[layer].m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight >> 1; 885 } 886 #else 887 //Frame height 888 m_iSourceHeightOrg = m_iSourceHeight; 889 //Field height 890 m_iSourceHeight = m_iSourceHeight >> 1; 891 #endif 892 //number of fields to encode 893 m_framesToBeEncoded *= 2; 894 } 895 829 896 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 830 897 { … … 1119 1186 #endif 1120 1187 m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str()); 1121 1188 1189 #if REPN_FORMAT_IN_VPS_123 1190 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1191 { 1192 m_acLayerCfg[layer].setSourceHeight( m_repFormatCfg[ m_acLayerCfg[layer].getRepFormatIdx() ].m_picHeightInLumaSamples); 1193 m_acLayerCfg[layer].setSourceWidth ( m_repFormatCfg[ m_acLayerCfg[layer].getRepFormatIdx() ].m_picWidthInLumaSamples ); 1194 } 1195 #endif 1122 1196 /* rules for input, output and internal bitdepths as per help text */ 1123 1197 if (!m_internalBitDepthY) { m_internalBitDepthY = m_inputBitDepthY; } … … 1151 1225 m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 1152 1226 m_iSourceHeight += m_confBottom; 1227 if ( m_isField ) 1228 { 1229 m_iSourceHeightOrg += m_confBottom << 1; 1230 m_aiPad[1] = m_confBottom << 1; 1231 } 1153 1232 } 1154 1233 if (m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0) … … 1284 1363 } 1285 1364 } 1365 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1366 if (m_interLayerConstrainedTileSetsSEIEnabled) 1367 { 1368 if (m_iNumColumnsMinus1 == 0 && m_iNumRowsMinus1 == 0) 1369 { 1370 printf( "Tiles are not defined (needed for inter-layer comnstrained tile sets SEI).\n" ); 1371 exit( EXIT_FAILURE ); 1372 } 1373 Char* pTileSets = cfg_tileSets.empty() ? NULL : strdup(cfg_tileSets.c_str()); 1374 int i = 0; 1375 char *topLeftTileIndex = strtok(pTileSets, " ,"); 1376 while(topLeftTileIndex != NULL) 1377 { 1378 if( i >= m_ilNumSetsInMessage ) 1379 { 1380 printf( "The number of tile sets is larger than defined by IlNumSetsInMessage.\n" ); 1381 exit( EXIT_FAILURE ); 1382 } 1383 *( m_topLeftTileIndex + i ) = atoi( topLeftTileIndex ); 1384 char *bottonRightTileIndex = strtok(NULL, " ,"); 1385 if( bottonRightTileIndex == NULL ) 1386 { 1387 printf( "BottonRightTileIndex is missing in the tile sets.\n" ); 1388 exit( EXIT_FAILURE ); 1389 } 1390 *( m_bottomRightTileIndex + i ) = atoi( bottonRightTileIndex ); 1391 char *ilcIdc = strtok(NULL, " ,"); 1392 if( ilcIdc == NULL ) 1393 { 1394 printf( "IlcIdc is missing in the tile sets.\n" ); 1395 exit( EXIT_FAILURE ); 1396 } 1397 *( m_ilcIdc + i ) = atoi( ilcIdc ); 1398 topLeftTileIndex = strtok(NULL, " ,"); 1399 i++; 1400 } 1401 if( i < m_ilNumSetsInMessage ) 1402 { 1403 printf( "The number of tile sets is smaller than defined by IlNumSetsInMessage.\n" ); 1404 exit( EXIT_FAILURE ); 1405 } 1406 m_skippedTileSetPresentFlag = false; 1407 } 1408 #endif 1286 1409 // check validity of input parameters 1287 1410 xCheckParameter(); … … 1467 1590 #endif 1468 1591 1469 #if !FINAL_RPL_CHANGE_N00821592 #if EXTERNAL_USEDBYCURR_N0082|| !FINAL_RPL_CHANGE_N0082 1470 1593 Bool verifiedGOP=false; 1471 1594 #endif 1472 1595 Bool errorGOP=false; 1473 #if !FINAL_RPL_CHANGE_N00821596 #if EXTERNAL_USEDBYCURR_N0082|| !FINAL_RPL_CHANGE_N0082 1474 1597 Int checkGOP=1; 1475 Int numRefs = 1;1598 Int numRefs = m_isField ? 2 : 1; 1476 1599 #endif 1477 1600 Int refList[MAX_NUM_REF_PICS+1]; 1478 1601 refList[0]=0; 1602 if(m_isField) 1603 { 1604 refList[1] = 1; 1605 } 1479 1606 Bool isOK[MAX_GOP]; 1480 1607 for(Int i=0; i<MAX_GOP; i++) … … 1482 1609 isOK[i]=false; 1483 1610 } 1484 #if !FINAL_RPL_CHANGE_N00821611 #if EXTERNAL_USEDBYCURR_N0082|| !FINAL_RPL_CHANGE_N0082 1485 1612 Int numOK=0; 1486 1613 #endif … … 1504 1631 for(UInt layer=0; layer<m_numLayers; layer++) 1505 1632 { 1506 if(m_acLayerCfg[layer].xCheckParameter( ))1633 if(m_acLayerCfg[layer].xCheckParameter(m_isField)) 1507 1634 { 1508 1635 printf("\nError: invalid configuration parameter found in layer %d \n", layer); … … 1530 1657 for(UInt layer=0; layer<m_numLayers; layer++) 1531 1658 { 1532 if (m_acLayerCfg[layer].m_GOPListLayer[0].m_POC<0){ 1659 if (m_acLayerCfg[layer].m_GOPListLayer[0].m_POC<0) 1660 { 1533 1661 memcpy( m_acLayerCfg[layer].m_GOPListLayer, m_GOPList, sizeof(GOPEntry)*MAX_GOP ); 1534 1662 } … … 1536 1664 xConfirmPara(errorGOP,"Invalid GOP structure given"); 1537 1665 } 1666 #if TEMP_SCALABILITY_FIX 1667 if( m_acLayerCfg[1].m_GOPListLayer[5].m_POC == 6 && m_acLayerCfg[1].m_GOPListLayer[7].m_POC == 7 && 1668 m_acLayerCfg[1].m_GOPListLayer[5].m_temporalId == 0 && m_acLayerCfg[1].m_GOPListLayer[7].m_temporalId == 0) 1669 #else 1538 1670 //tentative for encoder 1539 if( m_acLayerCfg[1].m_GOPListLayer[5].m_POC == 6 && m_acLayerCfg[1].m_GOPListLayer[7].m_POC == 7 ){ 1671 if( m_acLayerCfg[1].m_GOPListLayer[5].m_POC == 6 && m_acLayerCfg[1].m_GOPListLayer[7].m_POC == 7 ) 1672 #endif 1673 { 1540 1674 //RA, POC5 1541 1675 m_acLayerCfg[1].m_GOPListLayer[5].m_usedByCurrPic[2] = 0; … … 1545 1679 m_acLayerCfg[1].m_GOPListLayer[7].m_refIdc[2] = 0; 1546 1680 } 1547 #else 1681 #endif 1682 #if EXTERNAL_USEDBYCURR_N0082|| !FINAL_RPL_CHANGE_N0082 1548 1683 m_extraRPSs=0; 1549 1684 //start looping through frames in coding order until we can verify that the GOP structure is correct. … … 1742 1877 xConfirmPara(errorGOP,"Invalid GOP structure given"); 1743 1878 #endif 1879 #if EXTERNAL_USEDBYCURR_N0082 1880 for(UInt layer=0; layer<m_numLayers; layer++) 1881 { 1882 for (Int i=0; i< m_iGOPSize; i++){ 1883 if (m_acLayerCfg[layer].m_GOPListLayer[i].m_UseExtusedByCurrPic == 1 ) 1884 { 1885 for(Int j=0; j<m_acLayerCfg[layer].m_GOPListLayer[i].m_numRefPics; j++ ) 1886 { 1887 m_acLayerCfg[layer].m_GOPListLayer[i].m_usedByCurrPic[j] = m_acLayerCfg[layer].m_GOPListLayer[i].m_ExtusedByCurrPic[j]; 1888 m_acLayerCfg[layer].m_GOPListLayer[i].m_refIdc[j] = m_acLayerCfg[layer].m_GOPListLayer[i].m_ExtusedByCurrPic[j]; 1889 } 1890 } 1891 } 1892 } 1893 #endif 1744 1894 m_maxTempLayer = 1; 1745 1895 for(Int i=0; i<m_iGOPSize; i++) … … 2045 2195 } 2046 2196 #endif 2197 #if N0120_MAX_TID_REF_CFG 2198 for (UInt layer=0; layer < MAX_LAYERS-1; layer++) 2199 { 2200 xConfirmPara(m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1 < 0 || m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7"); 2201 } 2202 #endif 2047 2203 #undef xConfirmPara 2048 2204 if (check_failed) … … 2081 2237 #if SVC_EXTENSION 2082 2238 printf("Total number of layers : %d\n", m_numLayers ); 2239 #if SCALABILITY_MASK_E0104 2240 printf("Multiview : %d\n", m_scalabilityMask[1] ); 2241 printf("Scalable : %d\n", m_scalabilityMask[2] ); 2242 #else 2083 2243 printf("Multiview : %d\n", m_scalabilityMask[0] ); 2084 2244 printf("Scalable : %d\n", m_scalabilityMask[1] ); 2245 #endif 2085 2246 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 2086 2247 printf("Adaptive Resolution Change : %d\n", m_adaptiveResolutionChange ); … … 2105 2266 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 2106 2267 #endif 2107 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2268 if (m_isField) 2269 { 2270 printf("Frame/Field : Field based coding\n"); 2271 printf("Field index : %u - %d (%d fields)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2272 if (m_isTopFieldFirst) 2273 { 2274 printf("Field Order : Top field first\n"); 2275 } 2276 else 2277 { 2278 printf("Field Order : Bottom field first\n"); 2279 } 2280 } 2281 else 2282 { 2283 printf("Frame/Field : Frame based coding\n"); 2284 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2285 } 2108 2286 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 2109 2287 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); … … 2209 2387 printf("AvcBase:%d ", 0); 2210 2388 #endif 2211 #if REF_IDX_FRAMEWORK2212 printf("REF_IDX_FRAMEWORK:%d ", REF_IDX_FRAMEWORK);2213 2389 printf("EL_RAP_SliceType: %d ", m_elRapSliceBEnabled); 2214 2390 printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV); 2215 2391 printf("ENCODER_FAST_MODE: %d ", ENCODER_FAST_MODE); 2216 2392 printf("REF_IDX_MFM: %d ", REF_IDX_MFM); 2217 #endif2218 2393 #else 2219 2394 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r345 r442 59 59 // file I/O 60 60 #if SVC_EXTENSION 61 TAppEncLayerCfg m_acLayerCfg [MAX_LAYERS]; 61 TAppEncLayerCfg m_acLayerCfg [MAX_LAYERS]; 62 62 Int m_numLayers; ///< number of layers 63 63 Int m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask … … 68 68 Int m_framesToBeEncoded; ///< number of encoded frames 69 69 #if AVC_BASE 70 Int m_avcBaseLayerFlag; ///< AVC_BASElayer_flag70 Int m_avcBaseLayerFlag; ///< avc_baselayer_flag 71 71 #endif 72 72 #if AVC_SYNTAX … … 76 76 Int m_ilSampleOnlyPred[ MAX_LAYERS ]; 77 77 #endif 78 #if N0120_MAX_TID_REF_CFG 79 Bool m_maxTidRefPresentFlag; 80 #endif 78 81 #else 79 82 Char* m_pchInputFile; ///< source file name … … 85 88 UInt m_FrameSkip; ///< number of skipped frames from the beginning 86 89 Int m_iSourceWidth; ///< source width in pixel 87 Int m_iSourceHeight; ///< source height in pixel 90 Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) 91 92 Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) 93 94 88 95 Int m_conformanceMode; 89 96 Int m_confLeft; … … 94 101 Int m_aiPad[2]; ///< number of padded pixels for width and height 95 102 #endif 103 104 Bool m_isField; ///< enable field coding 105 Bool m_isTopFieldFirst; 96 106 97 107 // profile/level … … 340 350 Int m_log2MaxMvLengthVertical; ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units 341 351 342 #if REF_IDX_FRAMEWORK352 #if SVC_EXTENSION 343 353 Int m_elRapSliceBEnabled; 344 354 #endif … … 353 363 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 354 364 Int m_adaptiveResolutionChange; ///< Indicate adaptive resolution change frame 365 #endif 366 #if REPN_FORMAT_IN_VPS 367 RepFormatCfg m_repFormatCfg[16]; ///< Rep_format structures 368 #endif 369 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 370 Bool m_interLayerConstrainedTileSetsSEIEnabled; 371 UInt m_ilNumSetsInMessage; 372 Bool m_skippedTileSetPresentFlag; 373 UInt m_topLeftTileIndex[1024]; 374 UInt m_bottomRightTileIndex[1024]; 375 UInt m_ilcIdc[1024]; 355 376 #endif 356 377 public: … … 381 402 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); 382 403 #endif 404 #if REPN_FORMAT_IN_VPS 405 RepFormatCfg* getRepFormatCfg(Int i) { return &m_repFormatCfg[i]; } 406 #endif 383 407 #endif 384 408 };// END CLASS DEFINITION TAppEncCfg -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r313 r442 32 32 m_conformanceMode( 0 ), 33 33 m_aidQP(NULL) 34 #if REPN_FORMAT_IN_VPS 35 , m_repFormatIdx (-1) 36 #endif 34 37 { 35 38 m_confLeft = m_confRight = m_confTop = m_confBottom = 0; … … 158 161 Bool confirmPara(Bool bflag, const char* message); 159 162 160 Bool TAppEncLayerCfg::xCheckParameter( )163 Bool TAppEncLayerCfg::xCheckParameter( Bool isField ) 161 164 { 162 165 switch (m_conformanceMode) … … 182 185 m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 183 186 m_iSourceHeight += m_confBottom; 187 if ( isField ) 188 { 189 m_iSourceHeightOrg += m_confBottom << 1; 190 m_aiPad[1] = m_confBottom << 1; 191 } 184 192 } 185 193 break; -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.h
r345 r442 33 33 Int m_iFrameRate; ///< source frame-rates (Hz) 34 34 Int m_iSourceWidth; ///< source width in pixel 35 Int m_iSourceHeight; ///< source height in pixel 35 Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) 36 Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) 36 37 Int m_conformanceMode; 37 38 Int m_confLeft; … … 66 67 #endif 67 68 69 #if N0120_MAX_TID_REF_CFG 70 Int m_maxTidIlRefPicsPlus1; 71 #endif 68 72 #if SVC_EXTENSION 69 73 Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). … … 84 88 GOPEntry m_GOPListLayer[MAX_GOP]; ///< for layer 85 89 #endif 90 #if REPN_FORMAT_IN_VPS 91 Int m_repFormatIdx; 92 #endif 86 93 public: 87 94 TAppEncLayerCfg(); … … 98 105 Void xPrintParameter(); 99 106 #endif 100 Bool xCheckParameter( );107 Bool xCheckParameter( Bool isField ); 101 108 102 109 Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } … … 107 114 Int getSourceWidth() {return m_iSourceWidth; } 108 115 Int getSourceHeight() {return m_iSourceHeight; } 116 Int getSourceHeightOrg() {return m_iSourceHeightOrg; } 109 117 Int getConformanceMode() { return m_conformanceMode; } 110 118 Int* getPad() {return m_aiPad; } … … 147 155 GOPEntry getGOPEntry(Int i ) {return m_GOPListLayer[i]; } 148 156 #endif 157 #if REPN_FORMAT_IN_VPS 158 Int getRepFormatIdx() { return m_repFormatIdx; } 159 Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } 160 Void setSourceWidth(Int x) { m_iSourceWidth = x; } 161 Void setSourceHeight(Int x) { m_iSourceHeight = x; } 162 #endif 163 #if N0120_MAX_TID_REF_CFG 164 Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } 165 #endif 149 166 }; // END CLASS DEFINITION TAppEncLayerCfg 150 167 -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r345 r442 90 90 vps->setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 91 91 } 92 92 #if REPN_FORMAT_IN_VPS 93 vps->setRepFormatIdxPresentFlag( true ); // Could be disabled to optimize in some cases. 94 Int maxRepFormatIdx = -1; 95 Int formatIdx = -1; 96 for(UInt layer=0; layer < m_numLayers; layer++) 97 { 98 // Auto generation of the format index 99 if( m_acLayerCfg[layer].getRepFormatIdx() == -1 ) 100 { 101 // Currently only picture width and height are considred. It has to be updated if different chroma format and bit-depth will are used. 102 Bool found = false; 103 for( UInt idx = 0; idx < layer; idx++ ) 104 { 105 if( m_acLayerCfg[layer].getSourceWidth() == m_acLayerCfg[idx].getSourceWidth() && m_acLayerCfg[layer].getSourceHeight() == m_acLayerCfg[idx].getSourceHeight() ) 106 { 107 found = true; 108 break; 109 } 110 } 111 if( !found ) 112 { 113 formatIdx++; 114 } 115 116 m_acLayerCfg[layer].setRepFormatIdx( formatIdx ); 117 } 118 119 assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" ); 120 vps->setVpsRepFormatIdx( layer, m_acLayerCfg[layer].getRepFormatIdx() ); 121 maxRepFormatIdx = std::max( m_acLayerCfg[layer].getRepFormatIdx(), maxRepFormatIdx ); 122 } 123 assert( vps->getVpsRepFormatIdx( 0 ) == 0 ); // Base layer should point to the first one. 124 Int* mapIdxToLayer = new Int[maxRepFormatIdx + 1]; 125 // Check that all the indices from 0 to maxRepFormatIdx are used in the VPS 126 for(Int i = 0; i <= maxRepFormatIdx; i++) 127 { 128 mapIdxToLayer[i] = -1; 129 UInt layer; 130 for(layer=0; layer < m_numLayers; layer++) 131 { 132 if( vps->getVpsRepFormatIdx(layer) == i ) 133 { 134 mapIdxToLayer[i] = layer; 135 break; 136 } 137 } 138 assert( layer != m_numLayers ); // One of the VPS Rep format indices not set 139 } 140 vps->setVpsNumRepFormats( maxRepFormatIdx + 1 ); 141 for(UInt idx=0; idx < vps->getVpsNumRepFormats(); idx++) 142 { 143 RepFormat *repFormat = vps->getVpsRepFormat( idx ); 144 repFormat->setPicWidthVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth() ); 145 repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight() ); 146 repFormat->setChromaFormatVpsIdc ( 1 ); // Need modification to change for each layer - corresponds to 420 147 repFormat->setSeparateColourPlaneVpsFlag( 0 ); // Need modification to change for each layer 148 repFormat->setBitDepthVpsLuma ( getInternalBitDepthY() ); // Need modification to change for each layer 149 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC() ); // Need modification to change for each layer 150 } 151 delete [] mapIdxToLayer; 152 #endif 93 153 for(UInt layer=0; layer<m_numLayers; layer++) 94 154 { … … 157 217 m_acTEncTop[layer].setMaxTempLayer ( m_maxTempLayer ); 158 218 m_acTEncTop[layer].setUseAMP( m_enableAMP ); 219 #if N0120_MAX_TID_REF_CFG 220 if (layer<m_numLayers-1) 221 { 222 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 223 } 224 #endif 159 225 #if VPS_EXTN_DIRECT_REF_LAYERS 160 226 if(layer) … … 195 261 { 196 262 m_acTEncTop[layer].setMotionPredRefLayerId ( i, m_acLayerCfg[layer].getMotionPredRefLayerId(i)); 197 m_acTEncTop[layer].setMotionPredEnabledFlag (m_acLayerCfg[layer].get SamplePredRefLayerId(i), true);263 m_acTEncTop[layer].setMotionPredEnabledFlag (m_acLayerCfg[layer].getMotionPredRefLayerId(i), true); 198 264 } 199 265 } … … 397 463 m_acTEncTop[layer].setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); 398 464 m_acTEncTop[layer].setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled ); 465 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 466 m_acTEncTop[layer].setInterLayerConstrainedTileSetsSEIEnabled( m_interLayerConstrainedTileSetsSEIEnabled ); 467 m_acTEncTop[layer].setIlNumSetsInMessage( m_ilNumSetsInMessage ); 468 m_acTEncTop[layer].setSkippedTileSetPresentFlag( m_skippedTileSetPresentFlag ); 469 m_acTEncTop[layer].setTopLeftTileIndex( m_topLeftTileIndex ); 470 m_acTEncTop[layer].setBottomRightTileIndex( m_bottomRightTileIndex ); 471 m_acTEncTop[layer].setIlcIdc( m_ilcIdc ); 472 #endif 399 473 m_acTEncTop[layer].setUniformSpacingIdr ( m_iUniformSpacingIdr ); 400 474 m_acTEncTop[layer].setNumColumnsMinus1 ( m_iNumColumnsMinus1 ); … … 475 549 m_acTEncTop[layer].setLog2MaxMvLengthHorizontal( m_log2MaxMvLengthHorizontal ); 476 550 m_acTEncTop[layer].setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 477 #if REF_IDX_FRAMEWORK478 551 m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled); 479 #endif480 552 #if SCALED_REF_LAYER_OFFSETS 481 553 if( layer > 0 ) … … 824 896 } 825 897 826 Void TAppEncTop::xInitLib( )898 Void TAppEncTop::xInitLib(Bool isFieldCoding) 827 899 { 828 900 #if SVC_EXTENSION 829 901 for(UInt layer=0; layer<m_numLayers; layer++) 830 902 { 831 m_acTEncTop[layer].init( );903 m_acTEncTop[layer].init(isFieldCoding); 832 904 } 833 905 #if VPS_RENAME … … 889 961 #endif 890 962 #if N0120_MAX_TID_REF_PRESENT_FLAG 891 vps->setMaxTidIlRefPicsPlus1PresentFlag(true); 892 if (vps->getMaxTidIlRefPicsPlus1PresentFlag()) 963 #if N0120_MAX_TID_REF_CFG 964 vps->setMaxTidRefPresentFlag(m_maxTidRefPresentFlag); 965 #else 966 vps->setMaxTidRefPresentFlag(true); 967 #endif 968 if (vps->getMaxTidRefPresentFlag()) 893 969 { 894 970 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++ ) 895 971 { 896 vps->setMaxSublayerForIlpPlus1(i, vps->getMaxTLayers()+1); 972 #if N0120_MAX_TID_REF_CFG 973 vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 974 #else 975 vps->setMaxTidIlRefPicsPlus1(i, vps->getMaxTLayers()+1); 976 #endif 897 977 } 898 978 } … … 901 981 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++ ) 902 982 { 903 vps->setMax SublayerForIlpPlus1(i, 7);983 vps->setMaxTidIlRefPicsPlus1(i, 7); 904 984 } 905 985 } … … 983 1063 #endif 984 1064 } 1065 #if IL_SL_SIGNALLING_N0371 1066 for(i = 1; i < vps->getMaxLayers(); i++) 1067 { 1068 for(Int j = 0; j < i; j++) 1069 { 1070 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) ); 1071 } 1072 } 1073 #endif 985 1074 #endif 986 1075 #if JCTVC_M0458_INTERLAYER_RPS_SIG 987 1076 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); 988 1077 #endif 1078 #if N0147_IRAP_ALIGN_FLAG 1079 vps->setCrossLayerIrapAlignFlag(true); 1080 for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1081 { 1082 for(Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) 1083 { 1084 if (vps->getDirectDependencyFlag( layerCtr, refLayerCtr)) 1085 { 1086 if(m_acTEncTop[layerCtr].getIntraPeriod() != m_acTEncTop[refLayerCtr].getIntraPeriod()) 1087 { 1088 vps->setCrossLayerIrapAlignFlag(false); 1089 break; 1090 } 1091 } 1092 } 1093 } 1094 1095 if( vps->getAvcBaseLayerFlag() ) 1096 { 1097 vps->setCrossLayerIrapAlignFlag(false); 1098 } 1099 #endif 989 1100 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 990 1101 vps->setSingleLayerForNonIrapFlag(m_adaptiveResolutionChange > 0 ? true : false); 991 1102 #endif 992 #else 993 m_cTEncTop.init(); 994 #endif 1103 #if VPS_EXTN_OFFSET 1104 // to be updated according to the current semantics 1105 vps->setExtensionOffset( 0xffff ); 1106 #endif 1107 #else //SVC_EXTENSION 1108 m_cTEncTop.init(isFieldCoding); 1109 #endif //SVC_EXTENSION 995 1110 } 996 1111 … … 1023 1138 xInitLibCfg(); 1024 1139 xCreateLib(); 1025 xInitLib( );1140 xInitLib(m_isField); 1026 1141 1027 1142 // main encoder loop … … 1035 1150 // allocate original YUV buffer 1036 1151 pcPicYuvOrg[layer] = new TComPicYuv; 1152 if( m_isField ) 1153 { 1037 1154 #if SVC_UPSAMPLING 1038 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1039 #else 1040 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1041 #endif 1155 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1156 #else 1157 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1158 #endif 1159 } 1160 else 1161 { 1162 #if SVC_UPSAMPLING 1163 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1164 #else 1165 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1166 #endif 1167 } 1042 1168 } 1043 1169 … … 1081 1207 m_iFrameRcvd++; 1082 1208 // check end of file 1083 bEos = (m_i FrameRcvd == m_framesToBeEncoded);1209 bEos = (m_isField && (m_iFrameRcvd == (m_framesToBeEncoded >> 1) )) || ( !m_isField && (m_iFrameRcvd == m_framesToBeEncoded) ); 1084 1210 } 1085 1211 1086 m_acTEncTop[layer].encodePrep( pcPicYuvOrg[layer] ); 1212 if ( m_isField ) 1213 { 1214 m_acTEncTop[layer].encodePrep( pcPicYuvOrg[layer], m_isTopFieldFirst ); 1215 } 1216 else 1217 { 1218 m_acTEncTop[layer].encodePrep( pcPicYuvOrg[layer] ); 1219 } 1087 1220 } 1088 1221 … … 1131 1264 { 1132 1265 // call encoding function for one frame 1133 m_acTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP ); 1266 if ( m_isField ) 1267 { 1268 m_acTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP, m_isTopFieldFirst ); 1269 } 1270 else 1271 { 1272 m_acTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP ); 1273 } 1134 1274 } 1135 1275 } … … 1168 1308 if (bEos) 1169 1309 { 1170 printOutSummary( );1310 printOutSummary(m_isTopFieldFirst); 1171 1311 } 1172 1312 … … 1200 1340 } 1201 1341 1202 Void TAppEncTop::printOutSummary( )1342 Void TAppEncTop::printOutSummary(Bool isField) 1203 1343 { 1204 1344 UInt layer; … … 1207 1347 for(layer = 0; layer < m_numLayers; layer++) 1208 1348 { 1209 m_gcAnalyzeAll[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate()); 1210 m_gcAnalyzeI[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1211 m_gcAnalyzeP[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1212 m_gcAnalyzeB[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1349 if(isField) 1350 { 1351 m_gcAnalyzeAll[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2); 1352 m_gcAnalyzeI[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2 ); 1353 m_gcAnalyzeP[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2 ); 1354 m_gcAnalyzeB[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2 ); 1355 } 1356 else 1357 { 1358 m_gcAnalyzeAll[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate()); 1359 m_gcAnalyzeI[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1360 m_gcAnalyzeP[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1361 m_gcAnalyzeB[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1362 } 1213 1363 } 1214 1364 … … 1241 1391 m_gcAnalyzeB[layer].printOut('b', layer); 1242 1392 } 1393 1394 if(isField) 1395 { 1396 for(layer = 0; layer < m_numLayers; layer++) 1397 { 1398 //-- interlaced summary 1399 m_gcAnalyzeAll_in.setFrmRate( m_acLayerCfg[layer].getFrameRate()); 1400 printf( "\n\nSUMMARY INTERLACED ---------------------------------------------\n" ); 1401 m_gcAnalyzeAll_in.printOutInterlaced('a', m_gcAnalyzeAll[layer].getBits()); 1402 1403 #if _SUMMARY_OUT_ 1404 m_gcAnalyzeAll_in.printSummaryOutInterlaced(); 1405 #endif 1406 } 1407 } 1243 1408 } 1244 1409 … … 1259 1424 xInitLibCfg(); 1260 1425 xCreateLib(); 1261 xInitLib( );1426 xInitLib(m_isField); 1262 1427 1263 1428 // main encoder loop … … 1268 1433 1269 1434 // allocate original YUV buffer 1270 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1435 if( m_isField ) 1436 { 1437 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeightOrg, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1438 } 1439 else 1440 { 1441 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1442 } 1271 1443 1272 1444 while ( !bEos ) … … 1281 1453 m_iFrameRcvd++; 1282 1454 1283 bEos = (m_iFrameRcvd == m_framesToBeEncoded); 1284 1455 bEos = (m_isField && (m_iFrameRcvd == (m_framesToBeEncoded >> 1) )) || ( !m_isField && (m_iFrameRcvd == m_framesToBeEncoded) ); 1285 1456 Bool flush = 0; 1286 1457 // if end of file (which is only detected on a read failure) flush the encoder of any queued pictures … … 1294 1465 1295 1466 // call encoding function for one frame 1467 if ( m_isField ) 1468 { 1469 m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded, m_isTopFieldFirst); 1470 } 1471 else 1472 { 1296 1473 m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded ); 1474 } 1297 1475 1298 1476 // write bistream to file if necessary … … 1304 1482 } 1305 1483 1306 m_cTEncTop.printSummary( );1484 m_cTEncTop.printSummary(m_isField); 1307 1485 1308 1486 // delete original YUV buffer … … 1378 1556 Void TAppEncTop::xWriteRecon(UInt layer, Int iNumEncoded) 1379 1557 { 1380 Int i; 1381 1382 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_acListPicYuvRec[layer].end(); 1383 1384 for ( i = 0; i < iNumEncoded; i++ ) 1385 { 1386 --iterPicYuvRec; 1387 } 1388 1389 for ( i = 0; i < iNumEncoded; i++ ) 1390 { 1391 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1558 if (m_isField) 1559 { 1560 //Reinterlace fields 1561 Int i; 1562 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_acListPicYuvRec[layer].end(); 1563 1564 for ( i = 0; i < iNumEncoded; i++ ) 1565 { 1566 --iterPicYuvRec; 1567 } 1568 1569 for ( i = 0; i < iNumEncoded/2; i++ ) 1570 { 1571 TComPicYuv* pcPicYuvRecTop = *(iterPicYuvRec++); 1572 TComPicYuv* pcPicYuvRecBottom = *(iterPicYuvRec++); 1573 1392 1574 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1393 if (!m_acLayerCfg[layer].getReconFile().empty() && pcPicYuvRec->isReconstructed()) 1394 #else 1395 if (!m_acLayerCfg[layer].getReconFile().empty()) 1396 #endif 1397 { 1398 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 1399 m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() ); 1575 if (!m_acLayerCfg[layer].getReconFile().empty() && pcPicYuvRecTop->isReconstructed() && pcPicYuvRecBottom->isReconstructed()) 1576 #else 1577 if (!m_acLayerCfg[layer].getReconFile().empty()) 1578 #endif 1579 { 1580 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom(), m_isTopFieldFirst ); 1581 } 1582 } 1583 } 1584 else 1585 { 1586 Int i; 1587 1588 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_acListPicYuvRec[layer].end(); 1589 1590 for ( i = 0; i < iNumEncoded; i++ ) 1591 { 1592 --iterPicYuvRec; 1593 } 1594 1595 for ( i = 0; i < iNumEncoded; i++ ) 1596 { 1597 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1598 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1599 if (!m_acLayerCfg[layer].getReconFile().empty() && pcPicYuvRec->isReconstructed()) 1600 #else 1601 if (!m_acLayerCfg[layer].getReconFile().empty()) 1602 #endif 1603 { 1604 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 1605 m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() ); 1606 } 1400 1607 } 1401 1608 } … … 1404 1611 Void TAppEncTop::xWriteStream(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits) 1405 1612 { 1406 Int i; 1407 1408 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1613 if (m_isField) 1614 { 1615 //Reinterlace fields 1616 Int i; 1617 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1409 1618 1410 1619 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1411 for ( i = 0; i < iNumEncoded && iterBitstream != accessUnits.end(); i++ ) 1412 #else 1413 for ( i = 0; i < iNumEncoded; i++ ) 1414 #endif 1415 { 1416 const AccessUnit& au = *(iterBitstream++); 1417 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 1418 rateStatsAccum(au, stats); 1620 for ( i = 0; i < iNumEncoded/2 && iterBitstream != accessUnits.end(); i++ ) 1621 #else 1622 for ( i = 0; i < iNumEncoded/2; i++ ) 1623 #endif 1624 { 1625 const AccessUnit& auTop = *(iterBitstream++); 1626 const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop); 1627 rateStatsAccum(auTop, statsTop); 1628 1629 const AccessUnit& auBottom = *(iterBitstream++); 1630 const vector<UInt>& statsBottom = writeAnnexB(bitstreamFile, auBottom); 1631 rateStatsAccum(auBottom, statsBottom); 1632 } 1633 } 1634 else 1635 { 1636 Int i; 1637 1638 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1639 1640 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1641 for ( i = 0; i < iNumEncoded && iterBitstream != accessUnits.end(); i++ ) 1642 #else 1643 for ( i = 0; i < iNumEncoded; i++ ) 1644 #endif 1645 { 1646 const AccessUnit& au = *(iterBitstream++); 1647 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 1648 rateStatsAccum(au, stats); 1649 } 1419 1650 } 1420 1651 } … … 1460 1691 Void TAppEncTop::xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits) 1461 1692 { 1462 Int i; 1463 1464 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1465 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1466 1467 for ( i = 0; i < iNumEncoded; i++ ) 1468 { 1469 --iterPicYuvRec; 1470 } 1471 1472 for ( i = 0; i < iNumEncoded; i++ ) 1473 { 1474 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1475 if (m_pchReconFile) 1476 { 1477 #if SYNTAX_OUTPUT && ILP_DECODED_PICTURE 1478 m_cTVideoIOYuvReconFile.write( pcPicYuvRec ); 1479 #else 1480 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 1481 #endif 1482 } 1483 1484 const AccessUnit& au = *(iterBitstream++); 1485 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 1486 rateStatsAccum(au, stats); 1693 if (m_isField) 1694 { 1695 //Reinterlace fields 1696 Int i; 1697 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1698 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1699 1700 for ( i = 0; i < iNumEncoded; i++ ) 1701 { 1702 --iterPicYuvRec; 1703 } 1704 1705 for ( i = 0; i < iNumEncoded/2; i++ ) 1706 { 1707 TComPicYuv* pcPicYuvRecTop = *(iterPicYuvRec++); 1708 TComPicYuv* pcPicYuvRecBottom = *(iterPicYuvRec++); 1709 1710 if (m_pchReconFile) 1711 { 1712 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confLeft, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst ); 1713 } 1714 1715 const AccessUnit& auTop = *(iterBitstream++); 1716 const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop); 1717 rateStatsAccum(auTop, statsTop); 1718 1719 const AccessUnit& auBottom = *(iterBitstream++); 1720 const vector<UInt>& statsBottom = writeAnnexB(bitstreamFile, auBottom); 1721 rateStatsAccum(auBottom, statsBottom); 1722 } 1723 } 1724 else 1725 { 1726 Int i; 1727 1728 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1729 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1730 1731 for ( i = 0; i < iNumEncoded; i++ ) 1732 { 1733 --iterPicYuvRec; 1734 } 1735 1736 for ( i = 0; i < iNumEncoded; i++ ) 1737 { 1738 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1739 if (m_pchReconFile) 1740 { 1741 #if SYNTAX_OUTPUT 1742 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 1743 #endif 1744 } 1745 1746 const AccessUnit& au = *(iterBitstream++); 1747 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 1748 rateStatsAccum(au, stats); 1749 } 1487 1750 } 1488 1751 } -
trunk/source/App/TAppEncoder/TAppEncTop.h
r313 r442 82 82 Void xCreateLib (); ///< create files & encoder class 83 83 Void xInitLibCfg (); ///< initialize internal variables 84 Void xInitLib ( );///< initialize encoder class84 Void xInitLib (Bool isFieldCoding); ///< initialize encoder class 85 85 Void xDestroyLib (); ///< destroy encoder class 86 86 … … 99 99 Void xWriteRecon(UInt layer, Int iNumEncoded); 100 100 Void xWriteStream(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits); 101 Void printOutSummary( );101 Void printOutSummary(Bool isField); 102 102 #else 103 103 Void xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits); ///< write bitstream to file -
trunk/source/Lib/TLibCommon/CommonDef.h
r352 r442 57 57 58 58 #if SVC_EXTENSION 59 #define NV_VERSION "3. 0.1" ///< Current software version60 #else 61 #define NV_VERSION "1 1.0" ///< Current software version59 #define NV_VERSION "3.1" ///< Current software version 60 #else 61 #define NV_VERSION "12.0" ///< Current software version 62 62 #endif 63 63 -
trunk/source/Lib/TLibCommon/SEI.h
r313 r442 75 75 LAYERS_PRESENT = 137, 76 76 #endif 77 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 78 INTER_LAYER_CONSTRAINED_TILE_SETS = 138 79 #endif 77 80 }; 78 81 … … 381 384 }; 382 385 386 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 387 class SEIInterLayerConstrainedTileSets : public SEI 388 { 389 public: 390 PayloadType payloadType() const { return INTER_LAYER_CONSTRAINED_TILE_SETS; } 391 392 SEIInterLayerConstrainedTileSets() {} 393 virtual ~SEIInterLayerConstrainedTileSets() {} 394 395 Bool m_ilAllTilesExactSampleValueMatchFlag; 396 Bool m_ilOneTilePerTileSetFlag; 397 UInt m_ilNumSetsInMessageMinus1; 398 Bool m_skippedTileSetPresentFlag; 399 UInt m_ilctsId[256]; 400 UInt m_ilNumTileRectsInSetMinus1[256]; 401 UInt m_ilTopLeftTileIndex[256][440]; 402 UInt m_ilBottomRightTileIndex[256][440]; 403 UInt m_ilcIdc[256]; 404 Bool m_ilExactSampleValueMatchFlag[256]; 405 UInt m_allTilesIlcIdc; 406 }; 407 #endif 408 409 383 410 typedef std::list<SEI*> SEIMessages; 384 411 -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r345 r442 1273 1273 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 1274 1274 1275 #if REPN_FORMAT_IN_VPS 1276 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getPicWidthInLumaSamples() ) 1277 #else 1275 1278 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) 1279 #endif 1276 1280 { 1277 1281 uiARPartUnitIdx = MAX_UINT; … … 1335 1339 UInt uiAbsZorderCUIdxLB = g_auiZscanToRaster[ m_uiAbsIdxInLCU ] + (m_puhHeight[0] / m_pcPic->getMinCUHeight() - 1)*m_pcPic->getNumPartInWidth(); 1336 1340 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 1337 1341 1342 #if REPN_FORMAT_IN_VPS 1343 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getPicHeightInLumaSamples() ) 1344 #else 1338 1345 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 1346 #endif 1339 1347 { 1340 1348 uiBLPartUnitIdx = MAX_UINT; … … 1384 1392 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 1385 1393 1394 #if REPN_FORMAT_IN_VPS 1395 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicHeightInLumaSamples()) 1396 #else 1386 1397 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples()) 1398 #endif 1387 1399 { 1388 1400 uiBLPartUnitIdx = MAX_UINT; … … 1432 1444 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 1433 1445 1446 #if REPN_FORMAT_IN_VPS 1447 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicWidthInLumaSamples() ) 1448 #else 1434 1449 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) 1450 #endif 1435 1451 { 1436 1452 uiARPartUnitIdx = MAX_UINT; … … 1703 1719 { 1704 1720 // check BL mode 1705 UInt uiCUAddrBase , uiAbsPartAddrBase;1721 UInt uiCUAddrBase = 0, uiAbsPartAddrBase = 0; 1706 1722 // the right reference layerIdc should be specified, currently it is set to m_layerId-1 1707 TComDataCU* pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase );1723 TComDataCU* pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 ); 1708 1724 1709 1725 if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA ) … … 2684 2700 Int uiLCUIdx = -1; 2685 2701 2702 #if REPN_FORMAT_IN_VPS 2703 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getPicWidthInLumaSamples() ) // image boundary check 2704 { 2705 } 2706 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getPicHeightInLumaSamples() ) 2707 { 2708 } 2709 #else 2686 2710 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 2687 2711 { … … 2690 2714 { 2691 2715 } 2716 #endif 2692 2717 else 2693 2718 { … … 3020 3045 uiAbsPartIdx = g_auiZscanToRaster[uiPartIdxRB]; 3021 3046 Int uiLCUIdx = -1; 3047 #if REPN_FORMAT_IN_VPS 3048 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdx] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getPicWidthInLumaSamples() ) // image boundary check 3049 { 3050 } 3051 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdx] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getPicHeightInLumaSamples() ) 3052 { 3053 } 3054 #else 3022 3055 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdx] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 3023 3056 { … … 3026 3059 { 3027 3060 } 3061 #endif 3028 3062 else 3029 3063 { … … 3095 3129 Int iMvShift = 2; 3096 3130 Int iOffset = 8; 3131 #if REPN_FORMAT_IN_VPS 3132 Int iHorMax = ( m_pcSlice->getPicWidthInLumaSamples() + iOffset - m_uiCUPelX - 1 ) << iMvShift; 3133 #else 3097 3134 Int iHorMax = ( m_pcSlice->getSPS()->getPicWidthInLumaSamples() + iOffset - m_uiCUPelX - 1 ) << iMvShift; 3135 #endif 3098 3136 Int iHorMin = ( -(Int)g_uiMaxCUWidth - iOffset - (Int)m_uiCUPelX + 1 ) << iMvShift; 3099 3137 3138 #if REPN_FORMAT_IN_VPS 3139 Int iVerMax = ( m_pcSlice->getPicHeightInLumaSamples() + iOffset - m_uiCUPelY - 1 ) << iMvShift; 3140 #else 3100 3141 Int iVerMax = ( m_pcSlice->getSPS()->getPicHeightInLumaSamples() + iOffset - m_uiCUPelY - 1 ) << iMvShift; 3142 #endif 3101 3143 Int iVerMin = ( -(Int)g_uiMaxCUHeight - iOffset - (Int)m_uiCUPelY + 1 ) << iMvShift; 3102 3144 … … 3946 3988 } 3947 3989 3948 #if SVC_COL_BLK 3949 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 3950 { 3951 #if 1 // it should provide identical resutls 3990 #if SVC_EXTENSION 3991 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping ) 3992 { 3952 3993 UInt uiPelX = getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 3953 3994 UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 3954 3995 3955 return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase ); 3956 #else 3957 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); 3958 3959 #if SVC_UPSAMPLING 3960 Int widthBL = cBaseColPic->getPicYuvRec()->getWidth () - cBaseColPic->getPicYuvRec()->getPicCropLeftOffset() - cBaseColPic->getPicYuvRec()->getPicCropRightOffset(); 3961 Int heightBL = cBaseColPic->getPicYuvRec()->getHeight() - cBaseColPic->getPicYuvRec()->getPicCropTopOffset() - cBaseColPic->getPicYuvRec()->getPicCropBottomOffset(); 3962 3963 Int widthEL = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset(); 3964 Int heightEL = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset(); 3965 #else 3966 Int widthBL = cBaseColPic->getPicYuvRec()->getWidth(); 3967 Int heightBL = cBaseColPic->getPicYuvRec()->getHeight(); 3968 3969 Int widthEL = m_pcPic->getPicYuvRec()->getWidth(); 3970 Int heightEL = m_pcPic->getPicYuvRec()->getHeight(); 3971 #endif 3972 3973 if (widthBL == widthEL && heightEL == heightBL) 3974 { 3975 uiAbsPartIdxBase = uiCuAbsPartIdx + m_uiAbsIdxInLCU; 3976 uiCUAddrBase = m_uiCUAddr; 3977 } 3978 else 3979 { 3980 UInt uiMinUnitSize = m_pcPic->getMinCUWidth(); 3981 UInt uiRasterAddr = g_auiZscanToRaster[uiCuAbsPartIdx]; 3982 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 3983 3984 Int iEX = m_uiCUPelX + uiMinUnitSize*(uiRasterAddr%uiNumPartInCUWidth); 3985 Int iEY = m_uiCUPelY + uiMinUnitSize*(uiRasterAddr/uiNumPartInCUWidth); 3986 3987 Int iBX = (iEX*widthBL + widthEL/2)/widthEL; 3988 Int iBY = (iEY*heightBL+ heightEL/2)/heightEL; 3989 3990 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth); 3991 3992 assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame()); 3993 3994 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth() 3995 + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize; 3996 3997 uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase]; 3998 } 3999 4000 return cBaseColPic->getCU(uiCUAddrBase); 4001 #endif 4002 } 4003 4004 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 3996 return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase, iMotionMapping ); 3997 } 3998 3999 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping ) 4005 4000 { 4006 4001 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(refLayerIdc); 4007 4008 #if !SIMPLIFIED_MV_POS_SCALING4009 #if SVC_UPSAMPLING && !ILP_DECODED_PICTURE4010 const Window &confBL = cBaseColPic->getPicYuvRec()->getConformanceWindow();4011 const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow();4012 4013 Int widthBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();4014 Int heightBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();4015 4016 Int widthEL = m_pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();4017 Int heightEL = m_pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();4018 #else4019 Int widthBL = cBaseColPic->getPicYuvRec()->getWidth();4020 Int heightBL = cBaseColPic->getPicYuvRec()->getHeight();4021 4022 Int widthEL = m_pcPic->getPicYuvRec()->getWidth();4023 Int heightEL = m_pcPic->getPicYuvRec()->getHeight();4024 #endif4025 #endif4026 4002 4027 4003 uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX); … … 4030 4006 UInt uiMinUnitSize = m_pcPic->getMinCUWidth(); 4031 4007 4032 #if SIMPLIFIED_MV_POS_SCALING4033 4008 #if SCALED_REF_LAYER_OFFSETS 4034 4009 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); … … 4040 4015 Int iBY = (uiPelY*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 4041 4016 #endif 4042 #else4043 Int iBX = (uiPelX*widthBL + widthEL/2)/widthEL;4044 Int iBY = (uiPelY*heightBL+ heightEL/2)/heightEL;4045 #endif4046 4017 4047 4018 #if N0139_POSITION_ROUNDING_OFFSET 4048 iBX += 4; 4049 iBY += 4; 4019 if( iMotionMapping == 1 ) 4020 { 4021 iBX += 4; 4022 iBY += 4; 4023 } 4050 4024 #endif 4051 4025 … … 4060 4034 } 4061 4035 4062 #if AVC_SYNTAX && !ILP_DECODED_PICTURE4063 #if !ILP_DECODED_PICTURE4064 const Window &confBL = cBaseColPic->getPicYuvRec()->getConformanceWindow();4065 const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow();4066 4067 Int widthBL = m_pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();4068 Int heightBL = m_pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();4069 #endif4070 if( iBX >= widthBL || iBY >= heightBL ) //outside of the reference layer cropped picture4071 {4072 return NULL;4073 }4074 #endif4075 4076 4036 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth); 4077 4037 … … 4090 4050 TComMvField cMvFieldBase; 4091 4051 TComMv cMv; 4092 #if SIMPLIFIED_MV_POS_SCALING 4052 4093 4053 cMv = rcMvFieldBase.getMv().scaleMv( g_mvScalingFactor[refLayerIdc][0], g_mvScalingFactor[refLayerIdc][1] ); 4094 #else4095 const Window &confBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();4096 const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow();4097 4098 Int widthBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();4099 Int heightBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();4100 4101 Int widthEL = m_pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();4102 Int heightEL = m_pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();4103 4104 Int iMvX = (rcMvFieldBase.getHor()*widthEL + (widthBL/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/widthBL;4105 Int iMvY = (rcMvFieldBase.getVer()*heightEL + (heightBL/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/heightBL;4106 4107 cMv.set(iMvX, iMvY);4108 #endif4109 4054 4110 4055 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); -
trunk/source/Lib/TLibCommon/TComDataCU.h
r345 r442 516 516 UInt& getTotalBins () { return m_uiTotalBins; } 517 517 518 #if REF_IDX_FRAMEWORK518 #if SVC_EXTENSION 519 519 #if FAST_INTRA_SHVC 520 520 Int reduceSetOfIntraModes ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes ); … … 538 538 UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); 539 539 540 #if REF_IDX_FRAMEWORK 541 #if SVC_COL_BLK 542 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 543 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 540 #if SVC_EXTENSION 541 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping = 0 ); 542 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping = 0 ); 544 543 Void scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ); 545 #endif546 544 #endif 547 545 }; -
trunk/source/Lib/TLibCommon/TComLoopFilter.cpp
r313 r442 180 180 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 181 181 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 182 #if REPN_FORMAT_IN_VPS 183 if( ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) ) 184 #else 182 185 if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 186 #endif 183 187 { 184 188 xDeblockCU( pcCU, uiAbsZorderIdx, uiDepth+1, Edge ); -
trunk/source/Lib/TLibCommon/TComMv.h
r313 r442 40 40 41 41 #include "CommonDef.h" 42 #include <cstdlib> 42 43 43 44 //! \ingroup TLibCommon … … 149 150 return TComMv( mvx, mvy ); 150 151 } 151 #if S IMPLIFIED_MV_POS_SCALING152 #if SVC_EXTENSION 152 153 const TComMv scaleMv( Int iScaleX, Int iScaleY ) const 153 154 { -
trunk/source/Lib/TLibCommon/TComPic.cpp
r313 r442 53 53 , m_bUsedByCurr (false) 54 54 , m_bIsLongTerm (false) 55 , m_bIsUsedAsLongTerm (false)56 55 , m_apcPicSym (NULL) 57 56 , m_pcPicYuvPred (NULL) … … 213 212 UInt maxNumSUInLCU = getNumPartInCU(); 214 213 UInt numLCUInPic = getNumCUsInFrame(); 214 #if REPN_FORMAT_IN_VPS 215 UInt picWidth = getSlice(0)->getPicWidthInLumaSamples(); 216 UInt picHeight = getSlice(0)->getPicHeightInLumaSamples(); 217 #else 215 218 UInt picWidth = getSlice(0)->getSPS()->getPicWidthInLumaSamples(); 216 219 UInt picHeight = getSlice(0)->getSPS()->getPicHeightInLumaSamples(); 220 #endif 217 221 Int numLCUsInPicWidth = getFrameWidthInCU(); 218 222 Int numLCUsInPicHeight= getFrameHeightInCU(); … … 524 528 } 525 529 526 #if REF_IDX_FRAMEWORK530 #if SVC_EXTENSION 527 531 Void copyOnetoOnePicture( // SVC_NONCOLL 528 532 Pel *in, … … 570 574 Void TComPic::copyUpsampledMvField(UInt refLayerIdc, TComPic* pcPicBase) 571 575 { 572 #if AVC_SYNTAX && !ILP_DECODED_PICTURE573 const Window &confBL = pcPicBase->getConformanceWindow();574 const Window &confEL = getPicYuvRec()->getConformanceWindow();575 576 Int widthBL = pcPicBase->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();577 Int heightBL = pcPicBase->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();578 579 Int widthEL = getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();580 Int heightEL = getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();581 #endif582 583 576 UInt numPartitions = 1<<(g_uiMaxCUDepth<<1); 584 577 UInt widthMinPU = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth); … … 598 591 599 592 TComDataCU *pcColCU = 0; 600 pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx); 601 602 #if AVC_SYNTAX && !ILP_DECODED_PICTURE 603 Int xBL = ( (pelX + 8) * widthBL + widthEL/2 ) / widthEL; 604 Int yBL = ( (pelY + 8) * heightBL+ heightEL/2 ) / heightEL; 605 606 if( ( xBL < widthBL && yBL < heightBL ) && pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 607 #else 593 pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx, 1); 594 608 595 if( pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 609 #endif610 596 { 611 597 for(UInt refPicList = 0; refPicList < 2; refPicList++) //for each reference list … … 670 656 } 671 657 672 #if ILP_DECODED_PICTURE673 658 UInt width = this->getPicYuvRec()->getWidth(); 674 659 UInt height = this->getPicYuvRec()->getHeight(); 675 #else 676 const Window &conf = this->getPicYuvRec()->getConformanceWindow(); 677 UInt width = this->getPicYuvRec()->getWidth() - conf.getWindowLeftOffset() - conf.getWindowRightOffset(); 678 UInt height = this->getPicYuvRec()->getHeight() - conf.getWindowTopOffset() - conf.getWindowBottomOffset(); 679 #endif 660 680 661 UInt64 poc = (UInt64)this->getPOC(); 681 662 UInt partWidth = width / 4; … … 754 735 } 755 736 756 #if ILP_DECODED_PICTURE757 737 UInt width = this->getPicYuvRec()->getWidth(); 758 738 UInt height = this->getPicYuvRec()->getHeight(); 759 #else760 const Window &conf = this->getConformanceWindow();761 UInt width = this->getPicYuvRec()->getWidth() - conf.getWindowLeftOffset() - conf.getWindowRightOffset();762 UInt height = this->getPicYuvRec()->getHeight() - conf.getWindowTopOffset() - conf.getWindowBottomOffset();763 #endif764 739 765 740 UInt64 poc = (UInt64)this->getPOC(); -
trunk/source/Lib/TLibCommon/TComPic.h
r313 r442 66 66 Bool m_bUsedByCurr; // Used by current picture 67 67 Bool m_bIsLongTerm; // IS long term picture 68 Bool m_bIsUsedAsLongTerm; // long term picture is used as reference before69 68 TComPicSym* m_apcPicSym; // Symbol 70 69 … … 88 87 Window m_defaultDisplayWindow; 89 88 89 Bool m_isTop; 90 Bool m_isField; 91 90 92 std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink; 91 93 … … 194 196 std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter (Int sliceID) { return m_vSliceCUDataLink[sliceID];} 195 197 198 /* field coding parameters*/ 199 200 Void setTopField(bool b) {m_isTop = b;} 201 Bool isTopField() {return m_isTop;} 202 Void setField(bool b) {m_isField = b;} 203 Bool isField() {return m_isField;} 204 196 205 /** transfer ownership of seis to this picture */ 197 206 void setSEIs(SEIMessages& seis) { m_SEIs = seis; } … … 207 216 const SEIMessages& getSEIs() const { return m_SEIs; } 208 217 209 #if REF_IDX_FRAMEWORK218 #if SVC_EXTENSION 210 219 Void copyUpsampledPictureYuv(TComPicYuv* pcPicYuvIn, TComPicYuv* pcPicYuvOut); 211 #endif212 220 #if AVC_SYNTAX 213 221 Void readBLSyntax( fstream* filestream, UInt numBytes ); 214 222 #endif 223 #endif 215 224 #if SYNTAX_OUTPUT 216 225 Void wrireBLSyntax( fstream* filestream, UInt numBytes ); -
trunk/source/Lib/TLibCommon/TComPicSym.cpp
r313 r442 61 61 ,m_uiNumAllocatedSlice (0) 62 62 ,m_apcTComDataCU (NULL) 63 ,m_iTileBoundaryIndependenceIdr (0)64 63 ,m_iNumColumnsMinus1 (0) 65 64 ,m_iNumRowsMinus1(0) … … 116 115 m_puiCUOrderMap = new UInt[m_uiNumCUsInFrame+1]; 117 116 m_puiTileIdxMap = new UInt[m_uiNumCUsInFrame]; 117 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 118 m_piTileSetIdxMap = new Int[m_uiNumCUsInFrame]; 119 m_pucTileSetType = new UChar[m_uiNumCUsInFrame]; 120 m_pbSkippedTileSetFlag = new Bool[m_uiNumCUsInFrame]; 121 #endif 118 122 m_puiInverseCUOrderMap = new UInt[m_uiNumCUsInFrame+1]; 119 123 … … 147 151 m_apcTComDataCU = NULL; 148 152 149 #if AVC_BASE || REF_IDX_FRAMEWORK153 #if SVC_EXTENSION 150 154 if( m_apcTComTile ) 151 155 { … … 156 160 } 157 161 delete [] m_apcTComTile; 158 #if AVC_BASE || REF_IDX_FRAMEWORK162 #if SVC_EXTENSION 159 163 } 160 164 #endif … … 167 171 delete [] m_puiTileIdxMap; 168 172 m_puiTileIdxMap = NULL; 173 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 174 delete [] m_piTileSetIdxMap; 175 m_piTileSetIdxMap = NULL; 176 delete [] m_pucTileSetType; 177 m_pucTileSetType = NULL; 178 delete [] m_pbSkippedTileSetFlag; 179 m_pbSkippedTileSetFlag = NULL; 180 #endif 169 181 170 182 delete [] m_puiInverseCUOrderMap; -
trunk/source/Lib/TLibCommon/TComPicSym.h
r313 r442 100 100 TComDataCU** m_apcTComDataCU; ///< array of CU data 101 101 102 Int m_iTileBoundaryIndependenceIdr;103 102 Int m_iNumColumnsMinus1; 104 103 Int m_iNumRowsMinus1; … … 106 105 UInt* m_puiCUOrderMap; //the map of LCU raster scan address relative to LCU encoding order 107 106 UInt* m_puiTileIdxMap; //the map of the tile index relative to LCU raster scan address 107 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 108 Int* m_piTileSetIdxMap; //the map of the tile set index relative to LCU raster scan address 109 UChar* m_pucTileSetType; 110 Bool* m_pbSkippedTileSetFlag; 111 #endif 108 112 UInt* m_puiInverseCUOrderMap; 109 113 … … 144 148 UInt getCUOrderMap( Int encCUOrder ) { return *(m_puiCUOrderMap + (encCUOrder>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : encCUOrder)); } 145 149 UInt getTileIdxMap( Int i ) { return *(m_puiTileIdxMap + i); } 150 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 151 Void setTileSetIdxMap( Int i, Int tileSetIdx, UChar setType, Bool skipFlag ) 152 { 153 m_piTileSetIdxMap[i] = tileSetIdx; 154 m_pucTileSetType[i] = setType; 155 m_pbSkippedTileSetFlag[i] = skipFlag; 156 } 157 Int getTileSetIdxMap( Int i ) { return *(m_piTileSetIdxMap + i); } 158 UChar getTileSetType( Int i ) { return *(m_pucTileSetType + i); } 159 Bool getSkippedTileSetFlag( Int i ) { return *(m_pbSkippedTileSetFlag + i); } 160 #endif 146 161 Void setInverseCUOrderMap( Int cuAddr, Int encCUOrder ) { *(m_puiInverseCUOrderMap + cuAddr) = encCUOrder; } 147 162 UInt getInverseCUOrderMap( Int cuAddr ) { return *(m_puiInverseCUOrderMap + (cuAddr>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : cuAddr)); } -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r345 r442 696 696 Int k, l, bottomLeft, topRight; 697 697 Int horPred; 698 Int leftColumn[MAX_CU_SIZE ], topRow[MAX_CU_SIZE], bottomRow[MAX_CU_SIZE], rightColumn[MAX_CU_SIZE];698 Int leftColumn[MAX_CU_SIZE+1], topRow[MAX_CU_SIZE+1], bottomRow[MAX_CU_SIZE], rightColumn[MAX_CU_SIZE]; 699 699 UInt blkSize = width; 700 700 UInt offset2D = width; -
trunk/source/Lib/TLibCommon/TComPrediction.h
r345 r442 118 118 Int getPredicBufHeight() { return m_iYuvExtHeight; } 119 119 120 #if REF_IDX_FRAMEWORK120 #if SVC_EXTENSION 121 121 #if SVC_UPSAMPLING 122 122 #if SCALED_REF_LAYER_OFFSETS -
trunk/source/Lib/TLibCommon/TComRdCost.h
r313 r442 116 116 private: 117 117 // for distortion 118 Int m_iBlkWidth;119 Int m_iBlkHeight;120 118 121 119 #if AMP_SAD -
trunk/source/Lib/TLibCommon/TComRom.cpp
r313 r442 55 55 ::memset( g_aucConvertToBit, -1, sizeof( g_aucConvertToBit ) ); 56 56 c=0; 57 for ( i=4; i< MAX_CU_SIZE; i*=2 )57 for ( i=4; i<=MAX_CU_SIZE; i*=2 ) 58 58 { 59 59 g_aucConvertToBit[ i ] = c; 60 60 c++; 61 61 } 62 g_aucConvertToBit[ i ] = c;63 62 64 63 c=2; … … 278 277 279 278 #if FAST_UDI_USE_MPM 280 const UChar g_aucIntraModeNumFast[ 7] =279 const UChar g_aucIntraModeNumFast[MAX_CU_DEPTH] = 281 280 { 282 281 3, // 2x2 … … 285 284 3, // 16x16 286 285 3, // 32x32 287 3, // 64x64 288 3 // 128x128 286 3 // 64x64 289 287 }; 290 288 #else // FAST_UDI_USE_MPM 291 const UChar g_aucIntraModeNumFast[ 7] =289 const UChar g_aucIntraModeNumFast[MAX_CU_DEPTH] = 292 290 { 293 291 3, // 2x2 … … 296 294 4, // 16x16 33 297 295 4, // 32x32 33 298 5, // 64x64 33 299 4 // 128x128 33 296 5 // 64x64 33 300 297 }; 301 298 #endif // FAST_UDI_USE_MPM … … 523 520 Int g_eTTable[4] = {0,3,1,2}; 524 521 525 #if S IMPLIFIED_MV_POS_SCALING522 #if SVC_EXTENSION 526 523 Int g_mvScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 527 524 Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 525 526 #if IL_SL_SIGNALLING_N0371 527 Int ref_scalingListDC [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; 528 Int ref_scalingListCoef [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][MAX_MATRIX_COEF_NUM]; 529 Int activeRefPPSId [MAX_LAYERS]; 530 Int activeRefSPSId [MAX_LAYERS]; 531 #endif 528 532 #endif 529 533 -
trunk/source/Lib/TLibCommon/TComRom.h
r313 r442 51 51 // ==================================================================================================================== 52 52 53 #define MAX_CU_DEPTH 7// log2(LCUSize)53 #define MAX_CU_DEPTH 6 // log2(LCUSize) 54 54 #define MAX_CU_SIZE (1<<(MAX_CU_DEPTH)) // maximum allowable size of CU 55 55 #define MIN_PU_SIZE 4 … … 131 131 // ==================================================================================================================== 132 132 133 extern const UChar g_aucIntraModeNumFast[ 7];133 extern const UChar g_aucIntraModeNumFast[ MAX_CU_DEPTH ]; 134 134 135 135 #if FAST_INTRA_SHVC … … 279 279 extern Int g_eTTable[4]; 280 280 281 #if S IMPLIFIED_MV_POS_SCALING281 #if SVC_EXTENSION 282 282 extern Int g_mvScalingFactor [MAX_LAYERS][2]; 283 283 extern Int g_posScalingFactor [MAX_LAYERS][2]; 284 285 #if IL_SL_SIGNALLING_N0371 286 extern Int ref_scalingListDC [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; 287 extern Int ref_scalingListCoef [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][MAX_MATRIX_COEF_NUM]; 288 extern Int activeRefPPSId [MAX_LAYERS]; 289 extern Int activeRefSPSId [MAX_LAYERS]; 290 #endif 284 291 #endif 285 292 -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r313 r442 1414 1414 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 1415 1415 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 1416 #if REPN_FORMAT_IN_VPS 1417 if( ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) ) 1418 #else 1416 1419 if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 1420 #endif 1417 1421 xPCMCURestoration( pcCU, uiAbsZorderIdx, uiDepth+1 ); 1418 1422 } -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r349 r442 46 46 47 47 #if SVC_EXTENSION 48 ParameterSetMap<TComVPS> ParameterSetManager::m_vpsMap(MAX_NUM_VPS); 49 Int ParameterSetManager::m_activeVPSId = -1; 48 ParameterSetMap<TComVPS> ParameterSetManager::m_vpsMap(MAX_NUM_VPS); 49 Int ParameterSetManager::m_activeVPSId = -1; 50 #if IL_SL_SIGNALLING_N0371 51 TComSPS* TComSPS::m_pcSPS[MAX_LAYERS]; 52 TComPPS* TComPPS::m_pcPPS[MAX_LAYERS]; 53 #endif 50 54 #endif 51 55 … … 71 75 , m_iDepth ( 0 ) 72 76 , m_bRefenced ( false ) 77 #if POC_RESET_FLAG 78 , m_bPocResetFlag ( false ) 79 #endif 73 80 #if SH_DISCARDABLE_FLAG 74 81 , m_bDiscardableFlag ( false ) … … 116 123 #if SVC_EXTENSION 117 124 memset( m_pcBaseColPic, 0, sizeof( m_pcBaseColPic ) ); 118 #if REF_IDX_FRAMEWORK119 125 #if JCTVC_M0458_INTERLAYER_RPS_SIG 120 126 m_activeNumILRRefIdx = 0; … … 133 139 #endif 134 140 #endif 135 #endif136 141 137 142 initEqualRef(); … … 168 173 #if SVC_EXTENSION 169 174 m_layerId = layerId; 170 #endif171 m_aiNumRefIdx[0] = 0;172 m_aiNumRefIdx[1] = 0;173 #if REF_IDX_FRAMEWORK174 175 #if JCTVC_M0458_INTERLAYER_RPS_SIG 175 176 m_activeNumILRRefIdx = 0; … … 177 178 #else 178 179 m_numILRRefIdx = 0; 179 #endif 180 #endif 180 181 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 181 182 m_numSamplePredRefLayers = 0; … … 183 184 #endif 184 185 #endif 186 m_aiNumRefIdx[0] = 0; 187 m_aiNumRefIdx[1] = 0; 188 185 189 m_colFromL0Flag = 1; 186 190 … … 273 277 pcPic = *(iterPic); 274 278 } 279 #if POC_RESET_FLAG 280 assert( pcPic->getSlice(0)->isReferenced() ); 281 #endif 275 282 return pcPic; 276 283 } … … 286 293 if (!pocHasMsb) 287 294 { 288 poc = poc % pocCycle;295 poc = poc & (pocCycle - 1); 289 296 } 290 297 … … 297 304 if (!pocHasMsb) 298 305 { 299 picPoc = picPoc % pocCycle;306 picPoc = picPoc & (pocCycle - 1); 300 307 } 301 308 … … 384 391 Int i; 385 392 386 #if REF_IDX_FRAMEWORK393 #if SVC_EXTENSION 387 394 if( m_layerId == 0 || ( m_layerId > 0 && ( m_activeNumILRRefIdx == 0 || !((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ) ) ) 388 395 { … … 439 446 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 440 447 } 441 #if REF_IDX_FRAMEWORK442 } 443 #endif 444 445 #if REF_IDX_FRAMEWORK448 #if SVC_EXTENSION 449 } 450 #endif 451 452 #if SVC_EXTENSION 446 453 for( i = 0; i < m_activeNumILRRefIdx; i++ ) 447 454 { … … 450 457 451 458 #if ILR_RESTR 452 Int max SubLayerForILPPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0;453 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<= max SubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) )459 Int maxTidIlRefPicsPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0; 460 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<= maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) ) 454 461 #else //#if ILR_RESTR 455 462 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 ) … … 477 484 TComPic* rpsCurrList0[MAX_NUM_REF+1]; 478 485 TComPic* rpsCurrList1[MAX_NUM_REF+1]; 479 #if REF_IDX_FRAMEWORK486 #if SVC_EXTENSION 480 487 #if ILR_RESTR 481 488 Int numInterLayerRPSPics = 0; … … 488 495 for( i=0; i < m_pcVPS->getNumDirectRefLayers( m_layerId ); i++ ) 489 496 { 490 Int max SubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId());491 if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<= max SubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag() ) )497 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[i]->getSlice(0)->getLayerId()); 498 if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<= maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag() ) ) 492 499 { 493 500 numInterLayerRPSPics++; … … 499 506 m_activeNumILRRefIdx = numInterLayerRPSPics; 500 507 } 501 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS && SIMPLIFIED_MV_POS_SCALING 508 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS 509 #if SCALABILITY_MASK_E0104 510 if( m_pcVPS->getScalabilityMask(2) ) 511 #else 502 512 if( m_pcVPS->getScalabilityMask(1) ) 513 #endif 503 514 { 504 515 Int numResampler = 0; 516 #if MOTION_RESAMPLING_CONSTRAINT 517 Int numMotionResamplers = 0; 518 Int refResamplingLayer[MAX_LAYERS]; 519 memset( refResamplingLayer, 0, sizeof( refResamplingLayer ) ); 520 #endif 505 521 const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); 506 522 Int scalingOffset = ((scalEL.getWindowLeftOffset() == 0 ) && … … 513 529 { 514 530 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 515 if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) && (scalingOffset)) // ratio 1x531 if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || (!scalingOffset)) // ratio 1x 516 532 { 533 #if MOTION_RESAMPLING_CONSTRAINT 534 UInt predType = m_pcVPS->getDirectDependencyType( m_layerId, m_pcVPS->getRefLayerId( m_layerId, refLayerIdc ) ) + 1; 535 536 if( predType & 0x1 ) 537 { 538 numResampler++; 539 refResamplingLayer[i] = refLayerIdc + 1; 540 } 541 542 if( predType & 0x2 ) 543 { 544 numMotionResamplers++; 545 refResamplingLayer[i] -= refLayerIdc + 1; 546 } 547 #else 517 548 numResampler++; 549 #endif 518 550 } 519 551 } 520 521 //Bitstream constraint for SHVC: The picture resampling process as specified in subclause G.8.1.4.1 shall not be invoked more than once for decoding of each particular picture. 552 553 // When both picture sample values and picture motion field resampling processes are invoked for decoding of a particular picture, they shall be applied to the same reference layer picture. 554 if( m_activeNumILRRefIdx > 1 && numResampler > 0 ) 555 { 556 for( i=0; i < m_activeNumILRRefIdx; i++ ) 557 { 558 assert( refResamplingLayer[i] >= 0 && "Motion and sample inter-layer prediction shall be from the same layer" ); 559 } 560 } 561 562 // Bitstream constraint for SHVC: The picture resampling process as specified in subclause G.8.1.4.1 shall not be invoked more than once for decoding of each particular picture. 522 563 assert(numResampler <= 1); 564 #if MOTION_RESAMPLING_CONSTRAINT 565 assert( numMotionResamplers <= 1 && "Up to 1 motion resampling is allowed" ); 566 #endif 523 567 } 524 568 #endif … … 584 628 rpsCurrList0[cIdx] = RefPicSetStCurr0[i]; 585 629 } 630 #if SVC_EXTENSION 586 631 #if RPL_INIT_N0316_N0082 587 #if REF_IDX_FRAMEWORK588 632 if( m_layerId > 0 ) 589 633 { … … 596 640 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 597 641 #if ILR_RESTR 598 Int max SubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());599 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=max SubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )642 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 643 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 600 644 #endif 601 645 rpsCurrList0[cIdx] = ilpPic[refLayerIdc]; … … 613 657 } 614 658 #if !RPL_INIT_N0316_N0082 615 #if REF_IDX_FRAMEWORK659 #if SVC_EXTENSION 616 660 if( m_layerId > 0 ) 617 661 { … … 624 668 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 625 669 #if ILR_RESTR 626 Int max SubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());627 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=max SubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )670 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 671 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 628 672 #endif 629 673 rpsCurrList0[cIdx] = ilpPic[refLayerIdc]; … … 650 694 } 651 695 652 #if REF_IDX_FRAMEWORK696 #if SVC_EXTENSION 653 697 if( m_layerId > 0 ) 654 698 { … … 661 705 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 662 706 #if ILR_RESTR 663 Int max SubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());664 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=max SubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )707 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 708 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 665 709 #endif 666 710 rpsCurrList1[cIdx] = ilpPic[refLayerIdc]; … … 680 724 m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ]; 681 725 #if RPL_INIT_N0316_N0082 682 m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 && cIdx < NumPocStCurr0 + m_activeNumILRRefIdx ) ;726 m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 && cIdx < NumPocStCurr0 + m_activeNumILRRefIdx ) || ( cIdx >= NumPocStCurr0 + NumPocStCurr1 + m_activeNumILRRefIdx ); 683 727 #else 684 728 m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 ); … … 702 746 } 703 747 704 #if REF_IDX_FRAMEWORK748 #if SVC_EXTENSION 705 749 Void TComSlice::setRefPicListModificationSvc() 706 750 { … … 721 765 #endif 722 766 767 #if N0147_IRAP_ALIGN_FLAG 768 assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 0); 769 assert(m_aiNumRefIdx[REF_PIC_LIST_1] > 0); 770 #else 723 771 assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 1); 724 772 assert(m_aiNumRefIdx[REF_PIC_LIST_1] > 1); 773 #endif 725 774 726 775 //set L0 inter-layer reference picture modification … … 729 778 #else 730 779 Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == numberOfRpsCurrTempList) ? false : true; 780 #endif 781 #if N0147_IRAP_ALIGN_FLAG 782 hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_0] > 1 ); 731 783 #endif 732 784 #if FINAL_RPL_CHANGE_N0082 … … 758 810 #if RPL_INIT_N0316_N0082 759 811 if((numberOfPocBeforeCurr) >= m_aiNumRefIdx[REF_PIC_LIST_0]) 812 { 760 813 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr); 814 } 761 815 else 762 816 { 763 817 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr); 764 818 for (Int j = numberOfPocBeforeCurr; j < (m_aiNumRefIdx[REF_PIC_LIST_0] - i); j++) 819 { 765 820 refPicListModification->setRefPicSetIdxL0(j, j + m_activeNumILRRefIdx); 821 } 766 822 } 767 823 #else … … 774 830 //set L1 inter-layer reference picture modification 775 831 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_1] == numberOfRpsCurrTempList) ? false : true; 832 #if N0147_IRAP_ALIGN_FLAG 833 hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_1] > 1 ); 834 #endif 835 776 836 refPicListModification->setRefPicListModificationFlagL1(hasModification); 777 837 if(hasModification) … … 828 888 Int numRpsCurrTempList = 0; 829 889 830 #if REF_IDX_FRAMEWORK890 #if SVC_EXTENSION 831 891 if( m_eSliceType == I_SLICE || ( m_pcSPS->getLayerId() && 832 892 (m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && … … 836 896 #endif 837 897 { 838 #if REF_IDX_FRAMEWORK898 #if SVC_EXTENSION 839 899 #if JCTVC_M0458_INTERLAYER_RPS_SIG 840 900 return m_activeNumILRRefIdx; … … 853 913 } 854 914 } 855 #if REF_IDX_FRAMEWORK915 #if SVC_EXTENSION 856 916 if( m_layerId > 0 ) 857 917 { … … 907 967 } 908 968 909 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic)969 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic) 910 970 { 911 971 for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++) … … 933 993 { 934 994 pocCRA = getPOC(); 935 prevRAPisBLA = false;995 associatedIRAPType = getNalUnitType(); 936 996 } 937 997 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found 938 998 { 939 999 pocCRA = getPOC(); 940 prevRAPisBLA = false;1000 associatedIRAPType = getNalUnitType(); 941 1001 } 942 1002 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP … … 945 1005 { 946 1006 pocCRA = getPOC(); 947 prevRAPisBLA = true;1007 associatedIRAPType = getNalUnitType(); 948 1008 } 949 1009 } … … 970 1030 { 971 1031 TComPic* rpcPic; 1032 setAssociatedIRAPPOC(pocCRA); 972 1033 Int pocCurr = getPOC(); 973 1034 … … 1076 1137 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; 1077 1138 memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) ); 1078 #elif REF_IDX_FRAMEWORK1079 m_numILRRefIdx = pSrc->m_numILRRefIdx;1080 1139 #endif 1081 1140 #endif … … 1138 1197 } 1139 1198 1140 Int TComSlice::m_prev POC = 0;1199 Int TComSlice::m_prevTid0POC = 0; 1141 1200 1142 1201 /** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag. … … 1193 1252 } 1194 1253 1254 1255 Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic) 1256 { 1257 TComPic* rpcPic; 1258 1259 Int nalUnitType = this->getNalUnitType(); 1260 1261 // When a picture is a leading picture, it shall be a RADL or RASL picture. 1262 if(this->getAssociatedIRAPPOC() > this->getPOC()) 1263 { 1264 // Do not check IRAP pictures since they may get a POC lower than their associated IRAP 1265 if(nalUnitType < NAL_UNIT_CODED_SLICE_BLA_W_LP || 1266 nalUnitType > NAL_UNIT_RESERVED_IRAP_VCL23) 1267 { 1268 assert(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1269 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || 1270 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1271 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); 1272 } 1273 } 1274 1275 // When a picture is a trailing picture, it shall not be a RADL or RASL picture. 1276 if(this->getAssociatedIRAPPOC() < this->getPOC()) 1277 { 1278 assert(nalUnitType != NAL_UNIT_CODED_SLICE_RASL_N && 1279 nalUnitType != NAL_UNIT_CODED_SLICE_RASL_R && 1280 nalUnitType != NAL_UNIT_CODED_SLICE_RADL_N && 1281 nalUnitType != NAL_UNIT_CODED_SLICE_RADL_R); 1282 } 1283 1284 // No RASL pictures shall be present in the bitstream that are associated 1285 // with a BLA picture having nal_unit_type equal to BLA_W_RADL or BLA_N_LP. 1286 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1287 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1288 { 1289 assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_W_RADL && 1290 this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_N_LP); 1291 } 1292 1293 // No RASL pictures shall be present in the bitstream that are associated with 1294 // an IDR picture. 1295 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1296 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1297 { 1298 assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_N_LP && 1299 this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL); 1300 } 1301 1302 // No RADL pictures shall be present in the bitstream that are associated with 1303 // a BLA picture having nal_unit_type equal to BLA_N_LP or that are associated 1304 // with an IDR picture having nal_unit_type equal to IDR_N_LP. 1305 if(nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1306 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R) 1307 { 1308 assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_N_LP && 1309 this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_N_LP); 1310 } 1311 1312 // loop through all pictures in the reference picture buffer 1313 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1314 while ( iterPic != rcListPic.end()) 1315 { 1316 rpcPic = *(iterPic++); 1317 if (rpcPic->getPOC() == this->getPOC()) 1318 { 1319 continue; 1320 } 1321 1322 // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture 1323 // in decoding order shall precede the IRAP picture in output order. 1324 // (Note that any picture following in output order would be present in the DPB) 1325 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1) 1326 { 1327 if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP || 1328 nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP || 1329 nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL || 1330 nalUnitType == NAL_UNIT_CODED_SLICE_CRA || 1331 nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP || 1332 nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL) 1333 { 1334 assert(rpcPic->getPOC() < this->getPOC()); 1335 } 1336 } 1337 1338 // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture 1339 // in decoding order shall precede any RADL picture associated with the IRAP 1340 // picture in output order. 1341 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1) 1342 { 1343 if((nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1344 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)) 1345 { 1346 // rpcPic precedes the IRAP in decoding order 1347 if(this->getAssociatedIRAPPOC() > rpcPic->getSlice(0)->getAssociatedIRAPPOC()) 1348 { 1349 // rpcPic must not be the IRAP picture 1350 if(this->getAssociatedIRAPPOC() != rpcPic->getPOC()) 1351 { 1352 assert(rpcPic->getPOC() < this->getPOC()); 1353 } 1354 } 1355 } 1356 } 1357 1358 // When a picture is a leading picture, it shall precede, in decoding order, 1359 // all trailing pictures that are associated with the same IRAP picture. 1360 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1361 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || 1362 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1363 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R) 1364 { 1365 if(rpcPic->getSlice(0)->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC()) 1366 { 1367 // rpcPic is a picture that preceded the leading in decoding order since it exist in the DPB 1368 // rpcPic would violate the constraint if it was a trailing picture 1369 assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC()); 1370 } 1371 } 1372 1373 // Any RASL picture associated with a CRA or BLA picture shall precede any 1374 // RADL picture associated with the CRA or BLA picture in output order 1375 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1376 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1377 { 1378 if((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP || 1379 this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_LP || 1380 this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL || 1381 this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) && 1382 this->getAssociatedIRAPPOC() == rpcPic->getSlice(0)->getAssociatedIRAPPOC()) 1383 { 1384 if(rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N || 1385 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R) 1386 { 1387 assert(rpcPic->getPOC() > this->getPOC()); 1388 } 1389 } 1390 } 1391 1392 // Any RASL picture associated with a CRA picture shall follow, in output 1393 // order, any IRAP picture that precedes the CRA picture in decoding order. 1394 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1395 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1396 { 1397 if(this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) 1398 { 1399 if(rpcPic->getSlice(0)->getPOC() < this->getAssociatedIRAPPOC() && 1400 (rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP || 1401 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP || 1402 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL || 1403 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || 1404 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || 1405 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)) 1406 { 1407 assert(this->getPOC() > rpcPic->getSlice(0)->getPOC()); 1408 } 1409 } 1410 } 1411 } 1412 } 1413 1195 1414 /** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet. 1196 1415 */ … … 1199 1418 TComPic* rpcPic; 1200 1419 Int i, isReference; 1420 1421 checkLeadingPictureRestrictions(rcListPic); 1201 1422 1202 1423 // loop through all pictures in the reference picture buffer … … 1235 1456 else 1236 1457 { 1237 if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) 1458 Int pocCycle = 1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1459 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC() & (pocCycle-1); 1460 Int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1); 1461 if(rpcPic->getIsLongTerm() && curPoc == refPoc) 1238 1462 { 1239 1463 isReference = 1; … … 1295 1519 else 1296 1520 { 1297 if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()) && rpcPic->getSlice(0)->isReferenced()) 1521 Int pocCycle = 1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1522 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC() & (pocCycle-1); 1523 Int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1); 1524 if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced()) 1298 1525 { 1299 1526 isAvailable = 1; … … 1314 1541 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 1315 1542 { 1316 curPoc = curPoc % pocCycle;1317 refPoc = refPoc % pocCycle;1543 curPoc = curPoc & (pocCycle - 1); 1544 refPoc = refPoc & (pocCycle - 1); 1318 1545 } 1319 1546 … … 1589 1816 } 1590 1817 1818 #if REPN_FORMAT_IN_VPS 1819 UInt TComSlice::getPicWidthInLumaSamples() 1820 { 1821 TComSPS *sps = getSPS(); 1822 TComVPS *vps = getVPS(); 1823 UInt retVal, layerId = getLayerId(); 1824 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1825 { 1826 retVal = sps->getPicWidthInLumaSamples(); 1827 } 1828 else 1829 { 1830 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getPicWidthVpsInLumaSamples(); 1831 } 1832 return retVal; 1833 } 1834 UInt TComSlice::getPicHeightInLumaSamples() 1835 { 1836 TComSPS *sps = getSPS(); 1837 TComVPS *vps = getVPS(); 1838 UInt retVal, layerId = getLayerId(); 1839 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1840 { 1841 retVal = sps->getPicHeightInLumaSamples(); 1842 } 1843 else 1844 { 1845 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getPicHeightVpsInLumaSamples(); 1846 } 1847 return retVal; 1848 } 1849 UInt TComSlice::getChromaFormatIdc() 1850 { 1851 TComSPS *sps = getSPS(); 1852 TComVPS *vps = getVPS(); 1853 UInt retVal, layerId = getLayerId(); 1854 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1855 { 1856 retVal = sps->getChromaFormatIdc(); 1857 } 1858 else 1859 { 1860 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getChromaFormatVpsIdc(); 1861 } 1862 return retVal; 1863 } 1864 UInt TComSlice::getBitDepthY() 1865 { 1866 TComSPS *sps = getSPS(); 1867 TComVPS *vps = getVPS(); 1868 UInt retVal, layerId = getLayerId(); 1869 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1870 { 1871 retVal = sps->getBitDepthY(); 1872 } 1873 else 1874 { 1875 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsLuma(); 1876 } 1877 return retVal; 1878 } 1879 UInt TComSlice::getBitDepthC() 1880 { 1881 TComSPS *sps = getSPS(); 1882 TComVPS *vps = getVPS(); 1883 UInt retVal, layerId = getLayerId(); 1884 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1885 { 1886 retVal = sps->getBitDepthC(); 1887 } 1888 else 1889 { 1890 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma(); 1891 } 1892 return retVal; 1893 } 1894 Int TComSlice::getQpBDOffsetY() 1895 { 1896 return (getBitDepthY() - 8) * 6; 1897 } 1898 Int TComSlice::getQpBDOffsetC() 1899 { 1900 return (getBitDepthC() - 8) * 6; 1901 } 1902 1903 RepFormat::RepFormat() 1904 : m_chromaFormatVpsIdc (0) 1905 , m_separateColourPlaneVpsFlag (false) 1906 , m_picWidthVpsInLumaSamples (0) 1907 , m_picHeightVpsInLumaSamples (0) 1908 , m_bitDepthVpsLuma (0) 1909 , m_bitDepthVpsChroma (0) 1910 {} 1911 #endif 1912 1591 1913 // ------------------------------------------------------------------------------------------------ 1592 1914 // Video parameter set (VPS) … … 1617 1939 , m_defaultOneTargetOutputLayerFlag (false) 1618 1940 #endif 1941 #if VPS_VUI_BITRATE_PICRATE 1942 , m_bitRatePresentVpsFlag (false) 1943 , m_picRatePresentVpsFlag (false) 1944 #endif 1945 #if REPN_FORMAT_IN_VPS 1946 , m_repFormatIdxPresentFlag (true) 1947 , m_vpsNumRepFormats (1) 1948 #endif 1949 #if VIEW_ID_RELATED_SIGNALING 1950 , m_viewIdLenMinus1 (0) 1951 #endif 1619 1952 { 1620 1953 for( Int i = 0; i < MAX_TLAYER; i++) … … 1665 1998 m_maxOneActiveRefLayerFlag = true; 1666 1999 #endif 2000 #if N0147_IRAP_ALIGN_FLAG 2001 m_crossLayerIrapAlignFlag = true; 2002 #endif 1667 2003 #if JCTVC_M0203_INTERLAYER_PRED_IDC 1668 2004 #if N0120_MAX_TID_REF_PRESENT_FLAG 1669 m_maxTid IlRefPicsPlus1PresentFlag = true;2005 m_maxTidRefPresentFlag = true; 1670 2006 #endif 1671 2007 for( Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++) 1672 2008 { 1673 m_maxSublayerForIlpPlus1[i] = m_uiMaxTLayers + 1; 1674 } 2009 m_maxTidIlRefPicsPlus1[i] = m_uiMaxTLayers + 1; 2010 } 2011 #endif 2012 #if TILE_BOUNDARY_ALIGNED_FLAG 2013 ::memset(m_tileBoundariesAlignedFlag, 0, sizeof(m_tileBoundariesAlignedFlag)); 2014 #endif 2015 #if N0160_VUI_EXT_ILP_REF 2016 m_numIlpRestrictedRefLayers = false; 2017 ::memset(m_minSpatialSegmentOffsetPlus1, 0, sizeof(m_minSpatialSegmentOffsetPlus1)); 2018 ::memset(m_ctuBasedOffsetEnabledFlag, 0, sizeof(m_ctuBasedOffsetEnabledFlag)); 2019 ::memset(m_minHorizontalCtuOffsetPlus1, 0, sizeof(m_minHorizontalCtuOffsetPlus1)); 2020 #endif 2021 #if VPS_VUI_BITRATE_PICRATE 2022 ::memset(m_bitRatePresentFlag, 0, sizeof(m_bitRatePresentFlag)); 2023 ::memset(m_picRatePresentFlag, 0, sizeof(m_picRatePresentFlag)); 2024 ::memset(m_avgBitRate , 0, sizeof(m_avgBitRate) ); 2025 ::memset(m_maxBitRate , 0, sizeof(m_maxBitRate) ); 2026 ::memset(m_constPicRateIdc , 0, sizeof(m_constPicRateIdc) ); 2027 ::memset(m_avgPicRate , 0, sizeof(m_avgPicRate) ); 2028 #endif 2029 #if REPN_FORMAT_IN_VPS 2030 ::memset( m_vpsRepFormatIdx, 0, sizeof(m_vpsRepFormatIdx) ); 2031 #endif 2032 #if VIEW_ID_RELATED_SIGNALING 2033 ::memset(m_viewIdVal, 0, sizeof(m_viewIdVal)); 1675 2034 #endif 1676 2035 } … … 1704 2063 setNumLayersInIdList(i, n); 1705 2064 } 2065 } 2066 #endif 2067 2068 #if IL_SL_SIGNALLING_N0371 2069 Bool TComVPS::checkLayerDependency(UInt i, UInt j) 2070 { 2071 if( this->getDirectDependencyFlag(i, j) == true ) 2072 { 2073 return true; 2074 } 2075 else 2076 { 2077 for(UInt k=i-1; k>j; k--) 2078 { 2079 if( this->getDirectDependencyFlag(i, k) == true ) 2080 { 2081 checkLayerDependency( k,j ); 2082 } 2083 } 2084 } 2085 return false; 2086 } 2087 #endif 2088 2089 #if VIEW_ID_RELATED_SIGNALING 2090 Int TComVPS::getNumViews() 2091 { 2092 Int numViews = 1; 2093 for( Int i = 0; i <= getMaxLayers() - 1; i++ ) 2094 { 2095 Int lId = getLayerIdInNuh( i ); 2096 if ( i > 0 && ( getViewIndex( lId ) != getScalabilityId( i - 1, VIEW_ORDER_INDEX ) ) ) 2097 { 2098 numViews++; 2099 } 2100 } 2101 2102 return numViews; 2103 } 2104 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType ) 2105 { 2106 return getScalabilityMask( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0; 2107 } 2108 Int TComVPS::scalTypeToScalIdx( ScalabilityType scalType ) 2109 { 2110 assert( scalType >= 0 && scalType <= MAX_VPS_NUM_SCALABILITY_TYPES ); 2111 assert( scalType == MAX_VPS_NUM_SCALABILITY_TYPES || getScalabilityMask( scalType ) ); 2112 Int scalIdx = 0; 2113 for( Int curScalType = 0; curScalType < scalType; curScalType++ ) 2114 { 2115 scalIdx += ( getScalabilityMask( curScalType ) ? 1 : 0 ); 2116 2117 } 2118 2119 return scalIdx; 1706 2120 } 1707 2121 #endif … … 1759 2173 , m_numScaledRefLayerOffsets (0) 1760 2174 #endif 2175 #if REPN_FORMAT_IN_VPS 2176 , m_updateRepFormatFlag (false) 2177 #endif 1761 2178 { 1762 2179 for ( Int i = 0; i < MAX_TLAYER; i++ ) … … 1802 2219 1803 2220 TimingInfo *timingInfo = vui->getTimingInfo(); 1804 timingInfo->setTimingInfoPresentFlag( true ); 1805 switch( frameRate ) 1806 { 1807 case 24: 1808 timingInfo->setNumUnitsInTick( 1125000 ); timingInfo->setTimeScale ( 27000000 ); 1809 break; 1810 case 25: 1811 timingInfo->setNumUnitsInTick( 1080000 ); timingInfo->setTimeScale ( 27000000 ); 1812 break; 1813 case 30: 1814 timingInfo->setNumUnitsInTick( 900900 ); timingInfo->setTimeScale ( 27000000 ); 1815 break; 1816 case 50: 1817 timingInfo->setNumUnitsInTick( 540000 ); timingInfo->setTimeScale ( 27000000 ); 1818 break; 1819 case 60: 1820 timingInfo->setNumUnitsInTick( 450450 ); timingInfo->setTimeScale ( 27000000 ); 1821 break; 1822 default: 1823 timingInfo->setNumUnitsInTick( 1001 ); timingInfo->setTimeScale ( 60000 ); 1824 break; 1825 } 1826 1827 Bool rateCnt = ( bitRate > 0 ); 1828 hrd->setNalHrdParametersPresentFlag( rateCnt ); 1829 hrd->setVclHrdParametersPresentFlag( rateCnt ); 1830 1831 hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) ); 1832 1833 if( hrd->getSubPicCpbParamsPresentFlag() ) 1834 { 1835 hrd->setTickDivisorMinus2( 100 - 2 ); // 1836 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 1837 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 1838 hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 ); // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay 2221 #if TIMING_INFO_NONZERO_LAYERID_SPS 2222 if( getLayerId() > 0 ) 2223 { 2224 timingInfo->setTimingInfoPresentFlag( false ); 1839 2225 } 1840 2226 else 1841 2227 { 1842 hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 1843 } 1844 1845 hrd->setBitRateScale( 4 ); // in units of 2~( 6 + 4 ) = 1,024 bps 1846 hrd->setCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 1847 hrd->setDuCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 2228 #endif 2229 timingInfo->setTimingInfoPresentFlag( true ); 2230 switch( frameRate ) 2231 { 2232 case 24: 2233 timingInfo->setNumUnitsInTick( 1125000 ); timingInfo->setTimeScale ( 27000000 ); 2234 break; 2235 case 25: 2236 timingInfo->setNumUnitsInTick( 1080000 ); timingInfo->setTimeScale ( 27000000 ); 2237 break; 2238 case 30: 2239 timingInfo->setNumUnitsInTick( 900900 ); timingInfo->setTimeScale ( 27000000 ); 2240 break; 2241 case 50: 2242 timingInfo->setNumUnitsInTick( 540000 ); timingInfo->setTimeScale ( 27000000 ); 2243 break; 2244 case 60: 2245 timingInfo->setNumUnitsInTick( 450450 ); timingInfo->setTimeScale ( 27000000 ); 2246 break; 2247 default: 2248 timingInfo->setNumUnitsInTick( 1001 ); timingInfo->setTimeScale ( 60000 ); 2249 break; 2250 } 2251 2252 Bool rateCnt = ( bitRate > 0 ); 2253 hrd->setNalHrdParametersPresentFlag( rateCnt ); 2254 hrd->setVclHrdParametersPresentFlag( rateCnt ); 2255 2256 hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) ); 2257 2258 if( hrd->getSubPicCpbParamsPresentFlag() ) 2259 { 2260 hrd->setTickDivisorMinus2( 100 - 2 ); // 2261 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 2262 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 2263 hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 ); // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay 2264 } 2265 else 2266 { 2267 hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 2268 } 2269 2270 hrd->setBitRateScale( 4 ); // in units of 2~( 6 + 4 ) = 1,024 bps 2271 hrd->setCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 2272 hrd->setDuCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 1848 2273 1849 hrd->setInitialCpbRemovalDelayLengthMinus1(15); // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit1850 if( randomAccess )1851 {1852 hrd->setCpbRemovalDelayLengthMinus1(5); // 32 = 2^5 (plus 1)1853 hrd->setDpbOutputDelayLengthMinus1 (5); // 32 + 3 = 2^61854 }1855 else1856 {1857 hrd->setCpbRemovalDelayLengthMinus1(9); // max. 2^101858 hrd->setDpbOutputDelayLengthMinus1 (9); // max. 2^101859 }2274 hrd->setInitialCpbRemovalDelayLengthMinus1(15); // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit 2275 if( randomAccess ) 2276 { 2277 hrd->setCpbRemovalDelayLengthMinus1(5); // 32 = 2^5 (plus 1) 2278 hrd->setDpbOutputDelayLengthMinus1 (5); // 32 + 3 = 2^6 2279 } 2280 else 2281 { 2282 hrd->setCpbRemovalDelayLengthMinus1(9); // max. 2^10 2283 hrd->setDpbOutputDelayLengthMinus1 (9); // max. 2^10 2284 } 1860 2285 1861 2286 /* 1862 Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported.2287 Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported. 1863 2288 */ 1864 Int i, j; 1865 UInt birateValue, cpbSizeValue; 1866 UInt ducpbSizeValue; 1867 UInt duBitRateValue = 0; 1868 1869 for( i = 0; i < MAX_TLAYER; i ++ ) 1870 { 1871 hrd->setFixedPicRateFlag( i, 1 ); 1872 hrd->setPicDurationInTcMinus1( i, 0 ); 1873 hrd->setLowDelayHrdFlag( i, 0 ); 1874 hrd->setCpbCntMinus1( i, 0 ); 1875 1876 birateValue = bitRate; 1877 cpbSizeValue = bitRate; // 1 second 1878 ducpbSizeValue = bitRate/numDU; 1879 duBitRateValue = bitRate; 1880 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 1881 { 1882 hrd->setBitRateValueMinus1( i, j, 0, ( birateValue - 1 ) ); 1883 hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) ); 1884 hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) ); 1885 hrd->setCbrFlag( i, j, 0, ( j == 0 ) ); 1886 1887 hrd->setBitRateValueMinus1( i, j, 1, ( birateValue - 1) ); 1888 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 1889 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 1890 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 1891 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 1892 } 1893 } 2289 Int i, j; 2290 UInt birateValue, cpbSizeValue; 2291 UInt ducpbSizeValue; 2292 UInt duBitRateValue = 0; 2293 2294 for( i = 0; i < MAX_TLAYER; i ++ ) 2295 { 2296 hrd->setFixedPicRateFlag( i, 1 ); 2297 hrd->setPicDurationInTcMinus1( i, 0 ); 2298 hrd->setLowDelayHrdFlag( i, 0 ); 2299 hrd->setCpbCntMinus1( i, 0 ); 2300 2301 birateValue = bitRate; 2302 cpbSizeValue = bitRate; // 1 second 2303 ducpbSizeValue = bitRate/numDU; 2304 duBitRateValue = bitRate; 2305 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 2306 { 2307 hrd->setBitRateValueMinus1( i, j, 0, ( birateValue - 1 ) ); 2308 hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) ); 2309 hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) ); 2310 hrd->setCbrFlag( i, j, 0, ( j == 0 ) ); 2311 2312 hrd->setBitRateValueMinus1( i, j, 1, ( birateValue - 1) ); 2313 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 2314 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 2315 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 2316 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 2317 } 2318 } 2319 #if TIMING_INFO_NONZERO_LAYERID_SPS 2320 } 2321 #endif 1894 2322 } 1895 2323 const Int TComSPS::m_winUnitX[]={1,2,2,1}; … … 2152 2580 TComScalingList::TComScalingList() 2153 2581 { 2154 m_useTransformSkip = false;2155 2582 init(); 2156 2583 } 2584 2157 2585 TComScalingList::~TComScalingList() 2158 2586 { … … 2162 2590 /** set default quantization matrix to array 2163 2591 */ 2592 #if IL_SL_SIGNALLING_N0371 2593 Void TComSlice::setDefaultScalingList( UInt layerId ) 2594 #else 2164 2595 Void TComSlice::setDefaultScalingList() 2596 #endif 2165 2597 { 2166 2598 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2168 2600 for(UInt listId=0;listId<g_scalingListNum[sizeId];listId++) 2169 2601 { 2602 #if IL_SL_SIGNALLING_N0371 2603 getScalingList()->processDefaultMarix(sizeId, listId, layerId); 2604 #else 2170 2605 getScalingList()->processDefaultMarix(sizeId, listId); 2606 #endif 2171 2607 } 2172 2608 } … … 2343 2779 * \param Index of input matrix 2344 2780 */ 2781 #if IL_SL_SIGNALLING_N0371 2782 Void TComScalingList::processDefaultMarix(UInt sizeId, UInt listId, UInt layerId) 2783 #else 2345 2784 Void TComScalingList::processDefaultMarix(UInt sizeId, UInt listId) 2346 { 2785 #endif 2786 { 2787 #if IL_SL_SIGNALLING_N0371 2788 Int i,coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]); 2789 UInt* scan = (sizeId == 0) ? g_auiSigLastScan [ SCAN_DIAG ] [ 1 ] : g_sigLastScanCG32x32; 2790 Int *src = getScalingListDefaultAddress(sizeId, listId); 2791 #endif 2792 2347 2793 ::memcpy(getScalingListAddress(sizeId, listId),getScalingListDefaultAddress(sizeId,listId),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 2794 2795 #if IL_SL_SIGNALLING_N0371 2796 for(i = 0; i < coefNum; i++) 2797 { 2798 ref_scalingListCoef[layerId][sizeId][listId][i] = src[scan[i]]; 2799 } 2800 #endif 2801 2348 2802 setScalingListDC(sizeId,listId,SCALING_LIST_DC); 2803 #if IL_SL_SIGNALLING_N0371 2804 ref_scalingListDC[layerId][sizeId][listId] = SCALING_LIST_DC; 2805 #endif 2349 2806 } 2350 2807 2351 2808 /** check DC value of matrix for default matrix signaling 2352 2809 */ 2810 #if IL_SL_SIGNALLING_N0371 2811 Void TComScalingList::checkDcOfMatrix( UInt layerId ) 2812 #else 2353 2813 Void TComScalingList::checkDcOfMatrix() 2814 #endif 2354 2815 { 2355 2816 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2360 2821 if(getScalingListDC(sizeId,listId) == 0) 2361 2822 { 2823 #if IL_SL_SIGNALLING_N0371 2824 processDefaultMarix(sizeId, listId, layerId); 2825 #else 2362 2826 processDefaultMarix(sizeId, listId); 2827 #endif 2363 2828 } 2364 2829 } … … 2441 2906 m_activeVPSId = vpsId; 2442 2907 m_activeSPSId = spsId; 2908 2909 #if IL_SL_SIGNALLING_N0371 2910 activeRefPPSId[ sps->getLayerId() ] = ppsId; 2911 activeRefSPSId[ sps->getLayerId() ] = spsId; 2912 #endif 2913 2443 2914 return true; 2444 2915 } … … 2554 3025 return; 2555 3026 } 3027 #if POC_RESET_FLAG 3028 if( this->getPocResetFlag() ) 3029 { 3030 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, 0)); 3031 } 3032 else 3033 { 3034 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 3035 } 3036 #else 2556 3037 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 3038 #endif 2557 3039 } 2558 3040 #endif … … 2568 3050 //set reference picture POC of each ILP reference 2569 3051 Int thePoc = ilpPic[refLayerIdc]->getPOC(); 2570 assert(thePoc >= 0); 3052 assert(thePoc >= 0); 2571 3053 assert(thePoc == pcRefPicBL->getPOC()); 2572 3054 -
trunk/source/Lib/TLibCommon/TComSlice.h
r345 r442 156 156 Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } 157 157 Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } 158 Bool getUseTransformSkip () { return m_useTransformSkip; } 159 Void setUseTransformSkip (Bool b) { m_useTransformSkip = b; } 158 159 #if IL_SL_SIGNALLING_N0371 160 UInt m_layerId; 161 162 Void setPredScalingListFlag (Bool b) { m_predScalingListFlag = b; } 163 Bool getPredScalingListFlag () { return m_predScalingListFlag; } 164 Void setScalingListRefLayerId (UInt b) { m_scalingListRefLayerId = b; } 165 UInt getScalingListRefLayerId () { return m_scalingListRefLayerId; } 166 #endif 167 160 168 Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient 161 169 Bool checkPredMode (UInt sizeId, UInt listId); … … 163 171 UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID 164 172 Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient 173 174 #if IL_SL_SIGNALLING_N0371 175 Void processDefaultMarix (UInt sizeId, UInt listId, UInt layerId ); 176 #else 165 177 Void processDefaultMarix (UInt sizeId, UInt listId); 178 #endif 179 166 180 Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value 167 181 168 182 Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value 183 184 #if IL_SL_SIGNALLING_N0371 185 Void setLayerId(UInt layerId) { m_layerId = layerId; } 186 UInt getLayerId() { return m_layerId; } 187 Void checkDcOfMatrix ( UInt m_layerId ); 188 #else 169 189 Void checkDcOfMatrix (); 190 #endif 191 170 192 Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); 171 193 Bool xParseScalingList (Char* pchFile); … … 178 200 UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID 179 201 Bool m_scalingListPresentFlag; //!< flag for using default matrix 202 203 #if IL_SL_SIGNALLING_N0371 204 Bool m_predScalingListFlag; //!< flag for inter-layer scaling-list prediction 205 UInt m_scalingListRefLayerId; //!< scaling_list_ref_layer_id 206 #endif 207 180 208 UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index 181 Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix 182 Bool m_useTransformSkip; //!< transform skipping flag for setting default scaling matrix for 4x4 209 Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix 183 210 }; 184 211 … … 406 433 }; 407 434 435 #if REPN_FORMAT_IN_VPS 436 class RepFormat 437 { 438 Int m_chromaFormatVpsIdc; 439 Bool m_separateColourPlaneVpsFlag; 440 Int m_picWidthVpsInLumaSamples; 441 Int m_picHeightVpsInLumaSamples; 442 Int m_bitDepthVpsLuma; // coded as minus8 443 Int m_bitDepthVpsChroma; // coded as minus8 444 445 public: 446 RepFormat(); 447 448 Int getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } 449 Void setChromaFormatVpsIdc(Int x) { m_chromaFormatVpsIdc = x; } 450 451 Bool getSeparateColourPlaneVpsFlag() { return m_separateColourPlaneVpsFlag; } 452 Void setSeparateColourPlaneVpsFlag(Bool x) { m_separateColourPlaneVpsFlag = x; } 453 454 Int getPicWidthVpsInLumaSamples() { return m_picWidthVpsInLumaSamples; } 455 Void setPicWidthVpsInLumaSamples(Int x) { m_picWidthVpsInLumaSamples = x; } 456 457 Int getPicHeightVpsInLumaSamples() { return m_picHeightVpsInLumaSamples; } 458 Void setPicHeightVpsInLumaSamples(Int x) { m_picHeightVpsInLumaSamples = x; } 459 460 Int getBitDepthVpsLuma() { return m_bitDepthVpsLuma; } 461 Void setBitDepthVpsLuma(Int x) { m_bitDepthVpsLuma = x; } 462 463 Int getBitDepthVpsChroma() { return m_bitDepthVpsChroma; } 464 Void setBitDepthVpsChroma(Int x) { m_bitDepthVpsChroma = x; } 465 }; 466 #endif 408 467 class TComVPS 409 468 { … … 436 495 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 437 496 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 497 #endif 498 #if IL_SL_SIGNALLING_N0371 499 Bool m_scalingListLayerDependency[MAX_LAYERS][MAX_LAYERS]; // layer dependency for scaling list 500 #endif 501 #if VPS_EXTN_OFFSET 502 UInt m_extensionOffset; 438 503 #endif 439 504 TComPTL m_pcPTL; … … 491 556 Bool m_maxOneActiveRefLayerFlag; 492 557 #endif 558 #if N0147_IRAP_ALIGN_FLAG 559 Bool m_crossLayerIrapAlignFlag; 560 #endif 493 561 #if JCTVC_M0203_INTERLAYER_PRED_IDC 494 UInt m_max SublayerForIlpPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1];562 UInt m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1]; 495 563 #endif 496 564 #if N0120_MAX_TID_REF_PRESENT_FLAG 497 Bool m_maxTid IlRefPicsPlus1PresentFlag;565 Bool m_maxTidRefPresentFlag; 498 566 #endif 499 567 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 500 568 Bool m_singleLayerForNonIrapFlag; 569 #endif 570 #if TILE_BOUNDARY_ALIGNED_FLAG 571 Bool m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 572 #endif 573 #if N0160_VUI_EXT_ILP_REF 574 Bool m_numIlpRestrictedRefLayers; 575 Int m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 576 Bool m_ctuBasedOffsetEnabledFlag [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 577 Int m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 578 #endif 579 #if VPS_VUI_BITRATE_PICRATE 580 Bool m_bitRatePresentVpsFlag; 581 Bool m_picRatePresentVpsFlag; 582 Bool m_bitRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 583 Bool m_picRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 584 Int m_avgBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 585 Int m_maxBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 586 Int m_constPicRateIdc [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 587 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 588 #endif 589 #if REPN_FORMAT_IN_VPS 590 Bool m_repFormatIdxPresentFlag; 591 Int m_vpsNumRepFormats; // coded as minus1 592 RepFormat m_vpsRepFormat[16]; 593 Int m_vpsRepFormatIdx[16]; 594 #endif 595 #if VIEW_ID_RELATED_SIGNALING 596 Int m_viewIdLenMinus1; 597 Int m_viewIdVal [MAX_LAYERS]; 501 598 #endif 502 599 public: … … 565 662 Void deriveLayerIdListVariables(); 566 663 #endif 664 665 #if IL_SL_SIGNALLING_N0371 666 Bool checkLayerDependency(UInt i, UInt j); 667 Bool getScalingListLayerDependency ( UInt layerId, UInt refLayerId ) { return m_scalingListLayerDependency[layerId][refLayerId]; } 668 Void setScalingListLayerDependency ( UInt layerId, UInt refLayerId, Bool val ) { m_scalingListLayerDependency[layerId][refLayerId] = val; } 669 #endif 670 567 671 TComPTL* getPTL() { return &m_pcPTL; } 568 672 TimingInfo* getTimingInfo() { return &m_timingInfo; } … … 659 763 Void setMaxOneActiveRefLayerFlag(Bool x) { m_maxOneActiveRefLayerFlag = x; } 660 764 #endif 765 #if N0147_IRAP_ALIGN_FLAG 766 Bool getCrossLayerIrapAlignFlag() { return m_crossLayerIrapAlignFlag; } 767 Void setCrossLayerIrapAlignFlag(Bool x) { m_crossLayerIrapAlignFlag = x; } 768 #endif 661 769 #if JCTVC_M0203_INTERLAYER_PRED_IDC 662 Bool getMaxSublayerForIlpPlus1(Int layerId) { return m_maxSublayerForIlpPlus1[layerId]; }663 Void setMax SublayerForIlpPlus1(Int layerId, UInt maxSublayer) { m_maxSublayerForIlpPlus1[layerId] = maxSublayer; }770 UInt getMaxTidIlRefPicsPlus1(Int layerId) { return m_maxTidIlRefPicsPlus1[layerId]; } 771 Void setMaxTidIlRefPicsPlus1(Int layerId, UInt maxSublayer) { m_maxTidIlRefPicsPlus1[layerId] = maxSublayer; } 664 772 #endif 665 773 #if N0120_MAX_TID_REF_PRESENT_FLAG 666 Bool getMaxTid IlRefPicsPlus1PresentFlag() { return m_maxTidIlRefPicsPlus1PresentFlag ;}667 Void setMaxTid IlRefPicsPlus1PresentFlag(Bool x) { m_maxTidIlRefPicsPlus1PresentFlag = x;}774 Bool getMaxTidRefPresentFlag() { return m_maxTidRefPresentFlag ;} 775 Void setMaxTidRefPresentFlag(Bool x) { m_maxTidRefPresentFlag = x;} 668 776 #endif 669 777 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 670 778 Bool getSingleLayerForNonIrapFlag() { return m_singleLayerForNonIrapFlag; } 671 779 Void setSingleLayerForNonIrapFlag(Bool x) { m_singleLayerForNonIrapFlag = x; } 780 #endif 781 #if TILE_BOUNDARY_ALIGNED_FLAG 782 Bool getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId) { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; } 783 Void setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x) { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x; } 784 #endif 785 #if N0160_VUI_EXT_ILP_REF 786 Bool getNumIlpRestrictedRefLayers ( ) { return m_numIlpRestrictedRefLayers ;} 787 Void setNumIlpRestrictedRefLayers ( Int val ) { m_numIlpRestrictedRefLayers = val;} 788 789 Int getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId ) { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];} 790 Void setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val ) { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val;} 791 792 Bool getCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId ) { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];} 793 Void setCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;} 794 795 Int getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId ) { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];} 796 Void setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val ) { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val;} 797 #endif 798 #if VPS_VUI_BITRATE_PICRATE 799 Bool getBitRatePresentVpsFlag() { return m_bitRatePresentVpsFlag; } 800 Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x; } 801 Bool getPicRatePresentVpsFlag() { return m_picRatePresentVpsFlag; } 802 Void setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x; } 803 804 Bool getBitRatePresentFlag(Int i, Int j) { return m_bitRatePresentFlag[i][j]; } 805 Void setBitRatePresentFlag(Int i, Int j, Bool x) { m_bitRatePresentFlag[i][j] = x; } 806 Bool getPicRatePresentFlag(Int i, Int j) { return m_picRatePresentFlag[i][j]; } 807 Void setPicRatePresentFlag(Int i, Int j, Bool x) { m_picRatePresentFlag[i][j] = x; } 808 809 Int getAvgBitRate(Int i, Int j) { return m_avgBitRate[i][j]; } 810 Void setAvgBitRate(Int i, Int j, Int x) { m_avgBitRate[i][j] = x; } 811 Int getMaxBitRate(Int i, Int j) { return m_maxBitRate[i][j]; } 812 Void setMaxBitRate(Int i, Int j, Int x) { m_maxBitRate[i][j] = x; } 813 814 Int getConstPicRateIdc(Int i, Int j) { return m_constPicRateIdc[i][j]; } 815 Void setConstPicRateIdc(Int i, Int j, Int x) { m_constPicRateIdc[i][j] = x; } 816 Int getAvgPicRate(Int i, Int j) { return m_avgPicRate[i][j]; } 817 Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x; } 818 #endif 819 820 #if REPN_FORMAT_IN_VPS 821 Bool getRepFormatIdxPresentFlag() { return m_repFormatIdxPresentFlag; } 822 Void setRepFormatIdxPresentFlag(Bool x) { m_repFormatIdxPresentFlag = x; } 823 824 Int getVpsNumRepFormats() { return m_vpsNumRepFormats; } 825 Void setVpsNumRepFormats(Int x) { m_vpsNumRepFormats = x; } 826 827 RepFormat* getVpsRepFormat(Int idx) { return &m_vpsRepFormat[idx]; } 828 829 Int getVpsRepFormatIdx(Int idx) { return m_vpsRepFormatIdx[idx]; } 830 Void setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x; } 831 #endif 832 #if VIEW_ID_RELATED_SIGNALING 833 Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val; } 834 Int getViewIdLenMinus1( ) { return m_viewIdLenMinus1; } 835 836 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } 837 Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } 838 Int getScalabilityId(Int, ScalabilityType scalType ); 839 840 Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } 841 842 Int getNumViews(); 843 Int scalTypeToScalIdx( ScalabilityType scalType ); 844 #endif 845 #if VPS_EXTN_OFFSET 846 Int getExtensionOffset() { return m_extensionOffset; } 847 Void setExtensionOffset( UInt offset ) { m_extensionOffset = offset; } 672 848 #endif 673 849 }; … … 951 1127 Bool m_scalingListEnabledFlag; 952 1128 Bool m_scalingListPresentFlag; 1129 953 1130 TComScalingList* m_scalingList; //!< ScalingList class pointer 1131 954 1132 UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; 955 1133 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) … … 975 1153 #if SVC_EXTENSION 976 1154 UInt m_layerId; 1155 1156 #if IL_SL_SIGNALLING_N0371 1157 TComVPS* m_pVPS; 1158 static TComSPS* m_pcSPS[MAX_LAYERS]; 1159 Bool m_predScalingListFlag; 1160 UInt m_scalingListRefLayerId; 1161 #endif 1162 977 1163 #endif 978 1164 #if REF_IDX_MFM … … 984 1170 UInt m_numScaledRefLayerOffsets; 985 1171 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1172 #endif 1173 #if REPN_FORMAT_IN_VPS 1174 Bool m_updateRepFormatFlag; 986 1175 #endif 987 1176 public: … … 1094 1283 Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } 1095 1284 Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } 1285 1286 #if IL_SL_SIGNALLING_N0371 1287 Bool getPredScalingListFlag() { return m_predScalingListFlag; } 1288 Void setPredScalingListFlag( Bool b ) { m_predScalingListFlag = b; } 1289 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; } 1290 Void setScalingListRefLayerId( UInt b ) { m_scalingListRefLayerId = b; } 1291 1292 TComVPS* getVPS() { return m_pVPS; } 1293 Void setVPS( TComVPS* vps ) { m_pVPS = vps; } 1294 static TComSPS* getSPS(UInt layerId) { return m_pcSPS[layerId]; } 1295 static Void setSPS(UInt layerId, TComSPS* sps) { m_pcSPS[layerId] = sps; } 1296 #endif 1297 1096 1298 Void setScalingList ( TComScalingList *scalingList); 1097 1299 TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS 1300 1098 1301 UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } 1099 1302 Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } … … 1142 1345 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 1143 1346 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 1347 #endif 1348 #if REPN_FORMAT_IN_VPS 1349 Bool getUpdateRepFormatFlag() { return m_updateRepFormatFlag; } 1350 Void setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x; } 1144 1351 #endif 1145 1352 }; … … 1225 1432 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1226 1433 Bool m_scalingListPresentFlag; 1434 1435 #if SVC_EXTENSION 1436 UInt m_layerId; 1437 1438 #if IL_SL_SIGNALLING_N0371 1439 static TComPPS* m_pcPPS[MAX_LAYERS]; 1440 Bool m_predScalingListFlag; 1441 UInt m_scalingListRefLayerId; 1442 #endif 1443 1444 #endif 1445 1227 1446 TComScalingList* m_scalingList; //!< ScalingList class pointer 1447 1228 1448 Bool m_listsModificationPresentFlag; 1229 1449 UInt m_log2ParallelMergeLevelMinus2; … … 1339 1559 Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } 1340 1560 Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } 1561 1562 #if IL_SL_SIGNALLING_N0371 1563 Void setLayerId(UInt layerId) { m_layerId = layerId; } 1564 UInt getLayerId() { return m_layerId; } 1565 1566 Bool getPredScalingListFlag() { return m_predScalingListFlag; } 1567 Void setPredScalingListFlag( Bool b ) { m_predScalingListFlag = b; } 1568 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; } 1569 Void setScalingListRefLayerId( UInt b ) { m_scalingListRefLayerId = b; } 1570 1571 static TComPPS* getPPS(UInt layerId) { return m_pcPPS[layerId]; } 1572 static Void setPPS(UInt layerId, TComPPS* pps) { m_pcPPS[layerId] = pps; } 1573 #endif 1574 1341 1575 Void setScalingList ( TComScalingList *scalingList); 1342 1576 TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS … … 1384 1618 Int m_iPOC; 1385 1619 Int m_iLastIDR; 1386 static Int m_prevPOC; 1620 Int m_iAssociatedIRAP; 1621 NalUnitType m_iAssociatedIRAPType; 1622 static Int m_prevTid0POC; 1387 1623 TComReferencePictureSet *m_pcRPS; 1388 1624 TComReferencePictureSet m_LocalRPS; … … 1404 1640 Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_ID_PLUS1]; 1405 1641 #else 1406 #if REF_IDX_FRAMEWORK1642 #if SVC_EXTENSION 1407 1643 Int m_numILRRefIdx; //< for inter-layer reference picture ser 1408 1644 #endif … … 1429 1665 Bool m_bRefenced; 1430 1666 1667 #if POC_RESET_FLAG 1668 Bool m_bPocResetFlag; 1669 Int m_pocValueBeforeReset; 1670 #endif 1431 1671 #if SH_DISCARDABLE_FLAG 1432 1672 Bool m_bDiscardableFlag; 1433 1673 #endif 1434 1435 1674 // access channel 1436 1675 TComVPS* m_pcVPS; … … 1460 1699 TComPic* m_pcBaseColPic[MAX_LAYERS]; 1461 1700 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; 1462 #if REF_IDX_FRAMEWORK &&M0457_COL_PICTURE_SIGNALING1701 #if M0457_COL_PICTURE_SIGNALING 1463 1702 Int m_numMotionPredRefLayers; 1464 1703 #if REF_IDX_MFM … … 1542 1781 Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } 1543 1782 Int getRPSidx () { return m_iBDidx; } 1544 Int getPrev POC () { return m_prevPOC; }1783 Int getPrevTid0POC () { return m_prevTid0POC; } 1545 1784 TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } 1546 1785 Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } 1547 1786 Int getLastIDR() { return m_iLastIDR; } 1787 Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } 1788 Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } 1789 Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } 1790 NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } 1548 1791 SliceType getSliceType () { return m_eSliceType; } 1549 1792 Int getPOC () { return m_iPOC; } … … 1571 1814 Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); 1572 1815 Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } 1816 Void setIsUsedAsLongTerm (Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } 1573 1817 Bool getCheckLDC () { return m_bCheckLDC; } 1574 1818 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } … … 1580 1824 Void setReferenced(Bool b) { m_bRefenced = b; } 1581 1825 Bool isReferenced() { return m_bRefenced; } 1582 Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } 1826 Bool isReferenceNalu() { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); } 1827 Void setPOC ( Int i ) { m_iPOC = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} } 1583 1828 Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } 1584 1829 NalUnitType getNalUnitType () const { return m_eNalUnitType; } … … 1591 1836 #endif 1592 1837 1838 #if POC_RESET_FLAG 1839 Bool getPocResetFlag () { return m_bPocResetFlag; } 1840 Void setPocResetFlag (Bool b) { m_bPocResetFlag = b; } 1841 Int getPocValueBeforeReset () { return m_pocValueBeforeReset; } 1842 Void setPocValueBeforeReset (Int x) { m_pocValueBeforeReset = x ; } 1843 #endif 1593 1844 #if SH_DISCARDABLE_FLAG 1594 1845 Bool getDiscardableFlag () { return m_bDiscardableFlag; } … … 1596 1847 #endif 1597 1848 1598 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic);1849 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 1599 1850 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); 1600 1851 Void setSliceType ( SliceType e ) { m_eSliceType = e; } … … 1665 1916 Void setTLayerInfo( UInt uiTLayer ); 1666 1917 Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 1918 Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); 1667 1919 Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); 1668 1920 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); … … 1731 1983 Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } 1732 1984 TComScalingList* getScalingList () { return m_scalingList; } 1985 1986 #if IL_SL_SIGNALLING_N0371 1987 Void setDefaultScalingList ( UInt m_layerId ); 1988 #else 1733 1989 Void setDefaultScalingList (); 1990 #endif 1991 1734 1992 Bool checkDefaultScalingList (); 1735 1993 Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag … … 1761 2019 #endif 1762 2020 1763 #if REF_IDX_FRAMEWORK1764 2021 Void setRefPicListModificationSvc(); 1765 2022 Int getNumILRRefIdx ( ) { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } … … 1789 2046 #endif 1790 2047 1791 #if REF_IDX_FRAMEWORK &&M0457_COL_PICTURE_SIGNALING2048 #if M0457_COL_PICTURE_SIGNALING 1792 2049 Void setNumMotionPredRefLayers(int i) { m_numMotionPredRefLayers = i; } 1793 2050 Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } … … 1806 2063 #endif 1807 2064 1808 #else1809 // temporal solution for IntraBL. Only one reference layer is supported.1810 Int getActiveNumILRRefIdx ( ) { return 1; }1811 Int getInterLayerPredLayerIdc (UInt layerIdx) { return m_layerId - 1;}1812 Void setActiveNumILRRefIdx ( Int i ) {}1813 Void setInterLayerPredEnabledFlag( Bool val ) {}1814 #endif1815 1816 2065 TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } 1817 2066 1818 2067 #endif //SVC_EXTENSION 1819 2068 2069 #if REPN_FORMAT_IN_VPS 2070 UInt getPicWidthInLumaSamples(); 2071 UInt getPicHeightInLumaSamples(); 2072 UInt getChromaFormatIdc(); 2073 UInt getBitDepthY(); 2074 UInt getBitDepthC(); 2075 Int getQpBDOffsetY(); 2076 Int getQpBDOffsetC(); 2077 #endif 1820 2078 protected: 1821 2079 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, -
trunk/source/Lib/TLibCommon/TComTrQuant.cpp
r345 r442 42 42 #include "TComPic.h" 43 43 #include "ContextTables.h" 44 44 #define MAYBE_BUGFIX 1 45 45 typedef struct 46 46 { … … 50 50 Double d64SigCost; 51 51 Double d64SigCost_0; 52 #if MAYBE_BUGFIX 53 Void init() 54 { 55 iNNZbeforePos0 = 0; 56 d64CodedLevelandDist = 0; 57 d64UncodedDist = 0; 58 d64SigCost = 0; 59 d64SigCost_0 = 0; 60 } 61 #endif 52 62 } coeffGroupRDStats; 53 63 … … 1033 1043 1034 1044 Int qpScaled; 1045 #if REPN_FORMAT_IN_VPS 1046 Int qpBDOffset = (eTType == TEXT_LUMA)? pcCU->getSlice()->getQpBDOffsetY() : pcCU->getSlice()->getQpBDOffsetC(); 1047 #else 1035 1048 Int qpBDOffset = (eTType == TEXT_LUMA)? pcCU->getSlice()->getSPS()->getQpBDOffsetY() : pcCU->getSlice()->getSPS()->getQpBDOffsetC(); 1049 #endif 1036 1050 1037 1051 if(eTType == TEXT_LUMA) … … 1581 1595 UInt uiCGPosY = uiCGBlkPos / uiNumBlkSide; 1582 1596 UInt uiCGPosX = uiCGBlkPos - (uiCGPosY * uiNumBlkSide); 1597 #if MAYBE_BUGFIX 1598 rdStats.init(); 1599 #else 1583 1600 ::memset( &rdStats, 0, sizeof (coeffGroupRDStats)); 1584 1601 #endif 1585 1602 const Int patternSigCtx = TComTrQuant::calcPatternSigCtx(uiSigCoeffGroupFlag, uiCGPosX, uiCGPosY, uiWidth, uiHeight); 1586 1603 for (Int iScanPosinCG = uiCGSize-1; iScanPosinCG >= 0; iScanPosinCG--) … … 2477 2494 /** set flat matrix value to quantized coefficient 2478 2495 */ 2496 #if IL_SL_SIGNALLING_N0371 2497 Void TComTrQuant::setFlatScalingList( UInt m_layerId ) 2498 #else 2479 2499 Void TComTrQuant::setFlatScalingList() 2500 #endif 2480 2501 { 2481 2502 UInt size,list; … … 2486 2507 for(list = 0; list < g_scalingListNum[size]; list++) 2487 2508 { 2509 #if IL_SL_SIGNALLING_N0371 2510 ref_scalingListDC[m_layerId][size][list] = SCALING_LIST_DC; 2511 for(UInt i=0; i<MAX_MATRIX_COEF_NUM; i++) 2512 { 2513 ref_scalingListCoef[m_layerId][size][list][i] = SCALING_LIST_DC; 2514 } 2515 #endif 2516 2488 2517 for(qp=0;qp<SCALING_LIST_REM_NUM;qp++) 2489 2518 { -
trunk/source/Lib/TLibCommon/TComTrQuant.h
r313 r442 181 181 Void setUseScalingList ( Bool bUseScalingList){ m_scalingListEnabledFlag = bUseScalingList; }; 182 182 Bool getUseScalingList (){ return m_scalingListEnabledFlag; }; 183 184 #if IL_SL_SIGNALLING_N0371 185 Void setFlatScalingList ( UInt m_layerId ); 186 #else 183 187 Void setFlatScalingList (); 188 #endif 189 184 190 Void xsetFlatScalingList ( UInt list, UInt size, UInt qp); 185 191 Void xSetScalingListEnc ( TComScalingList *scalingList, UInt list, UInt size, UInt qp); -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r345 r442 151 151 Pel* piDstV; 152 152 153 #if SIMPLIFIED_MV_POS_SCALING154 153 Int scaleX = g_posScalingFactor[refLayerIdc][0]; 155 154 Int scaleY = g_posScalingFactor[refLayerIdc][1]; 156 #else157 Int scaleX = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;158 Int scaleY = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;159 #endif160 155 161 156 if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x 162 157 { 163 piSrcY = piSrcBufY - scalEL.getWindowLeftOffset() - scalEL.getWindowTopOffset() * strideEL;164 piDstY = piDstBufY ;165 for( i = 0; i < height EL; i++ )158 piSrcY = piSrcBufY; 159 piDstY = piDstBufY + scalEL.getWindowLeftOffset() + scalEL.getWindowTopOffset() * strideEL; 160 for( i = 0; i < heightBL; i++ ) 166 161 { 167 162 memcpy( piDstY, piSrcY, sizeof(Pel) * widthBL ); … … 179 174 strideEL = pcUsPic->getCStride(); 180 175 181 piSrcU = piSrcBufU - ( scalEL.getWindowLeftOffset() >> 1 ) - ( scalEL.getWindowTopOffset() >> 1 ) * strideEL;182 piSrcV = piSrcBufV - ( scalEL.getWindowLeftOffset() >> 1 ) - ( scalEL.getWindowTopOffset() >> 1 ) * strideEL;183 184 piDstU = piDstBufU ;185 piDstV = piDstBufV ;186 187 for( i = 0; i < height EL; i++ )176 piSrcU = piSrcBufU; 177 piSrcV = piSrcBufV; 178 179 piDstU = piDstBufU + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL; 180 piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL; 181 182 for( i = 0; i < heightBL; i++ ) 188 183 { 189 184 memcpy( piDstU, piSrcU, sizeof(Pel) * widthBL ); … … 238 233 Int shiftYM4 = shiftY - 4; 239 234 240 #if ILP_DECODED_PICTURE241 235 widthEL = pcUsPic->getWidth (); 242 236 heightEL = pcUsPic->getHeight(); … … 244 238 widthBL = pcBasePic->getWidth (); 245 239 heightBL = min<Int>( pcBasePic->getHeight(), heightEL ); 246 #endif247 240 #if SCALED_REF_LAYER_OFFSETS 248 241 Int leftStartL = scalEL.getWindowLeftOffset(); … … 395 388 } 396 389 397 #if ILP_DECODED_PICTURE398 390 #if SCALED_REF_LAYER_OFFSETS 399 391 widthBL = pcBasePic->getWidth (); … … 408 400 widthEL = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 409 401 heightEL = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 410 #endif411 402 #endif 412 403 … … 451 442 shiftYM4 = shiftY - 4; 452 443 453 #if !SIMPLIFIED_MV_POS_SCALING454 scaleX = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;455 scaleY = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;456 #endif457 458 #if ILP_DECODED_PICTURE459 444 widthEL = pcUsPic->getWidth () >> 1; 460 445 heightEL = pcUsPic->getHeight() >> 1; … … 462 447 widthBL = pcBasePic->getWidth () >> 1; 463 448 heightBL = min<Int>( pcBasePic->getHeight() >> 1, heightEL ); 464 #endif465 449 466 450 #if N0214_INTERMEDIATE_BUFFER_16BITS … … 639 623 #endif 640 624 } 641 625 } 642 626 pcUsPic->setBorderExtension(false); 643 627 pcUsPic->extendPicBorder (); // extend the border. … … 647 631 pcTempPic->setBorderExtension(false); 648 632 pcBasePic->setBorderExtension(false); 649 }650 633 } 651 634 #endif //SVC_EXTENSION -
trunk/source/Lib/TLibCommon/TComWeightPrediction.h
r313 r442 53 53 class TComWeightPrediction 54 54 { 55 wpScalingParam m_wp0[3], m_wp1[3];56 57 55 public: 58 56 TComWeightPrediction(); -
trunk/source/Lib/TLibCommon/TypeDef.h
r345 r442 41 41 #define SVC_EXTENSION 1 42 42 43 #define N0139_POSITION_ROUNDING_OFFSET 144 45 43 #define SYNTAX_BYTES 10 ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)] 46 44 45 #define RANDOM_ACCESS_SEI_FIX 1 47 46 #if SVC_EXTENSION 47 #define VPS_NUH_LAYER_ID 1 ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0 48 48 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle 49 #define RPL_INIT_N0316_N0082 1 ///< N0316, N0082: initial reference picture list construction 50 #define FINAL_RPL_CHANGE_N0082 1 ///< N0082: final ref picture list change (encoder) 51 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 1 ///< VUI flag to indicate tile boundary alignment 52 #define M0463_VUI_EXT_ILP_REF 1 ///< VUI extension inter-layer dependency offset signalling 49 #define POC_RESET_FLAG 1 ///< JCTVC-N0244: POC reset flag for layer pictures. 50 #define ALIGN_TSA_STSA_PICS 1 ///< JCTVC-N0084: Alignment of TSA and STSA pictures across AU. 51 #define REPN_FORMAT_IN_VPS 1 ///< JCTVC-N0092: Signal represenation format (spatial resolution, bit depth, colour format) in the VPS 52 #define TIMING_INFO_NONZERO_LAYERID_SPS 1 ///< JCTVC-N0085: Semantics of vui_timing_info_present_flag to always set that flag to zero for non-zero layer ID SPS 53 #define RPL_INIT_N0316_N0082 1 ///< JCTVC-N0316, JCTVC-N0082: initial reference picture list construction 54 #define FINAL_RPL_CHANGE_N0082 1 ///< JCTVC-N0082: final ref picture list change (encoder) 55 #if FINAL_RPL_CHANGE_N0082 56 #define EXTERNAL_USEDBYCURR_N0082 1 ///< JCTVC-N0082: final ref picture list change (encoder) //dev ver. 57 #define TEMP_SCALABILITY_FIX 1 ///< fix for temporal scalability 58 #endif 59 #define IL_SL_SIGNALLING_N0371 0 ///< JCTVC-N0371: inter-layer scaling list 60 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 0 ///< JCTVC-M0464: VUI flag to indicate tile boundary alignment 61 #define M0463_VUI_EXT_ILP_REF 0 ///< JCTVC-M0463: VUI extension inter-layer dependency offset signalling 53 62 #define SPS_EXTENSION 1 ///< Define sps_extension() syntax structure 54 #define SCALED_REF_LAYER_OFFSET_FLAG 0 ///< M0309: Signal scaled reference layer offsets in SPS 55 #define SCALED_REF_LAYER_OFFSETS 1 ///< M0309: Signal scaled reference layer offsets in SPS 63 #define SCALED_REF_LAYER_OFFSETS 1 ///< JCTVC-M0309: Signal scaled reference layer offsets in SPS 64 #define VERT_MV_CONSTRAINT 1 ///< Vertical MV component constraint flag 65 #define SCALABILITY_MASK_E0104 1 ///< JCT3V-E0104: scalability mask for depth 56 66 57 67 #define ILP_SSH_SIG 1 ///< JCTVC-N0195 proposal 2, JCTVC-N0118: add presence flag in VPS ext to condition inter-layer prediction signaling in slice segment header … … 66 76 #define VPS_EXTN_PROFILE_INFO 1 ///< Include profile information for layer sets in VPS extension 67 77 #define VPS_EXTN_DIRECT_REF_LAYERS 1 ///< Include indication of direct dependency of layers in VPS extension 68 #define VPS_OUTPUT_LAYER_SET_IDX 1 ///< M0268: Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i]69 #define VPS_MOVE_DIR_DEPENDENCY_FLAG 1 ///< M0268: Move the syntax element direct_dependency_flag to follow the syntax element dimension_id70 #define VPS_PROFILE_OUTPUT_LAYERS 1 ///< M0268: Signal profile information and output layer information as in Sec. 3 of M0268v271 #define SPS_SUB_LAYER_INFO 1 ///< M0268: Do not signal sps_max_sub_layers_minus1 and sps_temporal_id_nesting_flag for nuh_layer_id greater than 072 #define VPS_SPLIT_FLAG 1 ///< M0163: Do not signal dimension_id and the last dimension_id_len_minus1, when splitting_flag is equal to 1.78 #define VPS_OUTPUT_LAYER_SET_IDX 1 ///< JCTVC-M0268: Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i] 79 #define VPS_MOVE_DIR_DEPENDENCY_FLAG 1 ///< JCTVC-M0268: Move the syntax element direct_dependency_flag to follow the syntax element dimension_id 80 #define VPS_PROFILE_OUTPUT_LAYERS 1 ///< JCTVC-M0268: Signal profile information and output layer information as in Sec. 3 of M0268v2 81 #define SPS_SUB_LAYER_INFO 1 ///< JCTVC-M0268: Do not signal sps_max_sub_layers_minus1 and sps_temporal_id_nesting_flag for nuh_layer_id greater than 0 82 #define VPS_SPLIT_FLAG 1 ///< JCTVC-M0163: Do not signal dimension_id and the last dimension_id_len_minus1, when splitting_flag is equal to 1. 73 83 #define M0457_PREDICTION_INDICATIONS 1 74 84 #define M0040_ADAPTIVE_RESOLUTION_CHANGE 1 75 #endif 76 77 #define SH_DISCARDABLE_FLAG 1 ///< M0152: Use one reserved flag in the slice header for discardable flag 85 #define VPS_VUI 1 ///< Include function structure for VPS VUI 86 87 #if VPS_VUI 88 #define TILE_BOUNDARY_ALIGNED_FLAG 1 ///< JCTVC-N0160/JCTVC-N0199 proposal 2 variant 2: VPS VUI flag to indicate tile boundary alignment 89 #define N0160_VUI_EXT_ILP_REF 1 ///< VUI extension inter-layer dependency offset signalling 90 #define VPS_VUI_BITRATE_PICRATE 1 ///< JCTVC-N0085: Signal bit rate and picture in VPS VUI 91 #else 92 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 0 ///< VUI flag to indicate tile boundary alignment 93 #endif //VPS_VUI 94 95 #endif 96 97 #define VPS_EXTN_OFFSET 1 ///< implementation of vps_extension_offset syntax element 98 #define SPS_PTL_FIX 1 ///< remove profile_tier_level from enhancement layer SPS 99 #define SH_DISCARDABLE_FLAG 1 ///< JCTVC-M0152: Use one reserved flag in the slice header for discardable flag 78 100 79 101 #define DERIVE_LAYER_ID_LIST_VARIABLES 1 ///< Derived variables based on the variables in VPS - for use in syntax table parsing 80 102 81 #define SVC_COL_BLK 1 ///< get co-located block82 103 #define SVC_UPSAMPLING 1 ///< upsampling filters 83 104 #define ROUNDING_OFFSET 1 ///< JCTVC-N0111: upsampling rounding offset using scalling factors 84 #define N0214_INTERMEDIATE_BUFFER_16BITS 1 ///< JCTVC-N0214 support base layer input more than 8 bits105 #define N0214_INTERMEDIATE_BUFFER_16BITS 1 ///< JCTVC-N0214: support base layer input more than 8 bits 85 106 #define ARBITRARY_SPATIAL_RATIO 0 ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio 86 107 #define BUGFIX_RESAMPLE 1 ///< JCTVC-N0055: resampling bug fix for positive left scalled offset 87 108 88 #define SIMPLIFIED_MV_POS_SCALING 1 ///< M0133/M0449: inter-layer MV scaling and pixel mapping position calculation89 #define ILP_DECODED_PICTURE 1 ///< M0274: use decoded picture for inter-layer prediction90 109 #define JCTVC_M0259_LAMBDAREFINEMENT 1 ///< JCTVC-M0259: lambda refinement (encoder only optimization) 91 110 #define RESTR_CHK 1 ///< JCTVC-M0208 proposal 1 92 111 #define ILP_RAP 1 ///< JCTVC-M0208 proposal 3 93 112 94 #define REF_IDX_FRAMEWORK 1 ///< inter-layer reference framework95 96 #define IDR_ALIGNMENT 1 ///< align IDR picures across layers97 98 113 #define AVC_BASE 1 ///< YUV BL reading for AVC base SVC 99 114 #if AVC_BASE … … 101 116 #endif 102 117 103 #if REF_IDX_FRAMEWORK 104 #define REF_IDX_ME_ZEROMV 1 ///< L0051: use zero motion for inter-layer reference picture (without fractional ME) 105 #define ENCODER_FAST_MODE 1 ///< L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1. 106 #define REF_IDX_MFM 1 ///< L0336: motion vector mapping of inter-layer reference picture 118 #define REF_IDX_ME_ZEROMV 1 ///< JCTVC-L0051: use zero motion for inter-layer reference picture (without fractional ME) 119 #define ENCODER_FAST_MODE 1 ///< JCTVC-L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1. 120 #define REF_IDX_MFM 1 ///< JCTVC-L0336: motion vector mapping of inter-layer reference picture 107 121 #define JCTVC_M0458_INTERLAYER_RPS_SIG 1 ///< implementation of JCTVC-L0178 108 122 #if JCTVC_M0458_INTERLAYER_RPS_SIG 109 123 #define MAX_ONE_RESAMPLING_DIRECT_LAYERS 1 ///< Allow maximum of one resampling process for direct reference layers 110 #endif 111 #define JCTVC_M0203_INTERLAYER_PRED_IDC 1 ///< implementation of JCTVC-M0203 Inter-layer Prediction Indication 124 #define MOTION_RESAMPLING_CONSTRAINT 1 ///< JCTVC-N0108: Allow maximum of one motion resampling process for direct reference layers, and use motion inter-layer prediction from the same layer as texture inter-layer prediction. 125 #endif 126 #define JCTVC_M0203_INTERLAYER_PRED_IDC 1 ///< JCTVC-M0203: implementation of Inter-layer Prediction Indication 112 127 #if JCTVC_M0203_INTERLAYER_PRED_IDC 113 #define ILR_RESTR 1 ///< JCTVC-M0209 Inter-layer RPS and RPL 114 #define N0120_MAX_TID_REF_PRESENT_FLAG 1 ///< JCTVC-N0120 max_tid_ref_pics_plus1_present_flag 128 #define ILR_RESTR 1 ///< JCTVC-M0209: Inter-layer RPS and RPL 129 #define ILR_RESTR_FIX 1 ///< Fix encoder crash when temporal layers are used with scalable coding 130 #define EARLY_REF_PIC_MARKING 1 ///< Decoded picture marking of sub-layer non-reference pictures 131 #define N0120_MAX_TID_REF_PRESENT_FLAG 1 ///< JCTVC-N0120: max_tid_ref_pics_plus1_present_flag 132 #define N0120_MAX_TID_REF_CFG 1 ///< set max_tid_il_ref_pics_plus1 and max_tid_ref_present_flag in the config. file (configuration setting) 115 133 #endif 116 134 #if REF_IDX_MFM 117 #define REMOVE_COL_PICTURE_SIGNALING 1 ///< JCTVC-N0107 remove alternative collocated picture signalling135 #define REMOVE_COL_PICTURE_SIGNALING 1 ///< JCTVC-N0107: remove alternative collocated picture signalling 118 136 #define M0457_COL_PICTURE_SIGNALING 1 137 #define N0139_POSITION_ROUNDING_OFFSET 1 ///< JCTVC-N0139: offset for collocated block in motion mapping 119 138 #endif 120 139 … … 124 143 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG 0 ///< shall be 0, JCTVC-N0107 125 144 #endif 126 #endif 127 128 #define FAST_INTRA_SHVC 1 ///< M0115: reduction number of intra modes in the EL (encoder only) 145 146 #define N0147_IRAP_ALIGN_FLAG 1 ///< a flag to indicatate whether IRAPs are aligned across layers 147 #if !N0147_IRAP_ALIGN_FLAG 148 #define IDR_ALIGNMENT 1 ///< align IDR picures across layers : As per JCTVC-N0373, IDR are not required to be aligned. 149 #endif 150 #define FAST_INTRA_SHVC 1 ///< JCTVC-M0115: reduction number of intra modes in the EL (encoder only) 129 151 #if FAST_INTRA_SHVC 130 #define NB_REMAIN_MODES 2 ///< nb of remaining modes (M0115) 131 #endif 132 133 #define RC_SHVC_HARMONIZATION 1 ///< JCTVC-M0037, rate control for SHVC 134 135 #else 136 #define ILP_DECODED_PICTURE 0 152 #define NB_REMAIN_MODES 2 ///< JCTVC-M0115: nb of remaining modes 153 #endif 154 155 #define RC_SHVC_HARMONIZATION 1 ///< JCTVC-M0037: rate control for SHVC 156 157 #define VIEW_ID_RELATED_SIGNALING 1 ///< Introduce syntax elements view_id_len_minus1 and view_id_val 158 #define M0043_LAYERS_PRESENT_SEI 0 ///< JCTVC-M0043: add layers present SEI. Macro shall be equal to 0 according to the JCTVC-N0174 discussion. The code is to be removed. 159 #define N0383_IL_CONSTRAINED_TILE_SETS_SEI 1 160 #define N0065_LAYER_POC_ALIGNMENT 1 161 #else 137 162 #define SYNTAX_OUTPUT 0 138 163 #endif // SVC_EXTENSION … … 143 168 144 169 #define FIX1071 1 ///< fix for issue #1071 145 #define M0043_LAYERS_PRESENT_SEI 0 ///< M0043: add layers present SEI146 170 147 171 #define MAX_NUM_PICS_IN_SOP 1024 … … 606 630 }; 607 631 } 632 #if VIEW_ID_RELATED_SIGNALING 633 /// scalability types 634 enum ScalabilityType 635 { 636 VIEW_ORDER_INDEX = 1, 637 SCALABILITY_ID = 2, 638 }; 639 #endif 608 640 //! \} 609 641 -
trunk/source/Lib/TLibDecoder/SEIread.cpp
r313 r442 101 101 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n"); 102 102 break; 103 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 104 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 105 fprintf( g_hTrace, "=========== Inter Layer Constrained Tile Sets SEI message ===========\n"); 106 break; 107 #endif 103 108 case SEI::SCALABLE_NESTING: 104 109 fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n"); … … 266 271 xParseSEISOPDescription((SEISOPDescription&) *sei, payloadSize); 267 272 break; 273 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 274 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 275 sei = new SEIInterLayerConstrainedTileSets; 276 xParseSEIInterLayerConstrainedTileSets((SEIInterLayerConstrainedTileSets&) *sei, payloadSize); 277 break; 278 #endif 268 279 case SEI::SCALABLE_NESTING: 269 280 sei = new SEIScalableNesting; … … 349 360 350 361 /* restore primary bitstream for sei_message */ 362 getBitstream()->deleteFifo(); 351 363 delete getBitstream(); 352 364 setBitstream(bs); … … 774 786 } 775 787 788 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 789 Void SEIReader::xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize) 790 { 791 UInt uiCode; 792 793 READ_FLAG( uiCode, "il_all_tiles_exact_sample_value_match_flag" ); sei.m_ilAllTilesExactSampleValueMatchFlag = uiCode; 794 READ_FLAG( uiCode, "il_one_tile_per_tile_set_flag" ); sei.m_ilOneTilePerTileSetFlag = uiCode; 795 if( !sei.m_ilOneTilePerTileSetFlag ) 796 { 797 READ_UVLC( uiCode, "il_num_sets_in_message_minus1" ); sei.m_ilNumSetsInMessageMinus1 = uiCode; 798 if( sei.m_ilNumSetsInMessageMinus1 ) 799 { 800 READ_FLAG( uiCode, "skipped_tile_set_present_flag" ); sei.m_skippedTileSetPresentFlag = uiCode; 801 } 802 else 803 { 804 sei.m_skippedTileSetPresentFlag = false; 805 } 806 UInt numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - (sei.m_skippedTileSetPresentFlag ? 1 : 0) + 1; 807 for( UInt i = 0; i < numSignificantSets; i++ ) 808 { 809 READ_UVLC( uiCode, "ilcts_id" ); sei.m_ilctsId[i] = uiCode; 810 READ_UVLC( uiCode, "il_num_tile_rects_in_set_minus1" ) ;sei.m_ilNumTileRectsInSetMinus1[i] = uiCode; 811 for( UInt j = 0; j <= sei.m_ilNumTileRectsInSetMinus1[i]; j++ ) 812 { 813 READ_UVLC( uiCode, "il_top_left_tile_index" ); sei.m_ilTopLeftTileIndex[i][j] = uiCode; 814 READ_UVLC( uiCode, "il_bottom_right_tile_index" ); sei.m_ilBottomRightTileIndex[i][j] = uiCode; 815 } 816 READ_CODE( 2, uiCode, "ilc_idc" ); sei.m_ilcIdc[i] = uiCode; 817 if( sei.m_ilAllTilesExactSampleValueMatchFlag ) 818 { 819 READ_FLAG( uiCode, "il_exact_sample_value_match_flag" ); sei.m_ilExactSampleValueMatchFlag[i] = uiCode; 820 } 821 } 822 } 823 else 824 { 825 READ_CODE( 2, uiCode, "all_tiles_ilc_idc" ); sei.m_allTilesIlcIdc = uiCode; 826 } 827 828 xParseByteAlign(); 829 } 830 #endif 831 776 832 #if M0043_LAYERS_PRESENT_SEI 777 833 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps) -
trunk/source/Lib/TLibDecoder/SEIread.h
r313 r442 80 80 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 81 81 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize); 82 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 83 Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize); 84 #endif 82 85 #if M0043_LAYERS_PRESENT_SEI 83 86 Void xParseSEILayersPresent (SEILayersPresent &sei, UInt payloadSize, TComVPS *vps); -
trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp
r313 r442 52 52 if (length < 10) 53 53 { 54 fprintf( g_hTrace, "%-50s u(%d) : % d\n", pSymbolName, length, rValue );54 fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 55 55 } 56 56 else 57 57 { 58 fprintf( g_hTrace, "%-50s u(%d) : % d\n", pSymbolName, length, rValue );58 fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 59 59 } 60 60 fflush ( g_hTrace ); … … 65 65 xReadUvlc (rValue); 66 66 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ ); 67 fprintf( g_hTrace, "%-50s ue(v) : % d\n", pSymbolName, rValue );67 fprintf( g_hTrace, "%-50s ue(v) : %u\n", pSymbolName, rValue ); 68 68 fflush ( g_hTrace ); 69 69 } -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r345 r442 291 291 } 292 292 READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" ); pcPPS->setScalingListPresentFlag( uiCode ? true : false ); 293 294 #if IL_SL_SIGNALLING_N0371 295 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 296 #endif 297 293 298 if(pcPPS->getScalingListPresentFlag ()) 294 299 { 300 #if IL_SL_SIGNALLING_N0371 301 pcPPS->getScalingList()->setLayerId( pcPPS->getLayerId() ); 302 303 if( pcPPS->getLayerId() > 0 ) 304 { 305 READ_FLAG( uiCode, "pps_pred_scaling_list_flag" ); pcPPS->setPredScalingListFlag( uiCode ? true : false ); 306 pcPPS->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() ); 307 308 if( pcPPS->getPredScalingListFlag() ) 309 { 310 READ_UVLC ( uiCode, "scaling_list_pps_ref_layer_id" ); pcPPS->setScalingListRefLayerId( uiCode ); 311 312 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 313 assert( /*pcPPS->getScalingListRefLayerId() >= 0 &&*/ pcPPS->getScalingListRefLayerId() <= 62 ); 314 315 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of pps_scaling_list_ref_layer_id shall be greater than 0 316 if( pcPPS->getSPS()->getVPS()->getAvcBaseLayerFlag() ) 317 { 318 assert( pcPPS->getScalingListRefLayerId() > 0 ); 319 } 320 321 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 322 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 323 assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 324 325 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 326 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 327 assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true ); 328 329 pcPPS->getScalingList()->setScalingListRefLayerId( pcPPS->getScalingListRefLayerId() ); 330 parseScalingList( pcPPS->getScalingList() ); 331 } 332 else 333 { 334 parseScalingList( pcPPS->getScalingList() ); 335 } 336 } 337 else 338 { 339 parseScalingList( pcPPS->getScalingList() ); 340 } 341 #else 295 342 parseScalingList( pcPPS->getScalingList() ); 343 #endif 296 344 } 297 345 … … 377 425 TimingInfo *timingInfo = pcVUI->getTimingInfo(); 378 426 READ_FLAG( uiCode, "vui_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); 427 #if TIMING_INFO_NONZERO_LAYERID_SPS 428 if( pcSPS->getLayerId() > 0 ) 429 { 430 assert( timingInfo->getTimingInfoPresentFlag() == false ); 431 } 432 #endif 379 433 if(timingInfo->getTimingInfoPresentFlag()) 380 434 { … … 516 570 } 517 571 #endif 572 #if IL_SL_SIGNALLING_N0371 573 pcSPS->setVPS( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId()) ); 574 pcSPS->setSPS( pcSPS->getLayerId(), pcSPS ); 575 #endif 518 576 if ( pcSPS->getMaxTLayers() == 1 ) 519 577 { … … 525 583 #endif 526 584 } 527 585 #ifdef SPS_PTL_FIX 586 if ( pcSPS->getLayerId() == 0) 587 { 588 parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 589 } 590 #else 528 591 parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 592 #endif 593 529 594 READ_UVLC( uiCode, "sps_seq_parameter_set_id" ); pcSPS->setSPSId( uiCode ); 530 595 assert(uiCode <= 15); 531 532 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 533 assert(uiCode <= 3); 534 // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream 535 assert (uiCode == 1); 536 if( uiCode == 3 ) 537 { 538 READ_FLAG( uiCode, "separate_colour_plane_flag"); assert(uiCode == 0); 539 } 540 541 READ_UVLC ( uiCode, "pic_width_in_luma_samples" ); pcSPS->setPicWidthInLumaSamples ( uiCode ); 542 READ_UVLC ( uiCode, "pic_height_in_luma_samples" ); pcSPS->setPicHeightInLumaSamples( uiCode ); 596 597 #if REPN_FORMAT_IN_VPS 598 if( pcSPS->getLayerId() > 0 ) 599 { 600 READ_FLAG( uiCode, "update_rep_format_flag" ); 601 pcSPS->setUpdateRepFormatFlag( uiCode ? true : false ); 602 } 603 else 604 { 605 pcSPS->setUpdateRepFormatFlag( true ); 606 } 607 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 608 { 609 #endif 610 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 611 assert(uiCode <= 3); 612 // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream 613 assert (uiCode == 1); 614 if( uiCode == 3 ) 615 { 616 READ_FLAG( uiCode, "separate_colour_plane_flag"); assert(uiCode == 0); 617 } 618 619 READ_UVLC ( uiCode, "pic_width_in_luma_samples" ); pcSPS->setPicWidthInLumaSamples ( uiCode ); 620 READ_UVLC ( uiCode, "pic_height_in_luma_samples" ); pcSPS->setPicHeightInLumaSamples( uiCode ); 621 #if REPN_FORMAT_IN_VPS 622 } 623 #endif 543 624 READ_FLAG( uiCode, "conformance_window_flag"); 544 625 if (uiCode != 0) 545 626 { 546 627 Window &conf = pcSPS->getConformanceWindow(); 628 #if REPN_FORMAT_IN_VPS 629 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode ); 630 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode ); 631 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode ); 632 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode ); 633 #else 547 634 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 548 635 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 549 636 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 550 637 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 551 } 552 553 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 554 assert(uiCode <= 6); 555 pcSPS->setBitDepthY( uiCode + 8 ); 556 pcSPS->setQpBDOffsetY( (Int) (6*uiCode) ); 557 558 READ_UVLC( uiCode, "bit_depth_chroma_minus8" ); 559 assert(uiCode <= 6); 560 pcSPS->setBitDepthC( uiCode + 8 ); 561 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 562 638 #endif 639 } 640 #if REPN_FORMAT_IN_VPS 641 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 642 { 643 #endif 644 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 645 assert(uiCode <= 6); 646 pcSPS->setBitDepthY( uiCode + 8 ); 647 pcSPS->setQpBDOffsetY( (Int) (6*uiCode) ); 648 649 READ_UVLC( uiCode, "bit_depth_chroma_minus8" ); 650 assert(uiCode <= 6); 651 pcSPS->setBitDepthC( uiCode + 8 ); 652 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 653 #if REPN_FORMAT_IN_VPS 654 } 655 #endif 563 656 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); 564 657 assert(uiCode <= 12); … … 606 699 Int addCuDepth = max (0, log2MinCUSize - (Int)pcSPS->getQuadtreeTULog2MinSize() ); 607 700 pcSPS->setMaxCUDepth( maxCUDepthDelta + addCuDepth ); 608 609 701 READ_FLAG( uiCode, "scaling_list_enabled_flag" ); pcSPS->setScalingListFlag ( uiCode ); 702 610 703 if(pcSPS->getScalingListFlag()) 611 704 { … … 613 706 if(pcSPS->getScalingListPresentFlag ()) 614 707 { 708 709 #if IL_SL_SIGNALLING_N0371 710 pcSPS->getScalingList()->setLayerId( pcSPS->getLayerId() ); 711 712 if( pcSPS->getLayerId() > 0 ) 713 { 714 READ_FLAG( uiCode, "sps_pred_scaling_list_flag" ); pcSPS->setPredScalingListFlag ( uiCode ); 715 pcSPS->getScalingList()->setPredScalingListFlag( pcSPS->getPredScalingListFlag() ); 716 717 if( pcSPS->getPredScalingListFlag() ) 718 { 719 READ_UVLC( uiCode, "scaling_list_sps_ref_layer_id" ); pcSPS->setScalingListRefLayerId( uiCode ); 720 721 // The value of sps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 722 assert( /*pcSPS->getScalingListRefLayerId() >= 0 &&*/ pcSPS->getScalingListRefLayerId() <= 62 ); 723 724 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 725 if( pcSPS->getVPS()->getAvcBaseLayerFlag() ) 726 { 727 assert( pcSPS->getScalingListRefLayerId() > 0 ); 728 } 729 730 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 731 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 732 assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 733 734 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 735 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 736 assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true ); 737 738 pcSPS->getScalingList()->setScalingListRefLayerId( pcSPS->getScalingListRefLayerId() ); 739 parseScalingList( pcSPS->getScalingList() ); 740 } 741 else 742 { 743 parseScalingList( pcSPS->getScalingList() ); 744 } 745 } 746 else 747 { 748 parseScalingList( pcSPS->getScalingList() ); 749 } 750 #else 615 751 parseScalingList( pcSPS->getScalingList() ); 752 #endif 753 616 754 } 617 755 } … … 697 835 UInt uiCode; 698 836 // more syntax elements to be parsed here 837 838 #if VERT_MV_CONSTRAINT 839 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); 840 // Vertical MV component restriction is not used in SHVC CTC 841 assert( uiCode == 0 ); 842 #endif 699 843 #if SCALED_REF_LAYER_OFFSETS 700 #if SCALED_REF_LAYER_OFFSET_FLAG701 READ_FLAG( uiCode, "scaled_ref_layer_offset_present_flag" );702 if( uiCode )703 #else704 844 if( pcSPS->getLayerId() > 0 ) 705 #endif706 845 { 707 846 Int iCode; … … 754 893 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 755 894 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); 895 #if VPS_EXTN_OFFSET 896 READ_CODE( 16, uiCode, "vps_extension_offset" ); pcVPS->setExtensionOffset( uiCode ); 897 #else 756 898 READ_CODE( 16, uiCode, "vps_reserved_ffff_16bits" ); assert(uiCode == 0xffff); 899 #endif 757 900 parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1); 758 901 UInt subLayerOrderingInfoPresentFlag; … … 833 976 { 834 977 #if VPS_EXTNS 978 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 979 { 980 READ_FLAG( uiCode, "vps_extension_alignment_bit_equal_to_one"); assert(uiCode == 1); 981 } 835 982 parseVPSExtension(pcVPS); 836 983 READ_FLAG( uiCode, "vps_entension2_flag" ); … … 927 1074 assert( uiCode <= vps->getMaxLayerId() ); 928 1075 } 1076 } 1077 #endif 1078 #if VIEW_ID_RELATED_SIGNALING 1079 // if ( pcVPS->getNumViews() > 1 ) 1080 // However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 1081 { 1082 READ_CODE( 4, uiCode, "view_id_len_minus1" ); vps->setViewIdLenMinus1( uiCode ); 1083 } 1084 1085 for( i = 0; i < vps->getNumViews(); i++ ) 1086 { 1087 READ_CODE( vps->getViewIdLenMinus1( ) + 1, uiCode, "view_id_val[i]" ); vps->setViewIdVal( i, uiCode ); 929 1088 } 930 1089 #endif … … 952 1111 #if JCTVC_M0203_INTERLAYER_PRED_IDC 953 1112 #if N0120_MAX_TID_REF_PRESENT_FLAG 954 READ_FLAG( uiCode, "max_tid_ il_ref_pics_plus1_present_flag"); vps->setMaxTidIlRefPicsPlus1PresentFlag(uiCode ? true : false);955 if (vps->getMaxTid IlRefPicsPlus1PresentFlag())1113 READ_FLAG( uiCode, "max_tid_ref_present_flag"); vps->setMaxTidRefPresentFlag(uiCode ? true : false); 1114 if (vps->getMaxTidRefPresentFlag()) 956 1115 { 957 1116 for(i = 0; i < vps->getMaxLayers() - 1; i++) 958 1117 { 959 READ_CODE( 3, uiCode, "max_sublayer_for_ilp_plus1[i]" ); vps->setMaxSublayerForIlpPlus1(i, uiCode); 960 assert( uiCode <= vps->getMaxTLayers() ); 1118 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); vps->setMaxTidIlRefPicsPlus1(i, uiCode); 1119 #if N0120_MAX_TID_REF_CFG 1120 assert( uiCode <= vps->getMaxTLayers()); 1121 #else 1122 assert( uiCode <= vps->getMaxTLayers()+ 1 ); 1123 #endif 961 1124 } 962 1125 } … … 965 1128 for(i = 0; i < vps->getMaxLayers() - 1; i++) 966 1129 { 967 vps->setMax SublayerForIlpPlus1(i, 7);1130 vps->setMaxTidIlRefPicsPlus1(i, 7); 968 1131 } 969 1132 } … … 971 1134 for(i = 0; i < vps->getMaxLayers() - 1; i++) 972 1135 { 973 READ_CODE( 3, uiCode, "max_ sublayer_for_ilp_plus1[i]" ); vps->setMaxSublayerForIlpPlus1(i, uiCode);1136 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); vps->setMaxTidIlRefPicsPlus1(i, uiCode); 974 1137 assert( uiCode <= vps->getMaxTLayers() ); 975 1138 } … … 1090 1253 #endif 1091 1254 #endif 1255 #if REPN_FORMAT_IN_VPS 1256 READ_FLAG( uiCode, "rep_format_idx_present_flag"); 1257 vps->setRepFormatIdxPresentFlag( uiCode ? true : false ); 1258 1259 if( vps->getRepFormatIdxPresentFlag() ) 1260 { 1261 READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" ); 1262 vps->setVpsNumRepFormats( uiCode + 1 ); 1263 } 1264 else 1265 { 1266 // default assignment 1267 assert (vps->getMaxLayers() <= 16); // If max_layers_is more than 15, num_rep_formats has to be signaled 1268 vps->setVpsNumRepFormats( vps->getMaxLayers() ); 1269 } 1270 for(i = 0; i < vps->getVpsNumRepFormats(); i++) 1271 { 1272 // Read rep_format_structures 1273 parseRepFormat( vps->getVpsRepFormat(i) ); 1274 } 1275 1276 // Default assignment for layer 0 1277 vps->setVpsRepFormatIdx( 0, 0 ); 1278 if( vps->getRepFormatIdxPresentFlag() ) 1279 { 1280 for(i = 1; i < vps->getMaxLayers(); i++) 1281 { 1282 if( vps->getVpsNumRepFormats() > 1 ) 1283 { 1284 READ_CODE( 4, uiCode, "vps_rep_format_idx[i]" ); 1285 vps->setVpsRepFormatIdx( i, uiCode ); 1286 } 1287 else 1288 { 1289 // default assignment - only one rep_format() structure 1290 vps->setVpsRepFormatIdx( i, 0 ); 1291 } 1292 } 1293 } 1294 else 1295 { 1296 // default assignment - each layer assigned each rep_format() structure in the order signaled 1297 for(i = 1; i < vps->getMaxLayers(); i++) 1298 { 1299 vps->setVpsRepFormatIdx( i, i ); 1300 } 1301 } 1302 #endif 1092 1303 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1093 READ_FLAG(uiCode, "max_one_active_ref_layer_flag" ); 1094 vps->setMaxOneActiveRefLayerFlag(uiCode); 1095 #endif 1304 READ_FLAG(uiCode, "max_one_active_ref_layer_flag" ); 1305 vps->setMaxOneActiveRefLayerFlag(uiCode); 1306 #endif 1307 1308 #if N0147_IRAP_ALIGN_FLAG 1309 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1310 vps->setCrossLayerIrapAlignFlag(uiCode); 1311 #endif 1096 1312 1097 1313 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG … … 1128 1344 } 1129 1345 } 1130 #endif 1346 1347 #endif 1348 1349 #if IL_SL_SIGNALLING_N0371 1350 for(i = 1; i < vps->getMaxLayers(); i++) 1351 { 1352 for(j = 0; j < i; j++) 1353 { 1354 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) ); 1355 } 1356 } 1357 #endif 1358 1131 1359 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1132 1360 READ_FLAG(uiCode, "single_layer_for_non_irap_flag" ); vps->setSingleLayerForNonIrapFlag(uiCode == 1 ? true : false); 1133 1361 #endif 1134 } 1135 #endif 1136 1362 1363 READ_FLAG( uiCode, "vps_vui_present_flag" ); 1364 if (uiCode) 1365 { 1366 #if VPS_VUI 1367 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 1368 { 1369 READ_FLAG( uiCode, "vps_vui_alignment_bit_equal_to_one"); assert(uiCode == 1); 1370 } 1371 parseVPSVUI(vps); 1372 #endif 1373 } 1374 } 1375 #endif 1376 #if REPN_FORMAT_IN_VPS 1377 Void TDecCavlc::parseRepFormat ( RepFormat *repFormat ) 1378 { 1379 UInt uiCode; 1380 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( uiCode ); 1381 1382 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1383 { 1384 READ_FLAG( uiCode, "separate_colour_plane_flag"); repFormat->setSeparateColourPlaneVpsFlag(uiCode ? true : false); 1385 } 1386 1387 READ_CODE ( 16, uiCode, "pic_width_in_luma_samples" ); repFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1388 READ_CODE ( 16, uiCode, "pic_height_in_luma_samples" ); repFormat->setPicHeightVpsInLumaSamples( uiCode ); 1389 1390 READ_CODE( 4, uiCode, "bit_depth_luma_minus8" ); repFormat->setBitDepthVpsLuma ( uiCode + 8 ); 1391 READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" ); repFormat->setBitDepthVpsChroma( uiCode + 8 ); 1392 1393 } 1394 #endif 1395 #if VPS_VUI 1396 Void TDecCavlc::parseVPSVUI(TComVPS *vps) 1397 { 1398 UInt i,j; 1399 UInt uiCode; 1400 #if VPS_VUI_BITRATE_PICRATE 1401 READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); vps->setBitRatePresentVpsFlag( uiCode ? true : false ); 1402 READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); vps->setPicRatePresentVpsFlag( uiCode ? true : false ); 1403 1404 Bool parseFlag = vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag(); 1405 { 1406 for( i = 0; i < vps->getNumLayerSets(); i++ ) 1407 { 1408 for( j = 0; j < vps->getMaxTLayers(); j++ ) 1409 { 1410 if( parseFlag && vps->getBitRatePresentVpsFlag() ) 1411 { 1412 READ_FLAG( uiCode, "bit_rate_present_vps_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false ); 1413 } 1414 else 1415 { 1416 vps->setBitRatePresentFlag( i, j, false ); 1417 } 1418 if( parseFlag && vps->getPicRatePresentVpsFlag() ) 1419 { 1420 READ_FLAG( uiCode, "pic_rate_present_vps_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false ); 1421 } 1422 else 1423 { 1424 vps->setPicRatePresentFlag( i, j, false ); 1425 } 1426 if( parseFlag && vps->getBitRatePresentFlag(i, j) ) 1427 { 1428 READ_CODE( 16, uiCode, "avg_bit_rate[i][j]" ); vps->setAvgBitRate( i, j, uiCode ); 1429 READ_CODE( 16, uiCode, "max_bit_rate[i][j]" ); vps->setMaxBitRate( i, j, uiCode ); 1430 } 1431 else 1432 { 1433 vps->setAvgBitRate( i, j, 0 ); 1434 vps->setMaxBitRate( i, j, 0 ); 1435 } 1436 if( parseFlag && vps->getPicRatePresentFlag(i, j) ) 1437 { 1438 READ_CODE( 2 , uiCode, "constant_pic_rate_idc[i][j]" ); vps->setConstPicRateIdc( i, j, uiCode ); 1439 READ_CODE( 16, uiCode, "avg_pic_rate[i][j]" ); vps->setAvgPicRate( i, j, uiCode ); 1440 } 1441 else 1442 { 1443 vps->setConstPicRateIdc( i, j, 0 ); 1444 vps->setAvgPicRate ( i, j, 0 ); 1445 } 1446 } 1447 } 1448 } 1449 #endif 1450 #if TILE_BOUNDARY_ALIGNED_FLAG 1451 for(i = 1; i < vps->getMaxLayers(); i++) 1452 { 1453 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1454 { 1455 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1)); 1456 } 1457 } 1458 #endif 1459 #if N0160_VUI_EXT_ILP_REF 1460 READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 ); 1461 if( vps->getNumIlpRestrictedRefLayers()) 1462 { 1463 for(i = 1; i < vps->getMaxLayers(); i++) 1464 { 1465 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1466 { 1467 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 1468 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 1469 { 1470 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 1471 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 1472 { 1473 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 1474 } 1475 } 1476 } 1477 } 1478 } 1479 #endif 1480 } 1481 #endif 1137 1482 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) 1138 1483 { … … 1169 1514 rpcSlice->setDependentSliceSegmentFlag(false); 1170 1515 } 1516 #if REPN_FORMAT_IN_VPS 1517 Int numCTUs = ((rpcSlice->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((rpcSlice->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight()); 1518 #else 1171 1519 Int numCTUs = ((sps->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((sps->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight()); 1520 #endif 1172 1521 Int maxParts = (1<<(sps->getMaxCUDepth()<<1)); 1173 1522 UInt sliceSegmentAddress = 0; … … 1203 1552 if(!rpcSlice->getDependentSliceSegmentFlag()) 1204 1553 { 1205 1554 #if POC_RESET_FLAG 1555 Int iBits = 0; 1556 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits) 1557 { 1558 READ_FLAG(uiCode, "poc_reset_flag"); rpcSlice->setPocResetFlag( uiCode ? true : false ); 1559 iBits++; 1560 } 1561 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits) 1562 { 1563 READ_FLAG(uiCode, "discardable_flag"); // ignored 1564 iBits++; 1565 } 1566 for (; iBits < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++) 1567 { 1568 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1569 } 1570 #else 1206 1571 #if SH_DISCARDABLE_FLAG 1207 1572 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) … … 1218 1583 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1219 1584 } 1585 #endif 1220 1586 #endif 1221 1587 … … 1244 1610 rpcSlice->setRPS(rps); 1245 1611 } 1612 #if N0065_LAYER_POC_ALIGNMENT 1613 if( rpcSlice->getLayerId() > 0 || !rpcSlice->getIdrPicFlag() ) 1614 #else 1246 1615 else 1616 #endif 1247 1617 { 1248 1618 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 1249 1619 Int iPOClsb = uiCode; 1250 Int iPrevPOC = rpcSlice->getPrev POC();1620 Int iPrevPOC = rpcSlice->getPrevTid0POC(); 1251 1621 Int iMaxPOClsb = 1<< sps->getBitsForPOC(); 1252 Int iPrevPOClsb = iPrevPOC %iMaxPOClsb;1622 Int iPrevPOClsb = iPrevPOC & (iMaxPOClsb - 1); 1253 1623 Int iPrevPOCmsb = iPrevPOC-iPrevPOClsb; 1254 1624 Int iPOCmsb; … … 1274 1644 rpcSlice->setPOC (iPOCmsb+iPOClsb); 1275 1645 1646 #if N0065_LAYER_POC_ALIGNMENT 1647 if( !rpcSlice->getIdrPicFlag() ) 1648 { 1649 #endif 1276 1650 TComReferencePictureSet* rps; 1277 1651 rps = rpcSlice->getLocalRPS(); … … 1372 1746 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLsbLt); 1373 1747 rps->setCheckLTMSBPresent(j,false); 1748 1749 // reset deltaPocMSBCycleLT for first LTRP from slice header if MSB not present 1750 if( j == offset+(numOfLtrp-numLtrpInSPS)-1 ) 1751 { 1752 deltaPocMSBCycleLT = 0; 1753 } 1374 1754 } 1375 1755 prevDeltaMSB = deltaPocMSBCycleLT; … … 1399 1779 rpcSlice->setEnableTMVPFlag(false); 1400 1780 } 1401 } 1402 1403 #if REF_IDX_FRAMEWORK 1781 #if N0065_LAYER_POC_ALIGNMENT 1782 } 1783 #endif 1784 } 1785 1786 #if SVC_EXTENSION 1404 1787 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1405 1788 rpcSlice->setActiveNumILRRefIdx(0); … … 1624 2007 if ( rpcSlice->getEnableTMVPFlag() ) 1625 2008 { 1626 #if REF_IDX_FRAMEWORK &&M0457_COL_PICTURE_SIGNALING2009 #if M0457_COL_PICTURE_SIGNALING 1627 2010 #if REMOVE_COL_PICTURE_SIGNALING 1628 2011 rpcSlice->setMFMEnabledFlag( rpcSlice->getNumMotionPredRefLayers() > 0 ? true : false ); … … 1667 2050 rpcSlice->setColRefIdx(0); 1668 2051 } 1669 #if REF_IDX_FRAMEWORK &&M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING2052 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 1670 2053 } 1671 2054 #endif … … 1685 2068 rpcSlice->setSliceQp (26 + pps->getPicInitQPMinus26() + iCode); 1686 2069 2070 #if REPN_FORMAT_IN_VPS 2071 assert( rpcSlice->getSliceQp() >= -rpcSlice->getQpBDOffsetY() ); 2072 #else 1687 2073 assert( rpcSlice->getSliceQp() >= -sps->getQpBDOffsetY() ); 2074 #endif 1688 2075 assert( rpcSlice->getSliceQp() <= 51 ); 1689 2076 … … 2016 2403 xReadSvlc( iDQp ); 2017 2404 2405 #if REPN_FORMAT_IN_VPS 2406 Int qpBdOffsetY = pcCU->getSlice()->getQpBDOffsetY(); 2407 #else 2018 2408 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY(); 2409 #endif 2019 2410 qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) - qpBdOffsetY; 2020 2411 … … 2186 2577 UInt code, sizeId, listId; 2187 2578 Bool scalingListPredModeFlag; 2579 2188 2580 //for each size 2189 2581 for(sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2191 2583 for(listId = 0; listId < g_scalingListNum[sizeId]; listId++) 2192 2584 { 2585 #if IL_SL_SIGNALLING_N0371 2586 if ( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2587 { 2588 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2589 scalingListPredModeFlag = (code) ? true : false; 2590 if(!scalingListPredModeFlag) //Copy Mode 2591 { 2592 READ_UVLC( code, "scaling_list_pred_matrix_id_delta"); 2593 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code))); 2594 if( sizeId > SCALING_LIST_8x8 ) 2595 { 2596 scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId)))); 2597 } 2598 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId)); 2599 2600 } 2601 else //DPCM Mode 2602 { 2603 xDecodeScalingList(scalingList, sizeId, listId); 2604 } 2605 } 2606 else 2607 { 2608 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2609 scalingListPredModeFlag = (code) ? true : false; 2610 if(!scalingListPredModeFlag) //Copy Mode 2611 { 2612 READ_UVLC( code, "scaling_list_pred_matrix_id_delta"); 2613 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code))); 2614 if( sizeId > SCALING_LIST_8x8 ) 2615 { 2616 scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId)))); 2617 } 2618 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId)); 2619 2620 } 2621 else //DPCM Mode 2622 { 2623 xDecodeScalingList(scalingList, sizeId, listId); 2624 } 2625 } 2626 #else 2193 2627 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2194 2628 scalingListPredModeFlag = (code) ? true : false; … … 2208 2642 xDecodeScalingList(scalingList, sizeId, listId); 2209 2643 } 2644 #endif 2210 2645 } 2211 2646 } … … 2229 2664 if( sizeId > SCALING_LIST_8x8 ) 2230 2665 { 2666 #if IL_SL_SIGNALLING_N0371 2667 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2668 { 2669 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId); 2670 scalingList->setScalingListDC(sizeId,listId,ref_scalingListDC[scalingList->getScalingListRefLayerId()][sizeId][listId]); 2671 } 2672 else 2673 { 2674 READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8"); 2675 scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8); 2676 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2677 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId); 2678 } 2679 #else 2231 2680 READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8"); 2232 2681 scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8); 2233 2682 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2683 #endif 2234 2684 } 2235 2685 2236 2686 for(i = 0; i < coefNum; i++) 2237 2687 { 2688 #if IL_SL_SIGNALLING_N0371 2689 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2690 { 2691 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]]; 2692 dst[scan[i]] = ref_scalingListCoef[scalingList->getScalingListRefLayerId()][sizeId][listId][i]; 2693 } 2694 else 2695 { 2696 READ_SVLC( data, "scaling_list_delta_coef"); 2697 nextCoef = (nextCoef + data + 256 ) % 256; 2698 dst[scan[i]] = nextCoef; 2699 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]]; 2700 } 2701 #else 2238 2702 READ_SVLC( data, "scaling_list_delta_coef"); 2239 2703 nextCoef = (nextCoef + data + 256 ) % 256; 2240 2704 dst[scan[i]] = nextCoef; 2705 #endif 2241 2706 } 2242 2707 } -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r345 r442 75 75 Void parseVPSExtension ( TComVPS* pcVPS ); 76 76 #endif 77 78 #if VPS_VUI 79 Void parseVPSVUI ( TComVPS* pcVPS ); 80 #endif 81 #if REPN_FORMAT_IN_VPS 82 Void parseRepFormat ( RepFormat *repFormat ); 83 #endif 77 84 #if SPS_SUB_LAYER_INFO 78 85 Void parseSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ); -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r345 r442 177 177 TComSlice * pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx()); 178 178 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 179 #if REPN_FORMAT_IN_VPS 180 UInt uiWidth = pcSlice->getPicWidthInLumaSamples(); 181 UInt uiHeight = pcSlice->getPicHeightInLumaSamples(); 182 #else 179 183 UInt uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 180 184 UInt uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 185 #endif 181 186 UInt uiGranularityWidth = g_uiMaxCUWidth; 182 187 UInt uiPosX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; … … 230 235 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 231 236 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); 237 #if REPN_FORMAT_IN_VPS 238 if((!bStartInCU) && ( uiRPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getPicHeightInLumaSamples() ) ) 239 #else 232 240 if((!bStartInCU) && ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 241 #endif 233 242 { 234 243 m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 256 265 if ( bSubInSlice ) 257 266 { 267 #if REPN_FORMAT_IN_VPS 268 if ( !ruiIsLast && ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) ) 269 #else 258 270 if ( !ruiIsLast && ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 271 #endif 259 272 { 260 273 xDecodeCU( pcCU, uiIdx, uiDepth+1, ruiIsLast ); … … 385 398 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 386 399 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); 400 #if REPN_FORMAT_IN_VPS 401 if(bStartInCU||( uiRPelX >= pcSlice->getPicWidthInLumaSamples() ) || ( uiBPelY >= pcSlice->getPicHeightInLumaSamples() ) ) 402 #else 387 403 if(bStartInCU||( uiRPelX >= pcSlice->getSPS()->getPicWidthInLumaSamples() ) || ( uiBPelY >= pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 404 #endif 388 405 { 389 406 bBoundary = true; … … 401 418 402 419 Bool binSlice = (pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getSliceSegmentCurStartCUAddr())&&(pcCU->getSCUAddr()+uiIdx<pcSlice->getSliceSegmentCurEndCUAddr()); 420 #if REPN_FORMAT_IN_VPS 421 if(binSlice&&( uiLPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getPicHeightInLumaSamples() ) ) 422 #else 403 423 if(binSlice&&( uiLPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 424 #endif 404 425 { 405 426 xDecompressCU(pcCU, uiIdx, uiNextDepth ); … … 494 515 495 516 //===== inverse transform ===== 517 #if REPN_FORMAT_IN_VPS 518 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), TEXT_LUMA, pcCU->getSlice()->getQpBDOffsetY(), 0 ); 519 #else 496 520 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 521 #endif 497 522 498 523 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)TEXT_LUMA]; … … 733 758 pResi = m_ppcYuvResi[uiDepth]->getLumaAddr(); 734 759 760 #if REPN_FORMAT_IN_VPS 761 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_LUMA, pcCU->getSlice()->getQpBDOffsetY(), 0 ); 762 #else 735 763 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 764 #endif 736 765 737 766 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); -
trunk/source/Lib/TLibDecoder/TDecGop.cpp
r313 r442 247 247 for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++) 248 248 { 249 #if REF_IDX_FRAMEWORK && VPS_EXTN_DIRECT_REF_LAYERS 249 #if SVC_EXTENSION 250 #if VPS_EXTN_DIRECT_REF_LAYERS 250 251 if( pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->isILR( m_layerId ) ) 251 252 { 252 printf( "%d(%d) 253 printf( "%d(%d)", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex), pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId() ); 253 254 } 254 255 else 255 #endif 256 { 257 printf ("%d", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)); 258 } 259 #endif 260 if( pcSlice->getEnableTMVPFlag() && iRefList == 1 - pcSlice->getColFromL0Flag() && iRefIndex == pcSlice->getColRefIdx() ) 261 { 262 printf( "c" ); 263 } 264 265 printf( " " ); 266 #else 256 267 printf ("%d ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)); 268 #endif 257 269 } 258 270 printf ("] "); -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r345 r442 860 860 { 861 861 UInt uiSign; 862 #if REPN_FORMAT_IN_VPS 863 Int qpBdOffsetY = pcCU->getSlice()->getQpBDOffsetY(); 864 #else 862 865 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY(); 866 #endif 863 867 m_pcTDecBinIf->decodeBinEP(uiSign); 864 868 iDQp = uiDQp; -
trunk/source/Lib/TLibDecoder/TDecSlice.h
r313 r442 65 65 TDecEntropy* m_pcEntropyDecoder; 66 66 TDecCu* m_pcCuDecoder; 67 UInt m_uiCurrSliceIdx;68 67 69 68 TDecSbac* m_pcBufferSbacDecoders; ///< line to store temporary contexts, one per column of tiles. -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r345 r442 57 57 g_nSymbolCounter = 0; 58 58 #endif 59 m_associatedIRAPType = NAL_UNIT_INVALID; 59 60 m_pocCRA = 0; 60 m_prevRAPisBLA = false;61 61 m_pocRandomAccess = MAX_INT; 62 62 #if !SVC_EXTENSION … … 72 72 m_pBLReconFile = NULL; 73 73 #endif 74 #endif75 #if REF_IDX_FRAMEWORK76 74 memset(m_cIlpPic, 0, sizeof(m_cIlpPic)); 77 75 #endif … … 79 77 m_pBLSyntaxFile = NULL; 80 78 #endif 81 79 m_prevSliceSkipped = false; 80 m_skippedPOC = 0; 82 81 } 83 82 … … 108 107 109 108 m_cSliceDecoder.destroy(); 110 #if REF_IDX_FRAMEWORK109 #if SVC_EXTENSION 111 110 for(Int i=0; i<MAX_NUM_REF; i++) 112 111 { … … 137 136 } 138 137 139 #if REF_IDX_FRAMEWORK 138 #if SVC_EXTENSION 139 #if !REPN_FORMAT_IN_VPS 140 140 Void TDecTop::xInitILRP(TComSPS *pcSPS) 141 { 141 #else 142 Void TDecTop::xInitILRP(TComSlice *slice) 143 #endif 144 { 145 #if REPN_FORMAT_IN_VPS 146 TComSPS* pcSPS = slice->getSPS(); 147 Int bitDepthY = slice->getBitDepthY(); 148 Int bitDepthC = slice->getBitDepthC(); 149 Int picWidth = slice->getPicWidthInLumaSamples(); 150 Int picHeight = slice->getPicHeightInLumaSamples(); 151 #endif 142 152 if(m_layerId>0) 143 153 { 154 #if REPN_FORMAT_IN_VPS 155 g_bitDepthY = bitDepthY; 156 g_bitDepthC = bitDepthC; 157 #else 144 158 g_bitDepthY = pcSPS->getBitDepthY(); 145 159 g_bitDepthC = pcSPS->getBitDepthC(); 160 #endif 146 161 g_uiMaxCUWidth = pcSPS->getMaxCUWidth(); 147 162 g_uiMaxCUHeight = pcSPS->getMaxCUHeight(); … … 164 179 165 180 m_cIlpPic[j] = new TComPic; 181 #if REPN_FORMAT_IN_VPS 182 #if SVC_UPSAMPLING 183 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 184 #else 185 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 186 #endif 187 #else 166 188 #if SVC_UPSAMPLING 167 189 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 168 190 #else 169 191 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 192 #endif 170 193 #endif 171 194 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCUsInFrame(); i++) … … 177 200 } 178 201 } 202 203 179 204 180 205 Void TDecTop::setILRPic(TComPic *pcPic) … … 191 216 m_cIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension(false); 192 217 m_cIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder(); 218 for (Int j=0; j<m_cIlpPic[refLayerIdc]->getPicSym()->getNumberOfCUsInFrame(); j++) // set reference CU layerId 219 { 220 m_cIlpPic[refLayerIdc]->getPicSym()->getCU(j)->setLayerId(m_cIlpPic[refLayerIdc]->getLayerId()); 221 } 193 222 } 194 223 } … … 266 295 //TComPic* pcPic = *(pcTDecTopBase->getListPic()->begin()); 267 296 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 297 #if REPN_FORMAT_IN_VPS 298 if(pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets ) 299 #else 268 300 if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples() || !zeroOffsets ) 301 #endif 269 302 { 270 303 rpcPic->setSpatialEnhLayerFlag( i, true ); 271 304 272 305 //only for scalable extension 306 #if SCALABILITY_MASK_E0104 307 assert( pcSlice->getVPS()->getScalabilityMask(2) == true ); 308 #else 273 309 assert( pcSlice->getVPS()->getScalabilityMask(1) == true ); 310 #endif 274 311 } 275 312 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS 313 #if SCALABILITY_MASK_E0104 314 if(pcSlice->getVPS()->getScalabilityMask(2)) 315 #else 276 316 if(pcSlice->getVPS()->getScalabilityMask(1)) 317 #endif 277 318 { 278 319 pcSlice->setPic(rpcPic); … … 283 324 #endif 284 325 326 #if REPN_FORMAT_IN_VPS 327 #if SVC_UPSAMPLING 328 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 329 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 330 #else 331 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 332 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 333 #endif 334 #else 285 335 #if SVC_UPSAMPLING 286 336 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, … … 290 340 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 291 341 #endif 342 #endif 343 292 344 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 293 345 m_cListPic.pushBack( rpcPic ); … … 329 381 rpcPic->destroy(); 330 382 383 #if REPN_FORMAT_IN_VPS 384 #if SVC_UPSAMPLING 385 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 386 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 387 388 #else 389 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 390 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 391 #endif 392 #else 331 393 #if SVC_UPSAMPLING 332 394 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, … … 336 398 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 337 399 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 400 #endif 338 401 #endif 339 402 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); … … 366 429 } 367 430 431 #if EARLY_REF_PIC_MARKING 432 Void TDecTop::earlyPicMarking(Int maxTemporalLayer, std::vector<Int>& targetDecLayerIdSet) 433 { 434 UInt currTid = m_pcPic->getTLayer(); 435 UInt highestTid = (maxTemporalLayer >= 0) ? maxTemporalLayer : (m_pcPic->getSlice(0)->getSPS()->getMaxTLayers() - 1); 436 UInt latestDecLayerId = m_layerId; 437 UInt numTargetDecLayers = 0; 438 Int targetDecLayerIdList[MAX_LAYERS]; 439 UInt latestDecIdx = 0; 440 TComSlice* pcSlice = m_pcPic->getSlice(0); 441 442 if ( currTid != highestTid ) // Marking process is only applicaple for highest decoded TLayer 443 { 444 return; 445 } 446 447 // currPic must be marked as "used for reference" and must be a sub-layer non-reference picture 448 if ( !((pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N || 449 pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 450 pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N || 451 pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N || 452 pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || 453 pcSlice->getNalUnitType() == NAL_UNIT_RESERVED_VCL_N10 || 454 pcSlice->getNalUnitType() == NAL_UNIT_RESERVED_VCL_N12 || 455 pcSlice->getNalUnitType() == NAL_UNIT_RESERVED_VCL_N14) && pcSlice->isReferenced())) 456 { 457 return; 458 } 459 460 if ( targetDecLayerIdSet.size() == 0 ) // Cannot mark if we don't know the number of scalable layers 461 { 462 return; 463 } 464 465 for (std::vector<Int>::iterator it = targetDecLayerIdSet.begin(); it != targetDecLayerIdSet.end(); it++) 466 { 467 if ( latestDecLayerId == (*it) ) 468 { 469 latestDecIdx = numTargetDecLayers; 470 } 471 targetDecLayerIdList[numTargetDecLayers++] = (*it); 472 } 473 474 Int remainingInterLayerReferencesFlag = 0; 475 if ( currTid <= pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(latestDecLayerId) - 1 ) 476 { 477 for ( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ ) 478 { 479 for ( Int k = 0; k < m_ppcTDecTop[targetDecLayerIdList[j]]->getNumDirectRefLayers(); k++ ) 480 { 481 if ( latestDecIdx == m_ppcTDecTop[targetDecLayerIdList[j]]->getRefLayerId(k) ) 482 { 483 remainingInterLayerReferencesFlag = 1; 484 } 485 } 486 } 487 } 488 489 if ( remainingInterLayerReferencesFlag == 0 ) 490 { 491 pcSlice->setReferenced(false); 492 } 493 } 494 #endif 495 368 496 Void TDecTop::xCreateLostPicture(Int iLostPoc) 369 497 { … … 478 606 m_apcSlicePilot->setSPS(sps); 479 607 pps->setSPS(sps); 608 #if REPN_FORMAT_IN_VPS 480 609 pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumColumnsMinus1() + 1) : 1); 610 #else 611 pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumColumnsMinus1() + 1) : 1); 612 #endif 481 613 pps->setMinCuDQPSize( sps->getMaxCUWidth() >> ( pps->getMaxCuDQPDepth()) ); 482 614 615 #if REPN_FORMAT_IN_VPS 616 g_bitDepthY = m_apcSlicePilot->getBitDepthY(); 617 g_bitDepthC = m_apcSlicePilot->getBitDepthC(); 618 #else 483 619 g_bitDepthY = sps->getBitDepthY(); 484 620 g_bitDepthC = sps->getBitDepthC(); 621 #endif 485 622 g_uiMaxCUWidth = sps->getMaxCUWidth(); 486 623 g_uiMaxCUHeight = sps->getMaxCUHeight(); … … 499 636 500 637 m_cSAO.destroy(); 638 #if REPN_FORMAT_IN_VPS 639 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() ); 640 #else 501 641 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() ); 642 #endif 502 643 m_cLoopFilter.create( sps->getMaxCUDepth() ); 503 644 } 504 645 505 646 #if SVC_EXTENSION 647 #if POC_RESET_FLAG 648 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC ) 649 #else 506 650 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC ) 651 #endif 507 652 #else 508 653 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) … … 538 683 m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId); 539 684 685 #if SVC_EXTENSION 540 686 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 541 687 setRefLayerParams(m_apcSlicePilot->getVPS()); 542 688 #endif 543 #if REF_IDX_FRAMEWORK &&M0457_COL_PICTURE_SIGNALING689 #if M0457_COL_PICTURE_SIGNALING 544 690 m_apcSlicePilot->setNumMotionPredRefLayers(m_numMotionPredRefLayers); 545 691 #endif 546 547 #if SVC_EXTENSION548 692 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 549 693 m_apcSlicePilot->setNumSamplePredRefLayers( getNumSamplePredRefLayers() ); … … 554 698 #endif 555 699 700 // set POC for dependent slices in skipped pictures 701 if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped) 702 { 703 m_apcSlicePilot->setPOC(m_skippedPOC); 704 } 705 706 m_apcSlicePilot->setAssociatedIRAPPOC(m_pocCRA); 707 m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType); 708 556 709 // Skip pictures due to random access 557 710 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) 558 711 { 712 m_prevSliceSkipped = true; 713 m_skippedPOC = m_apcSlicePilot->getPOC(); 559 714 return false; 560 715 } … … 562 717 if (isSkipPictureForBLA(iPOCLastDisplay)) 563 718 { 719 m_prevSliceSkipped = true; 720 m_skippedPOC = m_apcSlicePilot->getPOC(); 564 721 return false; 565 722 } 723 724 // clear previous slice skipped flag 725 m_prevSliceSkipped = false; 566 726 567 727 // exit when a new picture is found … … 594 754 // actual decoding starts here 595 755 xActivateParameterSets(); 596 756 #if 0 // N0147_IRAP_ALIGN_FLAG Disabled for now! 757 //When cross_layer_irap_aligned_flag is equal to 0, num_extra_slice_header_bits >=1 758 if(!m_apcSlicePilot->getVPS()->getCrossLayerIrapAlignFlag() ) 759 { 760 assert( m_apcSlicePilot->getPPS()->getNumExtraSliceHeaderBits() > 0); 761 } 762 //When cross_layer_irap_aligned_flag is equal to 1, the value of poc_reset_flag shall be equal to 0 763 if( m_apcSlicePilot->getVPS()->getCrossLayerIrapAlignFlag() ) 764 { 765 assert( m_apcSlicePilot->getPocResetFlag() == 0); 766 } 767 #endif 768 769 #if REPN_FORMAT_IN_VPS 770 // Initialize ILRP if needed, only for the current layer 771 // ILRP intialization should go along with activation of parameters sets, 772 // although activation of parameter sets itself need not be done for each and every slice!!! 773 xInitILRP(m_apcSlicePilot); 774 #endif 597 775 if (m_apcSlicePilot->isNextSlice()) 598 776 { … … 604 782 } 605 783 m_bFirstSliceInSequence = false; 784 #if POC_RESET_FLAG 785 // This operation would do the following: 786 // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture. 787 // 2. Update the value of m_pocCRA. 788 // 3. Reset the POC values at the decoder for the current picture to be zero. 789 // 4. update value of POCLastDisplay 790 if( m_apcSlicePilot->getPocResetFlag() ) 791 { 792 if( m_apcSlicePilot->getSliceIdx() == 0 ) 793 { 794 Int pocAdjustValue = m_apcSlicePilot->getPOC(); 795 796 // If poc reset flag is set to 1, reset all POC for DPB -> basically do it for each slice in the picutre 797 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 798 799 // Iterate through all picture in DPB 800 while( iterPic != m_cListPic.end() ) 801 { 802 TComPic *dpbPic = *iterPic; 803 // Check if the picture pointed to by iterPic is either used for reference or 804 // needed for output, are in the same layer, and not the current picture. 805 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 806 &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() ) 807 && ( dpbPic->getReconMark() ) 808 ) 809 { 810 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 811 { 812 813 TComSlice *slice = dpbPic->getSlice(i); 814 TComReferencePictureSet *rps = slice->getRPS(); 815 slice->setPOC( slice->getPOC() - pocAdjustValue ); 816 817 // Also adjust the POC value stored in the RPS of each such slice 818 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 819 { 820 rps->setPOC( j, rps->getPOC(j) - pocAdjustValue ); 821 } 822 // Also adjust the value of refPOC 823 for(Int k = 0; k < 2; k++) // For List 0 and List 1 824 { 825 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 826 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 827 { 828 slice->setRefPOC( slice->getRefPOC(list, j) - pocAdjustValue, list, j); 829 } 830 } 831 } 832 } 833 iterPic++; 834 } 835 // Update the value of pocCRA 836 m_pocCRA -= pocAdjustValue; 837 // Update value of POCLastDisplay 838 iPOCLastDisplay -= pocAdjustValue; 839 } 840 // Reset current poc for current slice and RPS 841 m_apcSlicePilot->setPOC( 0 ); 842 } 843 #endif 844 #if ALIGN_TSA_STSA_PICS 845 if( m_apcSlicePilot->getLayerId() > 0 ) 846 { 847 // Check for TSA alignment 848 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 849 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R 850 ) 851 { 852 for(Int dependentLayerIdx = 0; dependentLayerIdx < m_apcSlicePilot->getVPS()->getNumDirectRefLayers(m_layerId); dependentLayerIdx++) 853 { 854 TComList<TComPic*> *cListPic = getRefLayerDec( dependentLayerIdx )->getListPic(); 855 TComPic* refpicLayer = m_apcSlicePilot->getRefPic(*cListPic, m_apcSlicePilot->getPOC() ); 856 if( refpicLayer ) 857 { 858 assert( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 859 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R ); // TSA pictures should be aligned among depenedent layers 860 } 861 } 862 } 863 // Check for STSA alignment 864 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N || 865 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R 866 ) 867 { 868 for(Int dependentLayerIdx = 0; dependentLayerIdx < m_apcSlicePilot->getVPS()->getNumDirectRefLayers(m_layerId); dependentLayerIdx++) 869 { 870 TComList<TComPic*> *cListPic = getRefLayerDec( dependentLayerIdx )->getListPic(); 871 TComPic* refpicLayer = m_apcSlicePilot->getRefPic(*cListPic, m_apcSlicePilot->getPOC() ); // STSA pictures should be aligned among dependent layers 872 if( refpicLayer ) 873 874 { 875 assert( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N || 876 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R ); 877 } 878 } 879 } 880 } 881 #endif 606 882 //detect lost reference picture and insert copy of earlier frame. 607 883 Int lostPoc; … … 617 893 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 618 894 fstream* pFile = m_ppcTDecTop[0]->getBLReconFile(); 619 #if ILP_DECODED_PICTURE620 895 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth(); 621 896 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight(); 622 #else623 const Window &conf = pBLPic->getConformanceWindow();624 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth() - conf.getWindowLeftOffset() - conf.getWindowRightOffset();625 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight() - conf.getWindowTopOffset() - conf.getWindowBottomOffset();626 #endif627 897 628 898 if( pFile->good() ) … … 674 944 xGetNewPicBuffer (m_apcSlicePilot, pcPic); 675 945 946 Bool isField = false; 947 Bool isTff = false; 948 949 if(!m_SEIs.empty()) 950 { 951 // Check if any new Picture Timing SEI has arrived 952 SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING); 953 if (pictureTimingSEIs.size()>0) 954 { 955 SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin()); 956 isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2); 957 isTff = (pictureTiming->m_picStruct == 1); 958 } 959 } 960 961 //Set Field/Frame coding mode 962 m_pcPic->setField(isField); 963 m_pcPic->setTopField(isTff); 964 676 965 // transfer any SEI messages that have been received to the picture 677 966 pcPic->setSEIs(m_SEIs); … … 813 1102 if (bNextSlice) 814 1103 { 815 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_ prevRAPisBLA, m_cListPic );1104 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic ); 816 1105 // Set reference list 817 #if REF_IDX_FRAMEWORK1106 #if SVC_EXTENSION 818 1107 if (m_layerId == 0) 819 1108 #endif … … 867 1156 #endif 868 1157 869 #if SIMPLIFIED_MV_POS_SCALING870 1158 #if SCALED_REF_LAYER_OFFSETS 871 1159 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); … … 891 1179 g_posScalingFactor[refLayerIdc][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 892 1180 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 893 #endif894 1181 895 1182 #if SVC_UPSAMPLING … … 911 1198 } 912 1199 913 #if REF_IDX_FRAMEWORK914 1200 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 915 1201 { … … 927 1213 #endif 928 1214 } 929 #endif930 1215 pcSlice->setRefPicList( m_cListPic, false, m_cIlpPic); 931 1216 } … … 940 1225 #endif //SVC_EXTENSION 941 1226 1227 #if N0147_IRAP_ALIGN_FLAG 1228 if( m_layerId > 0 && pcSlice->getVPS()->getCrossLayerIrapAlignFlag()) 1229 { 1230 for(Int dependentLayerIdx = 0; dependentLayerIdx < pcSlice->getVPS()->getNumDirectRefLayers(m_layerId); dependentLayerIdx++) 1231 { 1232 TComList<TComPic*> *cListPic = getRefLayerDec( dependentLayerIdx )->getListPic(); 1233 TComPic* refpicLayer = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() ); 1234 if(refpicLayer && pcSlice->isIRAP()) 1235 { 1236 assert(pcSlice->getNalUnitType() == refpicLayer->getSlice(0)->getNalUnitType()); 1237 } 1238 } 1239 } 1240 #endif 1241 942 1242 // For generalized B 943 1243 // note: maybe not existed case (always L0 is copied to L1 if L1 is empty) … … 986 1286 if(pcSlice->getSPS()->getScalingListFlag()) 987 1287 { 1288 #if IL_SL_SIGNALLING_N0371 1289 pcSlice->getSPS()->getScalingList()->setLayerId( m_layerId ); 1290 #endif 1291 988 1292 pcSlice->setScalingList ( pcSlice->getSPS()->getScalingList() ); 1293 989 1294 if(pcSlice->getPPS()->getScalingListPresentFlag()) 990 1295 { 1296 #if IL_SL_SIGNALLING_N0371 1297 pcSlice->getPPS()->getScalingList()->setLayerId( m_layerId ); 1298 #endif 1299 991 1300 pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList() ); 992 1301 } 993 pcSlice->getScalingList()->setUseTransformSkip(pcSlice->getPPS()->getUseTransformSkip());994 1302 if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag()) 995 1303 { 1304 #if IL_SL_SIGNALLING_N0371 1305 pcSlice->setDefaultScalingList( m_layerId ); 1306 #else 996 1307 pcSlice->setDefaultScalingList(); 1308 #endif 997 1309 } 998 1310 m_cTrQuant.setScalingListDec(pcSlice->getScalingList()); … … 1001 1313 else 1002 1314 { 1315 #if IL_SL_SIGNALLING_N0371 1316 m_cTrQuant.setFlatScalingList( m_layerId ); 1317 #else 1003 1318 m_cTrQuant.setFlatScalingList(); 1319 #endif 1004 1320 m_cTrQuant.setUseScalingList(false); 1005 1321 } … … 1032 1348 sps->setLayerId(m_layerId); 1033 1349 #endif 1350 1034 1351 #if SPS_SUB_LAYER_INFO 1035 1352 m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder[0] ); … … 1042 1359 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 1043 1360 #endif 1044 #if REF_IDX_FRAMEWORK 1361 #if SVC_EXTENSION 1362 #if !REPN_FORMAT_IN_VPS // ILRP can only be initialized at activation 1045 1363 if(m_numLayer>0) 1046 1364 { … … 1048 1366 } 1049 1367 #endif 1368 #endif 1050 1369 } 1051 1370 … … 1053 1372 { 1054 1373 TComPPS* pps = new TComPPS(); 1374 1375 #if IL_SL_SIGNALLING_N0371 1376 pps->setLayerId(m_layerId); 1377 #endif 1378 1055 1379 m_cEntropyDecoder.decodePPS( pps ); 1056 1380 #if SVC_EXTENSION … … 1079 1403 if(nalUnitType == NAL_UNIT_SUFFIX_SEI) 1080 1404 { 1405 #if RANDOM_ACCESS_SEI_FIX 1406 if (m_prevSliceSkipped) // No need to decode SEI messages of a skipped access unit 1407 { 1408 return; 1409 } 1410 #endif 1081 1411 #if M0043_LAYERS_PRESENT_SEI 1082 1412 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveVPS(), m_parameterSetManagerDecoder[m_layerId].getActiveSPS() ); … … 1148 1478 { 1149 1479 case NAL_UNIT_VPS: 1480 #if VPS_NUH_LAYER_ID 1481 assert( nalu.m_layerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1482 #endif 1150 1483 xDecodeVPS(); 1151 1484 #if AVC_BASE … … 1247 1580 Bool TDecTop::isSkipPictureForBLA(Int& iPOCLastDisplay) 1248 1581 { 1249 if (m_prevRAPisBLA && m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N)) 1582 if ((m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_N_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_RADL) && 1583 m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N)) 1250 1584 { 1251 1585 iPOCLastDisplay++; -
trunk/source/Lib/TLibDecoder/TDecTop.h
r345 r442 67 67 Int m_iMaxRefPicNum; 68 68 69 NalUnitType m_associatedIRAPType; ///< NAL unit type of the associated IRAP picture 69 70 Int m_pocCRA; ///< POC number of the latest CRA picture 70 Bool m_prevRAPisBLA; ///< true if the previous RAP (CRA/CRANT/BLA/BLANT/IDR) picture is a BLA/BLANT picture71 71 Int m_pocRandomAccess; ///< POC number of the random access point (the first IDR or CRA picture) 72 72 … … 79 79 80 80 TComSlice* m_apcSlicePilot; 81 81 82 82 SEIMessages m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices 83 83 … … 107 107 Bool m_bFirstSliceInSequence; 108 108 #endif 109 Bool m_prevSliceSkipped; 110 Int m_skippedPOC; 109 111 110 112 #if SVC_EXTENSION … … 118 120 fstream* m_pBLReconFile; 119 121 Int m_iBLSourceWidth; 120 Int m_iBLSourceHeight; 122 Int m_iBLSourceHeight; 121 123 #endif 122 124 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS … … 130 132 Bool m_motionPredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1]; 131 133 #endif 134 TComPic* m_cIlpPic[MAX_NUM_REF]; ///< Inter layer Prediction picture = upsampled picture 132 135 #endif 133 136 #if AVC_SYNTAX || SYNTAX_OUTPUT 134 137 fstream* m_pBLSyntaxFile; 135 #endif136 #if REF_IDX_FRAMEWORK137 TComPic* m_cIlpPic[MAX_NUM_REF]; ///< Inter layer Prediction picture = upsampled picture138 138 #endif 139 139 … … 157 157 158 158 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); 159 160 #if SVC_EXTENSION 159 #if SVC_EXTENSION 160 #if EARLY_REF_PIC_MARKING 161 Void earlyPicMarking(Int maxTemporalLayer, std::vector<Int>& targetDecLayerIdList); 162 #endif 161 163 UInt getLayerId () { return m_layerId; } 162 164 Void setLayerId (UInt layer) { m_layerId = layer; } … … 206 208 Int getBLHeight() { return m_iBLSourceHeight; } 207 209 #endif 210 #if REPN_FORMAT_IN_VPS 211 Void xInitILRP(TComSlice *slice); 212 #else 213 Void xInitILRP(TComSPS *pcSPS); 214 #endif 215 Void setILRPic(TComPic *pcPic); 208 216 #endif 209 217 #if AVC_SYNTAX || SYNTAX_OUTPUT … … 211 219 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 212 220 #endif 213 #if REF_IDX_FRAMEWORK214 Void xInitILRP(TComSPS *pcSPS);215 Void setILRPic(TComPic *pcPic);216 #endif217 221 218 222 protected: … … 222 226 Void xActivateParameterSets(); 223 227 #if SVC_EXTENSION 228 #if POC_RESET_FLAG 229 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 230 #else 224 231 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 232 #endif 225 233 #else 226 234 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); -
trunk/source/Lib/TLibEncoder/SEIwrite.cpp
r313 r442 95 95 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n"); 96 96 break; 97 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 98 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 99 fprintf( g_hTrace, "=========== Inter Layer Constrained Tile Sets SEI message ===========\n"); 100 break; 101 #endif 97 102 case SEI::SCALABLE_NESTING: 98 103 fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n"); … … 153 158 xWriteSEISOPDescription(*static_cast<const SEISOPDescription*>(&sei)); 154 159 break; 160 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 161 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 162 xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei)); 163 break; 164 #endif 155 165 case SEI::SCALABLE_NESTING: 156 166 xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps); … … 559 569 } 560 570 571 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 572 Void SEIWriter::xWriteSEIInterLayerConstrainedTileSets(const SEIInterLayerConstrainedTileSets& sei) 573 { 574 WRITE_FLAG( sei.m_ilAllTilesExactSampleValueMatchFlag, "il_all_tiles_exact_sample_value_match_flag" ); 575 WRITE_FLAG( sei.m_ilOneTilePerTileSetFlag, "il_one_tile_per_tile_set_flag" ); 576 if( !sei.m_ilOneTilePerTileSetFlag ) 577 { 578 WRITE_UVLC( sei.m_ilNumSetsInMessageMinus1, "il_num_sets_in_message_minus1" ); 579 if( sei.m_ilNumSetsInMessageMinus1 ) 580 { 581 WRITE_FLAG( sei.m_skippedTileSetPresentFlag, "skipped_tile_set_present_flag" ); 582 } 583 UInt numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - (sei.m_skippedTileSetPresentFlag ? 1 : 0) + 1; 584 for( UInt i = 0; i < numSignificantSets; i++ ) 585 { 586 WRITE_UVLC( sei.m_ilctsId[i], "ilcts_id" ); 587 WRITE_UVLC( sei.m_ilNumTileRectsInSetMinus1[i], "il_num_tile_rects_in_set_minus1" ); 588 for( UInt j = 0; j <= sei.m_ilNumTileRectsInSetMinus1[i]; j++ ) 589 { 590 WRITE_UVLC( sei.m_ilTopLeftTileIndex[i][j], "il_top_left_tile_index" ); 591 WRITE_UVLC( sei.m_ilBottomRightTileIndex[i][j], "il_bottom_right_tile_index" ); 592 } 593 WRITE_CODE( sei.m_ilcIdc[i], 2, "ilc_idc" ); 594 if( sei.m_ilAllTilesExactSampleValueMatchFlag ) 595 { 596 WRITE_FLAG( sei.m_ilExactSampleValueMatchFlag[i], "il_exact_sample_value_match_flag" ); 597 } 598 } 599 } 600 else 601 { 602 WRITE_CODE( sei.m_allTilesIlcIdc, 2, "all_tiles_ilc_idc" ); 603 } 604 605 xWriteByteAlign(); 606 } 607 #endif 608 561 609 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps) 562 610 { -
trunk/source/Lib/TLibEncoder/SEIwrite.h
r313 r442 68 68 #endif 69 69 Void xWriteSEISOPDescription(const SEISOPDescription& sei); 70 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 71 Void xWriteSEIInterLayerConstrainedTileSets(const SEIInterLayerConstrainedTileSets& sei); 72 #endif 70 73 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps); 71 74 Void xWriteByteAlign(); -
trunk/source/Lib/TLibEncoder/TEncAnalyze.cpp
r313 r442 57 57 #endif 58 58 59 TEncAnalyze m_gcAnalyzeAll_in; 59 60 //! \} -
trunk/source/Lib/TLibEncoder/TEncAnalyze.h
r313 r442 131 131 fclose(pFile); 132 132 } 133 134 Void printOutInterlaced ( Char cDelim, Double bits ) 135 { 136 Double dFps = m_dFrmRate; //--CFG_KDY 137 Double dScale = dFps / 1000 / (Double)m_uiNumPic; 138 139 printf( "\tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR \n" ); 140 //printf( "\t------------ " " ----------" " -------- " " -------- " " --------\n" ); 141 printf( "\t %8d %c" "%12.4lf " "%8.4lf " "%8.4lf " "%8.4lf\n", 142 getNumPic(), cDelim, 143 bits * dScale, 144 getPsnrY() / (Double)getNumPic(), 145 getPsnrU() / (Double)getNumPic(), 146 getPsnrV() / (Double)getNumPic() ); 147 } 148 149 Void printSummaryOutInterlaced (Int bits) 150 { 151 FILE* pFile = fopen ("summaryTotal.txt", "at"); 152 Double dFps = m_dFrmRate; //--CFG_KDY 153 Double dScale = dFps / 1000 / (Double)m_uiNumPic; 154 155 fprintf(pFile, "%f\t %f\t %f\t %f\n", bits * dScale, 156 getPsnrY() / (Double)getNumPic(), 157 getPsnrU() / (Double)getNumPic(), 158 getPsnrV() / (Double)getNumPic() ); 159 fclose(pFile); 160 } 133 161 134 162 Void printSummary(Char ch) … … 178 206 #endif 179 207 208 extern TEncAnalyze m_gcAnalyzeAll_in; 180 209 //! \} 181 210 -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r345 r442 221 221 } 222 222 WRITE_FLAG( pcPPS->getScalingListPresentFlag() ? 1 : 0, "pps_scaling_list_data_present_flag" ); 223 224 #if IL_SL_SIGNALLING_N0371 225 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 226 #endif 227 223 228 if( pcPPS->getScalingListPresentFlag() ) 224 229 { … … 226 231 printf("PPS\n"); 227 232 #endif 233 234 #if IL_SL_SIGNALLING_N0371 235 m_pcSlice->getScalingList()->setLayerId( pcPPS->getLayerId() ); 236 237 if( pcPPS->getLayerId() > 0 ) 238 { 239 WRITE_FLAG( pcPPS->getPredScalingListFlag() ? 1 : 0, "pps_pred_scaling_list_flag" ); 240 m_pcSlice->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() ); 241 242 if( pcPPS->getPredScalingListFlag() ) 243 { 244 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 245 assert( /*pcPPS->getScalingListRefLayerId() >= 0 &&*/ pcPPS->getScalingListRefLayerId() <= 62 ); 246 247 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of pps_scaling_list_ref_layer_id shall be greater than 0 248 if( pcPPS->getSPS()->getVPS()->getAvcBaseLayerFlag() ) 249 { 250 assert( pcPPS->getScalingListRefLayerId() > 0 ); 251 } 252 253 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 254 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 255 assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 256 257 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 258 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 259 assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true ); 260 261 WRITE_UVLC( pcPPS->getScalingListRefLayerId(), "scaling_list_pps_ref_layer_id" ); 262 m_pcSlice->getScalingList()->setScalingListRefLayerId( pcPPS->getScalingListRefLayerId() ); 263 codeScalingList( m_pcSlice->getScalingList() ); 264 } 265 else 266 { 267 codeScalingList( m_pcSlice->getScalingList() ); 268 } 269 } 270 else 271 { 272 codeScalingList( m_pcSlice->getScalingList() ); 273 } 274 #else 228 275 codeScalingList( m_pcSlice->getScalingList() ); 276 #endif 277 229 278 } 230 279 WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag"); … … 414 463 } 415 464 #endif 465 #ifdef SPS_PTL_FIX 466 if (pcSPS->getLayerId() == 0) 467 { 468 codePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 469 } 470 #else 416 471 codePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 472 #endif 417 473 WRITE_UVLC( pcSPS->getSPSId (), "sps_seq_parameter_set_id" ); 418 WRITE_UVLC( pcSPS->getChromaFormatIdc (), "chroma_format_idc" ); 419 assert(pcSPS->getChromaFormatIdc () == 1); 420 // in the first version chroma_format_idc can only be equal to 1 (4:2:0) 421 if( pcSPS->getChromaFormatIdc () == 3 ) 422 { 423 WRITE_FLAG( 0, "separate_colour_plane_flag"); 424 } 425 426 WRITE_UVLC( pcSPS->getPicWidthInLumaSamples (), "pic_width_in_luma_samples" ); 427 WRITE_UVLC( pcSPS->getPicHeightInLumaSamples(), "pic_height_in_luma_samples" ); 474 #if REPN_FORMAT_IN_VPS 475 if( pcSPS->getLayerId() > 0 ) 476 { 477 WRITE_FLAG( pcSPS->getUpdateRepFormatFlag(), "update_rep_format_flag" ); 478 } 479 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 480 { 481 #endif 482 WRITE_UVLC( pcSPS->getChromaFormatIdc (), "chroma_format_idc" ); 483 assert(pcSPS->getChromaFormatIdc () == 1); 484 // in the first version chroma_format_idc can only be equal to 1 (4:2:0) 485 if( pcSPS->getChromaFormatIdc () == 3 ) 486 { 487 WRITE_FLAG( 0, "separate_colour_plane_flag"); 488 } 489 490 WRITE_UVLC( pcSPS->getPicWidthInLumaSamples (), "pic_width_in_luma_samples" ); 491 WRITE_UVLC( pcSPS->getPicHeightInLumaSamples(), "pic_height_in_luma_samples" ); 492 #if REPN_FORMAT_IN_VPS 493 } 494 #endif 428 495 Window conf = pcSPS->getConformanceWindow(); 429 496 … … 437 504 } 438 505 439 WRITE_UVLC( pcSPS->getBitDepthY() - 8, "bit_depth_luma_minus8" ); 440 WRITE_UVLC( pcSPS->getBitDepthC() - 8, "bit_depth_chroma_minus8" ); 441 506 #if REPN_FORMAT_IN_VPS 507 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 508 { 509 assert( pcSPS->getBitDepthY() >= 8 ); 510 assert( pcSPS->getBitDepthC() >= 8 ); 511 #endif 512 WRITE_UVLC( pcSPS->getBitDepthY() - 8, "bit_depth_luma_minus8" ); 513 WRITE_UVLC( pcSPS->getBitDepthC() - 8, "bit_depth_chroma_minus8" ); 514 #if REPN_FORMAT_IN_VPS 515 } 516 #endif 442 517 WRITE_UVLC( pcSPS->getBitsForPOC()-4, "log2_max_pic_order_cnt_lsb_minus4" ); 443 518 … … 463 538 WRITE_UVLC( pcSPS->getQuadtreeTUMaxDepthIntra() - 1, "max_transform_hierarchy_depth_intra" ); 464 539 WRITE_FLAG( pcSPS->getScalingListFlag() ? 1 : 0, "scaling_list_enabled_flag" ); 540 541 #if IL_SL_SIGNALLING_N0371 542 pcSPS->setSPS( pcSPS->getLayerId(), pcSPS ); 543 #endif 544 465 545 if(pcSPS->getScalingListFlag()) 466 546 { … … 471 551 printf("SPS\n"); 472 552 #endif 553 554 #if IL_SL_SIGNALLING_N0371 555 m_pcSlice->getScalingList()->setLayerId( pcSPS->getLayerId() ); 556 557 if( pcSPS->getLayerId() > 0 ) 558 { 559 WRITE_FLAG( pcSPS->getPredScalingListFlag() ? 1 : 0, "sps_pred_scaling_list_flag" ); 560 m_pcSlice->getScalingList()->setPredScalingListFlag( pcSPS->getPredScalingListFlag() ); 561 562 if( pcSPS->getPredScalingListFlag() ) 563 { 564 565 // The value of sps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 566 assert( /*pcSPS->getScalingListRefLayerId() >= 0 &&*/ pcSPS->getScalingListRefLayerId() <= 62 ); 567 568 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 569 if( pcSPS->getVPS()->getAvcBaseLayerFlag() ) 570 { 571 assert( pcSPS->getScalingListRefLayerId() > 0 ); 572 } 573 574 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 575 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 576 assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 577 578 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 579 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 580 assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true ); 581 582 WRITE_UVLC( pcSPS->getScalingListRefLayerId(), "scaling_list_sps_ref_layer_id" ); 583 m_pcSlice->getScalingList()->setScalingListRefLayerId( pcSPS->getScalingListRefLayerId() ); 584 codeScalingList( m_pcSlice->getScalingList() ); 585 } 586 else 587 { 588 codeScalingList( m_pcSlice->getScalingList() ); 589 } 590 } 591 else 592 { 473 593 codeScalingList( m_pcSlice->getScalingList() ); 594 } 595 #else 596 codeScalingList( m_pcSlice->getScalingList() ); 597 #endif 598 474 599 } 475 600 } … … 491 616 TComRPSList* rpsList = pcSPS->getRPSList(); 492 617 TComReferencePictureSet* rps; 493 618 494 619 WRITE_UVLC(rpsList->getNumberOfReferencePictureSets(), "num_short_term_ref_pic_sets" ); 495 620 for(Int i=0; i < rpsList->getNumberOfReferencePictureSets(); i++) … … 540 665 { 541 666 // more syntax elements to be written here 667 668 #if VERT_MV_CONSTRAINT 669 // Vertical MV component restriction is not used in SHVC CTC 670 WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" ); 671 #endif 542 672 #if SCALED_REF_LAYER_OFFSETS 543 #if SCALED_REF_LAYER_OFFSET_FLAG544 WRITE_FLAG( pcSPS->getLayerId() > 0, "scaled_ref_layer_offset_present_flag" );545 673 if( pcSPS->getLayerId() > 0 ) 546 #else547 if( pcSPS->getLayerId() > 0 )548 #endif549 674 { 550 675 WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets(), "num_scaled_ref_layer_offsets" ); … … 593 718 WRITE_FLAG( pcVPS->getTemporalNestingFlag(), "vps_temporal_id_nesting_flag" ); 594 719 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); 720 #if VPS_EXTN_OFFSET 721 WRITE_CODE( pcVPS->getExtensionOffset(), 16, "vps_extension_offset" ); 722 #else 595 723 WRITE_CODE( 0xffff, 16, "vps_reserved_ffff_16bits" ); 724 #endif 596 725 codePTL( pcVPS->getPTL(), true, pcVPS->getMaxTLayers() - 1 ); 597 726 const Bool subLayerOrderingInfoPresentFlag = 1; … … 676 805 #else 677 806 WRITE_FLAG( 1, "vps_extension_flag" ); 678 codeVPSExtension(pcVPS); 679 WRITE_FLAG( 0, "vps_extension2_flag" ); // Flag value of 1 reserved 807 if(1) // Should be conditioned on the value of vps_extension_flag 808 { 809 while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) 810 { 811 WRITE_FLAG(1, "vps_extension_alignment_bit_equal_to_one"); 812 } 813 codeVPSExtension(pcVPS); 814 WRITE_FLAG( 0, "vps_extension2_flag" ); // Flag value of 1 reserved 815 } 680 816 #endif 681 817 //future extensions here.. … … 737 873 } 738 874 #endif 875 #if VIEW_ID_RELATED_SIGNALING 876 // if ( pcVPS->getNumViews() > 1 ) 877 // However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 878 { 879 WRITE_CODE( vps->getViewIdLenMinus1( ), 4, "view_id_len_minus1" ); 880 } 881 882 for( i = 0; i < vps->getNumViews(); i++ ) 883 { 884 WRITE_CODE( vps->getViewIdVal( i ), vps->getViewIdLenMinus1( ) + 1, "view_id_val[i]" ); 885 } 886 #endif 739 887 #if VPS_MOVE_DIR_DEPENDENCY_FLAG 740 888 #if VPS_EXTN_DIRECT_REF_LAYERS … … 750 898 #if JCTVC_M0203_INTERLAYER_PRED_IDC 751 899 #if N0120_MAX_TID_REF_PRESENT_FLAG 752 WRITE_FLAG( vps->getMaxTid IlRefPicsPlus1PresentFlag(), "max_tid_il_ref_pics_plus1_present_flag");753 if (vps->getMaxTid IlRefPicsPlus1PresentFlag())900 WRITE_FLAG( vps->getMaxTidRefPresentFlag(), "max_tid_ref_present_flag"); 901 if (vps->getMaxTidRefPresentFlag()) 754 902 { 755 903 for( i = 0; i < vps->getMaxLayers() - 1; i++) 756 904 { 757 WRITE_CODE(vps->getMax SublayerForIlpPlus1(i), 3, "max_sublayer_for_ilp_plus1[i]" );905 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i), 3, "max_tid_il_ref_pics_plus1[i]" ); 758 906 } 759 907 } … … 761 909 for( i = 0; i < vps->getMaxLayers() - 1; i++) 762 910 { 763 WRITE_CODE(vps->getMax SublayerForIlpPlus1(i), 3, "max_sublayer_for_ilp_plus1[i]" );911 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i), 3, "max_tid_il_ref_pics_plus1[i]" ); 764 912 } 765 913 #endif … … 849 997 #endif 850 998 #endif 999 1000 #if REPN_FORMAT_IN_VPS 1001 WRITE_FLAG( vps->getRepFormatIdxPresentFlag(), "rep_format_idx_present_flag"); 1002 1003 if( vps->getRepFormatIdxPresentFlag() ) 1004 { 1005 WRITE_CODE( vps->getVpsNumRepFormats() - 1, 4, "vps_num_rep_formats_minus1" ); 1006 } 1007 for(i = 0; i < vps->getVpsNumRepFormats(); i++) 1008 { 1009 // Read rep_format_structures 1010 codeRepFormat( vps->getVpsRepFormat(i) ); 1011 } 1012 1013 if( vps->getRepFormatIdxPresentFlag() ) 1014 { 1015 for(i = 1; i < vps->getMaxLayers(); i++) 1016 { 1017 if( vps->getVpsNumRepFormats() > 1 ) 1018 { 1019 WRITE_CODE( vps->getVpsRepFormatIdx(i), 4, "vps_rep_format_idx[i]" ); 1020 } 1021 } 1022 } 1023 #endif 1024 851 1025 #if JCTVC_M0458_INTERLAYER_RPS_SIG 852 1026 WRITE_FLAG(vps->getMaxOneActiveRefLayerFlag(), "max_one_active_ref_layer_flag"); 1027 #endif 1028 #if N0147_IRAP_ALIGN_FLAG 1029 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 853 1030 #endif 854 1031 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG … … 875 1052 } 876 1053 } 1054 1055 #if IL_SL_SIGNALLING_N0371 1056 for(i = 1; i < vps->getMaxLayers(); i++) 1057 { 1058 for(j = 0; j < i; j++) 1059 { 1060 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) ); 1061 } 1062 } 1063 #endif 1064 877 1065 #endif 878 1066 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 879 1067 WRITE_FLAG(vps->getSingleLayerForNonIrapFlag(), "single_layer_for_non_irap_flag" ); 880 1068 #endif 1069 1070 #if !VPS_VUI 1071 WRITE_FLAG( 0, "vps_vui_present_flag" ); 1072 #else 1073 WRITE_FLAG( 1, "vps_vui_present_flag" ); 1074 if(1) // Should be conditioned on the value of vps_vui_present_flag 1075 { 1076 while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) 1077 { 1078 WRITE_FLAG(1, "vps_vui_alignment_bit_equal_to_one"); 1079 } 1080 codeVPSVUI(vps); 1081 } 1082 #endif 1083 } 1084 #endif 1085 #if REPN_FORMAT_IN_VPS 1086 Void TEncCavlc::codeRepFormat ( RepFormat *repFormat ) 1087 { 1088 WRITE_CODE( repFormat->getChromaFormatVpsIdc(), 2, "chroma_format_idc" ); 1089 1090 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1091 { 1092 WRITE_FLAG( repFormat->getSeparateColourPlaneVpsFlag(), "separate_colour_plane_flag"); 1093 } 1094 1095 WRITE_CODE ( repFormat->getPicWidthVpsInLumaSamples (), 16, "pic_width_in_luma_samples" ); 1096 WRITE_CODE ( repFormat->getPicHeightVpsInLumaSamples(), 16, "pic_height_in_luma_samples" ); 1097 1098 assert( repFormat->getBitDepthVpsLuma() >= 8 ); 1099 assert( repFormat->getBitDepthVpsChroma() >= 8 ); 1100 WRITE_CODE( repFormat->getBitDepthVpsLuma() - 8, 4, "bit_depth_luma_minus8" ); 1101 WRITE_CODE( repFormat->getBitDepthVpsChroma() - 8, 4, "bit_depth_chroma_minus8" ); 1102 1103 } 1104 #endif 1105 #if VPS_VUI 1106 Void TEncCavlc::codeVPSVUI (TComVPS *vps) 1107 { 1108 Int i,j; 1109 #if VPS_VUI_BITRATE_PICRATE 1110 WRITE_FLAG( vps->getBitRatePresentVpsFlag(), "bit_rate_present_vps_flag" ); 1111 WRITE_FLAG( vps->getPicRatePresentVpsFlag(), "pic_rate_present_vps_flag" ); 1112 1113 if( vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag() ) 1114 { 1115 for( i = 0; i < vps->getNumLayerSets(); i++ ) 1116 { 1117 for( j = 0; j < vps->getMaxTLayers(); j++ ) 1118 { 1119 if( vps->getBitRatePresentVpsFlag() ) 1120 { 1121 WRITE_FLAG( vps->getBitRatePresentFlag( i, j), "bit_rate_present_vps_flag[i][j]" ); 1122 } 1123 if( vps->getPicRatePresentVpsFlag() ) 1124 { 1125 WRITE_FLAG( vps->getPicRatePresentFlag( i, j), "pic_rate_present_vps_flag[i][j]" ); 1126 } 1127 if( vps->getBitRatePresentFlag(i, j) ) 1128 { 1129 WRITE_CODE( vps->getAvgBitRate( i, j ), 16, "avg_bit_rate[i][j]" ); 1130 WRITE_CODE( vps->getAvgBitRate( i, j ), 16, "max_bit_rate[i][j]" ); 1131 } 1132 if( vps->getPicRatePresentFlag(i, j) ) 1133 { 1134 WRITE_CODE( vps->getConstPicRateIdc( i, j), 2 , "constant_pic_rate_idc[i][j]" ); 1135 WRITE_CODE( vps->getConstPicRateIdc( i, j), 16, "avg_pic_rate[i][j]" ); 1136 } 1137 } 1138 } 1139 } 1140 #endif 1141 #if TILE_BOUNDARY_ALIGNED_FLAG 1142 for(i = 1; i < vps->getMaxLayers(); i++) 1143 { 1144 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1145 { 1146 WRITE_FLAG( vps->getTileBoundariesAlignedFlag(i,j) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" ); 1147 } 1148 } 1149 #endif 1150 #if N0160_VUI_EXT_ILP_REF 1151 WRITE_FLAG( vps->getNumIlpRestrictedRefLayers() ? 1 : 0 , "num_ilp_restricted_ref_layers" ); 1152 if( vps->getNumIlpRestrictedRefLayers()) 1153 { 1154 for(i = 1; i < vps->getMaxLayers(); i++) 1155 { 1156 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1157 { 1158 WRITE_UVLC(vps->getMinSpatialSegmentOffsetPlus1( i, j), "min_spatial_segment_offset_plus1[i][j]"); 1159 1160 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 1161 { 1162 WRITE_FLAG( vps->getCtuBasedOffsetEnabledFlag( i, j) ? 1 : 0 , "ctu_based_offset_enabled_flag[i][j]" ); 1163 1164 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 1165 { 1166 WRITE_UVLC(vps->getMinHorizontalCtuOffsetPlus1( i, j), "min_horizontal_ctu_offset_plus1[i][j]"); 1167 } 1168 } 1169 } 1170 } 1171 } 1172 #endif 881 1173 } 882 1174 #endif … … 927 1219 { 928 1220 1221 #if POC_RESET_FLAG 1222 Int iBits = 0; 1223 if( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits ) 1224 { 1225 WRITE_FLAG( pcSlice->getPocResetFlag(), "poc_reset_flag" ); 1226 iBits++; 1227 } 1228 if( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits ) 1229 { 1230 assert(!!"discardable_flag"); 1231 WRITE_FLAG(pcSlice->getDiscardableFlag(), "discardable_flag"); 1232 iBits++; 1233 } 1234 for ( ; iBits < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++) 1235 { 1236 assert(!!"slice_reserved_undetermined_flag[]"); 1237 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1238 } 1239 #else 929 1240 #if SH_DISCARDABLE_FLAG 930 1241 if (pcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) … … 945 1256 } 946 1257 #endif 1258 #endif 947 1259 948 1260 WRITE_UVLC( pcSlice->getSliceType(), "slice_type" ); … … 953 1265 } 954 1266 1267 #if REPN_FORMAT_IN_VPS 1268 // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present 1269 assert( pcSlice->getChromaFormatIdc() == 1 ); 1270 #else 955 1271 // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present 956 1272 assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 ); 1273 #endif 957 1274 // if( separate_colour_plane_flag == 1 ) 958 1275 // colour_plane_id u(2) 959 1276 1277 #if N0065_LAYER_POC_ALIGNMENT 1278 if( pcSlice->getLayerId() > 0 || !pcSlice->getIdrPicFlag() ) 1279 #else 960 1280 if( !pcSlice->getIdrPicFlag() ) 961 { 962 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC()); 1281 #endif 1282 { 1283 #if POC_RESET_FLAG 1284 Int picOrderCntLSB; 1285 if( !pcSlice->getPocResetFlag() ) 1286 { 1287 picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1288 } 1289 else 1290 { 1291 picOrderCntLSB = (pcSlice->getPocValueBeforeReset()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1292 } 1293 #else 1294 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1295 #endif 963 1296 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 1297 1298 #if N0065_LAYER_POC_ALIGNMENT 1299 if( !pcSlice->getIdrPicFlag() ) 1300 { 1301 #endif 964 1302 TComReferencePictureSet* rps = pcSlice->getRPS(); 965 1303 … … 1076 1414 WRITE_FLAG( pcSlice->getEnableTMVPFlag() ? 1 : 0, "slice_temporal_mvp_enable_flag" ); 1077 1415 } 1416 #if N0065_LAYER_POC_ALIGNMENT 1417 } 1418 #endif 1078 1419 } 1079 1420 … … 1224 1565 if ( pcSlice->getEnableTMVPFlag() ) 1225 1566 { 1226 #if REF_IDX_FRAMEWORK&& M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING1567 #if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 1227 1568 if ( !pcSlice->getIdrPicFlag() && pcSlice->getLayerId() > 0 && pcSlice->getActiveNumILRRefIdx() > 0 && pcSlice->getNumMotionPredRefLayers() > 0 ) 1228 1569 { … … 1247 1588 WRITE_UVLC( pcSlice->getColRefIdx(), "collocated_ref_idx" ); 1248 1589 } 1249 #if REF_IDX_FRAMEWORK&& M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING1590 #if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 1250 1591 } 1251 1592 #endif … … 1554 1895 Int iDQp = pcCU->getQP( uiAbsPartIdx ) - pcCU->getRefQP( uiAbsPartIdx ); 1555 1896 1897 #if REPN_FORMAT_IN_VPS 1898 Int qpBdOffsetY = pcCU->getSlice()->getQpBDOffsetY(); 1899 #else 1556 1900 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY(); 1901 #endif 1557 1902 iDQp = (iDQp + 78 + qpBdOffsetY + (qpBdOffsetY/2)) % (52 + qpBdOffsetY) - 26 - (qpBdOffsetY/2); 1558 1903 … … 1682 2027 startBit = m_pcBitIf->getNumberOfWrittenBits(); 1683 2028 #endif 2029 2030 #if IL_SL_SIGNALLING_N0371 2031 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2032 { 2033 scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId ); 2034 WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" ); 2035 if(!scalingListPredModeFlag)// Copy Mode 2036 { 2037 WRITE_UVLC( (Int)listId - (Int)scalingList->getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta"); 2038 } 2039 else// DPCM Mode 2040 { 2041 xCodeScalingList(scalingList, sizeId, listId); 2042 } 2043 } 2044 else 2045 { 2046 scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId ); 2047 WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" ); 2048 if(!scalingListPredModeFlag)// Copy Mode 2049 { 2050 WRITE_UVLC( (Int)listId - (Int)scalingList->getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta"); 2051 } 2052 else// DPCM Mode 2053 { 2054 xCodeScalingList(scalingList, sizeId, listId); 2055 } 2056 } 2057 #else 1684 2058 scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId ); 1685 2059 WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" ); … … 1692 2066 xCodeScalingList(scalingList, sizeId, listId); 1693 2067 } 2068 #endif 2069 1694 2070 #if SCALING_LIST_OUTPUT_RESULT 1695 2071 printf("Matrix [%d][%d] Bit %d\n",sizeId,listId,m_pcBitIf->getNumberOfWrittenBits() - startBit); 1696 2072 #endif 2073 1697 2074 } 1698 2075 } … … 1714 2091 Int data; 1715 2092 Int *src = scalingList->getScalingListAddress(sizeId, listId); 2093 1716 2094 if( sizeId > SCALING_LIST_8x8 ) 1717 2095 { 2096 #if IL_SL_SIGNALLING_N0371 2097 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2098 { 2099 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId); 2100 scalingList->setScalingListDC(sizeId,listId,ref_scalingListDC[scalingList->getScalingListRefLayerId()][sizeId][listId]); 2101 } 2102 else 2103 { 2104 WRITE_SVLC( scalingList->getScalingListDC(sizeId,listId) - 8, "scaling_list_dc_coef_minus8"); 2105 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2106 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId); 2107 } 2108 #else 1718 2109 WRITE_SVLC( scalingList->getScalingListDC(sizeId,listId) - 8, "scaling_list_dc_coef_minus8"); 1719 2110 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2111 #endif 1720 2112 } 1721 2113 for(Int i=0;i<coefNum;i++) 1722 2114 { 2115 #if IL_SL_SIGNALLING_N0371 2116 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2117 { 2118 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = src[scan[i]]; 2119 src[scan[i]] = ref_scalingListCoef[scalingList->getScalingListRefLayerId()][sizeId][listId][i]; 2120 } 2121 else 2122 { 2123 data = src[scan[i]] - nextCoef; 2124 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = src[scan[i]]; 2125 nextCoef = src[scan[i]]; 2126 if(data > 127) 2127 { 2128 data = data - 256; 2129 } 2130 if(data < -128) 2131 { 2132 data = data + 256; 2133 } 2134 2135 WRITE_SVLC( data, "scaling_list_delta_coef"); 2136 } 2137 #else 1723 2138 data = src[scan[i]] - nextCoef; 1724 2139 nextCoef = src[scan[i]]; … … 1733 2148 1734 2149 WRITE_SVLC( data, "scaling_list_delta_coef"); 2150 #endif 1735 2151 } 1736 2152 } … … 1738 2154 { 1739 2155 // Bool state = true, state2 = false; 1740 Int lsb = ltrpPOC % (1<<pcSlice->getSPS()->getBitsForPOC());2156 Int lsb = ltrpPOC & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1741 2157 for (Int k = 0; k < pcSlice->getSPS()->getNumLongTermRefPicSPS(); k++) 1742 2158 { -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r345 r442 87 87 Void codeVPSExtension ( TComVPS* pcVPS ); 88 88 #endif 89 90 #if VPS_VUI 91 Void codeVPSVUI (TComVPS *vps); 92 #endif 93 #if REPN_FORMAT_IN_VPS 94 Void codeRepFormat ( RepFormat *repFormat ); 95 #endif 89 96 Void codeVUI ( TComVUI *pcVUI, TComSPS* pcSPS ); 90 97 Void codeSPS ( TComSPS* pcSPS ); -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r313 r442 69 69 Int m_numRefIdc; 70 70 Int m_refIdc[MAX_NUM_REF_PICS+1]; 71 #if EXTERNAL_USEDBYCURR_N0082 72 Int m_UseExtusedByCurrPic; 73 Int m_ExtusedByCurrPic[MAX_NUM_REF_PICS]; 74 #endif 71 75 GOPEntry() 72 76 : m_POC(-1) … … 83 87 , m_deltaRPS(0) 84 88 , m_numRefIdc(0) 89 #if EXTERNAL_USEDBYCURR_N0082 90 , m_UseExtusedByCurrPic(0) 91 #endif 85 92 { 86 93 ::memset( m_referencePics, 0, sizeof(m_referencePics) ); 87 94 ::memset( m_usedByCurrPic, 0, sizeof(m_usedByCurrPic) ); 88 95 ::memset( m_refIdc, 0, sizeof(m_refIdc) ); 96 #if EXTERNAL_USEDBYCURR_N0082 97 ::memset( m_usedByCurrPic, 0, sizeof(m_ExtusedByCurrPic) ); 98 #endif 89 99 } 90 100 }; 91 101 92 102 std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry); //input 103 104 #if REPN_FORMAT_IN_VPS 105 struct RepFormatCfg 106 { 107 Int m_chromaFormatIdc; 108 Bool m_separateColourPlaneFlag; 109 Int m_picWidthInLumaSamples; 110 Int m_picHeightInLumaSamples; 111 Int m_bitDepthLuma; 112 Int m_bitDepthChroma; 113 RepFormatCfg() 114 : m_chromaFormatIdc (CHROMA_420) 115 , m_separateColourPlaneFlag (0) 116 , m_picWidthInLumaSamples (352) 117 , m_picHeightInLumaSamples (288) 118 , m_bitDepthLuma (8) 119 , m_bitDepthChroma (8) 120 {} 121 }; 122 std::istringstream &operator>>(std::istringstream &in, RepFormatCfg &repFormatCfg); 123 #endif 124 93 125 //! \ingroup TLibEncoder 94 126 //! \{ … … 155 187 #endif 156 188 #endif 189 #if N0120_MAX_TID_REF_CFG 190 Int m_maxTidIlRefPicsPlus1; 191 #endif 157 192 //======= Transform ============= 158 193 UInt m_uiQuadtreeTULog2MaxSize; … … 283 318 Int m_SOPDescriptionSEIEnabled; 284 319 Int m_scalableNestingSEIEnabled; 320 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 321 Bool m_interLayerConstrainedTileSetsSEIEnabled; 322 UInt m_ilNumSetsInMessage; 323 Bool m_skippedTileSetPresentFlag; 324 UInt m_topLeftTileIndex[1024]; 325 UInt m_bottomRightTileIndex[1024]; 326 UInt m_ilcIdc[1024]; 327 #endif 285 328 //====== Weighted Prediction ======== 286 329 Bool m_useWeightedPred; //< Use of Weighting Prediction (P_SLICE) … … 353 396 UInt m_layerId; 354 397 UInt m_numLayer; 355 #endif 356 #if REF_IDX_FRAMEWORK 357 Int m_elRapSliceBEnabled; 358 #endif 398 Int m_elRapSliceBEnabled; 359 399 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 360 Int m_adaptiveResolutionChange; 400 Int m_adaptiveResolutionChange; 401 #endif 361 402 #endif 362 403 … … 438 479 #endif 439 480 #endif 481 #if N0120_MAX_TID_REF_CFG 482 Int getMaxTidIlRefPicsPlus1 () { return m_maxTidIlRefPicsPlus1; } 483 Void setMaxTidIlRefPicsPlus1 (Int num) { m_maxTidIlRefPicsPlus1 = num; } 484 #endif 440 485 //======== Transform ============= 441 486 Void setQuadtreeTULog2MaxSize ( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } … … 720 765 Void setScalableNestingSEIEnabled(Int b) { m_scalableNestingSEIEnabled = b; } 721 766 Int getScalableNestingSEIEnabled() { return m_scalableNestingSEIEnabled; } 767 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 768 Void setInterLayerConstrainedTileSetsSEIEnabled(Bool b) { m_interLayerConstrainedTileSetsSEIEnabled = b; } 769 Bool getInterLayerConstrainedTileSetsSEIEnabled() { return m_interLayerConstrainedTileSetsSEIEnabled; } 770 Void setIlNumSetsInMessage(UInt b) { m_ilNumSetsInMessage = b; } 771 Int getIlNumSetsInMessage() { return m_ilNumSetsInMessage; } 772 Void setSkippedTileSetPresentFlag(Bool b) { m_skippedTileSetPresentFlag = b; } 773 Bool getSkippedTileSetPresentFlag() { return m_skippedTileSetPresentFlag; } 774 Void setTopLeftTileIndex(UInt *b) 775 { 776 for (UInt i = 0; i < m_ilNumSetsInMessage; i++) 777 { 778 m_topLeftTileIndex[i] = b[i]; 779 } 780 } 781 UInt getTopLeftTileIndex(UInt b) { return m_topLeftTileIndex[b]; } 782 Void setBottomRightTileIndex(UInt *b) 783 { 784 for (UInt i = 0; i < m_ilNumSetsInMessage; i++) 785 { 786 m_bottomRightTileIndex[i] = b[i]; 787 } 788 } 789 UInt getBottomRightTileIndex(UInt b) { return m_bottomRightTileIndex[b]; } 790 Void setIlcIdc(UInt *b) 791 { 792 for (UInt i = 0; i < m_ilNumSetsInMessage; i++) 793 { 794 m_ilcIdc[i] = b[i]; 795 } 796 } 797 UInt getIlcIdc(UInt b) { return m_ilcIdc[b]; } 798 #endif 722 799 Void setUseWP ( Bool b ) { m_useWeightedPred = b; } 723 800 Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } … … 858 935 Void setConformanceMode (Int mode) { m_conformanceMode = mode; } 859 936 Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } 860 #endif861 #if REF_IDX_FRAMEWORK862 937 Void setElRapSliceTypeB(Int bEnabled) {m_elRapSliceBEnabled = bEnabled;} 863 938 Int getElRapSliceTypeB() {return m_elRapSliceBEnabled;} 864 #endif865 939 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 866 940 Void setAdaptiveResolutionChange(Int x) { m_adaptiveResolutionChange = x; } 867 941 Int getAdaptiveResolutionChange() { return m_adaptiveResolutionChange; } 868 942 #endif 943 #endif 869 944 }; 870 945 -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r345 r442 379 379 m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); 380 380 381 // variables for fast encoder decision382 Bool bEarlySkip = false;383 Bool bTrySplit = true;384 Double fRD_Skip = MAX_DOUBLE;385 386 381 // variable for Early CU determination 387 382 Bool bSubBranch = true; … … 390 385 Bool doNotBlockPu = true; 391 386 Bool earlyDetectionSkipMode = false; 392 393 Bool bTrySplitDQP = true;394 395 static Double afCost[ MAX_CU_DEPTH ];396 static Int aiNum [ MAX_CU_DEPTH ];397 398 if ( rpcBestCU->getAddr() == 0 )399 {400 ::memset( afCost, 0, sizeof( afCost ) );401 ::memset( aiNum, 0, sizeof( aiNum ) );402 }403 387 404 388 Bool bBoundary = false; … … 412 396 Int iMaxQP; 413 397 Bool isAddLowestQP = false; 398 #if REPN_FORMAT_IN_VPS 399 Int lowestQP = -rpcTempCU->getSlice()->getQpBDOffsetY(); 400 #else 414 401 Int lowestQP = -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(); 402 #endif 415 403 416 404 if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() ) 417 405 { 418 406 Int idQP = m_pcEncCfg->getMaxDeltaQP(); 407 #if REPN_FORMAT_IN_VPS 419 408 iMinQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQP-idQP ); 420 409 iMaxQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQP+idQP ); 410 #else 411 iMinQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQP-idQP ); 412 iMaxQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQP+idQP ); 413 #endif 421 414 if ( (rpcTempCU->getSlice()->getSPS()->getUseLossless()) && (lowestQP < iMinQP) && rpcTempCU->getSlice()->getPPS()->getUseDQP() ) 422 415 { … … 450 443 Bool bSliceStart = pcSlice->getSliceSegmentCurStartCUAddr()>rpcTempCU->getSCUAddr()&&pcSlice->getSliceSegmentCurStartCUAddr()<rpcTempCU->getSCUAddr()+rpcTempCU->getTotalNumPart(); 451 444 Bool bSliceEnd = (pcSlice->getSliceSegmentCurEndCUAddr()>rpcTempCU->getSCUAddr()&&pcSlice->getSliceSegmentCurEndCUAddr()<rpcTempCU->getSCUAddr()+rpcTempCU->getTotalNumPart()); 445 #if REPN_FORMAT_IN_VPS 446 Bool bInsidePicture = ( uiRPelX < rpcBestCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiBPelY < rpcBestCU->getSlice()->getPicHeightInLumaSamples() ); 447 #else 452 448 Bool bInsidePicture = ( uiRPelX < rpcBestCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < rpcBestCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ); 449 #endif 453 450 // We need to split, so don't try these modes. 454 451 if(!bSliceEnd && !bSliceStart && bInsidePicture ) … … 458 455 if (rpcBestCU->getLayerId() > 0) 459 456 { 460 if(pcSlice->getSliceType() == P_SLICE && pcSlice->getNumRefIdx(REF_PIC_LIST_0) == pcSlice->getActiveNumILRRefIdx()) 461 testInter = false; 462 if(pcSlice->getSliceType() == B_SLICE && pcSlice->getNumRefIdx(REF_PIC_LIST_0) == pcSlice->getActiveNumILRRefIdx() && pcSlice->getNumRefIdx(REF_PIC_LIST_1) == pcSlice->getActiveNumILRRefIdx()) 463 testInter = false; 457 if(pcSlice->getSliceType() == P_SLICE && pcSlice->getNumRefIdx(REF_PIC_LIST_0) == pcSlice->getActiveNumILRRefIdx()) 458 { 459 testInter = false; 460 } 461 if(pcSlice->getSliceType() == B_SLICE && pcSlice->getNumRefIdx(REF_PIC_LIST_0) == pcSlice->getActiveNumILRRefIdx() && pcSlice->getNumRefIdx(REF_PIC_LIST_1) == pcSlice->getActiveNumILRRefIdx()) 462 { 463 testInter = false; 464 } 464 465 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 465 if( pcSlice->getInterLayerSamplePredOnlyFlag() ) 466 testInter = false; 466 if( pcSlice->getInterLayerSamplePredOnlyFlag() ) 467 { 468 testInter = false; 469 } 467 470 #endif 468 471 } … … 474 477 iQP = lowestQP; 475 478 } 476 // variables for fast encoder decision477 bEarlySkip = false;478 bTrySplit = true;479 fRD_Skip = MAX_DOUBLE;480 479 481 480 rpcTempCU->initEstData( uiDepth, iQP ); … … 496 495 xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, &earlyDetectionSkipMode );//by Merge for inter_2Nx2N 497 496 rpcTempCU->initEstData( uiDepth, iQP ); 498 499 // fast encoder decision for early skip 500 if ( m_pcEncCfg->getUseFastEnc() ) 501 { 502 Int iIdx = g_aucConvertToBit[ rpcBestCU->getWidth(0) ]; 503 if ( aiNum [ iIdx ] > 5 && fRD_Skip < EARLY_SKIP_THRES*afCost[ iIdx ]/aiNum[ iIdx ] ) 504 { 505 bEarlySkip = true; 506 bTrySplit = false; 507 } 508 } 497 509 498 #if (ENCODER_FAST_MODE == 2) 510 499 if (testInter) 511 500 { 512 501 #endif 513 514 502 if(!m_pcEncCfg->getUseEarlySkipDetection()) 515 503 { 516 504 // 2Nx2N, NxN 517 if ( !bEarlySkip ) 505 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); rpcTempCU->initEstData( uiDepth, iQP ); 506 if(m_pcEncCfg->getUseCbfFastMode()) 518 507 { 519 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); rpcTempCU->initEstData( uiDepth, iQP ); 520 if(m_pcEncCfg->getUseCbfFastMode()) 521 { 522 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 523 } 508 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 524 509 } 525 510 } 526 511 #if (ENCODER_FAST_MODE == 2) 527 } 528 #endif 529 530 } 531 532 if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() ) 533 { 534 if(iQP == iBaseQP) 535 { 536 bTrySplitDQP = bTrySplit; 537 } 538 } 539 else 540 { 541 bTrySplitDQP = bTrySplit; 542 } 512 } 513 #endif 514 } 515 543 516 if (isAddLowestQP && (iQP == lowestQP)) 544 517 { … … 567 540 // do inter modes, NxN, 2NxN, and Nx2N 568 541 #if (ENCODER_FAST_MODE) 569 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE && testInter )542 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE && testInter ) 570 543 #else 571 544 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE ) … … 573 546 { 574 547 // 2Nx2N, NxN 575 if ( !bEarlySkip)548 if(!( (rpcBestCU->getWidth(0)==8) && (rpcBestCU->getHeight(0)==8) )) 576 549 { 577 if( !( (rpcBestCU->getWidth(0)==8) && (rpcBestCU->getHeight(0)==8) ))550 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && doNotBlockPu) 578 551 { 579 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && doNotBlockPu) 580 { 581 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN ); 582 rpcTempCU->initEstData( uiDepth, iQP ); 583 } 552 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN ); 553 rpcTempCU->initEstData( uiDepth, iQP ); 584 554 } 585 555 } … … 721 691 722 692 // do normal intra modes 723 if ( !bEarlySkip )724 {725 693 // speedup for inter frames 726 694 #if (ENCODER_FAST_MODE) … … 748 716 } 749 717 } 750 }751 718 752 719 // test PCM … … 790 757 rpcBestCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcBestCU->getTotalBits(), rpcBestCU->getTotalDistortion() ); 791 758 792 // accumulate statistics for early skip793 if ( m_pcEncCfg->getUseFastEnc() )794 {795 if ( rpcBestCU->isSkipped(0) )796 {797 Int iIdx = g_aucConvertToBit[ rpcBestCU->getWidth(0) ];798 afCost[ iIdx ] += rpcBestCU->getTotalCost();799 aiNum [ iIdx ] ++;800 }801 }802 803 759 // Early CU determination 804 760 if( m_pcEncCfg->getUseEarlyCU() && rpcBestCU->isSkipped(0) ) … … 827 783 { 828 784 Int idQP = m_pcEncCfg->getMaxDeltaQP(); 785 #if REPN_FORMAT_IN_VPS 786 iMinQP = Clip3( -rpcTempCU->getSlice()->getQpBDOffsetY(), MAX_QP, iBaseQP-idQP ); 787 iMaxQP = Clip3( -rpcTempCU->getSlice()->getQpBDOffsetY(), MAX_QP, iBaseQP+idQP ); 788 #else 829 789 iMinQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQP-idQP ); 830 790 iMaxQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQP+idQP ); 791 #endif 831 792 if ( (rpcTempCU->getSlice()->getSPS()->getUseLossless()) && (lowestQP < iMinQP) && rpcTempCU->getSlice()->getPPS()->getUseDQP() ) 832 793 { … … 878 839 879 840 // further split 880 if( bSubBranch && bTrySplitDQP &&uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth )841 if( bSubBranch && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) 881 842 { 882 843 UChar uhNextDepth = uiDepth+1; … … 890 851 891 852 Bool bInSlice = pcSubBestPartCU->getSCUAddr()+pcSubBestPartCU->getTotalNumPart()>pcSlice->getSliceSegmentCurStartCUAddr()&&pcSubBestPartCU->getSCUAddr()<pcSlice->getSliceSegmentCurEndCUAddr(); 853 #if REPN_FORMAT_IN_VPS 854 if(bInSlice && ( pcSubBestPartCU->getCUPelX() < pcSlice->getPicWidthInLumaSamples() ) && ( pcSubBestPartCU->getCUPelY() < pcSlice->getPicHeightInLumaSamples() ) ) 855 #else 892 856 if(bInSlice && ( pcSubBestPartCU->getCUPelX() < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( pcSubBestPartCU->getCUPelY() < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 857 #endif 893 858 { 894 859 if( m_bUseSBACRD ) … … 1038 1003 UInt uiPosX = ( uiExternalAddress % pcPic->getFrameWidthInCU() ) * g_uiMaxCUWidth+ g_auiRasterToPelX[ g_auiZscanToRaster[uiInternalAddress] ]; 1039 1004 UInt uiPosY = ( uiExternalAddress / pcPic->getFrameWidthInCU() ) * g_uiMaxCUHeight+ g_auiRasterToPelY[ g_auiZscanToRaster[uiInternalAddress] ]; 1005 #if REPN_FORMAT_IN_VPS 1006 UInt uiWidth = pcSlice->getPicWidthInLumaSamples(); 1007 UInt uiHeight = pcSlice->getPicHeightInLumaSamples(); 1008 #else 1040 1009 UInt uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 1041 1010 UInt uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 1011 #endif 1042 1012 while(uiPosX>=uiWidth||uiPosY>=uiHeight) 1043 1013 { … … 1136 1106 iQpOffset = Int(floor( dQpOffset + 0.49999 )); 1137 1107 } 1108 #if REPN_FORMAT_IN_VPS 1109 return Clip3(-pcCU->getSlice()->getQpBDOffsetY(), MAX_QP, iBaseQp+iQpOffset ); 1110 #else 1138 1111 return Clip3(-pcCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQp+iQpOffset ); 1112 #endif 1139 1113 } 1140 1114 … … 1160 1134 pcSlice->getSliceSegmentCurStartCUAddr() < pcPic->getPicSym()->getInverseCUOrderMap(pcCU->getAddr())*pcCU->getPic()->getNumPartInCU()+uiAbsPartIdx+( pcPic->getNumPartInCU() >> (uiDepth<<1) ); 1161 1135 // We need to split, so don't try these modes. 1136 #if REPN_FORMAT_IN_VPS 1137 if(!bSliceStart&&( uiRPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getPicHeightInLumaSamples() ) ) 1138 #else 1162 1139 if(!bSliceStart&&( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 1140 #endif 1163 1141 { 1164 1142 m_pcEntropyCoder->encodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 1181 1159 uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 1182 1160 Bool bInSlice = pcCU->getSCUAddr()+uiAbsPartIdx+uiQNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurEndCUAddr(); 1161 #if REPN_FORMAT_IN_VPS 1162 if(bInSlice&&( uiLPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getPicHeightInLumaSamples() ) ) 1163 #else 1183 1164 if(bInSlice&&( uiLPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 1165 #endif 1184 1166 { 1185 1167 xEncodeCU( pcCU, uiAbsPartIdx, uiDepth+1 ); … … 1706 1688 Bool bSliceEnd = pcSlice->getSliceSegmentCurEndCUAddr() > rpcPic->getPicSym()->getInverseCUOrderMap(pcCU->getAddr())*pcCU->getPic()->getNumPartInCU()+uiAbsPartIdx && 1707 1689 pcSlice->getSliceSegmentCurEndCUAddr() < rpcPic->getPicSym()->getInverseCUOrderMap(pcCU->getAddr())*pcCU->getPic()->getNumPartInCU()+uiAbsPartIdx+( pcCU->getPic()->getNumPartInCU() >> (uiDepth<<1) ); 1690 #if REPN_FORMAT_IN_VPS 1691 if(!bSliceEnd && !bSliceStart && ( uiRPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getPicHeightInLumaSamples() ) ) 1692 #else 1708 1693 if(!bSliceEnd && !bSliceStart && ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 1694 #endif 1709 1695 { 1710 1696 UInt uiAbsPartIdxInRaster = g_auiZscanToRaster[uiAbsPartIdx]; … … 1727 1713 Bool bInSlice = rpcPic->getPicSym()->getInverseCUOrderMap(pcCU->getAddr())*pcCU->getPic()->getNumPartInCU()+uiAbsPartIdx+uiQNumParts > pcSlice->getSliceSegmentCurStartCUAddr() && 1728 1714 rpcPic->getPicSym()->getInverseCUOrderMap(pcCU->getAddr())*pcCU->getPic()->getNumPartInCU()+uiAbsPartIdx < pcSlice->getSliceSegmentCurEndCUAddr(); 1715 #if REPN_FORMAT_IN_VPS 1716 if(bInSlice&&( uiSubCULPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiSubCUTPelY < pcSlice->getPicHeightInLumaSamples() ) ) 1717 #else 1729 1718 if(bInSlice&&( uiSubCULPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiSubCUTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 1719 #endif 1730 1720 { 1731 1721 xCopyYuv2Pic( rpcPic, uiCUAddr, uiAbsPartIdx, uiDepth+1, uiSrcDepth, pcCU, uiSubCULPelX, uiSubCUTPelY ); // Copy Yuv data to picture Yuv -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r352 r442 307 307 } 308 308 309 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 310 SEIInterLayerConstrainedTileSets* TEncGOP::xCreateSEIInterLayerConstrainedTileSets() 311 { 312 SEIInterLayerConstrainedTileSets *seiInterLayerConstrainedTileSets = new SEIInterLayerConstrainedTileSets(); 313 seiInterLayerConstrainedTileSets->m_ilAllTilesExactSampleValueMatchFlag = false; 314 seiInterLayerConstrainedTileSets->m_ilOneTilePerTileSetFlag = false; 315 if (!seiInterLayerConstrainedTileSets->m_ilOneTilePerTileSetFlag) 316 { 317 seiInterLayerConstrainedTileSets->m_ilNumSetsInMessageMinus1 = m_pcCfg->getIlNumSetsInMessage() - 1; 318 if (seiInterLayerConstrainedTileSets->m_ilNumSetsInMessageMinus1) 319 { 320 seiInterLayerConstrainedTileSets->m_skippedTileSetPresentFlag = m_pcCfg->getSkippedTileSetPresentFlag(); 321 } 322 else 323 { 324 seiInterLayerConstrainedTileSets->m_skippedTileSetPresentFlag = false; 325 } 326 seiInterLayerConstrainedTileSets->m_ilNumSetsInMessageMinus1 += seiInterLayerConstrainedTileSets->m_skippedTileSetPresentFlag ? 1 : 0; 327 for (UInt i = 0; i < m_pcCfg->getIlNumSetsInMessage(); i++) 328 { 329 seiInterLayerConstrainedTileSets->m_ilctsId[i] = i; 330 seiInterLayerConstrainedTileSets->m_ilNumTileRectsInSetMinus1[i] = 0; 331 for( UInt j = 0; j <= seiInterLayerConstrainedTileSets->m_ilNumTileRectsInSetMinus1[i]; j++) 332 { 333 seiInterLayerConstrainedTileSets->m_ilTopLeftTileIndex[i][j] = m_pcCfg->getTopLeftTileIndex(i); 334 seiInterLayerConstrainedTileSets->m_ilBottomRightTileIndex[i][j] = m_pcCfg->getBottomRightTileIndex(i); 335 } 336 seiInterLayerConstrainedTileSets->m_ilcIdc[i] = m_pcCfg->getIlcIdc(i); 337 if (seiInterLayerConstrainedTileSets->m_ilAllTilesExactSampleValueMatchFlag) 338 { 339 seiInterLayerConstrainedTileSets->m_ilExactSampleValueMatchFlag[i] = false; 340 } 341 } 342 } 343 344 return seiInterLayerConstrainedTileSets; 345 } 346 #endif 347 309 348 Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps) 310 349 { … … 369 408 delete sei; 370 409 } 410 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 411 if(m_pcCfg->getInterLayerConstrainedTileSetsSEIEnabled()) 412 { 413 SEIInterLayerConstrainedTileSets *sei = xCreateSEIInterLayerConstrainedTileSets (); 414 415 nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, m_pcCfg->getNumLayer()-1); // For highest layer 416 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 417 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 418 writeRBSPTrailingBits(nalu.m_Bitstream); 419 accessUnit.push_back(new NALUnitEBSP(nalu)); 420 delete sei; 421 } 422 #endif 371 423 } 372 424 … … 375 427 // ==================================================================================================================== 376 428 #if SVC_EXTENSION 377 Void TEncGOP::compressGOP( Int iPicIdInGOP, Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP )378 #else 379 Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP )429 Void TEncGOP::compressGOP( Int iPicIdInGOP, Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, Bool isField, Bool isTff) 430 #else 431 Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, Bool isField, Bool isTff) 380 432 #endif 381 433 { … … 390 442 TComOutputBitstream* pcSubstreamsOut = NULL; 391 443 392 xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut );444 xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut, isField ); 393 445 394 446 m_iNumPicCoded = 0; … … 463 515 464 516 /////////////////////////////////////////////////////////////////////////////////////////////////// Initial to start encoding 465 Int pocCurr = iPOCLast -iNumPicRcvd+ m_pcCfg->getGOPEntry(iGOPid).m_POC; 466 Int iTimeOffset = m_pcCfg->getGOPEntry(iGOPid).m_POC; 467 if(iPOCLast == 0) 517 Int iTimeOffset; 518 Int pocCurr; 519 520 if(iPOCLast == 0) //case first frame or first top field 468 521 { 469 522 pocCurr=0; 470 523 iTimeOffset = 1; 471 524 } 525 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 526 { 527 pocCurr = 1; 528 iTimeOffset = 1; 529 } 530 else 531 { 532 pocCurr = iPOCLast - iNumPicRcvd + m_pcCfg->getGOPEntry(iGOPid).m_POC - isField; 533 iTimeOffset = m_pcCfg->getGOPEntry(iGOPid).m_POC; 534 } 535 472 536 if(pocCurr>=m_pcCfg->getFramesToBeEncoded()) 473 537 { … … 490 554 accessUnitsInGOP.push_back(AccessUnit()); 491 555 AccessUnit& accessUnit = accessUnitsInGOP.back(); 492 xGetBuffer( rcListPic, rcListPicYuvRecOut, iNumPicRcvd, iTimeOffset, pcPic, pcPicYuvRecOut, pocCurr );556 xGetBuffer( rcListPic, rcListPicYuvRecOut, iNumPicRcvd, iTimeOffset, pcPic, pcPicYuvRecOut, pocCurr, isField ); 493 557 494 558 // Slice data initialization … … 499 563 #if SVC_EXTENSION 500 564 pcPic->setLayerId( m_layerId ); 501 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), m_pcEncTop->getVPS() ); 502 #else 503 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() ); 504 #endif 505 565 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), m_pcEncTop->getVPS(), isField ); 566 #else 567 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), isField ); 568 #endif 569 570 //Set Frame/Field coding 571 pcSlice->getPic()->setField(isField); 572 573 #if POC_RESET_FLAG 574 if( !pcSlice->getPocResetFlag() ) // For picture that are not reset, we should adjust the value of POC calculated from the configuration files. 575 { 576 // Subtract POC adjustment value until now. 577 pcSlice->setPOC( pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue() ); 578 } 579 else 580 { 581 // Check if this is the first slice in the picture 582 // In the encoder, the POC values are copied along with copySliceInfo, so we only need 583 // to do this for the first slice. 584 Int pocAdjustValue = pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue(); 585 if( pcSlice->getSliceIdx() == 0 ) 586 { 587 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 588 589 // Iterate through all picture in DPB 590 while( iterPic != rcListPic.end() ) 591 { 592 TComPic *dpbPic = *iterPic; 593 if( dpbPic->getPOC() == pocCurr ) 594 { 595 if( dpbPic->getReconMark() ) 596 { 597 assert( !( dpbPic->getSlice(0)->isReferenced() ) && !( dpbPic->getOutputMark() ) ); 598 } 599 } 600 // Check if the picture pointed to by iterPic is either used for reference or 601 // needed for output, are in the same layer, and not the current picture. 602 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 603 && */ ( dpbPic->getLayerId() == pcSlice->getLayerId() ) 604 && ( dpbPic->getReconMark() ) 605 ) 606 { 607 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 608 { 609 TComSlice *slice = dpbPic->getSlice(i); 610 TComReferencePictureSet *rps = slice->getRPS(); 611 slice->setPOC( dpbPic->getSlice(i)->getPOC() - pocAdjustValue ); 612 613 // Also adjust the POC value stored in the RPS of each such slice 614 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 615 { 616 rps->setPOC( j, rps->getPOC(j) - pocAdjustValue ); 617 } 618 // Also adjust the value of refPOC 619 for(Int k = 0; k < 2; k++) // For List 0 and List 1 620 { 621 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 622 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 623 { 624 slice->setRefPOC( slice->getRefPOC(list, j) - pocAdjustValue, list, j); 625 } 626 } 627 } 628 } 629 iterPic++; 630 } 631 m_pcEncTop->setPocAdjustmentValue( m_pcEncTop->getPocAdjustmentValue() + pocAdjustValue ); 632 } 633 pcSlice->setPocValueBeforeReset( pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue() + pocAdjustValue ); 634 pcSlice->setPOC( 0 ); 635 } 636 #endif 506 637 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 507 638 if (m_pcEncTop->getAdaptiveResolutionChange() > 0 && m_layerId == 1 && pocCurr > m_pcEncTop->getAdaptiveResolutionChange()) … … 530 661 #endif 531 662 663 #if IL_SL_SIGNALLING_N0371 664 m_pcEncTop->getScalingList()->setLayerId( m_layerId ); 665 #endif 666 532 667 pcSlice->setLastIDR(m_iLastIDR); 533 668 pcSlice->setSliceIdx(0); … … 535 670 pcSlice->setLFCrossSliceBoundaryFlag( pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() ); 536 671 pcSlice->setScalingList ( m_pcEncTop->getScalingList() ); 537 pcSlice->getScalingList()->setUseTransformSkip(m_pcEncTop->getPPS()->getUseTransformSkip());538 672 if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_OFF) 539 673 { 674 #if IL_SL_SIGNALLING_N0371 675 m_pcEncTop->getTrQuant()->setFlatScalingList( m_layerId ); 676 #else 540 677 m_pcEncTop->getTrQuant()->setFlatScalingList(); 678 #endif 541 679 m_pcEncTop->getTrQuant()->setUseScalingList(false); 542 680 m_pcEncTop->getSPS()->setScalingListPresentFlag(false); … … 545 683 else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_DEFAULT) 546 684 { 685 #if IL_SL_SIGNALLING_N0371 686 pcSlice->getScalingList()->setLayerId( m_layerId ); 687 #endif 688 689 #if IL_SL_SIGNALLING_N0371 690 pcSlice->setDefaultScalingList ( m_layerId ); 691 #else 547 692 pcSlice->setDefaultScalingList (); 693 #endif 694 548 695 m_pcEncTop->getSPS()->setScalingListPresentFlag(false); 549 696 m_pcEncTop->getPPS()->setScalingListPresentFlag(false); … … 553 700 else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_FILE_READ) 554 701 { 702 #if IL_SL_SIGNALLING_N0371 703 pcSlice->getScalingList()->setLayerId( m_layerId ); 704 #endif 705 555 706 if(pcSlice->getScalingList()->xParseScalingList(m_pcCfg->getScalingListFile())) 556 707 { 708 #if IL_SL_SIGNALLING_N0371 709 pcSlice->setDefaultScalingList ( m_layerId ); 710 #else 557 711 pcSlice->setDefaultScalingList (); 558 } 712 #endif 713 } 714 #if IL_SL_SIGNALLING_N0371 715 pcSlice->getScalingList()->checkDcOfMatrix( m_layerId ); 716 #else 559 717 pcSlice->getScalingList()->checkDcOfMatrix(); 718 #endif 560 719 m_pcEncTop->getSPS()->setScalingListPresentFlag(pcSlice->checkDefaultScalingList()); 720 721 #if IL_SL_SIGNALLING_N0371 722 if( m_layerId > 0 ) 723 { 724 m_pcEncTop->getSPS()->setPredScalingListFlag (true); 725 m_pcEncTop->getSPS()->setScalingListRefLayerId( 0 ); 726 } 727 #endif 728 561 729 m_pcEncTop->getPPS()->setScalingListPresentFlag(false); 730 731 #if IL_SL_SIGNALLING_N0371 732 if( m_layerId > 0 ) 733 { 734 m_pcEncTop->getPPS()->setPredScalingListFlag (false); 735 m_pcEncTop->getPPS()->setScalingListRefLayerId( 0 ); 736 } 737 #endif 738 562 739 m_pcEncTop->getTrQuant()->setScalingList(pcSlice->getScalingList()); 563 740 m_pcEncTop->getTrQuant()->setUseScalingList(true); … … 576 753 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR)); 577 754 #if SVC_EXTENSION 755 #if ILR_RESTR && ILR_RESTR_FIX 756 Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1]; 757 Int activeNumILRRefIdxTmp = 0; 758 #endif 578 759 if (m_layerId > 0) 579 760 { … … 588 769 pcSlice->setBaseColPic( *cListPic, refLayerIdc ); 589 770 590 #if SIMPLIFIED_MV_POS_SCALING 771 #if ILR_RESTR && ILR_RESTR_FIX 772 // Apply temporal layer restriction to inter-layer prediction 773 Int maxTidIlRefPicsPlus1 = m_pcEncTop->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getLayerId()); 774 if( ((Int)(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getRapPicFlag()) ) 775 { 776 interLayerPredLayerIdcTmp[activeNumILRRefIdxTmp++] = refLayerIdc; // add picture to the list of valid inter-layer pictures 777 } 778 else 779 { 780 continue; // ILP is not valid due to temporal layer restriction 781 } 782 #endif 783 591 784 #if SCALED_REF_LAYER_OFFSETS 592 785 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc); … … 612 805 g_posScalingFactor[refLayerIdc][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 613 806 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 614 #endif615 807 616 808 #if SVC_UPSAMPLING 617 809 if( pcPic->isSpatialEnhLayer(refLayerIdc)) 618 { 810 { 619 811 #if SCALED_REF_LAYER_OFFSETS 620 812 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) ); … … 630 822 #endif 631 823 } 632 } 633 #endif 634 635 #if REF_IDX_FRAMEWORK 636 if( m_layerId > 0 && (pocCurr % m_pcCfg->getIntraPeriod() == 0) ) 637 { 824 825 #if ILR_RESTR && ILR_RESTR_FIX 826 // Update the list of active inter-layer pictures 827 for ( Int i = 0; i < activeNumILRRefIdxTmp; i++) 828 { 829 pcSlice->setInterLayerPredLayerIdc( interLayerPredLayerIdcTmp[i], i ); 830 } 831 pcSlice->setActiveNumILRRefIdx( activeNumILRRefIdxTmp ); 832 if ( pcSlice->getActiveNumILRRefIdx() == 0 ) 833 { 834 // No valid inter-layer pictures -> disable inter-layer prediction 835 pcSlice->setInterLayerPredEnabledFlag(false); 836 } 837 #endif 838 839 if( pocCurr % m_pcCfg->getIntraPeriod() == 0 ) 840 { 841 #if N0147_IRAP_ALIGN_FLAG 842 if(pcSlice->getVPS()->getCrossLayerIrapAlignFlag()) 843 { 844 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(0)->getListPic(); 845 TComPic* picLayer0 = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() ); 846 if(picLayer0) 847 { 848 pcSlice->setNalUnitType(picLayer0->getSlice(0)->getNalUnitType()); 849 } 850 else 851 { 852 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA); 853 } 854 } 855 else 856 #endif 857 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA); 858 638 859 #if IDR_ALIGNMENT 639 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(0)->getListPic(); 640 TComPic* picLayer0 = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() ); 641 if( picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 642 { 643 pcSlice->setNalUnitType(picLayer0->getSlice(0)->getNalUnitType()); 644 } 645 else 646 #endif 647 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA); 648 } 649 650 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() == 0 && pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 651 { 652 pcSlice->setSliceType(I_SLICE); 653 } 654 else if( m_layerId > 0 && !m_pcEncTop->getElRapSliceTypeB() ) 655 { 656 if( (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 657 (pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && 860 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(0)->getListPic(); 861 TComPic* picLayer0 = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() ); 862 if( picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 863 { 864 pcSlice->setNalUnitType(picLayer0->getSlice(0)->getNalUnitType()); 865 } 866 else 867 { 868 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA); 869 } 870 #endif 871 } 872 873 if( pcSlice->getActiveNumILRRefIdx() == 0 && pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 874 { 875 pcSlice->setSliceType(I_SLICE); 876 } 877 else if( !m_pcEncTop->getElRapSliceTypeB() ) 878 { 879 if( (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 880 (pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && 658 881 pcSlice->getSliceType() == B_SLICE ) 659 { 660 pcSlice->setSliceType(P_SLICE); 661 } 662 } 663 #endif 882 { 883 pcSlice->setSliceType(P_SLICE); 884 } 885 } 886 } 887 #endif //#if SVC_EXTENSION 664 888 if(pcSlice->getTemporalLayerNonReferenceFlag()) 665 889 { 666 if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_TRAIL_R) 890 if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_R && 891 !(m_iGopSize == 1 && pcSlice->getSliceType() == I_SLICE)) 892 // Add this condition to avoid POC issues with encoder_intra_main.cfg configuration (see #1127 in bug tracker) 667 893 { 668 894 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TRAIL_N); … … 700 926 if(pcSlice->isTemporalLayerSwitchingPoint(rcListPic) || pcSlice->getSPS()->getTemporalIdNestingFlag()) 701 927 { 928 #if ALIGN_TSA_STSA_PICS 929 if( pcSlice->getLayerId() > 0 ) 930 { 931 Bool oneRefLayerTSA = false, oneRefLayerNotTSA = false; 932 for( Int i = 0; i < pcSlice->getLayerId(); i++) 933 { 934 TComList<TComPic *> *cListPic = m_ppcTEncTop[i]->getListPic(); 935 TComPic *lowerLayerPic = pcSlice->getRefPic(*cListPic, pcSlice->getPOC()); 936 if( lowerLayerPic && pcSlice->getVPS()->getDirectDependencyFlag(pcSlice->getLayerId(), i) ) 937 { 938 if( ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N ) || 939 ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R ) 940 ) 941 { 942 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 943 { 944 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_N); 945 } 946 else 947 { 948 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TLA_R ); 949 } 950 oneRefLayerTSA = true; 951 } 952 else 953 { 954 oneRefLayerNotTSA = true; 955 } 956 } 957 } 958 assert( !( oneRefLayerNotTSA && oneRefLayerTSA ) ); // Only one variable should be true - failure of this assert means 959 // that two independent reference layers that are not dependent on 960 // each other, but are reference for current layer have inconsistency 961 if( oneRefLayerNotTSA /*&& !oneRefLayerTSA*/ ) // No reference layer is TSA - set current as TRAIL 962 { 963 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 964 { 965 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_N ); 966 } 967 else 968 { 969 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_R ); 970 } 971 } 972 else // This means there is no reference layer picture for current picture in this AU 973 { 974 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 975 { 976 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_N); 977 } 978 else 979 { 980 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TLA_R ); 981 } 982 } 983 } 984 #else 702 985 if(pcSlice->getTemporalLayerNonReferenceFlag()) 703 986 { … … 708 991 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TLA_R); 709 992 } 993 #endif 710 994 } 711 995 else if(pcSlice->isStepwiseTemporalLayerSwitchingPointCandidate(rcListPic)) … … 741 1025 if(isSTSA==true) 742 1026 { 1027 #if ALIGN_TSA_STSA_PICS 1028 if( pcSlice->getLayerId() > 0 ) 1029 { 1030 Bool oneRefLayerSTSA = false, oneRefLayerNotSTSA = false; 1031 for( Int i = 0; i < pcSlice->getLayerId(); i++) 1032 { 1033 TComList<TComPic *> *cListPic = m_ppcTEncTop[i]->getListPic(); 1034 TComPic *lowerLayerPic = pcSlice->getRefPic(*cListPic, pcSlice->getPOC()); 1035 if( lowerLayerPic && pcSlice->getVPS()->getDirectDependencyFlag(pcSlice->getLayerId(), i) ) 1036 { 1037 if( ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ) || 1038 ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R ) 1039 ) 1040 { 1041 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1042 { 1043 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1044 } 1045 else 1046 { 1047 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R ); 1048 } 1049 oneRefLayerSTSA = true; 1050 } 1051 else 1052 { 1053 oneRefLayerNotSTSA = true; 1054 } 1055 } 1056 } 1057 assert( !( oneRefLayerNotSTSA && oneRefLayerSTSA ) ); // Only one variable should be true - failure of this assert means 1058 // that two independent reference layers that are not dependent on 1059 // each other, but are reference for current layer have inconsistency 1060 if( oneRefLayerNotSTSA /*&& !oneRefLayerSTSA*/ ) // No reference layer is STSA - set current as TRAIL 1061 { 1062 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1063 { 1064 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_N ); 1065 } 1066 else 1067 { 1068 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_R ); 1069 } 1070 } 1071 else // This means there is no reference layer picture for current picture in this AU 1072 { 1073 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1074 { 1075 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1076 } 1077 else 1078 { 1079 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R ); 1080 } 1081 } 1082 } 1083 #else 743 1084 if(pcSlice->getTemporalLayerNonReferenceFlag()) 744 1085 { … … 749 1090 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R); 750 1091 } 1092 #endif 751 1093 } 752 1094 } … … 759 1101 pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); 760 1102 761 #if REF_IDX_FRAMEWORK1103 #if SVC_EXTENSION 762 1104 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 763 1105 { 764 1106 #if RESTR_CHK 765 if (pcSlice->getPOC()>0 && pcSlice->isRADL()&& pcPic->getSlice(0)->isRASL()) 1107 #if POC_RESET_FLAG 1108 if ( pocCurr > 0 && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL()) 1109 #else 1110 if (pcSlice->getPOC()>0 && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL()) 1111 #endif 766 1112 { 767 1113 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 797 1143 #endif 798 1144 } 799 #endif 1145 #endif //SVC_EXTENSION 800 1146 801 1147 #if ADAPTIVE_QP_SELECTION … … 803 1149 #endif 804 1150 805 #if REF_IDX_FRAMEWORK1151 #if SVC_EXTENSION 806 1152 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 807 1153 if ( pcSlice->getSliceType() == B_SLICE && !(pcSlice->getActiveNumILRRefIdx() > 0 && m_pcEncTop->getNumMotionPredRefLayers() > 0) ) … … 812 1158 pcSlice->setColFromL0Flag(1-uiColDir); 813 1159 } 814 #endif815 1160 816 1161 // Set reference list 817 #if REF_IDX_FRAMEWORK818 1162 if(m_layerId == 0 || ( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() == 0 ) ) 819 1163 { 820 1164 pcSlice->setRefPicList( rcListPic); 821 1165 } 822 #else 823 pcSlice->setRefPicList ( rcListPic ); 824 #endif 825 #if REF_IDX_FRAMEWORK 1166 826 1167 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 827 1168 { 828 1169 m_pcEncTop->setILRPic(pcPic); 829 830 1170 #if REF_IDX_MFM 831 1171 #if M0457_COL_PICTURE_SIGNALING … … 840 1180 #endif 841 1181 } 842 #endif 1182 #else 1183 // Set reference list 1184 pcSlice->setRefPicList ( rcListPic ); 1185 #endif //SVC_EXTENSION 843 1186 pcSlice->setRefPicListModificationSvc(); 844 1187 pcSlice->setRefPicList( rcListPic, false, m_pcEncTop->getIlpList()); … … 890 1233 #endif 891 1234 } 892 #endif 1235 #else //SVC_EXTENSION 1236 // Set reference list 1237 pcSlice->setRefPicList ( rcListPic ); 1238 #endif //#if SVC_EXTENSION 893 1239 894 1240 // Slice info. refinement … … 904 1250 #endif 905 1251 { 906 #if ! REF_IDX_FRAMEWORK1252 #if !SVC_EXTENSION 907 1253 pcSlice->setColFromL0Flag(1-uiColDir); 908 1254 #endif … … 1021 1367 1022 1368 Int sliceQP = m_pcCfg->getInitialQP(); 1369 #if POC_RESET_FLAG 1370 if ( ( pocCurr == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified 1371 #else 1023 1372 if ( ( pcSlice->getPOC() == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified 1373 #endif 1024 1374 { 1025 1375 Int NumberBFrames = ( m_pcCfg->getGOPSize() - 1 ); … … 1071 1421 } 1072 1422 1423 #if REPN_FORMAT_IN_VPS 1424 sliceQP = Clip3( -pcSlice->getQpBDOffsetY(), MAX_QP, sliceQP ); 1425 #else 1073 1426 sliceQP = Clip3( -pcSlice->getSPS()->getQpBDOffsetY(), MAX_QP, sliceQP ); 1427 #endif 1074 1428 m_pcRateCtrl->getRCPic()->setPicEstQP( sliceQP ); 1075 1429 … … 1084 1438 UInt uiPosX = ( uiExternalAddress % pcPic->getFrameWidthInCU() ) * g_uiMaxCUWidth+ g_auiRasterToPelX[ g_auiZscanToRaster[uiInternalAddress] ]; 1085 1439 UInt uiPosY = ( uiExternalAddress / pcPic->getFrameWidthInCU() ) * g_uiMaxCUHeight+ g_auiRasterToPelY[ g_auiZscanToRaster[uiInternalAddress] ]; 1440 #if REPN_FORMAT_IN_VPS 1441 UInt uiWidth = pcSlice->getPicWidthInLumaSamples(); 1442 UInt uiHeight = pcSlice->getPicHeightInLumaSamples(); 1443 #else 1086 1444 UInt uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 1087 1445 UInt uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 1446 #endif 1088 1447 while(uiPosX>=uiWidth||uiPosY>=uiHeight) 1089 1448 { … … 1164 1523 //intialize each tile of the current picture 1165 1524 pcPic->getPicSym()->xInitTiles(); 1525 1526 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1527 if (m_pcCfg->getInterLayerConstrainedTileSetsSEIEnabled()) 1528 { 1529 xBuildTileSetsMap(pcPic->getPicSym()); 1530 } 1531 #endif 1166 1532 1167 1533 // Allocate some coders, now we know how many tiles there are. … … 1310 1676 { 1311 1677 #if SVC_EXTENSION 1678 #if VPS_NUH_LAYER_ID 1679 OutputNALUnit nalu(NAL_UNIT_VPS, 0, 0 ); // The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1680 #else 1312 1681 OutputNALUnit nalu(NAL_UNIT_VPS, 0, m_layerId); 1682 #endif 1313 1683 #if AVC_BASE 1314 1684 if( ( m_layerId == 1 && m_pcEncTop->getVPS()->getAvcBaseLayerFlag() ) || ( m_layerId == 0 && !m_pcEncTop->getVPS()->getAvcBaseLayerFlag() ) ) … … 1333 1703 #if SVC_EXTENSION 1334 1704 nalu = NALUnit(NAL_UNIT_SPS, 0, m_layerId); 1705 #if IL_SL_SIGNALLING_N0371 1706 pcSlice->getSPS()->setVPS( pcSlice->getVPS() ); 1707 #endif 1335 1708 #else 1336 1709 nalu = NALUnit(NAL_UNIT_SPS); … … 1452 1825 } 1453 1826 } 1454 pictureTimingSEI.m_auCpbRemovalDelay = std::max<Int>(1, m_totalCoded - m_lastBPSEI); // Syntax element signalled as minus, hence the . 1827 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 . 1828 #if POC_RESET_FLAG 1829 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pocCurr - m_totalCoded; 1830 #else 1455 1831 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pcSlice->getPOC() - m_totalCoded; 1832 #endif 1456 1833 Int factor = pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2; 1457 1834 pictureTimingSEI.m_picDpbOutputDuDelay = factor * pictureTimingSEI.m_picDpbOutputDelay; … … 1558 1935 SEIRecoveryPoint sei_recovery_point; 1559 1936 sei_recovery_point.m_recoveryPocCnt = 0; 1937 #if POC_RESET_FLAG 1938 sei_recovery_point.m_exactMatchingFlag = ( pocCurr == 0 ) ? (true) : (false); 1939 #else 1560 1940 sei_recovery_point.m_exactMatchingFlag = ( pcSlice->getPOC() == 0 ) ? (true) : (false); 1941 #endif 1561 1942 sei_recovery_point.m_brokenLinkFlag = false; 1562 1943 … … 1619 2000 startCUAddrSliceSegmentIdx++; 1620 2001 } 1621 #if REF_IDX_FRAMEWORK&& M0457_COL_PICTURE_SIGNALING2002 #if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING 1622 2003 pcSlice->setNumMotionPredRefLayers(m_pcEncTop->getNumMotionPredRefLayers()); 1623 2004 #endif … … 1632 2013 uiPosX = ( uiExternalAddress % pcPic->getFrameWidthInCU() ) * g_uiMaxCUWidth+ g_auiRasterToPelX[ g_auiZscanToRaster[uiInternalAddress] ]; 1633 2014 uiPosY = ( uiExternalAddress / pcPic->getFrameWidthInCU() ) * g_uiMaxCUHeight+ g_auiRasterToPelY[ g_auiZscanToRaster[uiInternalAddress] ]; 2015 2016 #if REPN_FORMAT_IN_VPS 2017 uiWidth = pcSlice->getPicWidthInLumaSamples(); 2018 uiHeight = pcSlice->getPicHeightInLumaSamples(); 2019 #else 1634 2020 uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 1635 2021 uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 2022 #endif 1636 2023 while(uiPosX>=uiWidth||uiPosY>=uiHeight) 1637 2024 { … … 1688 2075 tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits(); 1689 2076 #endif 2077 1690 2078 m_pcEntropyCoder->encodeSliceHeader(pcSlice); 2079 1691 2080 #if RATE_CONTROL_LAMBDA_DOMAIN 1692 2081 actualHeadBits += ( m_pcEntropyCoder->getNumberOfWrittenBits() - tmpBitsBeforeWriting ); … … 1975 2364 xCalculateAddPSNR( pcPic, pcPic->getPicYuvRec(), accessUnit, dEncTime ); 1976 2365 2366 //In case of field coding, compute the interlaced PSNR for both fields 2367 if (isField && ((!pcPic->isTopField() && isTff) || (pcPic->isTopField() && !isTff))) 2368 { 2369 //get complementary top field 2370 TComPic* pcPicTop; 2371 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 2372 while ((*iterPic)->getPOC() != pcPic->getPOC()-1) 2373 { 2374 iterPic ++; 2375 } 2376 pcPicTop = *(iterPic); 2377 xCalculateInterlacedAddPSNR(pcPicTop, pcPic, pcPicTop->getPicYuvRec(), pcPic->getPicYuvRec(), accessUnit, dEncTime ); 2378 } 2379 1977 2380 if (digestStr) 1978 2381 { … … 2107 2510 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI, pcSlice->getTLayer()); 2108 2511 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2512 pictureTimingSEI.m_picStruct = (isField && pcSlice->getPic()->isTopField())? 1 : isField? 2 : 0; 2109 2513 m_seiWriter.writeSEImessage(nalu.m_Bitstream, pictureTimingSEI, pcSlice->getSPS()); 2110 2514 writeRBSPTrailingBits(nalu.m_Bitstream); … … 2225 2629 2226 2630 #if SVC_EXTENSION 2227 assert ( m_iNumPicCoded <= 1 );2228 #else 2229 assert ( m_iNumPicCoded == iNumPicRcvd);2631 assert ( m_iNumPicCoded <= 1 || (isField && iPOCLast == 1) ); 2632 #else 2633 assert ( (m_iNumPicCoded == iNumPicRcvd) || (isField && iPOCLast == 1) ); 2230 2634 #endif 2231 2635 } 2232 2636 2233 2637 #if !SVC_EXTENSION 2234 Void TEncGOP::printOutSummary(UInt uiNumAllPicCoded )2638 Void TEncGOP::printOutSummary(UInt uiNumAllPicCoded, Bool isField) 2235 2639 { 2236 2640 assert (uiNumAllPicCoded == m_gcAnalyzeAll.getNumPic()); … … 2238 2642 2239 2643 //--CFG_KDY 2240 m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate() ); 2241 m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate() ); 2242 m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate() ); 2243 m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate() ); 2644 if(isField) 2645 { 2646 m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate() * 2); 2647 m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate() * 2); 2648 m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate() * 2); 2649 m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate() * 2); 2650 } 2651 else 2652 { 2653 m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate() ); 2654 m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate() ); 2655 m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate() ); 2656 m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate() ); 2657 } 2244 2658 2245 2659 //-- all … … 2264 2678 m_gcAnalyzeB.printSummary('B'); 2265 2679 #endif 2680 2681 if(isField) 2682 { 2683 //-- interlaced summary 2684 m_gcAnalyzeAll_in.setFrmRate( m_pcCfg->getFrameRate()); 2685 printf( "\n\nSUMMARY INTERLACED ---------------------------------------------\n" ); 2686 m_gcAnalyzeAll_in.printOutInterlaced('a', m_gcAnalyzeAll.getBits()); 2687 2688 #if _SUMMARY_OUT_ 2689 m_gcAnalyzeAll_in.printSummaryOutInterlaced(); 2690 #endif 2691 } 2266 2692 2267 2693 printf("\nRVM: %.3lf\n" , xCalculateRVM()); … … 2305 2731 // ==================================================================================================================== 2306 2732 2733 2734 Void TEncGOP::xInitGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Bool isField ) 2735 { 2736 assert( iNumPicRcvd > 0 ); 2737 // Exception for the first frames 2738 if ( ( isField && (iPOCLast == 0 || iPOCLast == 1) ) || (!isField && (iPOCLast == 0)) ) 2739 { 2740 m_iGopSize = 1; 2741 } 2742 else 2743 { 2744 m_iGopSize = m_pcCfg->getGOPSize(); 2745 } 2746 assert (m_iGopSize > 0); 2747 2748 return; 2749 } 2750 2307 2751 Void TEncGOP::xInitGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut ) 2308 2752 { … … 2327 2771 TComPic*& rpcPic, 2328 2772 TComPicYuv*& rpcPicYuvRecOut, 2329 Int pocCurr ) 2773 Int pocCurr, 2774 Bool isField) 2330 2775 { 2331 2776 Int i; 2332 2777 // Rec. output 2333 2778 TComList<TComPicYuv*>::iterator iterPicYuvRec = rcListPicYuvRecOut.end(); 2334 for ( i = 0; i < iNumPicRcvd - iTimeOffset + 1; i++ ) 2335 { 2336 iterPicYuvRec--; 2337 } 2338 2779 2780 if (isField) 2781 { 2782 for ( i = 0; i < ( (pocCurr == 0 ) || (pocCurr == 1 ) ? (iNumPicRcvd - iTimeOffset + 1) : (iNumPicRcvd - iTimeOffset + 2) ); i++ ) 2783 { 2784 iterPicYuvRec--; 2785 } 2786 } 2787 else 2788 { 2789 for ( i = 0; i < (iNumPicRcvd - iTimeOffset + 1); i++ ) 2790 { 2791 iterPicYuvRec--; 2792 } 2793 } 2794 2795 if (isField) 2796 { 2797 if(pocCurr == 1) 2798 { 2799 iterPicYuvRec++; 2800 } 2801 } 2339 2802 rpcPicYuvRecOut = *(iterPicYuvRec); 2340 2803 … … 2421 2884 switch (type) 2422 2885 { 2423 case NAL_UNIT_CODED_SLICE_TRAIL_R: return "TRAIL_R";2424 case NAL_UNIT_CODED_SLICE_TRAIL_N: return "TRAIL_N";2886 case NAL_UNIT_CODED_SLICE_TRAIL_R: return "TRAIL_R"; 2887 case NAL_UNIT_CODED_SLICE_TRAIL_N: return "TRAIL_N"; 2425 2888 case NAL_UNIT_CODED_SLICE_TLA_R: return "TLA_R"; 2426 case NAL_UNIT_CODED_SLICE_TSA_N: return "TSA_N";2427 case NAL_UNIT_CODED_SLICE_STSA_R: return "STSA_R";2428 case NAL_UNIT_CODED_SLICE_STSA_N: return "STSA_N";2889 case NAL_UNIT_CODED_SLICE_TSA_N: return "TSA_N"; 2890 case NAL_UNIT_CODED_SLICE_STSA_R: return "STSA_R"; 2891 case NAL_UNIT_CODED_SLICE_STSA_N: return "STSA_N"; 2429 2892 case NAL_UNIT_CODED_SLICE_BLA_W_LP: return "BLA_W_LP"; 2430 2893 case NAL_UNIT_CODED_SLICE_BLA_W_RADL: return "BLA_W_RADL"; 2431 case NAL_UNIT_CODED_SLICE_BLA_N_LP: return "BLA_N_LP";2894 case NAL_UNIT_CODED_SLICE_BLA_N_LP: return "BLA_N_LP"; 2432 2895 case NAL_UNIT_CODED_SLICE_IDR_W_RADL: return "IDR_W_RADL"; 2433 case NAL_UNIT_CODED_SLICE_IDR_N_LP: return "IDR_N_LP";2434 case NAL_UNIT_CODED_SLICE_CRA: return "CRA";2896 case NAL_UNIT_CODED_SLICE_IDR_N_LP: return "IDR_N_LP"; 2897 case NAL_UNIT_CODED_SLICE_CRA: return "CRA"; 2435 2898 case NAL_UNIT_CODED_SLICE_RADL_R: return "RADL_R"; 2436 2899 case NAL_UNIT_CODED_SLICE_RASL_R: return "RASL_R"; 2437 case NAL_UNIT_VPS: return "VPS";2438 case NAL_UNIT_SPS: return "SPS";2439 case NAL_UNIT_PPS: return "PPS";2440 case NAL_UNIT_ACCESS_UNIT_DELIMITER: return "AUD";2441 case NAL_UNIT_EOS: return "EOS";2442 case NAL_UNIT_EOB: return "EOB";2443 case NAL_UNIT_FILLER_DATA: return "FILLER";2900 case NAL_UNIT_VPS: return "VPS"; 2901 case NAL_UNIT_SPS: return "SPS"; 2902 case NAL_UNIT_PPS: return "PPS"; 2903 case NAL_UNIT_ACCESS_UNIT_DELIMITER: return "AUD"; 2904 case NAL_UNIT_EOS: return "EOS"; 2905 case NAL_UNIT_EOB: return "EOB"; 2906 case NAL_UNIT_FILLER_DATA: return "FILLER"; 2444 2907 case NAL_UNIT_PREFIX_SEI: return "SEI"; 2445 2908 case NAL_UNIT_SUFFIX_SEI: return "SEI"; 2446 default: return "UNK";2909 default: return "UNK"; 2447 2910 } 2448 2911 } … … 2625 3088 for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++) 2626 3089 { 2627 #if REF_IDX_FRAMEWORK && VPS_EXTN_DIRECT_REF_LAYERS 3090 #if SVC_EXTENSION 3091 #if VPS_EXTN_DIRECT_REF_LAYERS 2628 3092 if( pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->isILR(m_layerId) ) 2629 3093 { 2630 printf( "%d(%d) 3094 printf( "%d(%d)", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR(), pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId() ); 2631 3095 } 2632 3096 else 2633 #endif 3097 { 3098 printf ("%d", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR()); 3099 } 3100 #endif 3101 if( pcSlice->getEnableTMVPFlag() && iRefList == 1 - pcSlice->getColFromL0Flag() && iRefIndex == pcSlice->getColRefIdx() ) 3102 { 3103 printf( "c" ); 3104 } 3105 3106 printf( " " ); 3107 #else 2634 3108 printf ("%d ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR()); 3109 #endif 2635 3110 } 2636 3111 printf("]"); 2637 3112 } 3113 } 3114 3115 3116 Void reinterlace(Pel* top, Pel* bottom, Pel* dst, UInt stride, UInt width, UInt height, Bool isTff) 3117 { 3118 3119 for (Int y = 0; y < height; y++) 3120 { 3121 for (Int x = 0; x < width; x++) 3122 { 3123 dst[x] = isTff ? (UChar) top[x] : (UChar) bottom[x]; 3124 dst[stride+x] = isTff ? (UChar) bottom[x] : (UChar) top[x]; 3125 } 3126 top += stride; 3127 bottom += stride; 3128 dst += stride*2; 3129 } 3130 } 3131 3132 Void TEncGOP::xCalculateInterlacedAddPSNR( TComPic* pcPicOrgTop, TComPic* pcPicOrgBottom, TComPicYuv* pcPicRecTop, TComPicYuv* pcPicRecBottom, const AccessUnit& accessUnit, Double dEncTime ) 3133 { 3134 Int x, y; 3135 3136 UInt64 uiSSDY_in = 0; 3137 UInt64 uiSSDU_in = 0; 3138 UInt64 uiSSDV_in = 0; 3139 3140 Double dYPSNR_in = 0.0; 3141 Double dUPSNR_in = 0.0; 3142 Double dVPSNR_in = 0.0; 3143 3144 /*------ INTERLACED PSNR -----------*/ 3145 3146 /* Luma */ 3147 3148 Pel* pOrgTop = pcPicOrgTop->getPicYuvOrg()->getLumaAddr(); 3149 Pel* pOrgBottom = pcPicOrgBottom->getPicYuvOrg()->getLumaAddr(); 3150 Pel* pRecTop = pcPicRecTop->getLumaAddr(); 3151 Pel* pRecBottom = pcPicRecBottom->getLumaAddr(); 3152 3153 Int iWidth; 3154 Int iHeight; 3155 Int iStride; 3156 3157 iWidth = pcPicOrgTop->getPicYuvOrg()->getWidth () - m_pcEncTop->getPad(0); 3158 iHeight = pcPicOrgTop->getPicYuvOrg()->getHeight() - m_pcEncTop->getPad(1); 3159 iStride = pcPicOrgTop->getPicYuvOrg()->getStride(); 3160 Int iSize = iWidth*iHeight; 3161 bool isTff = pcPicOrgTop->isTopField(); 3162 3163 TComPicYuv* pcOrgInterlaced = new TComPicYuv; 3164 pcOrgInterlaced->create( iWidth, iHeight << 1, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 3165 3166 TComPicYuv* pcRecInterlaced = new TComPicYuv; 3167 pcRecInterlaced->create( iWidth, iHeight << 1, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 3168 3169 Pel* pOrgInterlaced = pcOrgInterlaced->getLumaAddr(); 3170 Pel* pRecInterlaced = pcRecInterlaced->getLumaAddr(); 3171 3172 //=== Interlace fields ==== 3173 reinterlace(pOrgTop, pOrgBottom, pOrgInterlaced, iStride, iWidth, iHeight, isTff); 3174 reinterlace(pRecTop, pRecBottom, pRecInterlaced, iStride, iWidth, iHeight, isTff); 3175 3176 //===== calculate PSNR ===== 3177 for( y = 0; y < iHeight << 1; y++ ) 3178 { 3179 for( x = 0; x < iWidth; x++ ) 3180 { 3181 Int iDiff = (Int)( pOrgInterlaced[x] - pRecInterlaced[x] ); 3182 uiSSDY_in += iDiff * iDiff; 3183 } 3184 pOrgInterlaced += iStride; 3185 pRecInterlaced += iStride; 3186 } 3187 3188 /*Chroma*/ 3189 3190 iHeight >>= 1; 3191 iWidth >>= 1; 3192 iStride >>= 1; 3193 3194 pOrgTop = pcPicOrgTop->getPicYuvOrg()->getCbAddr(); 3195 pOrgBottom = pcPicOrgBottom->getPicYuvOrg()->getCbAddr(); 3196 pRecTop = pcPicRecTop->getCbAddr(); 3197 pRecBottom = pcPicRecBottom->getCbAddr(); 3198 pOrgInterlaced = pcOrgInterlaced->getCbAddr(); 3199 pRecInterlaced = pcRecInterlaced->getCbAddr(); 3200 3201 //=== Interlace fields ==== 3202 reinterlace(pOrgTop, pOrgBottom, pOrgInterlaced, iStride, iWidth, iHeight, isTff); 3203 reinterlace(pRecTop, pRecBottom, pRecInterlaced, iStride, iWidth, iHeight, isTff); 3204 3205 //===== calculate PSNR ===== 3206 for( y = 0; y < iHeight << 1; y++ ) 3207 { 3208 for( x = 0; x < iWidth; x++ ) 3209 { 3210 Int iDiff = (Int)( pOrgInterlaced[x] - pRecInterlaced[x] ); 3211 uiSSDU_in += iDiff * iDiff; 3212 } 3213 pOrgInterlaced += iStride; 3214 pRecInterlaced += iStride; 3215 } 3216 3217 pOrgTop = pcPicOrgTop->getPicYuvOrg()->getCrAddr(); 3218 pOrgBottom = pcPicOrgBottom->getPicYuvOrg()->getCrAddr(); 3219 pRecTop = pcPicRecTop->getCrAddr(); 3220 pRecBottom = pcPicRecBottom->getCrAddr(); 3221 pOrgInterlaced = pcOrgInterlaced->getCrAddr(); 3222 pRecInterlaced = pcRecInterlaced->getCrAddr(); 3223 3224 //=== Interlace fields ==== 3225 reinterlace(pOrgTop, pOrgBottom, pOrgInterlaced, iStride, iWidth, iHeight, isTff); 3226 reinterlace(pRecTop, pRecBottom, pRecInterlaced, iStride, iWidth, iHeight, isTff); 3227 3228 //===== calculate PSNR ===== 3229 for( y = 0; y < iHeight << 1; y++ ) 3230 { 3231 for( x = 0; x < iWidth; x++ ) 3232 { 3233 Int iDiff = (Int)( pOrgInterlaced[x] - pRecInterlaced[x] ); 3234 uiSSDV_in += iDiff * iDiff; 3235 } 3236 pOrgInterlaced += iStride; 3237 pRecInterlaced += iStride; 3238 } 3239 3240 Int maxvalY = 255 << (g_bitDepthY-8); 3241 Int maxvalC = 255 << (g_bitDepthC-8); 3242 Double fRefValueY = (Double) maxvalY * maxvalY * iSize*2; 3243 Double fRefValueC = (Double) maxvalC * maxvalC * iSize*2 / 4.0; 3244 dYPSNR_in = ( uiSSDY_in ? 10.0 * log10( fRefValueY / (Double)uiSSDY_in ) : 99.99 ); 3245 dUPSNR_in = ( uiSSDU_in ? 10.0 * log10( fRefValueC / (Double)uiSSDU_in ) : 99.99 ); 3246 dVPSNR_in = ( uiSSDV_in ? 10.0 * log10( fRefValueC / (Double)uiSSDV_in ) : 99.99 ); 3247 3248 /* calculate the size of the access unit, excluding: 3249 * - any AnnexB contributions (start_code_prefix, zero_byte, etc.,) 3250 * - SEI NAL units 3251 */ 3252 UInt numRBSPBytes = 0; 3253 for (AccessUnit::const_iterator it = accessUnit.begin(); it != accessUnit.end(); it++) 3254 { 3255 UInt numRBSPBytes_nal = UInt((*it)->m_nalUnitData.str().size()); 3256 3257 if ((*it)->m_nalUnitType != NAL_UNIT_PREFIX_SEI && (*it)->m_nalUnitType != NAL_UNIT_SUFFIX_SEI) 3258 numRBSPBytes += numRBSPBytes_nal; 3259 } 3260 3261 UInt uibits = numRBSPBytes * 8 ; 3262 3263 //===== add PSNR ===== 3264 m_gcAnalyzeAll_in.addResult (dYPSNR_in, dUPSNR_in, dVPSNR_in, (Double)uibits); 3265 3266 printf("\n Interlaced frame %d: [Y %6.4lf dB U %6.4lf dB V %6.4lf dB]", pcPicOrgBottom->getPOC()/2 , dYPSNR_in, dUPSNR_in, dVPSNR_in ); 3267 3268 pcOrgInterlaced->destroy(); 3269 delete pcOrgInterlaced; 3270 pcRecInterlaced->destroy(); 3271 delete pcRecInterlaced; 2638 3272 } 2639 3273 … … 2872 3506 return seiStartPos; 2873 3507 } 3508 3509 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3510 Void TEncGOP::xBuildTileSetsMap(TComPicSym* picSym) 3511 { 3512 Int numCUs = picSym->getFrameWidthInCU() * picSym->getFrameHeightInCU(); 3513 3514 for (Int i = 0; i < numCUs; i++) 3515 { 3516 picSym->setTileSetIdxMap(i, -1, 0, false); 3517 } 3518 3519 for (Int i = 0; i < m_pcCfg->getIlNumSetsInMessage(); i++) 3520 { 3521 TComTile* topLeftTile = picSym->getTComTile(m_pcCfg->getTopLeftTileIndex(i)); 3522 TComTile* bottomRightTile = picSym->getTComTile(m_pcCfg->getBottomRightTileIndex(i)); 3523 Int tileSetLeftEdgePosInCU = topLeftTile->getRightEdgePosInCU() - topLeftTile->getTileWidth() + 1; 3524 Int tileSetRightEdgePosInCU = bottomRightTile->getRightEdgePosInCU(); 3525 Int tileSetTopEdgePosInCU = topLeftTile->getBottomEdgePosInCU() - topLeftTile->getTileHeight() + 1; 3526 Int tileSetBottomEdgePosInCU = bottomRightTile->getBottomEdgePosInCU(); 3527 assert(tileSetLeftEdgePosInCU < tileSetRightEdgePosInCU && tileSetTopEdgePosInCU < tileSetBottomEdgePosInCU); 3528 for (Int j = tileSetTopEdgePosInCU; j <= tileSetBottomEdgePosInCU; j++) 3529 { 3530 for (Int k = tileSetLeftEdgePosInCU; k <= tileSetRightEdgePosInCU; k++) 3531 { 3532 picSym->setTileSetIdxMap(j * picSym->getFrameWidthInCU() + k, i, m_pcCfg->getIlcIdc(i), false); 3533 } 3534 } 3535 } 3536 3537 if (m_pcCfg->getSkippedTileSetPresentFlag()) 3538 { 3539 Int skippedTileSetIdx = m_pcCfg->getIlNumSetsInMessage(); 3540 for (Int i = 0; i < numCUs; i++) 3541 { 3542 if (picSym->getTileSetIdxMap(i) < 0) 3543 { 3544 picSym->setTileSetIdxMap(i, skippedTileSetIdx, 0, true); 3545 } 3546 } 3547 } 3548 } 3549 #endif 2874 3550 2875 3551 Void TEncGOP::dblMetric( TComPic* pcPic, UInt uiNumSlices ) -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r345 r442 145 145 Void init ( TEncTop* pcTEncTop ); 146 146 #if SVC_EXTENSION 147 Void compressGOP ( Int iPicIdInGOP, Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP );147 Void compressGOP ( Int iPicIdInGOP, Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP, Bool isField, Bool isTff ); 148 148 #else 149 Void compressGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP );149 Void compressGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP, Bool isField, Bool isTff ); 150 150 #endif 151 151 Void xAttachSliceDataToNalUnit (OutputNALUnit& rNalu, TComOutputBitstream*& rpcBitstreamRedirect); … … 156 156 TComList<TComPic*>* getListPic() { return m_pcListPic; } 157 157 158 Void printOutSummary ( UInt uiNumAllPicCoded ); 158 #if !SVC_EXTENSION 159 Void printOutSummary ( UInt uiNumAllPicCoded, Bool isField); 160 #endif 159 161 Void preLoopFilterPicAll ( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits ); 160 162 … … 166 168 167 169 protected: 170 171 Void xInitGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Bool isField ); 168 172 Void xInitGOP ( Int iPOC, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut ); 169 Void xGetBuffer ( TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Int iNumPicRcvd, Int iTimeOffset, TComPic*& rpcPic, TComPicYuv*& rpcPicYuvRecOut, Int pocCurr );173 Void xGetBuffer ( TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Int iNumPicRcvd, Int iTimeOffset, TComPic*& rpcPic, TComPicYuv*& rpcPicYuvRecOut, Int pocCurr, Bool isField ); 170 174 171 175 Void xCalculateAddPSNR ( TComPic* pcPic, TComPicYuv* pcPicD, const AccessUnit&, Double dEncTime ); 176 Void xCalculateInterlacedAddPSNR( TComPic* pcPicOrgTop, TComPic* pcPicOrgBottom, TComPicYuv* pcPicRecTop, TComPicYuv* pcPicRecBottom, const AccessUnit& accessUnit, Double dEncTime ); 172 177 173 178 UInt64 xFindDistortionFrame (TComPicYuv* pcPic0, TComPicYuv* pcPic1); … … 183 188 184 189 SEIToneMappingInfo* xCreateSEIToneMappingInfo(); 190 191 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 192 SEIInterLayerConstrainedTileSets* xCreateSEIInterLayerConstrainedTileSets(); 193 #endif 185 194 186 195 Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps); … … 197 206 m_nestedPictureTimingSEIPresentInAU = false; 198 207 } 208 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 209 Void xBuildTileSetsMap(TComPicSym* picSym); 210 #endif 199 211 Void dblMetric( TComPic* pcPic, UInt uiNumSlices ); 200 212 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r345 r442 804 804 Int iDQp = pcCU->getQP( uiAbsPartIdx ) - pcCU->getRefQP( uiAbsPartIdx ); 805 805 806 #if REPN_FORMAT_IN_VPS 807 Int qpBdOffsetY = pcCU->getSlice()->getQpBDOffsetY(); 808 #else 806 809 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY(); 810 #endif 807 811 iDQp = (iDQp + 78 + qpBdOffsetY + (qpBdOffsetY/2)) % (52 + qpBdOffsetY) - 26 - (qpBdOffsetY/2); 808 812 -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r345 r442 1104 1104 pcCU ->setTrIdxSubParts ( uiTrDepth, uiAbsPartIdx, uiFullDepth ); 1105 1105 1106 #if REPN_FORMAT_IN_VPS 1107 m_pcTrQuant->setQPforQuant ( pcCU->getQP( 0 ), TEXT_LUMA, pcCU->getSlice()->getQpBDOffsetY(), 0 ); 1108 #else 1106 1109 m_pcTrQuant->setQPforQuant ( pcCU->getQP( 0 ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 1110 #endif 1107 1111 1108 1112 #if RDOQ_CHROMA_LAMBDA … … 3217 3221 Int numValidMergeCand = 0 ; 3218 3222 3223 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3224 Bool disableILP = false; 3225 if (pcCU->getPic()->getLayerId() == (m_pcEncCfg->getNumLayer() - 1) && m_pcEncCfg->getInterLayerConstrainedTileSetsSEIEnabled() && pcCU->getPic()->getPicSym()->getTileSetIdxMap(pcCU->getAddr()) >= 0) 3226 { 3227 if (pcCU->getPic()->getPicSym()->getTileSetType(pcCU->getAddr()) == 2) 3228 { 3229 disableILP = true; 3230 } 3231 if (pcCU->getPic()->getPicSym()->getTileSetType(pcCU->getAddr()) == 1) 3232 { 3233 Int currCUaddr = pcCU->getAddr(); 3234 Int frameWitdhInCU = pcCU->getPic()->getPicSym()->getFrameWidthInCU(); 3235 Int frameHeightInCU = pcCU->getPic()->getPicSym()->getFrameHeightInCU(); 3236 Bool leftCUExists = (currCUaddr % frameWitdhInCU) > 0; 3237 Bool aboveCUExists = (currCUaddr / frameWitdhInCU) > 0; 3238 Bool rightCUExists = (currCUaddr % frameWitdhInCU) < (frameWitdhInCU - 1); 3239 Bool belowCUExists = (currCUaddr / frameWitdhInCU) < (frameHeightInCU - 1); 3240 Int currTileSetIdx = pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr); 3241 // Check if CU is at tile set boundary 3242 if ( (leftCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-1) != currTileSetIdx) || 3243 (leftCUExists && aboveCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-frameWitdhInCU-1) != currTileSetIdx) || 3244 (aboveCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-frameWitdhInCU) != currTileSetIdx) || 3245 (aboveCUExists && rightCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-frameWitdhInCU+1) != currTileSetIdx) || 3246 (rightCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+1) != currTileSetIdx) || 3247 (rightCUExists && belowCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+frameWitdhInCU+1) != currTileSetIdx) || 3248 (belowCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+frameWitdhInCU) != currTileSetIdx) || 3249 (belowCUExists && leftCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+frameWitdhInCU-1) != currTileSetIdx) ) 3250 { 3251 disableILP = true; // Disable ILP in tile set boundary CU 3252 } 3253 } 3254 } 3255 #endif 3256 3219 3257 for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 3220 3258 { … … 3266 3304 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 3267 3305 { 3306 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3307 if (pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp )->isILR(pcCU->getLayerId()) && disableILP) 3308 { 3309 continue; 3310 } 3311 #endif 3268 3312 #if (ENCODER_FAST_MODE) 3269 3313 TComPic* pcPic = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp ); … … 3484 3528 testIter = false; //the fixed part is ILR, skip this iteration 3485 3529 } 3530 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3531 if (pcPic->isILR(pcCU->getLayerId()) && disableILP) 3532 { 3533 testIter = false; 3534 } 3535 #endif 3486 3536 if(testIter) 3487 3537 { … … 3499 3549 testRefIdx = false; //the refined part is ILR, skip this reference pic 3500 3550 } 3551 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3552 if (pcPic->isILR(pcCU->getLayerId()) && disableILP) 3553 { 3554 testRefIdx = false; 3555 } 3556 #endif 3501 3557 if(testRefIdx) 3502 3558 { … … 4610 4666 while((uiWidth>>uiMaxTrMode) < (g_uiMaxCUWidth>>g_uiMaxCUDepth)) uiMaxTrMode--; 4611 4667 4668 #if REPN_FORMAT_IN_VPS 4669 qpMin = bHighPass ? Clip3( -pcCU->getSlice()->getQpBDOffsetY(), MAX_QP, pcCU->getQP(0) - m_iMaxDeltaQP ) : pcCU->getQP( 0 ); 4670 qpMax = bHighPass ? Clip3( -pcCU->getSlice()->getQpBDOffsetY(), MAX_QP, pcCU->getQP(0) + m_iMaxDeltaQP ) : pcCU->getQP( 0 ); 4671 #else 4612 4672 qpMin = bHighPass ? Clip3( -pcCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, pcCU->getQP(0) - m_iMaxDeltaQP ) : pcCU->getQP( 0 ); 4613 4673 qpMax = bHighPass ? Clip3( -pcCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, pcCU->getQP(0) + m_iMaxDeltaQP ) : pcCU->getQP( 0 ); 4674 #endif 4614 4675 4615 4676 rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth ); … … 4860 4921 } 4861 4922 4923 #if REPN_FORMAT_IN_VPS 4924 m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), TEXT_LUMA, pcCU->getSlice()->getQpBDOffsetY(), 0 ); 4925 #else 4862 4926 m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 4927 #endif 4863 4928 4864 4929 #if RDOQ_CHROMA_LAMBDA … … 4946 5011 Pel *pcResiCurrY = m_pcQTTempTComYuv[ uiQTTempAccessLayer ].getLumaAddr( absTUPartIdx ); 4947 5012 5013 #if REPN_FORMAT_IN_VPS 4948 5014 m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 5015 #else 5016 m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 5017 #endif 4949 5018 4950 5019 Int scalingListType = 3 + g_eTTable[(Int)TEXT_LUMA]; … … 5195 5264 } 5196 5265 5266 #if REPN_FORMAT_IN_VPS 5267 m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), TEXT_LUMA, pcCU->getSlice()->getQpBDOffsetY(), 0 ); 5268 #else 5197 5269 m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 5270 #endif 5198 5271 5199 5272 #if RDOQ_CHROMA_LAMBDA … … 5214 5287 const UInt uiTsSingleBitsY = m_pcEntropyCoder->getNumberOfWrittenBits(); 5215 5288 5289 #if REPN_FORMAT_IN_VPS 5290 m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), TEXT_LUMA, pcCU->getSlice()->getQpBDOffsetY(), 0 ); 5291 #else 5216 5292 m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 5293 #endif 5217 5294 5218 5295 Int scalingListType = 3 + g_eTTable[(Int)TEXT_LUMA]; -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r345 r442 180 180 #if SVC_EXTENSION 181 181 //\param vps VPS associated with the slice 182 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps )183 #else 184 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS )182 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps, Bool isField ) 183 #else 184 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, Bool isField ) 185 185 #endif 186 186 { … … 260 260 if(eSliceType!=I_SLICE) 261 261 { 262 #if REPN_FORMAT_IN_VPS 263 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 264 #else 262 265 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getSPS()->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 266 #endif 263 267 { 264 268 dQP += m_pcCfg->getGOPEntry(iGOPid).m_QPOffset; … … 294 298 Int NumberBFrames = ( m_pcCfg->getGOPSize() - 1 ); 295 299 Int SHIFT_QP = 12; 296 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double)NumberBFrames ); 300 301 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? NumberBFrames/2 : NumberBFrames) ); 302 297 303 #if FULL_NBIT 298 304 Int bitdepth_luma_qp_scale = 6 * (g_bitDepth - 8); … … 327 333 } 328 334 335 #if REPN_FORMAT_IN_VPS 336 iQP = max( -rpcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 337 #else 329 338 iQP = max( -pSPS->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 339 #endif 330 340 331 341 m_pdRdPicLambda[iDQpIdx] = dLambda; … … 400 410 eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 401 411 402 #if REF_IDX_FRAMEWORK412 #if SVC_EXTENSION 403 413 if(m_pcCfg->getLayerId() > 0) 404 414 { … … 412 422 { 413 423 dQP = xGetQPValueAccordingToLambda( dLambda ); 424 #if REPN_FORMAT_IN_VPS 425 iQP = max( -rpcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 426 #else 414 427 iQP = max( -pSPS->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 428 #endif 415 429 } 416 430 … … 467 481 468 482 pcPic->setTLayer( m_pcCfg->getGOPEntry(iGOPid).m_temporalId ); 483 #if TEMP_SCALABILITY_FIX 484 if((eSliceType==I_SLICE) || (rpcSlice->getPOC() == 0)) 485 #else 469 486 if(eSliceType==I_SLICE) 487 #endif 470 488 { 471 489 pcPic->setTLayer(0); … … 485 503 xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() ); 486 504 487 #if SVC_EXTENSION && REF_IDX_FRAMEWORK505 #if SVC_EXTENSION 488 506 if( layerId > 0 ) 489 507 { … … 606 624 } 607 625 626 #if REPN_FORMAT_IN_VPS 627 qp = max( -pcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( recalQP + 0.5 ) ) ); 628 #else 608 629 qp = max( -pcSPS->getQpBDOffsetY(), min( MAX_QP, (Int) floor( recalQP + 0.5 ) ) ); 630 #endif 609 631 610 632 m_pdRdPicLambda[deltqQpIdx] = lambda; … … 849 871 pcCU->initCU( rpcPic, uiCUAddr ); 850 872 873 #if REPN_FORMAT_IN_VPS 874 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 875 Int width = min( pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 876 #else 851 877 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 852 878 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 879 #endif 853 880 854 881 iSumHad = m_pcCuEncoder->updateLCUDataISlice(pcCU, uiCUAddr, width, height); … … 1148 1175 #endif 1149 1176 1177 #if REPN_FORMAT_IN_VPS 1178 estQP = Clip3( -pcSlice->getQpBDOffsetY(), MAX_QP, estQP ); 1179 #else 1150 1180 estQP = Clip3( -pcSlice->getSPS()->getQpBDOffsetY(), MAX_QP, estQP ); 1181 #endif 1151 1182 1152 1183 m_pcRdCost->setLambda(estLambda); … … 1176 1207 #if !M0036_RC_IMPROVEMENT 1177 1208 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); 1209 #if REPN_FORMAT_IN_VPS 1210 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 1211 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->>getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 1212 #else 1178 1213 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 1179 1214 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 1215 #endif 1180 1216 Double MAD = (Double)SAD / (Double)(height * width); 1181 1217 MAD = MAD * MAD; … … 1253 1289 #if !M0036_RC_IMPROVEMENT 1254 1290 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); 1291 #if REPN_FORMAT_IN_VPS 1292 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 1293 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 1294 #else 1255 1295 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 1256 1296 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 1297 #endif 1257 1298 Double MAD = (Double)SAD / (Double)(height * width); 1258 1299 MAD = MAD * MAD; … … 1919 1960 UInt uiPosX = ( uiExternalAddress % rpcPic->getFrameWidthInCU() ) * g_uiMaxCUWidth+ g_auiRasterToPelX[ g_auiZscanToRaster[uiInternalAddress] ]; 1920 1961 UInt uiPosY = ( uiExternalAddress / rpcPic->getFrameWidthInCU() ) * g_uiMaxCUHeight+ g_auiRasterToPelY[ g_auiZscanToRaster[uiInternalAddress] ]; 1962 #if REPN_FORMAT_IN_VPS 1963 UInt uiWidth = pcSlice->getPicWidthInLumaSamples(); 1964 UInt uiHeight = pcSlice->getPicHeightInLumaSamples(); 1965 #else 1921 1966 UInt uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 1922 1967 UInt uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 1968 #endif 1923 1969 while((uiPosX>=uiWidth||uiPosY>=uiHeight)&&!(uiPosX>=uiWidth&&uiPosY>=uiHeight)) 1924 1970 { … … 1942 1988 uiPosX = ( uiExternalAddress % rpcPic->getFrameWidthInCU() ) * g_uiMaxCUWidth+ g_auiRasterToPelX[ g_auiZscanToRaster[uiInternalAddress] ]; 1943 1989 uiPosY = ( uiExternalAddress / rpcPic->getFrameWidthInCU() ) * g_uiMaxCUHeight+ g_auiRasterToPelY[ g_auiZscanToRaster[uiInternalAddress] ]; 1990 #if REPN_FORMAT_IN_VPS 1991 uiWidth = pcSlice->getPicWidthInLumaSamples(); 1992 uiHeight = pcSlice->getPicHeightInLumaSamples(); 1993 #else 1944 1994 uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 1945 1995 uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 1996 #endif 1946 1997 while((uiPosX>=uiWidth||uiPosY>=uiHeight)&&!(uiPosX>=uiWidth&&uiPosY>=uiHeight)) 1947 1998 { -
trunk/source/Lib/TLibEncoder/TEncSlice.h
r313 r442 118 118 #if SVC_EXTENSION 119 119 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 120 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps );120 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps, Bool isField ); 121 121 #else 122 122 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 123 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS );123 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, Bool isField ); 124 124 #endif 125 125 -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r345 r442 83 83 m_pcBitCounters = NULL; 84 84 m_pcRdCosts = NULL; 85 #if REF_IDX_FRAMEWORK85 #if SVC_EXTENSION 86 86 memset(m_cIlpPic, 0, sizeof(m_cIlpPic)); 87 #endif88 87 #if REF_IDX_MFM 89 88 m_bMFMEnabledFlag = false; … … 91 90 #if SCALED_REF_LAYER_OFFSETS 92 91 m_numScaledRefLayerOffsets = 0; 92 #endif 93 #endif 94 #if POC_RESET_FLAG 95 m_pocAdjustmentValue = 0; 93 96 #endif 94 97 } … … 107 110 initROM(); 108 111 #endif 109 112 110 113 // create processing unit classes 111 114 #if SVC_EXTENSION … … 288 291 delete[] m_pcRdCosts; 289 292 290 #if !SVC_EXTENSION 291 // destroy ROM 292 destroyROM(); 293 #endif 294 #if REF_IDX_FRAMEWORK 293 #if SVC_EXTENSION 295 294 for(Int i=0; i<MAX_NUM_REF; i++) 296 295 { … … 301 300 m_cIlpPic[i] = NULL; 302 301 } 303 } 302 } 303 #else 304 // destroy ROM 305 destroyROM(); 304 306 #endif 305 307 return; 306 308 } 307 309 308 Void TEncTop::init( )310 Void TEncTop::init(Bool isFieldCoding) 309 311 { 310 312 // initialize SPS … … 317 319 m_cPPS.setSPS(&m_cSPS); 318 320 xInitPPS(); 319 xInitRPS( );321 xInitRPS(isFieldCoding); 320 322 321 323 xInitPPSforTiles(); … … 346 348 m_iSPSIdCnt ++; 347 349 m_iPPSIdCnt ++; 348 #endif349 #if REF_IDX_FRAMEWORK350 350 xInitILRP(); 351 351 #endif … … 396 396 397 397 // compress GOP 398 m_cGOPEncoder.compressGOP(iPicIdInGOP, m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut );398 m_cGOPEncoder.compressGOP(iPicIdInGOP, m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, false, false); 399 399 400 400 #if RATE_CONTROL_LAMBDA_DOMAIN … … 456 456 457 457 // compress GOP 458 m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut); 458 459 m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, false, false); 459 460 460 461 #if RATE_CONTROL_LAMBDA_DOMAIN … … 467 468 iNumEncoded = m_iNumPicRcvd; 468 469 m_iNumPicRcvd = 0; 470 m_uiNumAllPicCoded += iNumEncoded; 471 } 472 #endif 473 474 /**------------------------------------------------ 475 Separate interlaced frame into two fields 476 -------------------------------------------------**/ 477 void separateFields(Pel* org, Pel* dstField, UInt stride, UInt width, UInt height, Bool isTop) 478 { 479 if (!isTop) 480 { 481 org += stride; 482 } 483 for (Int y = 0; y < height>>1; y++) 484 { 485 for (Int x = 0; x < width; x++) 486 { 487 dstField[x] = org[x]; 488 } 489 490 dstField += stride; 491 org += stride*2; 492 } 493 494 } 495 496 #if SVC_EXTENSION 497 Void TEncTop::encodePrep( TComPicYuv* pcPicYuvOrg, Bool isTff ) 498 { 499 if (pcPicYuvOrg) 500 { 501 /* -- TOP FIELD -- */ 502 /* -- Top field initialization -- */ 503 504 TComPic *pcTopField; 505 xGetNewPicBuffer( pcTopField ); 506 pcTopField->getPicSym()->allocSaoParam(&m_cEncSAO); 507 pcTopField->setReconMark (false); 508 509 pcTopField->getSlice(0)->setPOC( m_iPOCLast ); 510 pcTopField->getPicYuvRec()->setBorderExtension(false); 511 pcTopField->setTopField(isTff); 512 513 Int nHeight = pcPicYuvOrg->getHeight(); 514 Int nWidth = pcPicYuvOrg->getWidth(); 515 Int nStride = pcPicYuvOrg->getStride(); 516 Int nPadLuma = pcPicYuvOrg->getLumaMargin(); 517 Int nPadChroma = pcPicYuvOrg->getChromaMargin(); 518 519 // Get pointers 520 Pel * PicBufY = pcPicYuvOrg->getBufY(); 521 Pel * PicBufU = pcPicYuvOrg->getBufU(); 522 Pel * PicBufV = pcPicYuvOrg->getBufV(); 523 524 Pel * pcTopFieldY = pcTopField->getPicYuvOrg()->getLumaAddr(); 525 Pel * pcTopFieldU = pcTopField->getPicYuvOrg()->getCbAddr(); 526 Pel * pcTopFieldV = pcTopField->getPicYuvOrg()->getCrAddr(); 527 528 // compute image characteristics 529 if ( getUseAdaptiveQP() ) 530 { 531 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcTopField ) ); 532 } 533 534 /* -- Defield -- */ 535 536 Bool isTop = isTff; 537 538 separateFields(PicBufY + nPadLuma + nStride*nPadLuma, pcTopFieldY, nStride, nWidth, nHeight, isTop); 539 separateFields(PicBufU + nPadChroma + (nStride >> 1)*nPadChroma, pcTopFieldU, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 540 separateFields(PicBufV + nPadChroma + (nStride >> 1)*nPadChroma, pcTopFieldV, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 541 542 /* -- BOTTOM FIELD -- */ 543 /* -- Bottom field initialization -- */ 544 545 TComPic* pcBottomField; 546 xGetNewPicBuffer( pcBottomField ); 547 pcBottomField->getPicSym()->allocSaoParam(&m_cEncSAO); 548 pcBottomField->setReconMark (false); 549 550 pcBottomField->getSlice(0)->setPOC( m_iPOCLast); 551 pcBottomField->getPicYuvRec()->setBorderExtension(false); 552 pcBottomField->setTopField(!isTff); 553 554 nHeight = pcPicYuvOrg->getHeight(); 555 nWidth = pcPicYuvOrg->getWidth(); 556 nStride = pcPicYuvOrg->getStride(); 557 nPadLuma = pcPicYuvOrg->getLumaMargin(); 558 nPadChroma = pcPicYuvOrg->getChromaMargin(); 559 560 // Get pointers 561 PicBufY = pcPicYuvOrg->getBufY(); 562 PicBufU = pcPicYuvOrg->getBufU(); 563 PicBufV = pcPicYuvOrg->getBufV(); 564 565 Pel * pcBottomFieldY = pcBottomField->getPicYuvOrg()->getLumaAddr(); 566 Pel * pcBottomFieldU = pcBottomField->getPicYuvOrg()->getCbAddr(); 567 Pel * pcBottomFieldV = pcBottomField->getPicYuvOrg()->getCrAddr(); 568 569 // Compute image characteristics 570 if ( getUseAdaptiveQP() ) 571 { 572 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcBottomField ) ); 573 } 574 575 /* -- Defield -- */ 576 577 isTop = !isTff; 578 579 separateFields(PicBufY + nPadLuma + nStride*nPadLuma, pcBottomFieldY, nStride, nWidth, nHeight, isTop); 580 separateFields(PicBufU + nPadChroma + (nStride >> 1)*nPadChroma, pcBottomFieldU, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 581 separateFields(PicBufV + nPadChroma + (nStride >> 1)*nPadChroma, pcBottomFieldV, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 582 583 } 584 } 585 586 Void TEncTop::encode( TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int iPicIdInGOP, Bool isTff ) 587 { 588 // compress GOP 589 if (m_iPOCLast == 0) // compress field 0 590 { 591 m_cGOPEncoder.compressGOP(iPicIdInGOP, m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, true, isTff); 592 } 593 594 if (pcPicYuvOrg) 595 { 596 TComPicYuv* rpcPicYuvRec = new TComPicYuv; 597 if ( rcListPicYuvRecOut.size() == (UInt)m_iGOPSize ) 598 { 599 rpcPicYuvRec = rcListPicYuvRecOut.popFront(); 600 } 601 else 602 { 603 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 604 } 605 rcListPicYuvRecOut.pushBack( rpcPicYuvRec ); 606 } 607 608 // compress GOP 609 m_cGOPEncoder.compressGOP(iPicIdInGOP, m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, true, isTff); 610 611 m_uiNumAllPicCoded ++; 612 } 613 #else 614 Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, Bool isTff) 615 { 616 /* -- TOP FIELD -- */ 617 618 if (pcPicYuvOrg) 619 { 620 621 /* -- Top field initialization -- */ 622 623 TComPic *pcTopField; 624 xGetNewPicBuffer( pcTopField ); 625 pcTopField->getPicSym()->allocSaoParam(&m_cEncSAO); 626 pcTopField->setReconMark (false); 627 628 pcTopField->getSlice(0)->setPOC( m_iPOCLast ); 629 pcTopField->getPicYuvRec()->setBorderExtension(false); 630 pcTopField->setTopField(isTff); 631 632 Int nHeight = pcPicYuvOrg->getHeight(); 633 Int nWidth = pcPicYuvOrg->getWidth(); 634 Int nStride = pcPicYuvOrg->getStride(); 635 Int nPadLuma = pcPicYuvOrg->getLumaMargin(); 636 Int nPadChroma = pcPicYuvOrg->getChromaMargin(); 637 638 // Get pointers 639 Pel * PicBufY = pcPicYuvOrg->getBufY(); 640 Pel * PicBufU = pcPicYuvOrg->getBufU(); 641 Pel * PicBufV = pcPicYuvOrg->getBufV(); 642 643 Pel * pcTopFieldY = pcTopField->getPicYuvOrg()->getLumaAddr(); 644 Pel * pcTopFieldU = pcTopField->getPicYuvOrg()->getCbAddr(); 645 Pel * pcTopFieldV = pcTopField->getPicYuvOrg()->getCrAddr(); 646 647 // compute image characteristics 648 if ( getUseAdaptiveQP() ) 649 { 650 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcTopField ) ); 651 } 652 653 /* -- Defield -- */ 654 655 Bool isTop = isTff; 656 657 separateFields(PicBufY + nPadLuma + nStride*nPadLuma, pcTopFieldY, nStride, nWidth, nHeight, isTop); 658 separateFields(PicBufU + nPadChroma + (nStride >> 1)*nPadChroma, pcTopFieldU, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 659 separateFields(PicBufV + nPadChroma + (nStride >> 1)*nPadChroma, pcTopFieldV, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 660 661 } 662 663 if (m_iPOCLast == 0) // compress field 0 664 { 665 m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, true, isTff); 666 } 667 668 /* -- BOTTOM FIELD -- */ 669 670 if (pcPicYuvOrg) 671 { 672 673 /* -- Bottom field initialization -- */ 674 675 TComPic* pcBottomField; 676 xGetNewPicBuffer( pcBottomField ); 677 pcBottomField->getPicSym()->allocSaoParam(&m_cEncSAO); 678 pcBottomField->setReconMark (false); 679 680 TComPicYuv* rpcPicYuvRec = new TComPicYuv; 681 if ( rcListPicYuvRecOut.size() == (UInt)m_iGOPSize ) 682 { 683 rpcPicYuvRec = rcListPicYuvRecOut.popFront(); 684 } 685 else 686 { 687 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 688 } 689 rcListPicYuvRecOut.pushBack( rpcPicYuvRec ); 690 691 pcBottomField->getSlice(0)->setPOC( m_iPOCLast); 692 pcBottomField->getPicYuvRec()->setBorderExtension(false); 693 pcBottomField->setTopField(!isTff); 694 695 int nHeight = pcPicYuvOrg->getHeight(); 696 int nWidth = pcPicYuvOrg->getWidth(); 697 int nStride = pcPicYuvOrg->getStride(); 698 int nPadLuma = pcPicYuvOrg->getLumaMargin(); 699 int nPadChroma = pcPicYuvOrg->getChromaMargin(); 700 701 // Get pointers 702 Pel * PicBufY = pcPicYuvOrg->getBufY(); 703 Pel * PicBufU = pcPicYuvOrg->getBufU(); 704 Pel * PicBufV = pcPicYuvOrg->getBufV(); 705 706 Pel * pcBottomFieldY = pcBottomField->getPicYuvOrg()->getLumaAddr(); 707 Pel * pcBottomFieldU = pcBottomField->getPicYuvOrg()->getCbAddr(); 708 Pel * pcBottomFieldV = pcBottomField->getPicYuvOrg()->getCrAddr(); 709 710 // Compute image characteristics 711 if ( getUseAdaptiveQP() ) 712 { 713 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcBottomField ) ); 714 } 715 716 /* -- Defield -- */ 717 718 Bool isTop = !isTff; 719 720 separateFields(PicBufY + nPadLuma + nStride*nPadLuma, pcBottomFieldY, nStride, nWidth, nHeight, isTop); 721 separateFields(PicBufU + nPadChroma + (nStride >> 1)*nPadChroma, pcBottomFieldU, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 722 separateFields(PicBufV + nPadChroma + (nStride >> 1)*nPadChroma, pcBottomFieldV, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 723 724 } 725 726 if ( ( !(m_iNumPicRcvd) || (!flush && m_iPOCLast != 1 && m_iNumPicRcvd != m_iGOPSize && m_iGOPSize)) ) 727 { 728 iNumEncoded = 0; 729 return; 730 } 731 732 // compress GOP 733 m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, true, isTff); 734 735 iNumEncoded = m_iNumPicRcvd; 736 m_iNumPicRcvd = 0; 469 737 m_uiNumAllPicCoded += iNumEncoded; 470 738 } … … 523 791 524 792 //only for scalable extension 793 #if SCALABILITY_MASK_E0104 794 assert( m_cVPS.getScalabilityMask(2) == true ); 795 #else 525 796 assert( m_cVPS.getScalabilityMask(1) == true ); 797 #endif 526 798 } 527 799 } … … 560 832 561 833 //only for scalable extension 834 #if SCALABILITY_MASK_E0104 835 assert( m_cVPS.getScalabilityMask(2) == true ); 836 #else 562 837 assert( m_cVPS.getScalabilityMask(1) == true ); 838 #endif 563 839 } 564 840 } … … 682 958 } 683 959 960 #if REPN_FORMAT_IN_VPS 961 m_cSPS.setBitDepthY( m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_layerId ) )->getBitDepthVpsLuma() ); 962 m_cSPS.setBitDepthC( m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_layerId ) )->getBitDepthVpsChroma() ); 963 964 m_cSPS.setQpBDOffsetY ( 6*(m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_layerId ) )->getBitDepthVpsLuma() - 8) ); 965 m_cSPS.setQpBDOffsetC ( 6*(m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_layerId ) )->getBitDepthVpsChroma() - 8) ); 966 #else 684 967 m_cSPS.setBitDepthY( g_bitDepthY ); 685 968 m_cSPS.setBitDepthC( g_bitDepthC ); … … 687 970 m_cSPS.setQpBDOffsetY ( 6*(g_bitDepthY - 8) ); 688 971 m_cSPS.setQpBDOffsetC ( 6*(g_bitDepthC - 8) ); 972 #endif 689 973 690 974 m_cSPS.setUseSAO( m_bUseSAO ); … … 745 1029 Void TEncTop::xInitPPS() 746 1030 { 1031 #if IL_SL_SIGNALLING_N0371 1032 m_cPPS.setLayerId(m_layerId); 1033 #endif 1034 747 1035 m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred ); 748 1036 Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false; 749 1037 1038 #if REPN_FORMAT_IN_VPS 1039 Int lowestQP; 1040 if( m_layerId == 0 || m_cSPS.getUpdateRepFormatFlag() ) 1041 { 1042 lowestQP = - m_cSPS.getQpBDOffsetY(); 1043 } 1044 else 1045 { 1046 lowestQP = - (m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_layerId ) )->getBitDepthVpsLuma() - 8) * 6; 1047 } 1048 #else 750 1049 Int lowestQP = - m_cSPS.getQpBDOffsetY(); 1050 #endif 751 1051 752 1052 if(getUseLossless()) … … 860 1160 } 861 1161 } 862 #if REF_IDX_FRAMEWORK1162 #if SVC_EXTENSION 863 1163 if (!m_layerId) 864 1164 { … … 869 1169 m_cPPS.setListsModificationPresentFlag(true); 870 1170 } 871 #endif 872 #if SVC_EXTENSION 1171 873 1172 m_cPPS.setPPSId ( m_iPPSIdCnt ); 874 1173 m_cPPS.setSPSId ( m_iSPSIdCnt ); 875 1174 #endif 1175 #if POC_RESET_FLAG 1176 m_cPPS.setNumExtraSliceHeaderBits( 2 ); 1177 #endif 876 1178 } 877 1179 878 1180 //Function for initializing m_RPSList, a list of TComReferencePictureSet, based on the GOPEntry objects read from the config file. 879 Void TEncTop::xInitRPS( )1181 Void TEncTop::xInitRPS(Bool isFieldCoding) 880 1182 { 881 1183 TComReferencePictureSet* rps; 882 1184 883 m_cSPS.createRPSList(getGOPSize()+m_extraRPSs );1185 m_cSPS.createRPSList(getGOPSize()+m_extraRPSs+1); 884 1186 TComRPSList* rpsList = m_cSPS.getRPSList(); 885 1187 … … 982 1284 printf("Warning: number of negative pictures in RPS is different between intra and inter RPS specified in the config file.\n"); 983 1285 rps->setNumberOfNegativePictures(numNeg); 984 rps->setNumberOfP ositivePictures(numNeg+numPos);1286 rps->setNumberOfPictures(numNeg+numPos); 985 1287 } 986 1288 if (numPos != rps->getNumberOfPositivePictures()) … … 988 1290 printf("Warning: number of positive pictures in RPS is different between intra and inter RPS specified in the config file.\n"); 989 1291 rps->setNumberOfPositivePictures(numPos); 990 rps->setNumberOfP ositivePictures(numNeg+numPos);1292 rps->setNumberOfPictures(numNeg+numPos); 991 1293 } 992 1294 RPSTemp.setNumberOfPictures(numNeg+numPos); … … 1052 1354 #endif //INTER_RPS_AUTO 1053 1355 } 1054 1356 //In case of field coding, we need to set special parameters for the first bottom field of the sequence, since it is not specified in the cfg file. 1357 //The position = GOPSize + extraRPSs which is (a priori) unused is reserved for this field in the RPS. 1358 if (isFieldCoding) 1359 { 1360 rps = rpsList->getReferencePictureSet(getGOPSize()+m_extraRPSs); 1361 rps->setNumberOfPictures(1); 1362 rps->setNumberOfNegativePictures(1); 1363 rps->setNumberOfPositivePictures(0); 1364 rps->setNumberOfLongtermPictures(0); 1365 rps->setDeltaPOC(0,-1); 1366 rps->setPOC(0,0); 1367 rps->setUsed(0,true); 1368 rps->setInterRPSPrediction(false); 1369 rps->setDeltaRIdxMinus1(0); 1370 rps->setDeltaRPS(0); 1371 rps->setNumRefIdc(0); 1372 } 1055 1373 } 1056 1374 … … 1061 1379 { 1062 1380 slice->setRPSidx(GOPid); 1063 1064 1381 for(Int extraNum=m_iGOPSize; extraNum<m_extraRPSs+m_iGOPSize; extraNum++) 1065 1382 { … … 1085 1402 } 1086 1403 1404 if(POCCurr == 1 && slice->getPic()->isField()) 1405 { 1406 slice->setRPSidx(m_iGOPSize+m_extraRPSs); 1407 } 1408 1087 1409 slice->setRPS(getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); 1088 1410 slice->getRPS()->setNumberOfPictures(slice->getRPS()->getNumberOfNegativePictures()+slice->getRPS()->getNumberOfPositivePictures()); 1089 1090 1411 } 1091 1412 … … 1215 1536 #endif 1216 1537 1217 #if REF_IDX_FRAMEWORK 1538 #if SVC_EXTENSION 1539 #if !REPN_FORMAT_IN_VPS 1218 1540 Void TEncTop::xInitILRP() 1219 1541 { … … 1249 1571 } 1250 1572 } 1251 1573 #else 1574 Void TEncTop::xInitILRP() 1575 { 1576 RepFormat *repFormat = m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_layerId ) ); 1577 Int bitDepthY,bitDepthC,picWidth,picHeight; 1578 1579 if( m_cSPS.getUpdateRepFormatFlag() ) 1580 { 1581 bitDepthY = m_cSPS.getBitDepthY(); 1582 bitDepthC = m_cSPS.getBitDepthC(); 1583 picWidth = m_cSPS.getPicWidthInLumaSamples(); 1584 picHeight = m_cSPS.getPicHeightInLumaSamples(); 1585 } 1586 else 1587 { 1588 bitDepthY = repFormat->getBitDepthVpsLuma(); 1589 bitDepthC = repFormat->getBitDepthVpsChroma(); 1590 picWidth = repFormat->getPicWidthVpsInLumaSamples(); 1591 picHeight = repFormat->getPicHeightVpsInLumaSamples(); 1592 } 1593 1594 if(m_layerId > 0) 1595 { 1596 g_bitDepthY = bitDepthY; 1597 g_bitDepthC = bitDepthC; 1598 g_uiMaxCUWidth = m_cSPS.getMaxCUWidth(); 1599 g_uiMaxCUHeight = m_cSPS.getMaxCUHeight(); 1600 g_uiMaxCUDepth = m_cSPS.getMaxCUDepth(); 1601 g_uiAddCUDepth = max (0, m_cSPS.getLog2MinCodingBlockSize() - (Int)m_cSPS.getQuadtreeTULog2MinSize() ); 1602 1603 Int numReorderPics[MAX_TLAYER]; 1604 Window &conformanceWindow = m_cSPS.getConformanceWindow(); 1605 Window defaultDisplayWindow = m_cSPS.getVuiParametersPresentFlag() ? m_cSPS.getVuiParameters()->getDefaultDisplayWindow() : Window(); 1606 1607 if (m_cIlpPic[0] == NULL) 1608 { 1609 for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++) // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]] 1610 { 1611 m_cIlpPic[j] = new TComPic; 1612 #if SVC_UPSAMPLING 1613 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1614 #else 1615 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 1616 #endif 1617 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCUsInFrame(); i++) 1618 { 1619 m_cIlpPic[j]->getPicSym()->getCU(i)->initCU(m_cIlpPic[j], i); 1620 } 1621 } 1622 } 1623 } 1624 } 1625 #endif 1252 1626 Void TEncTop::setILRPic(TComPic *pcPic) 1253 1627 { … … 1263 1637 m_cIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension(false); 1264 1638 m_cIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder(); 1639 for (Int j=0; j<m_cIlpPic[refLayerIdc]->getPicSym()->getNumberOfCUsInFrame(); j++) // set reference CU layerId 1640 { 1641 m_cIlpPic[refLayerIdc]->getPicSym()->getCU(j)->setLayerId(m_cIlpPic[refLayerIdc]->getLayerId()); 1642 } 1265 1643 } 1266 1644 } -
trunk/source/Lib/TLibEncoder/TEncTop.h
r313 r442 130 130 131 131 #if SVC_EXTENSION 132 132 133 TEncTop** m_ppcTEncTop; 133 134 TEncTop* getLayerEnc(UInt layer) { return m_ppcTEncTop[layer]; } 134 #endif135 #if REF_IDX_FRAMEWORK136 135 TComPic* m_cIlpPic[MAX_NUM_REF]; ///< Inter layer Prediction picture = upsampled picture 137 #endif138 136 #if REF_IDX_MFM 139 137 Bool m_bMFMEnabledFlag; … … 145 143 UInt m_numScaledRefLayerOffsets; 146 144 Window m_scaledRefLayerWindow[MAX_LAYERS]; 145 #endif 146 #if POC_RESET_FLAG 147 Int m_pocAdjustmentValue; 148 #endif 147 149 #endif 148 150 protected: … … 152 154 153 155 Void xInitPPSforTiles (); 154 Void xInitRPS ( );///< initialize PPS from encoder options155 #if REF_IDX_FRAMEWORK156 Void xInitRPS (Bool isFieldCoding); ///< initialize PPS from encoder options 157 #if SVC_EXTENSION 156 158 Void xInitILRP(); 157 159 #endif … … 162 164 Void create (); 163 165 Void destroy (); 164 Void init ( );166 Void init (Bool isFieldCoding); 165 167 Void deletePicBuffer (); 166 168 … … 207 209 Int getNumPicRcvd () { return m_iNumPicRcvd; } 208 210 Void setNumPicRcvd ( Int num ) { m_iNumPicRcvd = num; } 209 #endif210 211 #if SCALED_REF_LAYER_OFFSETS 211 212 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } … … 213 214 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 214 215 #endif 216 #endif 215 217 216 218 // ------------------------------------------------------------------------------------------------------------------- … … 220 222 /// encode several number of pictures until end-of-sequence 221 223 #if SVC_EXTENSION 222 #if REF_IDX_FRAMEWORK223 224 TComPic** getIlpList() { return m_cIlpPic; } 224 225 Void setILRPic(TComPic *pcPic); 225 #endif226 226 #if REF_IDX_MFM 227 227 Void setMFMEnabledFlag (Bool flag) {m_bMFMEnabledFlag = flag;} … … 236 236 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 237 237 #endif 238 Void encode( TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int iPicIdInGOP 238 Void encode( TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int iPicIdInGOP ); 239 239 Void encodePrep( TComPicYuv* pcPicYuvOrg ); 240 Void encode( TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int iPicIdInGOP, Bool isTff ); 241 Void encodePrep( TComPicYuv* pcPicYuvOrg, Bool isTff ); 240 242 #if VPS_EXTN_DIRECT_REF_LAYERS 241 243 TEncTop* getRefLayerEnc(UInt refLayerIdc); 242 244 #endif 243 #else 245 #if POC_RESET_FLAG 246 Int getPocAdjustmentValue() { return m_pocAdjustmentValue;} 247 Void setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x; } 248 #endif 249 #else //SVC_EXTENSION 244 250 Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, 245 std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded ); 246 #endif 247 248 void printSummary() { m_cGOPEncoder.printOutSummary (m_uiNumAllPicCoded); } 251 std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded ); 252 253 /// encode several number of pictures until end-of-sequence 254 Void encode( bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, 255 std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, Bool isTff); 256 257 Void printSummary(Bool isField) { m_cGOPEncoder.printOutSummary (m_uiNumAllPicCoded, isField); } 258 #endif //#if SVC_EXTENSION 249 259 }; 250 260 -
trunk/source/Lib/TLibVideoIO/TVideoIOYuv.cpp
r313 r442 339 339 } 340 340 341 static Bool writeField(ostream& fd, Pel* top, Pel* bottom, Bool is16bit, 342 UInt stride, 343 UInt width, UInt height, bool isTff) 344 { 345 Int write_len = width * (is16bit ? 2 : 1)*2; 346 UChar *buf = new UChar[write_len]; 347 for (Int y = 0; y < height; y++) 348 { 349 if (!is16bit) 350 { 351 for (Int x = 0; x < width; x++) 352 { 353 buf[x] = isTff ? (UChar) top[x] : (UChar) bottom[x]; 354 buf[width+x] = isTff ? (UChar) bottom[x] : (UChar) top[x]; 355 } 356 } 357 else 358 { 359 for (Int x = 0; x < width; x++) 360 { 361 buf[2*x] = isTff ? top[x] & 0xff : bottom[x] & 0xff; 362 buf[2*x+1] = isTff ? (top[x] >> 8) & 0xff : (bottom[x] >> 8) & 0xff; 363 364 buf[width+2*x] = isTff ? bottom[x] & 0xff : top[x] & 0xff; 365 buf[width+2*x+1] = isTff ? (bottom[x] >> 8) & 0xff : (top[x] >> 8) & 0xff; 366 } 367 } 368 369 fd.write(reinterpret_cast<Char*>(buf), write_len); 370 if (fd.eof() || fd.fail() ) 371 { 372 delete[] buf; 373 return false; 374 } 375 top += stride; 376 bottom += stride; 377 } 378 delete[] buf; 379 return true; 380 } 341 381 /** 342 382 * Read one Y'CbCr frame, performing any required input scaling to change … … 501 541 } 502 542 543 544 /** 545 * Write one Y'CbCr frame. No bit-depth conversion is performed, pcPicYuv is 546 * assumed to be at TVideoIO::m_fileBitdepth depth. 547 * 548 * @param pPicTop input top field YUV buffer class pointer 549 * @param pPicBottom input bottom field YUV buffer class pointer 550 * @param aiPad source padding size, aiPad[0] = horizontal, aiPad[1] = vertical 551 * @return true for success, false in case of error 552 */ 553 Bool TVideoIOYuv::write( TComPicYuv* pPicTop, TComPicYuv* pPicBottom, Int cropLeft, Int cropRight, Int cropTop, Int cropBottom , bool isTff) 554 { 555 // compute actual YUV frame size excluding padding size 556 Int iStride = pPicTop->getStride(); 557 UInt width = pPicTop->getWidth() - cropLeft - cropRight; 558 UInt height = pPicTop->getHeight() - cropTop - cropBottom; 559 Bool is16bit = m_fileBitDepthY > 8 || m_fileBitDepthC > 8; 560 561 TComPicYuv *dstPicTop = NULL; 562 TComPicYuv *dstPicBottom = NULL; 563 564 Bool retval = true; 565 566 if (m_bitDepthShiftY != 0 || m_bitDepthShiftC != 0) 567 { 568 dstPicTop = new TComPicYuv; 569 dstPicTop->create( pPicTop->getWidth(), pPicTop->getHeight(), 1, 1, 0 ); 570 pPicTop->copyToPic(dstPicTop); 571 572 dstPicBottom = new TComPicYuv; 573 dstPicBottom->create( pPicBottom->getWidth(), pPicBottom->getHeight(), 1, 1, 0 ); 574 pPicBottom->copyToPic(dstPicBottom); 575 576 Pel minvalY = 0; 577 Pel minvalC = 0; 578 Pel maxvalY = (1 << m_fileBitDepthY) - 1; 579 Pel maxvalC = (1 << m_fileBitDepthC) - 1; 580 #if CLIP_TO_709_RANGE 581 if (-m_bitDepthShiftY < 0 && m_fileBitDepthY >= 8) 582 { 583 /* ITU-R BT.709 compliant clipping for converting say 10b to 8b */ 584 minvalY = 1 << (m_fileBitDepthY - 8); 585 maxvalY = (0xff << (m_fileBitDepthY - 8)) -1; 586 } 587 if (-m_bitDepthShiftC < 0 && m_fileBitDepthC >= 8) 588 { 589 /* ITU-R BT.709 compliant clipping for converting say 10b to 8b */ 590 minvalC = 1 << (m_fileBitDepthC - 8); 591 maxvalC = (0xff << (m_fileBitDepthC - 8)) -1; 592 } 593 #endif 594 scalePlane(dstPicTop->getLumaAddr(), dstPicTop->getStride(), dstPicTop->getWidth(), dstPicTop->getHeight(), -m_bitDepthShiftY, minvalY, maxvalY); 595 scalePlane(dstPicTop->getCbAddr(), dstPicTop->getCStride(), dstPicTop->getWidth()>>1, dstPicTop->getHeight()>>1, -m_bitDepthShiftC, minvalC, maxvalC); 596 scalePlane(dstPicTop->getCrAddr(), dstPicTop->getCStride(), dstPicTop->getWidth()>>1, dstPicTop->getHeight()>>1, -m_bitDepthShiftC, minvalC, maxvalC); 597 598 scalePlane(dstPicBottom->getLumaAddr(), dstPicBottom->getStride(), dstPicBottom->getWidth(), dstPicBottom->getHeight(), -m_bitDepthShiftY, minvalY, maxvalY); 599 scalePlane(dstPicBottom->getCbAddr(), dstPicBottom->getCStride(), dstPicBottom->getWidth()>>1, dstPicBottom->getHeight()>>1, -m_bitDepthShiftC, minvalC, maxvalC); 600 scalePlane(dstPicBottom->getCrAddr(), dstPicBottom->getCStride(), dstPicBottom->getWidth()>>1, dstPicBottom->getHeight()>>1, -m_bitDepthShiftC, minvalC, maxvalC); 601 } 602 else 603 { 604 dstPicTop = pPicTop; 605 dstPicBottom = pPicBottom; 606 } 607 // location of upper left pel in a plane 608 Int planeOffset = 0; //cropLeft + cropTop * iStride; 609 //Write luma 610 if (! writeField(m_cHandle, dstPicTop->getLumaAddr() + planeOffset, dstPicBottom->getLumaAddr() + planeOffset, is16bit, iStride, width, height, isTff)) 611 { 612 retval=false; 613 goto exit; 614 } 615 616 width >>= 1; 617 height >>= 1; 618 iStride >>= 1; 619 cropLeft >>= 1; 620 cropRight >>= 1; 621 622 planeOffset = 0; // cropLeft + cropTop * iStride; 623 624 //Write chroma U 625 if (! writeField(m_cHandle, dstPicTop->getCbAddr() + planeOffset, dstPicBottom->getCbAddr() + planeOffset, is16bit, iStride, width, height, isTff)) 626 { 627 retval=false; 628 goto exit; 629 } 630 631 //Write chroma V 632 if (! writeField(m_cHandle, dstPicTop->getCrAddr() + planeOffset, dstPicBottom->getCrAddr() + planeOffset, is16bit, iStride, width, height, isTff)) 633 634 { 635 retval=false; 636 goto exit; 637 } 638 639 exit: 640 if (m_bitDepthShiftY != 0 || m_bitDepthShiftC != 0) 641 { 642 dstPicTop->destroy(); 643 delete dstPicTop; 644 dstPicBottom->destroy(); 645 delete dstPicBottom; 646 } 647 return retval; 648 } -
trunk/source/Lib/TLibVideoIO/TVideoIOYuv.h
r313 r442 72 72 Bool read ( TComPicYuv* pPicYuv, Int aiPad[2] ); ///< read one YUV frame with padding parameter 73 73 Bool write( TComPicYuv* pPicYuv, Int confLeft=0, Int confRight=0, Int confTop=0, Int confBottom=0 ); 74 Bool write( TComPicYuv* pPicYuv, TComPicYuv* pPicYuv2, Int confLeft=0, Int confRight=0, Int confTop=0, Int confBottom=0, Bool isTff = false ); 74 75 75 76 Bool isEof (); ///< check for end-of-file
Note: See TracChangeset for help on using the changeset viewer.