1 /*
2 * Copyright (c) 2021, 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_jpeg_reference_frames.h
24 //! \brief    Defines reference list related logic for encode jpeg
25 //!
26 #ifndef __ENCODE_JPEG_REFERENCE_FRAMES_H__
27 #define __ENCODE_JPEG_REFERENCE_FRAMES_H__
28 
29 #include "mhw_vdbox.h"
30 
31 namespace encode
32 {
33 
34 class JpegBasicFeature;
35 
36 class JpegReferenceFrames
37 {
38 public:
39 
40     //!
41     //! \brief  JpegReferenceFrames constructor
42     //!
JpegReferenceFrames()43     JpegReferenceFrames() {}
44 
45     //!
46     //! \brief  JpegReferenceFrames deconstructor
47     //!
48     virtual ~JpegReferenceFrames();
49 
50     //!
51     //! \brief  Initialize reference frame
52     //! \param  [in] params
53     //!         Pointer to JpegBasicFeature
54     //! \return  MOS_STATUS
55     //!         MOS_STATUS_SUCCESS if success, else fail reason
56     //!
57     MOS_STATUS Init(JpegBasicFeature *basicFeature);
58 
59     //!
60     //! \brief  Get reference list
61     //! \return  PCODEC_REF_LIST *
62     //!         Pointer of current reference list
63     //!
GetRefList()64     PCODEC_REF_LIST *GetRefList() { return m_refList; }
65 
66     //!
67     //! \brief  Get current reference list
68     //! \return  PCODEC_REF_LIST
69     //!         Pointer of current reference list
70     //!
GetCurrRefList()71     PCODEC_REF_LIST GetCurrRefList() { return m_currRefList; }
72 
73     //!
74     //! \brief  Update reference frame for picture
75     //! \return  MOS_STATUS
76     //!         MOS_STATUS_SUCCESS if success, else fail reason
77     //!
78     MOS_STATUS UpdatePicture();
79 
80 protected:
81 
82     PCODEC_REF_LIST   m_refList[CODECHAL_NUM_UNCOMPRESSED_SURFACE_JPEG] = {}; //!< Pointer to reference pictures
83     PCODEC_REF_LIST   m_currRefList = nullptr;                                //!< Current reference list
84 
85     JpegBasicFeature *m_basicFeature = nullptr;                               //!<  JPEG paramter
86 
87 MEDIA_CLASS_DEFINE_END(encode__JpegReferenceFrames)
88 };
89 
90 }  // namespace encode
91 
92 #endif  // !__ENCODE_JPEG_REFERENCE_FRAMES_H__
93