1 /*
2 * Copyright (c) 2015-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 //!
24 //! \file     codechal_decode_vc1_g11.h
25 //! \brief    Defines the decode interface extension for Gen11 VC1.
26 //! \details  Defines all types, macros, and functions required by CodecHal for Gen11 VC1 decoding.
27 //!           Definitions are not externally facing.
28 //!
29 
30 #ifndef __CODECHAL_DECODER_VC1_G11_H__
31 #define __CODECHAL_DECODER_VC1_G11_H__
32 
33 #include "codechal_decode_vc1.h"
34 #include "codechal_decode_singlepipe_virtualengine.h"
35 
36 //!
37 //! \class CodechalDecodeVc1G11
38 //! \brief This class defines the member fields, functions etc used by Gen11 VC1 decoder.
39 //!
40 class CodechalDecodeVc1G11 : public CodechalDecodeVc1
41 {
42 public:
43     //!
44     //! \brief  Constructor
45     //! \param    [in] hwInterface
46     //!           Hardware interface
47     //! \param    [in] debugInterface
48     //!           Debug interface
49     //! \param    [in] standardInfo
50     //!           The information of decode standard for this instance
51     //!
52     CodechalDecodeVc1G11(
53         CodechalHwInterface   *hwInterface,
54         CodechalDebugInterface* debugInterface,
55         PCODECHAL_STANDARD_INFO standardInfo);
56 
57     //!
58     //! \brief    Copy constructor
59     //!
60     CodechalDecodeVc1G11(const CodechalDecodeVc1G11&) = delete;
61 
62     //!
63     //! \brief    Copy assignment operator
64     //!
65     CodechalDecodeVc1G11& operator=(const CodechalDecodeVc1G11&) = delete;
66 
67     ~CodechalDecodeVc1G11();
68 
69     MOS_STATUS AllocateStandard(
70         CodechalSetting *          settings) override;
71 
72     //!
73     //! \brief  Set states for each frame to prepare for GEN11 VC1 decode
74     //! \return MOS_STATUS
75     //!         MOS_STATUS_SUCCESS if success, else fail reason
76     //!
77     MOS_STATUS SetFrameStates() override;
78 
79     MOS_STATUS DecodeStateLevel() override;
80 
81     MOS_STATUS DecodePrimitiveLevelVLD() override;
82 
83     MOS_STATUS DecodePrimitiveLevelIT() override;
84 
85 protected:
86     MOS_STATUS HandleSkipFrame() override;
87 
88     MOS_STATUS PerformVc1Olp();
89 
90     //!
91     //! \brief  Set up params for gpu context creation
92     //! \return   MOS_STATUS
93     //!           MOS_STATUS_SUCCESS if success, else fail reason
94     //!
95     MOS_STATUS SetGpuCtxCreatOption(CodechalSetting * settings) override;
96 
97     PCODECHAL_DECODE_SINGLEPIPE_VIRTUALENGINE_STATE m_veState = nullptr;  //!< Sinlge pipe VirtualEngine
98 };
99 
100 #endif  // __CODECHAL_DECODER_VC1_G11_H__
101