1 /*
2  * Copyright (c) 2011 Intel Corporation. All Rights Reserved.
3  * Copyright (c) Imagination Technologies Limited, UK
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sub license, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the
14  * next paragraph) shall be included in all copies or substantial portions
15  * of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
21  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  *
25  * Authors:
26  *    Elaine Wang <elaine.wang@intel.com>
27  *    Zeng Li <zeng.li@intel.com>
28  *    Edward Lin <edward.lin@intel.com>
29  *
30  */
31 
32 /*
33  * Description  DMA code for mtx Platform     : Generic
34  */
35 
36 #ifndef _TNG_HOSTHEADER_H_
37 #define _TNG_HOSTHEADER_H_
38 
39 
40 #include "img_types.h"
41 
42 #define MAX_MVC_VIEWS       2
43 #define MVC_BASE_VIEW_IDX   0
44 #define NON_MVC_VIEW        (~0x0)
45 
46 #define MVC_SPS_ID          1
47 #define MVC_PPS_ID          1
48 
49 /* Structure contains QP parameters, used with the DoHeader() routine */
50 typedef struct {
51     IMG_UINT32 H264_QP;
52     IMG_UINT32 H263_MPG4_FrameQ_scale;
53     IMG_UINT32 H263_MPG4_SliceQ_scale;
54 } MTX_QP_INFO;
55 
56 typedef struct {
57     IMG_UINT8       frameType;
58     IMG_BOOL8       weighted_pred_flag;     // Corresponds to field in the pps
59     IMG_UINT8               weighted_bipred_idc;
60     IMG_UINT32      luma_log2_weight_denom;
61     IMG_UINT32      chroma_log2_weight_denom;
62     IMG_BOOL8       weight_flag[3][2]; // Y,Cb, Cr Support for 2 ref pictures on P, or 1 pic in each direction on B.
63     IMG_INT32               weight[3][2];
64     IMG_INT32               offset[3][2];
65 } WEIGHTED_PREDICTION_VALUES;
66 
67 
68 /* #include "topaz_vlc_regs.h" */
69 
70 /* Allocating 32 words (128 bytes aligned to 8 bytes) */
71 #define MAX_HEADERSIZEWORDS (32)
72 
73 /*****************************************************************************
74  * @details    Enum describing partially coded header element types
75  * @brief          Header element type
76  ****************************************************************************/
77 typedef enum
78 {
79     ELEMENT_STARTCODE_RAWDATA=0,    //!< Raw data that includes a start code
80     ELEMENT_STARTCODE_MIDHDR,       //!< Start code in middle of header
81     ELEMENT_RAWDATA,                //!< Raw data
82     ELEMENT_QP,                     //!< Insert the H264 Picture Header QP parameter (no rawdata)
83     ELEMENT_SQP,	            //!< Insert the H264 Slice Header QP parameter (no rawdata)
84     ELEMENT_FRAMEQSCALE,            //!< Insert the H263/MPEG4 Frame Q_scale parameter (vob_quant field) (no rawdata)
85     ELEMENT_SLICEQSCALE,            //!< Insert the H263/MPEG4 Slice Q_scale parameter (quant_scale field) (no rawdata)
86     ELEMENT_INSERTBYTEALIGN_H264,   //!< Insert the byte align field for H264 (no rawdata)
87     ELEMENT_INSERTBYTEALIGN_MPG4,   //!< Insert the byte align field for MPEG4(no rawdata)
88     ELEMENT_INSERTBYTEALIGN_MPG2,   //!< Insert the byte align field for MPEG2(no rawdata)
89     ELEMENT_VBV_MPG2,
90     ELEMENT_TEMPORAL_REF_MPG2,
91     ELEMENT_CURRMBNR,               //!< Insert the current macrloblock number for a slice.
92 
93     ELEMENT_FRAME_NUM,              //!< Insert frame_num field (used as ID for ref. pictures in H264)
94     ELEMENT_TEMPORAL_REFERENCE,     //!< Insert Temporal Reference field (used as ID for ref. pictures in H263)
95     ELEMENT_EXTENDED_TR,            //!< Insert Extended Temporal Reference field
96     ELEMENT_IDR_PIC_ID,             //!< Insert idr_pic_id field (used to distinguish consecutive IDR frames)
97     ELEMENT_PIC_ORDER_CNT,                   //!< Insert pic_order_cnt_lsb field (used for display ordering in H264)
98     ELEMENT_GOB_FRAME_ID,                     //!< Insert gob_frame_id field (used for display ordering in H263)
99     ELEMENT_VOP_TIME_INCREMENT,         //!< Insert vop_time_increment field (used for display ordering in MPEG4)
100 
101     ELEMENT_MODULO_TIME_BASE,            //!< modulo_time_base used in MPEG4 (depends on vop_time_increment_resolution)
102 
103     ELEMENT_BOTTOM_FIELD,                     //!< Insert bottom_field flag
104     ELEMENT_SLICE_NUM,                            //!< Insert slice num (used for GOB headers in H263)
105     ELEMENT_MPEG2_SLICE_VERTICAL_POS,   //!< Insert slice vertical pos (MPEG2 slice header)
106     ELEMENT_MPEG2_IS_INTRA_SLICE,             //!< Insert 1 bit flag indicating if slice is Intra or not (MPEG2 slice header)
107     ELEMENT_MPEG2_PICTURE_STRUCTURE,  //!< Insert 2 bit field indicating if the current header is for a frame picture (11), top field (01) or bottom field (10) - (MPEG2 picture header)
108     ELEMENT_REFERENCE,                               //!< NAL header element. Specifies if this frame is used as reference
109     ELEMENT_ADAPTIVE,                                   //!< Adaptive reference marking mode: this element presented only in reference pictures
110     ELEMENT_DIRECT_SPATIAL_MV_FLAG,       //!< Spatial direct mode flag
111     ELEMENT_NUM_REF_IDX_ACTIVE,               //!< Override active number of references, if required
112     ELEMENT_REORDER_L0,                             //!< Reference list 0 reordering
113     ELEMENT_REORDER_L1,                             //!< Reference list 1 reordering
114     ELEMENT_TEMPORAL_ID,                            //!< Temporal ID of the picture, used for MVC header
115     ELEMENT_ANCHOR_PIC_FLAG,                   //!< True if this picture is an anchor picture
116 
117     BPH_SEI_NAL_INITIAL_CPB_REMOVAL_DELAY,
118     BPH_SEI_NAL_INITIAL_CPB_REMOVAL_DELAY_OFFSET,
119     PTH_SEI_NAL_CPB_REMOVAL_DELAY,
120     PTH_SEI_NAL_DPB_OUTPUT_DELAY,
121 
122     ELEMENT_SLICEWEIGHTEDPREDICTIONSTRUCT,
123     ELEMENT_CUSTOM_QUANT
124 } HEADER_ELEMENT_TYPE;
125 
126 typedef struct _MTX_HEADER_ELEMENT_ {
127     HEADER_ELEMENT_TYPE Element_Type;
128     IMG_UINT8 ui8Size;
129     IMG_UINT8 aui8Bits;
130 } MTX_HEADER_ELEMENT;
131 
132 
133 typedef struct _MTX_HEADER_PARAMS_ {
134     IMG_UINT32 ui32Elements;
135     MTX_HEADER_ELEMENT asElementStream[MAX_HEADERSIZEWORDS-1];
136 } MTX_HEADER_PARAMS;
137 
138 #define ELEMENTS_EMPTY 9999
139 
140 /* H264 Structures
141  */
142 
143 /* Define some constants for the variable elements in the header stream */
144 typedef enum _SHPROFILES {
145     SH_PROFILE_BP = 0,          //!< H.264 Baseline Profile
146     SH_PROFILE_MP = 1,          //!< H.264 Main Profile
147     SH_PROFILE_HP = 2,          //!< H.264 High Profile
148     SH_PROFILE_H444P = 3      //!< H.264 High 4:4:4 Profile
149 } SH_PROFILE_TYPE;
150 
151 /* Level number definitions (integer level numbers, non-intermediary only.. except level 1b) */
152 typedef enum _SHLEVELS {
153     SH_LEVEL_10 = 10,
154     SH_LEVEL_1B = 9,
155     SH_LEVEL_11 = 11,
156     SH_LEVEL_12 = 12,
157     SH_LEVEL_13 = 13,
158     SH_LEVEL_20 = 20,
159     SH_LEVEL_21 = 21,
160     SH_LEVEL_22 = 22,
161     SH_LEVEL_30 = 30,
162     SH_LEVEL_31 = 31,
163     SH_LEVEL_32 = 32,
164     SH_LEVEL_40 = 40,
165     SH_LEVEL_41 = 41,
166     SH_LEVEL_42 = 42,
167     SH_LEVEL_50 = 50,
168     SH_LEVEL_51 = 51
169 } SH_LEVEL_TYPE;
170 
171 
172 typedef enum _SLHP_SLICEFRAME_TYPE_ {
173     SLHP_P_SLICEFRAME_TYPE,
174     SLHP_B_SLICEFRAME_TYPE,
175     SLHP_I_SLICEFRAME_TYPE,
176     SLHP_SP_SLICEFRAME_TYPE,
177     SLHP_SI_SLICEFRAME_TYPE,
178     SLHP_IDR_SLICEFRAME_TYPE
179 
180 } SLHP_SLICEFRAME_TYPE;
181 
182 typedef enum _frame_template_type_ {
183     IMG_FRAME_IDR = 0,
184     IMG_FRAME_INTRA,
185     IMG_FRAME_INTER_P,
186     IMG_FRAME_INTER_B,
187     IMG_FRAME_INTER_P_IDR,
188     IMG_FRAME_UNDEFINED
189 } IMG_FRAME_TEMPLATE_TYPE;
190 
191 /* This holds the data that is needed at the start of a slice
192  */
193 typedef struct _SLICE_PARAMS_ {
194 
195     IMG_UINT32      ui32Flags;      //!< Flags for slice encode
196 
197     // the config registers, these are passed straigth through from drivers to hardware.
198     // change per slice
199     IMG_UINT32      ui32SliceConfig;        //!< Value to use for Slice Config register
200     IMG_UINT32      ui32IPEControl;         //!< Value to use for IPEControl register
201     IMG_UINT32      ui32SeqConfig;          //!< Value to use for Sequencer Config register
202 
203     IMG_FRAME_TEMPLATE_TYPE eTemplateType;  //!< Slice header template type
204     MTX_HEADER_PARAMS sSliceHdrTmpl;        //!< Template of corresponding slice header
205 } SLICE_PARAMS;
206 
207 /* Input parameters for the header generation
208  * Some of the following data structures may have fields that are actually static..
209  * may want to prune them down a bit later.
210  */
211 typedef struct _H264_VUI_PARAMS_STRUC {
212     IMG_UINT32 vui_flag;
213     IMG_UINT32 Time_Scale;
214     IMG_UINT32 num_units_in_tick;
215     IMG_UINT32 bit_rate_value_minus1; /* bitrate/64)-1 */
216     IMG_UINT32 cbp_size_value_minus1; /* (bitrate*1.5)/16 */
217     IMG_UINT8 CBR;
218     IMG_UINT8 initial_cpb_removal_delay_length_minus1;
219     IMG_UINT8 cpb_removal_delay_length_minus1;
220     IMG_UINT8 dpb_output_delay_length_minus1;
221     IMG_UINT8 time_offset_length;
222 } H264_VUI_PARAMS;
223 
224 typedef struct _H264_CROP_PARAMS_STRUCT_ {
225     IMG_BOOL bClip;
226     IMG_UINT16 ui16LeftCropOffset;
227     IMG_UINT16 ui16RightCropOffset;
228     IMG_UINT16 ui16TopCropOffset;
229     IMG_UINT16 ui16BottomCropOffset;
230 } H264_CROP_PARAMS;
231 
232 typedef struct {
233     IMG_UINT8       ui8ScalingLists4x4[6][16];
234     IMG_UINT8       ui8ScalingLists8x8[2][64];
235     IMG_UINT32      ui32ListMask;
236 } H264_SCALING_MATRIX_PARAMS;
237 
238 typedef struct _H264_SEQUENCE_HEADER_PARAMS_STRUC {
239     SH_PROFILE_TYPE ucProfile;
240     SH_LEVEL_TYPE ucLevel;
241     IMG_UINT8   ucWidth_in_mbs_minus1;
242     IMG_UINT8   ucHeight_in_maps_units_minus1;
243     IMG_UINT8   log2_max_pic_order_cnt;
244     IMG_UINT8   max_num_ref_frames;
245     IMG_UINT8   gaps_in_frame_num_value;
246     IMG_UINT8   ucFrame_mbs_only_flag;
247     IMG_UINT8   VUI_Params_Present;
248     IMG_UINT8   seq_scaling_matrix_present_flag;
249     IMG_BOOL    bUseDefaultScalingList;
250     IMG_BOOL    bIsLossless;
251     H264_VUI_PARAMS VUI_Params;
252 } H264_SEQUENCE_HEADER_PARAMS;
253 
254 typedef struct {
255     IMG_UINT8       pic_parameter_set_id;
256     IMG_UINT8       seq_parameter_set_id;
257     IMG_UINT8       entropy_coding_mode_flag;
258     IMG_UINT8       weighted_pred_flag;
259     IMG_UINT8       weighted_bipred_idc;
260     IMG_INT8        chroma_qp_index_offset;
261     IMG_UINT8       constrained_intra_pred_flag;
262     IMG_UINT8       transform_8x8_mode_flag;
263     IMG_BOOL        pic_scaling_matrix_present_flag;
264     IMG_BOOL        bUseDefaultScalingList;
265     IMG_INT8        second_chroma_qp_index_offset;
266 } H264_PICTURE_HEADER_PARAMS;
267 
268 
269 typedef struct _H264_SLICE_HEADER_PARAMS_STRUC {
270     IMG_UINT32           First_MB_Address;
271     IMG_INT32            luma_log2_weight_denom;
272     IMG_INT32            chroma_log2_weight_denom;
273     IMG_INT32            luma_weight_l0[2];
274     IMG_INT32            luma_offset_l0[2];
275     IMG_INT32            chromaB_weight_l0[2];
276     IMG_INT32            chromaB_offset_l0[2];
277     IMG_INT32            chromaR_weight_l0[2];
278     IMG_INT32            chromaR_offset_l0[2];
279     IMG_UINT8            uRefLongTermRefNum[2];
280     IMG_INT8             diff_ref_pic_num[2]; //when non-zero reorders reference pic list
281     IMG_UINT16           ui16MvcViewIdx;
282     IMG_UINT8            ui8Start_Code_Prefix_Size_Bytes;
283     IMG_UINT8            Frame_Num_DO;
284     IMG_UINT8            Idr_Pic_Id;
285     IMG_UINT8            log2_max_pic_order_cnt;
286     IMG_UINT8            Picture_Num_DO;
287     IMG_UINT8            Disable_Deblocking_Filter_Idc;
288     IMG_UINT8            num_ref_idx_l0_active_minus1;
289     IMG_UINT8            weighted_bipred_idc;
290     IMG_UINT8            uLongTermRefNum;
291     IMG_INT8             iDebAlphaOffsetDiv2;
292     IMG_INT8             iDebBetaOffsetDiv2;
293     SLHP_SLICEFRAME_TYPE SliceFrame_Type;
294     IMG_BOOL             bPiCInterlace;
295     IMG_BOOL             bFieldType;
296     IMG_BOOL             bReferencePicture;
297     IMG_BOOL             direct_spatial_mv_pred_flag;
298     IMG_BOOL             weighted_pred_flag;    // Corresponds to field in the pps
299     IMG_BOOL             chroma_weight_l0_flag[2];
300     IMG_BOOL             luma_weight_l0_flag[2]; // Support for 2 ref pictures on P, or 1 pic in each direction on B.
301     IMG_BOOL             bIsLongTermRef;
302     IMG_BOOL             bRefIsLongTermRef[2]; //Long term reference info for reference frames
303 } H264_SLICE_HEADER_PARAMS;
304 
305 /* MPEG4 Structures
306  */
307 typedef enum _MPEG4_PROFILE {
308     SP = 1,
309     ASP = 3
310 } MPEG4_PROFILE_TYPE;
311 
312 typedef enum _FIXED_VOP_TIME_ENUM {
313     _30FPS = 1,
314     _15FPS = 2,
315     _10FPS = 3
316 } FIXED_VOP_TIME_TYPE;
317 
318 typedef struct _VBVPARAMS_STRUC {
319     IMG_UINT32  First_half_bit_rate;
320     IMG_UINT32  Latter_half_bit_rate;
321     IMG_UINT32  First_half_vbv_buffer_size;
322     IMG_UINT32  Latter_half_vbv_buffer_size;
323     IMG_UINT32  First_half_vbv_occupancy;
324     IMG_UINT32  Latter_half_vbv_occupancy;
325 } VBVPARAMS;
326 
327 
328 /*
329  * H263 Structures
330  */
331 
332 typedef enum _VOP_CODING_ENUM {
333     I_FRAME = 0,
334     P_FRAME = 1
335 } VOP_CODING_TYPE, H263_PICTURE_CODING_TYPE;
336 
337 typedef enum _SEARCH_RANGE_ENUM {
338     PLUSMINUS_32 = 2,
339     PLUSMINUS_64 = 3,
340     FCODE_EQ_4 = 4
341 }  SEARCH_RANGE_TYPE;
342 
343 typedef enum _H263_SOURCE_FORMAT_ENUM {
344     _128x96_SubQCIF = 1,
345     _176x144_QCIF = 2,
346     _352x288_CIF = 3,
347     _704x576_4CIF = 4
348 } H263_SOURCE_FORMAT_TYPE;
349 
350 
351 #define SIZEINBITS(a) (sizeof(a)*8)
352 
353 /* H264 header preparation */
354 
355 void tng__H264ES_prepare_sequence_header(
356     void *pHeaderMemory,
357     H264_VUI_PARAMS *psVUI_Params,
358     H264_CROP_PARAMS *psCropParams,
359     IMG_UINT16 ui16PictureWidth,
360     IMG_UINT16 ui16PictureHeight,
361     IMG_UINT32 ui32CustomQuantMask,
362     IMG_UINT8 ui8ProfileIdc,
363     IMG_UINT8 ui8LevelIdc,
364     IMG_UINT8 ui8FieldCount,
365     IMG_UINT8 ui8MaxNumRefFrames,
366     IMG_BOOL  bPpsScaling,
367     IMG_BOOL  bUseDefaultScalingList,
368     IMG_BOOL  bEnableLossless,
369     IMG_BOOL  bASO
370 );
371 
372 void tng__H264ES_prepare_picture_header(
373     void *pHeaderMemory,
374     IMG_BOOL    bCabacEnabled,
375     IMG_BOOL    b_8x8transform,
376     IMG_BOOL    bIntraConstrained,
377     IMG_INT8    i8CQPOffset,
378     IMG_BOOL    bWeightedPrediction,
379     IMG_UINT8   ui8WeightedBiPred,
380     IMG_BOOL    bMvcPPS,
381     IMG_BOOL    bScalingMatrix,
382     IMG_BOOL    bScalingLists
383 );
384 
385 void tng__H264_prepare_slice_header(
386     IMG_UINT32 *pHeaderMemory,
387     IMG_BOOL        bIntraSlice,
388     IMG_BOOL        bInterBSlice,
389     IMG_BOOL        bMultiRef,
390     IMG_UINT8       ui8DisableDeblockingFilterIDC,
391     IMG_UINT32      ui32DisplayFrameNumber,
392     IMG_UINT32      ui32FrameNumId,
393     IMG_UINT32      uiFirst_MB_Address,
394     IMG_UINT32      uiMBSkipRun,
395     IMG_BOOL        bCabacEnabled,
396     IMG_BOOL        bIsInterlaced,
397     IMG_UINT8       ui8FieldNum,
398     WEIGHTED_PREDICTION_VALUES *pWeightedSetup,
399     IMG_BOOL        bIsLongTermRef);
400 
401 /* MPEG4 header preparation */
402 void tng__MPEG4_prepare_sequence_header(
403     void *pHeaderMemory,
404     IMG_BOOL bBFrame,
405     MPEG4_PROFILE_TYPE sProfile,
406     IMG_UINT8 Profile_and_level_indication,
407     FIXED_VOP_TIME_TYPE sFixed_vop_time_increment,
408     IMG_UINT32 Picture_Width_Pixels,
409     IMG_UINT32 Picture_Height_Pixels,
410     VBVPARAMS * psVBVParams,
411     IMG_UINT32 VopTimeResolution);
412 
413 void tng__MPEG4_prepare_vop_header(
414     IMG_UINT32 *pHeaderMem,
415     IMG_BOOL bIsVOP_coded,
416     IMG_UINT32 VOP_time_increment,
417     IMG_UINT8 sSearch_range,
418     IMG_UINT8 eVop_Coding_Type,
419     IMG_UINT32 VopTimeResolution);
420 
421 
422 /* H263 header preparation */
423 void tng__H263_prepare_sequence_header(
424     IMG_UINT32 *pHeaderMem,
425     IMG_UINT8 Profile_and_level_indication);
426 
427 void tng__H263_prepare_picture_header(
428     IMG_UINT32 *pHeaderMem,
429     IMG_UINT8 Temporal_Ref,
430     H263_PICTURE_CODING_TYPE PictureCodingType,
431     H263_SOURCE_FORMAT_TYPE SourceFormatType,
432     IMG_UINT8 FrameRate,
433     IMG_UINT16 PictureWidth,
434     IMG_UINT16 PictureHeigth);
435 
436 void tng__H263_notforsims_prepare_video_pictureheader(
437     MTX_HEADER_PARAMS* pMTX_Header,
438     H263_PICTURE_CODING_TYPE ePictureCodingType,
439     H263_SOURCE_FORMAT_TYPE eSourceFormatType,
440     IMG_UINT8 ui8FrameRate,
441     IMG_UINT32 ui32PictureWidth,
442     IMG_UINT32 ui32PictureHeigth);
443 
444 void tng__H263_prepare_GOBslice_header(
445     IMG_UINT32 *pHeaderMem,
446     IMG_UINT8 GOBNumber,
447     IMG_UINT8 GOBFrameId);
448 
449 void tng__H264ES_prepare_AUD_header(unsigned char *virtual_addr);
450 
451 void tng__H264ES_prepare_SEI_buffering_period_header(
452     unsigned char *virtual_addr,
453     IMG_UINT8 ui8NalHrdBpPresentFlag,
454     IMG_UINT8 ui8nal_cpb_cnt_minus1,
455     IMG_UINT8 ui8nal_initial_cpb_removal_delay_length,
456     IMG_UINT32 ui32nal_initial_cpb_removal_delay,
457     IMG_UINT32 ui32nal_initial_cpb_removal_delay_offset,
458     IMG_UINT8 ui8VclHrdBpPresentFlag,
459     IMG_UINT32 ui32vcl_initial_cpb_removal_delay,
460     IMG_UINT32 ui32vcl_initial_cpb_removal_delay_offset);
461 
462 void tng__H264ES_prepare_SEI_picture_timing_header(
463     unsigned char *virtual_addr,
464     IMG_UINT8 ui8CpbDpbDelaysPresentFlag,
465     IMG_UINT32 ui32cpb_removal_delay_length_minus1,
466     IMG_UINT32 ui32dpb_output_delay_length_minus1,
467     IMG_UINT32 ui32cpb_removal_delay,
468     IMG_UINT32 ui32dpb_output_delay,
469     IMG_UINT8 ui8pic_struct_present_flag,
470     IMG_UINT8 ui8pic_struct,
471     IMG_UINT8 ui8NumClockTS,
472     IMG_UINT8 *aui8clock_timestamp_flag,
473     IMG_UINT8 ui8full_timestamp_flag,
474     IMG_UINT8 ui8seconds_flag,
475     IMG_UINT8 ui8minutes_flag,
476     IMG_UINT8 ui8hours_flag,
477     IMG_UINT8 ui8seconds_value,
478     IMG_UINT8 ui8minutes_value,
479     IMG_UINT8 ui8hours_value,
480     IMG_UINT8 ui8ct_type,
481     IMG_UINT8 ui8nuit_field_based_flag,
482     IMG_UINT8 ui8counting_type,
483     IMG_UINT8 ui8discontinuity_flag,
484     IMG_UINT8 ui8cnt_dropped_flag,
485     IMG_UINT8 ui8n_frames,
486     IMG_UINT8 ui8time_offset_length,
487     IMG_INT32 i32time_offset);
488 
489 void tng__H264ES_notforsims_prepare_sliceheader(
490     IMG_UINT8       *slice_mem_p,
491     IMG_UINT32      ui32SliceType,
492     IMG_UINT8       ui8DisableDeblockingFilterIDC,
493     IMG_UINT32      uiFirst_MB_Address,
494     IMG_UINT32      uiMBSkipRun,
495     IMG_BOOL        bCabacEnabled,
496     IMG_BOOL        bIsInterlaced,
497     IMG_UINT16      ui16MvcViewIdx,
498     IMG_BOOL        bIsLongTermRef);
499 
500 void tng__H264ES_prepare_mvc_sequence_header(
501     void *pHeaderMemory,
502     H264_CROP_PARAMS *psCropParams,
503     IMG_UINT16 ui16PictureWidth,
504     IMG_UINT16 ui16PictureHeight,
505     IMG_UINT32 ui32CustomQuantMask,
506     IMG_UINT8 ui8ProfileIdc,
507     IMG_UINT8 ui8LevelIdc,
508     IMG_UINT8 ui8FieldCount,
509     IMG_UINT8 ui8MaxNumRefFrames,
510     IMG_BOOL  bPpsScaling,
511     IMG_BOOL  bUseDefaultScalingList,
512     IMG_BOOL  bEnableLossless,
513     IMG_BOOL  bASO);
514 
515 void tng__H263ES_notforsims_prepare_gobsliceheader(IMG_UINT8 *slice_mem_p);
516 void tng__MPEG2_prepare_sliceheader(IMG_UINT8 *slice_mem_p);
517 void tng__MPEG4_notforsims_prepare_vop_header(
518     MTX_HEADER_PARAMS* pMTX_Header,
519     IMG_BOOL bIsVOP_coded,
520     SEARCH_RANGE_TYPE eSearch_range,
521     VOP_CODING_TYPE eVop_Coding_Type);
522 
523 #endif /* _TNG_HOSTHEADER_H_ */
524 
525 
526