• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*!
2  * \copy
3  *     Copyright (c)  2009-2013, Cisco Systems
4  *     All rights reserved.
5  *
6  *     Redistribution and use in source and binary forms, with or without
7  *     modification, are permitted provided that the following conditions
8  *     are met:
9  *
10  *        * Redistributions of source code must retain the above copyright
11  *          notice, this list of conditions and the following disclaimer.
12  *
13  *        * Redistributions in binary form must reproduce the above copyright
14  *          notice, this list of conditions and the following disclaimer in
15  *          the documentation and/or other materials provided with the
16  *          distribution.
17  *
18  *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  *     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  *     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  *     FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22  *     COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23  *     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24  *     BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26  *     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  *     LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28  *     ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  *     POSSIBILITY OF SUCH DAMAGE.
30  *
31  *
32  * \file    fmo.h
33  *
34  * \brief   Flexible Macroblock Ordering implementation
35  *
36  * \date    2/4/2009 Created
37  *
38  *************************************************************************************
39  */
40 #ifndef WELS_FLEXIBLE_MACROBLOCK_ORDERING_H__
41 #define WELS_FLEXIBLE_MACROBLOCK_ORDERING_H__
42 
43 #include "typedefs.h"
44 #include "wels_const.h"
45 #include "parameter_sets.h"
46 #include "memory_align.h"
47 
48 namespace WelsDec {
49 
50 #ifndef MB_XY_T
51 #define MB_XY_T int32_t
52 #endif//MB_XY_T
53 
54 /*!
55  * \brief   Wels Flexible Macroblock Ordering (FMO)
56  */
57 typedef struct TagFmo {
58   uint8_t*        pMbAllocMap;
59   int32_t         iCountMbNum;
60   int32_t         iSliceGroupCount;
61   int32_t         iSliceGroupType;
62   bool            bActiveFlag;
63   uint8_t         uiReserved[3];          // reserved padding bytes
64 } SFmo, *PFmo;
65 
66 
67 /*!
68  * \brief   Initialize Wels Flexible Macroblock Ordering (FMO)
69  *
70  * \param   pFmo        Wels fmo to be initialized
71  * \param   pPps        PPps
72  * \param   kiMbWidth   mb width
73  * \param   kiMbHeight  mb height
74  *
75  * \return  0 - successful; none 0 - failed;
76  */
77 int32_t InitFmo (PFmo pFmo, PPps pPps, const int32_t kiMbWidth, const int32_t kiMbHeight, CMemoryAlign* pMa);
78 
79 /*!
80  * \brief   Uninitialize Wels Flexible Macroblock Ordering (FMO) list
81  *
82  * \param   pFmo        Wels base fmo ptr to be uninitialized
83  * \param   kiCnt       count number of PPS per list
84  * \param   kiAvail     count available number of PPS in list
85  *
86  * \return  NONE
87  */
88 void UninitFmoList (PFmo pFmo, const int32_t kiCnt, const int32_t kiAvail, CMemoryAlign* pMa);
89 
90 /*!
91  * \brief   update/insert FMO parameter unit
92  *
93  * \param   pFmo    FMO context
94  * \param   pSps    PSps
95  * \param   pPps    PPps
96  * \param   pActiveFmoNum   int32_t* [in/out]
97  *
98  * \return  true - update/insert successfully; false - failed;
99  */
100 int32_t FmoParamUpdate (PFmo pFmo, PSps pSps, PPps pPps, int32_t* pActiveFmoNum, CMemoryAlign* pMa);
101 
102 /*!
103  * \brief   Get successive mb to be processed with given current mb_xy
104  *
105  * \param   pFmo            Wels fmo context
106  * \param   iMbXy           current mb_xy
107  *
108  * \return  iNextMb - successful; -1 - failed;
109  */
110 MB_XY_T FmoNextMb (PFmo pFmo, const MB_XY_T kiMbXy);
111 
112 } // namespace WelsDec
113 
114 #endif//WELS_FLEXIBLE_MACROBLOCK_ORDERING_H__
115