Professional Documents
Culture Documents
H264 Decoder C6678 UserGuide
H264 Decoder C6678 UserGuide
User’s Guide
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements,
improvements, and other changes to its products and services at any time and to discontinue any product or service without
notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is
current and complete. All products are sold subject to TI’s terms and conditions of sale supplied at the time of order
acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s
standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this
warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily
performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and
applications using TI components. To minimize the risks associated with customer products and applications, customers should
provide adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask
work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services
are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such
products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party
under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual
property of TI.
Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is
accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is
an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation. Information of third
parties may be subject to additional restrictions.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service
voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business
practice. TI is not responsible or liable for any such statements.
TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would
reasonably be expected to cause severe personal injury or death, unless officers of the parties have executed an agreement
specifically governing such use. Buyers represent that they have all necessary expertise in the safety and regulatory
ramifications of their applications, and acknowledge and agree that they are solely responsible for all legal, regulatory and safety-
related requirements concerning their products and any use of TI products in such safety-critical applications, notwithstanding
any applications-related information or support that may be provided by TI. Further, Buyers must fully indemnify TI and its
representatives against any damages arising out of the use of TI products in such safety-critical applications.
TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products
are specifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet
military specifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-
grade is solely at the Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements
in connection with such use.
TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products
are designated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use any non-
designated products in automotive applications, TI will not be responsible for any failure to meet such requirements.
Following are URLs where you can obtain information on other Texas Instruments products and application solutions:
Products Applications
Audio www.ti.com/audio Communications and Telecom ww.ti.com/communications
Amplifiers amplifier.ti.com Computers and Peripherals www.ti.com/computers
Data Converters dataconverter.ti.com Consumer Electronics www.ti.com/consumer-apps
DLP® Products www.dlp.com Energy and Lighting www.ti.com/energy
DSP dsp.ti.com Industrial www.ti.com/industrial
Clocks and Timers www.ti.com/clocks Medical www.ti.com/medical
Interface interface.ti.com Security ww.ti.com/security
Logic logic.ti.com Space, Avionics and Defense www.ti.com/space-avionics-defense
Power Mgmt power.ti.com Transportation and Automotive www.ti.com/automotive
Microcontrollers microcontroller.ti.com Video and Imaging ww.ti.com/video
RFID www.ti-rfid.com
OMAP Mobile Processors www.ti.com/omap
Wireless Connctivity www.ti.com/wirelessconnectivity
Intended Audience
This document is intended for system engineers who want to integrate
TI’s codecs with other software to build a multimedia system based on
the C66x+ platform.
This document assumes that you are fluent in the C language, have a
good working knowledge of Digital Signal Processing (DSP), digital
signal processors, and DSP applications. Good knowledge of
eXpressDSP Algorithm Interface Standard (XDAIS) and eXpressDSP
Digital Media (XDM) standard will be helpful.
iii
Read This First
iv
Read This First
Related Documentation
You can use the following documents to supplement this user guide:
v
Read This First
Abbreviation Description
JM Joint Menu
MB Macro Block
MV Motion Vector
vi
Read This First
Abbreviation Description
Text Conventions
The following conventions are used in this document:
Product Support
When contacting TI for support on this codec, quote the product name
(H.264 High Profile Decoder on C66x) 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, and TMS320C64x+ are trademarks of
Texas Instruments.
vii
Contents
viii
3.2.2 Frame Buffer Management by Application ......................................................... 3-7
3.2.3 Display Delay and Resolution ............................................................................ 3-8
3.3 Handshaking between multiple cores ...............................................................3-9
3.4 Sample Test Application ..................................................................................3-9
API Reference ................................................................................................................4-1
4.1 Symbolic Constants and Enumerated Data Types ...........................................4-2
4.1.1 H.264 Decoder Enumerated Data Types ......................................................... 4-13
4.2 Data Structures ..............................................................................................4-17
4.2.1 Common XDM Data Structures........................................................................ 4-17
4.2.2 H.264 Decoder Data Structures ....................................................................... 4-26
4.3 Interface Functions ........................................................................................4-42
4.3.1 Creation APIs ................................................................................................... 4-43
4.3.2 Initialization API ................................................................................................ 4-45
4.3.3 Control API ....................................................................................................... 4-46
4.3.4 Data Processing API ........................................................................................ 4-47
4.3.5 Termination API................................................................................................ 4-49
4.3.6 Multi-core API ................................................................................................... 4-50
ix
Figures
x
This page is intentionally left blank
xi
Tables
xii
This page is intentionally left blank
xiii
Chapter 1
Introduction
1-1
Introduction
algInit()
algActivate()
algDeactivate()
algFree()
The IALG interface also defines three more optional APIs algControl(),
algNumAlloc(), and algMoved(). For more details on these APIs, see
TMS320 DSP Algorithm Standard API Reference (literature number
SPRU360).
1-2
Introduction
process()
Apart from defining standardized APIs for multimedia codecs, XDM also
standardizes the generic parameters that the client application must pass
to these APIs. The client application can define additional implementation
specific parameters using extended data structures.
The following figure depicts the XDM interface to the client application.
Client Application
XDM Interface
For more details, see eXpressDSP Digital Media (XDM) Standard API
Reference (literature number SPRUEC8).
1-3
Introduction
Each level specifies a set of limits on the values that may be taken by the
syntax elements in that profile.
Baseline Profile:
o Only I and P type slices are present
o Only frame mode (progressive) picture types are present
o Only CAVLC is supported
Main Profile:
o Only I, P, and B type slices are present
o Frame and field picture modes (in progressive and interlaced modes)
picture types are present
o Both CAVLC and CABAC are supported
o ASO is not supported
High Profile:
o Only I, P, and B type slices are present
o Frame and field picture modes (in progressive and interlaced modes)
picture types are present
o Both CAVLC and CABAC are supported
o ASO is not supported
o FMO is not supported
o 8x8 transform supported
o Scaling matrices supported
o Separate quantization parameter for Cb, Cr is supported
Intra coded data: Spatial prediction mode and prediction error data,
which is subjected to DCT and later quantized.
1-4
Introduction
The output of the decoder is a YUV sequence, which can be of format 420
planar and 422 interleaved in little endian.
1-5
Introduction
Video Out
Video Bit Stream
Current Spatial
Picture Store Compensation SW
Process
Multiple Motion
Previous Compensation
Picture Store Process
Motion Vectors
Supports up to 16 MV per MB
1-6
Introduction
Supports byte-stream syntax and NAL unit format for the input bit-
stream
Streams without IDR pictures, but containing pictures with all I-type
slices are decoded
This version of the decoder does not support the following features as per
the High Profile feature set:
1-7
Chapter 2
Installation Overview
2-1
Installation Overview
2.1.1 Hardware
This codec has been built and tested on the TMS320C6678 EVM with on
board USB emulation XDS100.
2.1.2 Software
The following are the software requirements for the normal functioning of
the codec:
Cygnus Cygwin V.B20, which includes unix utilities and the ‘make’
program.
2-2
Installation Overview
\Inc Contains XDM related header files which allow interface to the
codec library
2-3
Installation Overview
Sub-Directory Description
\Client\Build\TestAppDecoder Contains the sample test application project, related .cmd file,
configuration files, final application executable (.out) and the
memory map generated on compilation of the code
Note:
“Src”, “mkrel” & “make” folders will be available as part of release package if it is a source release.
These folders are not available if it just an object/library release.
2-4
Installation Overview
In IDE go to Windows -> Preferences -> General -> Workspace -> Linked
Resources. Create new path variable H264VDEC_ROOT and set it to codec
root folder: ex: E:\100_V_H264AVC_D_01_01\C6678_HP_001
http://softwaredl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/ind
ex.html
Install DSP/BIOS at the same location where you have installed Code
Composer Studio. For example:
<install directory>\CCStudio_v4.2.3
http://softwaredl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/fc/3_20
_02_29/index_FDS.html
Extract the FC zip file to the same location where you have installed Code
Composer Studio. For example:
<install directory>\CCStudio_v4.2.3\ccv4
http://softwaredl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/ind
ex.html
2-5
Installation Overview
Install XDC Tools at the same location where you have installed Code
Composer Studio. For example:
<install directory>\CCStudio_v4.2.3
http://softwaredl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ipc/inde
x.html
Install BIOS IPC Tools at the same location where you have installed Code
Composer Studio. For example:
<install directory>\CCStudio_v4.2.3
E:\100_V_H264AVC_D_01_01\C6678_HP_001\src\build\h264vdecAlg.
Project file will detect automatically, click on finish.
2) Select library project (h264decAlg) -> right click -> Build Properties ->
Macros. Set the BIOS_ROOT, XDC_ROOT, and FRMWRK_ROOT to
host system path. For example:
BIOS_ROOT- C:\ccstudio_4.2.3\bios_6_31_00_18
FRMWRK_ROOT-
C:\ccstudio_4.2.3\ccsv4\framework_components_3_20_02_29
XDC_ROOT- C:\ccstudio_4.2.3\xdctools_3_20_08_88
2-6
Installation Overview
E:\100_V_H264AVC_D_01_01\C6678_HP_001\Client\Build\
TestAppDecoder
2) Set the Build properties -> Macros for test application project for
BIOS_ROOT, XDC_ROOT and FRMWRK_ROOT, e.g.,
BIOS_ROOT - C:\ccstudio_4.2.3\bios_6_31_00_18
FRMWRK_ROOT -
C:\ccstudio_4.2.3\ccsv4\framework_components_3_20_02_29
XDC_ROOT - C:\ccstudio_4.2.3\xdctools_3_20_08_88
3) Verify that the codec object library, h264vdec_ti.le66 exists in the \Lib
sub-directory.
8) Select Target -> Run to execute the sample test application. The
sample test application takes the input files stored in the
\Client\Test\Testvecs\Input sub-directory, runs the codec, and uses
the reference files stored in the \Client\Test\Testvecs\Reference sub-
directory to verify that the codec is functioning as expected.
2-7
Installation Overview
where:
Config is the Decoder configuration file. For details, see section 2.7.2
1
..\..\Test\TestVecs\Config\Testparams.cfg
..\..\Test\TestVecs\Input\football_704x480_IBBP_CABAC_16mv_mbaff_3Mbps.264
..\..\Test\TestVecs\Reference\football_704x480_IBBP_CABAC_16mv_mbaff_3Mbps.yuv
0
..\..\Test\TestVecs\Config\Testparams.cfg
..\..\Test\TestVecs\Input\ football_704x480_IBBP_CABAC_16mv_mbaff_3Mbps.264
..\..\Test\TestVecs\Output\ football_704x480_IBBP_CABAC_16mv_mbaff_3Mbps.yuv
2-8
Installation Overview
To check the conformance of the codec for other input files of your choice,
follow these steps:
If you have chosen the option to write to an output file (X is 0), you can use
any standard file comparison utility to compare the codec output with the
reference output and check for conformance.
2-9
Installation Overview
2-10
Chapter 3
Sample Usage
3-1
Sample Usage
Figure 3-1 depicts the sequence of APIs exercised in the sample test
application.
3-2
Sample Usage
Parameter setup
Process call
After successful completion of the above steps, the test application does
the algorithm instance creation and initialization.
3-3
Sample Usage
2) Sets the input and output buffer descriptors required for the
process() function call. The input and output buffer descriptors are
obtained by calling the control() function with the XDM_GETBUFINFO
command.
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. Once an
algorithm is activated, there could be any ordering of control() and
process() functions. The following APIs are called in sequence:
In the master core, the do-while loop encapsulates frame level process()
call and updates the input buffer pointer every time before the next call.
The do-while loop breaks off either when an error condition occurs or when
the input buffer exhausts. It also protects the process() call from file
operations by placing appropriate calls for cache operations as well. The
test application does a cache invalidate for the valid input buffers before
3-4
Sample Usage
process() and a cache write back invalidate for output buffers after
process(). The slave core just calls the process() in the do-while loop.
In the multi-core application, the master and slave cores synchronize within
the do-while loop to exit if there is an error condition or input buffer
exhausts.
ALG_create(…);
3-5
Sample Usage
Note:
Application can take the information returned by the control function with
the XDM_GETBUFINFO command and change the size of the buffer
passed in the next process call.
Application can re-use the extra buffer space of the 1st frame, if the
above control call returns a small size than that was provided.
The frame pointer given by the application and that returned by the algorithm
may be different. BufferID (InputID/outputID) provides the unique ID to
keep a record of the buffer given to the algorithm and released by the
algorithm. The following figure explains the frame pointer usage.
ID: X
Frame pitch
Pointer given by framework
in IVIDDEC2_OutArgs-
3-6
Sample Usage
Note:
Frame height and width is the actual height and width (after removing
cropping and padded width)
Frame pitch indicates the offset between the pixels at the same
horizontal co-ordinate on two consecutive lines
Note:
BufferID returned in IVIDDEC2_OutArgs ->outputID[] is just for
display purpose. Application should not consider it free unless it is a part of
IVIDDEC2_OutArgs->freeBufID[].
Algorithm Framework
GetFreeBuffer( )
Video Decode
Thread Free Post
Frame Processing or
XDM API Buffers Display
ReleaseBuffer( )
Subsystem
Video Decoder
3-7
Sample Usage
The number of buffers requested by the decoder from the application is N+2.
The additional buffer is for writing the YUV output for the current decoded
picture.
Therefore, while decoding a stream of resolution 720 x 576, the decoder will
buffer up to 5 frames before it provides the first buffer for display. Similarly,
for 352 x 288 resolution, the decoder buffers up to 16 frames. That is, for
3-8
Sample Usage
720 x 576, process call 6 will provide the first buffer for display. Similarly, for
the other resolutions.
The decoder and the application refers to any buffer by the unique buffer ID
assigned by the application at the time of providing the buffer to the decoder
through InArgs.inputID. The decoder internally bookmarks these buffers
using the assigned buffer ID. The decoder conveys the buffers to be
displayed to the application using the array outArgs.outputID[]. It
populates the buffer IDs of the buffers to be displayed in the order of display
in this array terminated by a zero, which is an invalid buffer ID (a buffer ID
has to be a non-zero value). Similarly, the decoder conveys the buffers to be
freed to the application using the array outArgs.freeBufID[]. It populates
the buffer IDs of the buffers to be freed in this array terminated by a zero,
which is an invalid buffer ID.
3-9
Sample Usage
...
if ((handle = (IALG_Handle)ALG_create (
(IALG_Fxns *) &H264HPDEC_CIT_IH264HPDEC,
(IALG_Handle) NULL, (IALG_Params *) &(params.viddecParams))) == NULL)
{
printf( "\nFailed to Create Instance... Exiting for this configuration..");
continue;
}
...
handle->fxns->algActivate(handle);
handle->fxns->algDeactivate(handle);
if(DNUM==CORE_TEAM[0])
{
/* Initialize all buffers to be FREE */
/* Get the first free buffer */
ret_val = BUFFMGR_Init
(
status.viddecStatus.bufInfo.minNumOutBufs,
status.viddecStatus.bufInfo.minOutBufSize
);
if (ret_val)
{
fprintf (stdout,"\nMemory could not get allocated for output
buffers\n");
break;
}
}
...
...
3-10
Sample Usage
(IVIDDEC2_DynamicParams *)&dynamicParams,
(IVIDDEC2_Status *)&status);
H264VDEC_mcore_sync(DNUM,IH264_SWBARR5, ncores);
if(DNUM!=CORE_TEAM[0])
{
/*Slave core - Check for end of frames*/
if(multiCoreSync[0])
break;
}
...
...
BUFFMGR_ReleaseBuffer((XDAS_UInt32 *)outArgs.viddecOutArgs.freeBufID);
...
H264VDEC_mcore_sync(DNUM,IH264_SWBARR5, ncores);
if(multiCoreSync[0])
break;
Note:
This sample test application does not depict the actual function parameter or
control code. It shows the basic flow of the code.
3-11
Chapter 4
API Reference
4-1
API Reference
4-2
API Reference
4-3
API Reference
4-4
API Reference
XDM_INSUFFICIENTDATA Bit 10
1 - Insufficient data
0 - Ignore
XDM_CORRUPTEDDATA Bit 11
1 - Data problem/corruption
0 - Ignore
XDM_CORRUPTEDHEADER Bit 12
1 - Header problem/corruption
0 - Ignore
4-5
API Reference
XDM_UNSUPPORTEDINPUT Bit 13
1 - Unsupported
feature/parameter in input
0 - Ignore
XDM_UNSUPPORTEDPARAM Bit 14
1 - Unsupported input
parameter or configuration
0 - Ignore
XDM_FATALERROR Bit 15
1 - Fatal error (stop encoding)
0 - Recoverable error
Note:
The algorithm can set multiple bits to 1 depending on the error condition.
4-6
API Reference
The following table lists the detailed error codes and their values.
4-7
API Reference
4-8
API Reference
4-9
API Reference
4-10
API Reference
4-11
API Reference
4-12
API Reference
of bounds
Minor Errors
4-13
API Reference
LEVEL_INVALID 0xFF
eH264VDEC_TI_Profile PROFILE_INVALID -1
4-14
API Reference
MAXSTRUCT
IVIDMC_TASK_SLAVE_1 2
IVIDMC_TASK_SLAVE_2 3
IVIDMC_TASK_SLAVE_3 4
IVIDMC_TASK_SLAVE_4 5
IVIDMC_TASK_SLAVE_5 6
IVIDMC_TASK_SLAVE_6 7
4-15
API Reference
IVIDMC_TASK_SLAVE_7 8
IVIDMC_TASK_SLAVE_8 9
4-16
API Reference
XDM1_BufDesc
XDM_SingleBufDesc
XDM1_SingleBufDesc
XDM_AlgBufInfo
IVIDEO1_BufDesc
IVIDDEC2_Fxns
IVIDDEC2_Params
IVIDDEC2_DynamicParams
IVIDDEC2_InArgs
IVIDDEC2_Status
IVIDDEC2_OutArgs
4-17
API Reference
4.2.1.1 XDM_BufDesc
║ Description
This structure defines the buffer descriptor for input and output buffers.
║ Fields
4.2.1.2 XDM1_BufDesc
║ Description
This structure defines the buffer descriptor for input and output buffers.
║ Fields
4.2.1.3 XDM_SingleBufDesc
║ Description
This structure defines the buffer descriptor for single input and output
buffers.
║ Fields
4.2.1.4 XDM1_SingleBufDesc
║ Description
4-18
API Reference
This structure defines the buffer descriptor for single input and output
buffers.
║ Fields
accessMask XDAS_Int32 Output If the buffer was not accessed by the algorithm
processor (For example, it was filled by DMA or other
hardware accelerator that does not write through the
algorithm CPU), then no bits in this mask should be
set.
4.2.1.5 XDM_AlgBufInfo
║ Description
This structure defines the buffer information descriptor for input and output
buffers. This structure is filled when you invoke the control() function
with the XDM_GETBUFINFO command.
║ Fields
minInBufSize[XDM_ XDAS_Int32 Output Size in bytes required for each input buffer
MAX_IO_BUFFERS]
minOutBufSize[XDM XDAS_Int32 Output Size in bytes required for each output buffer
_MAX_IO_BUFFERS]
4-19
API Reference
Note:
These are the maximum buffer sizes but you can reconfigure
depending on the format of the bit-stream.
4.2.1.6 IVIDEO1_BufDesc
║ Description
This structure defines the buffer descriptor for input and output buffers.
║ Fields
4-20
API Reference
Should be repeated
Note:
IVIDEO_MAX_YUV_BUFFERS:
4.2.1.7 IVIDDEC2_Fxns
║ Description
This structure contains pointers to all the XDAIS and XDM interface
functions.
║ Fields
4-21
API Reference
4.2.1.8 IVIDDEC2_Params
║ Description
║ Fields
Size XDAS_Int32 Input Size of the basic or extended (if being used)
data structure in bytes.
ForceChromaForma XDAS_Int32 Input Sets the output to the specified format. Only 420
t semi-planar format supported currently. Set
forceChromaFormat to XDM_YUV_420SP.
Note:
H.264 Decoder does not use the maxFrameRate and maxBitRate fields for
creating the algorithm instance. In the current implementation,
maxFrameRate is set to 1000 * 30, and maxBitRate is set to 10000000.
Maximum video height and width supported are 576 pixels and 720 pixels
respectively.
dataEndianness field should be set to XDM_BYTE.
4-22
API Reference
4.2.1.9 IVIDDEC2_DynamicParams
║ Description
size XDAS_Int3 Input Size of the basic or extended (if being used) data
2 structure in bytes.
newFrameFlag XDAS_Int3 Input Flag to indicate that the algorithm should start a new
2 frame. Valid values are XDAS_TRUE and
XDAS_FALSE. This is useful for error recovery, for
example, when the end of frame cannot be detected
by the codec but is known to the application.
mbDataFlag XDAS_Int3 Input Flag to indicate that the algorithm should generate MB
2 Data in addition to decoding the data.
Note:
H264 Decoder does not support decodeHeader field. It is set to
the default value as zero.
H.264 Decoder does not use displayWidth field. It is set to the
default value as zero.
frameOrder is a set to the enum value of
IVIDDEC2_DISPLAY_ORDER.
4-23
API Reference
IVIDEO_NO_SKIP.
H264 Decoder does not support newFrameFlag and mbDataFlag
in this version. Their values are set as zero.
4.2.1.10 IVIDDEC2_InArgs
║ Description
Size XDAS_Int32 Input Size of the basic or extended (if being used) data
structure in bytes.
numBytes XDAS_Int32 Input Size of input data (in bytes) provided to the algorithm for
decoding
inputID XDAS_Int32 Input Application passes this ID to algorithm and decoder will
attach this ID to the corresponding output frames. This is
useful in case of re-ordering (for example, B frames). If
there is no re-ordering, outputID field in the
IVIDDEC2_OutArgs data structure will be same as
inputID field.
Note:
4.2.1.11 IVIDDEC2_Status
║ Description
4-24
API Reference
4.2.1.12 IVIDDEC2_OutArgs
║ Description
4-25
API Reference
size XDAS_Int3 Input Size of the basic or extended (if being used) data
2 structure in bytes.
decodedBufs IVIDEO1_B Output The decoder fills this structure with buffer pointers to
ufDesc the decoded frame. Related information fields for the
decoded frame are also populated.
When frame decoding is not complete, as indicated
by outBufsInUseFlag, the frame data in this
structure will be incomplete. However, the algorithm
will provide incomplete decoded frame data in case
application may choose to use it for error recovery
purposes.
mbDataBuf XDM1_Sing Output The decoder populates the last buffer among the
leBufDesc buffers supplied within outBufs->bufs[] with the
decoded MB data generated by the Decoder module.
outBufsInUseFla XDAS_Int3 Output Flag to indicate that the outBufs provided with the
g 2 process() call are in use. No outBufs are
required to be supplied with the next process()
call.
Note:
OutputMbDataID and mbDataBuf ID are not used in this version
of the decoder, as dumping of MB data is not supported.
XDM_MAX_IO_BUFFERS - Maximum number of I/O buffers set to 20.
4-26
API Reference
IH264VDEC_Params
IH264VDEC_DynamicParams
IH264VDEC_InArgs
IH264VDEC_Status
IH264VDEC_OutArgs
║ Description
4.2.2.1.1 IVIDMC_t
║ Description
*swbarr XDAS_Void Input Codec generates call out and sends number
(swbarr_cnt) of cores from the team (ncores) that
need to reach the software barrier, before
execution proceeds. It is possible to have multiple
software barriers in the system present
4-27
API Reference
ncores XDAS_Int32 Input Number of cores in the team, i.e., cores running
together for processing same stream
4.2.2.2 IH264VDEC_DynamicParams
║ Description
4-28
API Reference
4.2.2.3 IH264VDEC_InArgs
║ Description
This structure defines the run-time input arguments for the H.264 Decoder
instance object.
║ Fields
4.2.2.4 IH264VDEC_Status
║ Description
This structure defines parameters that describe the status of the H.264
Decoder and any other implementation specific parameters. The status
parameters are defined in the XDM data structure, IVIDDEC2_Status.
║ Fields
full_frame_dec XDAS_UInt32 Output The flag indicates whether the full frame is
oded decoded without any errors.
4-29
API Reference
Note:
Following is the decoder behavior for supporting frame size being non-
multiple of 16 through frame cropping:
The decoder populates the output buffers at a resolution equal to the
size of the cropped image. Also, it returns status parameters for
picture resolution (outputHeight and outputWidth) as equal to
the cropped values.
If the displayWidth (element in DynamicParams) is lesser than
the cropped image width, then the decoder writes at a width equal to
the display width.
4.2.2.5 IH264VDEC_OutArgs
║ Description
This structure defines the run - time output arguments for the H.264
Decoder instance object.
║ Fields
display_frame_ XDAS_Int32 Output This flag, when set to one indicates that the
skip_flag frame returned in this call was skipped and
hence nothing was written into this buffer.
4-30
API Reference
disp_top_field XDAS_Int32 Output This flag indicates if the top or bottom field
_first should be displayed first (Refer to Appendix
C for details).
4.2.2.5.1 sSeiVuiParams_t
║ Description
Note:
A brief description of SEI and VUI contents are given below. For details
see H.264 standard (ISO/IEC 14496-10:2005 (E) Rec.- Information
technology – Coding of audio-visual objects – H.264 (E) ITU-T
Recommendation.)
4.2.2.5.2 sSeiMessages_t
║ Description
4-31
API Reference
║ Fields
4-32
API Reference
4.2.2.5.3 sFullFrameFreezeRepetition_t
║ Description
4.2.2.5.4 sFullFrameFreezeRelease_t
║ Description
full_frame_freeze unsigned char Output Cancels the effect of any full-frame freeze
_ SEI message sent with pictures that precede
release_flag the current picture in output order.
4-33
API Reference
4.2.2.5.5 sProgRefineStart_t
║ Description
4.2.2.5.6 sProgRefineEnd_t
║ Description
4-34
API Reference
4.2.2.5.7 sRecoveryPointInfo_t
║ Description
4.2.2.5.8 sPictureTiming_t
║ Description
Structure contains timing information such as DPB delay and CPD delay.
║ Fields
4-35
API Reference
cpb_removal_delay unsigned int Output Specifies how many clock ticks to wait
after removal from the CPB of the access
unit associated with the most recent
buffering period SEI message before
removing from the buffer the access unit
data associated with the picture timing SEI
message.
dpb_output_delay unsigned int Output Used to compute the DPB output time of
the picture.
4-36
API Reference
4.2.2.5.9 sVSP_t
║ Description
This structure defines parameters that describe the values of various video
usability parameters that come as a part of Sequence Parameter Set in the
bit-stream.
║ Fields
aspect_ratio_info_p unsigned int Output Indicates whether aspect ratio idc is present
resent_flag or not.
overscan_appropriat unsigned int Output Cropped decoded pictures are suitable for
e_flag display or not.
4-37
API Reference
video_full_range_fl unsigned int Output Black level, luma and chroma ranges. It
ag should be used for BT.601 compliance
matrix_coefficients unsigned int Output Matrix coefficients for deriving Luma and
chroma data from RGB components.
fixed_frame_rate_fl unsigned int Output It tells how the temporal distance between
ag HRD output times of any two output pictures
is constrained
4-38
API Reference
motion_vectors_over unsigned int Output Specifies whether motion vectors can point
_pic_boundaries_fla to regions outside the picture boundaries
g
max_dec_frame_buffe unsigned int Output Size of HRD decoded buffer (DPB) in terms
ring of frame buffers
4.2.2.5.10 sHrdParm_t
║ Description
This structure defines the HRD parameters that come in a H264 bit-stream
as a part of video usability Information.
║ Fields
4-39
API Reference
th
cpb_size_value[i] unsigned int Output Maximum CPB size for the i CPB
th
vbr_cbr_flag[i] unsigned int Output Specifies the i CPB is operated in Constant
Bit-rate mode or variable bit-rate mode
Note:
4-40
API Reference
4-41
API Reference
Initialization – algInit()
Control – control()
Termination – algFree()
control() can be called any time after calling the algInit() API.
4-42
API Reference
XDAS_Int32 algNumAlloc(Void);
║ Arguments
Void
║ Return Value
For more details, see TMS320 DSP Algorithm Standard API Reference.
║ See Also
algAlloc()
4-43
API Reference
║ Name
For more details, see TMS320 DSP Algorithm Standard API Reference.
║ See Also
algNumAlloc(), algFree()
4-44
API Reference
The second argument is a table of memory records that describe the base
address, size, alignment, type, and memory space of all buffers allocated
for an algorithm instance. The number of initialized records is identical to
the number returned by a prior call to algAlloc().
For more details, see TMS320 DSP Algorithm Standard API Reference.
║ See Also
algAlloc(), algMoved()
4-45
API Reference
4-46
API Reference
For more details, see TMS320 DSP Algorithm Standard API Reference.
(literature number SPRU360).
║ See Also
algDeactivate()
4-47
API Reference
║ Name
This function does the basic H264 video decoding. The first argument to
process() is a handle to the H264 Decoder instance object.
The second and third arguments are pointers to the input and output buffer
descriptor data structures respectively (see XDM1_BufDesc and
XDM_BufDesc data structure for details).
Note:
Prior to each decode call, ensure that all fields are set as described
in XDM1_BufDesc, XDM_BufDesc, and IVIDDEC2_InArgs structures.
The algorithm may also modify the output buffer pointers. The return value
is IALG_EOK for success or IALG_EFAIL in case of failure. The
extendedError field of the IVIDDEC2_Status structure contains error
conditions flagged by the algorithm. This structure can be populated by a
calling Control API using XDM_GETSTATUS command.
4-48
API Reference
║ See Also
control()
║ Name
For more details, see TMS320 DSP Algorithm Standard API Reference.
║ See Also
algActivate()
║ Name
4-49
API Reference
The second argument is a table of memory records that describe the base
address, size, alignment, type, and memory space of all buffers previously
allocated for the algorithm instance.
For more details, see TMS320 DSP Algorithm Standard API Reference
(literature number SPRU360).
║ See Also
algAlloc()
║ Name
*swbarr() – call out to core that need to reach the software barrier
║ Synopsis
XDAS_Int32 coreID;
IVIDMC_SWBARR swbarr_id;
XDAS_UInt32 swbarr_cnt;
║ Return Value
XDAS_Void
║ Description
Codec generates call out and sends number (swbarr_count) of cores from
the team (ncores) that need to reach the software barrier, before execution
proceeds. It is possible to have multiple software barriers in the system
present simultaneously. This is why codec needs to identify barrier with
swbarr_id parameter. Core needs to provide correct value for swbarr_cnt
or 0.
║ See Also
**shmmap(), *shmunmap()
║ Name
4-50
API Reference
XDAS_Int32 coreID;
IVIDMC_SHMEMKEY shmem_key;
XDAS_Int32 shmem_size;
IVIDMC_SHMEM_ATTRS attr;
XDAS_Int32 alignment;
║ Return Value
XDAS_Int32 *
║ Description
║ Name
XDAS_Int32 coreID;
IVIDMC_SHMEMKEY shmem_key;
XDAS_Int32 *shmem_base;
║ Return Value
XDAS_Int32
║ Description
4-51
API Reference
║ Name
║ Synopsis
XDAS_Int32 coreID;
IVIDMC_SHMEMKEY shmem_key;
XDAS_Int32 *shmem_base;
║ Return Value
XDAS_Int32
║ Description
4-50