1 /* 2 * Copyright (c) 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 //! 24 //! \file decode_hevc_phase_back_end.h 25 //! \brief Defines the common interface for hevc decode back end phase. 26 //! 27 28 #ifndef __DECODE_HEVC_PHASE_BACK_END_H__ 29 #define __DECODE_HEVC_PHASE_BACK_END_H__ 30 31 #include "decode_hevc_phase.h" 32 33 namespace decode 34 { 35 36 class HevcPhaseBackEnd : public HevcPhase 37 { 38 public: 39 //! 40 //! \brief HEVC decode back end phase constructor 41 //! \param [in] pipeline 42 //! Decode pipeline 43 //! \param [in] params 44 //! Decode scalability params 45 //! \param [in] scalabOption 46 //! Decode scalability option 47 //! \param [in] phaseManager 48 //! Decode phase manager 49 //! HevcPhaseBackEnd(DecodePipeline & pipeline,DecodeScalabilityOption & scalabOption)50 HevcPhaseBackEnd(DecodePipeline &pipeline, DecodeScalabilityOption &scalabOption) 51 : HevcPhase(pipeline, scalabOption) 52 {} 53 54 //! 55 //! \brief HEVC decode back end phase destructor 56 //! ~HevcPhaseBackEnd()57 virtual ~HevcPhaseBackEnd() {}; 58 59 virtual uint32_t GetCmdBufIndex() override; 60 virtual uint32_t GetSubmissionType() override; 61 virtual MOS_STATUS GetMode(uint32_t &pipeWorkMode, uint32_t &multiEngineMode) override; 62 virtual uint32_t GetPktId() override; 63 virtual bool ImmediateSubmit() override; 64 virtual bool RequiresContextSwitch() override; 65 66 private: IsFirstBackEnd()67 inline bool IsFirstBackEnd() 68 { 69 return (GetPipe() == 0); 70 } IsLastBackEnd()71 inline bool IsLastBackEnd() 72 { 73 return ((GetPipe() + 1) == m_scalabOption.GetNumPipe()); 74 } 75 76 MEDIA_CLASS_DEFINE_END(decode__HevcPhaseBackEnd) 77 }; 78 79 } 80 #endif // !__DECODE_HEVC_PHASE_BACK_END_H__ 81 82