1 /*
2 * Copyright (c) 2022, 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_vdenc_preenc.h
24 //! \brief    Defines the interface for encode av1 preenc feature
25 //!
26 #ifndef __ENCODE_AV1_VDENC_PREENC_H__
27 #define __ENCODE_AV1_VDENC_PREENC_H__
28 
29 #include "mhw_vdbox_vdenc_itf.h"
30 #include "encode_mem_compression.h"
31 #include "encode_preenc_basic_feature.h"
32 #include "encode_av1_basic_feature.h"
33 #include "codechal_debug.h"
34 
35 namespace encode
36 {
37 
38 class Av1VdencPreEnc : public PreEncBasicFeature
39 {
40 public:
41     Av1VdencPreEnc(MediaFeatureManager *featureManager,
42                     EncodeAllocator     *allocator,
43                     CodechalHwInterfaceNext *hwInterface,
44                     TrackedBuffer       *trackedBuf,
45                     RecycleResource     *recycleBuf,
46                     void                *constSettings = nullptr);
47 
~Av1VdencPreEnc()48     virtual ~Av1VdencPreEnc() {};
49 
50 protected:
51     virtual MOS_STATUS PreparePreEncConfig(void *params) override;
52 
53     Av1BasicFeature *m_basicFeature = nullptr;  //!< AV1 paramter
54 
55     const uint8_t HevcSliceType[3] = {encodeHevcISlice, encodeHevcBSlice, encodeHevcBSlice};
56 
57     uint8_t m_orderHintOffset[ENCODE_AV1_ORDER_HINT_SIZE];
58 
59 MEDIA_CLASS_DEFINE_END(encode__Av1VdencPreEnc)
60 };
61 
62 }  // namespace encode
63 
64 #endif  // !__ENCODE_AV1_VDENC_PREENC_H__
65