/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1992-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _MULTIMEDIA_RESAMPLE_H
#define _MULTIMEDIA_RESAMPLE_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* To convert the sampling rate of fi of input signal to fo of output signal,
* the least common multiple fm = L * fi = M * fo needs to be derived first.
* Then the input signal is
* 1) up-sampled to fm by inserting (L - 1) zero-valued samples after each
* input sample,
* 2) low-pass filtered to half of the lower of fi and fo, and
* 3) down-sampled to fo by saving one out of every M samples.
*
* The low-pass filter is implemented with an FIR filter which is a truncated
* ideal low pass filter whose order is dependent on its bandwidth.
*
* Refer to Fir.h for explanations of filter() and flush().
*
*/
#include <Fir.h>
#ifdef __cplusplus
extern "C" {
#endif
// if fi is a multiple of fo, LP filtering followed by down_sampling
int decimate_flush(short *);
// if fo is a multiple of fi, up-sampling followed by LP filtering
int interpolate_flush(short *);
virtual int getFlushSize(void);
};
#ifdef __cplusplus
}
#endif
#endif /* !_MULTIMEDIA_RESAMPLE_H */