dmMPEG1AudioEncoderSetParams(3dm)
dmMPEG1AudioEncoderSetParams, dmMPEG1AudioDecoderSetParams, dmMPEG1AudioEncoderGetParams, dmMPEG1AudioDecoderGetParams - set and query MPEG1 audio encoder/decoder parameter values.
As shipped in IRIX 6.5.15. Unchanged since IRIX 6.5.
NAME dmMPEG1AudioEncoderSetParams, dmMPEG1AudioDecoderSetParams, dmMPEG1AudioEncoderGetParams, dmMPEG1AudioDecoderGetParams - set and query MPEG1 audio encoder/decoder parameter values. SYNOPSIS #include <dmedia/dm_params.h> #include <dmedia/dmedia.h> #include <dmedia/dm_audioutil.h> DMstatus dmMPEG1AudioEncoderSetParams(DMMPEG1audioencoder encoder, DMparams *params) DMstatus dmMPEG1AudioDecoderSetParams(DMMPEG1audiodecoder decoder, DMparams *params) DMstatus dmMPEG1AudioEncoderGetParams(DMMPEG1audioencoder encoder, DMparams *params) DMstatus dmMPEG1AudioDecoderGetParams(DMMPEG1audiodecoder decoder, DMparams *params) PARAMETER encoder DMMPEG1audioencoder structure, created by dmMPEG1AudioEncoderCreate(3dm). decoder DMMPEG1audiodecoder structure, created by dmMPEG1AudioDecoderCreate(3dm). params List of parameters for specification. RETURNED VALUE Returns DM_SUCCESS or DM_FAILURE. DESCRIPTION dmMPEG1AudioEncoderSetParams(3dm) or dmMPEG1AudioDecoderSetParams(3dm) sets MPEG1 audio encoder or decoder parameters to user defined values with params. These values will overwrite the default values set by dmMPEG1AudioEncoderCreate(3dm) or dmMPEG1AudioDecoderSetParams(3dm). *params can be NULL, then default values will be used. Unrecognized parameters are ignored. dmMPEG1AudioEncoderSetParams(3dm) or dmMPEG1AudioDecoderSetParams(3dm) also initializes necessary filter coefficients for encoder/decoder so it has to be used before calling dmMPEG1AudioEncode(3dm) or dmMPEG1AudioDecode(3dm). For decoder, user defined parameters usually should be obtained first by using dmMPEG1AudioHeaderGetParams(3dm) from compressed data header. dmMPEG1AudioEncoderGetParams(3dm) or dmMPEG1AudioDecoderGetParams(3dm) obtains MPEG1 audio encoder or decoder parameters. The set of parameters for params are, defined in dmedia/dm_audioutil.h and dmedia/dm_params.h are as follows Parameters for MPEG1 audio encoder and decoder: DM_AUDIO_RATE input/output sampling rate parameter (rate given in Hz). The corresponding values for the rates are doubles. 32000, 44100 (default), and 48000 Hz are supported. DM_AUDIO_FORMAT DM_AUDIO_TWOS_COMPLEMENT indicates the format of each input/ouput audio sample. DM_AUDIO_TWOS_COMPLEMENT is the only value supported. DM_AUDIO_WIDTH DM_AUDIO_WIDTH_16 indicates the width of each input/ouput audio sample. DM_AUDIO_WIDTH_16 is the only value supported. DM_AUDIO_CHANNELS passes the number of channels in the input/output audio data. Integer 1 or 2 (default) are the only values supported. DM_MPEG1_AUDIO_LAYER DM_MPEG1_AUDIO_LAYER1 DM_MPEG1_AUDIO_LAYER2 (default) a flag specifying the basic algorithm to be used. DM_AUDIO_CHANNEL_POLICY DM_AUDIO_STEREO DM_AUDIO_JOINT_STEREO (default) DM_AUDIO_INDEPENDENT chooses how multiple channels should be treaed. DM_AUDIO_STEREO indicates that the channels are part of a single multichannel signal. This includes quadrophonic, etc.; DM_AUDIO_JOINT_STEREO indicates that the algorithm may attempt to exploit redundancy between channels for greater coding gain; DM_AUDIO_INDEPENDENT indicates that the separate channels are unrelated and should be processed separately, such as multilingual sound tracks. DM_AUDIO_BITRATE specifies the desired bitrate for the compressed data, in bits per second. Note that for some schemes such as MPEG's maxrate this is treated as an upper limit, whereas for MPEG's fixrate, this is strictly achieved as a constant rate. The following is a list of valid bitrates for MPEG1 audio: Layer 1: 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000 (default), 288000, 320000, 352000, 384000, 416000, and 448000. Layer 2: 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000 (default), 320000, and 384000. Parameters for MPEG1 audio encoder only: DM_MPEG1_AUDIO_PSYCHOMODEL DM_MPEG1_AUDIO_PSYCHOMODEL1 DM_MPEG1_AUDIO_PSYCHOMODEL2 selects which psychoacoustic model is used to calculate the safe masking thresholds for quantizing noise (the basis of the compression). The psychoacoustic model determines when quantization noise may be safely hidden below signal components. The DM_MPEG1_AUDIO_PSYCHOMODEL1_ALPHA specifies possible float value for MPEG1 audio psychoacoustic model's alpha parameter (only for model 1). Valid value is within (0.0, 2.0]. Default is 2.0. DM_MPEG1_AUDIO_BITRATE_POLICY DM_MPEG1_AUDIO_FIXRATE (default) DM_MPEG1_AUDIO_CONSTANT_QUALITY is a flag to select variants for interpreting DM_AUDIO_BIT_RATE. DM_MPEG1_AUDIO_CONST_QUAL_NMR The argument is the desired mask to noise ratio in dB. Possible float value for this parameter is within (-13.0, 13.0]. Default is 0.0. Positive (negative) values will make quantization noise more (less) audible and result in smaller (larger) compressed files. Parameters for MPEG1 audio decoder only: DM_MPEG1_AUDIO_DECIMATION_SCALE DM_MPEG1_AUDIO_BANDWIDTH_FULL (default) DM_MPEG1_AUDIO_BANDWIDTH_HALF DM_MPEG1_AUDIO_BANDWIDTH_QUARTER specifies the decimation factor applied to reduced complexity of decoding. A value of fraction of DM_MPEG1_AUDIO_BANDWIDTH_HALF or DM_MPEG1_AUDIO_BANDWIDTH_QUARTER indicates that the resynthesized stream should be at one-half or one- quaner of the nominal sampling rate. A value of DM_MPEG1_AUDIO_BANDWIDTH_FULL results in normal behavior. DM_MPEG1_AUDIO_SCALE_FILTERSHAPE DM_MPEG1_AUDIO_DEFAULT_FILTER (default) DM_MPEG1_AUDIO_FILTER_SHAPE1 DM_MPEG1_AUDIO_FILTER_SHAPE2 specifies the filter shape applied to reduced complexity of decoding. A value of DM_MPEG1_AUDIO_BANDWIDTH_FULL results in normal behavior. DM_MPEG1_AUDIO_COMBINE_CHANS_FLAG integer, default value is 0; if set to 1, it overwrites the JOINT_STEREO mode and force decoder to produce single channel output. Parameters for MPEG1 audio query only, using dmMPEG1AudioEncoderGetParams(3dm) or dmMPEG1AudioDecoderGetParams(3dm): DM_AUDIO_CODEC_FRAMES_PER_BLOCK specifies how many sample frames (integer) are put into each compressed data block. For each call to dmMPEG1AudioEncode(3dm), this many new sample frames must be provided; each call to dmMPEG1AudioDecode(3dm), will return this many new sample frames. DM_AUDIO_CODEC_MAX_BYTES_PER_BLOCK indicates the maximum number of bytes (integer) that will comprise a compressed data block (representing frames per block sample frames). For compression, this is the size of the output buffer that must be provided to dmMPEG1AudioEncode(3dm); for decompression, this is the number of compressed bytes that must be queued up for dmMPEG1AudioDecode(3dm) to look at. Note that any particular block can be smaller than this; both dmMPEG1AudioEncode(3dm) and dmMPEG1AudioDecode(3dm) return the actual byte-size of the given block. DM_AUDIO_CODEC_FILTER_DELAY This is the number of sample fames (integer) of delay introduced in compression and decompression processing. These numbers are usually different for compression versus decompression. This is caused by filter operations that convolve a N past input samples with a filter M- coefficient array to create N+M-1 output samples. The filtered signal contains more samples than the unfiltered signal. the output signal is offset by DM_AUDIO_CODEC_FILTER_DELAY samples from the first sample thus omits the last DM_AUDIO_CODEC_FILTER_DELAY samples from the output file. NOTE SEE ALSO dmMPEG1AudioEncoderCreate(3dm), dmMPEG1AudioEncode(3dm), dmMPEG1AudioDecoderCreate(3dm), dmMPEG1AudioDecode(3dm).