1 /*
2 * Copyright (c) 2017-2019, 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_vp8_g12.h
24 //! \brief    Defines the decode interface extension for VP8.
25 //! \details  Defines all types, macros, and functions required by CodecHal for VP8 decoding. Definitions are not externally facing.
26 //!
27 
28 #ifndef __CODECHAL_DECODER_VP8_G12_H__
29 #define __CODECHAL_DECODER_VP8_G12_H__
30 
31 #include "codechal_decode_vp8.h"
32 #include "codechal_decode_singlepipe_virtualengine.h"
33 
34 //!
35 //! \class CodechalDecodeVp8G12
36 //! \brief This class defines the member fields, functions etc used by GEN11 VP8 decoder.
37 //!
38 class CodechalDecodeVp8G12 : public CodechalDecodeVp8
39 {
40 public:
41     //!
42     //! \brief  Constructor
43     //! \param    [in] hwInterface
44     //!           Hardware interface
45     //! \param    [in] debugInterface
46     //!           Debug interface
47     //! \param    [in] standardInfo
48     //!           The information of decode standard for this instance
49     //!
50     CodechalDecodeVp8G12(
51         CodechalHwInterface   *hwInterface,
52         CodechalDebugInterface* debugInterface,
53         PCODECHAL_STANDARD_INFO standardInfo);
54 
55     //!
56     //! \brief    Copy constructor
57     //!
58     CodechalDecodeVp8G12(const CodechalDecodeVp8G12&) = delete;
59 
60     //!
61     //! \brief    Copy assignment operator
62     //!
63     CodechalDecodeVp8G12& operator=(const CodechalDecodeVp8G12&) = delete;
64 
65     //!
66     //! \brief    Destructor
67     //!
68     ~CodechalDecodeVp8G12();
69 
70     MOS_STATUS  AllocateStandard (
71         CodechalSetting *          settings) override;
72 
73     //!
74     //! \brief  Set states for each frame to prepare for GEN12 VP8 decode
75     //! \return MOS_STATUS
76     //!         MOS_STATUS_SUCCESS if success, else fail reason
77     //!
78     MOS_STATUS  SetFrameStates() override;
79 
80     MOS_STATUS  DecodeStateLevel() override;
81 
82     MOS_STATUS  DecodePrimitiveLevel() override;
83 
84     MOS_STATUS InitMmcState() override;
85 
86 private:
87     PCODECHAL_DECODE_SINGLEPIPE_VIRTUALENGINE_STATE m_veState = nullptr;  //!< single pipe virtual engine state
88 };
89 
90 #endif  // __CODECHAL_DECODER_VP8_G12_H__
91