Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dmG726Encode(3dm) — IRIX 6.5.3f

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

dmG726EncoderCreate(3dm)

dmG726EncoderSetParams(3dm)

dmG726EncoderDestroy(3dm)

dmG726Decode(3dm)



dmG726Encode(3dm)                                            dmG726Encode(3dm)



NAME
     dmG726Encode - implements ITU (International Telecommunication Union)
     Recommendation G.726 ADPCM compression for input of 64 kbit/s A-law, mu-
     law, or linear data and output of compressed bit stream of 40, 32 ,24, or
     16 kbit/s.  G.726 replaced G.721 and G.723.


SYNOPSIS
     #include <dmedia/dmaudioutil.h>

     DMstatus dmG726Encode(DMG726encoder handle,
                           void *ibuf,
                      unsigned char *obuf
                           int numSamples)


PARAMETER
     handle    DMG726encoder structure, created by dmG726EncoderCreate(3dm),
               specifies the signal processing parameters.


     ibuf      pointer to input sample data buffer, an array of short (16
               bits) for linear input or unsigned char for A-law or mu-law
               input.  For linear input, samples are assumed to be two's
               complement.  Data buffer must be a multiple (the same multiple
               as that of output bitstrem buffer) of 4, 8, 2, or 8 for
               operations at 16, 24, 32, or 40 kbit/s respectively.  This
               assumes the sampling rate of 8 kHz.


     obuf      pointer to output compressed data buffer, an array of bytes.
               The data format is unsigned char (8-bit).  The output bitstrem
               buffer consists of a multiple of 1, 3, 1, or 5 bytes, for
               operations at 16, 24, 32, or 40 kbit/s respectively.


     numSamples
               number of samples to be processed. it must always be a multiple
               of 4, 8, 2, or 8 for operations at 16, 24, 32, or 40 kbit/s
               respectively.


RETURNED VALUE
     Returns DMFAILURE or DMSUCCESS.


DESCRIPTION
     dmG726Encode(3dm) implements ITU G726 compression.  G.726 compression
     compresses one input sample to 2, 3, 4, or 5 bits for 16, 24, 32, or 40
     kbit/s operations respectively. 16, 24, 32, or 40 kbit/s operation is
     indicated by setting parameter DMAUDIOBITRATE to DMG72616KBITS,
     DMG72624KBITS, DMG72632KBITS, or DMG72640KBITS using DMparams



                                                                        Page 1





dmG726Encode(3dm)                                            dmG726Encode(3dm)



     and passed to dmG726EncoderSetParams(3dm).  Input format is indicated by
     setting DMG726NATIVEFORMAT to DMG726ULAW, DMG726ALAW, or
     DMG726LINEARPCM, respectively for inputting of mu-law, A-law, or
     linear PCM data, using DMparams and passed to
     dmG726EncoderSetParams(3dm).  If input format is DMG726LINEARPCM, the
     PCM data type will be short.  Otherwise, the PCM data type will be
     unsigned char.  Therefore, the inbuf is void in the function prototyping.


     G726 compression uses a linear prediction scheme.  This means that the
     compressed bits, which carrying compressed information, are interrelated
     or interdependent.  If a application calls afSeekFrame(3dm) 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 dmG726Decode(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.


NOTE
     G.726 algorithm was developed for sampling rate of 8 kHz, but could be
     used from 8 kHz to 48 kHz.


SEE ALSO
     dmG726EncoderCreate(3dm), dmG726EncoderSetParams(3dm),
     dmG726EncoderDestroy(3dm), dmG726Decode(3dm), ITU (International
     Telecommunication Union) Recommendation G.726.




















                                                                        Page 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026