avclib_common.h revision 609f1a00c96cf5605f4614e7bb6d0487c98969c5
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 common encoder/decoder library.
20@publishedAll
21*/
22#ifndef AVCCOMMON_LIB_H_INCLUDED
23#define AVCCOMMON_LIB_H_INCLUDED
24
25#ifndef AVCINT_COMMON_H_INCLUDED
26#include "avcint_common.h"
27#endif
28
29/*----------- deblock.c --------------*/
30/**
31This function performs conditional deblocking on a complete picture.
32\param "video"  "Pointer to AVCCommonObj."
33\return "AVC_SUCCESS for success and AVC_FAIL otherwise."
34*/
35OSCL_IMPORT_REF AVCStatus DeblockPicture(AVCCommonObj *video);
36
37/**
38This function performs MB-based deblocking when MB_BASED_DEBLOCK
39is defined at compile time.
40\param "video"  "Pointer to AVCCommonObj."
41\return "AVC_SUCCESS for success and AVC_FAIL otherwise."
42*/
43void MBInLoopDeblock(AVCCommonObj *video);
44
45
46/*---------- dpb.c --------------------*/
47/**
48This function is called everytime a new sequence is detected.
49\param "avcHandle"  "Pointer to AVCHandle."
50\param "video" "Pointer to AVCCommonObj."
51\param "padding"    "Flag specifying whether padding in luma component is needed (used for encoding)."
52\return "AVC_SUCCESS or AVC_FAIL."
53*/
54OSCL_IMPORT_REF AVCStatus AVCConfigureSequence(AVCHandle *avcHandle, AVCCommonObj *video, bool padding);
55
56/**
57This function allocates and initializes the decoded picture buffer structure based on
58the profile and level for the first sequence parameter set. Currently,
59it does not allow changing in profile/level for subsequent SPS.
60\param "avcHandle"  "Pointer to AVCHandle."
61\param "video" "Pointer to AVCCommonObj."
62\param "FrameHeightInMbs"   "Height of the frame in the unit of MBs."
63\param "PicWidthInMbs"  "Width of the picture in the unit of MBs."
64\param "padding"    "Flag specifying whether padding in luma component is needed (used for encoding)."
65\return "AVC_SUCCESS or AVC_FAIL."
66*/
67AVCStatus InitDPB(AVCHandle *avcHandle, AVCCommonObj *video, int FrameHeightInMbs, int PicWidthInMbs, bool padding);
68
69/**
70This function frees the DPB memory.
71\param "avcHandle"  "Pointer to AVCHandle."
72\param "video" "Pointer to AVCCommonObj."
73\return "AVC_SUCCESS or AVC_FAIL."
74*/
75OSCL_IMPORT_REF AVCStatus CleanUpDPB(AVCHandle *avcHandle, AVCCommonObj *video);
76
77/**
78This function finds empty frame in the decoded picture buffer to be used for the
79current picture, initializes the corresponding picture structure with Sl, Scb, Scr,
80width, height and pitch.
81\param "avcHandle" "Pointer to the main handle object."
82\param "video"  "Pointer to AVCCommonObj."
83\return "AVC_SUCCESS or AVC_FAIL."
84*/
85OSCL_IMPORT_REF AVCStatus DPBInitBuffer(AVCHandle *avcHandle, AVCCommonObj *video);
86/**
87This function finds empty frame in the decoded picture buffer to be used for the
88current picture, initializes the corresponding picture structure with Sl, Scb, Scr,
89width, height and pitch.
90\param "video"  "Pointer to AVCCommonObj."
91\param "CurrPicNum" "Current picture number (only used in decoder)."
92\return "AVC_SUCCESS or AVC_FAIL."
93*/
94
95OSCL_IMPORT_REF void DPBInitPic(AVCCommonObj *video, int CurrPicNum);
96
97/**
98This function releases the current frame back to the available pool for skipped frame after encoding.
99\param "avcHandle" "Pointer to the main handle object."
100\param "video" "Pointer to the AVCCommonObj."
101\return "void."
102*/
103OSCL_IMPORT_REF void DPBReleaseCurrentFrame(AVCHandle *avcHandle, AVCCommonObj *video);
104
105/**
106This function performs decoded reference picture marking process and store the current picture to the
107corresponding frame storage in the decoded picture buffer.
108\param "avcHandle" "Pointer to the main handle object."
109\param "video" "Pointer to the AVCCommonObj."
110\return "AVC_SUCCESS or AVC_FAIL."
111*/
112OSCL_IMPORT_REF AVCStatus StorePictureInDPB(AVCHandle *avcHandle, AVCCommonObj *video);
113
114/**
115This function perform sliding window operation on the reference picture lists, see subclause 8.2.5.3.
116It removes short-term ref frames with smallest FrameNumWrap from the reference list.
117\param "avcHandle" "Pointer to the main handle object."
118\param "video" "Pointer to the AVCCommonObj."
119\param "dpb"  "Pointer to the AVCDecPicBuffer."
120\return "AVC_SUCCESS or AVC_FAIL (contradicting values or scenario as in the Note in the draft)."
121*/
122AVCStatus sliding_window_process(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb);
123
124
125/**
126This function perform adaptive memory marking operation on the reference picture lists,
127see subclause 8.2.5.4. It calls other functions for specific operations.
128\param "video" "Pointer to the AVCCommonObj."
129\param "dpb"  "Pointer to the AVCDecPicBuffer."
130\param "sliceHdr"   "Pointer to the AVCSliceHeader."
131\return "AVC_SUCCESS or AVC_FAIL (contradicting values or scenario as in the Note in the draft)."
132*/
133AVCStatus adaptive_memory_marking(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb, AVCSliceHeader *sliceHdr);
134
135/**
136This function performs memory management control operation 1, marking a short-term picture
137as unused for reference. See subclause 8.2.5.4.1.
138\param "video" "Pointer to the AVCCommonObj."
139\param "dpb"  "Pointer to the AVCDecPicBuffer."
140\param "difference_of_pic_nums_minus1"  "From the syntax in dec_ref_pic_marking()."
141*/
142void MemMgrCtrlOp1(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb, int difference_of_pic_nums_minus1);
143
144/**
145This function performs memory management control operation 2, marking a long-term picture
146as unused for reference. See subclause 8.2.5.4.2.
147\param "dpb"  "Pointer to the AVCDecPicBuffer."
148\param "field_pic_flag"  "Flag whether the current picture is field or not."
149\param "long_term_pic_num"  "From the syntax in dec_ref_pic_marking()."
150*/
151void MemMgrCtrlOp2(AVCHandle *avcHandle, AVCDecPicBuffer *dpb, int long_term_pic_num);
152
153/**
154This function performs memory management control operation 3, assigning a LongTermFrameIdx to
155a short-term reference picture. See subclause 8.2.5.4.3.
156\param "video" "Pointer to the AVCCommonObj."
157\param "dpb"  "Pointer to the AVCDecPicBuffer."
158\param "difference_of_pic_nums_minus1"  "From the syntax in dec_ref_pic_marking()."
159\param "long_term_pic_num"  "From the syntax in dec_ref_pic_marking()."
160*/
161void MemMgrCtrlOp3(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb, uint difference_of_pic_nums_minus1,
162                   uint long_term_frame_idx);
163
164/**
165This function performs memory management control operation 4, getting new MaxLongTermFrameIdx.
166 See subclause 8.2.5.4.4.
167\param "video" "Pointer to the AVCCommonObj."
168\param "dpb"  "Pointer to the AVCDecPicBuffer."
169\param "max_long_term_frame_idx_plus1"  "From the syntax in dec_ref_pic_marking()."
170*/
171void MemMgrCtrlOp4(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb, uint max_long_term_frame_idx_plus1);
172
173/**
174This function performs memory management control operation 5, marking all reference pictures
175as unused for reference and set MaxLongTermFrameIdx to no long-termframe indices.
176 See subclause 8.2.5.4.5.
177\param "video" "Pointer to the AVCCommonObj."
178\param "dpb"  "Pointer to the AVCDecPicBuffer."
179*/
180void MemMgrCtrlOp5(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb);
181
182/**
183This function performs memory management control operation 6, assigning a long-term frame index
184to the current picture. See subclause 8.2.5.4.6.
185\param "video" "Pointer to the AVCCommonObj."
186\param "dpb"  "Pointer to the AVCDecPicBuffer."
187\param "long_term_frame_idx"  "From the syntax in dec_ref_pic_marking()."
188*/
189void MemMgrCtrlOp6(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb, uint long_term_frame_idx);
190
191/**
192This function mark a long-term ref frame with a specific frame index as unused for reference.
193\param "dpb"  "Pointer to the AVCDecPicBuffer."
194\param "long_term_frame_idx"  "To look for"
195*/
196void unmark_long_term_frame_for_reference_by_frame_idx(AVCHandle *avcHandle, AVCDecPicBuffer *dpb, uint long_term_frame_idx);
197
198/**
199This function mark a long-term ref field with a specific frame index as unused for reference except
200a frame that contains a picture with picNumX.
201\param "dpb"  "Pointer to the AVCDecPicBuffer."
202\param "long_term_frame_idx"  "To look for."
203\param "picNumX"    "To look for."
204*/
205void unmark_long_term_field_for_reference_by_frame_idx(AVCCommonObj *video, AVCDecPicBuffer *dpb, uint long_term_frame_indx, int picNumX);
206
207/**
208This function mark a frame to unused for reference.
209\param "fs" "Pointer to AVCFrameStore to be unmarked."
210*/
211void unmark_for_reference(AVCHandle *avcHandle, AVCDecPicBuffer *dpb, uint idx);
212
213void update_ref_list(AVCDecPicBuffer *dpb);
214
215
216/*---------- fmo.c --------------*/
217/**
218This function initializes flexible macroblock reordering.
219\param "video"  "Pointer to AVCCommonObj."
220\return "AVC_SUCCESS for success and AVC_FAIL otherwise."
221*/
222OSCL_IMPORT_REF AVCStatus FMOInit(AVCCommonObj *video);
223
224/**
225This function fills up an array that maps Map unit to the slice group
226following the interleaved slice group map type.
227\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
228\param "run_length_minus1"  "Array of the run-length."
229\param "num_slice_groups_minus_1"   "Number of slice group minus 1."
230\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
231\return "Void."
232*/
233void FmoGenerateType0MapUnitMap(int *mapUnitToSliceGroupMap, uint *run_length_minus1, uint num_slice_groups_minus1, uint PicSizeInMapUnits);
234
235/**
236This function fills up an array that maps Map unit to the slice group
237following the dispersed slice group map type.
238\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
239\param "PicWidthInMbs"  "Width of the luma picture in macroblock unit."
240\param "num_slice_groups_minus_1"   "Number of slice group minus 1."
241\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
242\return "Void."
243*/
244void FmoGenerateType1MapUnitMap(int *mapUnitToSliceGroupMap, int PicWidthInMbs, uint num_slice_groups_minus1, uint PicSizeInMapUnits);
245
246/**
247This function fills up an array that maps Map unit to the slice group
248following the foreground with left-over slice group map type.
249\param "pps"    "Pointer to AVCPicParamSets structure."
250\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
251\param "PicWidthInMbs"  "Width of the luma picture in macroblock unit."
252\param "num_slice_groups_minus_1"   "Number of slice group minus 1."
253\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
254\return "Void."
255*/
256void FmoGenerateType2MapUnitMap(AVCPicParamSet *pps, int *mapUnitToSliceGroupMap, int PicWidthInMbs,
257                                uint num_slice_groups_minus1, uint PicSizeInMapUnits);
258
259/**
260This function fills up an array that maps Map unit to the slice group
261following the box-out slice group map type.
262\param "pps"    "Pointer to AVCPicParamSets structure."
263\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
264\param "PicWidthInMbs"  "Width of the luma picture in macroblock unit."
265\return "Void."
266*/
267void FmoGenerateType3MapUnitMap(AVCCommonObj *video, AVCPicParamSet* pps, int *mapUnitToSliceGroupMap,
268                                int PicWidthInMbs);
269
270/**
271This function fills up an array that maps Map unit to the slice group
272following the raster scan slice group map type.
273\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
274\param "MapUnitsInSliceGroup0"  "Derived in subclause 7.4.3."
275\param "slice_group_change_direction_flag"  "A value from the slice header."
276\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
277\return "void"
278*/
279void FmoGenerateType4MapUnitMap(int *mapUnitToSliceGroupMap, int MapUnitsInSliceGroup0,
280                                int slice_group_change_direction_flag, uint PicSizeInMapUnits);
281
282/**
283This function fills up an array that maps Map unit to the slice group
284following wipe slice group map type.
285\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
286\param "video"  "Pointer to AVCCommonObj structure."
287\param "slice_group_change_direction_flag"  "A value from the slice header."
288\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
289\return "void"
290*/
291void FmoGenerateType5MapUnitMap(int *mapUnitsToSliceGroupMap, AVCCommonObj *video,
292                                int slice_group_change_direction_flag, uint PicSizeInMapUnits);
293
294/**
295This function fills up an array that maps Map unit to the slice group
296following wipe slice group map type.
297\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
298\param "slice_group_id" "Array of slice_group_id from AVCPicParamSet structure."
299\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
300\return "void"
301*/
302void FmoGenerateType6MapUnitMap(int *mapUnitsToSliceGroupMap, int *slice_group_id, uint PicSizeInMapUnits);
303
304/*------------- itrans.c --------------*/
305/**
306This function performs transformation of the Intra16x16DC value according to
307subclause 8.5.6.
308\param "block"  "Pointer to the video->block[0][0][0]."
309\param "QPy"    "Quantization parameter."
310\return "void."
311*/
312void Intra16DCTrans(int16 *block, int Qq, int Rq);
313
314/**
315This function performs transformation of a 4x4 block according to
316subclause 8.5.8.
317\param "block"  "Pointer to the origin of transform coefficient area."
318\param "pred"   "Pointer to the origin of predicted area."
319\param "cur"    "Pointer to the origin of the output area."
320\param "width"  "Pitch of cur."
321\return "void."
322*/
323void itrans(int16 *block, uint8 *pred, uint8 *cur, int width);
324
325/*
326This function is the same one as itrans except for chroma.
327\param "block"  "Pointer to the origin of transform coefficient area."
328\param "pred"   "Pointer to the origin of predicted area."
329\param "cur"    "Pointer to the origin of the output area."
330\param "width"  "Pitch of cur."
331\return "void."
332*/
333void ictrans(int16 *block, uint8 *pred, uint8 *cur, int width);
334
335/**
336This function performs transformation of the DCChroma value according to
337subclause 8.5.7.
338\param "block"  "Pointer to the video->block[0][0][0]."
339\param "QPc"    "Quantization parameter."
340\return "void."
341*/
342void ChromaDCTrans(int16 *block, int Qq, int Rq);
343
344/**
345This function copies a block from pred to cur.
346\param "pred"   "Pointer to prediction block."
347\param "cur"    "Pointer to the current YUV block."
348\param "width"  "Pitch of cur memory."
349\param "pred_pitch" "Pitch for pred memory.
350\return "void."
351*/
352void copy_block(uint8 *pred, uint8 *cur, int width, int pred_pitch);
353
354/*--------- mb_access.c ----------------*/
355/**
356This function initializes the neighboring information before start macroblock decoding.
357\param "video"  "Pointer to AVCCommonObj."
358\param "mbNum"  "The current macroblock index."
359\param "currMB" "Pointer to the current AVCMacroblock structure."
360\return "void"
361*/
362OSCL_IMPORT_REF void InitNeighborAvailability(AVCCommonObj *video, int mbNum);
363
364/**
365This function checks whether the requested neighboring macroblock is available.
366\param "MbToSliceGroupMap"  "Array containing the slice group ID mapping to MB index."
367\param "PicSizeInMbs"   "Size of the picture in number of MBs."
368\param "mbAddr"     "Neighboring macroblock index to check."
369\param "currMbAddr" "Current macroblock index."
370\return "TRUE if the neighboring MB is available, FALSE otherwise."
371*/
372bool mb_is_available(AVCMacroblock *mblock, uint PicSizeInMbs, int mbAddr, int currMbAddr);
373
374/**
375This function performs prediction of the nonzero coefficient for a luma block (i,j).
376\param "video"  "Pointer to AVCCommonObj."
377\param "i"  "Block index, horizontal."
378\param "j"  "Block index, vertical."
379\return "Predicted number of nonzero coefficient."
380*/
381OSCL_IMPORT_REF int predict_nnz(AVCCommonObj *video, int i, int j);
382
383/**
384This function performs prediction of the nonzero coefficient for a chroma block (i,j).
385\param "video"  "Pointer to AVCCommonObj."
386\param "i"  "Block index, horizontal."
387\param "j"  "Block index, vertical."
388\return "Predicted number of nonzero coefficient."
389*/
390OSCL_IMPORT_REF int predict_nnz_chroma(AVCCommonObj *video, int i, int j);
391
392/**
393This function calculates the predicted motion vectors for the current macroblock.
394\param "video" "Pointer to AVCCommonObj."
395\param "encFlag"    "Boolean whether this function is used by encoder or decoder."
396\return "void."
397*/
398OSCL_IMPORT_REF void GetMotionVectorPredictor(AVCCommonObj *video, int encFlag);
399
400/*---------- reflist.c -----------------*/
401/**
402This function initializes reference picture list used in INTER prediction
403at the beginning of each slice decoding. See subclause 8.2.4.
404\param "video"  "Pointer to AVCCommonObj."
405\return "void"
406Output is video->RefPicList0, video->RefPicList1, video->refList0Size and video->refList1Size.
407*/
408OSCL_IMPORT_REF void RefListInit(AVCCommonObj *video);
409
410/**
411This function generates picture list from frame list. Used when current picture is field.
412see subclause 8.2.4.2.5.
413\param "video"  "Pointer to AVCCommonObj."
414\param "IsL1"   "Is L1 list?"
415\param "long_term"  "Is long-term prediction?"
416\return "void"
417*/
418void    GenPicListFromFrameList(AVCCommonObj *video, int IsL1, int long_term);
419
420/**
421This function performs reference picture list reordering according to the
422ref_pic_list_reordering() syntax. See subclause 8.2.4.3.
423\param "video"  "Pointer to AVCCommonObj."
424\return "AVC_SUCCESS or AVC_FAIL"
425Output is video->RefPicList0, video->RefPicList1, video->refList0Size and video->refList1Size.
426*/
427OSCL_IMPORT_REF AVCStatus ReOrderList(AVCCommonObj *video);
428
429/**
430This function performs reference picture list reordering according to the
431ref_pic_list_reordering() syntax regardless of list 0 or list 1. See subclause 8.2.4.3.
432\param "video"  "Pointer to AVCCommonObj."
433\param "isL1"   "Is list 1 or not."
434\return "AVC_SUCCESS or AVC_FAIL"
435Output is video->RefPicList0 and video->refList0Size or video->RefPicList1 and video->refList1Size.
436*/
437AVCStatus ReorderRefPicList(AVCCommonObj *video, int isL1);
438
439/**
440This function performs reordering process of reference picture list for short-term pictures.
441See subclause 8.2.4.3.1.
442\param "video"  "Pointer to AVCCommonObj."
443\param "picNumLX"   "picNumLX of an entry in the reference list."
444\param "refIdxLX"   "Pointer to the current entry index in the reference."
445\param "isL1"       "Is list 1 or not."
446\return "AVC_SUCCESS or AVC_FAIL"
447*/
448AVCStatus ReorderShortTerm(AVCCommonObj *video, int picNumLX, int *refIdxLX, int isL1);
449
450/**
451This function performs reordering process of reference picture list for long-term pictures.
452See subclause 8.2.4.3.2.
453\param "video"  "Pointer to AVCCommonObj."
454\param "LongTermPicNum" "LongTermPicNum of an entry in the reference list."
455\param "refIdxLX"   "Pointer to the current entry index in the reference."
456\param "isL1"       "Is list 1 or not."
457\return "AVC_SUCCESS or AVC_FAIL"
458*/
459AVCStatus ReorderLongTerm(AVCCommonObj *video, int LongTermPicNum, int *refIdxLX, int isL1);
460
461/**
462This function gets the pictures in DPB according to the PicNum.
463\param "video"  "Pointer to AVCCommonObj."
464\param "picNum" "PicNum of the picture we are looking for."
465\return "Pointer to the AVCPictureData or NULL if not found"
466*/
467AVCPictureData*  GetShortTermPic(AVCCommonObj *video, int picNum);
468
469/**
470This function gets the pictures in DPB according to the LongtermPicNum.
471\param "video"  "Pointer to AVCCommonObj."
472\param "LongtermPicNum" "LongtermPicNum of the picture we are looking for."
473\return "Pointer to the AVCPictureData."
474*/
475AVCPictureData*  GetLongTermPic(AVCCommonObj *video, int LongtermPicNum);
476
477/**
478This function indicates whether the picture is used for short-term reference or not.
479\param "s"  "Pointer to AVCPictureData."
480\return "1 if it is used for short-term, 0 otherwise."
481*/
482int is_short_ref(AVCPictureData *s);
483
484/**
485This function indicates whether the picture is used for long-term reference or not.
486\param "s"  "Pointer to AVCPictureData."
487\return "1 if it is used for long-term, 0 otherwise."
488*/
489int is_long_ref(AVCPictureData *s);
490
491/**
492This function sorts array of pointers to AVCPictureData in descending order of
493the PicNum value.
494\param "data"   "Array of pointers to AVCPictureData."
495\param "num"    "Size of the array."
496\return "void"
497*/
498void SortPicByPicNum(AVCPictureData *data[], int num);
499
500/**
501This function sorts array of pointers to AVCPictureData in ascending order of
502the PicNum value.
503\param "data"   "Array of pointers to AVCPictureData."
504\param "num"    "Size of the array."
505\return "void"
506*/
507void SortPicByPicNumLongTerm(AVCPictureData *data[], int num);
508
509/**
510This function sorts array of pointers to AVCFrameStore in descending order of
511the FrameNumWrap value.
512\param "data"   "Array of pointers to AVCFrameStore."
513\param "num"    "Size of the array."
514\return "void"
515*/
516void SortFrameByFrameNumWrap(AVCFrameStore *data[], int num);
517
518/**
519This function sorts array of pointers to AVCFrameStore in ascending order of
520the LongTermFrameIdx value.
521\param "data"   "Array of pointers to AVCFrameStore."
522\param "num"    "Size of the array."
523\return "void"
524*/
525void SortFrameByLTFrameIdx(AVCFrameStore *data[], int num);
526
527/**
528This function sorts array of pointers to AVCPictureData in descending order of
529the PicOrderCnt value.
530\param "data"   "Array of pointers to AVCPictureData."
531\param "num"    "Size of the array."
532\return "void"
533*/
534void SortPicByPOC(AVCPictureData *data[], int num, int descending);
535
536/**
537This function sorts array of pointers to AVCPictureData in ascending order of
538the LongTermPicNum value.
539\param "data"   "Array of pointers to AVCPictureData."
540\param "num"    "Size of the array."
541\return "void"
542*/
543void SortPicByLTPicNum(AVCPictureData *data[], int num);
544
545/**
546This function sorts array of pointers to AVCFrameStore in descending order of
547the PicOrderCnt value.
548\param "data"   "Array of pointers to AVCFrameStore."
549\param "num"    "Size of the array."
550\return "void"
551*/
552void SortFrameByPOC(AVCFrameStore *data[], int num, int descending);
553
554
555#endif /* _AVCCOMMON_LIB_H_ */
556