• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*!
2  * \copy
3  *     Copyright (c)  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 
33 //picture.h     -       reconstruction picture/ reference picture/ residual picture are declared here
34 #ifndef WELS_PICTURE_H__
35 #define WELS_PICTURE_H__
36 
37 #include "typedefs.h"
38 #include "wels_common_defs.h"
39 #include "wels_const_common.h"
40 #include "wels_decoder_thread.h"
41 
42 using namespace WelsCommon;
43 
44 namespace WelsDec {
45 
46 /*
47 *  Reconstructed Picture definition
48 *  It is used to express reference picture, also consequent reconstruction picture for output
49 */
50 
51 struct SPicture {
52   /************************************payload data*********************************/
53   uint8_t*        pBuffer[4];             // pointer to the first allocated byte, basical offset of buffer, dimension:
54   uint8_t*        pData[4];               // pointer to picture planes respectively
55   int32_t         iLinesize[4];// linesize of picture planes respectively used currently
56   int32_t         iPlanes;                        // How many planes are introduced due to color space format?
57 // picture information
58 
59   /*******************************from EC mv copy****************************/
60   bool bIdrFlag;
61 
62   /*******************************from other standard syntax****************************/
63   /*from sps*/
64   int32_t         iWidthInPixel;  // picture width in pixel
65   int32_t         iHeightInPixel;// picture height in pixel
66   /*from slice header*/
67   int32_t         iFramePoc;              // frame POC
68 
69   /*******************************sef_definition for misc use****************************/
70   bool            bUsedAsRef;                                                     //for ref pic management
71   bool            bIsLongRef;     // long term reference frame flag       //for ref pic management
72   int8_t          iRefCount;
73 
74   bool            bIsComplete;    // indicate whether current picture is complete, not from EC
75   /*******************************for future use****************************/
76   uint8_t         uiTemporalId;
77   uint8_t         uiSpatialId;
78   uint8_t         uiQualityId;
79 
80   int32_t         iFrameNum;              // frame number                 //for ref pic management
81   int32_t         iFrameWrapNum;          // frame wrap number            //for ref pic management
82   int32_t         iLongTermFrameIdx;                                      //id for long term ref pic
83   uint32_t        uiLongTermPicNum;       //long_term_pic_num
84 
85   int32_t     iSpsId; //against mosaic caused by cross-IDR interval reference.
86   int32_t     iPpsId;
87   unsigned long long uiTimeStamp;
88   uint32_t    uiDecodingTimeStamp; //represent relative decoding time stamps
89   int32_t     iPicBuffIdx;
90   EWelsSliceType  eSliceType;
91   bool        bIsUngroupedMultiSlice; //multi-slice picture with each each slice group contains one slice.
92   bool bNewSeqBegin;
93   int32_t iMbEcedNum;
94   int32_t iMbEcedPropNum;
95   int32_t iMbNum;
96 
97   bool*    pMbCorrectlyDecodedFlag;
98   int8_t (*pNzc)[24];
99   uint32_t*  pMbType; // mb type used for direct mode
100   int16_t (*pMv[LIST_A])[MB_BLOCK4x4_NUM][MV_A]; // used for direct mode
101   int8_t (*pRefIndex[LIST_A])[MB_BLOCK4x4_NUM]; //used for direct mode
102   struct SPicture* pRefPic[LIST_A][17];  //ref pictures used for direct mode
103   SWelsDecEvent* pReadyEvent;  //MB line ready event
104 
105 };// "Picture" declaration is comflict with Mac system
106 
107 typedef struct SPicture* PPicture;
108 
109 } // namespace WelsDec
110 
111 #endif//WELS_PICTURE_H__
112