1 /*
2 * Copyright (c) 2011-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_mpeg2_g11.h
24 //! \brief    Defines the decode interface extension for MPEG2.
25 //! \details  Defines all types, macros, and functions required by CodecHal for MPEG2 decoding. Definitions are not externally facing.
26 //!
27 
28 #ifndef __CODECHAL_DECODER_MPEG2_G11_H__
29 #define __CODECHAL_DECODER_MPEG2_G11_H__
30 
31 #include "codechal_decode_mpeg2.h"
32 #include "codechal_decode_singlepipe_virtualengine.h"
33 
34 //!
35 //! \class CodechalDecodeMpeg2G11
36 //! \brief This class defines the member fields, functions etc used by GEN11 MPEG2 decoder.
37 //!
38 class CodechalDecodeMpeg2G11 : public CodechalDecodeMpeg2
39 {
40 public:
41 
42     //!
43     //! \brief  Constructor
44     //! \param    [in] hwInterface
45     //!           Hardware interface
46     //! \param    [in] debugInterface
47     //!           Debug interface
48     //! \param    [in] standardInfo
49     //!           The information of decode standard for this instance
50     //!
51     CodechalDecodeMpeg2G11(
52         CodechalHwInterface   *hwInterface,
53         CodechalDebugInterface* debugInterface,
54         PCODECHAL_STANDARD_INFO standardInfo);
55 
56     //!
57     //! \brief    Copy constructor
58     //!
59     CodechalDecodeMpeg2G11(const CodechalDecodeMpeg2G11&) = delete;
60 
61     //!
62     //! \brief    Copy assignment operator
63     //!
64     CodechalDecodeMpeg2G11& operator=(const CodechalDecodeMpeg2G11&) = delete;
65 
66     //!
67     //! \brief    Destructor
68     //!
69     ~CodechalDecodeMpeg2G11 ();
70 
71     //!
72     //! \brief    Allocate and initialize MPEG2 decoder standard
73     //!           Pointer to CodechalSetting
74     //! \return   MOS_STATUS
75     //!           MOS_STATUS_SUCCESS if success, else fail reason
76     //!
77     MOS_STATUS  AllocateStandard (
78         CodechalSetting *          settings) override;
79 
80     //!
81     //! \brief  Set states for each frame to prepare for GEN11 MPEG2 decode
82     //! \return MOS_STATUS
83     //!         MOS_STATUS_SUCCESS if success, else fail reason
84     //!
85     MOS_STATUS  SetFrameStates () override;
86 
87     //!
88     //! \brief    MPEG2 decoder state level function
89     //! \details  State level function for GEN11 MPEG2 decoder
90     //!
91     //! \return   MOS_STATUS
92     //!           MOS_STATUS_SUCCESS if success, else fail reason
93     //!
94     MOS_STATUS  DecodeStateLevel () override;
95 
96     //!
97     //! \brief    MPEG2 decoder slice level function
98     //! \details  Primitive level function in VLD mode for GEN specific MPEG2 decoder
99     //!
100     //! \return   MOS_STATUS
101     //!           MOS_STATUS_SUCCESS if success, else fail reason
102     //!
103     MOS_STATUS          SliceLevel() override;
104 
105 protected:
106 
107     //!
108     //! \brief  Set up params for gpu context creation
109     //! \return   MOS_STATUS
110     //!           MOS_STATUS_SUCCESS if success, else fail reason
111     //!
112     MOS_STATUS SetGpuCtxCreatOption(CodechalSetting * settings) override;
113 
114     PCODECHAL_DECODE_SINGLEPIPE_VIRTUALENGINE_STATE m_veState = nullptr;  //!< single pipe virtual engine state
115 };
116 
117 #endif  // __CODECHAL_DECODER_MPEG2_G11_H__
118