videoeditorengine/h263decoder/inc/decgob.h
changeset 0 951a5db380a0
equal deleted inserted replaced
-1:000000000000 0:951a5db380a0
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 * Ixonos Plc
       
    14 *
       
    15 * Description:  
       
    16 * Header for GOB segment decoding module.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef _DECGOB_H_
       
    22 #define _DECGOB_H_
       
    23 
       
    24 #include "core.h"
       
    25 #include "vdcmvc.h"
       
    26 #include "vdeims.h"
       
    27 #include "MPEG4Transcoder.h"
       
    28 class CMPEG4Transcoder;
       
    29 /*
       
    30  * Defines
       
    31  */
       
    32  
       
    33 // unify error codes
       
    34 #define DGOB_OK_BUT_BIT_ERROR H263D_OK_BUT_BIT_ERROR           /* Bit errors detected */
       
    35 #define DGOB_OK H263D_OK
       
    36 #define DGOB_ERR H263D_ERROR
       
    37 
       
    38 /*
       
    39  * Structs and typedefs
       
    40  */
       
    41 
       
    42 /* {{-output"dgobGOBSegmentInParam_t_info.txt" -ignore"*" -noCR}}
       
    43    This structure is used to pass input parameters to
       
    44    the dgobGetAndDecodeGOBSegment and dgobGetAndDecodeGOBSegmentContents
       
    45    functions.
       
    46    {{-output"dgobGOBSegmentInParam_t_info.txt"}} */
       
    47 
       
    48 /* {{-output"dgobGOBSegmentInParam_t.txt"}} */
       
    49 typedef struct {
       
    50    int numStuffBits;             /* Number of stuffing bits before GBSC */
       
    51 
       
    52    vdcPictureParam_t *pictParam; /* Picture attributes */
       
    53 
       
    54    bibBuffer_t *inBuffer;        /* Bit Buffer instance */
       
    55 
       
    56 
       
    57    bibBuffer_t *outBuffer;        /* output Bit Buffer instance */
       
    58    bibBufferEdit_t *bufEdit; 
       
    59    int iColorEffect; 
       
    60    TBool iGetDecodedFrame;
       
    61 
       
    62 
       
    63    int fGFIDShouldChange;        /* If non-zero, the gfid parameter passed in 
       
    64                                     the dgobGOBSegmentInOutParam_t structure
       
    65                                     should be different from the value got
       
    66                                     from the bitstream. Otherwise, the values
       
    67                                     should be equal. */
       
    68 
       
    69 } dgobGOBSegmentInParam_t;
       
    70 /* {{-output"dgobGOBSegmentInParam_t.txt"}} */
       
    71 
       
    72 
       
    73 
       
    74 /* {{-output"dgobGOBSegmentInOutParam_t_info.txt" -ignore"*" -noCR}}
       
    75    This structure is used to pass input parameters to
       
    76    the dgobGetAndDecodeGOBSegment and dgobGetAndDecodeGOBSegmentContents
       
    77    functions. The functions may modify the parameters (or the structures
       
    78    pointed by the parameters).
       
    79    {{-output"dgobGOBSegmentInOutParam_t_info.txt"}} */
       
    80 
       
    81 /* {{-output"dgobGOBSegmentInOutParam_t.txt"}} */
       
    82 typedef struct {
       
    83    int prevGNWithHeader;         /* GN of the latest decoded GOB with header */
       
    84 
       
    85    int prevGN;                   /* GN of the latest decoded GOB */
       
    86 
       
    87    int gfid;                     /* GFID of the latest GOB header,
       
    88                                     specify -1 if this is the 1st GOB of
       
    89                                     the sequence */
       
    90 
       
    91    u_char *fCodedMBs;            /* array for coded macroblock flags in
       
    92                                     scan-order, 1 = coded, 0 = not coded */
       
    93 
       
    94    int numOfCodedMBs;            /* number of coded macroblocks */
       
    95 
       
    96    int *quantParams;             /* array of quantization parameters for
       
    97                                     macroblocks in scan-order */
       
    98 
       
    99    mvcData_t *mvcData;           /* Motion Vector Count module instance data */
       
   100 
       
   101    vdeIms_t *imageStore;         /* VDE Image Store instance data */
       
   102 
       
   103    int trp;                      /* Temporal Reference for Prediction,
       
   104                                     -1 if not indicated in the bitstream */
       
   105 
       
   106    int rtr;                      /* Real TR of the referenced image */
       
   107 
       
   108    u_char *refY;                 /* Reference frame */
       
   109    u_char *refU;
       
   110    u_char *refV;
       
   111 
       
   112    u_char *currPY;               /* Current P (or I) frame */
       
   113    u_char *currPU;
       
   114    u_char *currPV;
       
   115 
       
   116    int StartByteIndex;
       
   117    int StartBitIndex;
       
   118 
       
   119 
       
   120 } dgobGOBSegmentInOutParam_t;
       
   121 /* {{-output"dgobGOBSegmentInOutParam_t.txt"}} */
       
   122 
       
   123 
       
   124 /* {{-output"dgobGOBCheckParam_t_info.txt" -ignore"*" -noCR}}
       
   125    This structure is used to pass input parameters to
       
   126    the dgobCheckNextGob function.
       
   127    {{-output"dgobGOBCheckParam_t_info.txt"}} */
       
   128 
       
   129 /* {{-output"dgobGOBCheckParam_t.txt"}} */
       
   130 typedef struct {
       
   131    bibBuffer_t *inBuffer;        /* Bit Buffer instance */
       
   132 
       
   133    bibBuffer_t *outBuffer;        /* Out Bit Buffer instance data */
       
   134 	 int StartByteIndex;
       
   135 	 int StartBitIndex;
       
   136 
       
   137    vdcPictureParam_t *pictParam; /* Picture attributes */
       
   138    int numStuffBits;             /* Number of stuffing bits before GBSC */
       
   139    int prevGN;                   /* GN of the latest GOB */
       
   140    int gfid;                     /* GFID of the frame */
       
   141 } dgobCheckParam_t;
       
   142 /* {{-output"dgobGOBCheckParam_t.txt"}} */
       
   143 
       
   144 
       
   145 /*
       
   146  * Functions prototypes
       
   147  */
       
   148 
       
   149 int dgobGetAndDecodeGOBSegment(
       
   150    const dgobGOBSegmentInParam_t *inParam,
       
   151    dgobGOBSegmentInOutParam_t *inOutParam, CMPEG4Transcoder *hTranscoder);
       
   152 
       
   153 int dgobGetAndDecodeGOBSegmentContents(
       
   154    const dgobGOBSegmentInParam_t *inParam,
       
   155    int fGetNewReferenceFrame,
       
   156    int quant,
       
   157    dgobGOBSegmentInOutParam_t *inOutParam, CMPEG4Transcoder *hTranscoder);
       
   158 
       
   159 int dgobCheckNextGob( 
       
   160    dgobCheckParam_t *param , CMPEG4Transcoder *hTranscoder);
       
   161 
       
   162 #endif
       
   163 // End of File