2020-01-12 11:57:20 +01:00
|
|
|
/*
|
|
|
|
Interface to Namco G.722.1 decoder
|
|
|
|
*/
|
2020-02-09 10:15:17 +01:00
|
|
|
#ifndef _G7221_DECODER_LIB_H
|
|
|
|
#define _G7221_DECODER_LIB_H
|
2020-01-12 11:57:20 +01:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/* forward definition for the opaque handle object */
|
|
|
|
typedef struct g7221_handle g7221_handle;
|
|
|
|
|
|
|
|
/* return a handle for decoding on successful init, NULL on failure */
|
2020-02-08 12:54:13 +01:00
|
|
|
g7221_handle* g7221_init(int bytes_per_frame);
|
2020-01-12 11:57:20 +01:00
|
|
|
|
|
|
|
/* decode a frame, at code_words, into 16-bit PCM in sample_buffer */
|
2020-02-08 12:54:13 +01:00
|
|
|
int g7221_decode_frame(g7221_handle* handle, uint8_t* data, int16_t* out_samples);
|
2020-01-12 11:57:20 +01:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* decodes an empty frame after no more data is found (may be used to "drain" window samples */
|
2020-02-08 12:54:13 +01:00
|
|
|
int g7221_decode_empty(g7221_handle* handle, int16_t* out_samples);
|
2020-01-12 11:57:20 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* reset the decoder to its initial state */
|
|
|
|
void g7221_reset(g7221_handle* handle);
|
|
|
|
|
|
|
|
/* free resources */
|
|
|
|
void g7221_free(g7221_handle* handle);
|
|
|
|
|
2020-02-09 10:15:17 +01:00
|
|
|
/* set new key (ignores key on failure) */
|
|
|
|
int g7221_set_key(g7221_handle* handle, const uint8_t* key);
|
|
|
|
|
2020-01-12 11:57:20 +01:00
|
|
|
#endif
|