FFmpeg
Data Structures | Functions | Variables
atrac3plusdec.c File Reference
#include <stdint.h>
#include <string.h>
#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
#include "atrac.h"
#include "atrac3plus.h"

Go to the source code of this file.

Data Structures

struct  ATRAC3PContext
 

Functions

static av_cold int atrac3p_decode_close (AVCodecContext *avctx)
 
static av_cold int set_channel_params (ATRAC3PContext *ctx, AVCodecContext *avctx)
 
static av_cold void atrac3p_init_static (void)
 
static av_cold int atrac3p_decode_init (AVCodecContext *avctx)
 
static void decode_residual_spectrum (ATRAC3PContext *ctx, Atrac3pChanUnitCtx *ch_unit, float out[2][ATRAC3P_FRAME_SAMPLES], int num_channels, AVCodecContext *avctx)
 
static void reconstruct_frame (ATRAC3PContext *ctx, Atrac3pChanUnitCtx *ch_unit, int num_channels, AVCodecContext *avctx)
 
static int atrac3p_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

const AVCodec ff_atrac3p_decoder
 
const AVCodec ff_atrac3pal_decoder
 

Detailed Description

Sony ATRAC3+ compatible decoder.

Container formats used to store its data: RIFF WAV (.at3) and Sony OpenMG (.oma, .aa3).

Technical description of this codec can be found here: http://wiki.multimedia.cx/index.php?title=ATRAC3plus

Kudos to Benjamin Larsson and Michael Karcher for their precious technical help!

Definition in file atrac3plusdec.c.

Function Documentation

◆ atrac3p_decode_close()

static av_cold int atrac3p_decode_close ( AVCodecContext avctx)
static

Definition at line 70 of file atrac3plusdec.c.

◆ set_channel_params()

static av_cold int set_channel_params ( ATRAC3PContext ctx,
AVCodecContext avctx 
)
static

Definition at line 83 of file atrac3plusdec.c.

Referenced by atrac3p_decode_init().

◆ atrac3p_init_static()

static av_cold void atrac3p_init_static ( void  )
static

Definition at line 149 of file atrac3plusdec.c.

Referenced by atrac3p_decode_init().

◆ atrac3p_decode_init()

static av_cold int atrac3p_decode_init ( AVCodecContext avctx)
static

Definition at line 155 of file atrac3plusdec.c.

◆ decode_residual_spectrum()

static void decode_residual_spectrum ( ATRAC3PContext ctx,
Atrac3pChanUnitCtx ch_unit,
float  out[2][ATRAC3P_FRAME_SAMPLES],
int  num_channels,
AVCodecContext avctx 
)
static

Definition at line 207 of file atrac3plusdec.c.

Referenced by atrac3p_decode_frame().

◆ reconstruct_frame()

static void reconstruct_frame ( ATRAC3PContext ctx,
Atrac3pChanUnitCtx ch_unit,
int  num_channels,
AVCodecContext avctx 
)
static

Definition at line 271 of file atrac3plusdec.c.

Referenced by atrac3p_decode_frame().

◆ atrac3p_decode_frame()

static int atrac3p_decode_frame ( AVCodecContext avctx,
void *  data,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 336 of file atrac3plusdec.c.

Variable Documentation

◆ ff_atrac3p_decoder

const AVCodec ff_atrac3p_decoder
Initial value:
= {
.name = "atrac3plus",
.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"),
.capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(ATRAC3PContext),
}

Definition at line 396 of file atrac3plusdec.c.

◆ ff_atrac3pal_decoder

const AVCodec ff_atrac3pal_decoder
Initial value:
= {
.name = "atrac3plusal",
.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ AL (Adaptive TRansform Acoustic Coding 3+ Advanced Lossless)"),
.capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(ATRAC3PContext),
}

Definition at line 409 of file atrac3plusdec.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:42
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
atrac3p_decode_close
static av_cold int atrac3p_decode_close(AVCodecContext *avctx)
Definition: atrac3plusdec.c:70
ATRAC3PContext
Definition: atrac3plusdec.c:50
AV_CODEC_ID_ATRAC3PAL
@ AV_CODEC_ID_ATRAC3PAL
Definition: codec_id.h:505
atrac3p_decode_init
static av_cold int atrac3p_decode_init(AVCodecContext *avctx)
Definition: atrac3plusdec.c:155
AV_CODEC_ID_ATRAC3P
@ AV_CODEC_ID_ATRAC3P
Definition: codec_id.h:461
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:50
atrac3p_decode_frame
static int atrac3p_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: atrac3plusdec.c:336