1 | /* The copyright in this software is being made available under the BSD |
---|
2 | * License, included below. This software may be subject to other third party |
---|
3 | * and contributor rights, including patent rights, and no such rights are |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2014, ITU/ISO/IEC |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
15 | * this list of conditions and the following disclaimer in the documentation |
---|
16 | * and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
18 | * be used to endorse or promote products derived from this software without |
---|
19 | * specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | */ |
---|
33 | |
---|
34 | /** \file TAppEncTop.cpp |
---|
35 | \brief Encoder application class |
---|
36 | */ |
---|
37 | |
---|
38 | #include <list> |
---|
39 | #include <fstream> |
---|
40 | #include <stdlib.h> |
---|
41 | #include <stdio.h> |
---|
42 | #include <fcntl.h> |
---|
43 | #include <assert.h> |
---|
44 | |
---|
45 | #include "TAppEncTop.h" |
---|
46 | #include "TLibEncoder/AnnexBwrite.h" |
---|
47 | |
---|
48 | using namespace std; |
---|
49 | |
---|
50 | //! \ingroup TAppEncoder |
---|
51 | //! \{ |
---|
52 | |
---|
53 | // ==================================================================================================================== |
---|
54 | // Constructor / destructor / initialization / destroy |
---|
55 | // ==================================================================================================================== |
---|
56 | |
---|
57 | TAppEncTop::TAppEncTop() |
---|
58 | { |
---|
59 | |
---|
60 | #if H_MV_HLS_8 |
---|
61 | m_vps = new TComVPS; |
---|
62 | #endif |
---|
63 | #if !H_MV |
---|
64 | m_iFrameRcvd = 0; |
---|
65 | #endif |
---|
66 | m_totalBytes = 0; |
---|
67 | m_essentialBytes = 0; |
---|
68 | } |
---|
69 | |
---|
70 | TAppEncTop::~TAppEncTop() |
---|
71 | { |
---|
72 | #if H_MV_HLS_8 |
---|
73 | if (m_vps) |
---|
74 | { |
---|
75 | delete m_vps; |
---|
76 | }; |
---|
77 | #endif |
---|
78 | |
---|
79 | } |
---|
80 | |
---|
81 | Void TAppEncTop::xInitLibCfg() |
---|
82 | { |
---|
83 | #if H_MV |
---|
84 | #if H_MV_HLS_8 |
---|
85 | TComVPS& vps = (*m_vps); |
---|
86 | #else |
---|
87 | TComVPS& vps = m_vps; |
---|
88 | #endif |
---|
89 | #else |
---|
90 | TComVPS vps; |
---|
91 | #endif |
---|
92 | |
---|
93 | #if H_3D |
---|
94 | vps.createCamPars(m_iNumberOfViews); |
---|
95 | TComDLT& dlt = m_dlt; |
---|
96 | #endif |
---|
97 | |
---|
98 | #if H_MV |
---|
99 | Int maxTempLayer = -1; |
---|
100 | for (Int j = 0; j < m_numberOfLayers; j++) |
---|
101 | { |
---|
102 | maxTempLayer = max( m_maxTempLayerMvc[ j ], maxTempLayer ); |
---|
103 | } |
---|
104 | |
---|
105 | vps.setMaxTLayers ( maxTempLayer ); |
---|
106 | if ( maxTempLayer ) |
---|
107 | { |
---|
108 | vps.setTemporalNestingFlag(true); |
---|
109 | } |
---|
110 | vps.setMaxLayersMinus1( m_numberOfLayers - 1); |
---|
111 | for(Int i = 0; i < MAX_TLAYER; i++) |
---|
112 | { |
---|
113 | Int maxNumReOrderPics = 0; |
---|
114 | Int maxDecPicBuffering = 0; |
---|
115 | for (Int j = 0; j < m_numberOfLayers; j++) |
---|
116 | { |
---|
117 | maxNumReOrderPics = max( maxNumReOrderPics, m_numReorderPicsMvc [ j ][ i ] ); |
---|
118 | maxDecPicBuffering = max( maxDecPicBuffering, m_maxDecPicBufferingMvc[ j ][ i ] ); |
---|
119 | } |
---|
120 | |
---|
121 | vps.setNumReorderPics ( maxNumReOrderPics ,i ); |
---|
122 | vps.setMaxDecPicBuffering ( maxDecPicBuffering ,i ); |
---|
123 | } |
---|
124 | #else |
---|
125 | vps.setMaxTLayers ( m_maxTempLayer ); |
---|
126 | if (m_maxTempLayer == 1) |
---|
127 | { |
---|
128 | vps.setTemporalNestingFlag(true); |
---|
129 | } |
---|
130 | vps.setMaxLayers ( 1 ); |
---|
131 | for(Int i = 0; i < MAX_TLAYER; i++) |
---|
132 | { |
---|
133 | vps.setNumReorderPics ( m_numReorderPics[i], i ); |
---|
134 | vps.setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); |
---|
135 | } |
---|
136 | #endif |
---|
137 | #if H_MV |
---|
138 | xSetLayerIds ( vps ); |
---|
139 | xSetDimensionIdAndLength ( vps ); |
---|
140 | xSetDependencies( vps ); |
---|
141 | xSetProfileTierLevel ( vps ); |
---|
142 | xSetRepFormat ( vps ); |
---|
143 | xSetLayerSets ( vps ); |
---|
144 | xSetDpbSize ( vps ); |
---|
145 | xSetVPSVUI ( vps ); |
---|
146 | #if H_3D |
---|
147 | xSetVPSExtension2 ( vps ); |
---|
148 | m_ivPicLists.setVPS ( &vps ); |
---|
149 | xDeriveDltArray ( vps, dlt ); |
---|
150 | #endif |
---|
151 | |
---|
152 | |
---|
153 | for(Int layerIdInVps = 0; layerIdInVps < m_numberOfLayers; layerIdInVps++) |
---|
154 | { |
---|
155 | m_frameRcvd .push_back(0); |
---|
156 | m_acTEncTopList .push_back(new TEncTop); |
---|
157 | m_acTVideoIOYuvInputFileList.push_back(new TVideoIOYuv); |
---|
158 | m_acTVideoIOYuvReconFileList.push_back(new TVideoIOYuv); |
---|
159 | m_picYuvRec .push_back(new TComList<TComPicYuv*>) ; |
---|
160 | m_ivPicLists.push_back( m_acTEncTopList[ layerIdInVps ]->getListPic() ); |
---|
161 | TEncTop& m_cTEncTop = *m_acTEncTopList[ layerIdInVps ]; // It is not a member, but this name helps avoiding code duplication !!! |
---|
162 | |
---|
163 | Int layerId = vps.getLayerIdInNuh( layerIdInVps ); |
---|
164 | m_cTEncTop.setLayerIdInVps ( layerIdInVps ); |
---|
165 | m_cTEncTop.setLayerId ( layerId ); |
---|
166 | m_cTEncTop.setViewId ( vps.getViewId ( layerId ) ); |
---|
167 | m_cTEncTop.setViewIndex ( vps.getViewIndex ( layerId ) ); |
---|
168 | #if H_3D |
---|
169 | Bool isDepth = ( vps.getDepthId ( layerId ) != 0 ) ; |
---|
170 | m_cTEncTop.setIsDepth ( isDepth ); |
---|
171 | //====== Camera Parameters ========= |
---|
172 | m_cTEncTop.setCameraParameters ( &m_cCameraData ); |
---|
173 | m_cTEncTop.setCamParPrecision ( m_cCameraData.getCamParsCodedPrecision () ); |
---|
174 | m_cTEncTop.setCamParInSliceHeader ( m_cCameraData.getVaryingCameraParameters() ); |
---|
175 | m_cTEncTop.setCodedScale ( m_cCameraData.getCodedScale () ); |
---|
176 | m_cTEncTop.setCodedOffset ( m_cCameraData.getCodedOffset () ); |
---|
177 | #if H_3D_VSO |
---|
178 | //====== VSO ========= |
---|
179 | m_cTEncTop.setRenderModelParameters ( &m_cRenModStrParser ); |
---|
180 | m_cTEncTop.setForceLambdaScaleVSO ( isDepth ? m_bForceLambdaScaleVSO : false ); |
---|
181 | m_cTEncTop.setLambdaScaleVSO ( isDepth ? m_dLambdaScaleVSO : 1 ); |
---|
182 | m_cTEncTop.setVSOMode ( isDepth ? m_uiVSOMode : 0 ); |
---|
183 | |
---|
184 | m_cTEncTop.setAllowNegDist ( isDepth ? m_bAllowNegDist : false ); |
---|
185 | |
---|
186 | // SAIT_VSO_EST_A0033 |
---|
187 | m_cTEncTop.setUseEstimatedVSD ( isDepth ? m_bUseEstimatedVSD : false ); |
---|
188 | |
---|
189 | // LGE_WVSO_A0119 |
---|
190 | m_cTEncTop.setUseWVSO ( isDepth ? m_bUseWVSO : false ); |
---|
191 | m_cTEncTop.setVSOWeight ( isDepth ? m_iVSOWeight : 0 ); |
---|
192 | m_cTEncTop.setVSDWeight ( isDepth ? m_iVSDWeight : 0 ); |
---|
193 | m_cTEncTop.setDWeight ( isDepth ? m_iDWeight : 0 ); |
---|
194 | #endif // H_3D_VSO |
---|
195 | #if H_3D_ARP && !QC_IV_PRED_CONSTRAINT_H0137 |
---|
196 | //====== Advanced Inter-view Residual Prediction ========= |
---|
197 | m_cTEncTop.setUseAdvRP ( ( isDepth || 0==layerIdInVps ) ? 0 : m_uiUseAdvResPred ); |
---|
198 | m_cTEncTop.setARPStepNum ( ( isDepth || 0==layerIdInVps ) ? 1 : H_3D_ARP_WFNR ); |
---|
199 | #endif |
---|
200 | #if H_3D_SPIVMP |
---|
201 | m_cTEncTop.setSubPULog2Size (( isDepth || 0==layerIdInVps ) ? 0 : m_iSubPULog2Size ); |
---|
202 | m_cTEncTop.setSubPUMPILog2Size ( !isDepth ? 0 : m_iSubPUMPILog2Size ); |
---|
203 | #endif |
---|
204 | #if H_3D_IC |
---|
205 | m_cTEncTop.setUseIC ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC ); |
---|
206 | #if MTK_LOW_LATENCY_IC_ENCODING_H0086 |
---|
207 | m_cTEncTop.setUseICLowLatencyEnc ( m_bUseLowLatencyICEnc ); |
---|
208 | #endif |
---|
209 | #endif |
---|
210 | //========== Depth intra modes ========== |
---|
211 | #if H_3D_DIM |
---|
212 | m_cTEncTop.setUseDMM ( isDepth ? m_useDMM : false ); |
---|
213 | m_cTEncTop.setUseSDC ( isDepth ? m_useSDC : false ); |
---|
214 | m_cTEncTop.setUseDLT ( isDepth ? m_useDLT : false ); |
---|
215 | #endif |
---|
216 | #if H_3D_QTLPC |
---|
217 | m_cTEncTop.setUseQTL ( isDepth ? m_bUseQTL : false ); |
---|
218 | m_cTEncTop.setUsePC ( isDepth ? m_bUsePC : false ); |
---|
219 | #endif |
---|
220 | //====== Depth Inter SDC ========= |
---|
221 | #if H_3D_INTER_SDC |
---|
222 | m_cTEncTop.setInterSDCEnable ( isDepth ? m_bDepthInterSDCFlag : false ); |
---|
223 | #endif |
---|
224 | #if H_3D_DBBP |
---|
225 | m_cTEncTop.setUseDBBP ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_bUseDBBP ); |
---|
226 | #endif |
---|
227 | #if H_3D_IV_MERGE |
---|
228 | m_cTEncTop.setUseMPI ( isDepth ? m_bMPIFlag : false ); |
---|
229 | #endif |
---|
230 | #endif // H_3D |
---|
231 | |
---|
232 | m_cTEncTop.setIvPicLists ( &m_ivPicLists ); |
---|
233 | #endif // H_MV |
---|
234 | m_cTEncTop.setVPS(&vps); |
---|
235 | |
---|
236 | #if H_3D |
---|
237 | m_cTEncTop.setDLT(&dlt); |
---|
238 | #endif |
---|
239 | |
---|
240 | m_cTEncTop.setProfile(m_profile); |
---|
241 | m_cTEncTop.setLevel(m_levelTier, m_level); |
---|
242 | m_cTEncTop.setProgressiveSourceFlag(m_progressiveSourceFlag); |
---|
243 | m_cTEncTop.setInterlacedSourceFlag(m_interlacedSourceFlag); |
---|
244 | m_cTEncTop.setNonPackedConstraintFlag(m_nonPackedConstraintFlag); |
---|
245 | m_cTEncTop.setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlag); |
---|
246 | |
---|
247 | m_cTEncTop.setFrameRate ( m_iFrameRate ); |
---|
248 | m_cTEncTop.setFrameSkip ( m_FrameSkip ); |
---|
249 | m_cTEncTop.setSourceWidth ( m_iSourceWidth ); |
---|
250 | m_cTEncTop.setSourceHeight ( m_iSourceHeight ); |
---|
251 | m_cTEncTop.setConformanceWindow ( m_confLeft, m_confRight, m_confTop, m_confBottom ); |
---|
252 | m_cTEncTop.setFramesToBeEncoded ( m_framesToBeEncoded ); |
---|
253 | |
---|
254 | //====== Coding Structure ======== |
---|
255 | #if H_MV |
---|
256 | m_cTEncTop.setIntraPeriod ( m_iIntraPeriod[ layerIdInVps ] ); |
---|
257 | #else |
---|
258 | m_cTEncTop.setIntraPeriod ( m_iIntraPeriod ); |
---|
259 | #endif |
---|
260 | m_cTEncTop.setDecodingRefreshType ( m_iDecodingRefreshType ); |
---|
261 | m_cTEncTop.setGOPSize ( m_iGOPSize ); |
---|
262 | #if H_MV |
---|
263 | m_cTEncTop.setGopList ( m_GOPListMvc[layerIdInVps] ); |
---|
264 | m_cTEncTop.setExtraRPSs ( m_extraRPSsMvc[layerIdInVps] ); |
---|
265 | for(Int i = 0; i < MAX_TLAYER; i++) |
---|
266 | { |
---|
267 | m_cTEncTop.setNumReorderPics ( m_numReorderPicsMvc[layerIdInVps][i], i ); |
---|
268 | m_cTEncTop.setMaxDecPicBuffering ( m_maxDecPicBufferingMvc[layerIdInVps][i], i ); |
---|
269 | } |
---|
270 | #else |
---|
271 | m_cTEncTop.setGopList ( m_GOPList ); |
---|
272 | m_cTEncTop.setExtraRPSs ( m_extraRPSs ); |
---|
273 | for(Int i = 0; i < MAX_TLAYER; i++) |
---|
274 | { |
---|
275 | m_cTEncTop.setNumReorderPics ( m_numReorderPics[i], i ); |
---|
276 | m_cTEncTop.setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); |
---|
277 | } |
---|
278 | #endif |
---|
279 | for( UInt uiLoop = 0; uiLoop < MAX_TLAYER; ++uiLoop ) |
---|
280 | { |
---|
281 | m_cTEncTop.setLambdaModifier( uiLoop, m_adLambdaModifier[ uiLoop ] ); |
---|
282 | } |
---|
283 | #if H_MV |
---|
284 | m_cTEncTop.setQP ( m_iQP[layerIdInVps] ); |
---|
285 | #else |
---|
286 | m_cTEncTop.setQP ( m_iQP ); |
---|
287 | #endif |
---|
288 | |
---|
289 | m_cTEncTop.setPad ( m_aiPad ); |
---|
290 | |
---|
291 | #if H_MV |
---|
292 | m_cTEncTop.setMaxTempLayer ( m_maxTempLayerMvc[layerIdInVps] ); |
---|
293 | #else |
---|
294 | m_cTEncTop.setMaxTempLayer ( m_maxTempLayer ); |
---|
295 | #endif |
---|
296 | m_cTEncTop.setUseAMP( m_enableAMP ); |
---|
297 | |
---|
298 | //===== Slice ======== |
---|
299 | |
---|
300 | //====== Loop/Deblock Filter ======== |
---|
301 | #if H_MV |
---|
302 | m_cTEncTop.setLoopFilterDisable ( m_bLoopFilterDisable[layerIdInVps]); |
---|
303 | #else |
---|
304 | m_cTEncTop.setLoopFilterDisable ( m_bLoopFilterDisable ); |
---|
305 | #endif |
---|
306 | m_cTEncTop.setLoopFilterOffsetInPPS ( m_loopFilterOffsetInPPS ); |
---|
307 | m_cTEncTop.setLoopFilterBetaOffset ( m_loopFilterBetaOffsetDiv2 ); |
---|
308 | m_cTEncTop.setLoopFilterTcOffset ( m_loopFilterTcOffsetDiv2 ); |
---|
309 | m_cTEncTop.setDeblockingFilterControlPresent( m_DeblockingFilterControlPresent); |
---|
310 | m_cTEncTop.setDeblockingFilterMetric ( m_DeblockingFilterMetric ); |
---|
311 | |
---|
312 | //====== Motion search ======== |
---|
313 | m_cTEncTop.setFastSearch ( m_iFastSearch ); |
---|
314 | m_cTEncTop.setSearchRange ( m_iSearchRange ); |
---|
315 | m_cTEncTop.setBipredSearchRange ( m_bipredSearchRange ); |
---|
316 | |
---|
317 | //====== Quality control ======== |
---|
318 | m_cTEncTop.setMaxDeltaQP ( m_iMaxDeltaQP ); |
---|
319 | m_cTEncTop.setMaxCuDQPDepth ( m_iMaxCuDQPDepth ); |
---|
320 | |
---|
321 | m_cTEncTop.setChromaCbQpOffset ( m_cbQpOffset ); |
---|
322 | m_cTEncTop.setChromaCrQpOffset ( m_crQpOffset ); |
---|
323 | |
---|
324 | #if ADAPTIVE_QP_SELECTION |
---|
325 | m_cTEncTop.setUseAdaptQpSelect ( m_bUseAdaptQpSelect ); |
---|
326 | #endif |
---|
327 | |
---|
328 | m_cTEncTop.setUseAdaptiveQP ( m_bUseAdaptiveQP ); |
---|
329 | m_cTEncTop.setQPAdaptationRange ( m_iQPAdaptationRange ); |
---|
330 | |
---|
331 | //====== Tool list ======== |
---|
332 | m_cTEncTop.setDeltaQpRD ( m_uiDeltaQpRD ); |
---|
333 | m_cTEncTop.setUseASR ( m_bUseASR ); |
---|
334 | m_cTEncTop.setUseHADME ( m_bUseHADME ); |
---|
335 | #if H_MV |
---|
336 | m_cTEncTop.setdQPs ( m_aidQP[layerIdInVps] ); |
---|
337 | #else |
---|
338 | m_cTEncTop.setdQPs ( m_aidQP ); |
---|
339 | #endif |
---|
340 | m_cTEncTop.setUseRDOQ ( m_useRDOQ ); |
---|
341 | m_cTEncTop.setUseRDOQTS ( m_useRDOQTS ); |
---|
342 | m_cTEncTop.setRDpenalty ( m_rdPenalty ); |
---|
343 | m_cTEncTop.setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); |
---|
344 | m_cTEncTop.setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize ); |
---|
345 | m_cTEncTop.setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); |
---|
346 | m_cTEncTop.setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); |
---|
347 | m_cTEncTop.setUseFastEnc ( m_bUseFastEnc ); |
---|
348 | m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU ); |
---|
349 | m_cTEncTop.setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); |
---|
350 | m_cTEncTop.setUseCbfFastMode ( m_bUseCbfFastMode ); |
---|
351 | m_cTEncTop.setUseEarlySkipDetection ( m_useEarlySkipDetection ); |
---|
352 | |
---|
353 | m_cTEncTop.setUseTransformSkip ( m_useTransformSkip ); |
---|
354 | m_cTEncTop.setUseTransformSkipFast ( m_useTransformSkipFast ); |
---|
355 | m_cTEncTop.setUseConstrainedIntraPred ( m_bUseConstrainedIntraPred ); |
---|
356 | m_cTEncTop.setPCMLog2MinSize ( m_uiPCMLog2MinSize); |
---|
357 | m_cTEncTop.setUsePCM ( m_usePCM ); |
---|
358 | m_cTEncTop.setPCMLog2MaxSize ( m_pcmLog2MaxSize); |
---|
359 | m_cTEncTop.setMaxNumMergeCand ( m_maxNumMergeCand ); |
---|
360 | |
---|
361 | |
---|
362 | //====== Weighted Prediction ======== |
---|
363 | m_cTEncTop.setUseWP ( m_useWeightedPred ); |
---|
364 | m_cTEncTop.setWPBiPred ( m_useWeightedBiPred ); |
---|
365 | //====== Parallel Merge Estimation ======== |
---|
366 | m_cTEncTop.setLog2ParallelMergeLevelMinus2 ( m_log2ParallelMergeLevel - 2 ); |
---|
367 | |
---|
368 | //====== Slice ======== |
---|
369 | m_cTEncTop.setSliceMode ( m_sliceMode ); |
---|
370 | m_cTEncTop.setSliceArgument ( m_sliceArgument ); |
---|
371 | |
---|
372 | //====== Dependent Slice ======== |
---|
373 | m_cTEncTop.setSliceSegmentMode ( m_sliceSegmentMode ); |
---|
374 | m_cTEncTop.setSliceSegmentArgument ( m_sliceSegmentArgument ); |
---|
375 | Int iNumPartInCU = 1<<(m_uiMaxCUDepth<<1); |
---|
376 | if(m_sliceSegmentMode==FIXED_NUMBER_OF_LCU) |
---|
377 | { |
---|
378 | m_cTEncTop.setSliceSegmentArgument ( m_sliceSegmentArgument * iNumPartInCU ); |
---|
379 | } |
---|
380 | if(m_sliceMode==FIXED_NUMBER_OF_LCU) |
---|
381 | { |
---|
382 | m_cTEncTop.setSliceArgument ( m_sliceArgument * iNumPartInCU ); |
---|
383 | } |
---|
384 | if(m_sliceMode==FIXED_NUMBER_OF_TILES) |
---|
385 | { |
---|
386 | m_cTEncTop.setSliceArgument ( m_sliceArgument ); |
---|
387 | } |
---|
388 | |
---|
389 | if(m_sliceMode == 0 ) |
---|
390 | { |
---|
391 | m_bLFCrossSliceBoundaryFlag = true; |
---|
392 | } |
---|
393 | m_cTEncTop.setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag ); |
---|
394 | #if H_MV |
---|
395 | m_cTEncTop.setUseSAO ( m_bUseSAO[layerIdInVps] ); |
---|
396 | #else |
---|
397 | m_cTEncTop.setUseSAO ( m_bUseSAO ); |
---|
398 | #endif |
---|
399 | m_cTEncTop.setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic); |
---|
400 | |
---|
401 | m_cTEncTop.setSaoLcuBoundary (m_saoLcuBoundary); |
---|
402 | m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); |
---|
403 | m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); |
---|
404 | |
---|
405 | m_cTEncTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); |
---|
406 | m_cTEncTop.setRecoveryPointSEIEnabled( m_recoveryPointSEIEnabled ); |
---|
407 | m_cTEncTop.setBufferingPeriodSEIEnabled( m_bufferingPeriodSEIEnabled ); |
---|
408 | m_cTEncTop.setPictureTimingSEIEnabled( m_pictureTimingSEIEnabled ); |
---|
409 | m_cTEncTop.setToneMappingInfoSEIEnabled ( m_toneMappingInfoSEIEnabled ); |
---|
410 | m_cTEncTop.setTMISEIToneMapId ( m_toneMapId ); |
---|
411 | m_cTEncTop.setTMISEIToneMapCancelFlag ( m_toneMapCancelFlag ); |
---|
412 | m_cTEncTop.setTMISEIToneMapPersistenceFlag ( m_toneMapPersistenceFlag ); |
---|
413 | m_cTEncTop.setTMISEICodedDataBitDepth ( m_toneMapCodedDataBitDepth ); |
---|
414 | m_cTEncTop.setTMISEITargetBitDepth ( m_toneMapTargetBitDepth ); |
---|
415 | m_cTEncTop.setTMISEIModelID ( m_toneMapModelId ); |
---|
416 | m_cTEncTop.setTMISEIMinValue ( m_toneMapMinValue ); |
---|
417 | m_cTEncTop.setTMISEIMaxValue ( m_toneMapMaxValue ); |
---|
418 | m_cTEncTop.setTMISEISigmoidMidpoint ( m_sigmoidMidpoint ); |
---|
419 | m_cTEncTop.setTMISEISigmoidWidth ( m_sigmoidWidth ); |
---|
420 | m_cTEncTop.setTMISEIStartOfCodedInterva ( m_startOfCodedInterval ); |
---|
421 | m_cTEncTop.setTMISEINumPivots ( m_numPivots ); |
---|
422 | m_cTEncTop.setTMISEICodedPivotValue ( m_codedPivotValue ); |
---|
423 | m_cTEncTop.setTMISEITargetPivotValue ( m_targetPivotValue ); |
---|
424 | m_cTEncTop.setTMISEICameraIsoSpeedIdc ( m_cameraIsoSpeedIdc ); |
---|
425 | m_cTEncTop.setTMISEICameraIsoSpeedValue ( m_cameraIsoSpeedValue ); |
---|
426 | m_cTEncTop.setTMISEIExposureIndexIdc ( m_exposureIndexIdc ); |
---|
427 | m_cTEncTop.setTMISEIExposureIndexValue ( m_exposureIndexValue ); |
---|
428 | m_cTEncTop.setTMISEIExposureCompensationValueSignFlag ( m_exposureCompensationValueSignFlag ); |
---|
429 | m_cTEncTop.setTMISEIExposureCompensationValueNumerator ( m_exposureCompensationValueNumerator ); |
---|
430 | m_cTEncTop.setTMISEIExposureCompensationValueDenomIdc ( m_exposureCompensationValueDenomIdc ); |
---|
431 | m_cTEncTop.setTMISEIRefScreenLuminanceWhite ( m_refScreenLuminanceWhite ); |
---|
432 | m_cTEncTop.setTMISEIExtendedRangeWhiteLevel ( m_extendedRangeWhiteLevel ); |
---|
433 | m_cTEncTop.setTMISEINominalBlackLevelLumaCodeValue ( m_nominalBlackLevelLumaCodeValue ); |
---|
434 | m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); |
---|
435 | m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); |
---|
436 | m_cTEncTop.setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled ); |
---|
437 | m_cTEncTop.setFramePackingArrangementSEIType( m_framePackingSEIType ); |
---|
438 | m_cTEncTop.setFramePackingArrangementSEIId( m_framePackingSEIId ); |
---|
439 | m_cTEncTop.setFramePackingArrangementSEIQuincunx( m_framePackingSEIQuincunx ); |
---|
440 | m_cTEncTop.setFramePackingArrangementSEIInterpretation( m_framePackingSEIInterpretation ); |
---|
441 | m_cTEncTop.setDisplayOrientationSEIAngle( m_displayOrientationSEIAngle ); |
---|
442 | m_cTEncTop.setTemporalLevel0IndexSEIEnabled( m_temporalLevel0IndexSEIEnabled ); |
---|
443 | m_cTEncTop.setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled ); |
---|
444 | m_cTEncTop.setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled ); |
---|
445 | m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); |
---|
446 | m_cTEncTop.setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled ); |
---|
447 | #if H_MV |
---|
448 | m_cTEncTop.setSubBitstreamPropSEIEnabled( m_subBistreamPropSEIEnabled ); |
---|
449 | if( m_subBistreamPropSEIEnabled ) |
---|
450 | { |
---|
451 | m_cTEncTop.setNumAdditionalSubStreams ( m_sbPropNumAdditionalSubStreams ); |
---|
452 | m_cTEncTop.setSubBitstreamMode ( m_sbPropSubBitstreamMode ); |
---|
453 | m_cTEncTop.setOutputLayerSetIdxToVps ( m_sbPropOutputLayerSetIdxToVps ); |
---|
454 | m_cTEncTop.setHighestSublayerId ( m_sbPropHighestSublayerId ); |
---|
455 | m_cTEncTop.setAvgBitRate ( m_sbPropAvgBitRate ); |
---|
456 | m_cTEncTop.setMaxBitRate ( m_sbPropMaxBitRate ); |
---|
457 | } |
---|
458 | #endif |
---|
459 | m_cTEncTop.setUniformSpacingIdr ( m_iUniformSpacingIdr ); |
---|
460 | m_cTEncTop.setNumColumnsMinus1 ( m_iNumColumnsMinus1 ); |
---|
461 | m_cTEncTop.setNumRowsMinus1 ( m_iNumRowsMinus1 ); |
---|
462 | if(m_iUniformSpacingIdr==0) |
---|
463 | { |
---|
464 | m_cTEncTop.setColumnWidth ( m_pColumnWidth ); |
---|
465 | m_cTEncTop.setRowHeight ( m_pRowHeight ); |
---|
466 | } |
---|
467 | m_cTEncTop.xCheckGSParameters(); |
---|
468 | Int uiTilesCount = (m_iNumRowsMinus1+1) * (m_iNumColumnsMinus1+1); |
---|
469 | if(uiTilesCount == 1) |
---|
470 | { |
---|
471 | m_bLFCrossTileBoundaryFlag = true; |
---|
472 | } |
---|
473 | m_cTEncTop.setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); |
---|
474 | m_cTEncTop.setWaveFrontSynchro ( m_iWaveFrontSynchro ); |
---|
475 | m_cTEncTop.setWaveFrontSubstreams ( m_iWaveFrontSubstreams ); |
---|
476 | m_cTEncTop.setTMVPModeId ( m_TMVPModeId ); |
---|
477 | m_cTEncTop.setUseScalingListId ( m_useScalingListId ); |
---|
478 | m_cTEncTop.setScalingListFile ( m_scalingListFile ); |
---|
479 | m_cTEncTop.setSignHideFlag(m_signHideFlag); |
---|
480 | #if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227 |
---|
481 | if(!m_cTEncTop.getIsDepth()) //only for texture |
---|
482 | { |
---|
483 | m_cTEncTop.setUseRateCtrl ( m_RCEnableRateControl ); |
---|
484 | } |
---|
485 | else |
---|
486 | { |
---|
487 | m_cTEncTop.setUseRateCtrl ( 0 ); |
---|
488 | } |
---|
489 | #else |
---|
490 | m_cTEncTop.setUseRateCtrl ( m_RCEnableRateControl ); |
---|
491 | #endif |
---|
492 | #if !KWU_RC_VIEWRC_E0227 |
---|
493 | m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); |
---|
494 | #endif |
---|
495 | m_cTEncTop.setKeepHierBit ( m_RCKeepHierarchicalBit ); |
---|
496 | m_cTEncTop.setLCULevelRC ( m_RCLCULevelRC ); |
---|
497 | m_cTEncTop.setUseLCUSeparateModel ( m_RCUseLCUSeparateModel ); |
---|
498 | m_cTEncTop.setInitialQP ( m_RCInitialQP ); |
---|
499 | m_cTEncTop.setForceIntraQP ( m_RCForceIntraQP ); |
---|
500 | #if KWU_RC_MADPRED_E0227 |
---|
501 | if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) |
---|
502 | { |
---|
503 | m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_depthMADPred : 0); |
---|
504 | if(m_cTEncTop.getUseDepthMADPred()) |
---|
505 | { |
---|
506 | m_cTEncTop.setCamParam(&m_cCameraData); |
---|
507 | } |
---|
508 | } |
---|
509 | #endif |
---|
510 | #if KWU_RC_VIEWRC_E0227 |
---|
511 | if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) |
---|
512 | { |
---|
513 | m_cTEncTop.setUseViewWiseRateCtrl(m_viewWiseRateCtrl); |
---|
514 | if(m_iNumberOfViews == 1) |
---|
515 | { |
---|
516 | if(m_viewWiseRateCtrl) |
---|
517 | { |
---|
518 | m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]); |
---|
519 | } |
---|
520 | else |
---|
521 | { |
---|
522 | m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); |
---|
523 | } |
---|
524 | } |
---|
525 | else |
---|
526 | { |
---|
527 | if(m_viewWiseRateCtrl) |
---|
528 | { |
---|
529 | m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]); |
---|
530 | } |
---|
531 | else |
---|
532 | { |
---|
533 | if(m_iNumberOfViews == 2) |
---|
534 | { |
---|
535 | if(m_cTEncTop.getViewId() == 0) |
---|
536 | { |
---|
537 | m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*80)/100 ); |
---|
538 | } |
---|
539 | else if(m_cTEncTop.getViewId() == 1) |
---|
540 | { |
---|
541 | m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*20)/100 ); |
---|
542 | } |
---|
543 | } |
---|
544 | else if(m_iNumberOfViews == 3) |
---|
545 | { |
---|
546 | if(m_cTEncTop.getViewId() == 0) |
---|
547 | { |
---|
548 | m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*66)/100 ); |
---|
549 | } |
---|
550 | else if(m_cTEncTop.getViewId() == 1) |
---|
551 | { |
---|
552 | m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*17)/100 ); |
---|
553 | } |
---|
554 | else if(m_cTEncTop.getViewId() == 2) |
---|
555 | { |
---|
556 | m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*17)/100 ); |
---|
557 | } |
---|
558 | } |
---|
559 | else |
---|
560 | { |
---|
561 | m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); |
---|
562 | } |
---|
563 | } |
---|
564 | } |
---|
565 | } |
---|
566 | #endif |
---|
567 | m_cTEncTop.setTransquantBypassEnableFlag(m_TransquantBypassEnableFlag); |
---|
568 | m_cTEncTop.setCUTransquantBypassFlagForceValue(m_CUTransquantBypassFlagForce); |
---|
569 | m_cTEncTop.setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda ); |
---|
570 | m_cTEncTop.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); |
---|
571 | m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); |
---|
572 | m_cTEncTop.setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); |
---|
573 | m_cTEncTop.setAspectRatioIdc( m_aspectRatioIdc ); |
---|
574 | m_cTEncTop.setSarWidth( m_sarWidth ); |
---|
575 | m_cTEncTop.setSarHeight( m_sarHeight ); |
---|
576 | m_cTEncTop.setOverscanInfoPresentFlag( m_overscanInfoPresentFlag ); |
---|
577 | m_cTEncTop.setOverscanAppropriateFlag( m_overscanAppropriateFlag ); |
---|
578 | m_cTEncTop.setVideoSignalTypePresentFlag( m_videoSignalTypePresentFlag ); |
---|
579 | m_cTEncTop.setVideoFormat( m_videoFormat ); |
---|
580 | m_cTEncTop.setVideoFullRangeFlag( m_videoFullRangeFlag ); |
---|
581 | m_cTEncTop.setColourDescriptionPresentFlag( m_colourDescriptionPresentFlag ); |
---|
582 | m_cTEncTop.setColourPrimaries( m_colourPrimaries ); |
---|
583 | m_cTEncTop.setTransferCharacteristics( m_transferCharacteristics ); |
---|
584 | m_cTEncTop.setMatrixCoefficients( m_matrixCoefficients ); |
---|
585 | m_cTEncTop.setChromaLocInfoPresentFlag( m_chromaLocInfoPresentFlag ); |
---|
586 | m_cTEncTop.setChromaSampleLocTypeTopField( m_chromaSampleLocTypeTopField ); |
---|
587 | m_cTEncTop.setChromaSampleLocTypeBottomField( m_chromaSampleLocTypeBottomField ); |
---|
588 | m_cTEncTop.setNeutralChromaIndicationFlag( m_neutralChromaIndicationFlag ); |
---|
589 | m_cTEncTop.setDefaultDisplayWindow( m_defDispWinLeftOffset, m_defDispWinRightOffset, m_defDispWinTopOffset, m_defDispWinBottomOffset ); |
---|
590 | m_cTEncTop.setFrameFieldInfoPresentFlag( m_frameFieldInfoPresentFlag ); |
---|
591 | m_cTEncTop.setPocProportionalToTimingFlag( m_pocProportionalToTimingFlag ); |
---|
592 | m_cTEncTop.setNumTicksPocDiffOneMinus1 ( m_numTicksPocDiffOneMinus1 ); |
---|
593 | m_cTEncTop.setBitstreamRestrictionFlag( m_bitstreamRestrictionFlag ); |
---|
594 | m_cTEncTop.setTilesFixedStructureFlag( m_tilesFixedStructureFlag ); |
---|
595 | m_cTEncTop.setMotionVectorsOverPicBoundariesFlag( m_motionVectorsOverPicBoundariesFlag ); |
---|
596 | m_cTEncTop.setMinSpatialSegmentationIdc( m_minSpatialSegmentationIdc ); |
---|
597 | m_cTEncTop.setMaxBytesPerPicDenom( m_maxBytesPerPicDenom ); |
---|
598 | m_cTEncTop.setMaxBitsPerMinCuDenom( m_maxBitsPerMinCuDenom ); |
---|
599 | m_cTEncTop.setLog2MaxMvLengthHorizontal( m_log2MaxMvLengthHorizontal ); |
---|
600 | m_cTEncTop.setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); |
---|
601 | #if H_MV |
---|
602 | } |
---|
603 | #endif |
---|
604 | #if H_3D_VSO |
---|
605 | if ( m_bUseVSO ) |
---|
606 | { |
---|
607 | if ( m_uiVSOMode == 4 ) |
---|
608 | { |
---|
609 | #if H_3D_VSO_EARLY_SKIP |
---|
610 | m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, m_bVSOEarlySkip ); |
---|
611 | #else |
---|
612 | m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 ); |
---|
613 | #endif |
---|
614 | for ( Int layer = 0; layer < m_numberOfLayers ; layer++ ) |
---|
615 | { |
---|
616 | TEncTop* pcEncTop = m_acTEncTopList[ layer ]; |
---|
617 | Int iViewNum = pcEncTop->getViewIndex(); |
---|
618 | Int iContent = pcEncTop->getIsDepth() ? 1 : 0; |
---|
619 | Int iNumOfModels = m_cRenModStrParser.getNumOfModelsForView(iViewNum, iContent); |
---|
620 | |
---|
621 | Bool bUseVSO = (iNumOfModels != 0); |
---|
622 | |
---|
623 | pcEncTop->setUseVSO( bUseVSO ); |
---|
624 | pcEncTop->getRdCost()->setRenModel( bUseVSO ? &m_cRendererModel : NULL ); |
---|
625 | |
---|
626 | for (Int iCurModel = 0; iCurModel < iNumOfModels; iCurModel++ ) |
---|
627 | { |
---|
628 | Int iModelNum; Int iLeftViewNum; Int iRightViewNum; Int iDump; Int iOrgRefNum; Int iBlendMode; |
---|
629 | |
---|
630 | m_cRenModStrParser.getSingleModelData ( iViewNum, iContent, iCurModel, iModelNum, iBlendMode, iLeftViewNum, iRightViewNum, iOrgRefNum, iDump ) ; |
---|
631 | m_cRendererModel .createSingleModel ( iViewNum, iContent, iModelNum, iLeftViewNum, iRightViewNum, (iOrgRefNum != -1), iBlendMode ); |
---|
632 | } |
---|
633 | } |
---|
634 | } |
---|
635 | else |
---|
636 | { |
---|
637 | AOT(true); |
---|
638 | } |
---|
639 | } |
---|
640 | #endif |
---|
641 | } |
---|
642 | |
---|
643 | Void TAppEncTop::xCreateLib() |
---|
644 | { |
---|
645 | #if H_MV |
---|
646 | // initialize global variables |
---|
647 | initROM(); |
---|
648 | #if H_3D_DIM_DMM |
---|
649 | initWedgeLists( true ); |
---|
650 | #endif |
---|
651 | |
---|
652 | for( Int layer=0; layer < m_numberOfLayers; layer++) |
---|
653 | { |
---|
654 | m_acTVideoIOYuvInputFileList[layer]->open( m_pchInputFileList[layer], false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode |
---|
655 | m_acTVideoIOYuvInputFileList[layer]->skipFrames( m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]); |
---|
656 | |
---|
657 | if (m_pchReconFileList[layer]) |
---|
658 | { |
---|
659 | m_acTVideoIOYuvReconFileList[layer]->open( m_pchReconFileList[layer], true, m_outputBitDepthY, m_outputBitDepthC, m_internalBitDepthY, m_internalBitDepthC); // write mode |
---|
660 | } |
---|
661 | m_acTEncTopList[layer]->create(); |
---|
662 | } |
---|
663 | #else |
---|
664 | // Video I/O |
---|
665 | m_cTVideoIOYuvInputFile.open( m_pchInputFile, false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode |
---|
666 | m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]); |
---|
667 | |
---|
668 | if (m_pchReconFile) |
---|
669 | m_cTVideoIOYuvReconFile.open(m_pchReconFile, true, m_outputBitDepthY, m_outputBitDepthC, m_internalBitDepthY, m_internalBitDepthC); // write mode |
---|
670 | |
---|
671 | // Neo Decoder |
---|
672 | m_cTEncTop.create(); |
---|
673 | #endif |
---|
674 | } |
---|
675 | |
---|
676 | Void TAppEncTop::xDestroyLib() |
---|
677 | { |
---|
678 | #if H_MV |
---|
679 | // destroy ROM |
---|
680 | destroyROM(); |
---|
681 | |
---|
682 | for(Int layer=0; layer<m_numberOfLayers; layer++) |
---|
683 | { |
---|
684 | m_acTVideoIOYuvInputFileList[layer]->close(); |
---|
685 | m_acTVideoIOYuvReconFileList[layer]->close(); |
---|
686 | delete m_acTVideoIOYuvInputFileList[layer] ; |
---|
687 | m_acTVideoIOYuvInputFileList[layer] = NULL; |
---|
688 | delete m_acTVideoIOYuvReconFileList[layer] ; |
---|
689 | m_acTVideoIOYuvReconFileList[layer] = NULL; |
---|
690 | m_acTEncTopList[layer]->deletePicBuffer(); |
---|
691 | m_acTEncTopList[layer]->destroy(); |
---|
692 | delete m_acTEncTopList[layer] ; |
---|
693 | m_acTEncTopList[layer] = NULL; |
---|
694 | delete m_picYuvRec[layer] ; |
---|
695 | m_picYuvRec[layer] = NULL; |
---|
696 | } |
---|
697 | #else |
---|
698 | // Video I/O |
---|
699 | m_cTVideoIOYuvInputFile.close(); |
---|
700 | m_cTVideoIOYuvReconFile.close(); |
---|
701 | |
---|
702 | // Neo Decoder |
---|
703 | m_cTEncTop.destroy(); |
---|
704 | #endif |
---|
705 | } |
---|
706 | |
---|
707 | Void TAppEncTop::xInitLib(Bool isFieldCoding) |
---|
708 | { |
---|
709 | #if H_3D |
---|
710 | #if H_MV_HLS_8 |
---|
711 | for ( Int viewIndex = 0; viewIndex < m_vps->getNumViews(); viewIndex++ ) |
---|
712 | { |
---|
713 | m_vps->initCamParaVPS( viewIndex, true, m_cCameraData.getCamParsCodedPrecision(), |
---|
714 | m_cCameraData.getVaryingCameraParameters(), m_cCameraData.getCodedScale(), m_cCameraData.getCodedOffset() ); |
---|
715 | #else |
---|
716 | for ( Int viewIndex = 0; viewIndex < m_vps.getNumViews(); viewIndex++ ) |
---|
717 | { |
---|
718 | m_vps.initCamParaVPS( viewIndex, true, m_cCameraData.getCamParsCodedPrecision(), |
---|
719 | m_cCameraData.getVaryingCameraParameters(), m_cCameraData.getCodedScale(), m_cCameraData.getCodedOffset() ); |
---|
720 | #endif |
---|
721 | } |
---|
722 | #endif |
---|
723 | |
---|
724 | #if H_MV |
---|
725 | for(Int layer=0; layer<m_numberOfLayers; layer++) |
---|
726 | { |
---|
727 | #if KWU_RC_MADPRED_E0227 |
---|
728 | m_acTEncTopList[layer]->init( isFieldCoding, this ); |
---|
729 | #else |
---|
730 | m_acTEncTopList[layer]->init( isFieldCoding ); |
---|
731 | #endif |
---|
732 | } |
---|
733 | #else |
---|
734 | m_cTEncTop.init( isFieldCoding ); |
---|
735 | #endif |
---|
736 | } |
---|
737 | |
---|
738 | // ==================================================================================================================== |
---|
739 | // Public member functions |
---|
740 | // ==================================================================================================================== |
---|
741 | |
---|
742 | /** |
---|
743 | - create internal class |
---|
744 | - initialize internal variable |
---|
745 | - until the end of input YUV file, call encoding function in TEncTop class |
---|
746 | - delete allocated buffers |
---|
747 | - destroy internal class |
---|
748 | . |
---|
749 | */ |
---|
750 | Void TAppEncTop::encode() |
---|
751 | { |
---|
752 | fstream bitstreamFile(m_pchBitstreamFile, fstream::binary | fstream::out); |
---|
753 | if (!bitstreamFile) |
---|
754 | { |
---|
755 | fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_pchBitstreamFile); |
---|
756 | exit(EXIT_FAILURE); |
---|
757 | } |
---|
758 | |
---|
759 | TComPicYuv* pcPicYuvOrg = new TComPicYuv; |
---|
760 | TComPicYuv* pcPicYuvRec = NULL; |
---|
761 | |
---|
762 | // initialize internal class & member variables |
---|
763 | xInitLibCfg(); |
---|
764 | xCreateLib(); |
---|
765 | xInitLib(m_isField); |
---|
766 | |
---|
767 | // main encoder loop |
---|
768 | #if H_MV |
---|
769 | Bool allEos = false; |
---|
770 | std::vector<Bool> eos ; |
---|
771 | std::vector<Bool> flush ; |
---|
772 | |
---|
773 | Int gopSize = 1; |
---|
774 | Int maxGopSize = 0; |
---|
775 | maxGopSize = (std::max)(maxGopSize, m_acTEncTopList[0]->getGOPSize()); |
---|
776 | |
---|
777 | for(Int layer=0; layer < m_numberOfLayers; layer++ ) |
---|
778 | { |
---|
779 | eos .push_back( false ); |
---|
780 | flush.push_back( false ); |
---|
781 | } |
---|
782 | #else |
---|
783 | Int iNumEncoded = 0; |
---|
784 | Bool bEos = false; |
---|
785 | #endif |
---|
786 | |
---|
787 | list<AccessUnit> outputAccessUnits; ///< list of access units to write out. is populated by the encoding process |
---|
788 | |
---|
789 | // allocate original YUV buffer |
---|
790 | if( m_isField ) |
---|
791 | { |
---|
792 | pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeightOrg, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); |
---|
793 | } |
---|
794 | else |
---|
795 | { |
---|
796 | pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); |
---|
797 | } |
---|
798 | |
---|
799 | #if H_MV |
---|
800 | while ( !allEos ) |
---|
801 | { |
---|
802 | for(Int layer=0; layer < m_numberOfLayers; layer++ ) |
---|
803 | { |
---|
804 | Int frmCnt = 0; |
---|
805 | while ( !eos[layer] && !(frmCnt == gopSize)) |
---|
806 | { |
---|
807 | // get buffers |
---|
808 | xGetBuffer(pcPicYuvRec, layer); |
---|
809 | |
---|
810 | // read input YUV file |
---|
811 | m_acTVideoIOYuvInputFileList[layer]->read ( pcPicYuvOrg, m_aiPad ); |
---|
812 | m_acTEncTopList [layer]->initNewPic( pcPicYuvOrg ); |
---|
813 | |
---|
814 | // increase number of received frames |
---|
815 | m_frameRcvd[layer]++; |
---|
816 | |
---|
817 | frmCnt++; |
---|
818 | |
---|
819 | eos[layer] = (m_frameRcvd[layer] == m_framesToBeEncoded); |
---|
820 | allEos = allEos||eos[layer]; |
---|
821 | |
---|
822 | // if end of file (which is only detected on a read failure) flush the encoder of any queued pictures |
---|
823 | if (m_acTVideoIOYuvInputFileList[layer]->isEof()) |
---|
824 | { |
---|
825 | flush [layer] = true; |
---|
826 | eos [layer] = true; |
---|
827 | m_frameRcvd [layer]--; |
---|
828 | m_acTEncTopList[layer]->setFramesToBeEncoded(m_frameRcvd[layer]); |
---|
829 | } |
---|
830 | } |
---|
831 | } |
---|
832 | for ( Int gopId=0; gopId < gopSize; gopId++ ) |
---|
833 | { |
---|
834 | #if H_3D |
---|
835 | UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId ); |
---|
836 | if ( iNextPoc < m_framesToBeEncoded ) |
---|
837 | { |
---|
838 | m_cCameraData.update( iNextPoc ); |
---|
839 | } |
---|
840 | #endif |
---|
841 | for(Int layer=0; layer < m_numberOfLayers; layer++ ) |
---|
842 | { |
---|
843 | #if H_3D_VSO |
---|
844 | if( m_bUseVSO && m_bUseEstimatedVSD && iNextPoc < m_framesToBeEncoded ) |
---|
845 | { |
---|
846 | m_cCameraData.setDispCoeff( iNextPoc, m_acTEncTopList[layer]->getViewIndex() ); |
---|
847 | m_acTEncTopList[layer] ->setDispCoeff( m_cCameraData.getDispCoeff() ); |
---|
848 | } |
---|
849 | #endif |
---|
850 | |
---|
851 | #if H_3D_DDD |
---|
852 | m_acTEncTopList[ layer ]->getSliceEncoder()->setDDDPar( m_cCameraData.getCodedScale()[0][ m_acTEncTopList[layer]->getViewIndex() ], |
---|
853 | m_cCameraData.getCodedOffset()[0][ m_acTEncTopList[layer]->getViewIndex() ], |
---|
854 | m_cCameraData.getCamParsCodedPrecision() ); |
---|
855 | #endif |
---|
856 | Int iNumEncoded = 0; |
---|
857 | |
---|
858 | // call encoding function for one frame |
---|
859 | m_acTEncTopList[layer]->encode( eos[layer], flush[layer] ? 0 : pcPicYuvOrg, *m_picYuvRec[layer], outputAccessUnits, iNumEncoded, gopId ); |
---|
860 | xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits, layer); |
---|
861 | outputAccessUnits.clear(); |
---|
862 | } |
---|
863 | } |
---|
864 | |
---|
865 | gopSize = maxGopSize; |
---|
866 | } |
---|
867 | for(Int layer=0; layer < m_numberOfLayers; layer++ ) |
---|
868 | { |
---|
869 | m_acTEncTopList[layer]->printSummary( m_acTEncTopList[layer]->getNumAllPicCoded(), m_isField ); |
---|
870 | } |
---|
871 | #else |
---|
872 | while ( !bEos ) |
---|
873 | { |
---|
874 | // get buffers |
---|
875 | xGetBuffer(pcPicYuvRec); |
---|
876 | |
---|
877 | // read input YUV file |
---|
878 | m_cTVideoIOYuvInputFile.read( pcPicYuvOrg, m_aiPad ); |
---|
879 | |
---|
880 | // increase number of received frames |
---|
881 | m_iFrameRcvd++; |
---|
882 | |
---|
883 | bEos = (m_isField && (m_iFrameRcvd == (m_framesToBeEncoded >> 1) )) || ( !m_isField && (m_iFrameRcvd == m_framesToBeEncoded) ); |
---|
884 | |
---|
885 | Bool flush = 0; |
---|
886 | // if end of file (which is only detected on a read failure) flush the encoder of any queued pictures |
---|
887 | if (m_cTVideoIOYuvInputFile.isEof()) |
---|
888 | { |
---|
889 | flush = true; |
---|
890 | bEos = true; |
---|
891 | m_iFrameRcvd--; |
---|
892 | m_cTEncTop.setFramesToBeEncoded(m_iFrameRcvd); |
---|
893 | } |
---|
894 | |
---|
895 | // call encoding function for one frame |
---|
896 | if ( m_isField ) |
---|
897 | { |
---|
898 | m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded, m_isTopFieldFirst); |
---|
899 | } |
---|
900 | else |
---|
901 | { |
---|
902 | m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded ); |
---|
903 | } |
---|
904 | |
---|
905 | // write bistream to file if necessary |
---|
906 | if ( iNumEncoded > 0 ) |
---|
907 | { |
---|
908 | xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits); |
---|
909 | outputAccessUnits.clear(); |
---|
910 | } |
---|
911 | } |
---|
912 | |
---|
913 | m_cTEncTop.printSummary(m_isField); |
---|
914 | #endif |
---|
915 | |
---|
916 | // delete original YUV buffer |
---|
917 | pcPicYuvOrg->destroy(); |
---|
918 | delete pcPicYuvOrg; |
---|
919 | pcPicYuvOrg = NULL; |
---|
920 | |
---|
921 | #if !H_MV |
---|
922 | // delete used buffers in encoder class |
---|
923 | m_cTEncTop.deletePicBuffer(); |
---|
924 | #endif |
---|
925 | |
---|
926 | // delete buffers & classes |
---|
927 | xDeleteBuffer(); |
---|
928 | xDestroyLib(); |
---|
929 | |
---|
930 | printRateSummary(); |
---|
931 | |
---|
932 | #if H_3D_REN_MAX_DEV_OUT |
---|
933 | Double dMaxDispDiff = m_cCameraData.getMaxShiftDeviation(); |
---|
934 | |
---|
935 | if ( !(dMaxDispDiff < 0) ) |
---|
936 | { |
---|
937 | printf("\n Max. possible shift error: %12.3f samples.\n", dMaxDispDiff ); |
---|
938 | } |
---|
939 | #endif |
---|
940 | |
---|
941 | return; |
---|
942 | } |
---|
943 | |
---|
944 | // ==================================================================================================================== |
---|
945 | // Protected member functions |
---|
946 | // ==================================================================================================================== |
---|
947 | |
---|
948 | /** |
---|
949 | - application has picture buffer list with size of GOP |
---|
950 | - picture buffer list acts as ring buffer |
---|
951 | - end of the list has the latest picture |
---|
952 | . |
---|
953 | */ |
---|
954 | #if H_MV |
---|
955 | Void TAppEncTop::xGetBuffer( TComPicYuv*& rpcPicYuvRec, UInt layer) |
---|
956 | #else |
---|
957 | Void TAppEncTop::xGetBuffer( TComPicYuv*& rpcPicYuvRec) |
---|
958 | #endif |
---|
959 | { |
---|
960 | assert( m_iGOPSize > 0 ); |
---|
961 | |
---|
962 | // org. buffer |
---|
963 | #if H_MV |
---|
964 | if ( m_picYuvRec[layer]->size() == (UInt)m_iGOPSize ) |
---|
965 | { |
---|
966 | rpcPicYuvRec = m_picYuvRec[layer]->popFront(); |
---|
967 | #else |
---|
968 | if ( m_cListPicYuvRec.size() == (UInt)m_iGOPSize ) |
---|
969 | { |
---|
970 | rpcPicYuvRec = m_cListPicYuvRec.popFront(); |
---|
971 | #endif |
---|
972 | |
---|
973 | } |
---|
974 | else |
---|
975 | { |
---|
976 | rpcPicYuvRec = new TComPicYuv; |
---|
977 | |
---|
978 | rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); |
---|
979 | |
---|
980 | } |
---|
981 | #if H_MV |
---|
982 | m_picYuvRec[layer]->pushBack( rpcPicYuvRec ); |
---|
983 | #else |
---|
984 | m_cListPicYuvRec.pushBack( rpcPicYuvRec ); |
---|
985 | #endif |
---|
986 | } |
---|
987 | |
---|
988 | Void TAppEncTop::xDeleteBuffer( ) |
---|
989 | { |
---|
990 | #if H_MV |
---|
991 | for(Int layer=0; layer<m_picYuvRec.size(); layer++) |
---|
992 | { |
---|
993 | if(m_picYuvRec[layer]) |
---|
994 | { |
---|
995 | TComList<TComPicYuv*>::iterator iterPicYuvRec = m_picYuvRec[layer]->begin(); |
---|
996 | Int iSize = Int( m_picYuvRec[layer]->size() ); |
---|
997 | #else |
---|
998 | TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.begin(); |
---|
999 | |
---|
1000 | Int iSize = Int( m_cListPicYuvRec.size() ); |
---|
1001 | #endif |
---|
1002 | |
---|
1003 | for ( Int i = 0; i < iSize; i++ ) |
---|
1004 | { |
---|
1005 | TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); |
---|
1006 | pcPicYuvRec->destroy(); |
---|
1007 | delete pcPicYuvRec; pcPicYuvRec = NULL; |
---|
1008 | } |
---|
1009 | |
---|
1010 | #if H_MV |
---|
1011 | } |
---|
1012 | } |
---|
1013 | #endif |
---|
1014 | } |
---|
1015 | |
---|
1016 | /** \param iNumEncoded number of encoded frames |
---|
1017 | */ |
---|
1018 | #if H_MV |
---|
1019 | Void TAppEncTop::xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, std::list<AccessUnit>& accessUnits, UInt layerId) |
---|
1020 | #else |
---|
1021 | Void TAppEncTop::xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits) |
---|
1022 | #endif |
---|
1023 | { |
---|
1024 | if (m_isField) |
---|
1025 | { |
---|
1026 | //Reinterlace fields |
---|
1027 | Int i; |
---|
1028 | #if H_MV |
---|
1029 | if( iNumEncoded > 0 ) |
---|
1030 | { |
---|
1031 | TComList<TComPicYuv*>::iterator iterPicYuvRec = m_picYuvRec[layerId]->end(); |
---|
1032 | #else |
---|
1033 | TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); |
---|
1034 | list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); |
---|
1035 | #endif |
---|
1036 | |
---|
1037 | for ( i = 0; i < iNumEncoded; i++ ) |
---|
1038 | { |
---|
1039 | --iterPicYuvRec; |
---|
1040 | } |
---|
1041 | |
---|
1042 | for ( i = 0; i < iNumEncoded/2; i++ ) |
---|
1043 | { |
---|
1044 | TComPicYuv* pcPicYuvRecTop = *(iterPicYuvRec++); |
---|
1045 | TComPicYuv* pcPicYuvRecBottom = *(iterPicYuvRec++); |
---|
1046 | |
---|
1047 | #if H_MV |
---|
1048 | if (m_pchReconFileList[layerId]) |
---|
1049 | { |
---|
1050 | m_acTVideoIOYuvReconFileList[layerId]->write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confLeft, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst ); |
---|
1051 | } |
---|
1052 | } |
---|
1053 | } |
---|
1054 | |
---|
1055 | if( ! accessUnits.empty() ) |
---|
1056 | { |
---|
1057 | list<AccessUnit>::iterator aUIter; |
---|
1058 | for( aUIter = accessUnits.begin(); aUIter != accessUnits.end(); aUIter++ ) |
---|
1059 | { |
---|
1060 | const vector<UInt>& stats = writeAnnexB(bitstreamFile, *aUIter); |
---|
1061 | rateStatsAccum(*aUIter, stats); |
---|
1062 | } |
---|
1063 | } |
---|
1064 | #else |
---|
1065 | if (m_pchReconFile) |
---|
1066 | { |
---|
1067 | m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confLeft, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst ); |
---|
1068 | } |
---|
1069 | |
---|
1070 | const AccessUnit& auTop = *(iterBitstream++); |
---|
1071 | const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop); |
---|
1072 | rateStatsAccum(auTop, statsTop); |
---|
1073 | |
---|
1074 | const AccessUnit& auBottom = *(iterBitstream++); |
---|
1075 | const vector<UInt>& statsBottom = writeAnnexB(bitstreamFile, auBottom); |
---|
1076 | rateStatsAccum(auBottom, statsBottom); |
---|
1077 | } |
---|
1078 | #endif |
---|
1079 | } |
---|
1080 | else |
---|
1081 | { |
---|
1082 | Int i; |
---|
1083 | #if H_MV |
---|
1084 | if( iNumEncoded > 0 ) |
---|
1085 | { |
---|
1086 | TComList<TComPicYuv*>::iterator iterPicYuvRec = m_picYuvRec[layerId]->end(); |
---|
1087 | #else |
---|
1088 | TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); |
---|
1089 | list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); |
---|
1090 | #endif |
---|
1091 | |
---|
1092 | for ( i = 0; i < iNumEncoded; i++ ) |
---|
1093 | { |
---|
1094 | --iterPicYuvRec; |
---|
1095 | } |
---|
1096 | |
---|
1097 | for ( i = 0; i < iNumEncoded; i++ ) |
---|
1098 | { |
---|
1099 | TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); |
---|
1100 | #if H_MV |
---|
1101 | if (m_pchReconFileList[layerId]) |
---|
1102 | { |
---|
1103 | m_acTVideoIOYuvReconFileList[layerId]->write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); |
---|
1104 | } |
---|
1105 | } |
---|
1106 | } |
---|
1107 | if( ! accessUnits.empty() ) |
---|
1108 | { |
---|
1109 | list<AccessUnit>::iterator aUIter; |
---|
1110 | for( aUIter = accessUnits.begin(); aUIter != accessUnits.end(); aUIter++ ) |
---|
1111 | { |
---|
1112 | const vector<unsigned>& stats = writeAnnexB(bitstreamFile, *aUIter); |
---|
1113 | rateStatsAccum(*aUIter, stats); |
---|
1114 | } |
---|
1115 | } |
---|
1116 | #else |
---|
1117 | if (m_pchReconFile) |
---|
1118 | { |
---|
1119 | m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); |
---|
1120 | } |
---|
1121 | |
---|
1122 | const AccessUnit& au = *(iterBitstream++); |
---|
1123 | const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); |
---|
1124 | rateStatsAccum(au, stats); |
---|
1125 | } |
---|
1126 | #endif |
---|
1127 | } |
---|
1128 | } |
---|
1129 | |
---|
1130 | /** |
---|
1131 | * |
---|
1132 | */ |
---|
1133 | void TAppEncTop::rateStatsAccum(const AccessUnit& au, const std::vector<UInt>& annexBsizes) |
---|
1134 | { |
---|
1135 | AccessUnit::const_iterator it_au = au.begin(); |
---|
1136 | vector<UInt>::const_iterator it_stats = annexBsizes.begin(); |
---|
1137 | |
---|
1138 | for (; it_au != au.end(); it_au++, it_stats++) |
---|
1139 | { |
---|
1140 | switch ((*it_au)->m_nalUnitType) |
---|
1141 | { |
---|
1142 | case NAL_UNIT_CODED_SLICE_TRAIL_R: |
---|
1143 | case NAL_UNIT_CODED_SLICE_TRAIL_N: |
---|
1144 | case NAL_UNIT_CODED_SLICE_TSA_R: |
---|
1145 | case NAL_UNIT_CODED_SLICE_TSA_N: |
---|
1146 | case NAL_UNIT_CODED_SLICE_STSA_R: |
---|
1147 | case NAL_UNIT_CODED_SLICE_STSA_N: |
---|
1148 | case NAL_UNIT_CODED_SLICE_BLA_W_LP: |
---|
1149 | case NAL_UNIT_CODED_SLICE_BLA_W_RADL: |
---|
1150 | case NAL_UNIT_CODED_SLICE_BLA_N_LP: |
---|
1151 | case NAL_UNIT_CODED_SLICE_IDR_W_RADL: |
---|
1152 | case NAL_UNIT_CODED_SLICE_IDR_N_LP: |
---|
1153 | case NAL_UNIT_CODED_SLICE_CRA: |
---|
1154 | case NAL_UNIT_CODED_SLICE_RADL_N: |
---|
1155 | case NAL_UNIT_CODED_SLICE_RADL_R: |
---|
1156 | case NAL_UNIT_CODED_SLICE_RASL_N: |
---|
1157 | case NAL_UNIT_CODED_SLICE_RASL_R: |
---|
1158 | case NAL_UNIT_VPS: |
---|
1159 | case NAL_UNIT_SPS: |
---|
1160 | case NAL_UNIT_PPS: |
---|
1161 | m_essentialBytes += *it_stats; |
---|
1162 | break; |
---|
1163 | default: |
---|
1164 | break; |
---|
1165 | } |
---|
1166 | |
---|
1167 | m_totalBytes += *it_stats; |
---|
1168 | } |
---|
1169 | } |
---|
1170 | |
---|
1171 | void TAppEncTop::printRateSummary() |
---|
1172 | { |
---|
1173 | #if H_MV |
---|
1174 | Double time = (Double) m_frameRcvd[0] / m_iFrameRate; |
---|
1175 | printf("\n"); |
---|
1176 | #else |
---|
1177 | Double time = (Double) m_iFrameRcvd / m_iFrameRate; |
---|
1178 | #endif |
---|
1179 | printf("Bytes written to file: %u (%.3f kbps)\n", m_totalBytes, 0.008 * m_totalBytes / time); |
---|
1180 | #if VERBOSE_RATE |
---|
1181 | printf("Bytes for SPS/PPS/Slice (Incl. Annex B): %u (%.3f kbps)\n", m_essentialBytes, 0.008 * m_essentialBytes / time); |
---|
1182 | #endif |
---|
1183 | } |
---|
1184 | |
---|
1185 | #if H_3D_DIM_DLT |
---|
1186 | Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt) |
---|
1187 | { |
---|
1188 | TComPicYuv* pcDepthPicYuvOrg = new TComPicYuv; |
---|
1189 | // allocate original YUV buffer |
---|
1190 | pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); |
---|
1191 | |
---|
1192 | TVideoIOYuv* depthVideoFile = new TVideoIOYuv; |
---|
1193 | |
---|
1194 | UInt uiMaxDepthValue = ((1 << g_bitDepthY)-1); |
---|
1195 | |
---|
1196 | Bool abValidDepths[256]; |
---|
1197 | |
---|
1198 | depthVideoFile->open( m_pchInputFileList[layer], false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode |
---|
1199 | |
---|
1200 | // initialize boolean array |
---|
1201 | for(Int p=0; p<=uiMaxDepthValue; p++) |
---|
1202 | abValidDepths[p] = false; |
---|
1203 | |
---|
1204 | Int iHeight = pcDepthPicYuvOrg->getHeight(); |
---|
1205 | Int iWidth = pcDepthPicYuvOrg->getWidth(); |
---|
1206 | Int iStride = pcDepthPicYuvOrg->getStride(); |
---|
1207 | |
---|
1208 | Pel* pInDM = pcDepthPicYuvOrg->getLumaAddr(); |
---|
1209 | |
---|
1210 | for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ ) |
---|
1211 | { |
---|
1212 | depthVideoFile->read( pcDepthPicYuvOrg, m_aiPad ); |
---|
1213 | |
---|
1214 | // check all pixel values |
---|
1215 | for (Int i=0; i<iHeight; i++) |
---|
1216 | { |
---|
1217 | Int rowOffset = i*iStride; |
---|
1218 | |
---|
1219 | for (Int j=0; j<iWidth; j++) |
---|
1220 | { |
---|
1221 | Pel depthValue = pInDM[rowOffset+j]; |
---|
1222 | abValidDepths[depthValue] = true; |
---|
1223 | } |
---|
1224 | } |
---|
1225 | } |
---|
1226 | |
---|
1227 | depthVideoFile->close(); |
---|
1228 | delete depthVideoFile; |
---|
1229 | |
---|
1230 | pcDepthPicYuvOrg->destroy(); |
---|
1231 | delete pcDepthPicYuvOrg; |
---|
1232 | |
---|
1233 | // convert boolean array to idx2Depth LUT |
---|
1234 | Int* aiIdx2DepthValue = (Int*) calloc(uiMaxDepthValue, sizeof(Int)); |
---|
1235 | Int iNumDepthValues = 0; |
---|
1236 | for(Int p=0; p<=uiMaxDepthValue; p++) |
---|
1237 | { |
---|
1238 | if( abValidDepths[p] == true) |
---|
1239 | { |
---|
1240 | aiIdx2DepthValue[iNumDepthValues++] = p; |
---|
1241 | } |
---|
1242 | } |
---|
1243 | |
---|
1244 | if( uiNumFrames == 0 || numBitsForValue(iNumDepthValues) == g_bitDepthY ) |
---|
1245 | { |
---|
1246 | dlt->setUseDLTFlag(layer, false); |
---|
1247 | } |
---|
1248 | |
---|
1249 | // assign LUT |
---|
1250 | if( dlt->getUseDLTFlag(layer) ) |
---|
1251 | { |
---|
1252 | dlt->setDepthLUTs(layer, aiIdx2DepthValue, iNumDepthValues); |
---|
1253 | } |
---|
1254 | |
---|
1255 | // free temporary memory |
---|
1256 | free(aiIdx2DepthValue); |
---|
1257 | } |
---|
1258 | #endif |
---|
1259 | |
---|
1260 | #if H_MV |
---|
1261 | Void TAppEncTop::xSetDimensionIdAndLength( TComVPS& vps ) |
---|
1262 | { |
---|
1263 | vps.setScalabilityMaskFlag( m_scalabilityMask ); |
---|
1264 | for( Int dim = 0; dim < m_dimIds.size(); dim++ ) |
---|
1265 | { |
---|
1266 | vps.setDimensionIdLen( dim, m_dimensionIdLen[ dim ] ); |
---|
1267 | for( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ ) |
---|
1268 | |
---|
1269 | { |
---|
1270 | vps.setDimensionId( layer, dim, m_dimIds[ dim ][ layer ] ); |
---|
1271 | } |
---|
1272 | } |
---|
1273 | |
---|
1274 | Int maxViewId = xGetMax( m_viewId ); |
---|
1275 | |
---|
1276 | Int viewIdLen = gCeilLog2( maxViewId + 1 ); |
---|
1277 | const Int maxViewIdLen = ( 1 << 4 ) - 1; |
---|
1278 | assert( viewIdLen <= maxViewIdLen ); |
---|
1279 | vps.setViewIdLen( viewIdLen ); |
---|
1280 | for (Int i = 0; i < m_iNumberOfViews; i++) |
---|
1281 | { |
---|
1282 | vps.setViewIdVal( i, m_viewId[ i] ); |
---|
1283 | } |
---|
1284 | |
---|
1285 | assert( m_iNumberOfViews == vps.getNumViews() ); |
---|
1286 | } |
---|
1287 | |
---|
1288 | Void TAppEncTop::xSetDependencies( TComVPS& vps ) |
---|
1289 | { |
---|
1290 | // Direct dependency flags + dependency types |
---|
1291 | for( Int depLayer = 1; depLayer < MAX_NUM_LAYERS; depLayer++ ) |
---|
1292 | { |
---|
1293 | for( Int refLayer = 0; refLayer < MAX_NUM_LAYERS; refLayer++ ) |
---|
1294 | { |
---|
1295 | vps.setDirectDependencyFlag( depLayer, refLayer, false); |
---|
1296 | vps.setDirectDependencyType( depLayer, refLayer, -1 ); |
---|
1297 | } |
---|
1298 | } |
---|
1299 | |
---|
1300 | Int defaultDirectDependencyType = -1; |
---|
1301 | #if MV_FIX_DEP_TYPES |
---|
1302 | Bool defaultDirectDependencyFlag = false; |
---|
1303 | #else |
---|
1304 | Bool defaultDirectDependencyFlag = true; |
---|
1305 | #endif |
---|
1306 | |
---|
1307 | for( Int depLayer = 1; depLayer < m_numberOfLayers; depLayer++ ) |
---|
1308 | { |
---|
1309 | Int numRefLayers = (Int) m_directRefLayers[depLayer].size(); |
---|
1310 | assert( numRefLayers == (Int) m_dependencyTypes[depLayer].size() ); |
---|
1311 | for( Int i = 0; i < numRefLayers; i++ ) |
---|
1312 | { |
---|
1313 | Int refLayer = m_directRefLayers[depLayer][i]; |
---|
1314 | vps.setDirectDependencyFlag( depLayer, refLayer, true); |
---|
1315 | Int curDirectDependencyType = m_dependencyTypes[depLayer][i]; |
---|
1316 | |
---|
1317 | if ( defaultDirectDependencyType != -1 ) |
---|
1318 | { |
---|
1319 | defaultDirectDependencyFlag = defaultDirectDependencyFlag && (curDirectDependencyType == defaultDirectDependencyType ); |
---|
1320 | } |
---|
1321 | else |
---|
1322 | { |
---|
1323 | defaultDirectDependencyType = curDirectDependencyType; |
---|
1324 | #if MV_FIX_DEP_TYPES |
---|
1325 | defaultDirectDependencyFlag = true; |
---|
1326 | #endif |
---|
1327 | } |
---|
1328 | |
---|
1329 | vps.setDirectDependencyType( depLayer, refLayer, curDirectDependencyType); |
---|
1330 | } |
---|
1331 | } |
---|
1332 | |
---|
1333 | vps.setDefaultDirectDependencyFlag( defaultDirectDependencyFlag ); |
---|
1334 | vps.setDefaultDirectDependencyType( defaultDirectDependencyFlag ? defaultDirectDependencyType : -1 ); |
---|
1335 | |
---|
1336 | // Max sub layers, + presence flag |
---|
1337 | Bool subLayersMaxMinus1PresentFlag = false; |
---|
1338 | Int subLayersMaxMinus1 = -1; |
---|
1339 | for (Int curLayerIdInVps = 0; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++ ) |
---|
1340 | { |
---|
1341 | Int curSubLayersMaxMinus1 = -1; |
---|
1342 | for( Int i = 0; i < getGOPSize(); i++ ) |
---|
1343 | { |
---|
1344 | GOPEntry geCur = m_GOPListMvc[curLayerIdInVps][i]; |
---|
1345 | curSubLayersMaxMinus1 = std::max( curSubLayersMaxMinus1, geCur.m_temporalId ); |
---|
1346 | } |
---|
1347 | |
---|
1348 | vps.setSubLayersVpsMaxMinus1( curLayerIdInVps, curSubLayersMaxMinus1 ); |
---|
1349 | if ( subLayersMaxMinus1 == -1 ) |
---|
1350 | { |
---|
1351 | subLayersMaxMinus1 = curSubLayersMaxMinus1; |
---|
1352 | } |
---|
1353 | else |
---|
1354 | { |
---|
1355 | subLayersMaxMinus1PresentFlag = subLayersMaxMinus1PresentFlag || ( curSubLayersMaxMinus1 != subLayersMaxMinus1 ); |
---|
1356 | } |
---|
1357 | } |
---|
1358 | |
---|
1359 | vps.setVpsSubLayersMaxMinus1PresentFlag( subLayersMaxMinus1PresentFlag ); |
---|
1360 | |
---|
1361 | |
---|
1362 | // Max temporal id for inter layer reference pictures + presence flag |
---|
1363 | Bool maxTidRefPresentFlag = false; |
---|
1364 | for ( Int refLayerIdInVps = 0; refLayerIdInVps < m_numberOfLayers; refLayerIdInVps++) |
---|
1365 | { |
---|
1366 | for ( Int curLayerIdInVps = 1; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++) |
---|
1367 | { |
---|
1368 | Int maxTid = -1; |
---|
1369 | for( Int i = 0; i < getGOPSize(); i++ ) |
---|
1370 | { |
---|
1371 | GOPEntry geCur = m_GOPListMvc[curLayerIdInVps][i]; |
---|
1372 | GOPEntry geRef = m_GOPListMvc[refLayerIdInVps][i]; |
---|
1373 | |
---|
1374 | for (Int j = 0; j < geCur.m_numActiveRefLayerPics; j++) |
---|
1375 | { |
---|
1376 | if ( m_directRefLayers[ curLayerIdInVps ][ geCur.m_interLayerPredLayerIdc[ j ]] == refLayerIdInVps ) |
---|
1377 | { |
---|
1378 | maxTid = std::max( maxTid, geRef.m_temporalId ); |
---|
1379 | } |
---|
1380 | } |
---|
1381 | } |
---|
1382 | vps.setMaxTidIlRefPicsPlus1( refLayerIdInVps, curLayerIdInVps, maxTid + 1 ); |
---|
1383 | maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 ); |
---|
1384 | } |
---|
1385 | } |
---|
1386 | |
---|
1387 | vps.setMaxTidRefPresentFlag( maxTidRefPresentFlag ); |
---|
1388 | // Max one active ref layer flag |
---|
1389 | Bool maxOneActiveRefLayerFlag = true; |
---|
1390 | for ( Int layerIdInVps = 1; layerIdInVps < m_numberOfLayers && maxOneActiveRefLayerFlag; layerIdInVps++) |
---|
1391 | { |
---|
1392 | for( Int i = 0; i < ( getGOPSize() + 1) && maxOneActiveRefLayerFlag; i++ ) |
---|
1393 | { |
---|
1394 | GOPEntry ge = m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]; |
---|
1395 | maxOneActiveRefLayerFlag = maxOneActiveRefLayerFlag && (ge.m_numActiveRefLayerPics <= 1); |
---|
1396 | } |
---|
1397 | } |
---|
1398 | |
---|
1399 | vps.setMaxOneActiveRefLayerFlag( maxOneActiveRefLayerFlag ); |
---|
1400 | |
---|
1401 | // Poc Lsb Not Present Flag |
---|
1402 | for ( Int layerIdInVps = 1; layerIdInVps < m_numberOfLayers; layerIdInVps++) |
---|
1403 | { |
---|
1404 | if ( m_directRefLayers[ layerIdInVps ].size() == 0 ) |
---|
1405 | { |
---|
1406 | vps.setPocLsbNotPresentFlag( layerIdInVps, true ); |
---|
1407 | } |
---|
1408 | } |
---|
1409 | |
---|
1410 | // All Ref layers active flag |
---|
1411 | Bool allRefLayersActiveFlag = true; |
---|
1412 | for ( Int layerIdInVps = 1; layerIdInVps < m_numberOfLayers && allRefLayersActiveFlag; layerIdInVps++) |
---|
1413 | { |
---|
1414 | for( Int i = 0; i < ( getGOPSize() + 1) && allRefLayersActiveFlag; i++ ) |
---|
1415 | { |
---|
1416 | GOPEntry ge = m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]; |
---|
1417 | Int tId = ge.m_temporalId; // Should be equal for all layers. |
---|
1418 | |
---|
1419 | // check if all reference layers when allRefLayerActiveFlag is equal to 1 are reference layer pictures specified in the gop entry |
---|
1420 | for (Int k = 0; k < m_directRefLayers[ layerIdInVps].size() && allRefLayersActiveFlag; k++ ) |
---|
1421 | { |
---|
1422 | Int refLayerIdInVps = vps.getLayerIdInVps( m_directRefLayers[ layerIdInVps ][ k ] ); |
---|
1423 | if ( vps.getMaxTidIlRefPicsPlus1(refLayerIdInVps,layerIdInVps) > tId && vps.getSubLayersVpsMaxMinus1(refLayerIdInVps) >= tId ) |
---|
1424 | { |
---|
1425 | Bool gopEntryFoundFlag = false; |
---|
1426 | for( Int l = 0; l < ge.m_numActiveRefLayerPics && !gopEntryFoundFlag; l++ ) |
---|
1427 | { |
---|
1428 | gopEntryFoundFlag = gopEntryFoundFlag || ( ge.m_interLayerPredLayerIdc[l] == k ); |
---|
1429 | } |
---|
1430 | allRefLayersActiveFlag = allRefLayersActiveFlag && gopEntryFoundFlag; |
---|
1431 | } |
---|
1432 | } |
---|
1433 | |
---|
1434 | // check if all inter layer reference pictures specified in the gop entry are valid reference layer pictures when allRefLayerActiveFlag is equal to 1 |
---|
1435 | // (Should actually always be true) |
---|
1436 | Bool maxTidIlRefAndSubLayerMaxVaildFlag = true; |
---|
1437 | for( Int l = 0; l < ge.m_numActiveRefLayerPics; l++ ) |
---|
1438 | { |
---|
1439 | Bool referenceLayerFoundFlag = false; |
---|
1440 | for (Int k = 0; k < m_directRefLayers[ layerIdInVps].size(); k++ ) |
---|
1441 | { |
---|
1442 | Int refLayerIdInVps = vps.getLayerIdInVps( m_directRefLayers[ layerIdInVps ][ k ] ); |
---|
1443 | |
---|
1444 | if ( vps.getMaxTidIlRefPicsPlus1(refLayerIdInVps,layerIdInVps) > tId && vps.getSubLayersVpsMaxMinus1(refLayerIdInVps) >= tId ) |
---|
1445 | { |
---|
1446 | referenceLayerFoundFlag = referenceLayerFoundFlag || ( ge.m_interLayerPredLayerIdc[l] == k ); |
---|
1447 | } |
---|
1448 | } |
---|
1449 | maxTidIlRefAndSubLayerMaxVaildFlag = maxTidIlRefAndSubLayerMaxVaildFlag && referenceLayerFoundFlag; |
---|
1450 | } |
---|
1451 | assert ( maxTidIlRefAndSubLayerMaxVaildFlag ); // Something wrong with MaxTidIlRefPicsPlus1 or SubLayersVpsMaxMinus1 |
---|
1452 | } |
---|
1453 | } |
---|
1454 | |
---|
1455 | vps.setAllRefLayersActiveFlag( allRefLayersActiveFlag ); |
---|
1456 | |
---|
1457 | vps.setRefLayers(); |
---|
1458 | }; |
---|
1459 | |
---|
1460 | GOPEntry* TAppEncTop::xGetGopEntry( Int layerIdInVps, Int poc ) |
---|
1461 | { |
---|
1462 | GOPEntry* geFound = NULL; |
---|
1463 | for( Int i = 0; i < ( getGOPSize() + 1) && geFound == NULL ; i++ ) |
---|
1464 | { |
---|
1465 | GOPEntry* ge = &(m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]); |
---|
1466 | if ( ge->m_POC == poc ) |
---|
1467 | { |
---|
1468 | geFound = ge; |
---|
1469 | } |
---|
1470 | } |
---|
1471 | assert( geFound != NULL ); |
---|
1472 | return geFound; |
---|
1473 | } |
---|
1474 | |
---|
1475 | Void TAppEncTop::xSetLayerIds( TComVPS& vps ) |
---|
1476 | { |
---|
1477 | vps.setSplittingFlag ( m_splittingFlag ); |
---|
1478 | |
---|
1479 | Bool nuhLayerIdPresentFlag = !( m_layerIdInNuh.size() == 1 ); |
---|
1480 | Int maxNuhLayerId = nuhLayerIdPresentFlag ? xGetMax( m_layerIdInNuh ) : ( m_numberOfLayers - 1 ) ; |
---|
1481 | |
---|
1482 | vps.setVpsMaxLayerId( maxNuhLayerId ); |
---|
1483 | vps.setVpsNuhLayerIdPresentFlag( nuhLayerIdPresentFlag ); |
---|
1484 | |
---|
1485 | for (Int layer = 0; layer < m_numberOfLayers; layer++ ) |
---|
1486 | { |
---|
1487 | vps.setLayerIdInNuh( layer, nuhLayerIdPresentFlag ? m_layerIdInNuh[ layer ] : layer ); |
---|
1488 | vps.setLayerIdInVps( vps.getLayerIdInNuh( layer ), layer ); |
---|
1489 | } |
---|
1490 | } |
---|
1491 | |
---|
1492 | Int TAppEncTop::xGetMax( std::vector<Int>& vec ) |
---|
1493 | { |
---|
1494 | Int maxVec = 0; |
---|
1495 | for ( Int i = 0; i < vec.size(); i++) |
---|
1496 | { |
---|
1497 | maxVec = max( vec[i], maxVec ); |
---|
1498 | } |
---|
1499 | return maxVec; |
---|
1500 | } |
---|
1501 | |
---|
1502 | Void TAppEncTop::xSetProfileTierLevel( TComVPS& vps ) |
---|
1503 | { |
---|
1504 | const Int vpsNumProfileTierLevelMinus1 = 0; //TBD |
---|
1505 | vps.setVpsNumProfileTierLevelMinus1( vpsNumProfileTierLevelMinus1 ); |
---|
1506 | |
---|
1507 | for (Int i = 0; i <= vps.getVpsNumProfileTierLevelMinus1(); i++ ) |
---|
1508 | { |
---|
1509 | vps.setVpsProfilePresentFlag( i, true ); |
---|
1510 | } |
---|
1511 | } |
---|
1512 | |
---|
1513 | |
---|
1514 | Void TAppEncTop::xSetRepFormat( TComVPS& vps ) |
---|
1515 | { |
---|
1516 | #if H_MV_HLS_8_PMS_Q0195_20 |
---|
1517 | vps.setRepFormatIdxPresentFlag( false ); |
---|
1518 | #else |
---|
1519 | vps.setRepFormatIdxPresentFlag( true ); |
---|
1520 | #endif |
---|
1521 | vps.setVpsNumRepFormatsMinus1 ( 0 ); |
---|
1522 | |
---|
1523 | TComRepFormat* repFormat = new TComRepFormat; |
---|
1524 | |
---|
1525 | repFormat->setBitDepthVpsChromaMinus8 ( g_bitDepthC - 8 ); |
---|
1526 | repFormat->setBitDepthVpsLumaMinus8 ( g_bitDepthY - 8 ); |
---|
1527 | repFormat->setChromaFormatVpsIdc ( CHROMA_420 ); |
---|
1528 | repFormat->setPicHeightVpsInLumaSamples ( m_iSourceHeight ); |
---|
1529 | repFormat->setPicWidthVpsInLumaSamples ( m_iSourceWidth ); |
---|
1530 | repFormat->setChromaAndBitDepthVpsPresentFlag( true ); |
---|
1531 | // ToDo not supported yet. |
---|
1532 | //repFormat->setSeparateColourPlaneVpsFlag( ); |
---|
1533 | |
---|
1534 | assert( vps.getRepFormat( 0 ) == NULL ); |
---|
1535 | vps.setRepFormat( 0 , repFormat ); |
---|
1536 | |
---|
1537 | #if !H_MV_HLS_8_PMS_Q0195_20 |
---|
1538 | for(Int i = 0; i <= vps.getMaxLayersMinus1(); i++ ) |
---|
1539 | { |
---|
1540 | vps.setVpsRepFormatIdx( i , 0 ); |
---|
1541 | } |
---|
1542 | #endif |
---|
1543 | } |
---|
1544 | |
---|
1545 | Void TAppEncTop::xSetDpbSize ( TComVPS& vps ) |
---|
1546 | { |
---|
1547 | // These settings need to be verified |
---|
1548 | |
---|
1549 | TComDpbSize* dpbSize = vps.getDpbSize(); |
---|
1550 | |
---|
1551 | assert ( dpbSize != 0 ); |
---|
1552 | |
---|
1553 | #if H_MV_HLS_8_HRD_Q0102_08 |
---|
1554 | for( Int i = 0; i < vps.getNumOutputLayerSets(); i++ ) |
---|
1555 | #else |
---|
1556 | for( Int i = 1; i < vps.getNumOutputLayerSets(); i++ ) |
---|
1557 | #endif |
---|
1558 | { |
---|
1559 | #if H_MV_HLS_8_MIS_Q0102_30 |
---|
1560 | Int currLsIdx = vps.olsIdxToLsIdx( i ); |
---|
1561 | #endif |
---|
1562 | std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i ); |
---|
1563 | Bool subLayerFlagInfoPresentFlag = false; |
---|
1564 | |
---|
1565 | #if H_MV_HLS_8_MIS_Q0102_30 |
---|
1566 | for( Int j = 0; j <= vps.getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ ) |
---|
1567 | #else |
---|
1568 | for( Int j = 0; j <= vps.getMaxSubLayersInLayerSetMinus1( i ); j++ ) |
---|
1569 | #endif |
---|
1570 | { |
---|
1571 | Bool subLayerDpbInfoPresentFlag = false; |
---|
1572 | #if H_MV_HLS_8_MIS_Q0102_30 || H_MV_HLS_8_DBP_NODOC_42 |
---|
1573 | assert( vps.getNumLayersInIdList( currLsIdx ) == targetDecLayerIdList.size() ); |
---|
1574 | for( Int k = 0; k < vps.getNumLayersInIdList( currLsIdx ); k++ ) |
---|
1575 | #else |
---|
1576 | assert( vps.getNumSubDpbs( vps.olsIdxToLsIdx( i ) ) == targetDecLayerIdList.size() ); |
---|
1577 | for( Int k = 0; k < vps.getNumSubDpbs( vps.olsIdxToLsIdx( i )); k++ ) |
---|
1578 | #endif |
---|
1579 | { |
---|
1580 | Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] ); |
---|
1581 | #if H_MV_HLS7_GEN |
---|
1582 | // TBD. Some derivation based on output layer set might be added here. |
---|
1583 | #endif |
---|
1584 | dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, m_maxDecPicBufferingMvc[ layerIdInVps ][ j ] - 1 ); |
---|
1585 | if ( j > 0 ) |
---|
1586 | { |
---|
1587 | subLayerDpbInfoPresentFlag = subLayerDpbInfoPresentFlag || ( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) != dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j - 1 ) ); |
---|
1588 | } |
---|
1589 | } |
---|
1590 | |
---|
1591 | Int maxNumReorderPics = MIN_INT; |
---|
1592 | for ( Int idx = 0; idx < targetDecLayerIdList.size(); idx++ ) |
---|
1593 | { |
---|
1594 | Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[ idx ] ); |
---|
1595 | maxNumReorderPics = std::max( maxNumReorderPics, m_numReorderPicsMvc[ layerIdInVps ][ j ] ); |
---|
1596 | } |
---|
1597 | assert( maxNumReorderPics != MIN_INT ); |
---|
1598 | |
---|
1599 | dpbSize->setMaxVpsNumReorderPics( i, j, maxNumReorderPics ); |
---|
1600 | if ( j > 0 ) |
---|
1601 | { |
---|
1602 | subLayerDpbInfoPresentFlag = subLayerDpbInfoPresentFlag || ( dpbSize->getMaxVpsNumReorderPics( i, j ) != dpbSize->getMaxVpsNumReorderPics( i, j - 1 ) ); |
---|
1603 | } |
---|
1604 | |
---|
1605 | // To Be Done ! |
---|
1606 | // dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, xx ); |
---|
1607 | if ( j > 0 ) |
---|
1608 | { |
---|
1609 | subLayerDpbInfoPresentFlag = subLayerDpbInfoPresentFlag || ( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ) != dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); |
---|
1610 | } |
---|
1611 | |
---|
1612 | if( j > 0 ) |
---|
1613 | { |
---|
1614 | dpbSize->setSubLayerDpbInfoPresentFlag( i, j, subLayerDpbInfoPresentFlag ); |
---|
1615 | subLayerFlagInfoPresentFlag = subLayerFlagInfoPresentFlag || subLayerDpbInfoPresentFlag; |
---|
1616 | } |
---|
1617 | } |
---|
1618 | dpbSize->setSubLayerFlagInfoPresentFlag( i, subLayerFlagInfoPresentFlag ); |
---|
1619 | } |
---|
1620 | } |
---|
1621 | |
---|
1622 | |
---|
1623 | Void TAppEncTop::xSetLayerSets( TComVPS& vps ) |
---|
1624 | { |
---|
1625 | // Layer sets |
---|
1626 | vps.setVpsNumLayerSetsMinus1 ( m_vpsNumLayerSets - 1 ); |
---|
1627 | |
---|
1628 | for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ ) |
---|
1629 | { |
---|
1630 | for( Int layerId = 0; layerId < MAX_NUM_LAYER_IDS; layerId++ ) |
---|
1631 | { |
---|
1632 | vps.setLayerIdIncludedFlag( false, lsIdx, layerId ); |
---|
1633 | } |
---|
1634 | for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++) |
---|
1635 | { |
---|
1636 | vps.setLayerIdIncludedFlag( true, lsIdx, vps.getLayerIdInNuh( m_layerIdsInSets[lsIdx][i] ) ); |
---|
1637 | } |
---|
1638 | } |
---|
1639 | vps.deriveLayerSetLayerIdList(); |
---|
1640 | |
---|
1641 | Int numAddOuputLayerSets = (Int) m_outputLayerSetIdx.size(); |
---|
1642 | // Additional output layer sets + profileLevelTierIdx |
---|
1643 | vps.setDefaultOutputLayerIdc ( m_defaultOutputLayerIdc ); |
---|
1644 | #if H_MV_HLS_8_SYN_39_19 |
---|
1645 | vps.setNumAddLayerSets ( 0 ); |
---|
1646 | vps.setNumAddOlss ( numAddOuputLayerSets ); |
---|
1647 | #else |
---|
1648 | vps.setNumAddLayerSets ( numAddOuputLayerSets ); |
---|
1649 | #endif |
---|
1650 | vps.initTargetLayerIdLists(); |
---|
1651 | |
---|
1652 | for (Int olsIdx = 0; olsIdx < m_vpsNumLayerSets + numAddOuputLayerSets; olsIdx++) |
---|
1653 | { |
---|
1654 | Int addOutLsIdx = olsIdx - m_vpsNumLayerSets; |
---|
1655 | |
---|
1656 | vps.setLayerSetIdxForOlsMinus1( olsIdx, ( ( addOutLsIdx < 0 ) ? olsIdx : m_outputLayerSetIdx[ addOutLsIdx ] ) - 1 ); |
---|
1657 | |
---|
1658 | std::vector<Int>& layerIdList = m_layerIdsInSets[ vps.olsIdxToLsIdx( olsIdx ) ]; |
---|
1659 | |
---|
1660 | if (vps.getDefaultOutputLayerIdc() == 2 || addOutLsIdx >= 0 ) |
---|
1661 | { |
---|
1662 | for ( Int i = 0; i < layerIdList.size(); i++) |
---|
1663 | { |
---|
1664 | vps.setOutputLayerFlag( olsIdx, i, ( olsIdx == 0 && i == 0 ) ? vps.inferOutputLayerFlag(olsIdx, i ) : false ); // This is a software only fix for a bug in the spec. In spec outputLayerFlag neither present nor inferred for this case ! |
---|
1665 | } |
---|
1666 | |
---|
1667 | std::vector<Int>& outLayerIdList = ( addOutLsIdx >= 0 ) ? m_layerIdsInAddOutputLayerSet[addOutLsIdx] : m_layerIdsInDefOutputLayerSet[olsIdx]; |
---|
1668 | |
---|
1669 | Bool outputLayerInLayerSetFlag = false; |
---|
1670 | for (Int j = 0; j < outLayerIdList.size(); j++) |
---|
1671 | { |
---|
1672 | for (Int i = 0; i < layerIdList.size(); i++ ) |
---|
1673 | { |
---|
1674 | if ( layerIdList[ i ] == outLayerIdList[ j ] ) |
---|
1675 | { |
---|
1676 | vps.setOutputLayerFlag( olsIdx, i, true ); |
---|
1677 | outputLayerInLayerSetFlag = true; |
---|
1678 | break; |
---|
1679 | } |
---|
1680 | } |
---|
1681 | assert( outputLayerInLayerSetFlag ); // The output layer is not not in the layer set. |
---|
1682 | } |
---|
1683 | } |
---|
1684 | else |
---|
1685 | { |
---|
1686 | for ( Int i = 0; i < layerIdList.size(); i++) |
---|
1687 | { |
---|
1688 | vps.setOutputLayerFlag( olsIdx, i, vps.inferOutputLayerFlag( olsIdx, i ) ); |
---|
1689 | } |
---|
1690 | } |
---|
1691 | |
---|
1692 | vps.deriveTargetLayerIdList( olsIdx ); |
---|
1693 | |
---|
1694 | if ( olsIdx > 0 ) |
---|
1695 | { |
---|
1696 | vps.setProfileLevelTierIdx( olsIdx, m_profileLevelTierIdx[ olsIdx ] ); |
---|
1697 | } |
---|
1698 | #if H_MV_HLS_7_VPS_P0300_27 |
---|
1699 | if ( vps.getNumOutputLayersInOutputLayerSet( olsIdx ) == 1 && |
---|
1700 | vps.getNumDirectRefLayers( vps.getOlsHighestOutputLayerId( olsIdx ) ) ) |
---|
1701 | { |
---|
1702 | vps.setAltOutputLayerFlag( olsIdx , m_altOutputLayerFlag[ olsIdx ]); |
---|
1703 | } |
---|
1704 | else |
---|
1705 | { |
---|
1706 | vps.setAltOutputLayerFlag( olsIdx , false ); |
---|
1707 | if ( m_altOutputLayerFlag[ olsIdx ] ) |
---|
1708 | { |
---|
1709 | printf( "\nWarning: Ignoring AltOutputLayerFlag for output layer set %d, since more than one output layer or no dependent layers.\n", olsIdx ); |
---|
1710 | } |
---|
1711 | } |
---|
1712 | #else |
---|
1713 | vps.setAltOutputLayerFlag( olsIdx , false); |
---|
1714 | #endif |
---|
1715 | } |
---|
1716 | } |
---|
1717 | |
---|
1718 | Void TAppEncTop::xSetVPSVUI( TComVPS& vps ) |
---|
1719 | { |
---|
1720 | vps.setVpsVuiPresentFlag( m_vpsVuiPresentFlag ); |
---|
1721 | |
---|
1722 | TComVPSVUI* pcVPSVUI = vps.getVPSVUI( ); |
---|
1723 | assert( pcVPSVUI ); |
---|
1724 | |
---|
1725 | if ( m_vpsVuiPresentFlag ) |
---|
1726 | { |
---|
1727 | // All this stuff could actually be derived by the encoder, |
---|
1728 | // however preliminary setting it from input parameters |
---|
1729 | |
---|
1730 | pcVPSVUI->setCrossLayerPicTypeAlignedFlag( m_crossLayerPicTypeAlignedFlag ); |
---|
1731 | pcVPSVUI->setCrossLayerIrapAlignedFlag ( m_crossLayerIrapAlignedFlag ); |
---|
1732 | pcVPSVUI->setAllLayersIdrAlignedFlag ( m_allLayersIdrAlignedFlag ); |
---|
1733 | pcVPSVUI->setBitRatePresentVpsFlag( m_bitRatePresentVpsFlag ); |
---|
1734 | pcVPSVUI->setPicRatePresentVpsFlag( m_picRatePresentVpsFlag ); |
---|
1735 | |
---|
1736 | if( pcVPSVUI->getBitRatePresentVpsFlag( ) || pcVPSVUI->getPicRatePresentVpsFlag( ) ) |
---|
1737 | { |
---|
1738 | for( Int i = 0; i <= vps.getVpsNumLayerSetsMinus1(); i++ ) |
---|
1739 | { |
---|
1740 | for( Int j = 0; j <= vps.getMaxTLayers(); j++ ) |
---|
1741 | { |
---|
1742 | if( pcVPSVUI->getBitRatePresentVpsFlag( ) && m_bitRatePresentFlag[i].size() > j ) |
---|
1743 | { |
---|
1744 | pcVPSVUI->setBitRatePresentFlag( i, j, m_bitRatePresentFlag[i][j] ); |
---|
1745 | } |
---|
1746 | if( pcVPSVUI->getPicRatePresentVpsFlag( ) && m_picRatePresentFlag[i].size() > j ) |
---|
1747 | { |
---|
1748 | pcVPSVUI->setPicRatePresentFlag( i, j, m_picRatePresentFlag[i][j] ); |
---|
1749 | } |
---|
1750 | if( pcVPSVUI->getBitRatePresentFlag( i, j ) && m_avgBitRate[i].size() > j ) |
---|
1751 | { |
---|
1752 | pcVPSVUI->setAvgBitRate( i, j, m_avgBitRate[i][j] ); |
---|
1753 | } |
---|
1754 | if( pcVPSVUI->getBitRatePresentFlag( i, j ) && m_maxBitRate[i].size() > j ) |
---|
1755 | { |
---|
1756 | pcVPSVUI->setMaxBitRate( i, j, m_maxBitRate[i][j] ); |
---|
1757 | } |
---|
1758 | if( pcVPSVUI->getPicRatePresentFlag( i, j ) && m_constantPicRateIdc[i].size() > j ) |
---|
1759 | { |
---|
1760 | pcVPSVUI->setConstantPicRateIdc( i, j, m_constantPicRateIdc[i][j] ); |
---|
1761 | } |
---|
1762 | if( pcVPSVUI->getPicRatePresentFlag( i, j ) && m_avgPicRate[i].size() > j ) |
---|
1763 | { |
---|
1764 | pcVPSVUI->setAvgPicRate( i, j, m_avgPicRate[i][j] ); |
---|
1765 | } |
---|
1766 | } |
---|
1767 | } |
---|
1768 | } |
---|
1769 | |
---|
1770 | pcVPSVUI->setTilesNotInUseFlag( m_tilesNotInUseFlag ); |
---|
1771 | |
---|
1772 | if( !pcVPSVUI->getTilesNotInUseFlag() ) |
---|
1773 | { |
---|
1774 | for( Int i = 0; i <= vps.getMaxLayersMinus1(); i++ ) |
---|
1775 | { |
---|
1776 | pcVPSVUI->setTilesInUseFlag( i, m_tilesInUseFlag[ i ] ); |
---|
1777 | if( pcVPSVUI->getTilesInUseFlag( i ) ) |
---|
1778 | { |
---|
1779 | pcVPSVUI->setLoopFilterNotAcrossTilesFlag( i, m_loopFilterNotAcrossTilesFlag[ i ] ); |
---|
1780 | } |
---|
1781 | } |
---|
1782 | |
---|
1783 | for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) |
---|
1784 | { |
---|
1785 | for( Int j = 0; j < vps.getNumDirectRefLayers( vps.getLayerIdInNuh( i ) ) ; j++ ) |
---|
1786 | { |
---|
1787 | Int layerIdx = vps.getLayerIdInVps( vps.getRefLayerId(vps.getLayerIdInNuh( i ) , j )); |
---|
1788 | if( pcVPSVUI->getTilesInUseFlag( i ) && pcVPSVUI->getTilesInUseFlag( layerIdx ) ) |
---|
1789 | { |
---|
1790 | pcVPSVUI->setTileBoundariesAlignedFlag( i, j, m_tileBoundariesAlignedFlag[i][j] ); |
---|
1791 | } |
---|
1792 | } |
---|
1793 | } |
---|
1794 | } |
---|
1795 | |
---|
1796 | pcVPSVUI->setWppNotInUseFlag( m_wppNotInUseFlag ); |
---|
1797 | |
---|
1798 | if( !pcVPSVUI->getWppNotInUseFlag( ) ) |
---|
1799 | { |
---|
1800 | for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) |
---|
1801 | { |
---|
1802 | pcVPSVUI->setWppInUseFlag( i, m_wppInUseFlag[ i ]); |
---|
1803 | } |
---|
1804 | } |
---|
1805 | |
---|
1806 | pcVPSVUI->setIlpRestrictedRefLayersFlag( m_ilpRestrictedRefLayersFlag ); |
---|
1807 | |
---|
1808 | if( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ) |
---|
1809 | { |
---|
1810 | for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) |
---|
1811 | { |
---|
1812 | for( Int j = 0; j < vps.getNumDirectRefLayers( vps.getLayerIdInNuh( i ) ); j++ ) |
---|
1813 | { |
---|
1814 | if ( m_minSpatialSegmentOffsetPlus1[i].size() > j ) |
---|
1815 | { |
---|
1816 | pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, m_minSpatialSegmentOffsetPlus1[i][j] ); |
---|
1817 | } |
---|
1818 | if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 ) |
---|
1819 | { |
---|
1820 | if ( m_ctuBasedOffsetEnabledFlag[i].size() > j ) |
---|
1821 | { |
---|
1822 | pcVPSVUI->setCtuBasedOffsetEnabledFlag( i, j, m_ctuBasedOffsetEnabledFlag[i][j] ); |
---|
1823 | } |
---|
1824 | if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) ) |
---|
1825 | { |
---|
1826 | if ( m_minHorizontalCtuOffsetPlus1[i].size() > j ) |
---|
1827 | { |
---|
1828 | pcVPSVUI->setMinHorizontalCtuOffsetPlus1( i, j, m_minHorizontalCtuOffsetPlus1[i][j] ); |
---|
1829 | } |
---|
1830 | } |
---|
1831 | } |
---|
1832 | } |
---|
1833 | } |
---|
1834 | } |
---|
1835 | pcVPSVUI->setVideoSignalInfoIdxPresentFlag( true ); |
---|
1836 | pcVPSVUI->setVpsNumVideoSignalInfoMinus1 ( 0 ); |
---|
1837 | |
---|
1838 | assert ( pcVPSVUI->getVideoSignalInfo( 0 ) == NULL ); |
---|
1839 | |
---|
1840 | TComVideoSignalInfo* videoSignalInfo = new TComVideoSignalInfo; |
---|
1841 | |
---|
1842 | videoSignalInfo->setColourPrimariesVps ( m_colourPrimaries ); |
---|
1843 | videoSignalInfo->setMatrixCoeffsVps ( m_matrixCoefficients ); |
---|
1844 | videoSignalInfo->setTransferCharacteristicsVps( m_transferCharacteristics ); |
---|
1845 | videoSignalInfo->setVideoVpsFormat ( m_videoFormat ); |
---|
1846 | videoSignalInfo->setVideoFullRangeVpsFlag ( m_videoFullRangeFlag ); |
---|
1847 | |
---|
1848 | pcVPSVUI->setVideoSignalInfo( 0, videoSignalInfo ); |
---|
1849 | |
---|
1850 | for (Int i = 0; i < m_numberOfLayers; i++) |
---|
1851 | { |
---|
1852 | pcVPSVUI->setVpsVideoSignalInfoIdx( i, 0 ); |
---|
1853 | } |
---|
1854 | pcVPSVUI->setVpsVuiBspHrdPresentFlag( false ); // TBD |
---|
1855 | } |
---|
1856 | else |
---|
1857 | { |
---|
1858 | pcVPSVUI->setCrossLayerIrapAlignedFlag ( false ); |
---|
1859 | } |
---|
1860 | } |
---|
1861 | #endif |
---|
1862 | #if H_3D |
---|
1863 | Void TAppEncTop::xSetVPSExtension2( TComVPS& vps ) |
---|
1864 | { |
---|
1865 | for ( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ ) |
---|
1866 | { |
---|
1867 | Bool isDepth = ( vps.getDepthId( layer ) == 1 ) ; |
---|
1868 | Bool isLayerZero = ( layer == 0 ); |
---|
1869 | |
---|
1870 | #if H_3D_ARP |
---|
1871 | #if QC_IV_PRED_CONSTRAINT_H0137 |
---|
1872 | vps.setUseAdvRP ( layer, ( isDepth || isLayerZero || !vps.getNumDirectRefLayers(layer) ) ? 0 : m_uiUseAdvResPred ); |
---|
1873 | vps.setARPStepNum ( layer, ( isDepth || isLayerZero || !vps.getNumDirectRefLayers(layer) ) ? 1 : H_3D_ARP_WFNR ); |
---|
1874 | #else |
---|
1875 | vps.setUseAdvRP ( layer, ( isDepth || isLayerZero ) ? 0 : m_uiUseAdvResPred ); |
---|
1876 | vps.setARPStepNum ( layer, ( isDepth || isLayerZero ) ? 1 : H_3D_ARP_WFNR ); |
---|
1877 | #endif |
---|
1878 | #endif |
---|
1879 | #if H_3D_SPIVMP |
---|
1880 | if( isDepth ) |
---|
1881 | { |
---|
1882 | vps.setSubPULog2Size ( layer, (layer != 1) ? 6: 0 ); |
---|
1883 | } |
---|
1884 | else |
---|
1885 | { |
---|
1886 | vps.setSubPULog2Size ( layer, (!isLayerZero) ? m_iSubPULog2Size: 0 ); |
---|
1887 | } |
---|
1888 | #endif |
---|
1889 | |
---|
1890 | #if H_3D_DIM |
---|
1891 | vps.setVpsDepthModesFlag( layer, isDepth && !isLayerZero && (m_useDMM || m_useSDC || m_useDLT ) ); |
---|
1892 | #endif |
---|
1893 | |
---|
1894 | #if H_3D_IV_MERGE |
---|
1895 | #if QC_IV_PRED_CONSTRAINT_H0137 |
---|
1896 | if( !vps.getNumDirectRefLayers(layer) ) |
---|
1897 | { |
---|
1898 | vps.setIvMvPredFlag (layer, false); |
---|
1899 | } |
---|
1900 | else |
---|
1901 | { |
---|
1902 | #endif |
---|
1903 | if( isDepth ) |
---|
1904 | { |
---|
1905 | vps.setIvMvPredFlag ( layer, (layer != 1) && m_ivMvPredFlag[1] ); |
---|
1906 | } |
---|
1907 | else |
---|
1908 | { |
---|
1909 | vps.setIvMvPredFlag ( layer, !isLayerZero && m_ivMvPredFlag[0] ); |
---|
1910 | } |
---|
1911 | #if QC_IV_PRED_CONSTRAINT_H0137 |
---|
1912 | } |
---|
1913 | #endif |
---|
1914 | #endif |
---|
1915 | #if H_3D_NBDV_REF |
---|
1916 | vps.setDepthRefinementFlag ( layer, !isLayerZero && !isDepth && m_depthRefinementFlag ); |
---|
1917 | #endif |
---|
1918 | #if H_3D_VSP |
---|
1919 | #if QC_IV_PRED_CONSTRAINT_H0137 |
---|
1920 | vps.setViewSynthesisPredFlag( layer, !isLayerZero && !isDepth && vps.getNumDirectRefLayers(layer) && m_viewSynthesisPredFlag ); |
---|
1921 | #else |
---|
1922 | vps.setViewSynthesisPredFlag( layer, !isLayerZero && !isDepth && m_viewSynthesisPredFlag ); |
---|
1923 | #endif |
---|
1924 | #endif |
---|
1925 | #if H_3D_DBBP |
---|
1926 | vps.setUseDBBP ( layer, !isLayerZero && !isDepth && m_bUseDBBP ); |
---|
1927 | #endif |
---|
1928 | #if H_3D_INTER_SDC |
---|
1929 | vps.setInterSDCFlag( layer, !isLayerZero && isDepth && m_bDepthInterSDCFlag ); |
---|
1930 | #endif |
---|
1931 | #if H_3D_IV_MERGE |
---|
1932 | vps.setMPIFlag( layer, !isLayerZero && isDepth && m_bMPIFlag ); |
---|
1933 | #endif |
---|
1934 | } |
---|
1935 | #if H_3D_SPIVMP |
---|
1936 | vps.setSubPUMPILog2Size( m_iSubPUMPILog2Size ); |
---|
1937 | #endif |
---|
1938 | #if H_3D |
---|
1939 | vps.setIvMvScalingFlag( m_ivMvScalingFlag ); |
---|
1940 | #endif |
---|
1941 | } |
---|
1942 | |
---|
1943 | Void TAppEncTop::xDeriveDltArray( TComVPS& vps, TComDLT& dlt ) |
---|
1944 | { |
---|
1945 | Int iNumDepthViews = 0; |
---|
1946 | Bool bDltPresentFlag = false; |
---|
1947 | |
---|
1948 | for ( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ ) |
---|
1949 | { |
---|
1950 | Bool isDepth = ( vps.getDepthId( layer ) == 1 ); |
---|
1951 | |
---|
1952 | if ( isDepth ) |
---|
1953 | { |
---|
1954 | iNumDepthViews++; |
---|
1955 | } |
---|
1956 | |
---|
1957 | dlt.setUseDLTFlag( layer , isDepth && m_useDLT ); |
---|
1958 | if( dlt.getUseDLTFlag( layer ) ) |
---|
1959 | { |
---|
1960 | xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod[layer], 24), &vps, &dlt); |
---|
1961 | bDltPresentFlag = bDltPresentFlag || dlt.getUseDLTFlag(layer); |
---|
1962 | #if H_3D_DELTA_DLT |
---|
1963 | dlt.setInterViewDltPredEnableFlag(layer, (dlt.getUseDLTFlag(layer) && (layer>1))); |
---|
1964 | #endif |
---|
1965 | } |
---|
1966 | } |
---|
1967 | |
---|
1968 | dlt.setDltPresentFlag( bDltPresentFlag ); |
---|
1969 | dlt.setNumDepthViews ( iNumDepthViews ); |
---|
1970 | } |
---|
1971 | #endif |
---|
1972 | //! \} |
---|