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

  man pages->IRIX man pages -> dmedia/dmG722Encode (3d)              
Title
Content
Arch
Section
 

Contents


dmG722Encode(3dm)					     dmG722Encode(3dm)


NAME    [Toc]    [Back]

     dmG722Encode - implements the ITU (International Telecommunication	Union)
     Recommendation G.722 compression.

SYNOPSIS    [Toc]    [Back]

     #include <dmedia/dm_audioutil.h>

     DMstatus dmG722Encode(DMG722encoder handle,
		       short *ibuf, unsigned char *obuf, int nsamples)

PARAMETER    [Toc]    [Back]

     handle    DMG722encoder structure,	created	by dmG722EncoderCreate(3dm),
	       specifies the signal processing parameters.


     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 must be 16	kHz or less.


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


     nsamples  number of samples in the	input buffer to	be processed. the
	       value of	nsamples passed	to the G.722 encode/decode routines
	       must always be a	multiple of 2.	It will	fail if	nsamples
	       exceeds the the maximum value specified when the	DMG722encoder
	       was created.

RETURNED VALUE    [Toc]    [Back]

     Returns DM_FAILURE	or DM_SUCCESS.


DESCRIPTION    [Toc]    [Back]

     dmG722Encode(3dm) implements the ITU Recommendation G.722 compression.
     If	sampling rate is less than 16 kHz, the algorithm still works, except
     the upper bits contains less useful information.


     dmG722Encode(3dm) algorithm uses bandpass filter operations that convolve
     past input	samples	with a filter M-coefficient array. The linear phase
     filter has	a constant time	delay of G = (M-1)/2 samples.
     dmG722Decode(3dm) algorithm also uses bandpass filter operations.	The
     total delay for operating dmG722Encode(3dm) and dmG722Decode(3dm) will be
     2*G = M-1 samples.	This constant is _AU_G722_QMF_DELAY, which is 23.





									Page 1






dmG722Encode(3dm)					     dmG722Encode(3dm)



     In	real time operation, bandpass filtering	simply delays the output by 23
     samples. In file conversion expecting N samples in	and out, the output
     signal is offset by 23 samples from the first sample.  The	application
     may want to discard the first 23 samples returned in output date buffer
     from dmG722Decode.	 The application may also want to flush	out an
     additional	23 samples from	dmG722Encode after feeding in all the input
     data to be	compressed.  This flushing operation is	performed by calling
     dmG722Encode with a value nsamples	= 23 (the corresponding	inbuf will
     typically be bzero'd).


     ITU Recommendation	G.722 compression also uses a linear prediction
     scheme.  This means that the compressed bits, which carrying compressed
     information, are interrelated or interdependent.  If a application	calls
     afSeekFrame() to an offset	into the compressed bit	stream file and	then
     starts reading bits in the	middle of the bit stream and decompress	them
     with dmG722Decode(3dm), the interdependency of the	bits at	the cutting
     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.


     There is no way to	exactly	recreate the decoded data in the middle	of the
     bit stream	file without going all the way back to the beginning.
     However, with a "preroll" value to	read ahead a portion of	the compressed
     file, application can compensate for the amplitude	problem.  We recommend
     2 second "preroll".  The application may also consider adding extra 23
     samples for "preroll" for compensation of the filter delays encountered
     in	the encoding and decoding processes, as	we discussed above.

NOTE    [Toc]    [Back]

     G.722 algorithm was developed for sampling	rate of	16 kHz.

SEE ALSO    [Toc]    [Back]

      
      
     dmG722EncoderCreate(3dm), dmG722EncoderDestroy(3dm), dmG722Decode(3dm),
     ITU Recommendation	G.722.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
dmG722Decode IRIX implements the ITU (International Telecommunication Union) Recommendation G.722 decompression.
dmG726Decode IRIX implements ITU (International Telecommunication Union) Recommendation G.726 ADPCM decompression for input comp
dmG728Encode IRIX implements the ITU (International Telecommunication Union)
dmG728Decode IRIX implements the ITU (International Telecommunication Union)
dmG726Encode IRIX implements ITU (International Telecommunication Union)
clAddParam IRIX Add a video or audio compression parameter to the Compression Library
clAddAlgorithm IRIX Add a video or audio compression algorithm to the Compression Library
mount_union OpenBSD mount union filesystems
mount_unionfs FreeBSD mount union file systems
cs_oid_set_union Tru64 create an new object identifier (OID) set that is an union of two existingsets.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service