background image

 
 
 
 
 

H.264 High Profile Encoder on 
TMS320C6678 Platform 
 

User’s Guide 

 

 

 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Literature Number: SPRUHL4 

December 2012 

 

Summary of Contents for H.264 High Profile Encoder

Page 1: ...H 264 High Profile Encoder on TMS320C6678 Platform User s Guide Literature Number SPRUHL4 December 2012 ...

Page 2: ...solely responsible for compliance with all legal regulatory and safety related requirements concerning its products and any use of TI components in its applications notwithstanding any applications related information or support that may be provided by TI Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which anticipate dangerous consequences o...

Page 3: ...rocessing DSP digital signal processors and DSP applications Good knowledge of eXpressDSP Algorithm Interface Standard XDAIS and eXpressDSP Digital Media XDM standard will be helpful How to Use This Manual This document includes the following chapters Chapter 1 Introduction provides a brief introduction to the XDAIS and XDM standards It also provides an overview of the codec and lists its supporte...

Page 4: ...echnical Overview of eXpressDSP Compliant Algorithms for DSP Software Producers literature number SPRA579 describes how to make algorithms compliant with the TMS320 DSP Algorithm Standard which is part of TI s eXpressDSP technology initiative Using the TMS320 DSP Algorithm Standard in a Static DSP System literature number SPRA577 describes how an eXpressDSP compliant algorithm may be used effectiv...

Page 5: ...iate Format COFF Common Object File Format DMA Direct Memory Access DMAN3 DMA Manager DSP Digital Signal Processing EVM Evaluation Module GOP Group Of Pictures IDR Instantaneous Decoding Refresh IRES Interface for Resources NAL Network Abstraction Layer PPS Picture Parameter Set QCIF Quarter Common Intermediate Format QP Quantization Parameter QVGA Quarter Video Graphics Array RMAN Resource Manage...

Page 6: ...ne commands are shown in a mono spaced font Product Support When contacting TI for support on this codec quote the product name H 264 High Profile Encoder on TMS320C6678 platform and version number The version number of the codec is included in the Title of the Release Notes that accompanies this codec Trademarks Code Composer Studio DSP BIOS eXpressDSP TMS320 TMS320C64x TMS320C6000 TMS320C6678 an...

Page 7: ...LLATION OVERVIEW 2 1 2 1 SYSTEM REQUIREMENTS 2 2 2 1 1 Hardware 2 2 2 1 2 Software 2 2 2 2 INSTALLING THE COMPONENT 2 2 2 2 1 Installing the Component RTSC Package 2 2 2 2 2 Installing the Component Compressed archive 2 4 2 3 BEFORE BUILDING THE ALGORITHM LIBRARY AND SAMPLE TEST APPLICATION 2 9 2 3 1 Installing XDAIS tools XDAIS 2 9 2 3 2 Installing XDC Tools 2 9 2 3 3 Installing BIOS tools SYS BI...

Page 8: ...4 3 1 4 Algorithm Instance Deletion 3 5 3 2 FRAME BUFFER MANAGEMENT 3 5 3 2 1 Input Frame Buffer 3 5 API REFERENCE 4 1 4 1 SYMBOLIC CONSTANTS AND ENUMERATED DATA TYPES 4 2 4 1 1 Common XDM Data types 4 2 4 1 2 Common Multi Core Data types 4 24 4 2 DATA STRUCTURES 4 28 4 2 1 Common XDM Data Structures 4 28 4 2 2 Common Multi core Data Structures 4 46 4 2 3 H 264 High Profile Encoder Data Structures...

Page 9: ... 1 5 FIGURE 2 1 COMPONENT DIRECTORY STRUCTURE IN CASE OF RTSC PACKAGE RELEASE 2 3 FIGURE 2 2 COMPONENT DIRECTORY STRUCTURE IN CASE OF OBJECT RELEASE 2 5 FIGURE 2 3 COMPONENT DIRECTORY STRUCTURE IN CASE OF SOURCE RELEASE 2 7 FIGURE 3 1 TEST APPLICATION SAMPLE IMPLEMENTATION 3 2 FIGURE 5 1 OVERVIEW OF CALLBACK FUNCTION B 1 FIGURE 5 3 OVERVIEW OF COPYING B 2 ...

Page 10: ...x This page is intentionally left blank ...

Page 11: ...AMS 4 64 TABLE 4 6 DEFAULT AND SUPPORTED VALUES FOR IVIDENC2_DYNAMICPARAMS 4 66 TABLE 4 7 DEFAULT AND SUPPORTED VALUES FOR IH264HPVENC_RATECONTROLPARAMS 4 67 TABLE 4 8 DEFAULT AND SUPPORTED VALUES FOR IH264HPVENC_INTERCODINGPARAMS 4 68 TABLE 4 9 DEFAULT AND SUPPORTED VALUES FOR IH264HPVENC_INTRACODINGPARAMS 4 68 TABLE 4 10 DEFAULT AND SUPPORTED VALUES FOR IH264HPVENC_SLICECODINGPARAMS 4 69 TABLE 4...

Page 12: ...xii This page is intentionally left blank ...

Page 13: ...AIS and XDM It also provides an overview of TI s implementation of the H 264 High Profile Encoder on the TMS320C6678 platform and its supported features Topic Page 1 1 Overview of XDAIS XDM and IRES 1 2 1 2 Overview of H 264 High Profile Encoder 1 4 1 3 Supported Services and Features 1 6 ...

Page 14: ...algInit API allows the algorithm to initialize the memory allocated by the client application The algFree API allows the algorithm to communicate the memory to be freed when an instance is no longer required Once an algorithm instance object is created it can be used to process data in real time The algActivate API provides a notification to the algorithm instance that one or more algorithm proces...

Page 15: ...ou have developed a client application using an XDM compliant MPEG4 video decoder then you can easily replace MPEG4 with another XDM compliant video decoder say H 263 with minimal changes to the client application For more details see eXpressDSP Digital Media XDM Standard API Reference literature number SPRUEC8 1 1 3 IRES Overview IRES is a generic resource agnostic extendible resource query initi...

Page 16: ...tches a concrete IRES resource interface supported by the application framework and if the resource is available the client grants the algorithm logical IRES resource handles representing the allotted resources Each handle provides the algorithm with access to the resource as defined by the concrete IRES resource interface IRES interface definition and function calling sequence is depicted in the ...

Page 17: ...ins all zero co efficients and are not coded The H 264 Encoder defines in loop filtering to avoid blocks across the 4x4 block boundaries It is the second most computational task of H 264 encoding process after motion estimation In loop filtering is applied on all 4x4 edges as a post process and the operations depend upon the edge strength of the particular edge The H 264 Encoder applies entropy co...

Page 18: ...intra modes 16x16 8x8 and 4x4 Supports user controllable quantization parameter range initial quantization parameter HRD buffer size Supports 8x8 and 4x4 transform size Supports separate Cb and Cr Quantisation parameter control Supports multiple Scaling Matrix Preset and User Defined Scaling Matrices Supports user controlled quarter pel interpolation and integer pel for motion estimation Supports ...

Page 19: ...m BBIBBP Supports byte stream format and NAL unit format Support capability to generating only headers The other explicit features that TI s H 264 HP Encoder provides are eXpressDSP Digital Media XDM IVIDENC2 interface compliant Independent of any operating system Supports only YUV420 planar color sub sampling format Supports multi channel functionality This version of the codec does not support t...

