TI-RTOS Drivers  tidrivers_full_2_20_00_08
Functions
Codec1.h File Reference

Detailed Description

Implementation of TI Codec Type 1 (IMA ADPCM) encoding and decoding.

============================================================================

This module provides functions for encoding and decoding data using ADPCM encoding.


#include <stdint.h>
Include dependency graph for Codec1.h:

Go to the source code of this file.

Functions

uint8_t Codec1_encodeSingle (int16_t audSample)
 This routine encodes one int16 sample with TI Codec Type 1. More...
 
int16_t Codec1_decodeSingle (uint8_t nibble_4bits)
 This routine decode a 4-bit nibble sample to a uint16 PCM audio sample. More...
 
uint8_t Codec1_encodeBuff (uint8_t *dst, int16_t *src, int16_t srcSize, int8_t *si, int16_t *pv)
 This routine encode a buffer with TI codec Type 1. More...
 
void Codec1_decodeBuff (int16_t *dst, uint8_t *src, unsigned srcSize, int8_t *si, int16_t *pv)
 This routine decodes a buffer with TI codec Type 1. More...
 

Function Documentation

uint8_t Codec1_encodeSingle ( int16_t  audSample)

This routine encodes one int16 sample with TI Codec Type 1.

Parameters
audSampleThe audtion sample to encode
Returns
The encoded result as a 4-bit nibble
int16_t Codec1_decodeSingle ( uint8_t  nibble_4bits)

This routine decode a 4-bit nibble sample to a uint16 PCM audio sample.

Parameters
nibble_4bitsA 4-bit nibble to decode
Returns
The decoded value as a 16-bit PCM sample
uint8_t Codec1_encodeBuff ( uint8_t *  dst,
int16_t *  src,
int16_t  srcSize,
int8_t *  si,
int16_t *  pv 
)

This routine encode a buffer with TI codec Type 1.

Parameters
dstPointer to the buffer where encoding result will be written to
srcPointer to the buffer that should be encoded. Must be a multiple of 4 bytes
srcSizeThe number of samples (int16) in the src buffer. Must be a multiple of 2.
siPointer to the current step index
pvPointer to the current predicted-value
Returns
Number of bytes written to the destination buffer
void Codec1_decodeBuff ( int16_t *  dst,
uint8_t *  src,
unsigned  srcSize,
int8_t *  si,
int16_t *  pv 
)

This routine decodes a buffer with TI codec Type 1.

Parameters
dstPointer to the buffer where decoded result will be written to
srcPointer to the buffer that should be decoded. Must be a multiple of 4 bytes
srcSizeNumber of byte that will be generated by the encoder (4* (src buffer size in byte))
siPointer to the current step index
pvPointer to the current predicted-value
Copyright 2016, Texas Instruments Incorporated