| 1 | /* |
| 2 | * Copyright (c) 2012-2020, 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_vp9_g11.h |
| 24 | //! \brief Defines the decode interface extension for Gen11 VP9. |
| 25 | //! \details Defines all types, macros, and functions required by CodecHal for Gen11 VP9 decoding. |
| 26 | //! Definitions are not externally facing. |
| 27 | //! |
| 28 | |
| 29 | #ifndef __CODECHAL_DECODE_VP9_G11_H__ |
| 30 | #define __CODECHAL_DECODE_VP9_G11_H__ |
| 31 | |
| 32 | #include "codechal_decode_vp9.h" |
| 33 | #include "codechal_decode_scalability.h" |
| 34 | #include "codechal_decode_singlepipe_virtualengine.h" |
| 35 | #include "mhw_vdbox_g11_X.h" |
| 36 | |
| 37 | //! |
| 38 | //! \class CodechalDecodeVp9G11 |
| 39 | //! \brief This class defines the member fields, functions etc used by gen11 VP9 decoder. |
| 40 | //! |
| 41 | class CodechalDecodeVp9G11 : public CodechalDecodeVp9 |
| 42 | { |
| 43 | public: |
| 44 | //! |
| 45 | //! \brief Constructor |
| 46 | //! \param [in] hwInterface |
| 47 | //! Hardware interface |
| 48 | //! \param [in] debugInterface |
| 49 | //! Debug interface |
| 50 | //! \param [in] standardInfo |
| 51 | //! The information of decode standard for this instance |
| 52 | //! |
| 53 | CodechalDecodeVp9G11( |
| 54 | CodechalHwInterface *hwInterface, |
| 55 | CodechalDebugInterface* debugInterface, |
| 56 | PCODECHAL_STANDARD_INFO standardInfo); |
| 57 | |
| 58 | //! |
| 59 | //! \brief Copy constructor |
| 60 | //! |
| 61 | CodechalDecodeVp9G11(const CodechalDecodeVp9G11&) = delete; |
| 62 | |
| 63 | //! |
| 64 | //! \brief Copy assignment operator |
| 65 | //! |
| 66 | CodechalDecodeVp9G11& operator=(const CodechalDecodeVp9G11&) = delete; |
| 67 | |
| 68 | ~CodechalDecodeVp9G11(); |
| 69 | |
| 70 | MOS_STATUS AllocateStandard ( |
| 71 | CodechalSetting * settings) override; |
| 72 | |
| 73 | MOS_STATUS DecodeStateLevel () override; |
| 74 | |
| 75 | MOS_STATUS DecodePrimitiveLevel () override; |
| 76 | |
| 77 | MOS_STATUS InitializeDecodeMode () override; |
| 78 | |
| 79 | MOS_STATUS AllocateResourcesVariableSizes() override; |
| 80 | |
| 81 | MOS_STATUS DetermineDecodePhase() override; |
| 82 | |
| 83 | protected: |
| 84 | //! |
| 85 | //! \brief End status report for GEN specific decoder |
| 86 | //! \param [in] decodeStatusReport |
| 87 | //! Decode status |
| 88 | //! \param [out] cmdBuffer |
| 89 | //! Pointer to command buffer |
| 90 | //! \return MOS_STATUS |
| 91 | //! MOS_STATUS_SUCCESS if success, else fail reason |
| 92 | //! |
| 93 | MOS_STATUS EndStatusReport( |
| 94 | CodechalDecodeStatusReport &decodeStatusReport, |
| 95 | PMOS_COMMAND_BUFFER cmdBuffer) override; |
| 96 | |
| 97 | //! |
| 98 | //! \brief End status report for GEN specific decoder |
| 99 | // \details End status report for GEN specific decoder to read HCP status report at end of FE |
| 100 | //! \param [out] cmdBuffer |
| 101 | //! Pointer to command buffer |
| 102 | //! \return MOS_STATUS |
| 103 | //! MOS_STATUS_SUCCESS if success, else fail reason |
| 104 | //! |
| 105 | MOS_STATUS EndStatusReportForFE( |
| 106 | PMOS_COMMAND_BUFFER cmdBuffer); |
| 107 | |
| 108 | //! |
| 109 | //! \brief Set And Populate VE Hint parameters |
| 110 | //! \details Set Virtual Engine hint parameter and populate it to primary cmd buffer attributes |
| 111 | //! \param [in] primCmdBuf |
| 112 | //! Pointer to primary cmd buffer |
| 113 | //! \return MOS_STATUS |
| 114 | //! MOS_STATUS_SUCCESS if success, else fail reason |
| 115 | //! |
| 116 | MOS_STATUS SetAndPopulateVEHintParams( |
| 117 | PMOS_COMMAND_BUFFER primCmdBuf); |
| 118 | |
| 119 | //! |
| 120 | //! \brief Determin if need to send prolog with frame tracking |
| 121 | //! \param [in] sendPrologWithFrameTracking |
| 122 | //! Pointer to bool type flag |
| 123 | //! \return MOS_STATUS |
| 124 | //! MOS_STATUS_SUCCESS if success, else fail reason |
| 125 | //! |
| 126 | MOS_STATUS DetermineSendProlgwithFrmTracking( |
| 127 | bool *sendPrologWithFrameTracking); |
| 128 | |
| 129 | //! |
| 130 | //! \brief Set up params for gpu context creation |
| 131 | //! \return MOS_STATUS |
| 132 | //! MOS_STATUS_SUCCESS if success, else fail reason |
| 133 | //! |
| 134 | MOS_STATUS SetGpuCtxCreatOption(CodechalSetting * settings) override; |
| 135 | |
| 136 | private: |
| 137 | //! |
| 138 | //! \brief The virtual function for decode standard to override the requested space size |
| 139 | //! \param [in] requestedSize |
| 140 | //! The intial request size computed by picture level and slice level |
| 141 | //! \return The final requested space size |
| 142 | //! |
| 143 | uint32_t RequestedSpaceSize(uint32_t requestedSize) override; |
| 144 | |
| 145 | //! |
| 146 | //! \brief The virtual function for decode standard to override the extra requested space size |
| 147 | //! \param [in] requestedSize |
| 148 | //! The intial request size computed by picture level and slice level |
| 149 | //! \param [in] additionalSizeNeeded |
| 150 | //! The additional request size for command buffer |
| 151 | //! \return The extra requested space size |
| 152 | //! |
| 153 | virtual MOS_STATUS VerifyExtraSpace( |
| 154 | uint32_t requestedSize, |
| 155 | uint32_t additionalSizeNeeded) override; |
| 156 | |
| 157 | protected: |
| 158 | uint32_t m_frameSizeMaxAlloced; //!< Max Frame size used for buffer allocation in past frames |
| 159 | |
| 160 | PCODECHAL_DECODE_SINGLEPIPE_VIRTUALENGINE_STATE m_sinlgePipeVeState; //!< single pipe virtual engine state |
| 161 | PCODECHAL_DECODE_SCALABILITY_STATE m_scalabilityState; //!< Scalability state |
| 162 | }; |
| 163 | #endif // __CODECHAL_DECODE_VP9_G11_H__ |
| 164 |