Page 20: ......

Page 21: ... on building and running the sample test application Topic Page 2 1 System Requirements 2 2 2 2 Installing the Component 2 2 2 3 Before Building the Algorithm Library and Sample Test Application 2 9 2 4 Building the Algorithm Library 2 10 2 5 Building Sample Test Application 2 11 2 6 Running Sample Test Application 2 13 2 7 Configuration Files 2 15 2 8 Uninstalling the Component 2 18 ...

Page 22: ...rsion 5 1 0 09000 This project is sanity tested on Shannon TMS320C6678 platform Code Generation Tools This project is compiled assembled archived and linked using C6000 Code Generation tools version 7 4 1 for C66x CPU 2 2 Installing the Component The codec component is released as RTSC package or compressed archive Following sub sections details on installation along with directory structure 2 2 1...

Page 23: ...dec interface files h264hpvenc App Contains sample test application which uses codec library using IVIDENC2 codec interface h264hpvenc App Client B uild C66X Map Contains map file generated after building with 66X compiler h264hpvenc App Client B uild C664X Obj Contains intermediate Object files generated after building host test application with C66X compiler h264hpvenc App Client B uild C66X Out...

Page 24: ... Test TestVecs Reference Contains read only reference output to be used for cross checking against codec output h264hpvenc Docs Contains user guide data sheet release notes and software manifest h264hpvenc Lib Contains the library file named as h264hpvenc_ti le66 for encoding the compressed video data 2 2 2 Installing the Component Compressed archive The codec component is released as a compressed...

Page 25: ...generated after building host test application with C66X compiler Client Build C66X Out Contains the final application executable out file generated by the sample test application Client Build packages Platform RTSC package for building Test application Client Build VC h264hpve nc_ti_vc Contains project files to build stand alone test application for encoder on VC Client Test Inc Contains standalo...

Page 26: ...generated by the codec It is empty directory as part of release Client Test TestVecs Reference Contains read only reference output to be used for cross checking against codec output docs Contains user guide data sheet and release notes Inc Contains XDM related header files which allow interface to the codec library Lib Contains the library file named as h264hpvenc_ti_vc lib h264hpvenc_ti le66 for ...

Page 27: ...Description Src Build C66X Contains project files needed to build codec with C66X compiler Src Build C66X Obj Contains intermediate Object files generated after building codec with C66X compiler Src Build VC h264hpvenc _ti_vc_lib Contains project files needed to build codec with Microsoft Visual studio compiler Src Build VC Obj Contains intermediate Object files generated after building codec with...

Page 28: ...ecific to the TMS320C6678 platform Src ISA C66X CI Contains intrinsic implementation of source files for TMS320C6678 platform Src ISA C66X Inc Contains header files of codec specific to TMS320C6678 platform Src ISA C66X SA Contains linear assembly files specific to TMS320C6678 platform Src ISA VC C Contains Visual studio specific C source files for encoder algorithm Src ISA VC Inc Contains Visual ...

Page 29: ...de generation tools installation path 2 3 1 Installing XDAIS tools XDAIS XDAIS version 7 21 can be downloaded from the following website http software dl ti com dsps dsps_public_sw sdo_sb targetcontent xdais 7_21_01_07 index_FDS html Extract the XDAIS zip file to the same location where Code Composer Studio is installed For example C CCStudio5 0 Set a system environment variable named XDAIS_INSTAL...

Page 30: ... channels and data transfer across DDR memory to L2 memory using EDMA hardware EDMA low level driver can be downloaded from the following website http software dl ti com dsps dsps_public_sw sdo_tii psp edma3_lld edma3 lld bios6 02_11_03_03 index_FDS html Mare sure that EDMA3 LLD tools are recognized as RTSC package in CCS V5 by adding installation directory path at RTSC products search path in CCS...

Page 31: ...ofile Debug configuration will disable all the optimizations to debug the code in ELF mode Release configuration will enable all the optimizations without exposing symbols in ELF mode Please select Release configuration 4 Right click on the above project in CCSv5 IDE and select Build Project to build the algorithm library The built library h264hpvenc_ti le66 is available in the Lib sub directory 2...

Page 32: ...t Build C66X sub directory 5 This project contains two build configurations Debug and Release Debug configuration will disable all the optimizations to debug the code in ELF mode Release configuration will enable all the optimizations without exposing symbols in ELF mode Please select Debug configuration 6 Open the build properties by right clicking the project under CCS build options Build Variab...

Page 33: ...i_c66x out will be present in h264hpvenc App Client Build C66X Out sub directory 2 6 Running Sample Test Application Sample test application is used to run codec library in single core or multicore mode Number of cores involved can be controlled with ncores parameter Running sample test application on Visual studio and Code composer studio is specified in section 2 6 1 and section 2 6 2 respective...

Page 34: ...erspective by clicking on Window Open Perspective other and then by clicking CCS Debug 4 Make sure TMS320C6678 target is configured with TMS320C6678 EVM by checking View Target Configurations user Defined One should see the specific target if it is not available go to Target New Target Configuration Give name of the target next select TMS320C6678 Device according to the type of JTAG availability 5...

Page 35: ...e test case 2 Terminate the regression 2 7 1 Encoder Configuration File The encoder configuration file encoder cfg contains the configuration parameters required for the encoder The Encoder cfg file is available in the Client Test TestVecs Config sub directory A sample encoder cfg file is as shown ParameterName ParameterValue Comment Files InputFile Test TestVecs Input airshow_p352x288 yuv Encoded...

Page 36: ...ned rcAlgo 0 0 Variable Bitrate 1 Constant bitrate qpI 1 Initial QP for I IDR frames 1 codec chosen qpP 1 Initial QP for P frames qpOffsetB 4 Offset of B frames QP from P frames qpMaxI 51 Maximum QP for I IDR frames qpMinI 1 Minimum QP for I IDR frames qpMaxP 51 Maximum QP for P frames qpMinP 1 Minimum QP for P frames qpMaxB 51 Maximum QP for B frames qpMinB 1 Minimum QP for B frames CbQPIndexOffs...

Page 37: ... 2 No filter across slices filterOffsetA 0 Alpha offset for loop filter filterOffsetB 0 Beta offset for loop filter VUI Control Params vuiCodingPreset 0 0 deafult values 1 user defined aspectRatioInfoPresentFlag 1 Controls the insertion of aspect ratio information in VUI part of bit stream aspectRatioIdc 1 Aspect ratio ID videoSignalTypePresentFlag 0 insertion of video signal type in VUI part of b...

Page 38: ...g 1 to indicate field order in interlaced content interlaceCodingType 3 Interlced field coding type selection 2 MRF 3 ARF 4 SPF DebugTraceLevel 0 Debug trace Enable 0 Disable 1 Level 1 2 Level 2 3 Level 3 lastNFramesToLog 5 Last N frames to log into debug trace buffer Any field in the IVIDENC2_Params structure see Section 4 2 1 7 can be set in the encoder cfg file using the syntax as shown in the ...

Page 39: ... 3 Sample Usage This chapter provides a detailed description of the sample test application that accompanies this codec component Topic Page 3 1 Overview of the Test Application 3 2 3 2 Frame Buffer Management 3 5 ...

