/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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) 4Front Technologies 1996-2008.
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Purpose: GRC3 Sample Rate Converter
*
* GRC library version 3.1
*/
#include "audio_grc3.h"
extern const int32_t filter_data_L[];
extern const int32_t filter_data_M[];
extern const int32_t filter_data_H[];
extern const int32_t filter_data_P[];
static int32_t
{
return ((uint32_t)(v));
}
static int32_t
{
return ((int32_t)(v >> 6));
}
static int32_t
{
return ((int32_t)(v >> 31));
}
#define DEFINE_FILTER(T) \
static int32_t \
{ \
return ((int32_t)(v >> 31)); \
}
#define DEFINE_FILTER_HQ(T) \
static int32_t \
{ \
\
(filter_data_##T[idx2] + \
return ((int32_t)(v>>31)); \
}
static int32_t \
{ \
\
\
history--; \
} \
\
return (accum); \
}
DEFINE_CONVD(L, 4096)
DEFINE_CONVD(M, 8192)
DEFINE_CONVD(H, 16384)
DEFINE_CONVD(P, 32768)
static int32_t
{
#define ITERATION(p) \
history--
return (accum);
}
static int32_t
{
return (accum);
}
static int32_t
{
return (accum);
}
static int32_t
{
return (accum);
}
static int32_t
{
return (accum);
}
static int32_t
{
return (accum);
}
static void \
{ \
\
\
while (sz > 0) { \
goto endloop; \
dstsz++; \
} \
\
history++; \
history -= GRC3_MAXHISTORY; \
\
\
\
sz--; \
} \
endloop: \
\
} \
\
static void \
{ \
\
\
while (sz > 0) { \
goto endloop; \
dstsz++; \
} \
\
history++; \
history -= GRC3_MAXHISTORY; \
\
/* \
* TODO: for better quality multiplier is worth moving \
* to output cascade \
*/ \
\
\
sz--; \
} \
endloop: \
\
} \
\
static void \
{ \
else \
}
/*
* For performance reasons, we only support 24-bit SRC.
*/
void
{
switch (quality) {
default:
case 0:
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
}
}
void
{
int32_t t;
for (t = 0; t < GRC3_MAXHISTORY * 2; t++)
}
static void
{
}
static void
{
}
void
{
fromRate >>= 1;
toRate >>= 1;
}
else
}