libavcodec/atrac1.c File Reference

Atrac 1 compatible decoder. More...

#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include "avcodec.h"
#include "get_bits.h"
#include "dsputil.h"
#include "fft.h"
#include "sinewin.h"
#include "atrac.h"
#include "atrac1data.h"

Go to the source code of this file.

Data Structures

struct  AT1SUCtx
 Sound unit struct, one unit is used per channel. More...
struct  AT1Ctx
 The atrac1 context, holds all needed parameters for decoding. More...

Defines

#define AT1_MAX_BFU   52
 max number of block floating units in a sound unit
#define AT1_SU_SIZE   212
 number of bytes in a sound unit
#define AT1_SU_SAMPLES   512
 number of samples in a sound unit
#define AT1_FRAME_SIZE   AT1_SU_SIZE * 2
#define AT1_SU_MAX_BITS   AT1_SU_SIZE * 8
#define AT1_MAX_CHANNELS   2
#define AT1_QMF_BANDS   3
#define IDX_LOW_BAND   0
#define IDX_MID_BAND   1
#define IDX_HIGH_BAND   2

Functions

static void at1_imdct (AT1Ctx *q, float *spec, float *out, int nbits, int rev_spec)
static int at1_imdct_block (AT1SUCtx *su, AT1Ctx *q)
static int at1_parse_bsm (GetBitContext *gb, int log2_block_cnt[AT1_QMF_BANDS])
 Parse the block size mode byte.
static int at1_unpack_dequant (GetBitContext *gb, AT1SUCtx *su, float spec[AT1_SU_SAMPLES])
static void at1_subband_synthesis (AT1Ctx *q, AT1SUCtx *su, float *pOut)
static int atrac1_decode_frame (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
static av_cold int atrac1_decode_init (AVCodecContext *avctx)
static av_cold int atrac1_decode_end (AVCodecContext *avctx)

Variables

static const uint16_t samples_per_band [3] = {128, 128, 256}
 size of the transform in samples in the long mode for each QMF band
static const uint8_t mdct_long_nbits [3] = {7, 7, 8}
AVCodec ff_atrac1_decoder


Detailed Description

Atrac 1 compatible decoder.

This decoder handles raw ATRAC1 data and probably SDDS data.

Definition in file atrac1.c.


Define Documentation

#define AT1_FRAME_SIZE   AT1_SU_SIZE * 2

Definition at line 47 of file atrac1.c.

#define AT1_MAX_BFU   52

max number of block floating units in a sound unit

Definition at line 44 of file atrac1.c.

Referenced by at1_unpack_dequant().

#define AT1_MAX_CHANNELS   2

Definition at line 49 of file atrac1.c.

Referenced by atrac1_decode_init().

#define AT1_QMF_BANDS   3

Definition at line 51 of file atrac1.c.

Referenced by at1_imdct_block(), and at1_unpack_dequant().

#define AT1_SU_MAX_BITS   AT1_SU_SIZE * 8

Definition at line 48 of file atrac1.c.

Referenced by at1_unpack_dequant().

#define AT1_SU_SAMPLES   512

number of samples in a sound unit

Definition at line 46 of file atrac1.c.

Referenced by atrac1_decode_frame().

#define AT1_SU_SIZE   212

number of bytes in a sound unit

Definition at line 45 of file atrac1.c.

Referenced by aea_read_header().

#define IDX_HIGH_BAND   2

Definition at line 54 of file atrac1.c.

Referenced by at1_parse_bsm().

#define IDX_LOW_BAND   0

Definition at line 52 of file atrac1.c.

#define IDX_MID_BAND   1

Definition at line 53 of file atrac1.c.


Function Documentation

static void at1_imdct ( AT1Ctx q,
float *  spec,
float *  out,
int  nbits,
int  rev_spec 
) [static]

Definition at line 92 of file atrac1.c.

Referenced by at1_imdct_block().

static int at1_imdct_block ( AT1SUCtx su,
AT1Ctx q 
) [static]

Definition at line 107 of file atrac1.c.

Referenced by atrac1_decode_frame().

static int at1_parse_bsm ( GetBitContext gb,
int  log2_block_cnt[AT1_QMF_BANDS] 
) [static]

Parse the block size mode byte.

Definition at line 168 of file atrac1.c.

Referenced by atrac1_decode_frame().

static void at1_subband_synthesis ( AT1Ctx q,
AT1SUCtx su,
float *  pOut 
) [static]

Definition at line 256 of file atrac1.c.

Referenced by atrac1_decode_frame().

static int at1_unpack_dequant ( GetBitContext gb,
AT1SUCtx su,
float  spec[AT1_SU_SAMPLES] 
) [static]

< the word length indexes for each BFU

< the scalefactor indexes for each BFU

Definition at line 191 of file atrac1.c.

Referenced by atrac1_decode_frame().

static av_cold int atrac1_decode_end ( AVCodecContext avctx  )  [static]

Definition at line 371 of file atrac1.c.

static int atrac1_decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
AVPacket avpkt 
) [static]

Definition at line 273 of file atrac1.c.

static av_cold int atrac1_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 333 of file atrac1.c.


Variable Documentation

Initial value:

 {
    .name = "atrac1",
    .type = AVMEDIA_TYPE_AUDIO,
    .id = CODEC_ID_ATRAC1,
    .priv_data_size = sizeof(AT1Ctx),
    .init = atrac1_decode_init,
    .close = atrac1_decode_end,
    .decode = atrac1_decode_frame,
    .long_name = NULL_IF_CONFIG_SMALL("Atrac 1 (Adaptive TRansform Acoustic Coding)"),
}

Definition at line 381 of file atrac1.c.

const uint8_t mdct_long_nbits[3] = {7, 7, 8} [static]

Definition at line 89 of file atrac1.c.

Referenced by at1_imdct_block().

const uint16_t samples_per_band[3] = {128, 128, 256} [static]

size of the transform in samples in the long mode for each QMF band

Definition at line 88 of file atrac1.c.

Referenced by at1_imdct_block().


Generated on Fri Oct 26 02:38:15 2012 for FFmpeg by  doxygen 1.5.8