Page 40: ...ile Encoder library The source files for this application are available in the Client Test Src and Client Test Inc sub directories Figure 3 1 Test Application Sample Implementation The test application is divided into four logical blocks Parameter setup Algorithm instance creation and initialization Process call Algorithm instance deletion ...

Page 41: ... test application accepts the various initialization parameters and returns an algorithm instance pointer The following APIs implemented by the codec are called in sequence by ALG_create 1 algNumAlloc To query the algorithm about the number of memory records it requires 2 algAlloc To query the algorithm about the memory requirement to be filled in the memory records 3 algInit To initialize the alg...

Page 42: ...eeping operations by the codec and updates the output parameters The control and process functions should be called only within the scope of the algActivate and algDeactivate XDAIS functions which activate and deactivate the algorithm instance respectively If the same algorithm is in use between two process control function calls calling these functions can be avoided Once an algorithm is activate...

Page 43: ...cess call 5 RMAN_exit To delete the generic IRES RMAN and release memory 3 2 Frame Buffer Management 3 2 1 Input Frame Buffer The encoder has input buffers that stores frames until they are processed These buffers at the input level are associated with a buffer input IDs The IDs are required to track the buffers that have been processed or locked The encoder uses this ID at the end of the process ...

Page 44: ...ero This initial delay is equal to the number of B frames Since the 4 th frame is a P frame it is returned immediately at the end of the process call Then input IDs 2 and 3 are returned as free buffers while frames 5 and 6 are being processed Hence if there are two B frames between P frames the input images for the B frames are stored and the P frame is encoded first and then the two B frames are ...

Page 45: ...ed description of the data structures and interfaces functions used in the codec component Topic Page 4 1 Symbolic Constants and Enumerated Data Types 4 2 4 2 Data Structures 4 28 4 3 Default and Supported Values of Parameters 4 64 4 4 Interface Functions 4 74 ...

Page 46: ...ME Frame type not available IVIDEO_I_FRAME IVIDEO_FRAMETYPE_D EFAULT Intra coded frame Default value IVIDEO_P_FRAME Forward inter coded frame IVIDEO_B_FRAME Bi directional inter coded frame IVIDEO_IDR_FRAME Intra coded frame that can be used for refreshing video content IVIDEO_II_FRAME Interlaced frame both fields are I frames IVIDEO_IP_FRAME Interlaced frame first field is an I frame second field...

Page 47: ...d ignore this operation if the frame for which the control is issued is IDR I frame IVIDEO_MetadataType IVIDEO_METADATAPLA NE_NONE Used to indicate no metadata is requested or available IVIDEO_METADATAPLA NE_MBINFO Used to indicate that MB info metadata is requested or available IVIDEO_METADATAPLA NE_EINFO Used to indicate that Error info metadata is requested or available IVIDEO_METADATAPLA NE_AL...

Page 48: ... skip mode IVIDEO_FRAME_SKIPP ED Input video frame skipped There is no encoded bit stream corresponding to the input frame IVIDEO_OutputFrameSt atus IVIDEO_FRAME_NOERR OR IVIDEO_OUTPUTFRAME STATUS_DEFAULT Output buffer is available default value Default status of the output frame IVIDEO_FRAME_NOTAV AILABLE Encoder does not have any output buffers IVIDEO_FRAME_ERROR Output buffer is available and c...

Page 49: ...enerates transcode information at the frame level IVIDEO_TRANSCODE_M BLEVEL Transcode mode of operation encode decode that consumes generates transcode information at the MB level IVIDEO_TRANSRATE_F RAMELEVEL Transrate mode of operation for encoder that consumes transrate information at the frame level IVIDEO_TRANSRATE_M BLEVEL Transrate mode of operation for encoder which consumes transrate infor...

Page 50: ... values The application needs to initialize the dynamicParams size and status size fields prior to calling control with XDM_SETDEFAULT The algorithm must write to the status extendedError field and potentially algorithm specific extended fields XDM_SETDEFAULT differs from XDM_RESET In addition to restoring the algorithm s internal state XDM_RESET also resets any channel related state XDM_FLUSH Han...

Page 51: ...264HPVENC_VERSION_LENGTH XDM_GETCONTEXTINFO Query a split codec part for its context needs Only split codecs are required to implement this command Not supported in this version of H264 Encoder XDM_GETDYNPARAMSDE FAULT Query the algorithm to fill the default values for the parameters which can be configured dynamically To get the current value of an algorithm instance s dynamic parameters it is re...

Page 52: ...e color format XDM_RGB555 RGB555 color format XDM_RGB565 RGB565 color format XDM_YUV_444ILE YUV 4 4 4 interleaved little endian color format XDM_MemoryType XDM_MEMTYPE_ROW XDM_MEMTYPE_RAW Raw memory type XDM_MEMTYPE_TILED8 2D memory in 8 bit container of tiled memory space XDM_MEMTYPE_TILED1 6 2D memory in 16 bit container of tiled memory space XDM_MEMTYPE_TILED3 2 2D memory in 32 bit container of...

Page 53: ... medium speed high quality XDM_EncMode XDM_ENCODE_AU Encode entire access unit including the headers Default value XDM_GENERATE_HEADE R Encode only header IVIDENC2_MotionVecto rAccuracy IVIDENC2_MOTIONVEC TOR_PIXEL Motion vectors accuracy is only integer pel IVIDENC2_MOTIONVEC TOR_HALFPEL Motion vectors accuracy is half pel IVIDENC2_MOTIONVEC TOR_QUARTERPEL Motion vectors accuracy is quarter pel I...

Page 54: ...s a frame XDM_CORRUPTEDDATA Bit 11 1 Data problem corruption 0 Ignore This error is applicable for decoders This is set when the bit stream has an error and not compliant to the standard syntax XDM_CORRUPTEDHEADE R Bit 12 1 Header problem corruption 0 Ignore This error is applicable for decoders This is set when the header information in the bit stream is incorrect For example it is set when Seque...

Page 55: ...the algorithm cannot recover from the current state It informs the system not to try the next frame and possibly delete the multimedia algorithm instance It implies the codec will not work when reset You should delete the current instance of the codec Note The remaining bits that are not mentioned in XDM_ErrorBit are interpreted as Bit 16 28 Used for codec specific error codes Bit 0 7 Codec and im...

Page 56: ...ofile identifier for H 264 Encoder IH264HP_BASELINE_PROFILE Baseline Profile IH264HP_MAIN_PROFILE Main Profile IH264HP_HIGH_PROFILE IH264HP_DEFAULT_PROFILE High Profile This is the default setting IH264HPVENC_Metadata Type Meta data type specifc to H 264 encoder IH264HP_USER_DEFINED_SCAL INGMATRIX By setting this value to any of IVIDENC2_Params metadataTy pe i You can provide scaling matrices to b...

Page 57: ...ATECONTROLPARAM S_DEFAULT Default rate control params IH264HP_RATECONTROLPARAM S_USERDEFINED User defined rate control params Default value IH264HPVENC_RateCon trolAlgo These enumerations control the type of rate control algorithm to be picked up by the encoder Only useful if IVIDENC2 rateControlPreset is set as IVIDEO_USER_DEFINED IH264HP_RATECONTROL_VBR IH264HP_RATECONTROL_DEFA ULT VBR Variable ...

