PageRenderTime 55ms CodeModel.GetById 2ms app.highlight 47ms RepoModel.GetById 1ms app.codeStats 0ms

/Avc/avcdec_lib.h

http://github.com/mbebenita/Broadway
C Header | 555 lines | 130 code | 69 blank | 356 comment | 0 complexity | b82a67699a01a2d320632b8608c9ab5f MD5 | raw file
  1/* ------------------------------------------------------------------
  2 * Copyright (C) 1998-2009 PacketVideo
  3 *
  4 * Licensed under the Apache License, Version 2.0 (the "License");
  5 * you may not use this file except in compliance with the License.
  6 * You may obtain a copy of the License at
  7 *
  8 *      http://www.apache.org/licenses/LICENSE-2.0
  9 *
 10 * Unless required by applicable law or agreed to in writing, software
 11 * distributed under the License is distributed on an "AS IS" BASIS,
 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 13 * express or implied.
 14 * See the License for the specific language governing permissions
 15 * and limitations under the License.
 16 * -------------------------------------------------------------------
 17 */
 18/**
 19This file contains declarations of internal functions for AVC decoder library.
 20@publishedAll
 21*/
 22#ifndef _AVCDEC_LIB_H_
 23#define _AVCDEC_LIB_H_
 24
 25#include "avclib_common.h"
 26#include "avcdec_int.h"
 27
 28/*----------- avcdec_api.c -------------*/
 29/**
 30This function takes out the emulation prevention bytes from the input to creat RBSP.
 31The result is written over the input bitstream.
 32\param "nal_unit"   "(I/O) Pointer to the input buffer."
 33\param "size"       "(I/O) Pointer to the size of the input/output buffer."
 34\return "AVCDEC_SUCCESS for success and AVCDEC_FAIL otherwise."
 35*/
 36AVCDec_Status EBSPtoRBSP(uint8 *nal_unit, int *size);
 37
 38/*------------- pred_intra.c ---------------*/
 39/**
 40This function is the main entry point to intra prediction operation on a
 41macroblock.
 42\param "video"  "Pointer to AVCCommonObj."
 43*/
 44AVCStatus  IntraMBPrediction(AVCCommonObj *video);
 45
 46void SaveNeighborForIntraPred(AVCCommonObj *video, int offset);
 47
 48AVCStatus Intra_4x4(AVCCommonObj *video, int component, int SubBlock_indx, uint8 *comp);
 49void Intra_4x4_Vertical(AVCCommonObj *video, int block_offset);
 50void Intra_4x4_Horizontal(AVCCommonObj *video, int pitch, int block_offset);
 51void Intra_4x4_DC(AVCCommonObj *video, int pitch, int block_offset, AVCNeighborAvailability *availability);
 52void Intra_4x4_Down_Left(AVCCommonObj *video, int block_offset, AVCNeighborAvailability *availability);
 53void Intra_4x4_Diagonal_Down_Right(AVCCommonObj *video, int pitch, int block_offset);
 54void Intra_4x4_Diagonal_Vertical_Right(AVCCommonObj *video, int pitch, int block_offset);
 55void Intra_4x4_Diagonal_Horizontal_Down(AVCCommonObj *video, int pitch, int block_offset);
 56void Intra_4x4_Vertical_Left(AVCCommonObj *video,  int block_offset, AVCNeighborAvailability *availability);
 57void Intra_4x4_Horizontal_Up(AVCCommonObj *video, int pitch, int block_offset);
 58void  Intra_16x16_Vertical(AVCCommonObj *video);
 59void Intra_16x16_Horizontal(AVCCommonObj *video, int pitch);
 60void Intra_16x16_DC(AVCCommonObj *video, int pitch);
 61void Intra_16x16_Plane(AVCCommonObj *video, int pitch);
 62void Intra_Chroma_DC(AVCCommonObj *video, int pitch, uint8 *predCb, uint8 *predCr);
 63void  Intra_Chroma_Horizontal(AVCCommonObj *video, int pitch, uint8 *predCb, uint8 *predCr);
 64void  Intra_Chroma_Vertical(AVCCommonObj *video, uint8 *predCb, uint8 *predCr);
 65void  Intra_Chroma_Plane(AVCCommonObj *video, int pitch, uint8 *predCb, uint8 *predCr);
 66
 67/*------------ pred_inter.c ---------------*/
 68/**
 69This function is the main entrance to inter prediction operation for
 70a macroblock. For decoding, this function also calls inverse transform and
 71compensation.
 72\param "video"  "Pointer to AVCCommonObj."
 73\return "void"
 74*/
 75void InterMBPrediction(AVCCommonObj *video);
 76
 77/**
 78This function is called for luma motion compensation.
 79\param "ref"    "Pointer to the origin of a reference luma."
 80\param "picwidth"   "Width of the picture."
 81\param "picheight"  "Height of the picture."
 82\param "x_pos"  "X-coordinate of the predicted block in quarter pel resolution."
 83\param "y_pos"  "Y-coordinate of the predicted block in quarter pel resolution."
 84\param "pred"   "Pointer to the output predicted block."
 85\param "pred_pitch" "Width of pred."
 86\param "blkwidth"   "Width of the current partition."
 87\param "blkheight"  "Height of the current partition."
 88\return "void"
 89*/
 90void LumaMotionComp(uint8 *ref, int picwidth, int picheight,
 91                    int x_pos, int y_pos,
 92                    uint8 *pred, int pred_pitch,
 93                    int blkwidth, int blkheight);
 94
 95/**
 96Functions below are special cases for luma motion compensation.
 97LumaFullPelMC is for full pixel motion compensation.
 98LumaBorderMC is for interpolation in only one dimension.
 99LumaCrossMC is for interpolation in one dimension and half point in the other dimension.
100LumaDiagonalMC is for interpolation in diagonal direction.
101
102\param "ref"    "Pointer to the origin of a reference luma."
103\param "picwidth"   "Width of the picture."
104\param "picheight"  "Height of the picture."
105\param "x_pos"  "X-coordinate of the predicted block in full pel resolution."
106\param "y_pos"  "Y-coordinate of the predicted block in full pel resolution."
107\param "dx"     "Fraction of x_pos in quarter pel."
108\param "dy"     "Fraction of y_pos in quarter pel."
109\param "curr"   "Pointer to the current partition in the current picture."
110\param "residue"    "Pointer to the current partition for the residue block."
111\param "blkwidth"   "Width of the current partition."
112\param "blkheight"  "Height of the current partition."
113\return "void"
114*/
115void CreatePad(uint8 *ref, int picwidth, int picheight, int x_pos, int y_pos,
116               uint8 *out, int blkwidth, int blkheight);
117
118void FullPelMC(uint8 *in, int inwidth, uint8 *out, int outpitch,
119               int blkwidth, int blkheight);
120
121void HorzInterp1MC(uint8 *in, int inpitch, uint8 *out, int outpitch,
122                   int blkwidth, int blkheight, int dx);
123
124void HorzInterp2MC(int *in, int inpitch, uint8 *out, int outpitch,
125                   int blkwidth, int blkheight, int dx);
126
127void HorzInterp3MC(uint8 *in, int inpitch, int *out, int outpitch,
128                   int blkwidth, int blkheight);
129
130void VertInterp1MC(uint8 *in, int inpitch, uint8 *out, int outpitch,
131                   int blkwidth, int blkheight, int dy);
132
133void VertInterp2MC(uint8 *in, int inpitch, int *out, int outpitch,
134                   int blkwidth, int blkheight);
135
136void VertInterp3MC(int *in, int inpitch, uint8 *out, int outpitch,
137                   int blkwidth, int blkheight, int dy);
138
139void DiagonalInterpMC(uint8 *in1, uint8 *in2, int inpitch,
140                      uint8 *out, int outpitch,
141                      int blkwidth, int blkheight);
142
143
144void ChromaMotionComp(uint8 *ref, int picwidth, int picheight,
145                      int x_pos, int y_pos, uint8 *pred, int pred_pitch,
146                      int blkwidth, int blkheight);
147
148void ChromaFullPelMC(uint8 *in, int inpitch, uint8 *out, int outpitch,
149                     int blkwidth, int blkheight) ;
150void ChromaBorderMC(uint8 *ref, int picwidth, int dx, int dy,
151                    uint8 *pred, int pred_pitch, int blkwidth, int blkheight);
152void ChromaDiagonalMC(uint8 *ref, int picwidth, int dx, int dy,
153                      uint8 *pred, int pred_pitch, int blkwidth, int blkheight);
154
155void ChromaFullPelMCOutside(uint8 *ref, uint8 *pred, int pred_pitch,
156                            int blkwidth, int blkheight, int x_inc,
157                            int y_inc0, int y_inc1, int x_mid, int y_mid);
158void ChromaBorderMCOutside(uint8 *ref, int picwidth, int dx, int dy,
159                           uint8 *pred, int pred_pitch, int blkwidth, int blkheight,
160                           int x_inc, int z_inc, int y_inc0, int y_inc1, int x_mid, int y_mid);
161void ChromaDiagonalMCOutside(uint8 *ref, int picwidth,
162                             int dx, int dy, uint8 *pred, int pred_pitch,
163                             int blkwidth, int blkheight, int x_inc, int z_inc,
164                             int y_inc0, int y_inc1, int x_mid, int y_mid);
165
166void ChromaDiagonalMC_SIMD(uint8 *pRef, int srcPitch, int dx, int dy,
167                           uint8 *pOut, int predPitch, int blkwidth, int blkheight);
168
169void ChromaHorizontalMC_SIMD(uint8 *pRef, int srcPitch, int dx, int dy,
170                             uint8 *pOut, int predPitch, int blkwidth, int blkheight);
171
172void ChromaVerticalMC_SIMD(uint8 *pRef, int srcPitch, int dx, int dy,
173                           uint8 *pOut, int predPitch, int blkwidth, int blkheight);
174
175void ChromaFullMC_SIMD(uint8 *pRef, int srcPitch, int dx, int dy,
176                       uint8 *pOut, int predPitch, int blkwidth, int blkheight);
177
178void ChromaVerticalMC2_SIMD(uint8 *pRef, int srcPitch, int dx, int dy,
179                            uint8 *pOut, int predPitch, int blkwidth, int blkheight);
180
181void ChromaHorizontalMC2_SIMD(uint8 *pRef, int srcPitch, int dx, int dy,
182                              uint8 *pOut, int predPitch, int blkwidth, int blkheight);
183
184void ChromaDiagonalMC2_SIMD(uint8 *pRef, int srcPitch, int dx, int dy,
185                            uint8 *pOut, int predPitch, int blkwidth, int blkheight);
186
187
188/*----------- slice.c ---------------*/
189/**
190This function performs the main decoding loop for slice data including
191INTRA/INTER prediction, transform and quantization and compensation.
192See decode_frame_slice() in JM.
193\param "video"  "Pointer to AVCDecObject."
194\return "AVCDEC_SUCCESS for success, AVCDEC_PICTURE_READY for end-of-picture and AVCDEC_FAIL otherwise."
195*/
196AVCDec_Status DecodeSlice(AVCDecObject *video);
197AVCDec_Status ConcealSlice(AVCDecObject *decvid, int mbnum_start, int mbnum_end);
198/**
199This function performs the decoding of one macroblock.
200\param "video"  "Pointer to AVCDecObject."
201\param "prevMbSkipped"  "A value derived in 7.3.4."
202\return "AVCDEC_SUCCESS for success or AVCDEC_FAIL otherwise."
203*/
204AVCDec_Status DecodeMB(AVCDecObject *video);
205
206/**
207This function performs macroblock prediction type decoding as in subclause 7.3.5.1.
208\param "video" "Pointer to AVCCommonObj."
209\param "currMB" "Pointer to the current macroblock."
210\param "stream" "Pointer to AVCDecBitstream."
211\return "AVCDEC_SUCCESS for success or AVCDEC_FAIL otherwise."
212*/
213AVCDec_Status mb_pred(AVCCommonObj *video, AVCMacroblock *currMB, AVCDecBitstream *stream);
214
215/**
216This function performs sub-macroblock prediction type decoding as in subclause 7.3.5.2.
217\param "video" "Pointer to AVCCommonObj."
218\param "currMB" "Pointer to the current macroblock."
219\param "stream" "Pointer to AVCDecBitstream."
220\return "AVCDEC_SUCCESS for success or AVCDEC_FAIL otherwise."
221*/
222AVCDec_Status sub_mb_pred(AVCCommonObj *video, AVCMacroblock *currMB, AVCDecBitstream *stream);
223
224/**
225This function interprets the mb_type and sets necessary information
226when the slice type is AVC_I_SLICE.
227in the macroblock structure.
228\param "mblock" "Pointer to current AVCMacroblock."
229\param "mb_type" "From the syntax bitstream."
230\return "void"
231*/
232void InterpretMBModeI(AVCMacroblock *mblock, uint mb_type);
233
234/**
235This function interprets the mb_type and sets necessary information
236when the slice type is AVC_P_SLICE.
237in the macroblock structure.
238\param "mblock" "Pointer to current AVCMacroblock."
239\param "mb_type" "From the syntax bitstream."
240\return "void"
241*/
242void InterpretMBModeP(AVCMacroblock *mblock, uint mb_type);
243
244/**
245This function interprets the mb_type and sets necessary information
246when the slice type is AVC_B_SLICE.
247in the macroblock structure.
248\param "mblock" "Pointer to current AVCMacroblock."
249\param "mb_type" "From the syntax bitstream."
250\return "void"
251*/
252void InterpretMBModeB(AVCMacroblock *mblock, uint mb_type);
253
254/**
255This function interprets the mb_type and sets necessary information
256when the slice type is AVC_SI_SLICE.
257in the macroblock structure.
258\param "mblock" "Pointer to current AVCMacroblock."
259\param "mb_type" "From the syntax bitstream."
260\return "void"
261*/
262void InterpretMBModeSI(AVCMacroblock *mblock, uint mb_type);
263
264/**
265This function interprets the sub_mb_type and sets necessary information
266when the slice type is AVC_P_SLICE.
267in the macroblock structure.
268\param "mblock" "Pointer to current AVCMacroblock."
269\param "sub_mb_type" "From the syntax bitstream."
270\return "void"
271*/
272void InterpretSubMBModeP(AVCMacroblock *mblock, uint *sub_mb_type);
273
274/**
275This function interprets the sub_mb_type and sets necessary information
276when the slice type is AVC_B_SLICE.
277in the macroblock structure.
278\param "mblock" "Pointer to current AVCMacroblock."
279\param "sub_mb_type" "From the syntax bitstream."
280\return "void"
281*/
282void InterpretSubMBModeB(AVCMacroblock *mblock, uint *sub_mb_type);
283
284/**
285This function decodes the Intra4x4 prediction mode from neighboring information
286and from the decoded syntax.
287\param "video"  "Pointer to AVCCommonObj."
288\param "currMB" "Pointer to current macroblock."
289\param "stream" "Pointer to AVCDecBitstream."
290\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
291*/
292AVCDec_Status DecodeIntra4x4Mode(AVCCommonObj *video, AVCMacroblock *currMB, AVCDecBitstream *stream);
293
294/*----------- vlc.c -------------------*/
295/**
296This function reads and decodes Exp-Golomb codes.
297\param "bitstream" "Pointer to AVCDecBitstream."
298\param "codeNum" "Pointer to the value of the codeNum."
299\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
300*/
301AVCDec_Status ue_v(AVCDecBitstream *bitstream, uint *codeNum);
302
303/**
304This function reads and decodes signed Exp-Golomb codes.
305\param "bitstream" "Pointer to AVCDecBitstream."
306\param "value"  "Pointer to syntax element value."
307\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
308*/
309AVCDec_Status  se_v(AVCDecBitstream *bitstream, int *value);
310
311/**
312This function reads and decodes signed Exp-Golomb codes for
31332 bit codeword.
314\param "bitstream" "Pointer to AVCDecBitstream."
315\param "value"  "Pointer to syntax element value."
316\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
317*/
318AVCDec_Status  se_v32bit(AVCDecBitstream *bitstream, int32 *value);
319
320/**
321This function reads and decodes truncated Exp-Golomb codes.
322\param "bitstream" "Pointer to AVCDecBitstream."
323\param "value"  "Pointer to syntax element value."
324\param "range"  "Range of the value as input to determine the algorithm."
325\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
326*/
327AVCDec_Status te_v(AVCDecBitstream *bitstream, uint *value, uint range);
328
329/**
330This function parse Exp-Golomb code from the bitstream.
331\param "bitstream" "Pointer to AVCDecBitstream."
332\param "leadingZeros" "Pointer to the number of leading zeros."
333\param "infobits"   "Pointer to the value after leading zeros and the first one.
334                    The total number of bits read is 2*leadingZeros + 1."
335\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
336*/
337AVCDec_Status GetEGBitstring(AVCDecBitstream *bitstream, int *leadingZeros, int *infobits);
338
339/**
340This function parse Exp-Golomb code from the bitstream for 32 bit codewords.
341\param "bitstream" "Pointer to AVCDecBitstream."
342\param "leadingZeros" "Pointer to the number of leading zeros."
343\param "infobits"   "Pointer to the value after leading zeros and the first one.
344                    The total number of bits read is 2*leadingZeros + 1."
345\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
346*/
347AVCDec_Status GetEGBitstring32bit(AVCDecBitstream *bitstream, int *leadingZeros, uint32 *infobits);
348
349/**
350This function performs CAVLC decoding of the CBP (coded block pattern) of a macroblock
351by calling ue_v() and then mapping the codeNum to the corresponding CBP value.
352\param "currMB"  "Pointer to the current AVCMacroblock structure."
353\param "stream"  "Pointer to the AVCDecBitstream."
354\return "void"
355*/
356AVCDec_Status DecodeCBP(AVCMacroblock *currMB, AVCDecBitstream *stream);
357
358/**
359This function decodes the syntax for trailing ones and total coefficient.
360Subject to optimization.
361\param "stream" "Pointer to the AVCDecBitstream."
362\param "TrailingOnes"   "Pointer to the trailing one variable output."
363\param "TotalCoeff" "Pointer to the total coefficient variable output."
364\param "nC" "Context for number of nonzero coefficient (prediction context)."
365\return "AVCDEC_SUCCESS for success."
366*/
367AVCDec_Status ce_TotalCoeffTrailingOnes(AVCDecBitstream *stream, int *TrailingOnes, int *TotalCoeff, int nC);
368
369/**
370This function decodes the syntax for trailing ones and total coefficient for
371chroma DC block. Subject to optimization.
372\param "stream" "Pointer to the AVCDecBitstream."
373\param "TrailingOnes"   "Pointer to the trailing one variable output."
374\param "TotalCoeff" "Pointer to the total coefficient variable output."
375\return "AVCDEC_SUCCESS for success."
376*/
377AVCDec_Status ce_TotalCoeffTrailingOnesChromaDC(AVCDecBitstream *stream, int *TrailingOnes, int *TotalCoeff);
378
379/**
380This function decode a VLC table with 2 output.
381\param "stream" "Pointer to the AVCDecBitstream."
382\param "lentab" "Table for code length."
383\param "codtab" "Table for code value."
384\param "tabwidth" "Width of the table or alphabet size of the first output."
385\param "tabheight"  "Height of the table or alphabet size of the second output."
386\param "code1"  "Pointer to the first output."
387\param "code2"  "Pointer to the second output."
388\return "AVCDEC_SUCCESS for success."
389*/
390AVCDec_Status code_from_bitstream_2d(AVCDecBitstream *stream, int *lentab, int *codtab, int tabwidth,
391                                     int tabheight, int *code1, int *code2);
392
393/**
394This function decodes the level_prefix VLC value as in Table 9-6.
395\param "stream" "Pointer to the AVCDecBitstream."
396\param "code"   "Pointer to the output."
397\return "AVCDEC_SUCCESS for success."
398*/
399AVCDec_Status ce_LevelPrefix(AVCDecBitstream *stream, uint *code);
400
401/**
402This function decodes total_zeros VLC syntax as in Table 9-7 and 9-8.
403\param "stream" "Pointer to the AVCDecBitstream."
404\param "code"   "Pointer to the output."
405\param "TotalCoeff" "Context parameter."
406\return "AVCDEC_SUCCESS for success."
407*/
408AVCDec_Status ce_TotalZeros(AVCDecBitstream *stream, int *code, int TotalCoeff);
409
410/**
411This function decodes total_zeros VLC syntax for chroma DC as in Table 9-9.
412\param "stream" "Pointer to the AVCDecBitstream."
413\param "code"   "Pointer to the output."
414\param "TotalCoeff" "Context parameter."
415\return "AVCDEC_SUCCESS for success."
416*/
417AVCDec_Status ce_TotalZerosChromaDC(AVCDecBitstream *stream, int *code, int TotalCoeff);
418
419/**
420This function decodes run_before VLC syntax as in Table 9-10.
421\param "stream" "Pointer to the AVCDecBitstream."
422\param "code"   "Pointer to the output."
423\param "zeroLeft"   "Context parameter."
424\return "AVCDEC_SUCCESS for success."
425*/
426AVCDec_Status ce_RunBefore(AVCDecBitstream *stream, int *code, int zeroLeft);
427
428/*----------- header.c -------------------*/
429/**
430This function parses vui_parameters.
431\param "decvid" "Pointer to AVCDecObject."
432\param "stream" "Pointer to AVCDecBitstream."
433\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
434*/
435AVCDec_Status vui_parameters(AVCDecObject *decvid, AVCDecBitstream *stream, AVCSeqParamSet *currSPS);
436AVCDec_Status sei_payload(AVCDecObject *decvid, AVCDecBitstream *stream, uint payloadType, uint payloadSize);
437
438AVCDec_Status buffering_period(AVCDecObject *decvid, AVCDecBitstream *stream);
439AVCDec_Status pic_timing(AVCDecObject *decvid, AVCDecBitstream *stream);
440AVCDec_Status recovery_point(AVCDecObject *decvid, AVCDecBitstream *stream);
441AVCDec_Status dec_ref_pic_marking_repetition(AVCDecObject *decvid, AVCDecBitstream *stream);
442AVCDec_Status motion_constrained_slice_group_set(AVCDecObject *decvid, AVCDecBitstream *stream);
443
444
445/**
446This function parses hrd_parameters.
447\param "decvid" "Pointer to AVCDecObject."
448\param "stream" "Pointer to AVCDecBitstream."
449\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
450*/
451AVCDec_Status hrd_parameters(AVCDecObject *decvid, AVCDecBitstream *stream, AVCHRDParams *HRDParam);
452
453/**
454This function decodes the syntax in sequence parameter set slice and fill up the AVCSeqParamSet
455structure.
456\param "decvid" "Pointer to AVCDecObject."
457\param "video" "Pointer to AVCCommonObj."
458\param "stream" "Pointer to AVCDecBitstream."
459\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
460*/
461AVCDec_Status DecodeSPS(AVCDecObject *decvid, AVCDecBitstream *stream);
462
463/**
464This function decodes the syntax in picture parameter set and fill up the AVCPicParamSet
465structure.
466\param "decvid" "Pointer to AVCDecObject."
467\param "video" "Pointer to AVCCommonObj."
468\param "stream" "Pointer to AVCDecBitstream."
469\return "AVCDEC_SUCCESS or AVCDEC_FAIL."
470*/
471AVCDec_Status DecodePPS(AVCDecObject *decvid, AVCCommonObj *video, AVCDecBitstream *stream);
472AVCDec_Status DecodeSEI(AVCDecObject *decvid, AVCDecBitstream *stream);
473
474/**
475This function decodes slice header, calls related functions such as
476reference picture list reordering, prediction weight table, decode ref marking.
477See FirstPartOfSliceHeader() and RestOfSliceHeader() in JM.
478\param "decvid" "Pointer to AVCDecObject."
479\param "video" "Pointer to AVCCommonObj."
480\param "stream" "Pointer to AVCDecBitstream."
481\return "AVCDEC_SUCCESS for success and AVCDEC_FAIL otherwise."
482*/
483AVCDec_Status DecodeSliceHeader(AVCDecObject *decvid, AVCCommonObj *video, AVCDecBitstream *stream);
484
485/**
486This function performes necessary operations to create dummy frames when
487there is a gap in frame_num.
488\param "video"  "Pointer to AVCCommonObj."
489\return "AVCDEC_SUCCESS for success and AVCDEC_FAIL otherwise."
490*/
491AVCDec_Status fill_frame_num_gap(AVCHandle *avcHandle, AVCCommonObj *video);
492
493/**
494This function decodes ref_pic_list_reordering related syntax and fill up the AVCSliceHeader
495structure.
496\param "video" "Pointer to AVCCommonObj."
497\param "stream" "Pointer to AVCDecBitstream."
498\param "sliceHdr" "Pointer to AVCSliceHdr."
499\param "slice_type" "Value of slice_type - 5 if greater than 5."
500\return "AVCDEC_SUCCESS for success and AVCDEC_FAIL otherwise."
501*/
502AVCDec_Status ref_pic_list_reordering(AVCCommonObj *video, AVCDecBitstream *stream, AVCSliceHeader *sliceHdr, int slice_type);
503
504/**
505This function decodes dec_ref_pic_marking related syntax  and fill up the AVCSliceHeader
506structure.
507\param "video" "Pointer to AVCCommonObj."
508\param "stream" "Pointer to AVCDecBitstream."
509\param "sliceHdr" "Pointer to AVCSliceHdr."
510\return "AVCDEC_SUCCESS for success and AVCDEC_FAIL otherwise."
511*/
512AVCDec_Status dec_ref_pic_marking(AVCCommonObj *video, AVCDecBitstream *stream, AVCSliceHeader *sliceHdr);
513
514/**
515This function performs POC related operation prior to decoding a picture
516\param "video" "Pointer to AVCCommonObj."
517\return "AVCDEC_SUCCESS for success and AVCDEC_FAIL otherwise."
518See also PostPOC() for initialization of some variables.
519*/
520AVCDec_Status DecodePOC(AVCCommonObj *video);
521
522
523
524/*------------ residual.c ------------------*/
525/**
526This function decodes the intra pcm data and fill it in the corresponding location
527on the current picture.
528\param "video"  "Pointer to AVCCommonObj."
529\param "stream" "Pointer to AVCDecBitstream."
530*/
531AVCDec_Status DecodeIntraPCM(AVCCommonObj *video, AVCDecBitstream *stream);
532
533/**
534This function performs residual syntax decoding as well as quantization and transformation of
535the decoded coefficients. See subclause 7.3.5.3.
536\param "video"  "Pointer to AVCDecObject."
537\param "currMB" "Pointer to current macroblock."
538*/
539AVCDec_Status residual(AVCDecObject *video, AVCMacroblock *currMB);
540
541/**
542This function performs CAVLC syntax decoding to get the run and level information of the coefficients.
543\param "video"  "Pointer to AVCDecObject."
544\param "type"   "One of AVCResidualType for a particular 4x4 block."
545\param "bx"     "Horizontal block index."
546\param "by"     "Vertical block index."
547\param "level"  "Pointer to array of level for output."
548\param "run"    "Pointer to array of run for output."
549\param "numcoeff"   "Pointer to the total number of nonzero coefficients."
550\return "AVCDEC_SUCCESS for success."
551*/
552AVCDec_Status residual_block_cavlc(AVCDecObject *video, int nC, int maxNumCoeff,
553                                   int *level, int *run, int *numcoeff);
554
555#endif /* _AVCDEC_LIB_H_ */