1609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/* ------------------------------------------------------------------
2609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * Copyright (C) 1998-2009 PacketVideo
3609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber *
4609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * Licensed under the Apache License, Version 2.0 (the "License");
5609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * you may not use this file except in compliance with the License.
6609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * You may obtain a copy of the License at
7609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber *
8609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber *      http://www.apache.org/licenses/LICENSE-2.0
9609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber *
10609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * Unless required by applicable law or agreed to in writing, software
11609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * distributed under the License is distributed on an "AS IS" BASIS,
12609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * express or implied.
14609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * See the License for the specific language governing permissions
15609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * and limitations under the License.
16609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber * -------------------------------------------------------------------
17609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber */
18609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
19609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis file contains declarations of internal functions for common encoder/decoder library.
20609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber@publishedAll
21609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
22609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber#ifndef AVCCOMMON_LIB_H_INCLUDED
23609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber#define AVCCOMMON_LIB_H_INCLUDED
24609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
253bcbcd09b48deb2b498f7163f89f92e01b9fd43bAndreas Huber#include <stdlib.h>
263bcbcd09b48deb2b498f7163f89f92e01b9fd43bAndreas Huber
27609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber#ifndef AVCINT_COMMON_H_INCLUDED
28609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber#include "avcint_common.h"
29609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber#endif
30609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
31609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/*----------- deblock.c --------------*/
32609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
33609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs conditional deblocking on a complete picture.
34609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
35609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS for success and AVC_FAIL otherwise."
36609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
37609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF AVCStatus DeblockPicture(AVCCommonObj *video);
38609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
39609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
40609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs MB-based deblocking when MB_BASED_DEBLOCK
41609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberis defined at compile time.
42609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
43609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS for success and AVC_FAIL otherwise."
44609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
45609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid MBInLoopDeblock(AVCCommonObj *video);
46609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
47609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
48609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/*---------- dpb.c --------------------*/
49609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
50609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function is called everytime a new sequence is detected.
51609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "avcHandle"  "Pointer to AVCHandle."
52609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to AVCCommonObj."
53609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "padding"    "Flag specifying whether padding in luma component is needed (used for encoding)."
54609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL."
55609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
56609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF AVCStatus AVCConfigureSequence(AVCHandle *avcHandle, AVCCommonObj *video, bool padding);
57609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
58609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
59609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function allocates and initializes the decoded picture buffer structure based on
60609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberthe profile and level for the first sequence parameter set. Currently,
61609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberit does not allow changing in profile/level for subsequent SPS.
62609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "avcHandle"  "Pointer to AVCHandle."
63609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to AVCCommonObj."
64609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "FrameHeightInMbs"   "Height of the frame in the unit of MBs."
65609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicWidthInMbs"  "Width of the picture in the unit of MBs."
66609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "padding"    "Flag specifying whether padding in luma component is needed (used for encoding)."
67609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL."
68609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
69609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberAVCStatus InitDPB(AVCHandle *avcHandle, AVCCommonObj *video, int FrameHeightInMbs, int PicWidthInMbs, bool padding);
70609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
71609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
72609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function frees the DPB memory.
73609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "avcHandle"  "Pointer to AVCHandle."
74609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to AVCCommonObj."
75609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL."
76609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
77609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF AVCStatus CleanUpDPB(AVCHandle *avcHandle, AVCCommonObj *video);
78609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
79609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
80609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function finds empty frame in the decoded picture buffer to be used for the
81609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubercurrent picture, initializes the corresponding picture structure with Sl, Scb, Scr,
82609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberwidth, height and pitch.
83609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "avcHandle" "Pointer to the main handle object."
84609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
85609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL."
86609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
87609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF AVCStatus DPBInitBuffer(AVCHandle *avcHandle, AVCCommonObj *video);
88609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
89609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function finds empty frame in the decoded picture buffer to be used for the
90609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubercurrent picture, initializes the corresponding picture structure with Sl, Scb, Scr,
91609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberwidth, height and pitch.
92609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
93609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "CurrPicNum" "Current picture number (only used in decoder)."
94609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL."
95609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
96609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
97609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF void DPBInitPic(AVCCommonObj *video, int CurrPicNum);
98609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
99609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
100609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function releases the current frame back to the available pool for skipped frame after encoding.
101609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "avcHandle" "Pointer to the main handle object."
102609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to the AVCCommonObj."
103609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void."
104609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
105609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF void DPBReleaseCurrentFrame(AVCHandle *avcHandle, AVCCommonObj *video);
106609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
107609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
108609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs decoded reference picture marking process and store the current picture to the
109609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubercorresponding frame storage in the decoded picture buffer.
110609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "avcHandle" "Pointer to the main handle object."
111609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to the AVCCommonObj."
112609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL."
113609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
114609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF AVCStatus StorePictureInDPB(AVCHandle *avcHandle, AVCCommonObj *video);
115609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
116609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
117609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function perform sliding window operation on the reference picture lists, see subclause 8.2.5.3.
118609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberIt removes short-term ref frames with smallest FrameNumWrap from the reference list.
119609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "avcHandle" "Pointer to the main handle object."
120609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to the AVCCommonObj."
121609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "dpb"  "Pointer to the AVCDecPicBuffer."
122609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL (contradicting values or scenario as in the Note in the draft)."
123609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
124609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberAVCStatus sliding_window_process(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb);
125609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
126609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
127609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
128609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function perform adaptive memory marking operation on the reference picture lists,
129609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubersee subclause 8.2.5.4. It calls other functions for specific operations.
130609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to the AVCCommonObj."
131609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "dpb"  "Pointer to the AVCDecPicBuffer."
132609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "sliceHdr"   "Pointer to the AVCSliceHeader."
133609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL (contradicting values or scenario as in the Note in the draft)."
134609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
135609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberAVCStatus adaptive_memory_marking(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb, AVCSliceHeader *sliceHdr);
136609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
137609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
138609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs memory management control operation 1, marking a short-term picture
139609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberas unused for reference. See subclause 8.2.5.4.1.
140609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to the AVCCommonObj."
141609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "dpb"  "Pointer to the AVCDecPicBuffer."
142609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "difference_of_pic_nums_minus1"  "From the syntax in dec_ref_pic_marking()."
143609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
144609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid MemMgrCtrlOp1(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb, int difference_of_pic_nums_minus1);
145609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
146609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
147609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs memory management control operation 2, marking a long-term picture
148609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberas unused for reference. See subclause 8.2.5.4.2.
149609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "dpb"  "Pointer to the AVCDecPicBuffer."
150609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "field_pic_flag"  "Flag whether the current picture is field or not."
151609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "long_term_pic_num"  "From the syntax in dec_ref_pic_marking()."
152609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
153609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid MemMgrCtrlOp2(AVCHandle *avcHandle, AVCDecPicBuffer *dpb, int long_term_pic_num);
154609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
155609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
156609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs memory management control operation 3, assigning a LongTermFrameIdx to
157609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubera short-term reference picture. See subclause 8.2.5.4.3.
158609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to the AVCCommonObj."
159609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "dpb"  "Pointer to the AVCDecPicBuffer."
160609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "difference_of_pic_nums_minus1"  "From the syntax in dec_ref_pic_marking()."
161609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "long_term_pic_num"  "From the syntax in dec_ref_pic_marking()."
162609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
163609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid MemMgrCtrlOp3(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb, uint difference_of_pic_nums_minus1,
164609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber                   uint long_term_frame_idx);
165609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
166609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
167609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs memory management control operation 4, getting new MaxLongTermFrameIdx.
168609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber See subclause 8.2.5.4.4.
169609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to the AVCCommonObj."
170609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "dpb"  "Pointer to the AVCDecPicBuffer."
171609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "max_long_term_frame_idx_plus1"  "From the syntax in dec_ref_pic_marking()."
172609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
173609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid MemMgrCtrlOp4(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb, uint max_long_term_frame_idx_plus1);
174609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
175609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
176609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs memory management control operation 5, marking all reference pictures
177609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberas unused for reference and set MaxLongTermFrameIdx to no long-termframe indices.
178609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber See subclause 8.2.5.4.5.
179609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to the AVCCommonObj."
180609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "dpb"  "Pointer to the AVCDecPicBuffer."
181609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
182609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid MemMgrCtrlOp5(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb);
183609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
184609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
185609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs memory management control operation 6, assigning a long-term frame index
186609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberto the current picture. See subclause 8.2.5.4.6.
187609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to the AVCCommonObj."
188609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "dpb"  "Pointer to the AVCDecPicBuffer."
189609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "long_term_frame_idx"  "From the syntax in dec_ref_pic_marking()."
190609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
191609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid MemMgrCtrlOp6(AVCHandle *avcHandle, AVCCommonObj *video, AVCDecPicBuffer *dpb, uint long_term_frame_idx);
192609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
193609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
194609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function mark a long-term ref frame with a specific frame index as unused for reference.
195609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "dpb"  "Pointer to the AVCDecPicBuffer."
196609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "long_term_frame_idx"  "To look for"
197609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
198609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid unmark_long_term_frame_for_reference_by_frame_idx(AVCHandle *avcHandle, AVCDecPicBuffer *dpb, uint long_term_frame_idx);
199609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
200609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
201609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function mark a long-term ref field with a specific frame index as unused for reference except
202609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubera frame that contains a picture with picNumX.
203609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "dpb"  "Pointer to the AVCDecPicBuffer."
204609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "long_term_frame_idx"  "To look for."
205609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "picNumX"    "To look for."
206609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
207609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid unmark_long_term_field_for_reference_by_frame_idx(AVCCommonObj *video, AVCDecPicBuffer *dpb, uint long_term_frame_indx, int picNumX);
208609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
209609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
210609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function mark a frame to unused for reference.
211609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "fs" "Pointer to AVCFrameStore to be unmarked."
212609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
213609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid unmark_for_reference(AVCHandle *avcHandle, AVCDecPicBuffer *dpb, uint idx);
214609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
215609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid update_ref_list(AVCDecPicBuffer *dpb);
216609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
217609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
218609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/*---------- fmo.c --------------*/
219609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
220609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function initializes flexible macroblock reordering.
221609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
222609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS for success and AVC_FAIL otherwise."
223609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
224609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF AVCStatus FMOInit(AVCCommonObj *video);
225609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
226609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
227609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function fills up an array that maps Map unit to the slice group
228609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberfollowing the interleaved slice group map type.
229609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
230609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "run_length_minus1"  "Array of the run-length."
231609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "num_slice_groups_minus_1"   "Number of slice group minus 1."
232609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
233609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "Void."
234609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
235609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid FmoGenerateType0MapUnitMap(int *mapUnitToSliceGroupMap, uint *run_length_minus1, uint num_slice_groups_minus1, uint PicSizeInMapUnits);
236609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
237609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
238609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function fills up an array that maps Map unit to the slice group
239609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberfollowing the dispersed slice group map type.
240609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
241609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicWidthInMbs"  "Width of the luma picture in macroblock unit."
242609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "num_slice_groups_minus_1"   "Number of slice group minus 1."
243609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
244609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "Void."
245609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
246609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid FmoGenerateType1MapUnitMap(int *mapUnitToSliceGroupMap, int PicWidthInMbs, uint num_slice_groups_minus1, uint PicSizeInMapUnits);
247609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
248609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
249609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function fills up an array that maps Map unit to the slice group
250609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberfollowing the foreground with left-over slice group map type.
251609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "pps"    "Pointer to AVCPicParamSets structure."
252609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
253609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicWidthInMbs"  "Width of the luma picture in macroblock unit."
254609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "num_slice_groups_minus_1"   "Number of slice group minus 1."
255609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
256609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "Void."
257609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
258609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid FmoGenerateType2MapUnitMap(AVCPicParamSet *pps, int *mapUnitToSliceGroupMap, int PicWidthInMbs,
259609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber                                uint num_slice_groups_minus1, uint PicSizeInMapUnits);
260609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
261609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
262609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function fills up an array that maps Map unit to the slice group
263609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberfollowing the box-out slice group map type.
264609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "pps"    "Pointer to AVCPicParamSets structure."
265609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
266609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicWidthInMbs"  "Width of the luma picture in macroblock unit."
267609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "Void."
268609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
269609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid FmoGenerateType3MapUnitMap(AVCCommonObj *video, AVCPicParamSet* pps, int *mapUnitToSliceGroupMap,
270609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber                                int PicWidthInMbs);
271609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
272609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
273609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function fills up an array that maps Map unit to the slice group
274609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberfollowing the raster scan slice group map type.
275609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
276609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "MapUnitsInSliceGroup0"  "Derived in subclause 7.4.3."
277609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "slice_group_change_direction_flag"  "A value from the slice header."
278609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
279609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
280609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
281609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid FmoGenerateType4MapUnitMap(int *mapUnitToSliceGroupMap, int MapUnitsInSliceGroup0,
282609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber                                int slice_group_change_direction_flag, uint PicSizeInMapUnits);
283609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
284609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
285609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function fills up an array that maps Map unit to the slice group
286609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberfollowing wipe slice group map type.
287609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
288609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj structure."
289609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "slice_group_change_direction_flag"  "A value from the slice header."
290609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
291609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
292609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
293609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid FmoGenerateType5MapUnitMap(int *mapUnitsToSliceGroupMap, AVCCommonObj *video,
294609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber                                int slice_group_change_direction_flag, uint PicSizeInMapUnits);
295609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
296609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
297609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function fills up an array that maps Map unit to the slice group
298609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberfollowing wipe slice group map type.
299609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "mapUnitToSliceGroupMap" "Array of slice group mapping."
300609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "slice_group_id" "Array of slice_group_id from AVCPicParamSet structure."
301609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicSizeInMapUnit"   "Size of the picture in number Map units."
302609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
303609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
304609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid FmoGenerateType6MapUnitMap(int *mapUnitsToSliceGroupMap, int *slice_group_id, uint PicSizeInMapUnits);
305609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
306609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/*------------- itrans.c --------------*/
307609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
308609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs transformation of the Intra16x16DC value according to
309609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubersubclause 8.5.6.
310609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "block"  "Pointer to the video->block[0][0][0]."
311609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "QPy"    "Quantization parameter."
312609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void."
313609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
314609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid Intra16DCTrans(int16 *block, int Qq, int Rq);
315609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
316609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
317609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs transformation of a 4x4 block according to
318609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubersubclause 8.5.8.
319609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "block"  "Pointer to the origin of transform coefficient area."
320609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "pred"   "Pointer to the origin of predicted area."
321609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "cur"    "Pointer to the origin of the output area."
322609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "width"  "Pitch of cur."
323609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void."
324609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
325609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid itrans(int16 *block, uint8 *pred, uint8 *cur, int width);
326609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
327609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/*
328609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function is the same one as itrans except for chroma.
329609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "block"  "Pointer to the origin of transform coefficient area."
330609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "pred"   "Pointer to the origin of predicted area."
331609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "cur"    "Pointer to the origin of the output area."
332609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "width"  "Pitch of cur."
333609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void."
334609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
335609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid ictrans(int16 *block, uint8 *pred, uint8 *cur, int width);
336609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
337609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
338609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs transformation of the DCChroma value according to
339609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubersubclause 8.5.7.
340609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "block"  "Pointer to the video->block[0][0][0]."
341609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "QPc"    "Quantization parameter."
342609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void."
343609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
344609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid ChromaDCTrans(int16 *block, int Qq, int Rq);
345609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
346609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
347609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function copies a block from pred to cur.
348609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "pred"   "Pointer to prediction block."
349609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "cur"    "Pointer to the current YUV block."
350609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "width"  "Pitch of cur memory."
351609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "pred_pitch" "Pitch for pred memory.
352609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void."
353609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
354609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid copy_block(uint8 *pred, uint8 *cur, int width, int pred_pitch);
355609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
356609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/*--------- mb_access.c ----------------*/
357609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
358609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function initializes the neighboring information before start macroblock decoding.
359609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
360609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "mbNum"  "The current macroblock index."
361609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "currMB" "Pointer to the current AVCMacroblock structure."
362609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
363609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
364609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF void InitNeighborAvailability(AVCCommonObj *video, int mbNum);
365609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
366609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
367609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function checks whether the requested neighboring macroblock is available.
368609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "MbToSliceGroupMap"  "Array containing the slice group ID mapping to MB index."
369609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "PicSizeInMbs"   "Size of the picture in number of MBs."
370609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "mbAddr"     "Neighboring macroblock index to check."
371609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "currMbAddr" "Current macroblock index."
372609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "TRUE if the neighboring MB is available, FALSE otherwise."
373609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
374609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberbool mb_is_available(AVCMacroblock *mblock, uint PicSizeInMbs, int mbAddr, int currMbAddr);
375609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
376609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
377609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs prediction of the nonzero coefficient for a luma block (i,j).
378609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
379609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "i"  "Block index, horizontal."
380609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "j"  "Block index, vertical."
381609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "Predicted number of nonzero coefficient."
382609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
383609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF int predict_nnz(AVCCommonObj *video, int i, int j);
384609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
385609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
386609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs prediction of the nonzero coefficient for a chroma block (i,j).
387609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
388609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "i"  "Block index, horizontal."
389609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "j"  "Block index, vertical."
390609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "Predicted number of nonzero coefficient."
391609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
392609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF int predict_nnz_chroma(AVCCommonObj *video, int i, int j);
393609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
394609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
395609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function calculates the predicted motion vectors for the current macroblock.
396609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video" "Pointer to AVCCommonObj."
397609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "encFlag"    "Boolean whether this function is used by encoder or decoder."
398609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void."
399609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
400609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF void GetMotionVectorPredictor(AVCCommonObj *video, int encFlag);
401609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
402609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/*---------- reflist.c -----------------*/
403609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
404609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function initializes reference picture list used in INTER prediction
405609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberat the beginning of each slice decoding. See subclause 8.2.4.
406609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
407609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
408609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOutput is video->RefPicList0, video->RefPicList1, video->refList0Size and video->refList1Size.
409609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
410609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF void RefListInit(AVCCommonObj *video);
411609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
412609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
413609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function generates picture list from frame list. Used when current picture is field.
414609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubersee subclause 8.2.4.2.5.
415609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
416609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "IsL1"   "Is L1 list?"
417609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "long_term"  "Is long-term prediction?"
418609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
419609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
420609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid    GenPicListFromFrameList(AVCCommonObj *video, int IsL1, int long_term);
421609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
422609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
423609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs reference picture list reordering according to the
424609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberref_pic_list_reordering() syntax. See subclause 8.2.4.3.
425609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
426609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL"
427609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOutput is video->RefPicList0, video->RefPicList1, video->refList0Size and video->refList1Size.
428609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
429609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOSCL_IMPORT_REF AVCStatus ReOrderList(AVCCommonObj *video);
430609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
431609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
432609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs reference picture list reordering according to the
433609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberref_pic_list_reordering() syntax regardless of list 0 or list 1. See subclause 8.2.4.3.
434609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
435609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "isL1"   "Is list 1 or not."
436609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL"
437609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberOutput is video->RefPicList0 and video->refList0Size or video->RefPicList1 and video->refList1Size.
438609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
439609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberAVCStatus ReorderRefPicList(AVCCommonObj *video, int isL1);
440609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
441609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
442609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs reordering process of reference picture list for short-term pictures.
443609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberSee subclause 8.2.4.3.1.
444609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
445609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "picNumLX"   "picNumLX of an entry in the reference list."
446609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "refIdxLX"   "Pointer to the current entry index in the reference."
447609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "isL1"       "Is list 1 or not."
448609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL"
449609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
450609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberAVCStatus ReorderShortTerm(AVCCommonObj *video, int picNumLX, int *refIdxLX, int isL1);
451609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
452609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
453609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function performs reordering process of reference picture list for long-term pictures.
454609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberSee subclause 8.2.4.3.2.
455609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
456609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "LongTermPicNum" "LongTermPicNum of an entry in the reference list."
457609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "refIdxLX"   "Pointer to the current entry index in the reference."
458609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "isL1"       "Is list 1 or not."
459609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "AVC_SUCCESS or AVC_FAIL"
460609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
461609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberAVCStatus ReorderLongTerm(AVCCommonObj *video, int LongTermPicNum, int *refIdxLX, int isL1);
462609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
463609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
464609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function gets the pictures in DPB according to the PicNum.
465609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
466609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "picNum" "PicNum of the picture we are looking for."
467609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "Pointer to the AVCPictureData or NULL if not found"
468609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
469609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberAVCPictureData*  GetShortTermPic(AVCCommonObj *video, int picNum);
470609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
471609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
472609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function gets the pictures in DPB according to the LongtermPicNum.
473609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "video"  "Pointer to AVCCommonObj."
474609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "LongtermPicNum" "LongtermPicNum of the picture we are looking for."
475609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "Pointer to the AVCPictureData."
476609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
477609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberAVCPictureData*  GetLongTermPic(AVCCommonObj *video, int LongtermPicNum);
478609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
479609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
480609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function indicates whether the picture is used for short-term reference or not.
481609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "s"  "Pointer to AVCPictureData."
482609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "1 if it is used for short-term, 0 otherwise."
483609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
484609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberint is_short_ref(AVCPictureData *s);
485609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
486609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
487609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function indicates whether the picture is used for long-term reference or not.
488609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "s"  "Pointer to AVCPictureData."
489609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "1 if it is used for long-term, 0 otherwise."
490609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
491609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberint is_long_ref(AVCPictureData *s);
492609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
493609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
494609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function sorts array of pointers to AVCPictureData in descending order of
495609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberthe PicNum value.
496609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "data"   "Array of pointers to AVCPictureData."
497609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "num"    "Size of the array."
498609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
499609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
500609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid SortPicByPicNum(AVCPictureData *data[], int num);
501609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
502609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
503609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function sorts array of pointers to AVCPictureData in ascending order of
504609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberthe PicNum value.
505609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "data"   "Array of pointers to AVCPictureData."
506609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "num"    "Size of the array."
507609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
508609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
509609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid SortPicByPicNumLongTerm(AVCPictureData *data[], int num);
510609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
511609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
512609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function sorts array of pointers to AVCFrameStore in descending order of
513609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberthe FrameNumWrap value.
514609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "data"   "Array of pointers to AVCFrameStore."
515609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "num"    "Size of the array."
516609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
517609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
518609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid SortFrameByFrameNumWrap(AVCFrameStore *data[], int num);
519609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
520609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
521609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function sorts array of pointers to AVCFrameStore in ascending order of
522609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberthe LongTermFrameIdx value.
523609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "data"   "Array of pointers to AVCFrameStore."
524609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "num"    "Size of the array."
525609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
526609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
527609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid SortFrameByLTFrameIdx(AVCFrameStore *data[], int num);
528609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
529609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
530609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function sorts array of pointers to AVCPictureData in descending order of
531609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberthe PicOrderCnt value.
532609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "data"   "Array of pointers to AVCPictureData."
533609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "num"    "Size of the array."
534609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
535609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
536609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid SortPicByPOC(AVCPictureData *data[], int num, int descending);
537609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
538609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
539609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function sorts array of pointers to AVCPictureData in ascending order of
540609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberthe LongTermPicNum value.
541609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "data"   "Array of pointers to AVCPictureData."
542609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "num"    "Size of the array."
543609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
544609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
545609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid SortPicByLTPicNum(AVCPictureData *data[], int num);
546609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
547609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber/**
548609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas HuberThis function sorts array of pointers to AVCFrameStore in descending order of
549609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huberthe PicOrderCnt value.
550609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "data"   "Array of pointers to AVCFrameStore."
551609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\param "num"    "Size of the array."
552609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber\return "void"
553609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber*/
554609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Hubervoid SortFrameByPOC(AVCFrameStore *data[], int num, int descending);
555609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
556609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber
557609f1a00c96cf5605f4614e7bb6d0487c98969c5Andreas Huber#endif /* _AVCCOMMON_LIB_H_ */
558