H.264 Data Definitions

Parameter Settings

This section describes the data that is used by callback functions as well as when parameters are set.

The following table shows the ID and meaning of each parameter.

Parameter IDs

ID Value Description
H264DEC_PARAM_ID_FPTR_OUTPUT 0x00000001 Sets a callback function. Specify a function pointer as the third argument to H264DECInitParam.
H264DEC_PARAM_ID_OUTPUT_PER_FRAME 0x20000002 Sets the output mode for the decoding results. Specify a u8 pointer as the third argument to H264DECSetParam. The value indicated by this pointer has the following meanings.
0: Buffering mode
Any nonzero value: Sequential output mode.
H264DEC_PARAM_ID_USER_MEMORY 0x70000001 Sets user memory. Specify a u8 pointer as the third argument to H264DECSetParam. The value indicated by this pointer has the following meanings.
Specify a pointer to a pointer to the user memory that will be used within the callback function as the third argument to H264DECSetParam.

Error Codes

Nonzero values returned by functions of this API (except for H264DECExecute) contain error information. The following table shows the error codes.

ID Value Error Comments
H264DEC_ERR_STREAM 0x01000000 Stream error. It is possible to advance to the next stream data.
H264DEC_ERR_PROFILE 0x01080000 Stream error (Unsupported profile). It is possible to advance to the next stream data.
H264DEC_ERR_NODATA 0x01100000 Stream error (Stream not found). It is possible to advance to the next stream data
H264DEC_ERR_NOTSUPPORTED 0x01180000 Stream error (Unsupported resolution). It is possible to advance to the next stream data.
H264DEC_ERR_PARAM 0x01010000 Argument error. Call the function again using the correct arguments.
H264DEC_ERR_OUTOFMEMORY 0x01020000 Not enough memory while decoding. Can be recalled with correct parameters, settings.
H264DEC_ERR_INTERNAL 0x01030000 Internal error. Processing cannot continue. You need to initialize the library.
H264DEC_ERR_SEQUENCE 0x01050000 Out-of-order API function call error. Fix the order in which you make API function calls.
H264DEC_ERR_MEMSEGMENT 0x01060000 Memory boundary error If this error occurs during execution H264DECExecute processing because the memory is not appropriate for frame memory, processing can continue by using appropriate frame memory. (Execute again from H264DECSetBitstream.)
H264DEC_ERR_MAX_SIZE 0x01070000 Exceeded working memory allocated region (including when the stream level is not set correctly). Processing cannot continue. Initialization is required. When this error occurs during execution H264DECExecute processing, set an appropriate memory size equal to the working memory, and execute from H264DECInitParam.
H264DEC_ERR_BUFFEREMPTY 0x00080000 No flush frame. Processing can continue. At the time the stream flushing instruction H264DECFlush was processed, the decoding result was not held in the library, so the flush was not done.

Definition Values

The definition values that can be used in this library are shown in the following table.

Usable Definition Values

ID Value Description and Usage
BUFFERING_OUTPUT_PER_FRAME 0x00000000 Buffering Mode.
This value is used when setting the decoding result output mode in the library parameter settings H264DECSetParam.
UNBUFFERING_OUTPUT_PER_FRAME 0x00000001 Sequential Output Mode.
This value is used when setting the decoding result output mode in the library parameter settings H264DECSetParam.
H264DEC_ERR_FM_STAT 0x000000FF This mask value is used to get the lower 8 bits of the return value from running the library H264DECExecute.
H264DEC_ERR_USE_FM 0x00000080 This mask value is used to get the decode flag (bit [7]) included in the lower 8 bits of the return value from running the library H264DECExecute.
H264_BASELINE_PROFILE 66 Constrained Baseline Profile.
This value is passed to the first parameter (for profile ID) of the utility function H264DECMemoryRequirement.
H264_MAIN_PROFILE 77 Main Profile.
This value is passed to the first parameter (for profile ID) of the utility function H264DECMemoryRequirement.
H264_HIGH_PROFILE 100 High Profile.
This value is passed to the first parameter (for profile ID) of the utility function H264DECMemoryRequirement.
H264DEC_BUFFER_ALIGNMENT 256 The number of bytes that marks the boundary of the starting address.
H264DEC_ALIGN_PITCH_IN_PIXELS(PitchInPixels) A macro to set the frame memory-pitch alignment to 256 bytes.

Callback Functions

Decoding results from the library can be retrieved within a callback function. The user applications must define and implement the callback function (use parameter settings to configure the callback function). Define callback functions using the following format.

s32 Callback(void *ptr);

Access the decoded image data by casting ptr to a pointer to an H264DECOutput structure (described in Library Output). The library output data, and within it, the decoded output data and VUI output, are valid until the callback function completes execution. To use this output outside the callback function, it must be explicitly duplicated within the callback function. However, the location indicated by Result within the decoded data output (the actual decoded output image data) is maintained after the callback function completes, so only the pointer in Result needs to be duplicated. For specific details on how to use callbacks, see the source code of the sample applications.

This library invokes the defined callback function whenever it outputs an image. For information on when the library invokes callback functions, see Getting Decoding Results. This library does not overwrite the location indicated by Result after the callback function is invoked.

Use 'pan and scan' to adjust images, and refer to VUI (voice-user interface), as necessary, when you display the decoding results. Use 0 as this function's return value.

See Also

H264DEC API

Revision History

2014/07/25 Initial version.


CONFIDENTIAL