| 1 | /* |
| 2 | * Copyright (c) 2019 - 2023, 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_av1_pipeline.h |
| 24 | //! \brief Defines the interface for av1 encode pipeline |
| 25 | //! |
| 26 | #ifndef __ENCODE_AV1_PIPELINE_H__ |
| 27 | #define __ENCODE_AV1_PIPELINE_H__ |
| 28 | #include "encode_pipeline.h" |
| 29 | #include "encode_av1_vdenc_feature_manager.h" |
| 30 | |
| 31 | namespace encode { |
| 32 | class Av1Pipeline : public EncodePipeline |
| 33 | { |
| 34 | public: |
| 35 | //! |
| 36 | //! \brief EncodePipeline constructor |
| 37 | //! \param [in] hwInterface |
| 38 | //! Pointer to CodechalHwInterface |
| 39 | //! \param [in] debugInterface |
| 40 | //! Pointer to CodechalDebugInterface |
| 41 | //! |
| 42 | Av1Pipeline( |
| 43 | CodechalHwInterfaceNext * hwInterface, |
| 44 | CodechalDebugInterface *debugInterface); |
| 45 | |
| 46 | virtual ~Av1Pipeline() {} |
| 47 | |
| 48 | virtual MOS_STATUS Prepare(void *params) override; |
| 49 | |
| 50 | virtual bool IsDualEncEnabled() {return m_dualEncEnable;} |
| 51 | |
| 52 | enum Av1PacketIds |
| 53 | { |
| 54 | Av1HucBrcInit = CONSTRUCTPACKETID(PACKET_COMPONENT_ENCODE, PACKET_SUBCOMPONENT_AV1, 0), |
| 55 | Av1HucBrcUpdate, |
| 56 | Av1VdencPacket, |
| 57 | Av1PakIntegrate, |
| 58 | Av1BackAnnotation, |
| 59 | Av1Superres, |
| 60 | EncodeCheckHucLoad, |
| 61 | HucSLBBUpdate, |
| 62 | }; |
| 63 | |
| 64 | protected: |
| 65 | virtual MOS_STATUS Initialize(void *settings) override; |
| 66 | virtual MOS_STATUS Uninitialize() override; |
| 67 | virtual MOS_STATUS UserFeatureReport() override; |
| 68 | virtual MOS_STATUS CreateBufferTracker() override; |
| 69 | virtual MOS_STATUS CreateStatusReport() override; |
| 70 | virtual MOS_STATUS InitUserSetting(MediaUserSettingSharedPtr userSettingPtr) override; |
| 71 | |
| 72 | |
| 73 | #if USE_CODECHAL_DEBUG_TOOL |
| 74 | //! \brief Dump the Sequense parameters |
| 75 | //! |
| 76 | //! \param [in] seqParams |
| 77 | //! Pointer to CODEC_AV1_ENCODE_SEQUENCE_PARAMS |
| 78 | //! |
| 79 | //! \return MOS_STATUS |
| 80 | //! MOS_STATUS_SUCCESS if success, else fail reason |
| 81 | //! |
| 82 | MOS_STATUS DumpSeqParams( |
| 83 | const CODEC_AV1_ENCODE_SEQUENCE_PARAMS *seqParams); |
| 84 | |
| 85 | //! \brief Dump the picture parameters |
| 86 | //! |
| 87 | //! \param [in] picParams |
| 88 | //! Pointer to CODEC_AV1_ENCODE_PICTURE_PARAMS |
| 89 | //! |
| 90 | //! \return MOS_STATUS |
| 91 | //! MOS_STATUS_SUCCESS if success, else fail reason |
| 92 | //! |
| 93 | MOS_STATUS DumpPicParams( |
| 94 | const CODEC_AV1_ENCODE_PICTURE_PARAMS *picParams); |
| 95 | |
| 96 | //! \brief Dump the tile group parameters |
| 97 | //! |
| 98 | //! \param [in] tilegroupParams |
| 99 | //! Pointer to CODEC_AV1_ENCODE_TILE_GROUP_PARAMS |
| 100 | //! |
| 101 | //! \return MOS_STATUS |
| 102 | //! MOS_STATUS_SUCCESS if success, else fail reason |
| 103 | //! |
| 104 | MOS_STATUS DumpTileGroupParams( |
| 105 | const CODEC_AV1_ENCODE_TILE_GROUP_PARAMS *tilegroupParams, |
| 106 | uint32_t index); |
| 107 | #endif |
| 108 | |
| 109 | bool m_dualEncEnable = false; |
| 110 | |
| 111 | MEDIA_CLASS_DEFINE_END(encode__Av1Pipeline) |
| 112 | }; |
| 113 | |
| 114 | } |
| 115 | #endif // !__ENCODE_AV1_PIPELINE_H__ |