#include "avcodec.h"
#include "bitstream.h"
#include "ra144.h"
#include "celp_filters.h"
Go to the source code of this file.
Data Structures | |
struct | RA144Context |
Defines | |
#define | NBLOCKS 4 |
number of subblocks within a block | |
#define | BLOCKSIZE 40 |
subblock size in 16-bit words | |
#define | BUFFERSIZE 146 |
the size of the adaptive codebook | |
Functions | |
static av_cold int | ra144_decode_init (AVCodecContext *avctx) |
static int | t_sqrt (unsigned int x) |
Evaluate sqrt(x << 24). | |
static void | eval_coefs (int *coefs, const int *refl) |
Evaluate the LPC filter coefficients from the reflection coefficients. | |
static void | copy_and_dup (int16_t *target, const int16_t *source, int offset) |
Copy the last offset values of *source to *target. | |
static int | irms (const int16_t *data) |
inverse root mean square | |
static void | add_wav (int16_t *dest, int n, int skip_first, int *m, const int16_t *s1, const int8_t *s2, const int8_t *s3) |
static unsigned int | rescale_rms (unsigned int rms, unsigned int energy) |
static unsigned int | rms (const int *data) |
static void | do_output_subblock (RA144Context *ractx, const uint16_t *lpc_coefs, int gval, GetBitContext *gb) |
static void | int_to_int16 (int16_t *out, const int *inp) |
static int | eval_refl (int *refl, const int16_t *coefs, RA144Context *ractx) |
Evaluate the reflection coefficients from the filter coefficients. | |
static int | interp (RA144Context *ractx, int16_t *out, int a, int copyold, int energy) |
static int | ra144_decode_frame (AVCodecContext *avctx, void *vdata, int *data_size, const uint8_t *buf, int buf_size) |
Uncompress one block (20 bytes -> 160*2 bytes). | |
Variables | |
AVCodec | ra_144_decoder |
#define BLOCKSIZE 40 |
subblock size in 16-bit words
Definition at line 31 of file ra144.c.
Referenced by add_wav(), copy_and_dup(), do_output_subblock(), irms(), and ra144_decode_frame().
#define BUFFERSIZE 146 |
the size of the adaptive codebook
Definition at line 32 of file ra144.c.
Referenced by copy_and_dup(), and do_output_subblock().
#define NBLOCKS 4 |
static void add_wav | ( | int16_t * | dest, | |
int | n, | |||
int | skip_first, | |||
int * | m, | |||
const int16_t * | s1, | |||
const int8_t * | s2, | |||
const int8_t * | s3 | |||
) | [static] |
static void copy_and_dup | ( | int16_t * | target, | |
const int16_t * | source, | |||
int | offset | |||
) | [static] |
Copy the last offset values of *source to *target.
If those values are not enough to fill the target buffer, fill it with another copy of those values.
Definition at line 108 of file ra144.c.
Referenced by do_output_subblock().
static void do_output_subblock | ( | RA144Context * | ractx, | |
const uint16_t * | lpc_coefs, | |||
int | gval, | |||
GetBitContext * | gb | |||
) | [static] |
static void eval_coefs | ( | int * | coefs, | |
const int * | refl | |||
) | [static] |
Evaluate the LPC filter coefficients from the reflection coefficients.
Does the inverse of the eval_refl() function.
Definition at line 84 of file ra144.c.
Referenced by ra144_decode_frame().
static int eval_refl | ( | int * | refl, | |
const int16_t * | coefs, | |||
RA144Context * | ractx | |||
) | [static] |
Evaluate the reflection coefficients from the filter coefficients.
Does the inverse of the eval_coefs() function.
Definition at line 229 of file ra144.c.
Referenced by interp().
static void int_to_int16 | ( | int16_t * | out, | |
const int * | inp | |||
) | [static] |
static int interp | ( | RA144Context * | ractx, | |
int16_t * | out, | |||
int | a, | |||
int | copyold, | |||
int | energy | |||
) | [static] |
static int irms | ( | const int16_t * | data | ) | [static] |
inverse root mean square
Definition at line 118 of file ra144.c.
Referenced by do_output_subblock().
static int ra144_decode_frame | ( | AVCodecContext * | avctx, | |
void * | vdata, | |||
int * | data_size, | |||
const uint8_t * | buf, | |||
int | buf_size | |||
) | [static] |
static av_cold int ra144_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
static unsigned int rescale_rms | ( | unsigned int | rms, | |
unsigned int | energy | |||
) | [static] |
static unsigned int rms | ( | const int * | data | ) | [static] |
Definition at line 155 of file ra144.c.
Referenced by ff_rm_alloc_rmstream(), interp(), and ra144_decode_frame().
static int t_sqrt | ( | unsigned int | x | ) | [static] |
Evaluate sqrt(x << 24).
x must fit in 20 bits. This value is evaluated in an odd way to make the output identical to the binary decoder.
Definition at line 69 of file ra144.c.
Referenced by irms(), ra144_decode_frame(), and rms().
Initial value:
{ "real_144", CODEC_TYPE_AUDIO, CODEC_ID_RA_144, sizeof(RA144Context), ra144_decode_init, NULL, NULL, ra144_decode_frame, .long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"), }