1 /* 2 * Copyright (c) 2018, 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 encode_hevc_vdenc_roi.h 24 //! \brief Defines of the ROI feature of HEVC VDENC 25 //! 26 27 #ifndef __CODECHAL_HEVC_VDENC_ROI_NATIVE_H__ 28 #define __CODECHAL_HEVC_VDENC_ROI_NATIVE_H__ 29 30 #include "encode_hevc_vdenc_roi_strategy.h" 31 32 namespace encode 33 { 34 35 class NativeROI : public RoiStrategy 36 { 37 public: NativeROI(EncodeAllocator * allocator,MediaFeatureManager * featureManager,PMOS_INTERFACE osInterface)38 NativeROI(EncodeAllocator *allocator, MediaFeatureManager *featureManager, PMOS_INTERFACE osInterface) : 39 RoiStrategy(allocator, featureManager, osInterface) 40 { 41 42 } 43 ~NativeROI()44 virtual ~NativeROI() {} 45 46 //! 47 //! \brief Prepare parameters 48 //! 49 //! \param [in] hevcSeqParams 50 //! pointer of sequence parameters 51 //! \param [in] hevcPicParams 52 //! pointer of picture parameters 53 //! \param [in] hevcSlcParams 54 //! pointer of slice parameters 55 //! \return MOS_STATUS 56 //! MOS_STATUS_SUCCESS if success, else fail reason 57 //! 58 virtual MOS_STATUS PrepareParams( 59 SeqParams *hevcSeqParams, 60 PicParams *hevcPicParams, 61 SlcParams *hevcSlcParams) override; 62 63 protected: 64 //! 65 //! \brief Set the ROI ctrol mode(Native/ForceQP) 66 //! 67 //! \param [in] roiCtrl 68 //! ROI control 69 //! \param [in] forceQp 70 //! force QP value 71 //! \param [out] streaminDataParams 72 //! Streamin data parameters 73 //! 74 //! \return void 75 //! 76 virtual void SetRoiCtrlMode( 77 uint32_t lcuIndex, 78 uint32_t regionIndex, 79 StreamInParams &streaminParams) override; 80 81 //! 82 //! \brief Set ROI Control/Force QP Data per LCU 83 //! 84 //! \param [in] streaminDataParams 85 //! Streamin data parameters 86 //! \param [out] data 87 //! Streamin data 88 //! 89 //! \return void 90 //! 91 virtual void SetQpRoiCtrlPerLcu( 92 StreamInParams *streaminParams, 93 HevcVdencStreamInState *data) override; 94 95 MEDIA_CLASS_DEFINE_END(encode__NativeROI) 96 }; 97 98 } // namespace encode 99 #endif //<! __CODECHAL_HEVC_VDENC_ROI_NATIVE_H__