blob: e6c28cfddb6b9a95b6e8e17a1971dd6827850c73
1 | /* The copyright in this software is being made available under the BSD |
2 | * License, included below. This software may be subject to other third party |
3 | * and contributor rights, including patent rights, and no such rights are |
4 | * granted under this license. |
5 | * |
6 | * Copyright (c) 2002-2016, Audio Video coding Standard Workgroup of China |
7 | * All rights reserved. |
8 | * |
9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions are met: |
11 | * |
12 | * * Redistributions of source code must retain the above copyright notice, |
13 | * this list of conditions and the following disclaimer. |
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
15 | * this list of conditions and the following disclaimer in the documentation |
16 | * and/or other materials provided with the distribution. |
17 | * * Neither the name of Audio Video coding Standard Workgroup of China |
18 | * nor the names of its contributors maybe |
19 | * used to endorse or promote products |
20 | * derived from this software without |
21 | * specific prior written permission. |
22 | * |
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
27 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
33 | * THE POSSIBILITY OF SUCH DAMAGE. |
34 | */ |
35 | |
36 | |
37 | |
38 | |
39 | /* |
40 | * File name: global.h |
41 | * Function: global definitions for for AVS decoder. |
42 | * |
43 | */ |
44 | |
45 | #ifndef _GLOBAL_H_ |
46 | #define _GLOBAL_H_ |
47 | |
48 | /* #include <stdio.h> //!< for FILE */ |
49 | /* #include <stdlib.h> */ |
50 | |
51 | #define AML |
52 | #define SANITY_CHECK |
53 | #undef NO_DISPLAY |
54 | |
55 | /* #include "define.h" */ |
56 | #define RD "19.2" |
57 | #define VERSION "19.2" |
58 | |
59 | #define RESERVED_PROFILE_ID 0x24 |
60 | #define BASELINE_PICTURE_PROFILE 18 |
61 | #define BASELINE_PROFILE 32 /* 0x20 */ |
62 | #define BASELINE10_PROFILE 34 /* 0x22 */ |
63 | |
64 | |
65 | #define SCENE_PROFILE 48 /* 0x21 */ |
66 | #define SCENE10_PROFILE 50 /* 0x23 */ |
67 | |
68 | #define TRACE 0 /* !< 0:Trace off 1:Trace on */ |
69 | |
70 | |
71 | /* Type definitions and file operation for Windows/Linux |
72 | * All file operations for windows are replaced with native (FILE *) operations |
73 | * Falei LUO (falei.luo@vipl.ict.ac.cn) |
74 | * */ |
75 | |
76 | #define _FILE_OFFSET_BITS 64 /* for 64 bit fseeko */ |
77 | #define fseek fseeko |
78 | |
79 | #define int16 int16_t |
80 | #define int64 int64_t |
81 | |
82 | /* ////////////////// bug fix ///////////////////////////// */ |
83 | #define ALFSliceFix 1 |
84 | #define WRITENBIT_FIX 1 |
85 | #define FIX_PROFILE_LEVEL_DPB_RPS_1 1 |
86 | #define FIX_PROFILE_LEVEL_DPB_RPS_2 1 |
87 | #define FIX_RPS_PICTURE_REMOVE 1 /* flluo@pku.edu.cn */ |
88 | #define Mv_Clip 1 /* yuquanhe@hisilicon.com */ |
89 | #define REMOVE_UNUSED 1 /* yuquanhe@hisilicon.com */ |
90 | #define SAO_Height_Fix 1 /* yuquanhe@hisilicon.com */ |
91 | #define B_BACKGROUND_Fix 1 /* yuquanhe@hisilicon.com */ |
92 | #define Check_Bitstream 1 /* yuquanhe@hisilicon.com */ |
93 | #define Wq_param_Clip 1 /* yuquanhe@hisilicon.com */ |
94 | /* luofalei flluo@pku.edu.cn , wlq15@mails.tsinghua.edu.cn , |
95 | Longfei.Wang@mediatek.com */ |
96 | #define RD1501_FIX_BG 1 |
97 | /* yuquanhe@hisilicon.com ; he-yuan.lin@mstarsemi.com */ |
98 | #define Mv_Rang 1 |
99 | /* Longfei.Wang@mediatek.com ;fred.chiu@mediatek.com |
100 | jie1222.chen@samsung.com */ |
101 | #define RD160_FIX_BG 1 |
102 | /* Y_K_Tu@novatek.com.tw, he-yuan.lin@mstarsemi.com, |
103 | victor.huang@montage-tech.com M4041 */ |
104 | #define RD1601_FIX_BG 1 |
105 | #define SEQ_CHANGE_CHECKER 1 /* he-yuan.lin@mstarsemi.com */ |
106 | #define M4140_END_OF_SLICE_CHECKER 1 /* he-yuan.lin@mstarsemi.com */ |
107 | /* wlq15@mails.tsinghua.edu.cn */ |
108 | #define Mv_check_bug 1 |
109 | #define SAO_ASSERTION_FIX 1 /* fred.chiu@mediatek.com */ |
110 | #define FIELD_HORI_MV_NO_SCALE_FIX 1 /* fred.chiu@mediatek.com */ |
111 | #define RD170_FIX_BG 1 |
112 | #define FIX_CHROMA_FIELD_MV_BK_DIST 1 |
113 | #define FIX_LUMA_FIELD_MV_BK_DIST 1 |
114 | #define FIX_CHROMA_FIELD_MV_CLIP 1 |
115 | #if 1 |
116 | #define FIX_FLUSH_DPB_BY_LF 1 /* fred.chiu@mediatek.com */ |
117 | #define FIX_SEQ_END_FLUSH_DPB_BY_LF 1 /* fred.chiu@mediatek.com */ |
118 | #else |
119 | #define FIX_FLUSH_DPB_BY_LF 0 /* fred.chiu@mediatek.com */ |
120 | #define FIX_SEQ_END_FLUSH_DPB_BY_LF 0 /* fred.chiu@mediatek.com */ |
121 | #endif |
122 | #define RD191_FIX_BUG 1 /* yuquanhe@hsilicon.com */ |
123 | #define SYM_MV_SCALE_FIX 1/* peisong.chen@broadcom.com */ |
124 | #define BUG_10BIT_REFINEQP 0 /* wangzhenyu */ |
125 | |
126 | |
127 | |
128 | #if RD191_FIX_BUG |
129 | #endif |
130 | |
131 | /************************ |
132 | * AVS2 macros start |
133 | **************************/ |
134 | |
135 | #define INTERLACE_CODING 1 |
136 | #if INTERLACE_CODING /* M3531: MV scaling compensation */ |
137 | /* Luma component */ |
138 | #define HALF_PIXEL_COMPENSATION 1 /* common functions definition */ |
139 | #define HALF_PIXEL_COMPENSATION_PMV 1 /* spacial MV prediction */ |
140 | #define HALF_PIXEL_COMPENSATION_DIRECT 1 /* B direct mode */ |
141 | /* MV derivation method 1, weighted P_skip mode */ |
142 | #define HALF_PIXEL_COMPENSATION_M1 1 |
143 | /* M1 related with mv-scaling function */ |
144 | #define HALF_PIXEL_COMPENSATION_M1_FUCTION 1 |
145 | #define HALF_PIXEL_COMPENSATION_MVD 1 /* MV scaling from FW->BW */ |
146 | /* Chroma components */ |
147 | /* chroma MV is scaled with luma MV for 4:2:0 format */ |
148 | #define HALF_PIXEL_CHROMA 1 |
149 | /* half pixel compensation for p skip/direct */ |
150 | #define HALF_PIXEL_PSKIP 1 |
151 | #define INTERLACE_CODING_FIX 1 /* HLS fix */ |
152 | #define OUTPUT_INTERLACE_MERGED_PIC 1 |
153 | |
154 | #endif |
155 | /* |
156 | ******************************* |
157 | AVS2 10bit/12bit profile |
158 | ******************************** |
159 | */ |
160 | |
161 | #define DBFIX_10bit 1 |
162 | |
163 | #define BUG_10bit 1 |
164 | |
165 | /* |
166 | *************************************** |
167 | AVS2 HIGH LEVEL SYNTAX |
168 | *************************************** |
169 | */ |
170 | #define AVS2_HDR_HLS 1 |
171 | /* AVS2 HDR technology //yuquanhe@hisilicon.com */ |
172 | #define AVS2_HDR_Tec 1 |
173 | #if AVS2_HDR_Tec |
174 | #define HDR_CHROMA_DELTA_QP 1 /* M3905 */ |
175 | #define HDR_ADPTIVE_UV_DELTA 1 |
176 | #endif |
177 | /* |
178 | ************************************* |
179 | AVS2 S2 |
180 | ************************************* |
181 | */ |
182 | #define AVS2_S2_FASTMODEDECISION 1 |
183 | #define RD1510_FIX_BG 1 /* 20160714, flluo@pku.edu.cn */ |
184 | |
185 | |
186 | /* ////////////////// prediction techniques ///////////////////////////// */ |
187 | #define LAM_2Level_TU 0.8 |
188 | |
189 | |
190 | #define DIRECTION 4 |
191 | #define DS_FORWARD 4 |
192 | #define DS_BACKWARD 2 |
193 | #define DS_SYM 3 |
194 | #define DS_BID 1 |
195 | |
196 | #define MH_PSKIP_NUM 4 |
197 | #define NUM_OFFSET 0 |
198 | #define BID_P_FST 1 |
199 | #define BID_P_SND 2 |
200 | #define FW_P_FST 3 |
201 | #define FW_P_SND 4 |
202 | #define WPM_NUM 3 |
203 | /* M3330 changes it to 2, the original value is 3 */ |
204 | #define MAX_MVP_CAND_NUM 2 |
205 | |
206 | #define DMH_MODE_NUM 5 /* Number of DMH mode */ |
207 | #define TH_ME 0 /* Threshold of ME */ |
208 | |
209 | #define MV_SCALE 1 |
210 | |
211 | /* ///// reference picture management // */ |
212 | #define FIX_MAX_REF 1 /* Falei LUO, flluo@pku.edu.cn */ |
213 | #if FIX_MAX_REF |
214 | /* maximum number of reference frame for each frame */ |
215 | #define MAXREF 7 |
216 | #define MAXGOP 32 |
217 | #endif |
218 | |
219 | /* #define REF_MAXBUFFER 7 */ |
220 | /* more bufferes for displaying and background */ |
221 | /* #define REF_MAXBUFFER 15 */ |
222 | #if 1 |
223 | #define REF_MAXBUFFER 23 |
224 | #define REF_BUFFER 16 |
225 | #else |
226 | #if RD170_FIX_BG |
227 | #define REF_MAXBUFFER 16 |
228 | #else |
229 | #define REF_MAXBUFFER 7 |
230 | #endif |
231 | #endif |
232 | |
233 | #ifdef TO_PORTING |
234 | /* block-composed background reference, fangdong@mail.ustc.edu.cn */ |
235 | #define BCBR 1 |
236 | #else |
237 | #define BCBR 0 |
238 | #endif |
239 | /* one more buffer for background when background_picture_output_flag is 0*/ |
240 | #define AVS2_MAX_BUFFER_NUM (REF_MAXBUFFER + 1) |
241 | |
242 | /* /////////////////Adaptive Loop Filter////////////////////////// */ |
243 | #define NUM_ALF_COEFF_CTX 1 |
244 | #define NUM_ALF_LCU_CTX 4 |
245 | |
246 | #define LAMBDA_SCALE_LUMA (1.0) |
247 | #define LAMBDA_SCALE_CHROMA (1.0) |
248 | |
249 | |
250 | |
251 | /* ////////////////// entropy coding ///////////////////////////// */ |
252 | /* M3090: Make sure rs1 will not overflow for 8-bit unsign char */ |
253 | #define NUN_VALUE_BOUND 254 |
254 | #define Encoder_BYPASS_Final 1 /* M3484 */ |
255 | #define Decoder_Bypass_Annex 0 /* M3484 */ |
256 | #define Decoder_Final_Annex 0 /* M3540 */ |
257 | |
258 | |
259 | /* ////////////////// coefficient coding ///// */ |
260 | /* M3035 size of an coefficient group, 4x4 */ |
261 | #define CG_SIZE 16 |
262 | |
263 | #define SWAP(x, y) {\ |
264 | (y) = (y) ^ (x);\ |
265 | (x) = (y) ^ (x);\ |
266 | (y) = (x) ^ (y);\ |
267 | } |
268 | |
269 | /* ////////////////// encoder optimization /////// */ |
270 | #define TH 2 |
271 | |
272 | #define M3624MDLOG /* reserved */ |
273 | |
274 | #define TDRDO 1 /* M3528 */ |
275 | /* #define FIX_TDRDO_BG 1 // flluo@pku.edu.cn, 20160318// */ |
276 | #define RATECONTROL 1 /* M3580 M3627 M3689 */ |
277 | #define AQPO 1 /* M3623 */ |
278 | #define AQPOM3694 0 |
279 | #define AQPOM4063 1 |
280 | #define AQPOM3762 1 |
281 | #define BGQPO 1 /* M4061 */ |
282 | #if BGQPO |
283 | #define LONGREFERENCE 32 |
284 | #endif |
285 | |
286 | /* #define REPORT */ |
287 | /* ////////////////// Quantization /////////////////////////////////////// */ |
288 | /* Adaptive frequency weighting quantization */ |
289 | #define FREQUENCY_WEIGHTING_QUANTIZATION 1 |
290 | #if FREQUENCY_WEIGHTING_QUANTIZATION |
291 | #define CHROMA_DELTA_QP 1 |
292 | #define AWQ_WEIGHTING 1 |
293 | #define AWQ_LARGE_BLOCK_ENABLE 1 |
294 | #define COUNT_BIT_OVERHEAD 0 |
295 | #define AWQ_LARGE_BLOCK_EXT_MAPPING 1 |
296 | #endif |
297 | |
298 | #define QuantClip 1 |
299 | #define QuantMatrixClipFix 1 /* 20160418, fllu@pku.edu.cn */ |
300 | |
301 | #define WQ_MATRIX_FCD 1 |
302 | #if !WQ_MATRIX_FCD |
303 | #define WQ_FLATBASE_INBIT 7 |
304 | #else |
305 | #define WQ_FLATBASE_INBIT 6 |
306 | #endif |
307 | |
308 | |
309 | #define REFINED_QP 1 |
310 | |
311 | |
312 | /* ////////////////// delta QP ///// */ |
313 | /* M3122: the minimum dQP unit is Macro block */ |
314 | #define MB_DQP 1 |
315 | /* M3122: 1 represents left prediction |
316 | and 0 represents previous prediction */ |
317 | #define LEFT_PREDICTION 1 |
318 | |
319 | |
320 | /* //////////////////////SAO///////// */ |
321 | #define NUM_BO_OFFSET 32 |
322 | #define MAX_NUM_SAO_CLASSES 32 |
323 | #define NUM_SAO_BO_CLASSES_LOG2 5 |
324 | #define NUM_SAO_BO_CLASSES_IN_BIT 5 |
325 | #define MAX_DOUBLE (1.7e + 308) |
326 | #define NUM_SAO_EO_TYPES_LOG2 2 |
327 | #define NUM_SAO_BO_CLASSES (1<<NUM_SAO_BO_CLASSES_LOG2) |
328 | #define SAO_RATE_THR 0.75 |
329 | #define SAO_RATE_CHROMA_THR 1 |
330 | #define SAO_SHIFT_PIX_NUM 4 |
331 | |
332 | #define SAO_PARA_CROSS_SLICE 1 |
333 | #define SAO_MULSLICE_FTR_FIX 1 |
334 | |
335 | /* /////////////////// Transform ///////////////////// */ |
336 | #define SEC_TR_SIZE 4 |
337 | /* apply secT to greater than or equal to 8x8 block, */ |
338 | #define SEC_TR_MIN_BITSIZE 3 |
339 | |
340 | #define BUGFIXED_COMBINED_ST_BD 1 |
341 | |
342 | /* /////////////////// Scalable ///////////////////// */ |
343 | #define M3480_TEMPORAL_SCALABLE 1 |
344 | #define TEMPORAL_MAXLEVEL 8 |
345 | #define TEMPORAL_MAXLEVEL_BIT 3 |
346 | |
347 | |
348 | |
349 | |
350 | /* |
351 | ************************************* |
352 | * AVS2 macros end |
353 | * |
354 | ************************************* |
355 | */ |
356 | |
357 | #define CHROMA 1 |
358 | #define LUMA_8x8 2 |
359 | #define NUM_BLOCK_TYPES 8 |
360 | |
361 | #if (!defined clamp) |
362 | /* !< clamp a to the range of [b;c] */ |
363 | #define clamp(a, b, c) ((a) < (b) ? (b) : ((a) > (c) ? (c) : (a))) |
364 | #endif |
365 | |
366 | /* POC200301 moved from defines.h */ |
367 | #define LOG2_MAX_FRAME_NUM_MINUS4 4 |
368 | /* !< bytes for one frame */ |
369 | #define MAX_CODED_FRAME_SIZE 15000000 |
370 | |
371 | /* ----------------------- */ |
372 | /* FLAGS and DEFINES for new chroma intra prediction, Dzung Hoang */ |
373 | /* Threshold values to zero out quantized transform coefficients. */ |
374 | /* Recommend that _CHROMA_COEFF_COST_ be low to improve chroma quality */ |
375 | #define _LUMA_COEFF_COST_ 4 /* !< threshold for luma coeffs */ |
376 | /* !< Number of pixels padded around the reference frame (>=4) */ |
377 | #define IMG_PAD_SIZE 64 |
378 | |
379 | #define OUTSTRING_SIZE 255 |
380 | |
381 | /* !< abs macro, faster than procedure */ |
382 | #define absm(A) ((A) < (0) ? (-(A)) : (A)) |
383 | /* !< used for start value for some variables */ |
384 | #define MAX_VALUE 999999 |
385 | |
386 | #define Clip1(a) ((a) > 255 ? 255:((a) < 0 ? 0 : (a))) |
387 | #define Clip3(min, max, val) (((val) < (min)) ?\ |
388 | (min) : (((val) > (max)) ? (max) : (val))) |
389 | |
390 | /* --------------------------------------------- */ |
391 | |
392 | /* block size of block transformed by AVS */ |
393 | #define PSKIPDIRECT 0 |
394 | #define P2NX2N 1 |
395 | #define P2NXN 2 |
396 | #define PNX2N 3 |
397 | #define PHOR_UP 4 |
398 | #define PHOR_DOWN 5 |
399 | #define PVER_LEFT 6 |
400 | #define PVER_RIGHT 7 |
401 | #define PNXN 8 |
402 | #define I8MB 9 |
403 | #define I16MB 10 |
404 | #define IBLOCK 11 |
405 | #define InNxNMB 12 |
406 | #define INxnNMB 13 |
407 | #define MAXMODE 14 /* add yuqh 20130824 */ |
408 | #define LAMBDA_ACCURACY_BITS 16 |
409 | #define LAMBDA_FACTOR(lambda) ((int)((double)(1 << LAMBDA_ACCURACY_BITS)\ |
410 | * lambda + 0.5)) |
411 | #define WEIGHTED_COST(factor, bits) (((factor) * (bits))\ |
412 | >> LAMBDA_ACCURACY_BITS) |
413 | #define MV_COST(f, s, cx, cy, px, py) (WEIGHTED_COST(f, mvbits[((cx) << (s))\ |
414 | - px] + mvbits[((cy) << (s)) - py])) |
415 | #define REF_COST(f, ref) (WEIGHTED_COST(f, refbits[(ref)])) |
416 | |
417 | #define BWD_IDX(ref) (((ref) < 2) ? 1 - (ref) : (ref)) |
418 | #define REF_COST_FWD(f, ref) (WEIGHTED_COST(f,\ |
419 | ((img->num_ref_pic_active_fwd_minus1 == 0) ?\ |
420 | 0 : refbits[(ref)]))) |
421 | #define REF_COST_BWD(f, ef) (WEIGHTED_COST(f,\ |
422 | ((img->num_ref_pic_active_bwd_minus1 == 0) ?\ |
423 | 0 : BWD_IDX(refbits[ref])))) |
424 | |
425 | #define IS_INTRA(MB) ((MB)->cuType == I8MB ||\ |
426 | (MB)->cuType == I16MB ||\ |
427 | (MB)->cuType == InNxNMB || (MB)->cuType == INxnNMB) |
428 | #define IS_INTER(MB) ((MB)->cuType != I8MB &&\ |
429 | (MB)->cuType != I16MB && (MB)->cuType != InNxNMB\ |
430 | && (MB)->cuType != INxnNMB) |
431 | #define IS_INTERMV(MB) ((MB)->cuType != I8MB &&\ |
432 | (MB)->cuType != I16MB && (MB)->cuType != InNxNMB &&\ |
433 | (MB)->cuType != INxnNMB && (MB)->cuType != 0) |
434 | |
435 | |
436 | #define IS_DIRECT(MB) ((MB)->cuType == PSKIPDIRECT && (img->type == B_IMG)) |
437 | #define IS_P_SKIP(MB) ((MB)->cuType == PSKIPDIRECT &&\ |
438 | (((img->type == F_IMG)) || ((img->type == P_IMG)))) |
439 | #define IS_P8x8(MB) ((MB)->cuType == PNXN) |
440 | |
441 | /* Quantization parameter range */ |
442 | #define MIN_QP 0 |
443 | #define MAX_QP 63 |
444 | #define SHIFT_QP 11 |
445 | |
446 | /* Picture types */ |
447 | #define INTRA_IMG 0 /* !< I frame */ |
448 | #define INTER_IMG 1 /* !< P frame */ |
449 | #define B_IMG 2 /* !< B frame */ |
450 | #define I_IMG 0 /* !< I frame */ |
451 | #define P_IMG 1 /* !< P frame */ |
452 | #define F_IMG 4 /* !< F frame */ |
453 | |
454 | #define BACKGROUND_IMG 3 |
455 | |
456 | #define BP_IMG 5 |
457 | |
458 | |
459 | /* Direct Mode types */ |
460 | #define MIN_CU_SIZE 8 |
461 | #define MIN_BLOCK_SIZE 4 |
462 | #define MIN_CU_SIZE_IN_BIT 3 |
463 | #define MIN_BLOCK_SIZE_IN_BIT 2 |
464 | #define BLOCK_MULTIPLE (MIN_CU_SIZE/(MIN_BLOCK_SIZE)) |
465 | #define MAX_CU_SIZE 64 |
466 | #define MAX_CU_SIZE_IN_BIT 6 |
467 | #define B4X4_IN_BIT 2 |
468 | #define B8X8_IN_BIT 3 |
469 | #define B16X16_IN_BIT 4 |
470 | #define B32X32_IN_BIT 5 |
471 | #define B64X64_IN_BIT 6 |
472 | /* !< # luma intra prediction modes */ |
473 | #define NUM_INTRA_PMODE 33 |
474 | /* number of luma modes for full RD search */ |
475 | #define NUM_MODE_FULL_RD 9 |
476 | /* !< #chroma intra prediction modes */ |
477 | #define NUM_INTRA_PMODE_CHROMA 5 |
478 | |
479 | /* luma intra prediction modes */ |
480 | |
481 | #define DC_PRED 0 |
482 | #define PLANE_PRED 1 |
483 | #define BI_PRED 2 |
484 | #define VERT_PRED 12 |
485 | #define HOR_PRED 24 |
486 | |
487 | |
488 | /* chroma intra prediction modes */ |
489 | #define DM_PRED_C 0 |
490 | #define DC_PRED_C 1 |
491 | #define HOR_PRED_C 2 |
492 | #define VERT_PRED_C 3 |
493 | #define BI_PRED_C 4 |
494 | |
495 | #define EOS 1 /* !< End Of Sequence */ |
496 | /* !< Start Of Picture */ |
497 | #define SOP 2 |
498 | |
499 | #define DECODING_OK 0 |
500 | #define SEARCH_SYNC 1 |
501 | #define DECODE_MB 1 |
502 | |
503 | #ifndef max |
504 | /* !< Macro returning max value */ |
505 | #define max(a, b) ((a) > (b) ? (a) : (b)) |
506 | /* !< Macro returning min value */ |
507 | #define min(a, b) ((a) < (b) ? (a) : (b)) |
508 | #endif |
509 | |
510 | |
511 | #define XY_MIN_PMV 1 |
512 | #if XY_MIN_PMV |
513 | #define MVPRED_xy_MIN 0 |
514 | #else |
515 | #define MVPRED_MEDIAN 0 |
516 | #endif |
517 | #define MVPRED_L 1 |
518 | #define MVPRED_U 2 |
519 | #define MVPRED_UR 3 |
520 | |
521 | #define DUAL 4 |
522 | #define FORWARD 0 |
523 | #define BACKWARD 1 |
524 | #define SYM 2 |
525 | #define BID 3 |
526 | #define INTRA -1 |
527 | |
528 | #define BUF_CYCLE 5 |
529 | |
530 | #define ROI_M3264 1 /* ROI Information Encoding */ |
531 | |
532 | #define PicExtensionData 1 |
533 | |
534 | |
535 | #define REF_OUTPUT 1 /* M3337 */ |
536 | |
537 | |
538 | /* MV scaling 14 bit */ |
539 | #define MULTI 16384 |
540 | #define HALF_MULTI 8192 |
541 | #define OFFSET 14 |
542 | /* end of MV scaling */ |
543 | /* store the middle pixel's mv in a motion information unit */ |
544 | #define MV_DECIMATION_FACTOR 4 |
545 | |
546 | /* BUGFIX_AVAILABILITY_INTRA */ |
547 | #define NEIGHBOR_INTRA_LEFT 0 |
548 | #define NEIGHBOR_INTRA_UP 1 |
549 | #define NEIGHBOR_INTRA_UP_RIGHT 2 |
550 | #define NEIGHBOR_INTRA_UP_LEFT 3 |
551 | #define NEIGHBOR_INTRA_LEFT_DOWN 4 |
552 | /* end of BUGFIX_AVAILABILITY_INTRA */ |
553 | |
554 | /* end #include "define.h" */ |
555 | |
556 | /*#include "commonStructures.h"*/ |
557 | |
558 | /*typedef uint16_t byte;*/ /* !< byte type definition */ |
559 | #define byte uint16_t |
560 | #define pel_t byte |
561 | |
562 | enum BitCountType_e { |
563 | BITS_HEADER, |
564 | BITS_TOTAL_MB, |
565 | BITS_MB_MODE, |
566 | BITS_INTER_MB, |
567 | BITS_CBP_MB, |
568 | BITS_CBP01_MB, |
569 | BITS_COEFF_Y_MB, |
570 | BITS_COEFF_UV_MB, |
571 | BITS_DELTA_QUANT_MB, |
572 | BITS_SAO_MB, |
573 | MAX_BITCOUNTER_MB |
574 | }; |
575 | |
576 | |
577 | enum SAOEOClasses { |
578 | /* EO Groups, the assignments depended on |
579 | how you implement the edgeType calculation */ |
580 | SAO_CLASS_EO_FULL_VALLEY = 0, |
581 | SAO_CLASS_EO_HALF_VALLEY = 1, |
582 | SAO_CLASS_EO_PLAIN = 2, |
583 | SAO_CLASS_EO_HALF_PEAK = 3, |
584 | SAO_CLASS_EO_FULL_PEAK = 4, |
585 | SAO_CLASS_BO = 5, |
586 | NUM_SAO_EO_CLASSES = SAO_CLASS_BO, |
587 | NUM_SAO_OFFSET |
588 | }; |
589 | |
590 | struct SAOstatdata { |
591 | int32_t diff[MAX_NUM_SAO_CLASSES]; |
592 | int32_t count[MAX_NUM_SAO_CLASSES]; |
593 | }; |
594 | |
595 | struct CopyRight_s { |
596 | int32_t extension_id; |
597 | int32_t copyright_flag; |
598 | int32_t copyright_id; |
599 | int32_t original_or_copy; |
600 | int32_t reserved; |
601 | int32_t copyright_number; |
602 | }; |
603 | |
604 | struct CameraParamters_s { |
605 | int32_t reserved; |
606 | int32_t camera_id; |
607 | int32_t height_of_image_device; |
608 | int32_t focal_length; |
609 | int32_t f_number; |
610 | int32_t vertical_angle_of_view; |
611 | int32_t camera_position_x; |
612 | int32_t camera_position_y; |
613 | int32_t camera_position_z; |
614 | int32_t camera_direction_x; |
615 | int32_t camera_direction_y; |
616 | int32_t camera_direction_z; |
617 | int32_t image_plane_vertical_x; |
618 | int32_t image_plane_vertical_y; |
619 | int32_t image_plane_vertical_z; |
620 | }; |
621 | |
622 | /* ! SNRParameters */ |
623 | struct SNRParameters_s { |
624 | double snr_y; /* !< current Y SNR */ |
625 | double snr_u; /* !< current U SNR */ |
626 | double snr_v; /* !< current V SNR */ |
627 | double snr_y1; /* !< SNR Y(dB) first frame */ |
628 | double snr_u1; /* !< SNR U(dB) first frame */ |
629 | double snr_v1; /* !< SNR V(dB) first frame */ |
630 | double snr_ya; /* !< Average SNR Y(dB) remaining frames */ |
631 | double snr_ua; /* !< Average SNR U(dB) remaining frames */ |
632 | double snr_va; /* !< Average SNR V(dB) remaining frames */ |
633 | #if INTERLACE_CODING |
634 | double i_snr_ya; /* !< current Y SNR */ |
635 | double i_snr_ua; /* !< current U SNR */ |
636 | double i_snr_va; /* !< current V SNR */ |
637 | #endif |
638 | }; |
639 | |
640 | /* signal to noise ratio parameters */ |
641 | |
642 | /* ! codingUnit */ |
643 | struct codingUnit { |
644 | uint32_t ui_MbBitSize; |
645 | int32_t uiBitSize; /* size of MB */ |
646 | /* !< number of current syntax element */ |
647 | int32_t currSEnr; |
648 | int32_t slice_nr; |
649 | int32_t delta_quant; /* !< for rate control */ |
650 | int32_t delta_qp; |
651 | int32_t qp; |
652 | int32_t bitcounter[MAX_BITCOUNTER_MB]; |
653 | struct codingUnit |
654 | *mb_available[3][3]; /*!< pointer to neighboring MBs |
655 | in a 3x3 window of current MB, which is located at [1][1] \n |
656 | NULL pointer identifies neighboring MBs which are unavailable */ |
657 | /* some storage of codingUnit syntax elements for global access */ |
658 | int32_t cuType; |
659 | int32_t weighted_skipmode; |
660 | |
661 | int32_t md_directskip_mode; |
662 | |
663 | int32_t trans_size; |
664 | int |
665 | /* !< indices correspond to [forw,backw][block_y][block_x][x,y, dmh] */ |
666 | mvd[2][BLOCK_MULTIPLE][BLOCK_MULTIPLE][3]; |
667 | |
668 | int32_t intra_pred_modes[BLOCK_MULTIPLE * BLOCK_MULTIPLE]; |
669 | int32_t real_intra_pred_modes[BLOCK_MULTIPLE * BLOCK_MULTIPLE]; |
670 | int32_t l_ipred_mode; |
671 | int32_t cbp, cbp_blk; |
672 | uint32_t cbp_bits; |
673 | |
674 | int32_t b8mode[4]; |
675 | int32_t b8pdir[4]; |
676 | /* !< chroma intra prediction mode */ |
677 | int32_t c_ipred_mode; |
678 | |
679 | /* !< pointer to neighboring MB (AEC) */ |
680 | struct codingUnit *mb_available_up; |
681 | /* !< pointer to neighboring MB (AEC) */ |
682 | struct codingUnit *mb_available_left; |
683 | int32_t mbAddrA, mbAddrB, mbAddrC, mbAddrD; |
684 | /* !<added by mz, 2008.04 */ |
685 | int32_t slice_set_index; |
686 | /* added by mz, 2008.04 */ |
687 | int32_t slice_header_flag; |
688 | int32_t sliceqp; /* added by mz, 2008.04 */ |
689 | #if MB_DQP |
690 | int32_t previouse_qp; |
691 | int32_t left_cu_qp; |
692 | #endif |
693 | int32_t block_available_up; |
694 | int32_t block_available_left; |
695 | |
696 | }; |
697 | |
698 | |
699 | /* image parameters */ |
700 | struct syntaxelement; |
701 | struct slice; |
702 | struct alfdatapart; |
703 | struct SAOBlkParam_s { |
704 | int32_t modeIdc; /* NEW, MERGE, OFF */ |
705 | /* NEW: EO_0, EO_90, EO_135, EO_45, BO. MERGE: left, above */ |
706 | int32_t typeIdc; |
707 | int32_t startBand; /* BO: starting band index */ |
708 | int32_t startBand2; |
709 | int32_t deltaband; |
710 | int32_t offset[MAX_NUM_SAO_CLASSES]; |
711 | }; |
712 | struct ALFParam_s { |
713 | int32_t alf_flag; |
714 | int32_t num_coeff; |
715 | int32_t filters_per_group; |
716 | int32_t componentID; |
717 | int32_t filterPattern[16]; /* *filterPattern; */ |
718 | int32_t coeffmulti[16][9]; /* **coeffmulti; */ |
719 | }; |
720 | |
721 | enum ALFComponentID { |
722 | ALF_Y = 0, |
723 | ALF_Cb, |
724 | ALF_Cr, |
725 | NUM_ALF_COMPONENT |
726 | }; |
727 | struct ALF_APS_s { |
728 | int32_t usedflag; |
729 | int32_t cur_number; |
730 | int32_t max_number; |
731 | struct ALFParam_s alf_par[NUM_ALF_COMPONENT]; |
732 | }; |
733 | |
734 | |
735 | /* ------------------------------------------------------ |
736 | * frame data |
737 | */ |
738 | struct avs2_frame_s { |
739 | int32_t imgcoi_ref; |
740 | byte * *referenceFrame[3]; |
741 | int32_t **refbuf; |
742 | int32_t ***mvbuf; |
743 | #if 0 |
744 | double saorate[NUM_SAO_COMPONENTS]; |
745 | #endif |
746 | byte ***ref; |
747 | |
748 | int32_t imgtr_fwRefDistance; |
749 | int32_t refered_by_others; |
750 | int32_t is_output; |
751 | int32_t to_prepare_disp; |
752 | #if M3480_TEMPORAL_SCALABLE |
753 | /* temporal level setted in configure file */ |
754 | int32_t temporal_id; |
755 | #endif |
756 | byte **oneForthRefY; |
757 | #if FIX_MAX_REF |
758 | int32_t ref_poc[MAXREF]; |
759 | #else |
760 | int32_t ref_poc[4]; |
761 | #endif |
762 | #ifdef AML |
763 | int32_t index; |
764 | int32_t mmu_alloc_flag; |
765 | int32_t lcu_size_log2; |
766 | /*uint32_t header_adr;*/ |
767 | uint32_t mc_y_adr; |
768 | uint32_t mc_u_v_adr; |
769 | uint32_t mc_canvas_y; |
770 | uint32_t mc_canvas_u_v; |
771 | uint32_t mpred_mv_wr_start_addr; |
772 | uint8_t bg_flag; |
773 | /**/ |
774 | unsigned long header_adr; |
775 | int buf_size; |
776 | int lcu_total; |
777 | int comp_body_size; |
778 | uint32_t dw_y_adr; |
779 | uint32_t dw_u_v_adr; |
780 | int y_canvas_index; |
781 | int uv_canvas_index; |
782 | struct canvas_config_s canvas_config[2]; |
783 | int double_write_mode; |
784 | int bit_depth; |
785 | unsigned long cma_alloc_addr; |
786 | int BUF_index; |
787 | int pic_w; |
788 | int pic_h; |
789 | int stream_offset; |
790 | u32 pts; |
791 | u64 pts64; |
792 | /**/ |
793 | int vf_ref; |
794 | int decode_idx; |
795 | int slice_type; |
796 | int32_t imgtr_fwRefDistance_bak; |
797 | int32_t error_mark; |
798 | int32_t decoded_lcu; |
799 | #endif |
800 | #ifndef MV_USE_FIXED_BUF |
801 | int mv_buf_index; |
802 | #endif |
803 | |
804 | /* picture qos infomation*/ |
805 | int max_qp; |
806 | int avg_qp; |
807 | int min_qp; |
808 | int max_skip; |
809 | int avg_skip; |
810 | int min_skip; |
811 | int max_mv; |
812 | int min_mv; |
813 | int avg_mv; |
814 | }; |
815 | |
816 | |
817 | struct ImageParameters_s { |
818 | struct codingUnit *mb_data; |
819 | int32_t number; /* <! frame number */ |
820 | int32_t numIPFrames; |
821 | |
822 | int32_t type; |
823 | int32_t typeb; |
824 | int32_t typeb_before; |
825 | |
826 | int32_t qp; /* <! quant for the current frame */ |
827 | int32_t current_mb_nr; /* bitstream order */ |
828 | int32_t current_slice_nr; |
829 | int32_t tr; /* <! temporal reference, 8 bit, */ |
830 | |
831 | int32_t width; /* !< Number of pels */ |
832 | int32_t width_cr; /* !< Number of pels chroma */ |
833 | int32_t height; /* !< Number of lines */ |
834 | int32_t height_cr; /* !< Number of lines chroma */ |
835 | int32_t PicWidthInMbs; |
836 | int32_t PicSizeInMbs; |
837 | int32_t block8_x, block8_y; |
838 | int32_t subblock_x; |
839 | int32_t subblock_y; |
840 | |
841 | int32_t num_of_references; |
842 | /* <! Bug Fix: correct picture size for outputted reconstructed pictures */ |
843 | int32_t auto_crop_right; |
844 | int32_t auto_crop_bottom; |
845 | int32_t buf_cycle; |
846 | int32_t picture_structure; |
847 | /* <! pointer to current Slice data struct */ |
848 | struct slice *currentSlice; |
849 | |
850 | int32_t **predBlock; /* !< current best prediction mode */ |
851 | int32_t **predBlockTmp; |
852 | /* !< the diff pixel values between orginal image and prediction */ |
853 | int32_t **resiY; |
854 | /* !< Array containing square values,used for snr computation */ |
855 | int32_t *quad; |
856 | |
857 | /* //location of current MB////// */ |
858 | int32_t mb_y; /* !< current MB vertical */ |
859 | int32_t mb_x; /* !< current MB horizontal */ |
860 | int32_t pix_y; /* !< current pixel vertical */ |
861 | int32_t pix_x; /* !< current pixel horizontal */ |
862 | int32_t pix_c_y; /* !< current pixel chroma vertical */ |
863 | int32_t pix_c_x; /* !< current pixel chroma horizontal */ |
864 | |
865 | int32_t imgtr_next_P; |
866 | |
867 | int32_t imgcoi_next_ref; |
868 | |
869 | /* !< GH ipredmode[90][74];prediction mode for inter frames */ |
870 | /* fix from ver 4.1 */ |
871 | int32_t **ipredmode; |
872 | int32_t **rec_ipredmode; |
873 | |
874 | |
875 | /* //////////////decoder////////////////////////// */ |
876 | int32_t max_mb_nr; |
877 | int32_t **intra_block; |
878 | |
879 | int32_t block_y; |
880 | int32_t block_x; |
881 | /* <! final 4x4 block. Extended to 16x16 for AVS */ |
882 | int32_t resiUV[2][MAX_CU_SIZE][MAX_CU_SIZE]; |
883 | |
884 | int32_t **fw_refFrArr; /* <! [72][88]; */ |
885 | int32_t **bw_refFrArr; /* <! [72][88]; */ |
886 | |
887 | int32_t random_access_decodable_flag; |
888 | |
889 | int32_t seq_header_indicate; |
890 | int32_t B_discard_flag; |
891 | |
892 | /* B pictures */ |
893 | uint32_t pic_distance; |
894 | |
895 | uint32_t coding_order; |
896 | |
897 | uint32_t PrevPicDistanceLsb; |
898 | int32_t CurrPicDistanceMsb; |
899 | |
900 | int32_t PicHeightInMbs; |
901 | |
902 | int32_t types; |
903 | |
904 | int32_t new_sequence_flag; |
905 | int32_t sequence_end_flag; /* <! rm52k_r2 */ |
906 | |
907 | int32_t current_slice_set_index; /* <! added by mz, 2008.04 */ |
908 | int32_t current_slice_header_flag; /* <! added by mz, 2008.04 */ |
909 | int32_t slice_set_qp[64]; /* <! added by mz, 2008.04 */ |
910 | |
911 | |
912 | int32_t inter_amp_enable; |
913 | |
914 | /* ////////////////////////encoder////////////////////////// */ |
915 | |
916 | /* int32_t nb_references; //!< replaced by "num_of_references" */ |
917 | |
918 | int32_t framerate; |
919 | |
920 | int32_t ***predBlockY; /* !< all 9 prediction modes */ |
921 | /* !< new chroma 8x8 intra prediction modes */ |
922 | int32_t ****predBlockUV; |
923 | |
924 | int32_t **Coeff_all;/* qyu 0821 */ |
925 | |
926 | struct syntaxelement *MB_SyntaxElements; /* !< by oliver 0612 */ |
927 | |
928 | /* B pictures */ |
929 | |
930 | int32_t b_frame_to_code; |
931 | int32_t num_ref_pic_active_fwd_minus1; |
932 | int32_t num_ref_pic_active_bwd_minus1; |
933 | int32_t mv_range_flag; |
934 | |
935 | uint32_t frame_num; /* frame_num for this frame */ |
936 | int32_t slice_offset; |
937 | /* the following are sent in the slice header */ |
938 | int32_t NoResidueDirect; |
939 | int32_t coded_mb_nr; |
940 | int32_t progressive_frame; |
941 | int32_t tc_reserve_bit; |
942 | /* the last MB no in current slice. Yulj 2004.07.15 */ |
943 | int32_t mb_no_currSliceLastMB; |
944 | int32_t Seqheader_flag; /* Added by cjw, 20070327 */ |
945 | int32_t EncodeEnd_flag; /* Carmen, 2007/12/19 */ |
946 | |
947 | uint16_t bbv_delay; |
948 | |
949 | int32_t tmp_fwBSkipMv[DIRECTION + 1][2]; |
950 | int32_t tmp_bwBSkipMv[DIRECTION + 1][2]; |
951 | |
952 | int32_t tmp_pref_fst[MH_PSKIP_NUM + NUM_OFFSET + 1]; |
953 | int32_t tmp_pref_snd[MH_PSKIP_NUM + NUM_OFFSET + 1]; |
954 | int32_t tmp_fstPSkipMv[MH_PSKIP_NUM + NUM_OFFSET + 1][3]; |
955 | int32_t tmp_sndPSkipMv[MH_PSKIP_NUM + NUM_OFFSET + 1][3]; |
956 | #if BCBR |
957 | byte *org_ref_y; |
958 | byte *org_ref_u; |
959 | byte *org_ref_v; |
960 | int32_t *BLCUidx; |
961 | int32_t *DQPList; |
962 | int32_t iNumCUsInFrame; |
963 | |
964 | byte *org_ref2_y; |
965 | byte *org_ref2_u; |
966 | byte *org_ref2_v; |
967 | int32_t ref2Num; |
968 | #endif |
969 | /* //////////////SAO parameter////////////////// */ |
970 | double *cur_saorate; |
971 | #if 0 |
972 | int32_t slice_sao_on[NUM_SAO_COMPONENTS]; |
973 | #endif |
974 | int32_t pic_alf_on[NUM_ALF_COMPONENT]; |
975 | struct alfdatapart *dp_ALF; |
976 | |
977 | #if INTERLACE_CODING |
978 | int32_t is_field_sequence; |
979 | int32_t is_top_field; |
980 | #endif |
981 | |
982 | |
983 | }; |
984 | |
985 | |
986 | |
987 | /* ! struct for context management */ |
988 | struct BiContextType_s { |
989 | uint8_t MPS; /* 1 bit */ |
990 | uint32_t LG_PMPS; /* 10 bits */ |
991 | uint8_t cycno; /* 2 bits */ |
992 | }; |
993 | |
994 | /*********************************************************************** |
995 | * D a t a t y p e s f o r A E C |
996 | ************************************************************************/ |
997 | |
998 | |
999 | |
1000 | struct pix_pos { |
1001 | int32_t available; /* ABCD */ |
1002 | int32_t mb_addr; /* MB position */ |
1003 | int32_t x; |
1004 | int32_t y; |
1005 | int32_t pos_x; /* 4x4 x-pos */ |
1006 | int32_t pos_y; |
1007 | }; |
1008 | |
1009 | |
1010 | |
1011 | struct STDOUT_DATA_s { |
1012 | int32_t type; |
1013 | int32_t typeb; |
1014 | |
1015 | int32_t framenum; |
1016 | int32_t tr; |
1017 | int32_t qp; |
1018 | double snr_y; |
1019 | double snr_u; |
1020 | double snr_v; |
1021 | int32_t tmp_time; |
1022 | int32_t picture_structure; |
1023 | int32_t curr_frame_bits; |
1024 | int32_t emulate_bits; |
1025 | |
1026 | uint32_t DecMD5Value[4]; |
1027 | #if RD1501_FIX_BG |
1028 | int32_t background_picture_output_flag;/* Longfei.Wang@mediatek.com */ |
1029 | #endif |
1030 | #if RD160_FIX_BG |
1031 | int32_t picture_reorder_delay; |
1032 | #endif |
1033 | int8_t str_reference_list[128]; /* reference list information */ |
1034 | }; |
1035 | |
1036 | /********************************************************************** |
1037 | * C O N T E X T S F O R T M L S Y N T A X E L E M E N T S |
1038 | ********************************************************************** |
1039 | */ |
1040 | #define NUM_CuType_CTX (11 + 10) |
1041 | #define NUM_B8_TYPE_CTX 9 |
1042 | #define NUM_MVD_CTX 15 |
1043 | #define NUM_PMV_IDX_CTX 10 |
1044 | #define NUM_REF_NO_CTX 6 |
1045 | #define NUM_DELTA_QP_CTX 4 |
1046 | #define NUM_INTER_DIR_CTX 18 |
1047 | #define NUM_INTER_DIR_DHP_CTX 3 |
1048 | #define NUM_B8_TYPE_DHP_CTX 1 |
1049 | #define NUM_AMP_CTX 2 |
1050 | #define NUM_C_INTRA_MODE_CTX 4 |
1051 | #define NUM_CBP_CTX 4 |
1052 | #define NUM_BCBP_CTX 4 |
1053 | #define NUM_MAP_CTX 17 |
1054 | #define NUM_LAST_CTX 17 |
1055 | |
1056 | #define NUM_INTRA_MODE_CTX 7 |
1057 | |
1058 | #define NUM_ABS_CTX 5 |
1059 | #define NUM_TU_CTX 3 |
1060 | #define NUM_SPLIT_CTX 8 /* CU depth */ |
1061 | #if BCBR |
1062 | #define NUM_BGBLCOK_CTX 1 |
1063 | #endif |
1064 | |
1065 | #define NUM_BRP_CTX 8 |
1066 | |
1067 | |
1068 | #define NUM_LAST_CG_CTX_LUMA 12 |
1069 | #define NUM_LAST_CG_CTX_CHROMA 6 |
1070 | #define NUM_SIGCG_CTX_LUMA 2 |
1071 | #define NUM_SIGCG_CTX_CHROMA 1 |
1072 | #define NUM_LAST_POS_CTX_LUMA 56 |
1073 | #define NUM_LAST_POS_CTX_CHROMA 16 |
1074 | #define NUM_LAST_CG_CTX (NUM_LAST_CG_CTX_LUMA + NUM_LAST_CG_CTX_CHROMA) |
1075 | #define NUM_SIGCG_CTX (NUM_SIGCG_CTX_LUMA + NUM_SIGCG_CTX_CHROMA) |
1076 | #define NUM_LAST_POS_CTX (NUM_LAST_POS_CTX_LUMA + NUM_LAST_POS_CTX_CHROMA) |
1077 | #define NUM_SAO_MERGE_FLAG_CTX 3 |
1078 | #define NUM_SAO_MODE_CTX 1 |
1079 | #define NUM_SAO_OFFSET_CTX 2 |
1080 | #define NUM_INTER_DIR_MIN_CTX 2 |
1081 | |
1082 | /*end #include "commonStructures.h"*/ |
1083 | |
1084 | /*#include "commonVariables.h"*/ |
1085 | |
1086 | /* |
1087 | extern struct CameraParamters_s *camera; |
1088 | extern struct SNRParameters_s *snr; |
1089 | extern struct ImageParameters_s *img; |
1090 | */ |
1091 | |
1092 | /* avs2_frame_t *fref[REF_MAXBUFFER]; */ |
1093 | |
1094 | |
1095 | #define ET_SIZE 300 /* !< size of error text buffer */ |
1096 | |
1097 | |
1098 | /* ------------------------------------------------------ |
1099 | * common data |
1100 | */ |
1101 | struct Video_Com_data_s { |
1102 | int32_t Bframe_ctr; |
1103 | |
1104 | /* FILE *p_log; //!< SNR file */ |
1105 | /* FILE *p_trace; //!< Trace file */ |
1106 | |
1107 | int32_t tot_time; |
1108 | |
1109 | /* Tsinghua for picture_distance 200701 */ |
1110 | int32_t picture_distance; |
1111 | |
1112 | /* M3178 PKU Reference Manage */ |
1113 | int32_t coding_order; |
1114 | /* !< current encoding/decoding frame pointer */ |
1115 | struct avs2_frame_s *f_rec; |
1116 | int32_t seq_header; |
1117 | /* !< Array for reference frames of each block */ |
1118 | int32_t **refFrArr; |
1119 | int32_t **p_snd_refFrArr; |
1120 | |
1121 | byte ***currentFrame; /* [yuv][height][width] */ |
1122 | #ifdef AML |
1123 | struct avs2_frame_s *cur_pic; /*either f_rec or m_bg*/ |
1124 | #endif |
1125 | byte **backgroundReferenceFrame[3]; |
1126 | byte ***background_ref; |
1127 | |
1128 | |
1129 | int32_t total_frames; |
1130 | |
1131 | /* mv_range, 20071009 */ |
1132 | int32_t Min_V_MV; |
1133 | int32_t Max_V_MV; |
1134 | int32_t Min_H_MV; |
1135 | int32_t Max_H_MV; |
1136 | /* !< buffer for error message for exit with error(void) */ |
1137 | int8_t errortext[ET_SIZE]; |
1138 | int8_t str_list_reference[128]; |
1139 | |
1140 | |
1141 | }; |
1142 | /* extern Video_Com_data *hc; */ |
1143 | |
1144 | |
1145 | /*end #include "commonVariables.h"*/ |
1146 | /* #define USE_PARAM_TXT */ |
1147 | /* |
1148 | #if FIX_CHROMA_FIELD_MV_BK_DIST |
1149 | int8_t bk_img_is_top_field; |
1150 | #endif |
1151 | */ |
1152 | /* void write_GB_frame(FILE *p_dec); */ |
1153 | |
1154 | #if !FIX_MAX_REF |
1155 | #define MAXREF 4 |
1156 | #define MAXGOP 32 |
1157 | #endif |
1158 | |
1159 | struct StatBits { |
1160 | int32_t curr_frame_bits; |
1161 | int32_t prev_frame_bits; |
1162 | int32_t emulate_bits; |
1163 | int32_t prev_emulate_bits; |
1164 | int32_t last_unit_bits; |
1165 | int32_t bitrate; |
1166 | int32_t total_bitrate[1000]; |
1167 | int32_t coded_pic_num; |
1168 | int32_t time_s; |
1169 | }; |
1170 | |
1171 | struct reference_management { |
1172 | int32_t poc; |
1173 | int32_t qp_offset; |
1174 | int32_t num_of_ref; |
1175 | int32_t referd_by_others; |
1176 | int32_t ref_pic[MAXREF]; |
1177 | int32_t predict; |
1178 | int32_t deltaRPS; |
1179 | int32_t num_to_remove; |
1180 | int32_t remove_pic[MAXREF]; |
1181 | }; |
1182 | |
1183 | |
1184 | /* ------------------------------------------------------ |
1185 | * dec data |
1186 | */ |
1187 | struct Video_Dec_data_s { |
1188 | byte **background_frame[3]; |
1189 | int32_t background_reference_enable; |
1190 | |
1191 | int32_t background_picture_flag; |
1192 | int32_t background_picture_output_flag; |
1193 | int32_t background_picture_enable; |
1194 | |
1195 | int32_t background_number; |
1196 | |
1197 | #if BCBR |
1198 | int32_t bcbr_enable; |
1199 | #endif |
1200 | |
1201 | int32_t demulate_enable; |
1202 | int32_t currentbitoffset; |
1203 | |
1204 | int32_t aspect_ratio_information; |
1205 | int32_t frame_rate_code; |
1206 | int32_t bit_rate_lower; |
1207 | int32_t bit_rate_upper; |
1208 | int32_t marker_bit; |
1209 | |
1210 | int32_t video_format; |
1211 | int32_t color_description; |
1212 | int32_t color_primaries; |
1213 | int32_t transfer_characteristics; |
1214 | int32_t matrix_coefficients; |
1215 | |
1216 | int32_t progressive_sequence; |
1217 | #if INTERLACE_CODING |
1218 | int32_t is_field_sequence; |
1219 | #endif |
1220 | int32_t low_delay; |
1221 | int32_t horizontal_size; |
1222 | int32_t vertical_size; |
1223 | int32_t sample_precision; |
1224 | int32_t video_range; |
1225 | |
1226 | int32_t display_horizontal_size; |
1227 | int32_t display_vertical_size; |
1228 | int32_t TD_mode; |
1229 | int32_t view_packing_mode; |
1230 | int32_t view_reverse; |
1231 | |
1232 | int32_t b_pmvr_enabled; |
1233 | int32_t dhp_enabled; |
1234 | int32_t b_dmh_enabled; |
1235 | int32_t b_mhpskip_enabled; |
1236 | int32_t wsm_enabled; |
1237 | int32_t b_secT_enabled; |
1238 | |
1239 | int32_t tmp_time; |
1240 | int32_t FrameNum; |
1241 | int32_t eos; |
1242 | int32_t pre_img_type; |
1243 | int32_t pre_img_types; |
1244 | /* int32_t pre_str_vec; */ |
1245 | int32_t pre_img_tr; |
1246 | int32_t pre_img_qp; |
1247 | int32_t pre_tmp_time; |
1248 | int32_t RefPicExist; /* 20071224 */ |
1249 | int32_t BgRefPicExist; |
1250 | int32_t dec_ref_num; /* ref order */ |
1251 | |
1252 | /* video edit code */ /* M1956 by Grandview 2006.12.12 */ |
1253 | int32_t vec_flag; |
1254 | |
1255 | /* Copyright_extension(void) header */ |
1256 | int32_t copyright_flag; |
1257 | int32_t copyright_identifier; |
1258 | int32_t original_or_copy; |
1259 | int64_t copyright_number_1; |
1260 | int64_t copyright_number_2; |
1261 | int64_t copyright_number_3; |
1262 | /* Camera_parameters_extension */ |
1263 | int32_t camera_id; |
1264 | int32_t height_of_image_device; |
1265 | int32_t focal_length; |
1266 | int32_t f_number; |
1267 | int32_t vertical_angle_of_view; |
1268 | int32_t camera_position_x_upper; |
1269 | int32_t camera_position_x_lower; |
1270 | int32_t camera_position_y_upper; |
1271 | int32_t camera_position_y_lower; |
1272 | int32_t camera_position_z_upper; |
1273 | int32_t camera_position_z_lower; |
1274 | int32_t camera_direction_x; |
1275 | int32_t camera_direction_y; |
1276 | int32_t camera_direction_z; |
1277 | int32_t image_plane_vertical_x; |
1278 | int32_t image_plane_vertical_y; |
1279 | int32_t image_plane_vertical_z; |
1280 | |
1281 | #if AVS2_HDR_HLS |
1282 | /* mastering_display_and_content_metadata_extension(void) header */ |
1283 | int32_t display_primaries_x0; |
1284 | int32_t display_primaries_y0; |
1285 | int32_t display_primaries_x1; |
1286 | int32_t display_primaries_y1; |
1287 | int32_t display_primaries_x2; |
1288 | int32_t display_primaries_y2; |
1289 | int32_t white_point_x; |
1290 | int32_t white_point_y; |
1291 | int32_t max_display_mastering_luminance; |
1292 | int32_t min_display_mastering_luminance; |
1293 | int32_t maximum_content_light_level; |
1294 | int32_t maximum_frame_average_light_level; |
1295 | #endif |
1296 | |
1297 | /* I_pictures_header(void) */ |
1298 | int32_t top_field_first; |
1299 | int32_t repeat_first_field; |
1300 | int32_t progressive_frame; |
1301 | #if INTERLACE_CODING |
1302 | int32_t is_top_field; |
1303 | #endif |
1304 | /* int32_t fixed_picture_qp; //qyu 0927 */ |
1305 | int32_t picture_qp; |
1306 | int32_t fixed_picture_qp; |
1307 | int32_t time_code_flag; |
1308 | int32_t time_code; |
1309 | int32_t loop_filter_disable; |
1310 | int32_t loop_filter_parameter_flag; |
1311 | /* int32_t alpha_offset; */ |
1312 | /* int32_t beta_offset; */ |
1313 | |
1314 | /* Pb_picture_header(void) */ |
1315 | int32_t picture_coding_type; |
1316 | |
1317 | /*picture_display_extension(void)*/ |
1318 | int32_t frame_centre_horizontal_offset[4]; |
1319 | int32_t frame_centre_vertical_offset[4]; |
1320 | |
1321 | /* slice_header(void) */ |
1322 | int32_t img_width; |
1323 | int32_t slice_vertical_position; |
1324 | int32_t slice_vertical_position_extension; |
1325 | int32_t fixed_slice_qp; |
1326 | int32_t slice_qp; |
1327 | int32_t slice_horizontal_positon; /* added by mz, 2008.04 */ |
1328 | int32_t slice_horizontal_positon_extension; |
1329 | |
1330 | int32_t StartCodePosition; |
1331 | int32_t background_pred_flag; |
1332 | |
1333 | |
1334 | /* Reference Manage */ |
1335 | int32_t displaydelay; |
1336 | int32_t picture_reorder_delay; |
1337 | #if M3480_TEMPORAL_SCALABLE |
1338 | int32_t temporal_id_exist_flag; |
1339 | #endif |
1340 | |
1341 | int32_t gop_size; |
1342 | struct reference_management decod_RPS[MAXGOP]; |
1343 | struct reference_management curr_RPS; |
1344 | int32_t last_output; |
1345 | int32_t trtmp; |
1346 | #if M3480_TEMPORAL_SCALABLE |
1347 | int32_t cur_layer; |
1348 | #endif |
1349 | |
1350 | /* Adaptive frequency weighting quantization */ |
1351 | #if FREQUENCY_WEIGHTING_QUANTIZATION |
1352 | int32_t weight_quant_enable_flag; |
1353 | int32_t load_seq_weight_quant_data_flag; |
1354 | |
1355 | int32_t pic_weight_quant_enable_flag; |
1356 | int32_t pic_weight_quant_data_index; |
1357 | int32_t weighting_quant_param; |
1358 | int32_t weighting_quant_model; |
1359 | int16_t quant_param_undetail[6]; /* M2148 2007-09 */ |
1360 | int16_t quant_param_detail[6]; /* M2148 2007-09 */ |
1361 | int32_t WeightQuantEnable; /* M2148 2007-09 */ |
1362 | int32_t mb_adapt_wq_disable; /* M2331 2008-04 */ |
1363 | int32_t mb_wq_mode; /* M2331 2008-04 */ |
1364 | #if CHROMA_DELTA_QP |
1365 | int32_t chroma_quant_param_disable; |
1366 | int32_t chroma_quant_param_delta_u; |
1367 | int32_t chroma_quant_param_delta_v; |
1368 | #endif |
1369 | |
1370 | int32_t b_pre_dec_intra_img; |
1371 | int32_t pre_dec_img_type; |
1372 | int32_t CurrentSceneModel; |
1373 | #endif |
1374 | |
1375 | int32_t curr_IDRcoi; |
1376 | int32_t curr_IDRtr; |
1377 | int32_t next_IDRtr; |
1378 | int32_t next_IDRcoi; |
1379 | int32_t end_SeqTr; |
1380 | |
1381 | #if MB_DQP |
1382 | int32_t lastQP; |
1383 | /* FILE * testQP; */ |
1384 | #endif |
1385 | |
1386 | }; |
1387 | /* extern Video_Dec_data *hd; */ |
1388 | |
1389 | struct DecodingEnvironment_s { |
1390 | uint32_t Dbuffer; |
1391 | int32_t Dbits_to_go; |
1392 | uint8_t *Dcodestrm; |
1393 | int32_t *Dcodestrm_len; |
1394 | }; |
1395 | |
1396 | /* added at rm52k version */ |
1397 | |
1398 | struct inp_par; |
1399 | |
1400 | |
1401 | |
1402 | /* ! Slice */ |
1403 | struct slice { |
1404 | int32_t picture_id; |
1405 | int32_t qp; |
1406 | int32_t picture_type; /* !< picture type */ |
1407 | int32_t start_mb_nr; |
1408 | /* !< number of different partitions */ |
1409 | int32_t max_part_nr; |
1410 | |
1411 | /* added by lzhang */ |
1412 | /* !< pointer to struct of context models for use in AEC */ |
1413 | struct SyntaxInfoContexts_s *syn_ctx; |
1414 | }; |
1415 | |
1416 | struct alfdatapart { |
1417 | struct Bitstream_s *bitstream; |
1418 | struct DecodingEnvironment_s de_AEC; |
1419 | struct SyntaxInfoContexts_s *syn_ctx; |
1420 | }; |
1421 | /* static int32_t alfParAllcoated = 0; */ |
1422 | |
1423 | /* input parameters from configuration file */ |
1424 | struct inp_par { |
1425 | int32_t buf_cycle; /* <! Frame buffer size */ |
1426 | int32_t ref_pic_order; /* <! ref order */ |
1427 | int32_t output_dec_pic; /* <! output_dec_pic */ |
1428 | int32_t profile_id; |
1429 | int32_t level_id; |
1430 | int32_t chroma_format; |
1431 | int32_t g_uiMaxSizeInBit; |
1432 | int32_t alpha_c_offset; |
1433 | int32_t beta_offset; |
1434 | int32_t useNSQT; |
1435 | #if MB_DQP |
1436 | int32_t useDQP; |
1437 | #endif |
1438 | int32_t useSDIP; |
1439 | int32_t sao_enable; |
1440 | #if M3480_TEMPORAL_SCALABLE |
1441 | int32_t temporal_id_exist_flag; |
1442 | #endif |
1443 | int32_t alf_enable; |
1444 | |
1445 | int32_t crossSliceLoopFilter; |
1446 | |
1447 | int32_t sample_bit_depth; /* sample bit depth */ |
1448 | /* decoded file bit depth (assuming output_bit_depth is |
1449 | less or equal to sample_bit_depth) */ |
1450 | int32_t output_bit_depth; |
1451 | |
1452 | |
1453 | int32_t MD5Enable; |
1454 | |
1455 | #if OUTPUT_INTERLACE_MERGED_PIC |
1456 | int32_t output_interlace_merged_picture; |
1457 | #endif |
1458 | |
1459 | }; |
1460 | |
1461 | /* extern struct inp_par *input; */ |
1462 | |
1463 | struct outdata_s { |
1464 | #if RD170_FIX_BG |
1465 | struct STDOUT_DATA_s stdoutdata[REF_MAXBUFFER]; |
1466 | #else |
1467 | struct STDOUT_DATA_s stdoutdata[8]; |
1468 | #endif |
1469 | int32_t buffer_num; |
1470 | }; |
1471 | /* outdata outprint; */ |
1472 | |
1473 | #define PAYLOAD_TYPE_IDERP 8 |
1474 | |
1475 | struct Bitstream_s *AllocBitstream(void); |
1476 | void FreeBitstream(void); |
1477 | #if TRACE |
1478 | void tracebits2(const int8_t *trace_str, int32_t len, int32_t info); |
1479 | #endif |
1480 | |
1481 | /* int32_t direct_mv[45][80][4][4][3]; // only to verify result */ |
1482 | |
1483 | #define I_PICTURE_START_CODE 0xB3 |
1484 | #define PB_PICTURE_START_CODE 0xB6 |
1485 | #define SLICE_START_CODE_MIN 0x00 |
1486 | #define SLICE_START_CODE_MAX 0x8F |
1487 | #define USER_DATA_START_CODE 0xB2 |
1488 | #define SEQUENCE_HEADER_CODE 0xB0 |
1489 | #define EXTENSION_START_CODE 0xB5 |
1490 | #define SEQUENCE_END_CODE 0xB1 |
1491 | #define VIDEO_EDIT_CODE 0xB7 |
1492 | |
1493 | |
1494 | #define SEQUENCE_DISPLAY_EXTENSION_ID 2 |
1495 | #define COPYRIGHT_EXTENSION_ID 4 |
1496 | #define CAMERAPARAMETERS_EXTENSION_ID 11 |
1497 | #define PICTURE_DISPLAY_EXTENSION_ID 7 |
1498 | #if M3480_TEMPORAL_SCALABLE |
1499 | #define TEMPORAL_SCALABLE_EXTENSION_ID 3 |
1500 | #endif |
1501 | |
1502 | #if ROI_M3264 |
1503 | #if RD1501_FIX_BG |
1504 | #define LOCATION_DATA_EXTENSION_ID 12 |
1505 | #else |
1506 | #define LOCATION_DATA_EXTENSION_ID 15 |
1507 | #endif |
1508 | #endif |
1509 | |
1510 | #if AVS2_HDR_HLS |
1511 | #define MASTERING_DISPLAY_AND_CONTENT_METADATA_EXTENSION 10 |
1512 | #endif |
1513 | |
1514 | void malloc_slice(void); |
1515 | void free_slice(void); |
1516 | |
1517 | |
1518 | void read_ipred_modes(void); |
1519 | |
1520 | int32_t AEC_startcode_follows(int32_t eos_bit); |
1521 | |
1522 | /* extern uint32_t max_value_s; */ |
1523 | |
1524 | /*ComAdaptiveLoopFilter.h*/ |
1525 | #define ALF_MAX_NUM_COEF 9 |
1526 | #define NO_VAR_BINS 16 |
1527 | |
1528 | |
1529 | #define RPM_BEGIN 0x100 |
1530 | #define ALF_BEGIN 0x180 |
1531 | #define RPM_END 0x280 |
1532 | |
1533 | union param_u { |
1534 | struct { |
1535 | uint16_t data[RPM_END - RPM_BEGIN]; |
1536 | } l; |
1537 | struct { |
1538 | /*sequence*/ |
1539 | uint16_t profile_id; |
1540 | uint16_t level_id; |
1541 | uint16_t progressive_sequence; |
1542 | uint16_t is_field_sequence; |
1543 | uint16_t horizontal_size; |
1544 | uint16_t vertical_size; |
1545 | uint16_t chroma_format; |
1546 | uint16_t sample_precision; |
1547 | uint16_t encoding_precision; |
1548 | uint16_t aspect_ratio_information; |
1549 | uint16_t frame_rate_code; |
1550 | uint16_t bit_rate_lower; |
1551 | uint16_t bit_rate_upper; |
1552 | uint16_t low_delay; |
1553 | uint16_t temporal_id_exist_flag; |
1554 | uint16_t g_uiMaxSizeInBit; |
1555 | |
1556 | #define BACKGROUND_PICTURE_DISABLE_BIT 11 |
1557 | #define B_MHPSKIP_ENABLED_BIT 10 |
1558 | #define DHP_ENABLED_BIT 9 |
1559 | #define WSM_ENABLED_BIT 8 |
1560 | #define INTER_AMP_ENABLE_BIT 7 |
1561 | #define USENSQT_BIT 6 |
1562 | #define USESDIP_BIT 5 |
1563 | #define B_SECT_ENABLED_BIT 4 |
1564 | #define SAO_ENABLE_BIT 3 |
1565 | #define ALF_ENABLE_BIT 2 |
1566 | #define B_PMVR_ENABLED_BIT 1 |
1567 | #define CROSSSLICELOOPFILTER_BIT 0 |
1568 | uint16_t avs2_seq_flags; |
1569 | |
1570 | uint16_t num_of_RPS; |
1571 | uint16_t picture_reorder_delay; |
1572 | /*PIC*/ |
1573 | uint16_t time_code_flag; |
1574 | uint16_t time_code; |
1575 | uint16_t background_picture_flag; |
1576 | uint16_t background_picture_output_flag; |
1577 | uint16_t coding_order; |
1578 | uint16_t cur_layer; |
1579 | uint16_t displaydelay; /*???*/ |
1580 | uint16_t predict; /*???*/ |
1581 | uint16_t RPS_idx; /*???*/ |
1582 | uint16_t referd_by_others_cur; |
1583 | uint16_t num_of_ref_cur; |
1584 | uint16_t ref_pic_cur[8]; |
1585 | uint16_t num_to_remove_cur; |
1586 | uint16_t remove_pic_cur[8]; |
1587 | uint16_t progressive_frame; |
1588 | uint16_t picture_structure; |
1589 | uint16_t top_field_first; |
1590 | uint16_t repeat_first_field; |
1591 | uint16_t is_top_field; |
1592 | |
1593 | uint16_t picture_coding_type; |
1594 | uint16_t background_pred_flag; |
1595 | uint16_t background_reference_enable; |
1596 | uint16_t random_access_decodable_flag; |
1597 | uint16_t lcu_size; |
1598 | uint16_t alpha_c_offset; |
1599 | uint16_t beta_offset; |
1600 | uint16_t chroma_quant_param_delta_cb; |
1601 | uint16_t chroma_quant_param_delta_cr; |
1602 | uint16_t loop_filter_disable; |
1603 | |
1604 | uint16_t video_signal_type; |
1605 | uint16_t color_description; |
1606 | uint16_t display_primaries_x[3]; |
1607 | uint16_t display_primaries_y[3]; |
1608 | uint16_t white_point_x; |
1609 | uint16_t white_point_y; |
1610 | uint16_t max_display_mastering_luminance; |
1611 | uint16_t min_display_mastering_luminance; |
1612 | uint16_t max_content_light_level; |
1613 | uint16_t max_picture_average_light_level; |
1614 | } p; |
1615 | struct { |
1616 | uint16_t padding[ALF_BEGIN - RPM_BEGIN]; |
1617 | uint16_t picture_alf_enable_Y; |
1618 | uint16_t picture_alf_enable_Cb; |
1619 | uint16_t picture_alf_enable_Cr; |
1620 | uint16_t alf_filters_num_m_1; |
1621 | uint16_t region_distance[16]; |
1622 | uint16_t alf_cb_coeffmulti[9]; |
1623 | uint16_t alf_cr_coeffmulti[9]; |
1624 | uint16_t alf_y_coeffmulti[16][9]; |
1625 | } alf; |
1626 | }; |
1627 | |
1628 | |
1629 | struct avs2_decoder { |
1630 | uint8_t init_hw_flag; |
1631 | struct inp_par input; |
1632 | struct ImageParameters_s img; |
1633 | struct Video_Com_data_s hc; |
1634 | struct Video_Dec_data_s hd; |
1635 | union param_u param; |
1636 | struct avs2_frame_s frm_pool[AVS2_MAX_BUFFER_NUM]; |
1637 | struct avs2_frame_s *fref[REF_MAXBUFFER]; |
1638 | #ifdef AML |
1639 | /*used for background |
1640 | when background_picture_output_flag is 0*/ |
1641 | struct avs2_frame_s *m_bg; |
1642 | /*current background picture, ether m_bg or fref[..]*/ |
1643 | struct avs2_frame_s *f_bg; |
1644 | #endif |
1645 | struct outdata_s outprint; |
1646 | uint32_t cm_header_start; |
1647 | struct ALFParam_s m_alfPictureParam[NUM_ALF_COMPONENT]; |
1648 | #ifdef FIX_CHROMA_FIELD_MV_BK_DIST |
1649 | int8_t bk_img_is_top_field; |
1650 | #endif |
1651 | #ifdef AML |
1652 | int32_t lcu_size; |
1653 | int32_t lcu_size_log2; |
1654 | int32_t lcu_x_num; |
1655 | int32_t lcu_y_num; |
1656 | int32_t lcu_total; |
1657 | int32_t ref_maxbuffer; |
1658 | int32_t to_prepare_disp_count; |
1659 | int8_t bufmgr_error_flag; |
1660 | #endif |
1661 | }; |
1662 | |
1663 | |
1664 | extern void write_frame(struct avs2_decoder *avs2_dec, int32_t pos); |
1665 | extern void init_frame_t(struct avs2_frame_s *currfref); |
1666 | extern void report_frame(struct avs2_decoder *avs2_dec, |
1667 | struct outdata_s *data, int32_t pos); |
1668 | |
1669 | extern int avs2_post_process(struct avs2_decoder *avs2_dec); |
1670 | extern void avs2_prepare_header(struct avs2_decoder *avs2_dec, |
1671 | int32_t start_code); |
1672 | extern int32_t avs2_process_header(struct avs2_decoder *avs2_dec); |
1673 | |
1674 | extern void init_avs2_decoder(struct avs2_decoder *avs2_dec); |
1675 | |
1676 | extern int32_t avs2_init_global_buffers(struct avs2_decoder *avs2_dec); |
1677 | |
1678 | extern bool is_avs2_print_param(void); |
1679 | extern bool is_avs2_print_bufmgr_detail(void); |
1680 | #endif |
1681 | |
1682 |