⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 g726enc.c

📁 g.726编解码源程序
💻 C
字号:
/*
 *  Copyright 2002 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) RF3_UART_G726 1.00.00 07-18-02 (swat-c03)" */
/*
 *  Copyright 2001 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) XDAS 2.2.1 12-07-01 (__imports)" */
/*
 *  ======== g726enc.c ========
 *  G726 encoder module - implements all functions and defines all constants
 *  and structures common to all G726ENC algorithm implementations.
 *
 */

#include <std.h>

#include <algrf.h>
#include <xdas.h>
#include <g726enc.h>
#include <ialg.h>

/*
 *  ======== G726ENC_apply ========
 *  Apply a G726 encoder to the in buffer and place the encoded data in
 *  the out buffer. The function should return the number of samples in the
 *  out buffer.
 */
XDAS_Int16 G726ENC_apply(G726ENC_Handle handle, XDAS_Int16 *in, XDAS_Int8 *out)
{
    XDAS_Int16  numSamples;

    /* Check for valid handle and fxn ptr */
    if (handle == NULL || handle->fxns->encode == NULL) {
        return (-1);
    }

    /* Activate instance object */
    ALGRF_activate((IALG_Handle)handle);

    /* Encode */
    numSamples = handle->fxns->encode(handle, in, out);
    
    /* Deactivate instance object */
    ALGRF_deactivate((IALG_Handle)handle);

    return(numSamples);
}

/*
 *  ======== G726ENC_control ========
 *  Function to either write to the read/write parameters in the status
 *  structure or to read all the parameters in the status structure.
 */
XDAS_Bool G726ENC_control(G726ENC_Handle handle, G726ENC_Cmd cmd, G726ENC_Status *status)
{
    /* Check for valid handle and fxn ptr and do control operation */
    if (handle && handle->fxns->control) {
        return(handle->fxns->control(handle, cmd, status));
    }

    return (XDAS_FALSE);
}

/*
 *  ======== G726ENC_exit ========
 *  G726ENC module finalization
 */
Void G726ENC_exit(Void)
{
}

/*
 *  ======== G726ENC_init ========
 *  G726ENC module initialization
 */
Void G726ENC_init(Void)
{
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -