FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
ra144.h File Reference
#include <stdint.h>
#include "lpc.h"
#include "audio_frame_queue.h"

Go to the source code of this file.

Data Structures

struct  RA144Context
 

Macros

#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
 
#define FIXED_CB_SIZE   128
 size of fixed codebooks
 
#define FRAMESIZE   20
 size of encoded frame
 
#define LPC_ORDER   10
 order of LPC filter
 

Functions

void ff_copy_and_dup (int16_t *target, const int16_t *source, int offset)
 Copy the last offset values of *source to *target.
 
int ff_eval_refl (int *refl, const int16_t *coefs, AVCodecContext *avctx)
 Evaluate the reflection coefficients from the filter coefficients.
 
void ff_eval_coefs (int *coefs, const int *refl)
 Evaluate the LPC filter coefficients from the reflection coefficients.
 
void ff_int_to_int16 (int16_t *out, const int *inp)
 
int ff_t_sqrt (unsigned int x)
 Evaluate sqrt(x << 24).
 
unsigned int ff_rms (const int *data)
 
int ff_interp (RA144Context *ractx, int16_t *out, int a, int copyold, int energy)
 
unsigned int ff_rescale_rms (unsigned int rms, unsigned int energy)
 
int ff_irms (const int16_t *data)
 inverse root mean square
 
void ff_subblock_synthesis (RA144Context *ractx, const uint16_t *lpc_coefs, int cba_idx, int cb1_idx, int cb2_idx, int gval, int gain)
 

Variables

const int16_t ff_gain_val_tab [256][3]
 
const uint8_t ff_gain_exp_tab [256]
 
const int8_t ff_cb1_vects [128][40]
 
const int8_t ff_cb2_vects [128][40]
 
const uint16_t ff_cb1_base [128]
 
const uint16_t ff_cb2_base [128]
 
const int16_t ff_energy_tab [32]
 
const int16_t *const ff_lpc_refl_cb [10]
 

Macro Definition Documentation

#define NBLOCKS   4

number of subblocks within a block

Definition at line 29 of file ra144.h.

Referenced by ff_interp(), ra144_decode_frame(), ra144_encode_frame(), and ra144_encode_init().

#define BLOCKSIZE   40
#define BUFFERSIZE   146

the size of the adaptive codebook

Definition at line 31 of file ra144.h.

Referenced by adaptive_cb_search(), create_adapt_vect(), ff_copy_and_dup(), and ff_subblock_synthesis().

#define FIXED_CB_SIZE   128

size of fixed codebooks

Definition at line 32 of file ra144.h.

Referenced by find_best_vect().

#define FRAMESIZE   20

size of encoded frame

Definition at line 33 of file ra144.h.

Referenced by ra144_decode_frame(), and ra144_encode_frame().

#define LPC_ORDER   10

order of LPC filter

Definition at line 34 of file ra144.h.

Function Documentation

void ff_copy_and_dup ( int16_t *  target,
const int16_t *  source,
int  offset 
)

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 1530 of file ra144.c.

Referenced by ff_subblock_synthesis(), and ra144_encode_subblock().

int ff_eval_refl ( int *  refl,
const int16_t *  coefs,
AVCodecContext avctx 
)

Evaluate the reflection coefficients from the filter coefficients.

Returns
1 if one of the reflection coefficients is greater than 4095, 0 if not.

Definition at line 1545 of file ra144.c.

Referenced by ff_interp(), and ra144_encode_frame().

void ff_eval_coefs ( int *  coefs,
const int *  refl 
)

Evaluate the LPC filter coefficients from the reflection coefficients.

Does the inverse of the ff_eval_refl() function.

Definition at line 1593 of file ra144.c.

Referenced by ra144_decode_frame(), and ra144_encode_frame().

void ff_int_to_int16 ( int16_t *  out,
const int *  inp 
)

Definition at line 1613 of file ra144.c.

Referenced by ff_interp(), ra144_decode_frame(), and ra144_encode_frame().

int ff_t_sqrt ( unsigned int  x)

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 1625 of file ra144.c.

Referenced by ff_irms(), ff_rms(), ra144_decode_frame(), and ra144_encode_frame().

unsigned int ff_rms ( const int *  data)

Definition at line 1636 of file ra144.c.

Referenced by ff_interp(), ra144_decode_frame(), and ra144_encode_frame().

int ff_interp ( RA144Context ractx,
int16_t *  out,
int  a,
int  copyold,
int  energy 
)

Definition at line 1657 of file ra144.c.

Referenced by ra144_decode_frame(), and ra144_encode_frame().

unsigned int ff_rescale_rms ( unsigned int  rms,
unsigned int  energy 
)

Definition at line 1678 of file ra144.c.

Referenced by ff_interp(), ra144_decode_frame(), and ra144_encode_frame().

int ff_irms ( const int16_t *  data)

inverse root mean square

Definition at line 1684 of file ra144.c.

Referenced by ff_subblock_synthesis(), and ra144_encode_subblock().

void ff_subblock_synthesis ( RA144Context ractx,
const uint16_t *  lpc_coefs,
int  cba_idx,
int  cb1_idx,
int  cb2_idx,
int  gval,
int  gain 
)

Definition at line 1697 of file ra144.c.

Referenced by do_output_subblock(), and ra144_encode_subblock().

Variable Documentation

const int16_t ff_gain_val_tab[256][3]

Definition at line 28 of file ra144.c.

Referenced by ff_add_wav(), and ra144_encode_subblock().

const uint8_t ff_gain_exp_tab[256]

Definition at line 95 of file ra144.c.

Referenced by ff_add_wav(), and ra144_encode_subblock().

const int8_t ff_cb1_vects[128][40]

Definition at line 114 of file ra144.c.

Referenced by ff_subblock_synthesis(), fixed_cb_search(), and ra144_encode_subblock().

const int8_t ff_cb2_vects[128][40]

Definition at line 758 of file ra144.c.

Referenced by ff_subblock_synthesis(), fixed_cb_search(), and ra144_encode_subblock().

const uint16_t ff_cb1_base[128]

Definition at line 1402 of file ra144.c.

Referenced by ff_subblock_synthesis(), and ra144_encode_subblock().

const uint16_t ff_cb2_base[128]

Definition at line 1421 of file ra144.c.

Referenced by ff_subblock_synthesis(), and ra144_encode_subblock().

const int16_t ff_energy_tab[32]

Definition at line 1440 of file ra144.c.

Referenced by ra144_decode_frame(), and ra144_encode_frame().

const int16_t* const ff_lpc_refl_cb[10]

Definition at line 1502 of file ra144.c.

Referenced by ra144_decode_frame(), and ra144_encode_frame().