1 /*
2 * Copyright (c) 2018-2021, Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22 //!
23 //! \file     vp_resource_manager.h
24 //! \brief    The header file of the base class of vp resource manager
25 //! \details  all the vp resources will be traced here for usages using intermeida
26 //!           surfaces.
27 //!
28 #ifndef _VP_RESOURCE_MANAGER_H__
29 #define _VP_RESOURCE_MANAGER_H__
30 
31 #include <map>
32 #include "vp_allocator.h"
33 #include "vp_pipeline_common.h"
34 #include "vp_utils.h"
35 
36 #define VP_MAX_NUM_VEBOX_SURFACES     4                                       //!< Vebox output surface creation, also can be reuse for DI usage:
37                                                                               //!< for DI: 2 for ADI plus additional 2 for parallel execution
38 #define VP_NUM_DN_SURFACES           2                                       //!< Number of DN output surfaces
39 #define VP_NUM_STMM_SURFACES         2                                       //!< Number of STMM statistics surfaces
40 #define VP_DNDI_BUFFERS_MAX          4                                       //!< Max DNDI buffers
41 #define VP_NUM_KERNEL_VEBOX          8                                       //!< Max kernels called at Adv stage
42 
43 #define VP_VEBOX_PER_BLOCK_STATISTICS_SIZE   16
44 #define VP_VEBOX_FMD_HISTORY_SIZE            (144 * sizeof(uint32_t))
45 
46 #define VP_NUM_ACE_STATISTICS_HISTOGRAM      256
47 #define VP_NUM_STD_STATISTICS                2
48 
49 #ifndef VEBOX_AUTO_DENOISE_SUPPORTED
50 #define VEBOX_AUTO_DENOISE_SUPPORTED    1
51 #endif
52 
53 //!
54 //! \brief Number of LACE's PWLF surfaces
55 //!
56 #define VP_NUM_LACE_PWLF_SURFACES                    2
57 
58 #define IS_VP_VEBOX_DN_ONLY(_a) (_a.bDN &&          \
59                                !(_a.bDI) &&   \
60                                !(_a.bQueryVariance) && \
61                                !(_a.bIECP) && \
62                                !(_a.b3DlutOutput))
63 
64 #define VP_NUM_FC_INTERMEDIA_SURFACES   2
65 
66 namespace vp {
67     struct VEBOX_SPATIAL_ATTRIBUTES_CONFIGURATION
68     {
69         // DWORD 0
70         union
71         {
72             // RangeThrStart0
73             struct
74             {
75                 uint32_t       RangeThrStart0;
76             };
77 
78             uint32_t       Value;
79         } DW00;
80 
81         // DWORD 1
82         union
83         {
84             // RangeThrStart1
85             struct
86             {
87                 uint32_t       RangeThrStart1;
88             };
89 
90             uint32_t       Value;
91         } DW01;
92 
93         // DWORD 2
94         union
95         {
96             // RangeThrStart2
97             struct
98             {
99                 uint32_t       RangeThrStart2;
100             };
101 
102             uint32_t   Value;
103         } DW02;
104 
105         // DWORD 3
106         union
107         {
108             // RangeThrStart3
109             struct
110             {
111                 uint32_t       RangeThrStart3;
112             };
113 
114             uint32_t   Value;
115         } DW03;
116 
117         // DWORD 4
118         union
119         {
120             // RangeThrStart4
121             struct
122             {
123                 uint32_t       RangeThrStart4;
124             };
125 
126             uint32_t   Value;
127         } DW04;
128 
129         // DWORD 5
130         union
131         {
132             // RangeThrStart5
133             struct
134             {
135                 uint32_t       RangeThrStart5;
136             };
137 
138             uint32_t   Value;
139         } DW05;
140 
141         // DWORD 6
142         union
143         {
144             // Reserved
145             struct
146             {
147                 uint32_t       Reserved;
148             };
149 
150             uint32_t   Value;
151         } DW06;
152 
153         // DWORD 7
154         union
155         {
156             // Reserved
157             struct
158             {
159                 uint32_t       Reserved;
160             };
161 
162             uint32_t   Value;
163         } DW07;
164 
165         // DWORD 8
166         union
167         {
168             // RangeWgt0
169             struct
170             {
171                 uint32_t       RangeWgt0;
172             };
173 
174             uint32_t   Value;
175         } DW08;
176 
177         // DWORD 9
178         union
179         {
180             // RangeWgt1
181             struct
182             {
183                 uint32_t       RangeWgt1;
184             };
185 
186             uint32_t   Value;
187         } DW09;
188 
189         // DWORD 10
190         union
191         {
192             // RangeWgt2
193             struct
194             {
195                 uint32_t       RangeWgt2;
196             };
197 
198             uint32_t   Value;
199         } DW10;
200 
201         // DWORD 11
202         union
203         {
204             // RangeWgt3
205             struct
206             {
207                 uint32_t       RangeWgt3;
208             };
209 
210             uint32_t   Value;
211         } DW11;
212 
213         // DWORD 12
214         union
215         {
216             // RangeWgt4
217             struct
218             {
219                 uint32_t       RangeWgt4;
220             };
221 
222             uint32_t   Value;
223         } DW12;
224 
225         // DWORD 13
226         union
227         {
228             // RangeWgt5
229             struct
230             {
231                 uint32_t       RangeWgt5;
232             };
233 
234             uint32_t   Value;
235         } DW13;
236 
237         // DWORD 14
238         union
239         {
240             // Reserved
241             struct
242             {
243                 uint32_t       Reserved;
244             };
245 
246             uint32_t   Value;
247         } DW14;
248 
249         // DWORD 15
250         union
251         {
252             // Reserved
253             struct
254             {
255                 uint32_t       Reserved;
256             };
257 
258             uint32_t   Value;
259         } DW15;
260 
261         // DWORD 16 - 41: DistWgt[5][5]
262         uint32_t DistWgt[5][5];
263 
264         // Padding for 32-byte alignment, VEBOX_SPATIAL_ATTRIBUTES_CONFIGURATION_G9 is 7 uint32_ts
265         uint32_t dwPad[7];
266     };
267 
268 enum VEBOX_SURFACE_ID
269 {
270     VEBOX_SURFACE_NULL = 0,
271     VEBOX_SURFACE_INPUT,
272     VEBOX_SURFACE_OUTPUT,
273     VEBOX_SURFACE_PAST_REF,
274     VEBOX_SURFACE_FUTURE_REF,
275     VEBOX_SURFACE_FRAME0,
276     VEBOX_SURFACE_FRAME1,
277     VEBOX_SURFACE_FRAME2,
278     VEBOX_SURFACE_FRAME3,
279 };
280 
281 struct VEBOX_SURFACES
282 {
283     VEBOX_SURFACE_ID currentInputSurface;
284     VEBOX_SURFACE_ID pastInputSurface;
285     VEBOX_SURFACE_ID currentOutputSurface;
286     VEBOX_SURFACE_ID pastOutputSurface;
287 
VEBOX_SURFACESVEBOX_SURFACES288     VEBOX_SURFACES(VEBOX_SURFACE_ID _currentInputSurface, VEBOX_SURFACE_ID _pastInputSurface, VEBOX_SURFACE_ID _currentOutputSurface, VEBOX_SURFACE_ID _pastOutputSurface)
289         : currentInputSurface(_currentInputSurface), pastInputSurface(_pastInputSurface), currentOutputSurface(_currentOutputSurface), pastOutputSurface(_pastOutputSurface)
290     {}
291 };
292 
BoolToInt(bool b)293 inline uint32_t BoolToInt(bool b)
294 {
295     return ((b) ? 1 : 0);
296 }
297 
298 union VEBOX_SURFACES_CONFIG
299 {
300     struct
301     {
302         uint32_t b64DI              : 1;
303         uint32_t sfcEnable          : 1;
304         uint32_t sameSample         : 1;
305         uint32_t outOfBound         : 1;
306         uint32_t pastFrameAvailable    : 1;
307         uint32_t futureFrameAvailable    : 1;
308         uint32_t firstDiField       : 1;
309         uint32_t reserved           : 25;
310     };
311     uint32_t value;
VEBOX_SURFACES_CONFIG()312     VEBOX_SURFACES_CONFIG() : value(0)
313     {}
VEBOX_SURFACES_CONFIG(bool _b64DI,bool _sfcEnable,bool _sameSample,bool _outOfBound,bool _pastFrameAvailable,bool _futureFrameAvailable,bool _firstDiField)314     VEBOX_SURFACES_CONFIG(bool _b64DI, bool _sfcEnable, bool _sameSample, bool _outOfBound, bool _pastFrameAvailable, bool _futureFrameAvailable, bool _firstDiField) :
315         b64DI(BoolToInt(_b64DI)), sfcEnable(BoolToInt(_sfcEnable)), sameSample(BoolToInt(_sameSample)), outOfBound(BoolToInt(_outOfBound)),
316         pastFrameAvailable(BoolToInt(_pastFrameAvailable)), futureFrameAvailable(BoolToInt(_futureFrameAvailable)), firstDiField(BoolToInt(_firstDiField)), reserved(0)
317     {}
318 };
319 
320 typedef std::map<uint32_t, VEBOX_SURFACES> VEBOX_SURFACE_CONFIG_MAP;
321 
322 struct VP_FRAME_IDS
323 {
324     bool        valid;
325     bool        diEnabled;
326     int32_t     currentFrameId;
327     bool        pastFrameAvailable;
328     bool        futureFrameAvailable;
329     int32_t     pastFrameId;
330     int32_t     futureFrameId;
331 };
332 struct VP_SURFACE_PARAMS;
333 
334 class VpResourceManager
335 {
336 public:
337     VpResourceManager(MOS_INTERFACE &osInterface, VpAllocator &allocator, VphalFeatureReport &reporting, vp::VpPlatformInterface &vpPlatformInterface);
338     virtual ~VpResourceManager();
339     virtual MOS_STATUS OnNewFrameProcessStart(SwFilterPipe &pipe);
340     virtual void OnNewFrameProcessEnd();
341     MOS_STATUS PrepareFcIntermediateSurface(SwFilterPipe &featurePipe);
342     MOS_STATUS GetResourceHint(std::vector<FeatureType> &featurePool, SwFilterPipe& executedFilters, RESOURCE_ASSIGNMENT_HINT &hint);
343     MOS_STATUS AssignExecuteResource(std::vector<FeatureType> &featurePool, VP_EXECUTE_CAPS& caps, SwFilterPipe &executedFilters);
344     MOS_STATUS AssignExecuteResource(VP_EXECUTE_CAPS& caps, std::vector<VP_SURFACE *> &inputSurfaces, VP_SURFACE *outputSurface,
345         std::vector<VP_SURFACE *> &pastSurfaces, std::vector<VP_SURFACE *> &futureSurfaces,
346         RESOURCE_ASSIGNMENT_HINT resHint, VP_SURFACE_SETTING &surfSetting);
347 
IsSameSamples()348     bool IsSameSamples()
349     {
350         return m_sameSamples;
351     }
352 
353     bool IsOutputSurfaceNeeded(VP_EXECUTE_CAPS caps);
354 
IsRefValid()355     bool IsRefValid()
356     {
357         return m_currentFrameIds.pastFrameAvailable || m_currentFrameIds.futureFrameAvailable;
358     }
359 
IsPastHistogramValid()360     bool IsPastHistogramValid()
361     {
362         return m_isPastHistogramValid;
363     }
364 
GetImageResolutionOfPastHistogram(uint32_t & width,uint32_t & height)365     void GetImageResolutionOfPastHistogram(uint32_t &width, uint32_t &height)
366     {
367         width = m_imageWidthOfPastHistogram;
368         height = m_imageHeightOfPastHistogram;
369     }
370 
GetVeboxLaceLut()371     virtual VP_SURFACE* GetVeboxLaceLut()
372     {
373         return NULL;
374     }
375 
GetVeboxAggregatedHistogramSurface()376     virtual VP_SURFACE* GetVeboxAggregatedHistogramSurface()
377     {
378        return NULL;
379     }
380 
GetVeboxFrameHistogramSurface()381     virtual VP_SURFACE* GetVeboxFrameHistogramSurface()
382     {
383        return NULL;
384     }
385 
GetVeboxStdStatisticsSurface()386     virtual VP_SURFACE* GetVeboxStdStatisticsSurface()
387     {
388        return NULL;
389     }
390 
GetVeboxPwlfSurface()391     virtual VP_SURFACE* GetVeboxPwlfSurface()
392     {
393        return NULL;
394     }
395 
GetVeboxWeitCoefSurface()396     virtual VP_SURFACE* GetVeboxWeitCoefSurface()
397     {
398        return NULL;
399     }
400 
GetVeboxGlobalToneMappingCurveLUTSurface()401     virtual VP_SURFACE* GetVeboxGlobalToneMappingCurveLUTSurface()
402     {
403        return NULL;
404     }
405 
406 protected:
407     VP_SURFACE* GetVeboxOutputSurface(VP_EXECUTE_CAPS& caps, VP_SURFACE *outputSurface);
408     MOS_STATUS InitVeboxSpatialAttributesConfiguration();
409     MOS_STATUS AllocateVeboxResource(VP_EXECUTE_CAPS& caps, VP_SURFACE *inputSurface, VP_SURFACE *outputSurface);
410     MOS_STATUS AssignSurface(VP_EXECUTE_CAPS caps, VEBOX_SURFACE_ID &surfaceId, SurfaceType surfaceType, VP_SURFACE *inputSurface, VP_SURFACE *outputSurface, VP_SURFACE *pastRefSurface, VP_SURFACE *futureRefSurface, VP_SURFACE_GROUP &surfGroup);
411     bool VeboxOutputNeeded(VP_EXECUTE_CAPS& caps);
412     bool VeboxDenoiseOutputNeeded(VP_EXECUTE_CAPS& caps);
413     bool VeboxHdr3DlutNeeded(VP_EXECUTE_CAPS &caps);
414     // In some case, STMM should not be destroyed but not be used by current workload to maintain data,
415     // e.g. DI second field case.
416     // If queryAssignment == true, query whether STMM needed by current workload.
417     // If queryAssignment == false, query whether STMM needed to be allocated.
418     bool VeboxSTMMNeeded(VP_EXECUTE_CAPS& caps, bool queryAssignment);
419     virtual uint32_t GetHistogramSurfaceSize(VP_EXECUTE_CAPS& caps, uint32_t inputWidth, uint32_t inputHeight);
420     virtual uint32_t Get3DLutSize();
421     virtual Mos_MemPool GetHistStatMemType();
422     MOS_STATUS ReAllocateVeboxOutputSurface(VP_EXECUTE_CAPS& caps, VP_SURFACE *inputSurface, VP_SURFACE *outputSurface, bool &allocated);
423     MOS_STATUS ReAllocateVeboxDenoiseOutputSurface(VP_EXECUTE_CAPS& caps, VP_SURFACE *inputSurface, bool &allocated);
424     MOS_STATUS ReAllocateVeboxSTMMSurface(VP_EXECUTE_CAPS& caps, VP_SURFACE *inputSurface, bool &allocated);
425     void DestoryVeboxOutputSurface();
426     void DestoryVeboxDenoiseOutputSurface();
427     void DestoryVeboxSTMMSurface();
428     virtual MOS_STATUS AssignRenderResource(VP_EXECUTE_CAPS &caps, std::vector<VP_SURFACE *> &inputSurfaces, VP_SURFACE *outputSurface,
429         std::vector<VP_SURFACE *> &pastSurfaces, std::vector<VP_SURFACE *> &futureSurfaces, RESOURCE_ASSIGNMENT_HINT resHint, VP_SURFACE_SETTING &surfSetting);
430     virtual MOS_STATUS AssignFcResources(VP_EXECUTE_CAPS &caps, std::vector<VP_SURFACE *> &inputSurfaces, VP_SURFACE *outputSurface,
431         std::vector<VP_SURFACE *> &pastSurfaces, std::vector<VP_SURFACE *> &futureSurfaces,
432         RESOURCE_ASSIGNMENT_HINT resHint, VP_SURFACE_SETTING &surfSetting);
433     virtual MOS_STATUS AssignVeboxResourceForRender(VP_EXECUTE_CAPS &caps, VP_SURFACE *inputSurface, RESOURCE_ASSIGNMENT_HINT resHint, VP_SURFACE_SETTING &surfSetting);
434     virtual MOS_STATUS AssignVeboxResource(VP_EXECUTE_CAPS& caps, VP_SURFACE* inputSurface, VP_SURFACE* outputSurface, VP_SURFACE* pastSurface, VP_SURFACE* futureSurface,
435         RESOURCE_ASSIGNMENT_HINT resHint, VP_SURFACE_SETTING& surfSetting);
436 
437     //!
438     //! \brief    Vebox initialize STMM History
439     //! \details  Initialize STMM History surface
440     //! Description:
441     //!   This function is used by VEBox for initializing
442     //!   the STMM surface.  The STMM / Denoise history is a custom surface used
443     //!   for both input and output. Each cache line contains data for 4 4x4s.
444     //!   The STMM for each 4x4 is 8 bytes, while the denoise history is 1 byte
445     //!   and the chroma denoise history is 1 byte for each U and V.
446     //!   Byte    Data\n
447     //!   0       STMM for 2 luma values at luma Y=0, X=0 to 1\n
448     //!   1       STMM for 2 luma values at luma Y=0, X=2 to 3\n
449     //!   2       Luma Denoise History for 4x4 at 0,0\n
450     //!   3       Not Used\n
451     //!   4-5     STMM for luma from X=4 to 7\n
452     //!   6       Luma Denoise History for 4x4 at 0,4\n
453     //!   7       Not Used\n
454     //!   8-15    Repeat for 4x4s at 0,8 and 0,12\n
455     //!   16      STMM for 2 luma values at luma Y=1,X=0 to 1\n
456     //!   17      STMM for 2 luma values at luma Y=1, X=2 to 3\n
457     //!   18      U Chroma Denoise History\n
458     //!   19      Not Used\n
459     //!   20-31   Repeat for 3 4x4s at 1,4, 1,8 and 1,12\n
460     //!   32      STMM for 2 luma values at luma Y=2,X=0 to 1\n
461     //!   33      STMM for 2 luma values at luma Y=2, X=2 to 3\n
462     //!   34      V Chroma Denoise History\n
463     //!   35      Not Used\n
464     //!   36-47   Repeat for 3 4x4s at 2,4, 2,8 and 2,12\n
465     //!   48      STMM for 2 luma values at luma Y=3,X=0 to 1\n
466     //!   49      STMM for 2 luma values at luma Y=3, X=2 to 3\n
467     //!   50-51   Not Used\n
468     //!   36-47   Repeat for 3 4x4s at 3,4, 3,8 and 3,12\n
469     //! \param    [in] stmmSurface
470     //!           STMM surface
471     //! \return   MOS_STATUS
472     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
473     //!
474     MOS_STATUS VeboxInitSTMMHistory(MOS_SURFACE *stmmSurface);
475 
476     void InitSurfaceConfigMap();
AddSurfaceConfig(bool _b64DI,bool _sfcEnable,bool _sameSample,bool _outOfBound,bool _pastRefAvailable,bool _futureRefAvailable,bool _firstDiField,VEBOX_SURFACE_ID _currentInputSurface,VEBOX_SURFACE_ID _pastInputSurface,VEBOX_SURFACE_ID _currentOutputSurface,VEBOX_SURFACE_ID _pastOutputSurface)477     void AddSurfaceConfig(bool _b64DI, bool _sfcEnable, bool _sameSample, bool _outOfBound, bool _pastRefAvailable, bool _futureRefAvailable, bool _firstDiField,
478         VEBOX_SURFACE_ID _currentInputSurface, VEBOX_SURFACE_ID _pastInputSurface, VEBOX_SURFACE_ID _currentOutputSurface, VEBOX_SURFACE_ID _pastOutputSurface)
479     {
480         m_veboxSurfaceConfigMap.insert(std::make_pair(VEBOX_SURFACES_CONFIG(_b64DI, _sfcEnable, _sameSample, _outOfBound, _pastRefAvailable, _futureRefAvailable, _firstDiField).value, VEBOX_SURFACES(_currentInputSurface, _pastInputSurface, _currentOutputSurface, _pastOutputSurface)));
481     }
482 
483     virtual MOS_STATUS Get3DLutOutputColorAndFormat(VPHAL_CSPACE &colorSpace, MOS_FORMAT &format, SwFilterPipe &executedFilters);
484     MOS_STATUS GetIntermediaOutputSurfaceParams(VP_EXECUTE_CAPS& caps, VP_SURFACE_PARAMS &params, SwFilterPipe &executedFilters);
485     MOS_STATUS         GetIntermediaOutputSurfaceColorAndFormat(VP_EXECUTE_CAPS &caps, SwFilterPipe &executedFilters, MOS_FORMAT &format, VPHAL_CSPACE &colorSpace);
486     MOS_STATUS AssignIntermediaSurface(VP_EXECUTE_CAPS& caps, SwFilterPipe &executedFilters);
487 
IsDeferredResourceDestroyNeeded()488     bool IsDeferredResourceDestroyNeeded()
489     {
490         // For 0 == m_currentPipeIndex case, the surface being destroyed should not
491         // be used in current DDI call any more. So no need deferred destroyed.
492         return m_currentPipeIndex > 0;
493     }
494 
495     void CleanTempSurfaces();
496     VP_SURFACE* GetCopyInstOfExtSurface(VP_SURFACE* surf);
497 
498     MOS_STATUS GetFormatForFcIntermediaSurface(MOS_FORMAT& format, MEDIA_CSPACE &colorSpace, SwFilterPipe &featurePipe);
499     MOS_STATUS GetFcIntermediateSurfaceForOutput(VP_SURFACE *&intermediaSurface, SwFilterPipe &executedFilters);
500 
501 protected:
502     MOS_INTERFACE                &m_osInterface;
503     VpAllocator                  &m_allocator;
504     VphalFeatureReport           &m_reporting;
505     vp::VpPlatformInterface      &m_vpPlatformInterface;
506 
507     // Vebox Resource
508     VP_SURFACE* m_veboxDenoiseOutput[VP_NUM_DN_SURFACES]     = {};            //!< Vebox Denoise output surface
509     VP_SURFACE* m_veboxOutput[VP_MAX_NUM_VEBOX_SURFACES]     = {};            //!< Vebox output surface, can be reuse for DI usages
510     VP_SURFACE* m_veboxSTMMSurface[VP_NUM_STMM_SURFACES]     = {};            //!< Vebox STMM input/output surface
511     VP_SURFACE *m_veboxStatisticsSurface                     = nullptr;       //!< Statistics Surface for VEBOX
512     uint32_t    m_dwVeboxPerBlockStatisticsWidth             = 0;
513     uint32_t    m_dwVeboxPerBlockStatisticsHeight            = 0;
514     VP_SURFACE *m_veboxRgbHistogram                          = nullptr;       //!< RGB Histogram surface for Vebox
515     VP_SURFACE *m_veboxDNTempSurface                         = nullptr;       //!< Vebox DN Update kernels temp surface
516     VP_SURFACE *m_veboxDNSpatialConfigSurface                = nullptr;       //!< Spatial Attributes Configuration Surface for DN kernel
517     VP_SURFACE *m_vebox3DLookUpTables                        = nullptr;
518     uint32_t    m_currentDnOutput                            = 0;
519     uint32_t    m_currentStmmIndex                           = 0;
520     uint32_t    m_veboxOutputCount                           = 2;             //!< PE on: 4 used. PE off: 2 used
521     bool        m_pastDnOutputValid                          = false;         //!< true if vebox DN output of previous frame valid.
522     VP_FRAME_IDS m_currentFrameIds                           = {};
523     VP_FRAME_IDS m_pastFrameIds                              = {};
524     bool         m_firstFrame                                = true;
525     bool         m_sameSamples                               = false;
526     bool         m_outOfBound                                = false;
527     RECT         m_maxSrcRect                                = {};
528     VEBOX_SURFACE_CONFIG_MAP m_veboxSurfaceConfigMap;
529     bool        m_isHistogramReallocated                     = false;
530     bool        m_isCurrentHistogramInuse                    = false;
531     bool        m_isPastHistogramValid                       = false;
532     uint32_t    m_imageWidthOfPastHistogram                  = 0;
533     uint32_t    m_imageHeightOfPastHistogram                 = 0;
534     uint32_t    m_imageWidthOfCurrentHistogram               = 0;
535     uint32_t    m_imageHeightOfCurrentHistogram              = 0;
536     bool        m_isFcIntermediateSurfacePrepared            = false;
537     VP_SURFACE *m_fcIntermediateSurface[VP_NUM_FC_INTERMEDIA_SURFACES] = {}; // Ping-pong surface for multi-layer composition.
538     std::vector<VP_SURFACE *> m_intermediaSurfaces;
539     std::map<uint64_t, VP_SURFACE *> m_tempSurface; // allocation handle and surface pointer pair.
540     // Pipe index for one DDI call.
541     uint32_t    m_currentPipeIndex                           = 0;
542 
543     VP_SURFACE *m_veboxLaceInputSurface                       = nullptr;
544     VP_SURFACE *m_veboxAggregatedHistogramSurface             = nullptr;       //!< VEBOX 1D LUT surface for Vebox Gen12
545     VP_SURFACE *m_veboxFrameHistogramSurface                  = nullptr;       //!< VEBOX 1D LUT surface for Vebox Gen12
546     VP_SURFACE *m_veboxStdStatisticsSurface                   = nullptr;       //!< VEBOX 1D LUT surface for Vebox Gen12
547     VP_SURFACE *m_veboxPwlfSurface[VP_NUM_LACE_PWLF_SURFACES] = {};            //!< VEBOX 1D LUT surface for Vebox Gen12
548     VP_SURFACE *m_veboxWeitCoefSurface                        = nullptr;       //!< VEBOX 1D LUT surface for Vebox Gen12
549     VP_SURFACE *m_veboxGlobalToneMappingCurveLUTSurface       = nullptr;       //!< VEBOX 1D LUT surface for Vebox Gen12
550 
551     // Fc Resource
552     VP_SURFACE *m_cmfcCoeff                                   = nullptr;
553 
554 MEDIA_CLASS_DEFINE_END(VpResourceManager)
555 };
556 }
557 #endif // _VP_RESOURCE_MANAGER_H__
558