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 "codec_internal.h"
#include "decode.h"
#include "get_bits.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, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

static const uint8_t channel_map [8][8]
 
const FFCodec ff_atrac3p_decoder
 
const FFCodec 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 84 of file atrac3plusdec.c.

◆ set_channel_params()

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

Definition at line 97 of file atrac3plusdec.c.

Referenced by atrac3p_decode_init().

◆ atrac3p_init_static()

static av_cold void atrac3p_init_static ( void  )
static

Definition at line 165 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 171 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 230 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 294 of file atrac3plusdec.c.

Referenced by atrac3p_decode_frame().

◆ atrac3p_decode_frame()

static int atrac3p_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 360 of file atrac3plusdec.c.

Variable Documentation

◆ channel_map

const uint8_t channel_map[8][8]
static
Initial value:
= {
{ 0, },
{ 0, 1, },
{ 0, 1, 2, },
{ 0, 1, 2, 3, },
{ 0, },
{ 0, 1, 2, 4, 5, 3, },
{ 0, 1, 2, 4, 5, 6, 3, },
{ 0, 1, 2, 4, 5, 6, 7, 3, },
}

Definition at line 51 of file atrac3plusdec.c.

Referenced by ac3_decode_frame(), copy_input_samples(), ff_eac3_parse_header(), ff_opus_parse_extradata(), libopus_copy_samples_with_channel_map(), libopus_decode_init(), libopus_validate_layout_and_get_channel_map(), mov_write_dops_tag(), pulse_map_channels_to_pulse(), pulse_write_header(), set_channel_params(), and swr_set_channel_mapping().

◆ ff_atrac3p_decoder

const FFCodec ff_atrac3p_decoder
Initial value:
= {
.p.name = "atrac3plus",
CODEC_LONG_NAME("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.priv_data_size = sizeof(ATRAC3PContext),
}

Definition at line 419 of file atrac3plusdec.c.

◆ ff_atrac3pal_decoder

const FFCodec ff_atrac3pal_decoder
Initial value:
= {
.p.name = "atrac3plusal",
CODEC_LONG_NAME("ATRAC3+ AL (Adaptive TRansform Acoustic Coding 3+ Advanced Lossless)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.priv_data_size = sizeof(ATRAC3PContext),
}

Definition at line 432 of file atrac3plusdec.c.

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: codec_internal.h:42
atrac3p_decode_close
static av_cold int atrac3p_decode_close(AVCodecContext *avctx)
Definition: atrac3plusdec.c:84
ATRAC3PContext
Definition: atrac3plusdec.c:62
AV_CODEC_ID_ATRAC3PAL
@ AV_CODEC_ID_ATRAC3PAL
Definition: codec_id.h:523
atrac3p_decode_frame
static int atrac3p_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: atrac3plusdec.c:360
atrac3p_decode_init
static av_cold int atrac3p_decode_init(AVCodecContext *avctx)
Definition: atrac3plusdec.c:171
AV_CODEC_ID_ATRAC3P
@ AV_CODEC_ID_ATRAC3P
Definition: codec_id.h:479
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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