Page 58: ... or Intra8x8 modes in I and B slices IH264HP_INTRA_PARTITION_I PBSLICES IH264HP_INTRA_PARTITION_D EFAULT Enable Intra4x4 or Intra8x8 modes in I P and B slices This is the default setting IH264HPVENC_IntraRe freshMethods Refresh method type identifier for H 264 Encoder IH264HP_INTRAREFRESH_NONE IH264HP_INTRAREFRESH_DEFA ULT Does not forcefully insert intra macro blocks Default intra refresh is OFF ...

Page 59: ...filtering params IH264HP_LOOPFILTER_USERDE FINED User defined loop filtering params IH264HPVENC_LoopFil terDisableIDC Controls H264 loop filter disable options IH264HP_DISABLE_FILTER_NO NE IH264HP_DISABLE_FILTER_DE FAULT Enable filtering of all the edges Default is loop filter enabled IH264HP_DISABLE_FILTER_AL L_EDGES Disable filtering of all the edges IH264HP_DISABLE_FILTER_SL ICE_EDGES Disable f...

Page 60: ...dec IH264HP_INTERLACE_MBAFF MBAFF type of interlace coding Not supported in this version of codec IH264HP_INTERLACE_FIELDON LY IH264HP_INTERLACE_FIELDON LY_MRF Field only coding with selecting most recent field as reference IH264HP_INTERLACE_FIELDON LY_ARF Field only coding where codec decides the parity of the field to be used based on content IH264HP_INTERLACE_FIELDON LY_SPF IH264HP_INTERLACE_DE...

Page 61: ... IH264HPVENC_ASPECTRATIO_S QUARE 1 1 square aspect ratio IH264HPVENC_ASPECTRATIO_1 2_11 12 11 aspect ratio IH264HPVENC_ASPECTRATIO_1 0_11 10 11 aspect ratio IH264HPVENC_ASPECTRATIO_1 6_11 16 11 aspect ratio IH264HPVENC_ASPECTRATIO_4 0_33 40 33 aspect ratio IH264HPVENC_ASPECTRATIO_2 4_11 24 11 aspect ratio IH264HPVENC_ASPECTRATIO_2 0_11 20 11 aspect ratio IH264HPVENC_ASPECTRATIO_3 2_11 32 11 aspect...

Page 62: ... Picture and Television Engineers RP 177 1993 Annex B IH264HP_CP_UNSPECIFIED Image characteristics are unknown or aredetermined by the application IH264HP_CP_ITU_R_BT470_6_ SYSTEM_M ITU R Rec BT 470 6 System M historical United States National Television System Committee 1953 Recommendation for transmission standards for colour television United States Federal Communications Commission Title 47 Co...

Page 63: ...United States National Television System Committee 1953 Recommendation for transmission standards for colour television United States Federal Communications Commission Title 47 Code of Federal Regulations 2003 73 682 a 20 ITU R Rec BT 1700 2007 revision 625 PAL and 625 SECAM IH264HP_TC_ITU_R_BT470_6_ SYSTEM_B_G ITU R Rec BT 470 6 System B G historical IH264HP_TC_SMPTE_170M ITU R Rec BT 601 6 525 o...

Page 64: ...RP 177 1993 Annex B IH264HP_MC_UNSPECIFIED Image characteristics are unknown or are determined by the application IH264HP_MC_USFCC United States Federal Communications Commission Title 47 Code of Federal Regulations 2003 73 682 a 20 IH264HP_MC_ITU_R_BT470_6_ SYSTEM_B_G ITU R Rec BT 470 6 System B G historical ITU R Rec BT 601 6 625 ITU R Rec BT 1358 625 ITU R Rec BT 1700 625 PAL and 625 SECAM IEC ...

Page 65: ...n complaint parameters This error is applicable when some parameters are set which are not meeting the limit defined by H 264 standard Table A 1 Level limits The error can be categorized under following category IH264HPVENC_LEVEL_INCOMPLAINT_RESOLU TION Invalid width height IH264HPVENC_LEVEL_INCOMPLAINT_HRDBUF SZIE Invalid HrdBufferSize IH264HPVENC_LEVEL_INCOMPLAINT_BITRAT E Invalid Bit Rate IH264...

Page 66: ...E MAIN_PROFILE This is create time error IH264HPVENC_PROF ILE_INCOMPLAINT_ CHROMAQPINDEXOFF SET Bit 6 Profiel in complaint chroma Qp control This error is set when a separate Qp control is used for Cb and Cr with IH264HP_BASELINE_PROFILE MAIN_PROFILE IH264HPVENC_COMP RESSEDSIZEOVERFL OW Bit 7 This error is set when compressed data size exceeds the given output buffer size IH264HPVENC_IMPR OPER_NUM...

Page 67: ...allowed range IH264HPVENC_UNSU PPORTED_LOOPFILT ERPARAMS Bit 24 Invalid loop filter related parameters This error is set when any parameter of structure IH264HPVENC_LoopFilterParams is not in allowed range IH264HPVENC_UNSU PPORTED_VUICODIN GPARAMS Bit 25 Invalid VUI coding parameters This error is set when any parameter of structure IH264HPVENC_VUICodingParams is not in allowed range IH264HPVENC_U...

Page 68: ...on or Evaluation IVIDMC_TASK_e IVIDMC_TASK_MASTER 0 The master core task ID IVIDMC_TASK_SLAVE 1 Slave Task ID This is non specific to any particular task This can be used in case of symmetrical Multi core operations IVIDMC_TASK_SLAVE_1 2 Specific slave task ID 1 IVIDMC_TASK_SLAVE_2 2 Specific slave task ID 2 IVIDMC_TASK_SLAVE_3 3 Specific slave task ID 3 IVIDMC_TASK_SLAVE_4 4 Specific slave task I...

Page 69: ...EY_e IVIDMC_SHMEMKEY_FIRST 0 Shared memory Key value to get shared memory across cores tasks IVIDMC_SHMEM_KEY_0 0 Shared memory Key ID 0 IVIDMC_SHMEM_KEY_1 1 Shared memory Key ID 1 IVIDMC_SHMEM_KEY_2 2 Shared memory Key ID 2 IVIDMC_SHMEM_KEY_3 3 Shared memory Key ID 3 IVIDMC_SHMEM_KEY_4 4 Shared memory Key ID 4 IVIDMC_SHMEM_KEY_5 5 Shared memory Key ID 5 IVIDMC_SHMEM_KEY_6 6 Shared memory Key ID 6...

Page 70: ..._13 13 Shared memory Key ID 13 IVIDMC_SHMEM_KEY_14 14 Shared memory Key ID 14 IVIDMC_SHMEM_KEY_15 15 Shared memory Key ID 15 IVIDMC_SHMEM_KEY_LAST 15 Shared memory Key ID for last memory segment IVIDMC_SHMEM_NUM_KEYS 16 Total number of possible shared memory segments IVIDMC_SHMEM_KEY_CLEAN 65535 Key ID to clear shared memory allocations IVIDMC_SWBARR_e IVIDMC_SWBARR_FIRST 0 First Software barrier ...

