ref_iface_IVDXVideoDecoder_GetDecodePadding - shekh/VirtualDub2 GitHub Wiki

VirtualDub Plugin SDK 1.2

IVDXVideoDecoder interface

IVDXVideoDecoder:: GetDecodePadding

Returns the amount of padding at the end of samples required by the decoder.

uint32 GetDecodePadding();

Thread safety

This method is not thread-safe.

Errors

Errors may not be returned from this function (see SetError()).

Return value

The number of bytes of padding to be added to the sample buffer beyond the data length. Generally, this should be a small number, around 16 bytes or less.

Remarks

Padding at the end of a sample makes it easier for some types of decoders, especially those that deal with bit encodings. For instance, it is common for decoders that read variable length codes (VLC) to read up to three bytes beyond the end of the coded stream. A small amount of padding can make such decoders more efficient by not requiring onerous bounds checking code. For instance, a 1024 byte sample would arrive at the bottom of a 1028 byte buffer if GetDecodePadding() returned 4. However, some checking must still be implemented to avoid crashing on bad data.

Every sample that is buffered in the host is enlarged by this amount, so it is best not to request large amounts of padding. Requesting 1K of padding for each sample, for instance, could result in a substantial amount of extra memory being allocated.

The amount of padding must always be the same for a particular decoder object.


Copyright (C) 2007-2012 Avery Lee.

⚠️ **GitHub.com Fallback** ⚠️