Debian Codegraph @

media_softlet/agnostic/common/codec/hal/dec/shared/packet/decode_downsampling_packet.h

raw
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_downsampling_packet.h
25 //! \brief Defines the common interface for decode down sampling sub packet
26 //! \details The decode down sampling feature interface is further sub-divided by codec standard,
27 //! this file is for the base interface which is shared by all codecs.
28 //!
29
30 #ifndef __DECODE_DOWNSAMPLING_PACKET_H__
31 #define __DECODE_DOWNSAMPLING_PACKET_H__
32
33 #include "decode_sub_packet.h"
34 #include "codechal_setting.h"
35 #include "decode_pipeline.h"
36 #include "media_sfc_interface.h"
37
38 #ifdef _DECODE_PROCESSING_SUPPORTED
39
40 namespace decode
41 {
42
43 class DecodeDownSamplingPkt : public DecodeSubPacket
44 {
45 public:
46 //!
47 //! \brief Decode down sampling sub packet constructor
48 //!
49 DecodeDownSamplingPkt(DecodePipeline *pipeline, CodechalHwInterfaceNext *hwInterface);
50
51 //!
52 //! \brief Decode down sampling sub packet destructor
53 //!
54 virtual ~DecodeDownSamplingPkt();
55
56 //!
57 //! \brief Initialize the down sampling sub packet
58 //! \return MOS_STATUS
59 //! MOS_STATUS_SUCCESS if success, else fail reason
60 //!
61 virtual MOS_STATUS Init() override;
62
63 //!
64 //! \brief Update the parameters for down sampling sub packet
65 //! \return MOS_STATUS
66 //! MOS_STATUS_SUCCESS if success, else fail reason
67 //!
68 virtual MOS_STATUS Prepare() override;
69
70 //!
71 //! \brief Execute sub packet
72 //! \return MOS_STATUS
73 //! MOS_STATUS_SUCCESS if success, else fail reason
74 //!
75 virtual MOS_STATUS Execute(MOS_COMMAND_BUFFER& cmdBuffer);
76
77 //!
78 //! \brief Calculate Command Size
79 //!
80 //! \param [in, out] commandBufferSize
81 //! requested size
82 //! \param [in, out] requestedPatchListSize
83 //! requested size
84 //! \return MOS_STATUS
85 //! status
86 //!
87 MOS_STATUS CalculateCommandSize(
88 uint32_t &commandBufferSize,
89 uint32_t &requestedPatchListSize) override;
90
91 //! \brief Check if down sampling supported for current frame
92 //! \return bool
93 //! true if down sampling supported for current frame
94 bool IsSupported() { return m_isSupported; }
95
96 //! \brief Set down sampling mode
97 //! \param [in, out] mode
98 //! down sampling mode
99 //! \return MOS_STATUS
100 //! status
101 //!
102 virtual MOS_STATUS SetSfcMode(MEDIA_SFC_INTERFACE_MODE &mode) = 0;
103
104 //!
105 //! \brief Sfc Command Size
106 //! \details Calculate Command size of SFC commands.
107 //! \return uint32_t
108 //! Return calculated size
109 //!
110 uint32_t GetSfcCmdSize() { return (m_sfcInterface ? (m_sfcInterface->GetSfcCommandSize()) : 0); };
111
112 protected:
113 virtual MOS_STATUS InitSfcParams(VDBOX_SFC_PARAMS &sfcParams);
114
115 std::shared_ptr<MediaSfcInterface> m_sfcInterface = nullptr;
116 DecodeBasicFeature *m_basicFeature = nullptr;
117 DecodeDownSamplingFeature *m_downSampling = nullptr;
118 bool m_isSupported = false;
119
120 VDBOX_SFC_PARAMS m_sfcParams;
121
122 MEDIA_CLASS_DEFINE_END(decode__DecodeDownSamplingPkt)
123 };
124
125 }
126
127 #endif // !_DECODE_PROCESSING_SUPPORTED
128 #endif // !__DECODE_DOWNSAMPLING_PACKET_H__