Page 71: ...arrier ID 6 IVIDMC_SWBARR7 7 Software barrier ID 7 IVIDMC_SWBARR8 8 Software barrier ID 8 IVIDMC_SWBARR9 9 Software barrier ID 9 IVIDMC_SWBARR10 10 Software barrier ID 10 IVIDMC_SWBARR11 11 Software barrier ID 11 IVIDMC_SWBARR12 12 Software barrier ID 12 IVIDMC_SWBARR13 13 Software barrier ID 13 IVIDMC_SWBARR14 14 Software barrier ID 14 IVIDMC_SWBARR15 15 Software barrier ID 15 IVIDMC_SWBARR_LAST ...

Page 72: ...any implementation specific parameters for a codec component 4 2 1 Common XDM Data Structures This section includes the following common XDM data structures XDM2_SingleBufDesc XDM2_BufDesc XDM1_AlgBufInfo IVIDEO1_BufDescIn IVIDEO2_BufDesc IVIDENC2_Fxns IVIDENC2_Params IVIDENC2_DynamicParams IVIDENC2_Inargs IVIDENC2_Status IVIDENC2_OutArgs XDM_Date XDM_Point XDM_Rect XDM_DataSyncDesc ...

Page 73: ...he algorithm declaring how the buffer was accessed by the algorithm processor If the buffer was not accessed by the algorithm processor for example it was filled through DMA or other hardware accelerator that does not write through the algorithm s CPU then bits in this mask should not be set It is acceptable to set several bits in this mask if the algorithm accessed the buffer in several ways This...

Page 74: ...for more details outBufMemoryType XDM_MAX_IO_BUFFER S XDAS_Int32 Output Required memory type for each output buffer See XDM_MemoryType enumeration in Table 4 1 for more details minNumBufSets XDAS_Int32 Output Minimum number of buffer sets for buffer management Note For H 264 High Profile Encoder the buffer details are Number of input buffer required is 3 for YUV 420P chroma format memType is XDM_M...

Page 75: ...uffers Fields Field Data Type Input Output Description numPlanes XDAS_Int32 Input Ou tput Number of buffers for video planes numMetaPlanes XDAS_Int32 Input Ou tput Number of buffers for metadata dataLayout XDAS_Int32 Input Ou tput Video buffer layout field interleaved or field separated See IVIDEO_VideoLayout enumeration in Table 4 1 for more details planeDesc IVIDEO_MAX_NUM_PLANES XDM2_Singl eBuf...

Page 76: ...er input buffer topFieldFirstFlag XDAS_Int32 Input Ou tput Indicates when the application should display had captured the top field first Not applicable for progressive content Not applicable for encoder reconstructed buffers Valid values are XDAS_TRUE and XDAS_FALSE repeatFirstFieldFlag XDAS_Int32 Input Ou tput Indicates when the first field should be repeated Valid values are XDAS_TRUE and XDAS_...

Page 77: ...splay buffer chromaFormat XDAS_Int32 Input Ou tput Chroma format for encoder input data decoded output buffer See XDM_ChromaFormat enumeration in Table 4 1 for more details scalingWidth XDAS_Int32 Input Ou tput Scaled image width for post processing for decoder Not applicable for encoders scalingHeight XDAS_Int32 Input Ou tput Scaled image height for post processing for decoder Not applicable for ...

Page 78: ...is structure defines the creation parameters for an algorithm instance object Set this data structure to NULL if you are not sure of the values to be specified for these parameters For the default and supported values see Table 4 5 Fields Field Data Type Input Output Description Size XDAS_Int32 Input Size of the base or extended if being used data structure in bytes Supported Values sizeof IVIDENC...

Page 79: ...putChromaFormat XDAS_Int32 Input Chroma format for the input buffer See XDM_ChromaFormat enumeration in Table 4 1 for more details inputContentType XDAS_Int32 Input Video content type of the buffer being encoded See IVIDEO_ContentType enumeration in Table 4 1 for more details operatingMode XDAS_Int32 Input Video coding mode of operation See IVIDEO_OperatingMode enumeration in Table 4 1 for details...

Page 80: ...numeration for possible values Note The following fields of IVIDENC2_Params data structure are level dependent maxHeight maxWidth maxInterFrameInterval To check the values supported for maxHeight and maxWidth use the following expression maxFrameSizeinMbs maxHeight maxWidth 256 See Table A 1 Level Limits in ISO IEC 14496 10 for the supported maxFrameSizeinMbs values For example consider you have t...

Page 81: ... Width of input frame in pixels refFrameRate XDAS_Int32 Input Reference or input frame rate in fps 1000 For example if the frame rate is 30 set this field to 30000 targetFrameRate XDAS_Int32 Input Target frame rate in fps 1000 For example if the frame rate is 30 set this field to 30000 targetBitRate XDAS_Int32 Input Target bit rate in bits per second For example if the bit rate is 2 Mbps set this ...

Page 82: ...is IH264HPVENC_ASPECTRATIO_EXTENDED sampleAspectRat ioWidth XDAS_Int32 Input Sample aspect ratio width This will be considered by encoder only when IH264HPVENC_VUICodingParams aspectRatioIdc is IH264HPVENC_ASPECTRATIO_EXTENDED ignoreOutbufSiz eFlag XDAS_Int32 Input Flag to indicate that for bit stream buffer size application needs codec to expect the requested size or not Valid values are XDAS_TRU...

Page 83: ...ntifier for a channel in multi channel scenario Note The following are the limitations on the parameters of IVIDENC2_DynamicParams data structure inputHeight maxHeight inputWidth maxWidth See Table A 1 Level Limits in ISO IEC 14496 10 for the supported values of maxMbsPerSecond Use the following expression to calculate FrameSizeinMbs FrameSizeinMbs inputWidth inputHeight 256 Following condition sh...

Page 84: ...ing input frames to be encoded Zero 0 is not a supported inputID This value is reserved for cases when there no input buffer is provided This is useful when frames require buffering example B frames and to support buffer management When there is no re ordering IVIDENC2_OutArgs outputID will be the same as this inputID field control XDAS_Int32 Input Encoder control operations By this parameter vari...

Page 85: ...urn of the IVIDENC1_Fxns control call The algorithm must not retain a pointer to this data encodingPreset XDAS_Int32 Output Encoding preset See XDM_EncodingPreset enumeration in Table 4 1 or details rateControlPreset XDAS_Int32 Output Rate control preset See IVIDEO_RateControlPreset enumeration in Table 4 1 for details maxInterFrameInte rval XDAS_Int32 Output This is used for setting the maximum n...

Page 86: ... as number of slices rows blocks and so on Ignored if inputDataMode is set to full frame mode numOutputDataUnit s XDAS_Int32 Output Number of output slices rows Units depend on the outputDataMode such as number of slices rows blocks and so on Ignored if outputDataMode is set to full frame mode configurationID XDAS_Int32 Output This is based on the codec configuration and can be used by the framewo...

Page 87: ...ed XDAS_Int32 Output The number of bytes generated during the IVIDENC2_Fxns process call encodedFrameType XDAS_Int32 Output Frame types for video See IVIDEO_FrameType enumeration in Table 4 1 for details inputFrameSkip XDAS_Int32 Output Frame skipping modes for video See IVIDEO_SkipMode enumeration in Table 4 1 for details freeBufID IVIDEO2_M AX_IO_BUFFERS XDAS_Int32 Output This is an array of inp...

