libavcodec/ra144.c File Reference

#include "libavutil/intmath.h"
#include "avcodec.h"
#include "get_bits.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, AVCodecContext *avctx)
 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, AVPacket *avpkt)
 Uncompress one block (20 bytes -> 160*2 bytes).

Variables

AVCodec ra_144_decoder


Define Documentation

#define BLOCKSIZE   40

subblock size in 16-bit words

Definition at line 32 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 33 of file ra144.c.

Referenced by copy_and_dup(), and do_output_subblock().

#define NBLOCKS   4

number of subblocks within a block

Definition at line 31 of file ra144.c.

Referenced by interp().


Function Documentation

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]

Definition at line 136 of file ra144.c.

Referenced by do_output_subblock().

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 113 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]

Definition at line 181 of file ra144.c.

Referenced by ra144_decode_frame().

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

Referenced by ra144_decode_frame().

static int eval_refl ( int *  refl,
const int16_t *  coefs,
AVCodecContext avctx 
) [static]

Evaluate the reflection coefficients from the filter coefficients.

Does the inverse of the eval_coefs() function.

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

Definition at line 234 of file ra144.c.

Referenced by interp().

static void int_to_int16 ( int16_t *  out,
const int *  inp 
) [static]

Definition at line 219 of file ra144.c.

Referenced by interp(), and ra144_decode_frame().

static int interp ( RA144Context ractx,
int16_t *  out,
int  a,
int  copyold,
int  energy 
) [static]

Definition at line 271 of file ra144.c.

Referenced by ra144_decode_frame().

static int irms ( const int16_t *  data  )  [static]

inverse root mean square

Definition at line 123 of file ra144.c.

Referenced by do_output_subblock().

static int ra144_decode_frame ( AVCodecContext avctx,
void *  vdata,
int *  data_size,
AVPacket avpkt 
) [static]

Uncompress one block (20 bytes -> 160*2 bytes).

Definition at line 294 of file ra144.c.

static av_cold int ra144_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 57 of file ra144.c.

static unsigned int rescale_rms ( unsigned int  rms,
unsigned int  energy 
) [static]

Definition at line 155 of file ra144.c.

Referenced by interp(), and ra144_decode_frame().

static unsigned int rms ( const int *  data  )  [static]

Definition at line 160 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 74 of file ra144.c.

Referenced by irms(), ra144_decode_frame(), and rms().


Variable Documentation

Initial value:

{
    "real_144",
    AVMEDIA_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)"),
}

Definition at line 353 of file ra144.c.


Generated on Fri Oct 26 02:36:53 2012 for FFmpeg by  doxygen 1.5.8