Logo Search packages:      
Sourcecode: blender version File versions

qdm2.c File Reference

Detailed Description

QDM2 decoder
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.

Definition in file qdm2.c.

#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h"
#include "mpegaudio.h"
#include "qdm2data.h"
#include <assert.h>

Go to the source code of this file.


struct  _QDM2SubPNode
struct  FFTCoefficient
struct  FFTTone
struct  QDM2Complex
struct  QDM2Context
struct  QDM2FFT
struct  QDM2SubPacket


#define BITS_LEFT(length, gb)   ((length) - get_bits_count ((gb)))
#define FIX_NOISE_IDX(noise_idx)
#define HARDCLIP_THRESHOLD   35716
#define QDM2_LIST_ADD(list, size, packet)
#define QDM2_SB_USED(sub_sampling)   (((sub_sampling) >= 2) ? 30 : 8 << (sub_sampling))
#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 SB_DITHERING_NOISE(sb, noise_idx)   (noise_table[(noise_idx)++] * sb_noise_attenuation[(sb)])
#define SOFTCLIP_THRESHOLD   27600


typedef struct _QDM2SubPNode QDM2SubPNode
typedef int8_t sb_int8_array [2][30][64]


static MPA_INT mpa_window[512] __attribute__ ((aligned(16)))
static void average_quantized_coeffs (QDM2Context *q)
static void build_sb_samples_from_noise (QDM2Context *q, int sb)
static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_array tone_level_idx_temp, sb_int8_array coding_method, int nb_channels, int c, int superblocktype_2_3, int cm_table_select)
static void fill_tone_level_array (QDM2Context *q, int flag)
static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_method)
static void init_noise_samples (void)
static void init_quantized_coeffs_elem0 (int8_t *quantized_coeffs, GetBitContext *gb, int length)
static void init_tone_level_dequantization (QDM2Context *q, GetBitContext *gb, int length)
static void process_subpacket_10 (QDM2Context *q, QDM2SubPNode *node, int length)
static void process_subpacket_11 (QDM2Context *q, QDM2SubPNode *node, int length)
static void process_subpacket_12 (QDM2Context *q, QDM2SubPNode *node, int length)
static void process_subpacket_9 (QDM2Context *q, QDM2SubPNode *node)
static void process_synthesis_subpackets (QDM2Context *q, QDM2SubPNode *list)
static void qdm2_calculate_fft (QDM2Context *q, int channel, int sub_packet)
static void qdm2_decode (QDM2Context *q, uint8_t *in, int16_t *out)
static int qdm2_decode_close (AVCodecContext *avctx)
static void qdm2_decode_fft_packets (QDM2Context *q)
static int qdm2_decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
static int qdm2_decode_init (AVCodecContext *avctx)
static void qdm2_decode_sub_packet_header (GetBitContext *gb, QDM2SubPacket *sub_packet)
static void qdm2_decode_super_block (QDM2Context *q)
static void qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *gb, int b)
static void qdm2_fft_generate_tone (QDM2Context *q, FFTTone *tone)
static void qdm2_fft_init_coefficient (QDM2Context *q, int sub_packet, int offset, int duration, int channel, int exp, int phase)
static void qdm2_fft_tone_synthesizer (QDM2Context *q, int sub_packet)
static int qdm2_get_se_vlc (VLC *vlc, GetBitContext *gb, int depth)
static int qdm2_get_vlc (GetBitContext *gb, VLC *vlc, int flag, int depth)
static void qdm2_init (QDM2Context *q)
static void qdm2_init_vlc (void)
static uint16_t qdm2_packet_checksum (uint8_t *data, int length, int value)
static QDM2SubPNodeqdm2_search_subpacket_type_in_list (QDM2SubPNode *list, int type)
static void qdm2_synthesis_filter (QDM2Context *q, int index)
static void rnd_table_init (void)
static void softclip_table_init (void)
static void synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int length, int sb_min, int sb_max)


static uint8_t empty_buffer [FF_INPUT_BUFFER_PADDING_SIZE]
static float f2i_scale = (float) (1 << (FRAC_BITS - 15))
static VLC fft_level_exp_alt_vlc
static VLC fft_level_exp_vlc
static VLC fft_stereo_exp_vlc
static VLC fft_stereo_phase_vlc
static float noise_samples [128]
static float noise_table [4096]
AVCodec qdm2_decoder
static uint8_t random_dequant_index [256][5]
static uint8_t random_dequant_type24 [128][3]
static uint16_t softclip_table [HARDCLIP_THRESHOLD-SOFTCLIP_THRESHOLD+1]
static VLC vlc_tab_diff
static VLC vlc_tab_fft_tone_offset [5]
static VLC vlc_tab_level
static VLC vlc_tab_run
static VLC vlc_tab_tone_level_idx_hi1
static VLC vlc_tab_tone_level_idx_hi2
static VLC vlc_tab_tone_level_idx_mid
static VLC vlc_tab_type30
static VLC vlc_tab_type34

Generated by  Doxygen 1.6.0   Back to index