Lines Matching defs:aui32ElementPointers

88     MTX_HEADER_ELEMENT __maybe_unused ** aui32ElementPointers)
99 drv_debug_msg(VIDEO_DEBUG_GENERAL, "Encoding Element [%i] - Type:%i\n", f, aui32ElementPointers[f]->Element_Type);
101 if (aui32ElementPointers[f]->Element_Type == ELEMENT_STARTCODE_RAWDATA ||
102 aui32ElementPointers[f]->Element_Type == ELEMENT_RAWDATA) {
103 TotalByteSize = aui32ElementPointers[f]->ui8Size;
105 drv_debug_msg(VIDEO_DEBUG_GENERAL, "Writing %i RAW bits to element.\n", aui32ElementPointers[f]->ui8Size);
106 Show_Bits((IMG_UINT8 *)(&aui32ElementPointers[f]->ui8Size) + 1, 0, TotalByteSize);
114 switch (aui32ElementPointers[f]->Element_Type) {
156 /* TotalByteSize=TotalByteSize+32+(&aui32ElementPointers[f-1]->Element_Type-&aui32ElementPointers[0]->Element_Type)*8; */
186 MTX_HEADER_ELEMENT **aui32ElementPointers,
212 pui8SizeBits=&(aui32ElementPointers[pMTX_Header->ui32Elements]->ui8Size); //Pointer to the bit count field
213 pui8WriteBytes=&(aui32ElementPointers[pMTX_Header->ui32Elements]->aui8Bits); //Pointer to the space where header bits are to be written
219 aui32ElementPointers[pMTX_Header->ui32Elements]=(MTX_HEADER_ELEMENT *) &pui8WriteBytes[15]; //Element pointer set to position of next element (120/8 = 15 bytes)
220 aui32ElementPointers[pMTX_Header->ui32Elements]->Element_Type=ELEMENT_RAWDATA; //Write ELEMENT_TYPE
221 aui32ElementPointers[pMTX_Header->ui32Elements]->ui8Size=0; // Set new element size (bits) to zero
222 tng__write_upto8bits_elements(pMTX_Header,aui32ElementPointers, ui8WriteBits, ui16BitCnt); // Begin writing to the new element
240 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, InputVal.UI8Input[0],(IMG_UINT16) -i16Shift);
247 MTX_HEADER_ELEMENT **aui32ElementPointers,
262 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, ui8Bytes[ui32EndByte-1], (IMG_UINT8) ((ui32BitCnt)%8));
264 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, ui8Bytes[ui32EndByte-1], 8);
267 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, ui8Bytes[ui32BitLp-1], 8);
274 MTX_HEADER_ELEMENT **aui32ElementPointers,
287 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8);
289 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (IMG_UINT8) 1, (IMG_UINT8) (uiLp+1));
294 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (IMG_UINT8) uiChunk, 8);
297 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (IMG_UINT8) uiVal, ucZeros);
304 MTX_HEADER_ELEMENT **aui32ElementPointers,
313 tng__generate_ue(pMTX_Header, aui32ElementPointers, uiCodeNum);
320 MTX_HEADER_ELEMENT **aui32ElementPointers,
335 if (aui32ElementPointers[pMTX_Header->ui32Elements]->Element_Type==ELEMENT_STARTCODE_RAWDATA ||
336 aui32ElementPointers[pMTX_Header->ui32Elements]->Element_Type==ELEMENT_RAWDATA ||
337 aui32ElementPointers[pMTX_Header->ui32Elements]->Element_Type==ELEMENT_STARTCODE_MIDHDR) {
340 ui8Offset=aui32ElementPointers[pMTX_Header->ui32Elements]->ui8Size+8+31; // NumberofRawbits (excluding size of bit count field)+ size of the bitcount field
348 ui8P=(IMG_UINT8 *) aui32ElementPointers[pMTX_Header->ui32Elements-1];
350 aui32ElementPointers[pMTX_Header->ui32Elements]=(MTX_HEADER_ELEMENT *) ui8P;
355 aui32ElementPointers[pMTX_Header->ui32Elements]->Element_Type=ui32Token;
356 aui32ElementPointers[pMTX_Header->ui32Elements]->ui8Size=0;
364 MTX_HEADER_ELEMENT **aui32ElementPointers,
373 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8);
374 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 8);
381 static void CheckStartRawDataElement(MTX_HEADER_PARAMS *pMTX_Header, MTX_HEADER_ELEMENT **aui32ElementPointers)
385 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
391 static void tng__insert_prefix_nal_header(MTX_HEADER_PARAMS *pMTX_Header, MTX_HEADER_ELEMENT **aui32ElementPointers,
394 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
396 tng__H264_writebits_startcode_prefix_element(pMTX_Header, aui32ElementPointers, pSlHParams->ui8Start_Code_Prefix_Size_Bytes); //Can be 3 or 4 bytes - always 4 bytes in our implementations
397 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
399 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // forbidden_zero_bit
401 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_REFERENCE); //MTX fills this value in
402 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
404 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 14, 5); // nal unit type
406 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // SVC extension flag
411 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // non_idr_flag flag
413 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // non_idr_flag flag
416 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 6); // priority_id flag
417 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, 0, 10); // view_id flag
419 //tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 3); // temporal_id flag
420 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_TEMPORAL_ID); // temporal_id flag
422 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_ANCHOR_PIC_FLAG); // anchor_pic_flag
424 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
427 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // interview flag
429 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // interview flag
432 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // reserved one bit
439 MTX_HEADER_ELEMENT **aui32ElementPointers,
443 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
451 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, VUIParams->num_units_in_tick, 32);
454 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, VUIParams->Time_Scale, 32);
455 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // fixed_frame_rate_flag (1 bit) = 1 in Topaz
456 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // nal_hrd_parameters_present_flag (1 bit) = 1 in Topaz
458 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // cpb_cnt_minus1 ue(v) = 0 in Topaz = 1b
459 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 4); // bit_rate_scale (4 bits) = 0 in Topaz
460 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 2, 4); // cpb_size_scale (4 bits) = 2 in Topaz
462 tng__generate_ue(pMTX_Header, aui32ElementPointers, VUIParams->bit_rate_value_minus1); // bit_rate_value_minus1[0] ue(v) = (Bitrate/64)-1 [RANGE:0 to (2^32)-2]
463 tng__generate_ue(pMTX_Header, aui32ElementPointers, VUIParams->cbp_size_value_minus1); // cpb_size_value_minus1[0] ue(v) = (CPB_Bits_Size/16)-1 where CPB_Bits_Size = 1.5 * Bitrate [RANGE:0 to (2^32)-2]
464 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, VUIParams->CBR,1);// cbr_flag[0] (1 bit) = 0 for VBR, 1 for CBR
465 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, VUIParams->initial_cpb_removal_delay_length_minus1, 5); // initial_cpb_removal_delay_length_minus1 (5 bits) = ???
466 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, VUIParams->cpb_removal_delay_length_minus1, 5); // cpb_removal_delay_length_minus1 (5 bits) = ???
467 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, VUIParams->dpb_output_delay_length_minus1, 5); // dpb_output_delay_length_minus1 (5 bits) = ???
468 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, VUIParams->time_offset_length, 5); // time_offst_length (5 bits) = ???
470 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // vcl_hrd_parameters_present_flag (1 bit) = 0 in Topaz
474 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // low_delay_hrd_flag
476 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // pic_struct_present_flag (1 bit) = 0 in Topaz
477 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // bitstream_restriction_flag (1 bit) = 0 in Topaz
483 MTX_HEADER_ELEMENT **aui32ElementPointers,
501 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
502 tng__H264_writebits_startcode_prefix_element(pMTX_Header, aui32ElementPointers, 4);
510 aui32ElementPointers,
516 tng__generate_ue(pMTX_Header, aui32ElementPointers, pPHParams->pic_parameter_set_id); // pic_parameter_set_id ue(v)
517 tng__generate_ue(pMTX_Header, aui32ElementPointers, pPHParams->seq_parameter_set_id); // seq_parameter_set_id ue(v)
519 aui32ElementPointers,
528 aui32ElementPointers,
534 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_QP);
535 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
542 tng__generate_se(pMTX_Header, aui32ElementPointers, 0);
545 tng__generate_se(pMTX_Header, aui32ElementPointers, pPHParams->chroma_qp_index_offset);
550 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (1 << 2) |
559 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, pPHParams->transform_8x8_mode_flag, 1);
560 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
562 tng__generate_se(pMTX_Header, aui32ElementPointers, pPHParams->second_chroma_qp_index_offset);
565 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_INSERTBYTEALIGN_H264); // Tell MTX to insert the byte align field (we don't know final stream size for alignment at this point)
573 MTX_HEADER_ELEMENT **aui32ElementPointers,
583 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_CUSTOM_QUANT);
591 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // seq_scaling_list_present_flag[ui32List] = 1
598 tng__generate_se(pMTX_Header, aui32ElementPointers, i32DeltaScale); // delta_scale
603 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // seq_scaling_list_present_flag[ui32List] = 0
613 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // seq_scaling_list_present_flag[ui32List] = 1
620 tng__generate_se(pMTX_Header, aui32ElementPointers, i32DeltaScale); // delta_scale
625 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // seq_scaling_list_present_flag[ui32List] = 0
633 MTX_HEADER_ELEMENT **aui32ElementPointers,
639 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
640 tng__H264_writebits_startcode_prefix_element(pMTX_Header, aui32ElementPointers, 4);
647 aui32ElementPointers,(0 << 7) | // forbidden_zero_bit=0
655 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 66, 8);
658 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
668 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 77, 8);
671 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
681 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 100, 8);
683 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
693 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 244, 8);
696 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
709 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (pSHParams->ucLevel == SH_LEVEL_1B) ? 11 : (IMG_UINT8)pSHParams->ucLevel, 8);
710 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // seq_parameter_set_id = 0
713 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // chroma_format_idc = 1
714 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // bit_depth_luma_minus8 = 0
715 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // bit_depth_chroma_minus8 = 0
717 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, pSHParams->bIsLossless?1:0, 1);
719 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // seq_scaling_matrix_present_flag
721 tng__H264ES_writebits_scalinglists(pMTX_Header, aui32ElementPointers, psScalingMatrix, IMG_TRUE);
722 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
725 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8);
728 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // seq_scaling_matrix_present_flag
732 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // log2_max_frame_num_minus4 = 1
733 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // pic_order_cnt_type = 0
735 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSHParams->log2_max_pic_order_cnt - 4);
736 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSHParams->max_num_ref_frames); //num_ref_frames ue(2), typically 2
738 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
744 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSHParams->ucWidth_in_mbs_minus1);
746 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSHParams->ucHeight_in_maps_units_minus1);
749 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,pSHParams->ucFrame_mbs_only_flag,1);
751 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,0,1); // mb_adaptive_frame_field_flag = 0 in Topaz(field encoding at the sequence level)
753 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,1,1); // direct_8x8_inference_flag=1 in Topaz
755 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,1,1);
756 tng__generate_ue(pMTX_Header, aui32ElementPointers, psCrop->ui16LeftCropOffset);
757 tng__generate_ue(pMTX_Header, aui32ElementPointers, psCrop->ui16RightCropOffset);
758 tng__generate_ue(pMTX_Header, aui32ElementPointers, psCrop->ui16TopCropOffset);
759 tng__generate_ue(pMTX_Header, aui32ElementPointers, psCrop->ui16BottomCropOffset);
761 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,0,1);
766 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
771 tng__H264_writebits_VUI_params(pMTX_Header, aui32ElementPointers, &(pSHParams->VUI_Params));
775 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_INSERTBYTEALIGN_H264);
785 MTX_HEADER_ELEMENT **aui32ElementPointers,
790 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
792 tng__H264_writebits_startcode_prefix_element(pMTX_Header, aui32ElementPointers, pSlHParams->ui8Start_Code_Prefix_Size_Bytes);
802 aui32ElementPointers, (0 << 7) | // forbidden_zero_bit
808 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_CURRMBNR);
809 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
813 //tng__generate_ue(pMTX_Header, aui32ElementPointers, (IMG_UINT32) pSlHParams->First_MB_Address); //first_mb_in_slice = First MB address in slice: ue(Range 0 - 1619)
814 tng__generate_ue(pMTX_Header, aui32ElementPointers, (IMG_UINT32)((pSlHParams->SliceFrame_Type == SLHP_IDR_SLICEFRAME_TYPE) ? SLHP_I_SLICEFRAME_TYPE : pSlHParams->SliceFrame_Type)); //slice_type ue(v): 0 for P-slice, 1 for B-slice, 2 for I-slice
816 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
823 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // field_pic_flag = 1
824 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, pSlHParams->bFieldType, 1); // bottom_field_flag (0=top field, 1=bottom field)
828 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->Idr_Pic_Id); // idr_pic_id ue(v)
831 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (pSlHParams->Picture_Num_DO + pSlHParams->bFieldType), pSlHParams->log2_max_pic_order_cnt); // pic_order_cnt_lsb (6 bits) - picture no in display order
833 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, pSlHParams->Picture_Num_DO, pSlHParams->log2_max_pic_order_cnt); // pic_order_cnt_lsb (6 bits) - picture no in display order
837 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, pSlHParams->direct_spatial_mv_pred_flag, 1);// direct_spatial_mv_pred_flag (1 bit)
841 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
842 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->num_ref_idx_l0_active_minus1);
845 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
851 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); //ref_pic_list_modification_flag_l0
854 tng__generate_ue(pMTX_Header, aui32ElementPointers, 2); // mod_of_pic_num = 2 (long term ref)
855 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->uRefLongTermRefNum[0]); // long_term_pic_num
858 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // mod_of_pic_num = 1 (add to)
859 tng__generate_ue(pMTX_Header, aui32ElementPointers, 31); // abs_diff_minus_1
861 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // mod_of_pic_num = 0 (subtract from)
862 tng__generate_ue(pMTX_Header, aui32ElementPointers, -pSlHParams->diff_ref_pic_num[0] - 1); // abs_diff_minus_1
864 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // mod_of_pic_num = 1 (add too)
865 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->diff_ref_pic_num[0] - 1); // abs_diff_minus_1
870 tng__generate_ue(pMTX_Header, aui32ElementPointers, 2); // mod_of_pic_num = 2 (long term ref)
871 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->uRefLongTermRefNum[1]); // long_term_pic_num
873 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // mod_of_pic_num = 0 (subtract from)
874 tng__generate_ue(pMTX_Header, aui32ElementPointers, -pSlHParams->diff_ref_pic_num[1] - 1); // abs_diff_minus_1
876 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // mod_of_pic_num = 1 (add too)
877 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->diff_ref_pic_num[1] - 1); // abs_diff_minus_1
881 tng__generate_ue(pMTX_Header, aui32ElementPointers, 3); // mod_of_pic_num = 3 (no more changes)
883 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // ref_pic_list_ordering_flag_I0 (1 bit) = 0, no reference picture ordering in Topaz
888 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); //ref_pic_list_modification_flag_l1
891 tng__generate_ue(pMTX_Header, aui32ElementPointers, 2); // mod_of_pic_num = 2 (long term ref)
892 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->uRefLongTermRefNum[1]); // long_term_pic_num
894 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // mod_of_pic_num = 0 (subtract from)
895 tng__generate_ue(pMTX_Header, aui32ElementPointers, -pSlHParams->diff_ref_pic_num[1] - 1); // abs_diff_minus_1
897 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // mod_of_pic_num = 1 (add too)
898 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->diff_ref_pic_num[1] - 1); // abs_diff_minus_1
901 tng__generate_ue(pMTX_Header, aui32ElementPointers, 3); // mod_of_pic_num = 3 (no more changes)
903 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // ref_pic_list_ordering_flag_I1 (1 bit) = 0, no reference picture ordering in Topaz
909 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->luma_log2_weight_denom);
910 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->chroma_log2_weight_denom); // Always do chroma
912 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, pSlHParams->luma_weight_l0_flag[i], 1);
914 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->luma_weight_l0[i]);
915 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->luma_offset_l0[i]);
917 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, pSlHParams->chroma_weight_l0_flag[i], 1);
919 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->chromaB_weight_l0[i]);
920 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->chromaB_offset_l0[i]);
921 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->chromaR_weight_l0[i]);
922 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->chromaR_offset_l0[i]);
928 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // no_output_of_prior_pics_flag (1 bit) = 0
929 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, pSlHParams->bIsLongTermRef ? 1 : 0, 1); // long_term_reference_flag (1 bit) = 0
932 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // adaptive_ref_pic_marking_mode_flag (1 bit) = 0
935 tng__generate_ue(pMTX_Header, aui32ElementPointers, 4); // memory_management_control_operation
936 tng__generate_ue(pMTX_Header, aui32ElementPointers, 2); // max_long_term_frame_idx_plus1
939 tng__generate_ue(pMTX_Header, aui32ElementPointers, 6); // memory_management_control_operation
940 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->uLongTermRefNum); // long_term_frame_idx
943 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // memory_management_control_operation
945 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // adaptive_ref_pic_marking_mode_flag (1 bit) = 0
950 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // hard code cabac_init_idc value of 0
952 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_SQP); //MTX fills this value in
953 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
959 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->Disable_Deblocking_Filter_Idc); //disable_deblocking_filter_idc ue(v) = 2?
961 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->iDebAlphaOffsetDiv2); //slice_alpha_c0_offset_div2 se(v) = 0 (1b) in Topaz
962 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->iDebBetaOffsetDiv2); //slice_beta_offset_div2 se(v) = 0 (1b) in Topaz
981 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
984 aui32ElementPointers[0] = This_Element;
988 tng__H264ES_writebits_slice_header(mtx_hdr, aui32ElementPointers, pSlHParams, bCabacEnabled);
989 tng__generate_ue(mtx_hdr, aui32ElementPointers, MB_No_In_Slice); /* mb_skip_run = mb_no_in_slice */
992 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_INSERTBYTEALIGN_H264);
1007 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
1010 aui32ElementPointers[0] = This_Element;
1012 tng__H264ES_writebits_sequence_header(mtx_hdr, aui32ElementPointers, pSHParams, psCropParams, NULL);
1023 //MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
1026 //aui32ElementPointers[0]=This_Element;
1028 //tng__H264ES_writebits_picture_header(mtx_hdr, aui32ElementPointers);
1043 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
1046 aui32ElementPointers[0] = This_Element;
1050 tng__H264ES_writebits_slice_header(pMTX_Header, aui32ElementPointers, pSlHParams, bCabacEnabled);
1055 void H263_NOTFORSIMS_WriteBits_VideoPictureHeader(MTX_HEADER_PARAMS *pMTX_Header, MTX_HEADER_ELEMENT **aui32ElementPointers,
1067 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1070 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, 32, 22);
1073 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_TEMPORAL_REFERENCE);
1074 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
1077 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1080 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1083 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1086 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1089 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1092 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, SourceFormatType, 3);
1097 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, PictureCodingType, 1);
1099 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 4);
1117 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, UFEP, 3);
1123 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 6, 3);
1124 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1138 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, 0, 10); // 10 reserve bits
1146 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 8, 4); // 4 reserve bits
1152 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, PictureCodingType, 3 );
1158 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0 , 2);
1161 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, RTYPE, 1);
1167 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 2);
1170 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1 , 1);
1174 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0 ,1);
1183 //tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0x01, 4);
1184 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 2, 4);
1188 //tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (IMG_UINT8)(ui16PictureWidth >> 8), 1);
1189 //tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (IMG_UINT8)(ui16PictureWidth & 0xFF), 8);
1191 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers,ui16PWI, 9);
1194 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1197 //tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (IMG_UINT8)(ui16PictureHeigth >> 8), 1);
1198 //tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (IMG_UINT8)(ui16PictureHeigth & 0xFF), 8);
1200 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers,ui16PHI, 9);
1206 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_FRAMEQSCALE);
1208 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
1214 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0 ,1);
1217 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1222 void MPEG4_NOTFORSIMS_WriteBits_VOPHeader(MTX_HEADER_PARAMS *pMTX_Header, MTX_HEADER_ELEMENT **aui32ElementPointers,
1228 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1230 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, 438, 32);
1232 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, sVopCodingType, 2);
1235 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_MODULO_TIME_BASE);
1236 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
1239 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1242 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_VOP_TIME_INCREMENT);
1243 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
1246 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1251 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1253 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_INSERTBYTEALIGN_MPG4); // Tell MTX to insert the byte align field (we don't know final stream size for alignment at this point)
1257 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1261 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1264 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 3);
1266 //tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, Frame_Q_scale, 5);
1267 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_FRAMEQSCALE);
1271 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
1272 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, sSearch_range, 3);
1291 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
1294 aui32ElementPointers[0]=This_Element;
1298 aui32ElementPointers,
1322 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
1325 aui32ElementPointers[0]=This_Element;
1330 aui32ElementPointers,
1338 void H263_NOTFORSIMS_WriteBits_GOBSliceHeader(MTX_HEADER_PARAMS *pMTX_Header, MTX_HEADER_ELEMENT **aui32ElementPointers)
1341 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1343 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, 1, 17);
1346 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_SLICE_NUM); // Insert token to tell MTX to insert gob_number
1349 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_GOB_FRAME_ID); // Insert token to tell MTX to insert gob_frame_id
1351 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
1354 // tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, ui8GOB_Q_Scale, 5);
1355 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_SLICEQSCALE); // Insert token to tell MTX to insert rate-control value (QScale is sent as an argument
1380 MTX_HEADER_ELEMENT **aui32ElementPointers,
1390 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1392 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, 432, 32);
1394 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, ui8Profile_and_level_indication, 8);
1396 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1398 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8);
1399 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8);
1400 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 8);
1401 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 181, 8);
1403 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1405 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 4);
1407 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1409 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 2);
1411 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1413 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8);
1414 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8);
1415 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 8);
1416 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8);
1418 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1420 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8);
1421 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8);
1422 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 8);
1423 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 32, 8);
1425 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1429 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 8);
1432 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1436 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1438 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 4);
1440 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 3); // 0 is reserved...
1446 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 3, 8);
1448 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1450 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 5, 4);
1452 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 3);
1455 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 4);
1458 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1461 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 2);
1464 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1466 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1470 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1472 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, sVBVParams->First_half_bit_rate, 15); // first_half_bit_rate
1473 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1474 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, sVBVParams->Latter_half_bit_rate, 15); // latter_half_bit_rate
1475 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1476 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, sVBVParams->First_half_vbv_buffer_size, 15); // first_half_vbv_buffer_size
1477 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1478 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, sVBVParams->Latter_half_vbv_buffer_size, 3); // latter_half_vbv_buffer_size
1479 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, sVBVParams->First_half_vbv_occupancy, 11); // first_half_vbv_occupancy
1480 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1481 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, sVBVParams->Latter_half_vbv_occupancy, 15); // latter_half_vbv_occupancy
1482 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1485 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // No vbv parameters present
1487 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1490 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 2);
1491 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1493 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, ui32VopTimeResolution, 16);
1494 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1497 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1499 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, Bits2Code(ui32VopTimeResolution));
1500 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1503 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1504 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1507 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, Picture_Width_Pixels, 13);
1508 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1510 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, Picture_Height_Pixels, 13);
1511 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // Marker Bit = 1
1513 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1515 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1517 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1519 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1521 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1525 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1529 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1532 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1534 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
1537 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1541 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1543 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1546 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
1548 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_INSERTBYTEALIGN_MPG4); // Tell MTX to insert the byte align field (we don't know final stream size for alignment at this point)
1572 MTX_HEADER_ELEMENT **aui32ElementPointers,
1581 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1584 tng__write_upto32bits_elements(mtx_hdr, aui32ElementPointers, 438, 32);
1587 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, sVopCodingType, 2);
1592 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1595 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, bIsSyncPoint ? 2 : 0 , bIsSyncPoint ? 2 : 1);
1600 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 1, 1);
1606 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, VOP_time_increment, 5);
1610 mtx_hdr, aui32ElementPointers,
1616 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 1, 1);
1620 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1626 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_INSERTBYTEALIGN_MPG4);
1629 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 1, 1);
1633 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1637 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 3);
1640 /* tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, Frame_Q_scale, 5); */
1641 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_FRAMEQSCALE);
1645 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_RAWDATA);
1646 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, sSearch_range, 3);
1651 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_RAWDATA);
1668 MTX_HEADER_ELEMENT **aui32ElementPointers,
1672 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1675 tng__write_upto32bits_elements(mtx_hdr, aui32ElementPointers, 432, 32);
1678 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, Profile_and_level_indication, 8);
1683 tng__write_upto32bits_elements(mtx_hdr, aui32ElementPointers, 437, 32);
1686 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1689 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 1, 4);
1692 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1695 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 1, 2);
1698 tng__write_upto32bits_elements(mtx_hdr, aui32ElementPointers, 256, 32);
1705 MTX_HEADER_ELEMENT **aui32ElementPointers,
1717 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1720 tng__write_upto32bits_elements(mtx_hdr, aui32ElementPointers, 32, 22);
1723 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, Temporal_Ref, 8);
1726 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 1, 1);
1729 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1732 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1735 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1738 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1741 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, SourceFormatType, 3);
1745 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, PictureCodingType, 1);
1747 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 4);
1757 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, UFEP, 3);
1759 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 6, 3);
1760 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1774 tng__write_upto32bits_elements(mtx_hdr, aui32ElementPointers, 0, 10);
1776 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 8, 4);
1780 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, PictureCodingType, 3);
1782 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 2);
1785 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, RTYPE, 1);
1787 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 2);
1789 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 1 , 1);
1791 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0 , 1);
1796 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 1, 4);
1799 //tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, (IMG_UINT8)(PictureWidth >> 8), 1);
1800 //tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, (IMG_UINT8)(PictureWidth & 0xFF), 8);
1803 tng__write_upto32bits_elements(mtx_hdr, aui32ElementPointers, (IMG_UINT8)ui16PWI, 9);
1805 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 1, 1);
1807 //tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, (IMG_UINT8)(PictureHeight >> 8), 1);
1808 //tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, (IMG_UINT8)(PictureHeight & 0xFF), 8);
1811 tng__write_upto32bits_elements(mtx_hdr, aui32ElementPointers, (IMG_UINT8)ui16PHI, 9);
1813 // tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 1, 1);
1819 //tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, ui8Q_Scale, 5);
1820 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_FRAMEQSCALE); // Insert token to tell MTX to insert rate-control value (QScale
1822 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_RAWDATA);
1826 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1829 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, 0, 1);
1841 MTX_HEADER_ELEMENT **aui32ElementPointers,
1846 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1849 tng__write_upto32bits_elements(mtx_hdr, aui32ElementPointers, 1, 17);
1852 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, GOBNumber, 5);
1855 tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, GOBFrameId, 2);
1858 /* tng__write_upto8bits_elements(mtx_hdr, aui32ElementPointers, GOB_Q_Scale, 5); */
1863 tng__insert_element_token(mtx_hdr, aui32ElementPointers, ELEMENT_SLICEQSCALE);
1878 //MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
1881 //aui32ElementPointers[0]=This_Element;
1883 //H263_writebits_VideoSequenceHeader(mtx_hdr, aui32ElementPointers, Profile_and_level_indication);
1899 //MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
1902 //aui32ElementPointers[0]=This_Element;
1905 //mtx_hdr, aui32ElementPointers,
1923 //MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
1926 //aui32ElementPointers[0]=This_Element;
1928 //H263_writebits_GOBSliceHeader(mtx_hdr, aui32ElementPointers, GOBNumber, GOBFrameId);
1936 MTX_HEADER_ELEMENT **aui32ElementPointers)
1940 aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1943 aui32ElementPointers, 4); // 00 00 00 01 start code prefix
1946 aui32ElementPointers, 9, 8); // AUD nal_unit_type = 09
1950 aui32ElementPointers, 2, 3);
1953 aui32ElementPointers, 1 << 4, 5); // rbsp_trailing_bits
1957 aui32ElementPointers, 0x80, 8);
1965 MTX_HEADER_ELEMENT **aui32ElementPointers,
1984 aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
1987 aui32ElementPointers, 3); // 00 00 01 start code prefix
1990 aui32ElementPointers, 6, 8); // nal_unit_type = 06 (SEI Message)
1993 aui32ElementPointers, 0, 8); // SEI payload type (buffering period)
2004 aui32ElementPointers,
2012 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0);
2021 // tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_NAL_INIT_CPB_REMOVAL_DELAY); // Eventually use this if firmware value required
2023 //tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, ui32nal_initial_cpb_removal_delay, ui8nal_initial_cpb_removal_delay_length);
2025 aui32ElementPointers,
2034 aui32ElementPointers,
2041 aui32ElementPointers,
2043 // tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_VCL_INIT_CPB_REMOVAL_DELAY); // Eventually use this if firmware value required
2045 aui32ElementPointers,
2048 // tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_VCL_INIT_CPB_REMOVAL_DELAY_CPB); // Eventually use this if firmware value required
2050 aui32ElementPointers,
2060 aui32ElementPointers,
2066 aui32ElementPointers,
2071 aui32ElementPointers,
2075 aui32ElementPointers,
2080 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0x80, 8);
2088 MTX_HEADER_PARAMS *pMTX_Header, MTX_HEADER_ELEMENT **aui32ElementPointers,
2121 aui32ElementPointers,
2125 aui32ElementPointers,
2129 aui32ElementPointers,
2133 aui32ElementPointers,
2171 aui32ElementPointers,
2180 aui32ElementPointers,
2184 aui32ElementPointers,
2189 aui32ElementPointers,
2192 aui32ElementPointers,
2199 aui32ElementPointers,
2202 aui32ElementPointers,
2207 aui32ElementPointers,
2212 aui32ElementPointers,
2216 aui32ElementPointers,
2219 aui32ElementPointers,
2223 aui32ElementPointers,
2226 aui32ElementPointers,
2229 aui32ElementPointers,
2232 aui32ElementPointers,
2237 aui32ElementPointers,
2240 aui32ElementPointers,
2243 aui32ElementPointers,
2247 aui32ElementPointers,
2252 aui32ElementPointers,
2255 aui32ElementPointers,
2260 aui32ElementPointers,
2263 aui32ElementPointers,
2268 aui32ElementPointers,
2278 aui32ElementPointers,
2283 aui32ElementPointers,
2295 aui32ElementPointers,
2301 aui32ElementPointers,
2306 aui32ElementPointers,
2309 aui32ElementPointers,
2315 aui32ElementPointers,
2327 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
2330 aui32ElementPointers[0] = This_Element;
2332 tng__H264ES_writebits_AUD_header(pMTX_Header, aui32ElementPointers);
2352 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
2355 aui32ElementPointers[0] = This_Element;
2358 pMTX_Header, aui32ElementPointers,
2404 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
2407 aui32ElementPointers[0] = This_Element;
2410 pMTX_Header, aui32ElementPointers,
2523 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
2526 aui32ElementPointers[0] = This_Element;
2553 tng__H264ES_writebits_sequence_header(mtx_hdr, aui32ElementPointers, &SHParams, psCropParams, NULL, bASO);
2559 MTX_HEADER_ELEMENT **aui32ElementPointers,
2564 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
2565 tng__H264_writebits_startcode_prefix_element(pMTX_Header, aui32ElementPointers, 4);
2572 aui32ElementPointers, (0 << 7) | // forbidden_zero_bit=0
2579 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 118, 8);
2582 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (0 << 7) | // constrain_set0_flag = 1 for MP + BP constraints
2590 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (pSHParams->ucLevel == SH_LEVEL_1B) ? 11 : (IMG_UINT8)pSHParams->ucLevel, 8); // level_idc (8 bits) = 11 for 1b, 10xlevel for others
2592 tng__generate_ue(pMTX_Header, aui32ElementPointers, MVC_SPS_ID); // seq_parameter_Set_id = 1 FOR subset-SPS
2593 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // chroma_format_idc = 1
2594 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // bit_depth_luma_minus8 = 0
2595 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // bit_depth_chroma_minus8 = 0
2596 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, pSHParams->bIsLossless ? 1 : 0, 1); // qpprime_y_zero_transform_bypass_flag = 0
2599 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // seq_scaling_matrix_present_flag
2602 H264_WriteBits_ScalingLists(pMTX_Header, aui32ElementPointers, psScalingMatrix, IMG_TRUE);
2604 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
2606 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 8); // seq_scaling_list_present_flag[i] = 0; 0 < i < 8
2609 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // seq_scaling_matrix_present_flag
2612 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // log2_max_frame_num_minus4 = 1
2613 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // pic_order_cnt_type = 0
2614 tng__generate_ue(pMTX_Header, aui32ElementPointers, 2); // log2_max_pic_order_cnt_Isb_minus4 = 2
2616 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSHParams->max_num_ref_frames); //num_ref_frames ue(2), typically 2
2618 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
2624 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSHParams->ucWidth_in_mbs_minus1); //pic_width_in_mbs_minus1: ue(v) from 10 to 44 (176 to 720 pixel per row)
2625 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSHParams->ucHeight_in_maps_units_minus1); //pic_height_in_maps_units_minus1: ue(v) Value from 8 to 35 (144 to 576 pixels per column)
2628 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, pSHParams->ucFrame_mbs_only_flag, 1); // frame_mb_only_flag 1=frame encoding, 0=field encoding
2631 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // mb_adaptive_frame_field_flag = 0 in Topaz(field encoding at the sequence level)
2633 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // direct_8x8_inference_flag=1 in Topaz
2636 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1);
2637 tng__generate_ue(pMTX_Header, aui32ElementPointers, psCrop->ui16LeftCropOffset);
2638 tng__generate_ue(pMTX_Header, aui32ElementPointers, psCrop->ui16RightCropOffset);
2639 tng__generate_ue(pMTX_Header, aui32ElementPointers, psCrop->ui16TopCropOffset);
2640 tng__generate_ue(pMTX_Header, aui32ElementPointers, psCrop->ui16BottomCropOffset);
2643 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1);
2648 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
2652 tng__H264_writebits_VUI_params(pMTX_Header, aui32ElementPointers, &(pSHParams->VUI_Params));
2658 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); //bit_equal_to_one
2661 tng__generate_ue(pMTX_Header, aui32ElementPointers, (numViews - 1)); //num_views_minus1
2663 tng__generate_ue(pMTX_Header, aui32ElementPointers, viewIdx);
2668 //tng__generate_ue( pMTX_Header, aui32ElementPointers, 0); // num_anchor_refs_l0 = 0
2669 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // num_anchor_refs_l0 = 1; view-1 refers to view-0
2670 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // anchor_ref_l0 = 0
2672 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // num_anchor_refs_l1 = 0
2677 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // num_non_anchor_refs_l0 = 0
2678 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // non_anchor_refs_l0 = 0
2680 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // num_non_anchor_refs_l1 = 0
2683 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // num_level_values_signaled_minus1 = 0
2687 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, (pSHParams->ucLevel == SH_LEVEL_1B) ? 11 : (IMG_UINT8)pSHParams->ucLevel, 8); // level_idc (8 bits) = 11 for 1b, 10xlevel for others
2688 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // num_applicable_ops_minus1 = 0
2690 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 3); // applicable_ops_temporal_id = 0
2691 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // applicable_op_num_target_views_minus1 = 0
2693 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // applicable_op_target_view_id = 0
2695 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // applicable_op_num_views_minus1 = 0
2699 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
2703 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers,
2711 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_INSERTBYTEALIGN_H264);
2747 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
2760 aui32ElementPointers[0] = This_Element;
2779 tng__H264ES_writebits_mvc_sequence_header(pMTX_Header, aui32ElementPointers, &sSHParams, psCropParams, NULL);
2805 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
2808 aui32ElementPointers[0] = This_Element;
2826 tng__H264ES_writebits_picture_header(pMTX_Header, aui32ElementPointers, &sPHParams, NULL);
2953 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
2955 aui32ElementPointers[0] = This_Element;
2958 aui32ElementPointers,
2987 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
2990 aui32ElementPointers[0] = This_Element;
2996 mtx_hdr, aui32ElementPointers, bIsVOP_coded,
3018 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
3021 aui32ElementPointers[0] = This_Element;
3023 H263_writebits_VideoSequenceHeader(mtx_hdr, aui32ElementPointers, Profile_and_level_indication);
3044 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
3047 aui32ElementPointers[0] = This_Element;
3050 mtx_hdr, aui32ElementPointers,
3072 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
3075 aui32ElementPointers[0] = This_Element;
3077 H263_writebits_GOBSliceHeader(mtx_hdr, aui32ElementPointers, GOBNumber, GOBFrameId);
3095 MTX_HEADER_ELEMENT **aui32ElementPointers,
3101 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
3103 tng__H264_writebits_startcode_prefix_element(pMTX_Header, aui32ElementPointers, pSlHParams->ui8Start_Code_Prefix_Size_Bytes); //Can be 3 or 4 bytes - always 4 bytes in our implementations
3112 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // forbidden_zero_bit
3114 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_REFERENCE); //MTX fills this value in
3115 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3117 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 20, 5); // nal_unit_type for coded_slice_extension
3121 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // SVC extension flag
3126 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // non_idr_flag flag
3128 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // non_idr_flag flag
3130 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // non_idr_flag flag
3133 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 6); // priority_id flag
3134 tng__write_upto32bits_elements(pMTX_Header, aui32ElementPointers, 1, 10); // view_id = hardcoded to 1 for dependent view
3136 //tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 3); // temporal_id flag
3137 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_TEMPORAL_ID); // temporal_id flag
3138 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_ANCHOR_PIC_FLAG); // anchor_pic_flag
3140 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3142 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // interview flag is always FALSE for dependent frames
3144 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // reserved one bit
3148 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_CURRMBNR); //MTX fills this value in
3150 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3154 //tng__generate_ue(pMTX_Header, aui32ElementPointers, (IMG_UINT32) pSlHParams->First_MB_Address); //first_mb_in_slice = First MB address in slice: ue(Range 0 - 1619)
3155 tng__generate_ue(pMTX_Header, aui32ElementPointers, (IMG_UINT32)((pSlHParams->SliceFrame_Type == SLHP_IDR_SLICEFRAME_TYPE) ? SLHP_I_SLICEFRAME_TYPE : pSlHParams->SliceFrame_Type)); //slice_type ue(v): 0 for P-slice, 1 for B-slice, 2 for I-slice
3158 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // pic_parameter_set_id = 1 for dependent view
3160 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_FRAME_NUM); // Insert token to tell MTX to insert frame_num
3164 //tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3168 CheckStartRawDataElement(pMTX_Header, aui32ElementPointers);
3169 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // field_pic_flag = 1
3170 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_BOTTOM_FIELD); // Insert token to tell MTX to insert BOTTOM_FIELD flag if required
3171 //tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3177 CheckStartRawDataElement(pMTX_Header, aui32ElementPointers);
3178 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // idr_pic_id ue(v) = 0 (1b) in Topaz
3181 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_PIC_ORDER_CNT); // Insert token to tell MTX to insert pic_order_cnt_lsb
3185 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_DIRECT_SPATIAL_MV_FLAG); // Insert token to tell MTX to insert direct_spatial_mv_pred_flag
3188 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_NUM_REF_IDX_ACTIVE);
3191 CheckStartRawDataElement(pMTX_Header, aui32ElementPointers);
3192 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // num_ref_idx_active_override_flag (1 bit) = 0 in Topaz
3197 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_REORDER_L0); // Insert token to tell MTX to insert BOTTOM_FIELD flag if required
3198 //tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3203 CheckStartRawDataElement(pMTX_Header, aui32ElementPointers);
3204 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // ref_pic_list_ordering_flag_l1 (1 bit) = 0, no reference picture ordering in Topaz
3208 /* tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_SLICEWEIGHTEDPREDICTIONSTRUCT);
3212 CheckStartRawDataElement(pMTX_Header, aui32ElementPointers);
3213 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // no_output_of_prior_pics_flag (1 bit) = 0
3214 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // long_term_reference_flag (1 bit) = 0
3216 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_ADAPTIVE); //MTX fills this value in
3217 //tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3223 CheckStartRawDataElement(pMTX_Header, aui32ElementPointers);
3224 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // hard code cabac_init_idc value of 0
3226 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_SQP); //MTX fills this value in
3227 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3233 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->Disable_Deblocking_Filter_Idc); //disable_deblocking_filter_idc ue(v) = 2?
3235 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->iDebAlphaOffsetDiv2); //slice_alpha_c0_offset_div2 se(v) = 0 (1b) in Topaz
3236 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->iDebBetaOffsetDiv2); //slice_beta_offset_div2 se(v) = 0 (1b) in Topaz
3247 MTX_HEADER_ELEMENT **aui32ElementPointers,
3255 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_RAWDATA);
3257 tng__insert_prefix_nal_header(pMTX_Header, aui32ElementPointers,
3259 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_STARTCODE_MIDHDR);
3262 tng__H264ES_notforsims_writebits_extension_sliceheader(pMTX_Header, aui32ElementPointers,
3267 tng__H264_writebits_startcode_prefix_element(pMTX_Header, aui32ElementPointers, pSlHParams->ui8Start_Code_Prefix_Size_Bytes); //Can be 3 or 4 bytes - always 4 bytes in our implementations
3277 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // forbidden_zero_bit
3280 //tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, ((pSlHParams->SliceFrame_Type == SLHP_IDR_SLICEFRAME_TYPE ? 3 : ELEMENT_REFERENCE)), 2);
3281 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_REFERENCE);
3282 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3284 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, ((pSlHParams->SliceFrame_Type == SLHP_IDR_SLICEFRAME_TYPE ? 5 : 1)), // nal_unit_tpye (5 bits) = I-frame IDR, and 1 for rest
3287 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_CURRMBNR); //MTX fills this value in
3288 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3293 //tng__generate_ue(pMTX_Header, aui32ElementPointers, (IMG_UINT32) pSlHParams->First_MB_Address); //first_mb_in_slice = First MB address in slice: ue(Range 0 - 1619)
3294 tng__generate_ue(pMTX_Header, aui32ElementPointers, (IMG_UINT32)((pSlHParams->SliceFrame_Type == SLHP_IDR_SLICEFRAME_TYPE) ? SLHP_I_SLICEFRAME_TYPE : pSlHParams->SliceFrame_Type)); //slice_type ue(v): 0 for P-slice, 1 for B-slice, 2 for I-slice
3297 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->ui16MvcViewIdx); // pic_parameter_set_id = 0
3299 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // pic_parameter_set_id = 0
3301 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_FRAME_NUM); // Insert token to tell MTX to insert frame_num
3304 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3307 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // field_pic_flag = 1
3308 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_BOTTOM_FIELD); // Insert token to tell MTX to insert BOTTOM_FIELD flag if required
3309 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3313 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_IDR_PIC_ID); // idr_pic_id ue(v)
3316 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_PIC_ORDER_CNT); // Insert token to tell MTX to insert pic_order_cnt_lsb
3319 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_DIRECT_SPATIAL_MV_FLAG); // Insert token to tell MTX to insert direct_spatial_mv_pred_flag
3322 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_NUM_REF_IDX_ACTIVE); // Insert token to tell MTX to insert override for number of active references
3324 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3325 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 0, 1); // num_ref_idx_active_override_flag (1 bit) = 0
3330 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_REORDER_L0); // Insert token to tell MTX to insert reference list 0 reordering
3332 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_REORDER_L1); // Insert token to tell MTX to insert reference list 1 reordering
3337 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_SLICEWEIGHTEDPREDICTIONSTRUCT);
3338 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3341 tng__write_upto8bits_elements(pMTX_Header, aui32ElementPointers, 1, 1); // adaptive_ref_pic_marking_mode_flag (1 bit) = 0
3344 tng__generate_ue(pMTX_Header, aui32ElementPointers, 5); // memory_management_control_operation
3347 tng__generate_ue(pMTX_Header, aui32ElementPointers, 4); // memory_management_control_operation
3348 tng__generate_ue(pMTX_Header, aui32ElementPointers, 1); // max_long_term_frame_idx_plus1
3351 tng__generate_ue(pMTX_Header, aui32ElementPointers, 6); // memory_management_control_operation
3352 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // long_term_frame_idx
3355 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // memory_management_control_operation
3357 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_ADAPTIVE); //MTX fills this value in
3358 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3363 tng__generate_ue(pMTX_Header, aui32ElementPointers, 0); // hard code cabac_init_idc value of 0
3365 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_SQP); //MTX fills this value in
3366 tng__insert_element_token(pMTX_Header, aui32ElementPointers, ELEMENT_RAWDATA);
3372 tng__generate_ue(pMTX_Header, aui32ElementPointers, pSlHParams->Disable_Deblocking_Filter_Idc); //disable_deblocking_filter_idc ue(v) = 2?
3375 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->iDebAlphaOffsetDiv2); //slice_alpha_c0_offset_div2 se(v) = 0 (1b) in Topaz
3376 tng__generate_se(pMTX_Header, aui32ElementPointers, pSlHParams->iDebBetaOffsetDiv2); //slice_beta_offset_div2 se(v) = 0 (1b) in Topaz
3418 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
3450 aui32ElementPointers[0] = This_Element;
3454 tng__H264ES_notforsims_writebits_slice_header(pMTX_Header, aui32ElementPointers, &SlHParams, bCabacEnabled, bIsIDR);
3471 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
3474 aui32ElementPointers[0] = This_Element;
3475 H263_NOTFORSIMS_WriteBits_GOBSliceHeader(pMTX_Header, aui32ElementPointers);
3491 MTX_HEADER_ELEMENT *aui32ElementPointers[MAXNUMBERELEMENTS];
3494 aui32ElementPointers[0] = This_Element;
3495 // MPEG2_WriteBits_SliceHeader(pMTX_Header, aui32ElementPointers);