*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> dmedia/dmDVIAudioEncode (3d)              


dmDVIAudioEncode(3dm)					 dmDVIAudioEncode(3dm)

NAME    [Toc]    [Back]

     dmDVIAudioEncode -	compress audio data using the IMA (Interactive
     Multimedia	Association) Recommended ADPCM compression, based on Intel's
     DVI algorithm.

SYNOPSIS    [Toc]    [Back]

     #include <dmedia/dm_audioutil.h>

     DMstatus dmDVIAudioEncode(DMDVIaudioencoder handle,
			       short *ibuf, unsigned char *obuf,
			       int nsamples)

PARAMETER    [Toc]    [Back]

     handle    DMDVIaudioencoder structure, created by a previous call to
	       dmDVIAudioEncoderCreate(3dm).  It contains the state associated
	       with the	encoder.

     ibuf      pointer to input	sample data buffer.  The data format is	short
	       (16-bit).  The samples are assumed to be	two's complement.
	       Sampling	rate could range from 8	kHz to 48 kHz.

     obuf      pointer to output compressed data buffer. The data format is
	       unsigned	char (8-bit).

     nsamples  The number of samples to	be processed.  For the 4:1 algorithm
	       (the only one currently supported), the value of	nsamples
	       passed to the DVI encode/decode routines	must always be a
	       multiple	of 2.

RETURNED VALUE    [Toc]    [Back]

     Returns DM_FAILURE	or DM_SUCCESS.

DESCRIPTION    [Toc]    [Back]

     dmDVIAudioEncode(3dm) implements Intel, Inc.'s DVI	IMA4:1 ADPCM
     compression for monaural audio data.

     DVI IMA ADPCM compression exists in two forms, 4 bits per sample (IMA4:1)
     and 3 bits	per sample (IMA3:1).  The compression form may be retrieved
     using dmDVIAudioDecoderGetParams(3dm) via the parameter
     DM_DVI_AUDIO_BITS_PER_SAMPLE.  Its	possible values	are:

     DM_DVI_AUDIO_4BITS_PER_SAMPLE    [Toc]    [Back]
	  4:1 compression.  This is the	only form currently supported by the
	  SGI Digital Media libraries.

									Page 1

dmDVIAudioEncode(3dm)					 dmDVIAudioEncode(3dm)

     DM_DVI_AUDIO_3BITS_PER_SAMPLE    [Toc]    [Back]
	  3:1 compression.  Currently not supported.


     DVI audio compression uses	a linear prediction scheme.  This means	that
     the compressed bits are interrelated or interdependent.  If a application
     seeks to an offset	into the compressed bit	stream file and	then starts
     reading at	that point in the stream and decompresses it via
     dmDVIAudioDecode(3dm), the	interdependency	of the bits at the start point
     is	lost.  The application will initially get back data with a lower
     amplitude than if he had read the same data back during a complete	pass
     over the file from	the beginning.

     In	pure DVI ADPCM data, there is no way to	accurately begin decoding data
     in	the middle of the bit stream file without starting the beginning.  Two
     solutions to this problem have been developed, one	by Intel, Inc. and one
     by	Apple, Inc.  Both involve breaking the compressed data up into blocks,
     each with a small header encapsulating the	information needed to allow
     decoding to begin at any block boundry with no loss of data. WAVE(4) and
     AIFF-C format sound files using IMA DVI compression take advantage	of
     this block	method if you create them using	the Audio File Library.	 In
     addition, a block method compressed stream	may be created using
     dmACConvert(3dm) if it is configured properly.


     Three parameters are needed to configure the DMaudioconverter to allow
     creation of these block streams:

	  Indicates the	number of bytes	of compressed data per block,
	  including the	header.	 Indicates the number of bytes of compressed
	  data per block, including the	header.	 For AIFF-C(4) files, this
	  value	is always 34 * channel_count.  For WAVE(4) files, this value

	  Indicates the	number of frames of uncompressed data contained	in
	  each block.  Indicates the number of frames of uncompressed data
	  contained in each block.  For	AIFF-C(4) files, this value is always
	  64.  For WAVE(4) files, this value varies.

     DM_DVI_AUDIO_BLOCK_TYPE    [Toc]    [Back]
	  This DVI-specific parameter specifies	whether	the data will be
	  compressed using the Intel scheme, the Apple scheme, or no blocking
	  at all (i.e.,	"pure" DVI).  Its possible values are:

	  DM_DVI_AUDIO_BLOCK_TYPE_NONE -- For stream use only.

									Page 2

dmDVIAudioEncode(3dm)					 dmDVIAudioEncode(3dm)

IMPORTANT NOTE    [Toc]    [Back]

     Stereo audio streams and streams with block data cannot be	created	using
     dmDVIAudioEncode()	directly -- you	must use dmACConvert(3dm).  It is
     highly recommended	that the Audio File Library be used for	all to-	and
     from-disk compression and decompression.

SEE ALSO    [Toc]    [Back]

     dmDVIAudioEncoderCreate(3dm), dmDVIAudioEncoderSetParams(3dm),
     dmDVIAudioEncoderDestroy(3dm), dmDVIAudioEncode(3dm), dnACConvert(3dm),
     afWriteFrames(3dm), IMA Recommended Practices for Enhancing Digital Audio
     Compatibility in Multimedia Systems, rev 3.00.

									PPPPaaaaggggeeee 3333
[ Back ]
 Similar pages
Name OS Title
dmMPEG1AudioEncode IRIX Compresses a single block of audio data using MPEG1 audio compression algorithm.
aifccompress IRIX compress the audio data in an AIFF-C file
dmACConvert IRIX convert audio data format, sampling rate and compression
macebus OpenBSD Multimedia, Audio and Communications Engine I/O ASIC
macepcibr OpenBSD Multimedia, Audio and Communications Engine I/O ASIC
clAddAlgorithm IRIX Add a video or audio compression algorithm to the Compression Library
clAddParam IRIX Add a video or audio compression parameter to the Compression Library
AFinitcompression IRIX configure the audio compression type and parameters in an AFfilesetup structure for an audio track
cl_cosmo IRIX Cosmo Compress JPEG Accelerator (in the Compression Library)
clOpenCompressor IRIX Compress a video or audio stream
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service