1 /*
2 * Copyright (c) 2017, 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     codechal_decode_histogram.h
24 //! \brief    defines the decode histogram.
25 //! \details  decode histogram.
26 //!
27 #ifndef __CODECHAL_DECODE_HISTOGRAM_G12_H__
28 #define __CODECHAL_DECODE_HISTOGRAM_G12_H__
29 #include "codechal_decode_histogram.h"
30 
31 //!
32 //! \class   CodechalDecodeHistogram
33 //! \brief   Decode histogram base class
34 //! \details This class defines the base class for decode histogram, it includes
35 //!          common member fields, functions, interfaces etc. Specific definitions,
36 //!          features should be put into their corresponding classes. To create a
37 //!          decode histogram instance, client needs to new the instance in media interfaces
38 //!
39 class CodechalDecodeHistogramG12 : public CodechalDecodeHistogram
40 {
41 public:
42     //!
43     //! \brief  Decode histogram constructor
44     //! \param  [in] hwInterface
45     //!         Hardware interface
46     //! \param  [in] osInterface
47     //!         OS interface
48     //! \return No return
49     //!
50     CodechalDecodeHistogramG12(
51         CodechalHwInterface *hwInterface,
52         MOS_INTERFACE *osInterface);
53     //!
54     //! \brief  Decode histogram destructor
55     //!
56     virtual ~CodechalDecodeHistogramG12();
57 
58     //!
59     //! \brief  Set source surface to hold internal histogram buffer
60     //! \return PMOS_SURFACE
61     //!
62     virtual void SetSrcHistogramSurface(PMOS_SURFACE refSurface);
63 
64     //!
65     //! \brief  Render and output the histogram
66     //! \param  [in] codechalDecoder
67     //!         Pointer of codechal decoder
68     //! \param  [in] inputSurface
69     //!         Input surface to generate histogram
70     //! \return MOS_STATUS
71     //!         MOS_STATUS_SUCCESS if success, else fail reason
72     //!
73     virtual MOS_STATUS RenderHistogram(
74         CodechalDecode *codechalDecoder,
75         MOS_SURFACE *inputSurface);
76 
77 protected:
78     CodechalDecode      *m_decoder                      = nullptr;  //!< Pointer of codechal deocder
79     MOS_INTERFACE       *m_osInterface                  = nullptr;  //!< Pointer of OS interface
80     CodechalHwInterface *m_hwInterface                  = nullptr;  //!< Pointer of hardware interface
81     PMOS_SURFACE         m_inputSurface                 = nullptr;  //!< Pointer of input surface
82     uint8_t              m_histogramComponent           = 0;        //!< Histogram component
83 };
84 
85 #endif