blob: 3e7fcb842cbb3226d3cf4c17cce16ba6fd7ec108
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 | u32 hw_decode_time; |
816 | u32 frame_size; // For frame base mode |
817 | }; |
818 | |
819 | |
820 | struct ImageParameters_s { |
821 | struct codingUnit *mb_data; |
822 | int32_t number; /* <! frame number */ |
823 | int32_t numIPFrames; |
824 | |
825 | int32_t type; |
826 | int32_t typeb; |
827 | int32_t typeb_before; |
828 | |
829 | int32_t qp; /* <! quant for the current frame */ |
830 | int32_t current_mb_nr; /* bitstream order */ |
831 | int32_t current_slice_nr; |
832 | int32_t tr; /* <! temporal reference, 8 bit, */ |
833 | |
834 | int32_t width; /* !< Number of pels */ |
835 | int32_t width_cr; /* !< Number of pels chroma */ |
836 | int32_t height; /* !< Number of lines */ |
837 | int32_t height_cr; /* !< Number of lines chroma */ |
838 | int32_t PicWidthInMbs; |
839 | int32_t PicSizeInMbs; |
840 | int32_t block8_x, block8_y; |
841 | int32_t subblock_x; |
842 | int32_t subblock_y; |
843 | |
844 | int32_t num_of_references; |
845 | /* <! Bug Fix: correct picture size for outputted reconstructed pictures */ |
846 | int32_t auto_crop_right; |
847 | int32_t auto_crop_bottom; |
848 | int32_t buf_cycle; |
849 | int32_t picture_structure; |
850 | /* <! pointer to current Slice data struct */ |
851 | struct slice *currentSlice; |
852 | |
853 | int32_t **predBlock; /* !< current best prediction mode */ |
854 | int32_t **predBlockTmp; |
855 | /* !< the diff pixel values between orginal image and prediction */ |
856 | int32_t **resiY; |
857 | /* !< Array containing square values,used for snr computation */ |
858 | int32_t *quad; |
859 | |
860 | /* //location of current MB////// */ |
861 | int32_t mb_y; /* !< current MB vertical */ |
862 | int32_t mb_x; /* !< current MB horizontal */ |
863 | int32_t pix_y; /* !< current pixel vertical */ |
864 | int32_t pix_x; /* !< current pixel horizontal */ |
865 | int32_t pix_c_y; /* !< current pixel chroma vertical */ |
866 | int32_t pix_c_x; /* !< current pixel chroma horizontal */ |
867 | |
868 | int32_t imgtr_next_P; |
869 | |
870 | int32_t imgcoi_next_ref; |
871 | |
872 | /* !< GH ipredmode[90][74];prediction mode for inter frames */ |
873 | /* fix from ver 4.1 */ |
874 | int32_t **ipredmode; |
875 | int32_t **rec_ipredmode; |
876 | |
877 | |
878 | /* //////////////decoder////////////////////////// */ |
879 | int32_t max_mb_nr; |
880 | int32_t **intra_block; |
881 | |
882 | int32_t block_y; |
883 | int32_t block_x; |
884 | /* <! final 4x4 block. Extended to 16x16 for AVS */ |
885 | int32_t resiUV[2][MAX_CU_SIZE][MAX_CU_SIZE]; |
886 | |
887 | int32_t **fw_refFrArr; /* <! [72][88]; */ |
888 | int32_t **bw_refFrArr; /* <! [72][88]; */ |
889 | |
890 | int32_t random_access_decodable_flag; |
891 | |
892 | int32_t seq_header_indicate; |
893 | int32_t B_discard_flag; |
894 | |
895 | /* B pictures */ |
896 | uint32_t pic_distance; |
897 | |
898 | uint32_t coding_order; |
899 | |
900 | uint32_t PrevPicDistanceLsb; |
901 | int32_t CurrPicDistanceMsb; |
902 | |
903 | int32_t PicHeightInMbs; |
904 | |
905 | int32_t types; |
906 | |
907 | int32_t new_sequence_flag; |
908 | int32_t sequence_end_flag; /* <! rm52k_r2 */ |
909 | |
910 | int32_t current_slice_set_index; /* <! added by mz, 2008.04 */ |
911 | int32_t current_slice_header_flag; /* <! added by mz, 2008.04 */ |
912 | int32_t slice_set_qp[64]; /* <! added by mz, 2008.04 */ |
913 | |
914 | |
915 | int32_t inter_amp_enable; |
916 | |
917 | /* ////////////////////////encoder////////////////////////// */ |
918 | |
919 | /* int32_t nb_references; //!< replaced by "num_of_references" */ |
920 | |
921 | int32_t framerate; |
922 | |
923 | int32_t ***predBlockY; /* !< all 9 prediction modes */ |
924 | /* !< new chroma 8x8 intra prediction modes */ |
925 | int32_t ****predBlockUV; |
926 | |
927 | int32_t **Coeff_all;/* qyu 0821 */ |
928 | |
929 | struct syntaxelement *MB_SyntaxElements; /* !< by oliver 0612 */ |
930 | |
931 | /* B pictures */ |
932 | |
933 | int32_t b_frame_to_code; |
934 | int32_t num_ref_pic_active_fwd_minus1; |
935 | int32_t num_ref_pic_active_bwd_minus1; |
936 | int32_t mv_range_flag; |
937 | |
938 | uint32_t frame_num; /* frame_num for this frame */ |
939 | int32_t slice_offset; |
940 | /* the following are sent in the slice header */ |
941 | int32_t NoResidueDirect; |
942 | int32_t coded_mb_nr; |
943 | int32_t progressive_frame; |
944 | int32_t tc_reserve_bit; |
945 | /* the last MB no in current slice. Yulj 2004.07.15 */ |
946 | int32_t mb_no_currSliceLastMB; |
947 | int32_t Seqheader_flag; /* Added by cjw, 20070327 */ |
948 | int32_t EncodeEnd_flag; /* Carmen, 2007/12/19 */ |
949 | |
950 | uint16_t bbv_delay; |
951 | |
952 | int32_t tmp_fwBSkipMv[DIRECTION + 1][2]; |
953 | int32_t tmp_bwBSkipMv[DIRECTION + 1][2]; |
954 | |
955 | int32_t tmp_pref_fst[MH_PSKIP_NUM + NUM_OFFSET + 1]; |
956 | int32_t tmp_pref_snd[MH_PSKIP_NUM + NUM_OFFSET + 1]; |
957 | int32_t tmp_fstPSkipMv[MH_PSKIP_NUM + NUM_OFFSET + 1][3]; |
958 | int32_t tmp_sndPSkipMv[MH_PSKIP_NUM + NUM_OFFSET + 1][3]; |
959 | #if BCBR |
960 | byte *org_ref_y; |
961 | byte *org_ref_u; |
962 | byte *org_ref_v; |
963 | int32_t *BLCUidx; |
964 | int32_t *DQPList; |
965 | int32_t iNumCUsInFrame; |
966 | |
967 | byte *org_ref2_y; |
968 | byte *org_ref2_u; |
969 | byte *org_ref2_v; |
970 | int32_t ref2Num; |
971 | #endif |
972 | /* //////////////SAO parameter////////////////// */ |
973 | double *cur_saorate; |
974 | #if 0 |
975 | int32_t slice_sao_on[NUM_SAO_COMPONENTS]; |
976 | #endif |
977 | int32_t pic_alf_on[NUM_ALF_COMPONENT]; |
978 | struct alfdatapart *dp_ALF; |
979 | |
980 | #if INTERLACE_CODING |
981 | int32_t is_field_sequence; |
982 | int32_t is_top_field; |
983 | #endif |
984 | |
985 | |
986 | }; |
987 | |
988 | |
989 | |
990 | /* ! struct for context management */ |
991 | struct BiContextType_s { |
992 | uint8_t MPS; /* 1 bit */ |
993 | uint32_t LG_PMPS; /* 10 bits */ |
994 | uint8_t cycno; /* 2 bits */ |
995 | }; |
996 | |
997 | /*********************************************************************** |
998 | * D a t a t y p e s f o r A E C |
999 | ************************************************************************/ |
1000 | |
1001 | |
1002 | |
1003 | struct pix_pos { |
1004 | int32_t available; /* ABCD */ |
1005 | int32_t mb_addr; /* MB position */ |
1006 | int32_t x; |
1007 | int32_t y; |
1008 | int32_t pos_x; /* 4x4 x-pos */ |
1009 | int32_t pos_y; |
1010 | }; |
1011 | |
1012 | |
1013 | |
1014 | struct STDOUT_DATA_s { |
1015 | int32_t type; |
1016 | int32_t typeb; |
1017 | |
1018 | int32_t framenum; |
1019 | int32_t tr; |
1020 | int32_t qp; |
1021 | double snr_y; |
1022 | double snr_u; |
1023 | double snr_v; |
1024 | int32_t tmp_time; |
1025 | int32_t picture_structure; |
1026 | int32_t curr_frame_bits; |
1027 | int32_t emulate_bits; |
1028 | |
1029 | uint32_t DecMD5Value[4]; |
1030 | #if RD1501_FIX_BG |
1031 | int32_t background_picture_output_flag;/* Longfei.Wang@mediatek.com */ |
1032 | #endif |
1033 | #if RD160_FIX_BG |
1034 | int32_t picture_reorder_delay; |
1035 | #endif |
1036 | int8_t str_reference_list[128]; /* reference list information */ |
1037 | }; |
1038 | |
1039 | /********************************************************************** |
1040 | * 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 |
1041 | ********************************************************************** |
1042 | */ |
1043 | #define NUM_CuType_CTX (11 + 10) |
1044 | #define NUM_B8_TYPE_CTX 9 |
1045 | #define NUM_MVD_CTX 15 |
1046 | #define NUM_PMV_IDX_CTX 10 |
1047 | #define NUM_REF_NO_CTX 6 |
1048 | #define NUM_DELTA_QP_CTX 4 |
1049 | #define NUM_INTER_DIR_CTX 18 |
1050 | #define NUM_INTER_DIR_DHP_CTX 3 |
1051 | #define NUM_B8_TYPE_DHP_CTX 1 |
1052 | #define NUM_AMP_CTX 2 |
1053 | #define NUM_C_INTRA_MODE_CTX 4 |
1054 | #define NUM_CBP_CTX 4 |
1055 | #define NUM_BCBP_CTX 4 |
1056 | #define NUM_MAP_CTX 17 |
1057 | #define NUM_LAST_CTX 17 |
1058 | |
1059 | #define NUM_INTRA_MODE_CTX 7 |
1060 | |
1061 | #define NUM_ABS_CTX 5 |
1062 | #define NUM_TU_CTX 3 |
1063 | #define NUM_SPLIT_CTX 8 /* CU depth */ |
1064 | #if BCBR |
1065 | #define NUM_BGBLCOK_CTX 1 |
1066 | #endif |
1067 | |
1068 | #define NUM_BRP_CTX 8 |
1069 | |
1070 | |
1071 | #define NUM_LAST_CG_CTX_LUMA 12 |
1072 | #define NUM_LAST_CG_CTX_CHROMA 6 |
1073 | #define NUM_SIGCG_CTX_LUMA 2 |
1074 | #define NUM_SIGCG_CTX_CHROMA 1 |
1075 | #define NUM_LAST_POS_CTX_LUMA 56 |
1076 | #define NUM_LAST_POS_CTX_CHROMA 16 |
1077 | #define NUM_LAST_CG_CTX (NUM_LAST_CG_CTX_LUMA + NUM_LAST_CG_CTX_CHROMA) |
1078 | #define NUM_SIGCG_CTX (NUM_SIGCG_CTX_LUMA + NUM_SIGCG_CTX_CHROMA) |
1079 | #define NUM_LAST_POS_CTX (NUM_LAST_POS_CTX_LUMA + NUM_LAST_POS_CTX_CHROMA) |
1080 | #define NUM_SAO_MERGE_FLAG_CTX 3 |
1081 | #define NUM_SAO_MODE_CTX 1 |
1082 | #define NUM_SAO_OFFSET_CTX 2 |
1083 | #define NUM_INTER_DIR_MIN_CTX 2 |
1084 | |
1085 | /*end #include "commonStructures.h"*/ |
1086 | |
1087 | /*#include "commonVariables.h"*/ |
1088 | |
1089 | /* |
1090 | extern struct CameraParamters_s *camera; |
1091 | extern struct SNRParameters_s *snr; |
1092 | extern struct ImageParameters_s *img; |
1093 | */ |
1094 | |
1095 | /* avs2_frame_t *fref[REF_MAXBUFFER]; */ |
1096 | |
1097 | |
1098 | #define ET_SIZE 300 /* !< size of error text buffer */ |
1099 | |
1100 | |
1101 | /* ------------------------------------------------------ |
1102 | * common data |
1103 | */ |
1104 | struct Video_Com_data_s { |
1105 | int32_t Bframe_ctr; |
1106 | |
1107 | /* FILE *p_log; //!< SNR file */ |
1108 | /* FILE *p_trace; //!< Trace file */ |
1109 | |
1110 | int32_t tot_time; |
1111 | |
1112 | /* Tsinghua for picture_distance 200701 */ |
1113 | int32_t picture_distance; |
1114 | |
1115 | /* M3178 PKU Reference Manage */ |
1116 | int32_t coding_order; |
1117 | /* !< current encoding/decoding frame pointer */ |
1118 | struct avs2_frame_s *f_rec; |
1119 | int32_t seq_header; |
1120 | /* !< Array for reference frames of each block */ |
1121 | int32_t **refFrArr; |
1122 | int32_t **p_snd_refFrArr; |
1123 | |
1124 | byte ***currentFrame; /* [yuv][height][width] */ |
1125 | #ifdef AML |
1126 | struct avs2_frame_s *cur_pic; /*either f_rec or m_bg*/ |
1127 | #endif |
1128 | byte **backgroundReferenceFrame[3]; |
1129 | byte ***background_ref; |
1130 | |
1131 | |
1132 | int32_t total_frames; |
1133 | |
1134 | /* mv_range, 20071009 */ |
1135 | int32_t Min_V_MV; |
1136 | int32_t Max_V_MV; |
1137 | int32_t Min_H_MV; |
1138 | int32_t Max_H_MV; |
1139 | /* !< buffer for error message for exit with error(void) */ |
1140 | int8_t errortext[ET_SIZE]; |
1141 | int8_t str_list_reference[128]; |
1142 | |
1143 | |
1144 | }; |
1145 | /* extern Video_Com_data *hc; */ |
1146 | |
1147 | |
1148 | /*end #include "commonVariables.h"*/ |
1149 | /* #define USE_PARAM_TXT */ |
1150 | /* |
1151 | #if FIX_CHROMA_FIELD_MV_BK_DIST |
1152 | int8_t bk_img_is_top_field; |
1153 | #endif |
1154 | */ |
1155 | /* void write_GB_frame(FILE *p_dec); */ |
1156 | |
1157 | #if !FIX_MAX_REF |
1158 | #define MAXREF 4 |
1159 | #define MAXGOP 32 |
1160 | #endif |
1161 | |
1162 | struct StatBits { |
1163 | int32_t curr_frame_bits; |
1164 | int32_t prev_frame_bits; |
1165 | int32_t emulate_bits; |
1166 | int32_t prev_emulate_bits; |
1167 | int32_t last_unit_bits; |
1168 | int32_t bitrate; |
1169 | int32_t total_bitrate[1000]; |
1170 | int32_t coded_pic_num; |
1171 | int32_t time_s; |
1172 | }; |
1173 | |
1174 | struct reference_management { |
1175 | int32_t poc; |
1176 | int32_t qp_offset; |
1177 | int32_t num_of_ref; |
1178 | int32_t referd_by_others; |
1179 | int32_t ref_pic[MAXREF]; |
1180 | int32_t predict; |
1181 | int32_t deltaRPS; |
1182 | int32_t num_to_remove; |
1183 | int32_t remove_pic[MAXREF]; |
1184 | }; |
1185 | |
1186 | |
1187 | /* ------------------------------------------------------ |
1188 | * dec data |
1189 | */ |
1190 | struct Video_Dec_data_s { |
1191 | byte **background_frame[3]; |
1192 | int32_t background_reference_enable; |
1193 | |
1194 | int32_t background_picture_flag; |
1195 | int32_t background_picture_output_flag; |
1196 | int32_t background_picture_enable; |
1197 | |
1198 | int32_t background_number; |
1199 | |
1200 | #if BCBR |
1201 | int32_t bcbr_enable; |
1202 | #endif |
1203 | |
1204 | int32_t demulate_enable; |
1205 | int32_t currentbitoffset; |
1206 | |
1207 | int32_t aspect_ratio_information; |
1208 | int32_t frame_rate_code; |
1209 | int32_t bit_rate_lower; |
1210 | int32_t bit_rate_upper; |
1211 | int32_t marker_bit; |
1212 | |
1213 | int32_t video_format; |
1214 | int32_t color_description; |
1215 | int32_t color_primaries; |
1216 | int32_t transfer_characteristics; |
1217 | int32_t matrix_coefficients; |
1218 | |
1219 | int32_t progressive_sequence; |
1220 | #if INTERLACE_CODING |
1221 | int32_t is_field_sequence; |
1222 | #endif |
1223 | int32_t low_delay; |
1224 | int32_t horizontal_size; |
1225 | int32_t vertical_size; |
1226 | int32_t sample_precision; |
1227 | int32_t video_range; |
1228 | |
1229 | int32_t display_horizontal_size; |
1230 | int32_t display_vertical_size; |
1231 | int32_t TD_mode; |
1232 | int32_t view_packing_mode; |
1233 | int32_t view_reverse; |
1234 | |
1235 | int32_t b_pmvr_enabled; |
1236 | int32_t dhp_enabled; |
1237 | int32_t b_dmh_enabled; |
1238 | int32_t b_mhpskip_enabled; |
1239 | int32_t wsm_enabled; |
1240 | int32_t b_secT_enabled; |
1241 | |
1242 | int32_t tmp_time; |
1243 | int32_t FrameNum; |
1244 | int32_t eos; |
1245 | int32_t pre_img_type; |
1246 | int32_t pre_img_types; |
1247 | /* int32_t pre_str_vec; */ |
1248 | int32_t pre_img_tr; |
1249 | int32_t pre_img_qp; |
1250 | int32_t pre_tmp_time; |
1251 | int32_t RefPicExist; /* 20071224 */ |
1252 | int32_t BgRefPicExist; |
1253 | int32_t dec_ref_num; /* ref order */ |
1254 | |
1255 | /* video edit code */ /* M1956 by Grandview 2006.12.12 */ |
1256 | int32_t vec_flag; |
1257 | |
1258 | /* Copyright_extension(void) header */ |
1259 | int32_t copyright_flag; |
1260 | int32_t copyright_identifier; |
1261 | int32_t original_or_copy; |
1262 | int64_t copyright_number_1; |
1263 | int64_t copyright_number_2; |
1264 | int64_t copyright_number_3; |
1265 | /* Camera_parameters_extension */ |
1266 | int32_t camera_id; |
1267 | int32_t height_of_image_device; |
1268 | int32_t focal_length; |
1269 | int32_t f_number; |
1270 | int32_t vertical_angle_of_view; |
1271 | int32_t camera_position_x_upper; |
1272 | int32_t camera_position_x_lower; |
1273 | int32_t camera_position_y_upper; |
1274 | int32_t camera_position_y_lower; |
1275 | int32_t camera_position_z_upper; |
1276 | int32_t camera_position_z_lower; |
1277 | int32_t camera_direction_x; |
1278 | int32_t camera_direction_y; |
1279 | int32_t camera_direction_z; |
1280 | int32_t image_plane_vertical_x; |
1281 | int32_t image_plane_vertical_y; |
1282 | int32_t image_plane_vertical_z; |
1283 | |
1284 | #if AVS2_HDR_HLS |
1285 | /* mastering_display_and_content_metadata_extension(void) header */ |
1286 | int32_t display_primaries_x0; |
1287 | int32_t display_primaries_y0; |
1288 | int32_t display_primaries_x1; |
1289 | int32_t display_primaries_y1; |
1290 | int32_t display_primaries_x2; |
1291 | int32_t display_primaries_y2; |
1292 | int32_t white_point_x; |
1293 | int32_t white_point_y; |
1294 | int32_t max_display_mastering_luminance; |
1295 | int32_t min_display_mastering_luminance; |
1296 | int32_t maximum_content_light_level; |
1297 | int32_t maximum_frame_average_light_level; |
1298 | #endif |
1299 | |
1300 | /* I_pictures_header(void) */ |
1301 | int32_t top_field_first; |
1302 | int32_t repeat_first_field; |
1303 | int32_t progressive_frame; |
1304 | #if INTERLACE_CODING |
1305 | int32_t is_top_field; |
1306 | #endif |
1307 | /* int32_t fixed_picture_qp; //qyu 0927 */ |
1308 | int32_t picture_qp; |
1309 | int32_t fixed_picture_qp; |
1310 | int32_t time_code_flag; |
1311 | int32_t time_code; |
1312 | int32_t loop_filter_disable; |
1313 | int32_t loop_filter_parameter_flag; |
1314 | /* int32_t alpha_offset; */ |
1315 | /* int32_t beta_offset; */ |
1316 | |
1317 | /* Pb_picture_header(void) */ |
1318 | int32_t picture_coding_type; |
1319 | |
1320 | /*picture_display_extension(void)*/ |
1321 | int32_t frame_centre_horizontal_offset[4]; |
1322 | int32_t frame_centre_vertical_offset[4]; |
1323 | |
1324 | /* slice_header(void) */ |
1325 | int32_t img_width; |
1326 | int32_t slice_vertical_position; |
1327 | int32_t slice_vertical_position_extension; |
1328 | int32_t fixed_slice_qp; |
1329 | int32_t slice_qp; |
1330 | int32_t slice_horizontal_positon; /* added by mz, 2008.04 */ |
1331 | int32_t slice_horizontal_positon_extension; |
1332 | |
1333 | int32_t StartCodePosition; |
1334 | int32_t background_pred_flag; |
1335 | |
1336 | |
1337 | /* Reference Manage */ |
1338 | int32_t displaydelay; |
1339 | int32_t picture_reorder_delay; |
1340 | #if M3480_TEMPORAL_SCALABLE |
1341 | int32_t temporal_id_exist_flag; |
1342 | #endif |
1343 | |
1344 | int32_t gop_size; |
1345 | struct reference_management decod_RPS[MAXGOP]; |
1346 | struct reference_management curr_RPS; |
1347 | int32_t last_output; |
1348 | int32_t trtmp; |
1349 | #if M3480_TEMPORAL_SCALABLE |
1350 | int32_t cur_layer; |
1351 | #endif |
1352 | |
1353 | /* Adaptive frequency weighting quantization */ |
1354 | #if FREQUENCY_WEIGHTING_QUANTIZATION |
1355 | int32_t weight_quant_enable_flag; |
1356 | int32_t load_seq_weight_quant_data_flag; |
1357 | |
1358 | int32_t pic_weight_quant_enable_flag; |
1359 | int32_t pic_weight_quant_data_index; |
1360 | int32_t weighting_quant_param; |
1361 | int32_t weighting_quant_model; |
1362 | int16_t quant_param_undetail[6]; /* M2148 2007-09 */ |
1363 | int16_t quant_param_detail[6]; /* M2148 2007-09 */ |
1364 | int32_t WeightQuantEnable; /* M2148 2007-09 */ |
1365 | int32_t mb_adapt_wq_disable; /* M2331 2008-04 */ |
1366 | int32_t mb_wq_mode; /* M2331 2008-04 */ |
1367 | #if CHROMA_DELTA_QP |
1368 | int32_t chroma_quant_param_disable; |
1369 | int32_t chroma_quant_param_delta_u; |
1370 | int32_t chroma_quant_param_delta_v; |
1371 | #endif |
1372 | |
1373 | int32_t b_pre_dec_intra_img; |
1374 | int32_t pre_dec_img_type; |
1375 | int32_t CurrentSceneModel; |
1376 | #endif |
1377 | |
1378 | int32_t curr_IDRcoi; |
1379 | int32_t curr_IDRtr; |
1380 | int32_t next_IDRtr; |
1381 | int32_t next_IDRcoi; |
1382 | int32_t end_SeqTr; |
1383 | |
1384 | #if MB_DQP |
1385 | int32_t lastQP; |
1386 | /* FILE * testQP; */ |
1387 | #endif |
1388 | |
1389 | }; |
1390 | /* extern Video_Dec_data *hd; */ |
1391 | |
1392 | struct DecodingEnvironment_s { |
1393 | uint32_t Dbuffer; |
1394 | int32_t Dbits_to_go; |
1395 | uint8_t *Dcodestrm; |
1396 | int32_t *Dcodestrm_len; |
1397 | }; |
1398 | |
1399 | /* added at rm52k version */ |
1400 | |
1401 | struct inp_par; |
1402 | |
1403 | |
1404 | |
1405 | /* ! Slice */ |
1406 | struct slice { |
1407 | int32_t picture_id; |
1408 | int32_t qp; |
1409 | int32_t picture_type; /* !< picture type */ |
1410 | int32_t start_mb_nr; |
1411 | /* !< number of different partitions */ |
1412 | int32_t max_part_nr; |
1413 | |
1414 | /* added by lzhang */ |
1415 | /* !< pointer to struct of context models for use in AEC */ |
1416 | struct SyntaxInfoContexts_s *syn_ctx; |
1417 | }; |
1418 | |
1419 | struct alfdatapart { |
1420 | struct Bitstream_s *bitstream; |
1421 | struct DecodingEnvironment_s de_AEC; |
1422 | struct SyntaxInfoContexts_s *syn_ctx; |
1423 | }; |
1424 | /* static int32_t alfParAllcoated = 0; */ |
1425 | |
1426 | /* input parameters from configuration file */ |
1427 | struct inp_par { |
1428 | int32_t buf_cycle; /* <! Frame buffer size */ |
1429 | int32_t ref_pic_order; /* <! ref order */ |
1430 | int32_t output_dec_pic; /* <! output_dec_pic */ |
1431 | int32_t profile_id; |
1432 | int32_t level_id; |
1433 | int32_t chroma_format; |
1434 | int32_t g_uiMaxSizeInBit; |
1435 | int32_t alpha_c_offset; |
1436 | int32_t beta_offset; |
1437 | int32_t useNSQT; |
1438 | #if MB_DQP |
1439 | int32_t useDQP; |
1440 | #endif |
1441 | int32_t useSDIP; |
1442 | int32_t sao_enable; |
1443 | #if M3480_TEMPORAL_SCALABLE |
1444 | int32_t temporal_id_exist_flag; |
1445 | #endif |
1446 | int32_t alf_enable; |
1447 | |
1448 | int32_t crossSliceLoopFilter; |
1449 | |
1450 | int32_t sample_bit_depth; /* sample bit depth */ |
1451 | /* decoded file bit depth (assuming output_bit_depth is |
1452 | less or equal to sample_bit_depth) */ |
1453 | int32_t output_bit_depth; |
1454 | |
1455 | |
1456 | int32_t MD5Enable; |
1457 | |
1458 | #if OUTPUT_INTERLACE_MERGED_PIC |
1459 | int32_t output_interlace_merged_picture; |
1460 | #endif |
1461 | |
1462 | }; |
1463 | |
1464 | /* extern struct inp_par *input; */ |
1465 | |
1466 | struct outdata_s { |
1467 | #if RD170_FIX_BG |
1468 | struct STDOUT_DATA_s stdoutdata[REF_MAXBUFFER]; |
1469 | #else |
1470 | struct STDOUT_DATA_s stdoutdata[8]; |
1471 | #endif |
1472 | int32_t buffer_num; |
1473 | }; |
1474 | /* outdata outprint; */ |
1475 | |
1476 | #define PAYLOAD_TYPE_IDERP 8 |
1477 | |
1478 | struct Bitstream_s *AllocBitstream(void); |
1479 | void FreeBitstream(void); |
1480 | #if TRACE |
1481 | void tracebits2(const int8_t *trace_str, int32_t len, int32_t info); |
1482 | #endif |
1483 | |
1484 | /* int32_t direct_mv[45][80][4][4][3]; // only to verify result */ |
1485 | |
1486 | #define I_PICTURE_START_CODE 0xB3 |
1487 | #define PB_PICTURE_START_CODE 0xB6 |
1488 | #define SLICE_START_CODE_MIN 0x00 |
1489 | #define SLICE_START_CODE_MAX 0x8F |
1490 | #define USER_DATA_START_CODE 0xB2 |
1491 | #define SEQUENCE_HEADER_CODE 0xB0 |
1492 | #define EXTENSION_START_CODE 0xB5 |
1493 | #define SEQUENCE_END_CODE 0xB1 |
1494 | #define VIDEO_EDIT_CODE 0xB7 |
1495 | |
1496 | |
1497 | #define SEQUENCE_DISPLAY_EXTENSION_ID 2 |
1498 | #define COPYRIGHT_EXTENSION_ID 4 |
1499 | #define CAMERAPARAMETERS_EXTENSION_ID 11 |
1500 | #define PICTURE_DISPLAY_EXTENSION_ID 7 |
1501 | #if M3480_TEMPORAL_SCALABLE |
1502 | #define TEMPORAL_SCALABLE_EXTENSION_ID 3 |
1503 | #endif |
1504 | |
1505 | #if ROI_M3264 |
1506 | #if RD1501_FIX_BG |
1507 | #define LOCATION_DATA_EXTENSION_ID 12 |
1508 | #else |
1509 | #define LOCATION_DATA_EXTENSION_ID 15 |
1510 | #endif |
1511 | #endif |
1512 | |
1513 | #if AVS2_HDR_HLS |
1514 | #define MASTERING_DISPLAY_AND_CONTENT_METADATA_EXTENSION 10 |
1515 | #endif |
1516 | |
1517 | void malloc_slice(void); |
1518 | void free_slice(void); |
1519 | |
1520 | |
1521 | void read_ipred_modes(void); |
1522 | |
1523 | int32_t AEC_startcode_follows(int32_t eos_bit); |
1524 | |
1525 | /* extern uint32_t max_value_s; */ |
1526 | |
1527 | /*ComAdaptiveLoopFilter.h*/ |
1528 | #define ALF_MAX_NUM_COEF 9 |
1529 | #define NO_VAR_BINS 16 |
1530 | |
1531 | |
1532 | #define RPM_BEGIN 0x100 |
1533 | #define ALF_BEGIN 0x180 |
1534 | #define RPM_END 0x280 |
1535 | |
1536 | union param_u { |
1537 | struct { |
1538 | uint16_t data[RPM_END - RPM_BEGIN]; |
1539 | } l; |
1540 | struct { |
1541 | /*sequence*/ |
1542 | uint16_t profile_id; |
1543 | uint16_t level_id; |
1544 | uint16_t progressive_sequence; |
1545 | uint16_t is_field_sequence; |
1546 | uint16_t horizontal_size; |
1547 | uint16_t vertical_size; |
1548 | uint16_t chroma_format; |
1549 | uint16_t sample_precision; |
1550 | uint16_t encoding_precision; |
1551 | uint16_t aspect_ratio_information; |
1552 | uint16_t frame_rate_code; |
1553 | uint16_t bit_rate_lower; |
1554 | uint16_t bit_rate_upper; |
1555 | uint16_t low_delay; |
1556 | uint16_t temporal_id_exist_flag; |
1557 | uint16_t g_uiMaxSizeInBit; |
1558 | |
1559 | #define BACKGROUND_PICTURE_DISABLE_BIT 11 |
1560 | #define B_MHPSKIP_ENABLED_BIT 10 |
1561 | #define DHP_ENABLED_BIT 9 |
1562 | #define WSM_ENABLED_BIT 8 |
1563 | #define INTER_AMP_ENABLE_BIT 7 |
1564 | #define USENSQT_BIT 6 |
1565 | #define USESDIP_BIT 5 |
1566 | #define B_SECT_ENABLED_BIT 4 |
1567 | #define SAO_ENABLE_BIT 3 |
1568 | #define ALF_ENABLE_BIT 2 |
1569 | #define B_PMVR_ENABLED_BIT 1 |
1570 | #define CROSSSLICELOOPFILTER_BIT 0 |
1571 | uint16_t avs2_seq_flags; |
1572 | |
1573 | uint16_t num_of_RPS; |
1574 | uint16_t picture_reorder_delay; |
1575 | /*PIC*/ |
1576 | uint16_t time_code_flag; |
1577 | uint16_t time_code; |
1578 | uint16_t background_picture_flag; |
1579 | uint16_t background_picture_output_flag; |
1580 | uint16_t coding_order; |
1581 | uint16_t cur_layer; |
1582 | uint16_t displaydelay; /*???*/ |
1583 | uint16_t predict; /*???*/ |
1584 | uint16_t RPS_idx; /*???*/ |
1585 | uint16_t referd_by_others_cur; |
1586 | uint16_t num_of_ref_cur; |
1587 | uint16_t ref_pic_cur[8]; |
1588 | uint16_t num_to_remove_cur; |
1589 | uint16_t remove_pic_cur[8]; |
1590 | uint16_t progressive_frame; |
1591 | uint16_t picture_structure; |
1592 | uint16_t top_field_first; |
1593 | uint16_t repeat_first_field; |
1594 | uint16_t is_top_field; |
1595 | |
1596 | uint16_t picture_coding_type; |
1597 | uint16_t background_pred_flag; |
1598 | uint16_t background_reference_enable; |
1599 | uint16_t random_access_decodable_flag; |
1600 | uint16_t lcu_size; |
1601 | uint16_t alpha_c_offset; |
1602 | uint16_t beta_offset; |
1603 | uint16_t chroma_quant_param_delta_cb; |
1604 | uint16_t chroma_quant_param_delta_cr; |
1605 | uint16_t loop_filter_disable; |
1606 | |
1607 | uint16_t video_signal_type; |
1608 | uint16_t color_description; |
1609 | uint16_t display_primaries_x[3]; |
1610 | uint16_t display_primaries_y[3]; |
1611 | uint16_t white_point_x; |
1612 | uint16_t white_point_y; |
1613 | uint16_t max_display_mastering_luminance; |
1614 | uint16_t min_display_mastering_luminance; |
1615 | uint16_t max_content_light_level; |
1616 | uint16_t max_picture_average_light_level; |
1617 | } p; |
1618 | struct { |
1619 | uint16_t padding[ALF_BEGIN - RPM_BEGIN]; |
1620 | uint16_t picture_alf_enable_Y; |
1621 | uint16_t picture_alf_enable_Cb; |
1622 | uint16_t picture_alf_enable_Cr; |
1623 | uint16_t alf_filters_num_m_1; |
1624 | uint16_t region_distance[16]; |
1625 | uint16_t alf_cb_coeffmulti[9]; |
1626 | uint16_t alf_cr_coeffmulti[9]; |
1627 | uint16_t alf_y_coeffmulti[16][9]; |
1628 | } alf; |
1629 | }; |
1630 | |
1631 | |
1632 | struct avs2_decoder { |
1633 | uint8_t init_hw_flag; |
1634 | struct inp_par input; |
1635 | struct ImageParameters_s img; |
1636 | struct Video_Com_data_s hc; |
1637 | struct Video_Dec_data_s hd; |
1638 | union param_u param; |
1639 | struct avs2_frame_s frm_pool[AVS2_MAX_BUFFER_NUM]; |
1640 | struct avs2_frame_s *fref[REF_MAXBUFFER]; |
1641 | #ifdef AML |
1642 | /*used for background |
1643 | when background_picture_output_flag is 0*/ |
1644 | struct avs2_frame_s *m_bg; |
1645 | /*current background picture, ether m_bg or fref[..]*/ |
1646 | struct avs2_frame_s *f_bg; |
1647 | #endif |
1648 | struct outdata_s outprint; |
1649 | uint32_t cm_header_start; |
1650 | struct ALFParam_s m_alfPictureParam[NUM_ALF_COMPONENT]; |
1651 | #ifdef FIX_CHROMA_FIELD_MV_BK_DIST |
1652 | int8_t bk_img_is_top_field; |
1653 | #endif |
1654 | #ifdef AML |
1655 | int32_t lcu_size; |
1656 | int32_t lcu_size_log2; |
1657 | int32_t lcu_x_num; |
1658 | int32_t lcu_y_num; |
1659 | int32_t lcu_total; |
1660 | int32_t ref_maxbuffer; |
1661 | int32_t to_prepare_disp_count; |
1662 | int8_t bufmgr_error_flag; |
1663 | #endif |
1664 | }; |
1665 | |
1666 | |
1667 | extern void write_frame(struct avs2_decoder *avs2_dec, int32_t pos); |
1668 | extern void init_frame_t(struct avs2_frame_s *currfref); |
1669 | extern void report_frame(struct avs2_decoder *avs2_dec, |
1670 | struct outdata_s *data, int32_t pos); |
1671 | |
1672 | extern int avs2_post_process(struct avs2_decoder *avs2_dec); |
1673 | extern void avs2_prepare_header(struct avs2_decoder *avs2_dec, |
1674 | int32_t start_code); |
1675 | extern int32_t avs2_process_header(struct avs2_decoder *avs2_dec); |
1676 | |
1677 | extern void init_avs2_decoder(struct avs2_decoder *avs2_dec); |
1678 | |
1679 | extern int32_t avs2_init_global_buffers(struct avs2_decoder *avs2_dec); |
1680 | |
1681 | extern bool is_avs2_print_param(void); |
1682 | extern bool is_avs2_print_bufmgr_detail(void); |
1683 | #endif |
1684 | |
1685 |