Page 88: ...fers correspond to outBufs bufs 1 outBufs bufs 2 outBufs bufs 3 reconBufs bufDesc 0 buf is equivalent to outBufs bufs 1 reconBufs bufDesc 1 buf is equivalent to outBufs bufs 2 reconBufs bufDesc 2 buf is equivalent to outBufs bufs 3 It is optional for encoder to populate this buffer descriptor This implementation does not populate this descriptor 4 2 1 12 XDM_Date Description This structure contain...

Page 89: ...a structure for details bottomRight XDM_Point Input Bottom right corner of the frame See XDM_Point data structure for details 4 2 1 15 XDM_DataSyncDesc Description This structure provides the descriptor for the chunk of data being transferred in one call to putData or getData Fields Field Data Type Input Output Description size XDAS_Int32 Input Ou tput Size of this structure scatteredBlo cksFlag X...

Page 90: ...ks Memory for this array of size numBlocks has to be allocated by the caller of the putData API 4 2 2 Common Multi core Data Structures This section descibes below data structures which are used for multicore operations These data structures are common across all codecs IVIDMC_t 4 2 2 1 IVIDMC_t Description This structure contains Control parameters that are used for multi core program flow along ...

Page 91: ...grams related to cache coherency operations Lock Input Pointer to Critical section lock function UnLock Input Pointer to Critical section unlock function ncores XDAS_Int32 Input Total number of cores in the team core_task_ID IVIDMC_TASK_e Input Core Task Identification variable coreID XDAS_Int32 Input Current Core identification number ...

Page 92: ... specific extended data structures IH264HPVENC_Params IH264HPVENC_RateControlParams IH264HPVENC_InterCodingParams IH264HPVENC_IntraCodingParams IH264HPVENC_SliceCodingParams IH264HPVENC_LoopFilterParams IH264HPVENC_DynamicParams IH264HPVENC_Inargs IH264HPVENC_Status IH264HPVENC_OutArgs IH264HPVENC_Fxns IH264HPVENC_VUICodingParams ...

Page 93: ...arams data structure for details intraCodingPara ms IH264HPVENC_Int raCodingParams Input Controls all intra coding related parameters See IH264HPVENC_IntraCodingParams data structure for details sliceCodingPara ms IH264HPVENC_Sli ceCodingParams Input Controls all Slice coding related parameters See IH264HPVENC_SliceCodingParams data structure for details loopFilterParam s IH264HPVENC_Loo pFilterPa...

Page 94: ...nsform block size See IH264HPVENC_TransformBlockSize enumeration in Table 4 2 for more details picOrderCountTy pe XDAS_Int32 Input Picture order count type See IH264HPVENC_PicOrderCountType enumeration in Table 4 2 for more details log2MaxFNumMinu s4 XDAS_Int32 Input Limits the maximum frame number in the bit stream to 1 log2MaxFNumMinus4 4 Range is 0 to12 DebugTraceLevel XDAS_Int32 Input This par...

Page 95: ...ER_DEFINED When the encodingPreset field of IVIDENC2_Params data structure is equal to XDM_HIGH_QUALITY or XDM_HIGH_SPEED or XDM_DEFAULT the following parameters are chosen by codec and user doesn t have any control over these parameters 1 interCodingParams 2 intraCodingParams 3 sliceCodingParams 4 loopFilterParams 5 vuiCodingParams ...

Page 96: ... Range is 1 to 51 1 indicates auto initialization else Initial QP When rateControlPreset IVIDEO_NONE this quantization parameter is used by the whole video frame field and the range should be 0 to 51 qpMaxI XDAS_Int32 Input Maximum quantization parameter for I IDR frame s Range is 0 to 51 qpMinI XDAS_Int32 Input Minimum quantization parameter for I IDR frame s Range is 0 to 51 qpP XDAS_Int32 Input...

Page 97: ...ffer level should be provided as absolute value of the buffer size HRDBufferSize XDAS_Int32 Input Hypothetical reference decoder buffer size This size controls the frame skip logic of the encoder For low delay applications this size should be small This size is in bits enablePRC XDAS_Int32 Input Control Flag to enable MB level Perceptual Rate Control frameSkipAfte rSceneChange XDAS_Int32 Input Con...

Page 98: ...Data Type Input Output Description interCodingPr eset XDAS_Int32 Input This preset controls the USER_DEFINED versus DEFAULT mode If you are not aware about the fields it should be set as IH264HP_INTERCODING_DEFAULT MvRangeHorP XDAS_Int32 Input Horizontal motion vector range for P frames Possible values 16 to 496 MvRangeVerP XDAS_Int32 Input Vertical motion vector range for P frames Possible Values...

Page 99: ...nsformBlockSize 0 or Intra8x8 modes when transformBlockSize 1 coding in I P and B slices See IH264HPVENC_IntraPartitionParams enumeration in Table 4 2 for more details intraRefreshM ethod XDAS_Int32 Input Mechanism to do intra refresh See IH264HPVENC_IntraRefreshMethods enumeration in Table 4 2 for possible values intraRefreshR ate XDAS_Int32 Input Rate at which intra refresh is done This rate is ...

Page 100: ...a picture in slices It can be either MB based or picture based See IH264HPVENC_SliceMode enumeration in Table 4 2 for possible values sliceUnitSize XDAS_Int32 Input If sliceMode IH264HP_SLICEMODE_MBUNIT then this parameter informs the number of macro blocks in one slice streamFormat XDAS_Int32 Input Controls the type of stream byte stream format or NALU format See IH264HPVENC_StreamFormat enumerat...

Page 101: ...f you are not aware about the fields it should be set as IH264HP_SLICECODING_DEFAULT loopfilterDis ableIDC XDAS_Int32 Input Controls H 264 loop filter disabling options filterOffsetA XDAS_Int32 Input Alpha offset for loop filter Range is 12 12 even number filterOffsetB XDAS_Int32 Input Beta offset for loop filter Range is 12 12 even number Note These parameters can be controlled by user only when ...

Page 102: ...C_RateControlPara ms data structure for more details interCodingParams IH264HPVENC_Int erCodingParams Input Controls all inter MB coding related parameters Only few are supported to be changed as part of control call See IH264HPVENC_InterCodingPara ms data structure for more details intraCodingParams IH264HPVENC_Int raCodingParams Input Controls all intra MB coding related parameters Only few are ...

Page 103: ...ther implementation specific parameters The status parameters are defined in the XDM data structure IVIDENC2_Status Fields Field Data Type Input Output Description videnc2Status IVIDENC2_Status Output See IVIDENC2_Status data structure for details Status of the h264 encoder along with error information if any rateControlPar ams IH264HPVENC_Rat eControlParams Output See IH264HPVENC_RateControlParam...

Page 104: ..._Int32 Output See IH264HPVENC_InterlaceCodingType enumeration in Table 4 2 for details gopStructure XDAS_Int32 Output See IH264HPVENC_GOPStructure enumeration in Table 4 2 for details entropyCodingM ode XDAS_Int32 Output See IH264HPVENC_EntropyCodingMode enumeration in Table 4 2 for details transformBlock Size XDAS_Int32 Output See IH264HPVENC_TransformBlockSize enumeration in Table 4 2 for detail...

