| 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_avc_g12.h |
| 24 |
//! \brief This modules implements Render interface layer for AVC decoding to be used on all operating systems/DDIs, across CODECHAL components. |
| 25 |
//! |
| 26 |
//! |
| 27 |
//! \file codechal_decode_avc_g12.h |
| 28 |
//! \brief Defines the decode interface extension for AVC. |
| 29 |
//! \details Defines all types, macros, and functions required by CodecHal for AVC decoding. |
| 30 |
//! Definitions are not externally facing. |
| 31 |
//! |
| 32 |
|
| 33 |
#ifndef __CODECHAL_DECODER_AVC_G12_H__ |
| 34 |
#define __CODECHAL_DECODER_AVC_G12_H__ |
| 35 |
|
| 36 |
#include "codechal_decode_avc.h" |
| 37 |
#include "codechal_decode_singlepipe_virtualengine.h" |
| 38 |
#include "codechal_decode_sfc_avc_g12.h" |
| 39 |
|
| 40 |
//! |
| 41 |
//! \class CodechalDecodeAvcG12 |
| 42 |
//! \brief This class defines the member fields, functions etc used by AVC decoder. |
| 43 |
//! |
| 44 |
class CodechalDecodeAvcG12 : public CodechalDecodeAvc |
| 45 |
{ |
| 46 |
public: |
| 47 |
//! |
| 48 |
//! \brief Constructor |
| 49 |
//! \param [in] hwInterface |
| 50 |
//! Hardware interface |
| 51 |
//! \param [in] debugInterface |
| 52 |
//! Debug interface |
| 53 |
//! \param [in] standardInfo |
| 54 |
//! The information of decode standard for this instance |
| 55 |
//! |
| 56 |
CodechalDecodeAvcG12( |
| 57 |
CodechalHwInterface *hwInterface, |
| 58 |
CodechalDebugInterface* debugInterface, |
| 59 |
PCODECHAL_STANDARD_INFO standardInfo); |
| 60 |
|
| 61 |
//! |
| 62 |
//! \brief Copy constructor |
| 63 |
//! |
| 64 |
CodechalDecodeAvcG12(const CodechalDecodeAvcG12&) = delete; |
| 65 |
|
| 66 |
//! |
| 67 |
//! \brief Copy assignment operator |
| 68 |
//! |
| 69 |
CodechalDecodeAvcG12& operator=(const CodechalDecodeAvcG12&) = delete; |
| 70 |
|
| 71 |
//! |
| 72 |
//! \brief Destructor |
| 73 |
//! |
| 74 |
~CodechalDecodeAvcG12(); |
| 75 |
|
| 76 |
//! |
| 77 |
//! \brief Allocate and initialize AVC decoder standard |
| 78 |
//! \param [in] settings |
| 79 |
//! Pointer to CodechalSetting |
| 80 |
//! \return MOS_STATUS |
| 81 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 82 |
//! |
| 83 |
MOS_STATUS AllocateStandard( |
| 84 |
CodechalSetting * settings) override; |
| 85 |
|
| 86 |
//! |
| 87 |
//! \brief Set states for each frame to prepare for GEN11 AVC decode |
| 88 |
//! \return MOS_STATUS |
| 89 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 90 |
//! |
| 91 |
MOS_STATUS SetFrameStates() override; |
| 92 |
|
| 93 |
//! |
| 94 |
//! \brief AVC decoder state level function |
| 95 |
//! \details State level function for GEN11 AVC decoder |
| 96 |
//! |
| 97 |
//! \return MOS_STATUS |
| 98 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 99 |
//! |
| 100 |
MOS_STATUS DecodeStateLevel() override; |
| 101 |
|
| 102 |
//! |
| 103 |
//! \brief AVC decoder primitive level function |
| 104 |
//! \details Primitive level function for GEN specific AVC decoder |
| 105 |
//! |
| 106 |
//! \return MOS_STATUS |
| 107 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 108 |
//! |
| 109 |
MOS_STATUS DecodePrimitiveLevel() override; |
| 110 |
|
| 111 |
//! |
| 112 |
//! \brief Constrcut Mono Picture |
| 113 |
//! \details Constrcut Mono Picture in AVC decode driver, Write 0x80 in the chroma plane for Monochrome clips |
| 114 |
//! \param [in] surface |
| 115 |
//! Pointer to the decode output surface |
| 116 |
//! \return MOS_STATUS |
| 117 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 118 |
//! |
| 119 |
MOS_STATUS FormatAvcMonoPicture(PMOS_SURFACE surface) override; |
| 120 |
|
| 121 |
protected: |
| 122 |
MOS_STATUS InitMmcState() override; |
| 123 |
|
| 124 |
MOS_STATUS InitSfcState() override; |
| 125 |
|
| 126 |
MOS_STATUS SetGpuCtxCreatOption(CodechalSetting *settings) override; |
| 127 |
void CalcRequestedSpace( |
| 128 |
uint32_t &requestedSize, |
| 129 |
uint32_t &additionalSizeNeeded, |
| 130 |
uint32_t &requestedPatchListSize) override; |
| 131 |
|
| 132 |
//! |
| 133 |
//! \brief Utility function to allocate internal histogram surface |
| 134 |
//! |
| 135 |
//! \return MOS_STATUS |
| 136 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 137 |
//! |
| 138 |
virtual MOS_STATUS AllocateHistogramSurface(); |
| 139 |
|
| 140 |
//! |
| 141 |
//! \brief Detect conformance conflict and do error concealment |
| 142 |
//! \return MOS_STATUS |
| 143 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 144 |
//! |
| 145 |
MOS_STATUS ErrorDetectAndConceal(); |
| 146 |
|
| 147 |
PCODECHAL_DECODE_SINGLEPIPE_VIRTUALENGINE_STATE m_veState; //!< single pipe virtual engine state |
| 148 |
|
| 149 |
PMOS_SURFACE m_histogramSurface = nullptr; //!< Internal histogram buffer |
| 150 |
|
| 151 |
//! \Huc state level command buffer size is required |
| 152 |
uint32_t m_HucStateCmdBufferSizeNeeded = 0; |
| 153 |
//! \Huc state level patch list size is required |
| 154 |
uint32_t m_HucPatchListSizeNeeded = 0; |
| 155 |
}; |
| 156 |
|
| 157 |
#endif // __CODECHAL_DECODER_AVC_G12_H__ |