Once the uncompressed audio data has been divided into blocks, this
cannam@86: function is called on each block. It looks up the encoding mode and
cannam@86: dispatches the block to the forward transform provided by that mode.
cannam@86:
cannam@86:
When using a basic encoding mode, with no bitrate management,
cannam@86: an ogg_packet pointer can be given, and the coded block is returned
cannam@86: directly through that structure and can be placed in the output stream.
cannam@86:
cannam@86:
Otherwise, NULL should be passed for the ogg_packet pointer. In
cannam@86: that case, after the transform has been applied, the block must passed
cannam@86: to vorbis_bitrate_addblock() for further coding. This method works with
cannam@86: both basic and managed encoding modes, so it's recommended for new code.
cannam@86:
cannam@86:
cannam@86:
cannam@86:
cannam@86:
cannam@86:
cannam@86: extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op);
cannam@86:
cannam@86:
cannam@86:
cannam@86:
cannam@86:
cannam@86:
Parameters
cannam@86:
cannam@86:
vb
cannam@86:
Pointer to the vorbis_block to be encoded.
cannam@86:
op
cannam@86:
Optional pointer to an ogg_packet. This is normally NULL,
cannam@86: and the final output is obtained by passing vb though the
cannam@86: vorbis_bitrate_*() interface to perform further refinement.
cannam@86: However, when not using a bitrate managed encoding mode, it
cannam@86: is possible to skip that step by providing an ogg_packet pointer
cannam@86: here, obtaining the compressed data directly.
cannam@86:
cannam@86:
cannam@86:
cannam@86:
Return Values
cannam@86:
cannam@86:
0 for success
cannam@86:
negative values for failure:
cannam@86:
cannam@86:
OV_EINVAL - Invalid request; a non-NULL value was passed for op when the encoder is using a bitrate managed mode.
cannam@86:
OV_EFAULT - Internal fault; indicates a bug or memory corruption.
cannam@86:
OV_EIMPL - Unimplemented; not supported by this version of the library.