Page 105: ...See IVIDENC2_Fxns data structure for details 4 2 3 12 IH264HPVENC_VUICodingParams Description This structure contains all the parameters which controls VUI parameters Refer Annex E of the H 264 standard for more details of VUI and parameters Fields Field Data Type Input Output Description vuiCodingPreset XDAS_Int32 Input This preset controls the USER_DEFINED versus DEFAULT mode If you are not awar...

Page 106: ... type in VUI part of bit stream 0 No video signal related information is transmitted 1 video signal related information is transmitted videoFormat XDAS_Int32 Input This controls the video format type in VUI part of bit stream Encoder inserts videoFormat lower 3 bits as it is in the bit stream It is user s responsibility to provide appropriate value of this See Table E 2 H264 standard or enum IH264...

Page 107: ...he matrix coefficients type in VUI part of bit stream It is user s responsibility to provide appropriate value of this See Table E 5 H264 standard or enum IH264HPVENC_MatrixCoefficients for valid values timingInfoPresentF lag XDAS_Int32 Input This controls the insertion of timing info related parameters in VUI part of bit stream 0 timing information is not present 1 timing information is present N...

Page 108: ...VUICodingParams IH264HPVENC_Params IH264HPVENC_DynamicParams Table 4 5 Default and Supported Values for IVIDENC2_Params Field Default Value Supported Value size sizeof IH264HPVEN C_Params sizeof IH264HPVENC_Params encodingPreset XDM_DEFAULT XDM_DEFAULT XDM_USER_DEFINED XDM_HIGH_QUALITY XDM_HIGH_SPEED rateControlPreset IVIDEO_STORAGE IVIDEO_LOW_DELAY IVIDEO_STORAGE IVIDEO_NONE IVIDEO_USER_DEFINED I...

Page 109: ...ULTPROFILE level IH264HP_LEVEL_40 IH264HP_LEVEL_10 IH264HP_LEVEL_1b IH264HP_LEVEL_11 IH264HP_LEVEL_12 IH264HP_LEVEL_13 IH264HP_LEVEL_20 IH264HP_LEVEL_21 IH264HP_LEVEL_22 IH264HP_LEVEL_30 IH264HP_LEVEL_31 IH264HP_LEVEL_32 IH264HP_LEVEL_40 IH264HP_LEVEL_41 IH264HP_LEVEL_42 IH264HP_LEVEL_50 IH264HP_LEVEL_51 IVIDENC2_DEFAULTLEVEL inputDataMode IVIDEO_ENTIREFRAM E IVIDEO_ENTIREFRAME outputDataMode IVID...

Page 110: ...it intraFrameInterval 30 Any value 0 generateHeader XDM_ENCODE_AU XDM_ENCODE_AU XDM_GENERATE_HEADER captureWidth 1920 inputWidth forceFrame IVIDEO_NA_FRAME IVIDEO_NA_FRAME IVIDEO_IDR_FRAME interFrameInterval 1 1 255 Should be less than maxInterFrameInterval intraFrameInterval should be multiple of interFrameInterval mvAccuracy IVIDENC2_MOTIONVE CTOR_QUARTERPEL IVIDENC2_MOTIONVECTOR_QUARTERPEL IVID...

Page 111: ...INED rcAlgo IH264HP_RATECONTR OL_DEFAULT IH264HP_RATECONTROL_DEFAULT IH264HP_RATECONTROL_VBR IH264HP_RATECONTROL_CBR IH264HP_RATECONTROL_CONSTRAINED_ CBR qpI 1 1 51 qpMaxI 36 0 51 qpMinI 10 0 51 qpP 1 1 51 qpMaxP 40 0 51 qpMinP 10 0 51 qpOffsetB 4 The value of qpP qpOffsetB should be in range of 0 51 qpMaxB 44 0 51 qpMinB 10 0 51 CbQPIndexOffset 0 12 12 Note For Baseline and Main profiles CbQPInde...

Page 112: ...E D Table 4 8 Default and Supported Values for IH264HPVENC_InterCodingParams Field Default Value Supported Value interCodingPreset IH264HP_INTERCODIN G_DEFAULT IH264HP_INTERCODING_DEFAULT IH264HP_INTERCODING_USERDEFINED MvRangeHorP 144 16 496 MvRangeVerP 32 16 496 set as per level limit MvRangeHorB 144 16 496 MvRangeVerB 32 16 496 set as per level limit maxMVperMB 4 1 and 4 Table 4 9 Default and S...

Page 113: ...SliceCodingParams Field Default Value Supported Value sliceCodingPreset IH264HP_SLICECODI NG_DEFAULT IH264HP_SLICECODING_DEFAULT IH264HP_SLICECODING_USERDEFINED sliceMode IH264HP_SLICEMODE _DEFAULT IH264HP_SLICEMODE_NONE IH264HP_SLICEMODE_DEFAULT IH264HP_SLICEMODE_MBUNIT sliceUnitSize 0 0 when sliceMode IH264HP_SLICEMODE_MBUNIT sliceUnitSize is rounded to next multiple of mbs in a row If sliceUnit...

Page 114: ...LT IH264HP_VUICODING_USERDEFINED aspectRatioInfoPre sentFlag 0 0 1 aspectRatioIdc IH264HP_ASPECTRA TIO_UNSPECIFIED IH264HP_ASPECTRATIO_UNSPECIFIED IH264HP_ASPECTRATIO_SQUARE IH264HP_ASPECTRATIO_12_11 IH264HP_ASPECTRATIO_10_11 IH264HP_ASPECTRATIO_16_11 IH264HP_ASPECTRATIO_40_33 IH264HP_ASPECTRATIO_24_11 IH264HP_ASPECTRATIO_20_11 IH264HP_ASPECTRATIO_32_11 IH264HP_ASPECTRATIO_80_33 IH264HP_ASPECTRATI...

Page 115: ...264HP_TC_SMPTE_240M IH264HP_TC_LINEAR IH264HP_TC_LOG_100_1_RANGE IH264HP_TC_LOG_316_1_RANGE IH264HP_TC_IEC_61966_2_4 IH264HP_TC_ITU_R_BT1361 matrixCoefficients IH264HP_MC_UNSPE CIFIED IH264HP_MC_GBR IH264HP_MC_ITU_R_BT709_5 IH264HP_MC_UNSPECIFIED IH264HP_MC_USFCC IH264HP_MC_ITU_R_BT470_6_SYSTEM_B _G IH264HP_MC_SMPTE_170M IH264HP_MC_SMPTE_240M IH264HP_MC_YCGCO timingInfoPresentF lag 0 0 1 Table 4 1...

Page 116: ...4HP_INTERLACE_FIELDONLY_MRF IH264HP_INTERLACE_FIELDONLY_ARF IH264HP_INTERLACE_FIELDONLY_SPF IH264HP_INTERLACE_DEFAULT gopStructure IH264HPVENC_GOP STRUCTURE_DEFAU LT IH264HPVENC_GOPSTRUCTURE_NONUNIFO RM IH264HPVENC_GOPSTRUCTURE_DEFAULT IH264HPVENC_GOPSTRUCTURE_UNIFORM entropyCodingMode IH264HP_ENTROPY CODING_DEFAULT IH264HP_ENTROPYCODING_CABAC IH264HP_ENTROPYCODING_CAVLC IH264HP_ENTROPYCODING_DEFA...

