CABAC encoding starts after encoding slice headers with CAVLC.
Call CABACInit_H264 or CABACInitAlloc_H264 to start CABAC encoding. The pBitStream parameter of these functions should point to the same bit stream where slice headers were written. After calling these functions, do not write to the bit stream directly until the encoding with CABAC is finished.
Use the low-level CABACEncodeBin_H264 or CABACEncodeBinBypass_H264 functions for encoding all data elements but residual blocks.
Use the high-level CABACEncodeResidualBlock_H264 function for encoding residual blocks to minimize overhead on a function call.
Use CABACTerminateSlice_H264 to finish encoding of the slice. After calling this function, the bit stream contains all the CABAC-encoded data.
If any function fails with the ippStsH264BufferFullErr error, allocate a larger piece of memory for the bit stream, copy all the content of a bit stream to the place, call CABACSetStream_H264, and then call the failed function again.
The CABACGetStreamSize_H264 function provides the number of bits that CABAC produces for this bit stream (for example, for the purpose of rate-control), however it is not guaranteed that these bits are written to the bit stream until CABACTerminateSlice_H264 is called.
The CABACGetContexts_H264 function retrieves a specified range of CABAC contexts. The full range contains 460 contexts (see Table 9-11 of H.264 standard ([ITUH264])). You can use a retrieved context to estimate the number of bits needed for coding a single macroblock by a specific coding algorithm. This function does not determine the estimating method and does not specify the coding algorithm.
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.