FFmpeg
Classes | Macros | Typedefs | Variables
qdm2.c File Reference

QDM2 decoder. More...

#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "get_bits.h"
#include "bytestream.h"
#include "internal.h"
#include "mpegaudio.h"
#include "mpegaudiodsp.h"
#include "rdft.h"
#include "qdm2_tablegen.h"

Classes

struct  QDM2SubPacket
 Subpacket. More...
 
struct  QDM2SubPNode
 A node in the subpacket list. More...
 
struct  QDM2Complex
 
struct  FFTTone
 
struct  FFTCoefficient
 
struct  QDM2FFT
 
struct  QDM2Context
 QDM2 decoder context. More...
 

Macros

#define BITSTREAM_READER_LE
 
#define QDM2_LIST_ADD(list, size, packet)
 
#define QDM2_SB_USED(sub_sampling)   (((sub_sampling) >= 2) ? 30 : 8 << (sub_sampling))
 
#define FIX_NOISE_IDX(noise_idx)
 
#define SB_DITHERING_NOISE(sb, noise_idx)   (noise_table[(noise_idx)++] * sb_noise_attenuation[(sb)])
 
#define SAMPLES_NEEDED   av_log (NULL,AV_LOG_INFO,"This file triggers some untested code. Please contact the developers.\n");
 
#define SAMPLES_NEEDED_2(why)   av_log (NULL,AV_LOG_INFO,"This file triggers some missing code. Please contact the developers.\nPosition: %s\n",why);
 
#define QDM2_MAX_FRAME_SIZE   512
 

Typedefs

typedef int8_t sb_int8_array[2][30][64]
 
typedef struct QDM2SubPacket QDM2SubPacket
 Subpacket.
 
typedef struct QDM2SubPNode QDM2SubPNode
 A node in the subpacket list.
 
typedef struct QDM2Complex QDM2Complex
 
typedef struct FFTTone FFTTone
 
typedef struct FFTCoefficient FFTCoefficient
 
typedef struct QDM2FFT QDM2FFT
 
typedef struct QDM2Context QDM2Context
 QDM2 decoder context.
 

Variables

AVCodec ff_qdm2_decoder
 

Detailed Description

QDM2 decoder.

Author
Ewald Snel, Benjamin Larsson, Alex Beregszaszi, Roberto Togni

The decoder is not perfect yet, there are still some distortions especially on files encoded with 16 or 8 subbands.

Macro Definition Documentation

§ FIX_NOISE_IDX

#define FIX_NOISE_IDX (   noise_idx)
Value:
if ((noise_idx) >= 3840) \
(noise_idx) -= 3840; \

§ QDM2_LIST_ADD

#define QDM2_LIST_ADD (   list,
  size,
  packet 
)
Value:
do { \
if (size > 0) { \
list[size - 1].next = &list[size]; \
} \
list[size].packet = packet; \
list[size].next = NULL; \
size++; \
} while(0)

Variable Documentation

§ ff_qdm2_decoder

AVCodec ff_qdm2_decoder
Initial value:
= {
.name = "qdm2",
.long_name = NULL_IF_CONFIG_SMALL("QDesign Music Codec 2"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_QDM2,
.priv_data_size = sizeof(QDM2Context),
.init = qdm2_decode_init,
.close = qdm2_decode_close,
.decode = qdm2_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
}
struct QDM2Context QDM2Context
QDM2 decoder context.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959