Page 117: ...pported Values for IH264HPVENC_RateControlParams interCodingParams See Table 4 8 Default and Supported Values for IH264HPVENC_InterCodingParams intraCodingParams See Table 4 9 Default and Supported Values for IH264HPVENC_IntraCodingParams sliceCodingParams See Table 4 10 Default and Supported Values for IH264HPVENC_SliceCodingParams transformBlockSize IH264HP_TRANSFORM_DEFA ULT IH264HP_TRANSFORM_4...

Page 118: ...ivate process algDeactivate Termination algFree You must call these APIs in the following sequence 1 algNumAlloc 2 algAlloc 3 algInit 4 algActivate 5 process 6 algDeactivate 7 algFree control can be called any time after calling the algInit API algNumAlloc algAlloc algInit algActivate algDeactivate and algFree are standard XDAIS APIs This document includes only a brief description for the standard...

Page 119: ... Return Value XDAS_Int32 number of buffers required Description algNumAlloc returns the number of buffers that the algAlloc method requires This operation allows you to allocate sufficient space to call the algAlloc method algNumAlloc may be called at any time and can be called repeatedly without any side effects It always returns the same result The algNumAlloc API is optional For more details se...

Page 120: ...nitialized The first argument to algAlloc is a pointer to a structure that defines the creation parameters This pointer may be NULL however in this case algAlloc must assume default creation parameters and must not fail The second argument to algAlloc is an output parameter algAlloc may return a pointer to its parent s IALG functions If an algorithm does not require a parent object to be created t...

Page 121: ...ion necessary to complete the run time creation of an algorithm instance object After a successful return from algInit the instance object is ready to be used to process data The first argument to algInit is a handle to an algorithm instance This value is initialized to the base field of memTab 0 The second argument is a table of memory records that describe the base address size alignment type an...

Page 122: ...nism to return extended error code for unsupported parameters this version of encoder returns IALG_EOK even if some parameter unsupported is set But subsequence control process call it returns the detailed error code See Also algAlloc algMoved ...

Page 123: ...stance status parameters Return Value IALG_EOK status indicating success IALG_EFAIL status indicating failure XDM_EUNSUPPORTED status indicating parameters not supported Description This function changes the run time parameters of an algorithm instance and queries the algorithm s status control must only be called after a successful call to algInit and must never be called after a call to algFree ...

Page 124: ...owing conditions are true immediately after returning from this function If the control operation is successful the return value from this operation is equal to IALG_EOK otherwise it is equal to either IALG_EFAIL or an algorithm specific return value If status or handle is NULL then codec returns IALG_EFAIL If the control command is not recognized or some parameters to act upon are not supported t...

Page 125: ...at is part of the algorithm s instance object The first and only argument to algActivate is an algorithm instance handle This handle is used by the algorithm to identify various buffers that must be initialized prior to calling any of the algorithm s processing methods For more details see TMS320 DSP Algorithm Standard API Reference literature number SPRU360 See Also algDeactivate ...

Page 126: ...to the input and output buffer descriptor data structures respectively see XDM_BufDesc data structure for details The fourth argument is a pointer to the IVIDENC2_InArgs data structure that defines the run time input arguments for an algorithm instance object The last argument is a pointer to the IVIDENC2_OutArgs data structure that defines the run time output arguments for an algorithm instance o...

Page 127: ... must point to a valid buffer of data that is at least outBufs bufSizes 0 bytes in length The buffers in inBuf and outBuf are physically contiguous and owned by the calling application Postconditions The following conditions are true immediately after returning from this function If the process operation is successful the return value from this operation is equal to IALG_EOK otherwise it is equal ...

Page 128: ...r or decoder instance That is you cannot perform task switching while encode decode of a particular frame is in progress Pre emption can happen only at frame boundaries and after algDeactivate is called The input data is an uncompressed video frame in one of the format defined by inputChromaFormat of IVIDENC2_Params structure The encoder outputs H 264 compressed bit stream in the little endian for...

Page 129: ...nt information to non scratch buffers using the persistent memory that is part of the algorithm s instance object The first and only argument to algDeactivate is an algorithm instance handle This handle is used by the algorithm to identify various buffers that must be saved prior to next cycle of algActivate and processing For more details see TMS320 DSP Algorithm Standard API Reference literature...

Page 130: ... Value XDAS_Int32 Number of buffers used by the algorithm Description algFree determines the addresses of all memory buffers used by the algorithm The primary aim of doing so is to free up these memory regions after closing an instance of the algorithm The first argument to algFree is a handle to the algorithm instance The second argument is a table of memory records that describe the base address...

Page 131: ...stance creation i e MAX_DDR_SIZE and sizes for Input Output buffers need to change in buffer manager 5 2 Algorithm Related Question Answer What XDM interface does codec support Codec supports XDM IVIDENC2 interface What are the profiles supported in this version of encoder This version of encoder supports baseline main and high profiles FMO feature is not supported for baseline profile What is the...

Page 132: ... are the possible reasons The following are few of reasons for the error The input or output pointers are null The input or output buffer sizes are not sufficient or incorrect Creation control time failure Run time error occurred during encoding of the frame Does this version of encoder support interlaced coding This version supports interlace coding field coding SPF MRF and ARF and does not suppo...

Page 133: ...HPVENC_RateControlParams rcAlgo but rateControlParamsPreset controls the other associated parameters specified in IH264HPVENC_RateControlParams structure When rateControlPreset is user defined then only IH264HPVENC_RateControlParams rcAlgo is resepected otherwise it is controlled by rateControlPreset But even if rateControlPreset is not user defined other parameters of IH264HPVENC_RateControlParam...

Page 134: ...Frequently Asked Questions 5 4 This page is intentionally left blank ...

Page 135: ... frame MB_HEADER_SIZE Where SPS_PPS_HEADER_SIZE is size of SPS PPS data in debug buffer i e 200 bytes MB_HEADER_SIZE is Macroblock debug data buffer size i e 400 bytes Three levels are present in the Debug trace support Details of each level is explained below Level 1 All application input parameters are logged into debug trace buffer Level 2 All frame level parameters SPS PPS are logged into debu...

Page 136: ...o a bin file and feed to the Debug trace parser utility in the windows PC Debug trace parser is provided as utility along with codec release packages 6 Debug trace parser accepts the bin file and places log information to a text file in readable format ...

Page 137: ...ransmit the first NAL unit while the encoder is encoding the second NAL unit This will help to reduce end to end delay compared to the case where the encoder is first encoding all the NAL units and then transmitting them together Call back function that consumes compressed NAL units can be a simple copy function which reads from buffer A having compressed NAL unit and writes to buffer B which cons...

Page 138: ...ists This is because the encoder calls the function at same address once each NAL unit is encoded B 1 Call back Function Interface Call back function to be implemented by the application Description Encoder calls this function with NAL unit that informs about buffer that indicates pointer and size that the encoder writes Prototype void pfNalUnitCallBack unsigned int pNalu unsigned int pPacketSizeI...

Page 139: ...etSizeInBytes endif 2 In dynamic parameters set the call back function pointer This structure defines the run time parameters for H264VEnc object IH264VENC_DynamicParams dynamicParams Set the call back function pointer to application specific function dynamicParams videnc2DynamicParams putDataFxn H264BP_outputNalUnit Control call to set the dynamic parameters control XDM_SETPARAMS Call Back functi...

Reviews: