• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 //! \file     decode_filmgrain_postsubpipeline_g12.h
24 //! \brief    Defines the postSubpipeline for film grain
25 //! \details  Defines the postSubpipline for film grain to execute apply noise kernel
26 //!
27 
28 #ifndef __DECODE_FILMGRAIN_POSTSUBPIPELINE_G12_H__
29 #define __DECODE_FILMGRAIN_POSTSUBPIPELINE_G12_H__
30 
31 #include "decode_av1_pipeline_g12.h"
32 #include "decode_filmgrain_applynoise_packet_g12.h"
33 #include "decode_av1_filmgrain_feature_g12.h"
34 
35 namespace decode {
36 
37 class FilmGrainPostSubPipeline : public DecodeSubPipeline
38 {
39 public:
40     //!
41     //! \brief  AV1 Decode Film Grain constructor
42     //!
43     FilmGrainPostSubPipeline(DecodePipeline *pipeline, MediaTask *task, uint8_t numVdbox, CodechalHwInterface *hwInterface);
44 
45     //!
46     //! \brief  AV1 Decode Film Grain destructor
47     //!
~FilmGrainPostSubPipeline()48     virtual ~FilmGrainPostSubPipeline(){};
49 
50     //!
51     //! \brief  Initialize the bitstream context
52     //!
53     //! \param  [in] settings
54     //!         Reference to the Codechal settings
55     //! \return MOS_STATUS
56     //!         MOS_STATUS_SUCCESS if success, else fail reason
57     //!
58     virtual MOS_STATUS Init(CodechalSetting& settings) override;
59 
60     //!
61     //! \brief  Prepare interal parameters
62     //! \param  [in] params
63     //!         Reference to decode pipeline parameters
64     //! \return MOS_STATUS
65     //!         MOS_STATUS_SUCCESS if success, else fail reason
66     //!
67     virtual MOS_STATUS Prepare(DecodePipelineParams& params) override;
68 
69     //!
70     //! \brief
71     //! \param  [in] Check it the input bitstream is complete
72     //!         bitstream size
73     //! \return bool
74     //!         Ture if input bitstream is complete, else return false
75     //!
76     //bool IsComplete();
77 
78     //!
79     //! \brief  Get media function for context switch
80     //! \return MediaFunction
81     //!         Return the media function
82     //!
83     MediaFunction GetMediaFunction() override;
84 
85 protected:
86     //!
87     //! \brief  Reset the bitstream context for each frame
88     //! \return MOS_STATUS
89     //!         MOS_STATUS_SUCCESS if success, else fail reason
90     //!
91     MOS_STATUS Begin();
92 
93     //!
94     //! \brief  Film Grain Apply Noise kernel
95     //! \param  [in] decodeParams
96     //!         Reference to codechal decode parameters
97     //! \return MOS_STATUS
98     //!         MOS_STATUS_SUCCESS if success, else fail reason
99     //!
100     MOS_STATUS DoFilmGrainApplyNoise(const CodechalDecodeParams &decodeParams);
101 
102     //!
103     //! \brief  Initialize scalability parameters
104     //!
105     virtual void InitScalabilityPars(PMOS_INTERFACE osInterface) override;
106 
107 private:
108     DecodeBasicFeature*     m_basicFeature      = nullptr; //!< Decode basic feature
109     DecodeAllocator*        m_allocator         = nullptr; //!< Resource allocator
110 
111     FilmGrainAppNoisePkt*   m_filmGrainAppPkt   = nullptr; //!< film grain apply noise kernel packet
112     Av1DecodeFilmGrainG12*  m_filmGrainFeature  = nullptr; //!< film grain feature
113     CodechalHwInterface    *m_hwInterface       = nullptr;
114 
115 MEDIA_CLASS_DEFINE_END(decode__FilmGrainPostSubPipeline)
116 };
117 
118 }  // namespace decode
119 
120 #endif
121