linux/drivers/isdn/mISDN/dsp_audio.c

/*
 * Audio support data for mISDN_dsp.
 *
 * Copyright 2002/2003 by Andreas Eversberg ([email protected])
 * Rewritten by Peter
 *
 * This software may be used and distributed according to the terms
 * of the GNU General Public License, incorporated herein by reference.
 *
 */

#include <linux/delay.h>
#include <linux/mISDNif.h>
#include <linux/mISDNdsp.h>
#include <linux/export.h>
#include <linux/bitrev.h>
#include "core.h"
#include "dsp.h"

/* ulaw[unsigned char] -> signed 16-bit */
s32 dsp_audio_ulaw_to_s32[256];
/* alaw[unsigned char] -> signed 16-bit */
s32 dsp_audio_alaw_to_s32[256];

s32 *dsp_audio_law_to_s32;
EXPORT_SYMBOL();

/* signed 16-bit -> law */
u8 dsp_audio_s16_to_law[65536];
EXPORT_SYMBOL();

/* alaw -> ulaw */
u8 dsp_audio_alaw_to_ulaw[256];
/* ulaw -> alaw */
static u8 dsp_audio_ulaw_to_alaw[256];
u8 dsp_silence;


/*****************************************************
 * generate table for conversion of s16 to alaw/ulaw *
 *****************************************************/

#define AMI_MASK

static inline unsigned char linear2alaw(short int linear)
{}


static inline short int alaw2linear(unsigned char alaw)
{}

static inline short int ulaw2linear(unsigned char ulaw)
{}

#define BIAS

static unsigned char linear2ulaw(short sample)
{}

void dsp_audio_generate_law_tables(void)
{}

void
dsp_audio_generate_s2law_table(void)
{}


/*
 * the seven bit sample is the number of every second alaw-sample ordered by
 * aplitude. 0x00 is negative, 0x7f is positive amplitude.
 */
u8 dsp_audio_seven2law[128];
u8 dsp_audio_law2seven[256];

/********************************************************************
 * generate table for conversion law from/to 7-bit alaw-like sample *
 ********************************************************************/

void
dsp_audio_generate_seven(void)
{}


/* mix 2*law -> law */
u8 dsp_audio_mix_law[65536];

/******************************************************
 * generate mix table to mix two law samples into one *
 ******************************************************/

void
dsp_audio_generate_mix_table(void)
{}


/*************************************
 * generate different volume changes *
 *************************************/

static u8 dsp_audio_reduce8[256];
static u8 dsp_audio_reduce7[256];
static u8 dsp_audio_reduce6[256];
static u8 dsp_audio_reduce5[256];
static u8 dsp_audio_reduce4[256];
static u8 dsp_audio_reduce3[256];
static u8 dsp_audio_reduce2[256];
static u8 dsp_audio_reduce1[256];
static u8 dsp_audio_increase1[256];
static u8 dsp_audio_increase2[256];
static u8 dsp_audio_increase3[256];
static u8 dsp_audio_increase4[256];
static u8 dsp_audio_increase5[256];
static u8 dsp_audio_increase6[256];
static u8 dsp_audio_increase7[256];
static u8 dsp_audio_increase8[256];

static u8 *dsp_audio_volume_change[16] =;

void
dsp_audio_generate_volume_changes(void)
{}


/**************************************
 * change the volume of the given skb *
 **************************************/

/* this is a helper function for changing volume of skb. the range may be
 * -8 to 8, which is a shift to the power of 2. 0 == no volume, 3 == volume*8
 */
void
dsp_change_volume(struct sk_buff *skb, int volume)
{}