mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
Merge commit '76efedeadb1f6bf79020c44a71dd0cee13d932ad'
* commit '76efedeadb1f6bf79020c44a71dd0cee13d932ad': qdm2: formatting cosmetics Conflicts: libavcodec/qdm2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
e1f98f2231
@ -216,6 +216,10 @@ static const uint16_t qdm2_vlc_offs[] = {
|
||||
0,260,566,598,894,1166,1230,1294,1678,1950,2214,2278,2310,2570,2834,3124,3448,3838,
|
||||
};
|
||||
|
||||
static const int switchtable[23] = {
|
||||
0, 5, 1, 5, 5, 5, 5, 5, 2, 5, 5, 5, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 4
|
||||
};
|
||||
|
||||
static av_cold void qdm2_init_vlc(void)
|
||||
{
|
||||
static VLC_TYPE qdm2_table[3838][2];
|
||||
@ -388,7 +392,6 @@ static int qdm2_get_vlc (GetBitContext *gb, VLC *vlc, int flag, int depth)
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
static int qdm2_get_se_vlc(VLC *vlc, GetBitContext *gb, int depth)
|
||||
{
|
||||
int value = qdm2_get_vlc(gb, vlc, 0, depth);
|
||||
@ -396,7 +399,6 @@ static int qdm2_get_se_vlc (VLC *vlc, GetBitContext *gb, int depth)
|
||||
return (value & 1) ? ((value + 1) >> 1) : -(value >> 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* QDM2 checksum
|
||||
*
|
||||
@ -406,7 +408,8 @@ static int qdm2_get_se_vlc (VLC *vlc, GetBitContext *gb, int depth)
|
||||
*
|
||||
* @return 0 if checksum is OK
|
||||
*/
|
||||
static uint16_t qdm2_packet_checksum (const uint8_t *data, int length, int value) {
|
||||
static uint16_t qdm2_packet_checksum(const uint8_t *data, int length, int value)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
@ -415,14 +418,14 @@ static uint16_t qdm2_packet_checksum (const uint8_t *data, int length, int value
|
||||
return (uint16_t)(value & 0xffff);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fill a QDM2SubPacket structure with packet type, size, and data pointer.
|
||||
*
|
||||
* @param gb bitreader context
|
||||
* @param sub_packet packet under analysis
|
||||
*/
|
||||
static void qdm2_decode_sub_packet_header (GetBitContext *gb, QDM2SubPacket *sub_packet)
|
||||
static void qdm2_decode_sub_packet_header(GetBitContext *gb,
|
||||
QDM2SubPacket *sub_packet)
|
||||
{
|
||||
sub_packet->type = get_bits(gb, 8);
|
||||
|
||||
@ -441,14 +444,14 @@ static void qdm2_decode_sub_packet_header (GetBitContext *gb, QDM2SubPacket *sub
|
||||
if (sub_packet->type == 0x7f)
|
||||
sub_packet->type |= (get_bits(gb, 8) << 8);
|
||||
|
||||
sub_packet->data = &gb->buffer[get_bits_count(gb) / 8]; // FIXME: this depends on bitreader internal data
|
||||
// FIXME: this depends on bitreader-internal data
|
||||
sub_packet->data = &gb->buffer[get_bits_count(gb) / 8];
|
||||
}
|
||||
|
||||
av_log(NULL, AV_LOG_DEBUG, "Subpacket: type=%d size=%d start_offs=%x\n",
|
||||
sub_packet->type, sub_packet->size, get_bits_count(gb) / 8);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return node pointer to first packet of requested type in list.
|
||||
*
|
||||
@ -456,7 +459,8 @@ static void qdm2_decode_sub_packet_header (GetBitContext *gb, QDM2SubPacket *sub
|
||||
* @param type type of searched subpacket
|
||||
* @return node pointer for subpacket if found, else NULL
|
||||
*/
|
||||
static QDM2SubPNode* qdm2_search_subpacket_type_in_list (QDM2SubPNode *list, int type)
|
||||
static QDM2SubPNode *qdm2_search_subpacket_type_in_list(QDM2SubPNode *list,
|
||||
int type)
|
||||
{
|
||||
while (list != NULL && list->packet != NULL) {
|
||||
if (list->packet->type == type)
|
||||
@ -466,7 +470,6 @@ static QDM2SubPNode* qdm2_search_subpacket_type_in_list (QDM2SubPNode *list, int
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace 8 elements with their average value.
|
||||
* Called by qdm2_decode_superblock before starting subblock decoding.
|
||||
@ -495,7 +498,6 @@ static void average_quantized_coeffs (QDM2Context *q)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build subband samples with noise weighted by q->tone_level.
|
||||
* Called by synthfilt_build_sb_samples.
|
||||
@ -512,13 +514,15 @@ static void build_sb_samples_from_noise (QDM2Context *q, int sb)
|
||||
if (!q->nb_channels)
|
||||
return;
|
||||
|
||||
for (ch = 0; ch < q->nb_channels; ch++)
|
||||
for (ch = 0; ch < q->nb_channels; ch++) {
|
||||
for (j = 0; j < 64; j++) {
|
||||
q->sb_samples[ch][j * 2][sb] = SB_DITHERING_NOISE(sb,q->noise_idx) * q->tone_level[ch][sb][j];
|
||||
q->sb_samples[ch][j * 2 + 1][sb] = SB_DITHERING_NOISE(sb,q->noise_idx) * q->tone_level[ch][sb][j];
|
||||
q->sb_samples[ch][j * 2][sb] =
|
||||
SB_DITHERING_NOISE(sb, q->noise_idx) * q->tone_level[ch][sb][j];
|
||||
q->sb_samples[ch][j * 2 + 1][sb] =
|
||||
SB_DITHERING_NOISE(sb, q->noise_idx) * q->tone_level[ch][sb][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called while processing data from subpackets 11 and 12.
|
||||
@ -528,12 +532,12 @@ static void build_sb_samples_from_noise (QDM2Context *q, int sb)
|
||||
* @param channels number of channels
|
||||
* @param coding_method q->coding_method[0][0][0]
|
||||
*/
|
||||
static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_method)
|
||||
static void fix_coding_method_array(int sb, int channels,
|
||||
sb_int8_array coding_method)
|
||||
{
|
||||
int j, k;
|
||||
int ch;
|
||||
int run, case_val;
|
||||
static const int switchtable[23] = {0,5,1,5,5,5,5,5,2,5,5,5,5,5,5,5,3,5,5,5,5,5,4};
|
||||
|
||||
for (ch = 0; ch < channels; ch++) {
|
||||
for (j = 0; j < 64; ) {
|
||||
@ -542,30 +546,48 @@ static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_
|
||||
case_val = 8;
|
||||
} else {
|
||||
switch (switchtable[coding_method[ch][sb][j] - 8]) {
|
||||
case 0: run = 10; case_val = 10; break;
|
||||
case 1: run = 1; case_val = 16; break;
|
||||
case 2: run = 5; case_val = 24; break;
|
||||
case 3: run = 3; case_val = 30; break;
|
||||
case 4: run = 1; case_val = 30; break;
|
||||
case 5: run = 1; case_val = 8; break;
|
||||
default: run = 1; case_val = 8; break;
|
||||
case 0: run = 10;
|
||||
case_val = 10;
|
||||
break;
|
||||
case 1: run = 1;
|
||||
case_val = 16;
|
||||
break;
|
||||
case 2: run = 5;
|
||||
case_val = 24;
|
||||
break;
|
||||
case 3: run = 3;
|
||||
case_val = 30;
|
||||
break;
|
||||
case 4: run = 1;
|
||||
case_val = 30;
|
||||
break;
|
||||
case 5: run = 1;
|
||||
case_val = 8;
|
||||
break;
|
||||
default: run = 1;
|
||||
case_val = 8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (k = 0; k < run; k++)
|
||||
if (j + k < 128)
|
||||
if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > coding_method[ch][sb][j])
|
||||
for (k = 0; k < run; k++) {
|
||||
if (j + k < 128) {
|
||||
if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > coding_method[ch][sb][j]) {
|
||||
if (k > 0) {
|
||||
SAMPLES_NEEDED
|
||||
//not debugged, almost never used
|
||||
memset(&coding_method[ch][sb][j + k], case_val, k * sizeof(int8_t));
|
||||
memset(&coding_method[ch][sb][j + k], case_val, 3 * sizeof(int8_t));
|
||||
memset(&coding_method[ch][sb][j + k], case_val,
|
||||
k *sizeof(int8_t));
|
||||
memset(&coding_method[ch][sb][j + k], case_val,
|
||||
3 * sizeof(int8_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
j += run;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Related to synthesis filter
|
||||
* Called by process_subpacket_10
|
||||
@ -645,16 +667,14 @@ static void fill_tone_level_array (QDM2Context *q, int flag)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Related to synthesis filter
|
||||
* Called by process_subpacket_11
|
||||
* c is built with data from subpacket 11
|
||||
* Most of this function is used only if superblock_type_2_3 == 0, never seen it in samples
|
||||
* Most of this function is used only if superblock_type_2_3 == 0,
|
||||
* never seen it in samples.
|
||||
*
|
||||
* @param tone_level_idx
|
||||
* @param tone_level_idx_temp
|
||||
@ -664,9 +684,12 @@ static void fill_tone_level_array (QDM2Context *q, int flag)
|
||||
* @param superblocktype_2_3 flag based on superblock packet type
|
||||
* @param cm_table_select q->cm_table_select
|
||||
*/
|
||||
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_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)
|
||||
{
|
||||
int ch, sb, j;
|
||||
int tmp, acc, esp_40, comp;
|
||||
@ -773,15 +796,14 @@ static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_arra
|
||||
for (j = 0; j < 64; j++)
|
||||
coding_method[ch][sb][j] = coding_method_table[cm_table_select][sb];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Called by process_subpacket_11 to process more data from subpacket 11 with sb 0-8
|
||||
* Called by process_subpacket_12 to process data from subpacket 12 with sb 8-sb_used
|
||||
* Called by process_subpacket_11 to process more data from subpacket 11
|
||||
* with sb 0-8.
|
||||
* Called by process_subpacket_12 to process data from subpacket 12 with
|
||||
* sb 8-sb_used.
|
||||
*
|
||||
* @param q context
|
||||
* @param gb bitreader context
|
||||
@ -789,7 +811,8 @@ static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_arra
|
||||
* @param sb_min lower subband processed (sb_min included)
|
||||
* @param sb_max higher subband processed (sb_max excluded)
|
||||
*/
|
||||
static int synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int length, int sb_min, int sb_max)
|
||||
static int synthfilt_build_sb_samples(QDM2Context *q, GetBitContext *gb,
|
||||
int length, int sb_min, int sb_max)
|
||||
{
|
||||
int sb, j, k, n, ch, run, channels;
|
||||
int joined_stereo, zero_encoding, chs;
|
||||
@ -992,16 +1015,18 @@ static int synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int le
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Init the first element of a channel in quantized_coeffs with data from packet 10 (quantized_coeffs[ch][0]).
|
||||
* This is similar to process_subpacket_9, but for a single channel and for element [0]
|
||||
* Init the first element of a channel in quantized_coeffs with data
|
||||
* from packet 10 (quantized_coeffs[ch][0]).
|
||||
* This is similar to process_subpacket_9, but for a single channel
|
||||
* and for element [0]
|
||||
* same VLC tables as process_subpacket_9 are used.
|
||||
*
|
||||
* @param quantized_coeffs pointer to quantized_coeffs[ch][0]
|
||||
* @param gb bitreader context
|
||||
*/
|
||||
static int init_quantized_coeffs_elem0 (int8_t *quantized_coeffs, GetBitContext *gb)
|
||||
static int init_quantized_coeffs_elem0(int8_t *quantized_coeffs,
|
||||
GetBitContext *gb)
|
||||
{
|
||||
int i, k, run, level, diff;
|
||||
|
||||
@ -1032,11 +1057,11 @@ static int init_quantized_coeffs_elem0 (int8_t *quantized_coeffs, GetBitContext
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Related to synthesis filter, process data from packet 10
|
||||
* Init part of quantized_coeffs via function init_quantized_coeffs_elem0
|
||||
* Init tone_level_idx_hi1, tone_level_idx_hi2, tone_level_idx_mid with data from packet 10
|
||||
* Init tone_level_idx_hi1, tone_level_idx_hi2, tone_level_idx_mid with
|
||||
* data from packet 10
|
||||
*
|
||||
* @param q context
|
||||
* @param gb bitreader context
|
||||
@ -1111,7 +1136,7 @@ static int process_subpacket_9 (QDM2Context *q, QDM2SubPNode *node)
|
||||
|
||||
init_get_bits(&gb, node->packet->data, node->packet->size * 8);
|
||||
|
||||
n = coeff_per_sb_for_avg[q->coeff_per_sb_select][QDM2_SB_USED(q->sub_sampling) - 1] + 1; // same as averagesomething function
|
||||
n = coeff_per_sb_for_avg[q->coeff_per_sb_select][QDM2_SB_USED(q->sub_sampling) - 1] + 1;
|
||||
|
||||
for (i = 1; i < n; i++)
|
||||
for (ch = 0; ch < q->nb_channels; ch++) {
|
||||
@ -1140,7 +1165,6 @@ static int process_subpacket_9 (QDM2Context *q, QDM2SubPNode *node)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process subpacket 10 if not null, else
|
||||
*
|
||||
@ -1160,7 +1184,6 @@ static void process_subpacket_10 (QDM2Context *q, QDM2SubPNode *node)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process subpacket 11
|
||||
*
|
||||
@ -1181,14 +1204,15 @@ static void process_subpacket_11 (QDM2Context *q, QDM2SubPNode *node)
|
||||
int c = get_bits(&gb, 13);
|
||||
|
||||
if (c > 3)
|
||||
fill_coding_method_array (q->tone_level_idx, q->tone_level_idx_temp, q->coding_method,
|
||||
q->nb_channels, 8*c, q->superblocktype_2_3, q->cm_table_select);
|
||||
fill_coding_method_array(q->tone_level_idx,
|
||||
q->tone_level_idx_temp, q->coding_method,
|
||||
q->nb_channels, 8 * c,
|
||||
q->superblocktype_2_3, q->cm_table_select);
|
||||
}
|
||||
|
||||
synthfilt_build_sb_samples(q, &gb, length, 0, 8);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process subpacket 12
|
||||
*
|
||||
@ -1241,7 +1265,6 @@ static void process_synthesis_subpackets (QDM2Context *q, QDM2SubPNode *list)
|
||||
process_subpacket_12(q, NULL);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Decode superblock, fill packet lists.
|
||||
*
|
||||
@ -1354,13 +1377,13 @@ static void qdm2_decode_super_block (QDM2Context *q)
|
||||
} else if (packet->type == 15) {
|
||||
SAMPLES_NEEDED_2("packet type 15")
|
||||
return;
|
||||
} else if (packet->type >= 16 && packet->type < 48 && !fft_subpackets[packet->type - 16]) {
|
||||
} else if (packet->type >= 16 && packet->type < 48 &&
|
||||
!fft_subpackets[packet->type - 16]) {
|
||||
/* packets for FFT */
|
||||
QDM2_LIST_ADD(q->sub_packet_list_B, q->sub_packets_B, packet);
|
||||
}
|
||||
} // Packet bytes loop
|
||||
|
||||
/* **************************************************************** */
|
||||
if (q->sub_packet_list_D[0].packet != NULL) {
|
||||
process_synthesis_subpackets(q, q->sub_packet_list_D);
|
||||
q->do_synth_filter = 1;
|
||||
@ -1369,10 +1392,8 @@ static void qdm2_decode_super_block (QDM2Context *q)
|
||||
process_subpacket_11(q, NULL);
|
||||
process_subpacket_12(q, NULL);
|
||||
}
|
||||
/* **************************************************************** */
|
||||
}
|
||||
|
||||
|
||||
static void qdm2_fft_init_coefficient(QDM2Context *q, int sub_packet,
|
||||
int offset, int duration, int channel,
|
||||
int exp, int phase)
|
||||
@ -1380,7 +1401,8 @@ static void qdm2_fft_init_coefficient (QDM2Context *q, int sub_packet,
|
||||
if (q->fft_coefs_min_index[duration] < 0)
|
||||
q->fft_coefs_min_index[duration] = q->fft_coefs_index;
|
||||
|
||||
q->fft_coefs[q->fft_coefs_index].sub_packet = ((sub_packet >= 16) ? (sub_packet - 16) : sub_packet);
|
||||
q->fft_coefs[q->fft_coefs_index].sub_packet =
|
||||
((sub_packet >= 16) ? (sub_packet - 16) : sub_packet);
|
||||
q->fft_coefs[q->fft_coefs_index].channel = channel;
|
||||
q->fft_coefs[q->fft_coefs_index].offset = offset;
|
||||
q->fft_coefs[q->fft_coefs_index].exp = exp;
|
||||
@ -1388,8 +1410,8 @@ static void qdm2_fft_init_coefficient (QDM2Context *q, int sub_packet,
|
||||
q->fft_coefs_index++;
|
||||
}
|
||||
|
||||
|
||||
static void qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *gb, int b)
|
||||
static void qdm2_fft_decode_tones(QDM2Context *q, int duration,
|
||||
GetBitContext *gb, int b)
|
||||
{
|
||||
int channel, stereo, phase, exp;
|
||||
int local_int_4, local_int_8, stereo_phase, local_int_10;
|
||||
@ -1463,16 +1485,17 @@ static void qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *
|
||||
if (q->frequency_range > (local_int_14 + 1)) {
|
||||
int sub_packet = (local_int_20 + local_int_28);
|
||||
|
||||
qdm2_fft_init_coefficient(q, sub_packet, offset, duration, channel, exp, phase);
|
||||
qdm2_fft_init_coefficient(q, sub_packet, offset, duration,
|
||||
channel, exp, phase);
|
||||
if (stereo)
|
||||
qdm2_fft_init_coefficient(q, sub_packet, offset, duration, (1 - channel), stereo_exp, stereo_phase);
|
||||
qdm2_fft_init_coefficient(q, sub_packet, offset, duration,
|
||||
1 - channel,
|
||||
stereo_exp, stereo_phase);
|
||||
}
|
||||
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void qdm2_decode_fft_packets(QDM2Context *q)
|
||||
{
|
||||
int i, j, min, max, value, type, unknown_flag;
|
||||
@ -1505,7 +1528,9 @@ static void qdm2_decode_fft_packets (QDM2Context *q)
|
||||
if (!packet)
|
||||
return;
|
||||
|
||||
if (i == 0 && (packet->type < 16 || packet->type >= 48 || fft_subpackets[packet->type - 16]))
|
||||
if (i == 0 &&
|
||||
(packet->type < 16 || packet->type >= 48 ||
|
||||
fft_subpackets[packet->type - 16]))
|
||||
return;
|
||||
|
||||
/* decode FFT tones */
|
||||
@ -1545,7 +1570,6 @@ static void qdm2_decode_fft_packets (QDM2Context *q)
|
||||
q->fft_coefs_max_index[j] = q->fft_coefs_index;
|
||||
}
|
||||
|
||||
|
||||
static void qdm2_fft_generate_tone(QDM2Context *q, FFTTone *tone)
|
||||
{
|
||||
float level, f[6];
|
||||
@ -1574,8 +1598,10 @@ static void qdm2_fft_generate_tone (QDM2Context *q, FFTTone *tone)
|
||||
f[4] = tone->table[0] - tone->table[1];
|
||||
f[5] = tone->table[2];
|
||||
for (i = 0; i < 2; i++) {
|
||||
tone->complex[fft_cutoff_index_table[tone->cutoff][i]].re += c.re * f[i];
|
||||
tone->complex[fft_cutoff_index_table[tone->cutoff][i]].im += c.im *((tone->cutoff <= i) ? -f[i] : f[i]);
|
||||
tone->complex[fft_cutoff_index_table[tone->cutoff][i]].re +=
|
||||
c.re * f[i];
|
||||
tone->complex[fft_cutoff_index_table[tone->cutoff][i]].im +=
|
||||
c.im * ((tone->cutoff <= i) ? -f[i] : f[i]);
|
||||
}
|
||||
for (i = 0; i < 4; i++) {
|
||||
tone->complex[i].re += c.re * f[i + 2];
|
||||
@ -1590,7 +1616,6 @@ static void qdm2_fft_generate_tone (QDM2Context *q, FFTTone *tone)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void qdm2_fft_tone_synthesizer(QDM2Context *q, int sub_packet)
|
||||
{
|
||||
int i, j, ch;
|
||||
@ -1662,7 +1687,6 @@ static void qdm2_fft_tone_synthesizer (QDM2Context *q, int sub_packet)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void qdm2_calculate_fft(QDM2Context *q, int channel, int sub_packet)
|
||||
{
|
||||
const float gain = (q->channels == 1 && q->nb_channels == 2) ? 0.5f : 1.0f;
|
||||
@ -1679,7 +1703,6 @@ static void qdm2_calculate_fft (QDM2Context *q, int channel, int sub_packet)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param q context
|
||||
* @param index subpacket number
|
||||
@ -1717,7 +1740,6 @@ static void qdm2_synthesis_filter (QDM2Context *q, int index)
|
||||
q->output_buffer[q->channels * i + ch] += (1 << 23) * q->samples[q->nb_channels * sub_sampling * i + ch];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Init static data (does not depend on specific file)
|
||||
*
|
||||
@ -1731,7 +1753,6 @@ static av_cold void qdm2_init_static_data(AVCodec *codec) {
|
||||
init_noise_samples();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Init parameters from codec extradata
|
||||
*/
|
||||
@ -1908,7 +1929,6 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static av_cold int qdm2_decode_close(AVCodecContext *avctx)
|
||||
{
|
||||
QDM2Context *s = avctx->priv_data;
|
||||
@ -1918,7 +1938,6 @@ static av_cold int qdm2_decode_close(AVCodecContext *avctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int qdm2_decode(QDM2Context *q, const uint8_t *in, int16_t *out)
|
||||
{
|
||||
int ch, i;
|
||||
@ -1981,7 +2000,6 @@ static int qdm2_decode (QDM2Context *q, const uint8_t *in, int16_t *out)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int qdm2_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, AVPacket *avpkt)
|
||||
{
|
||||
@ -2014,8 +2032,7 @@ static int qdm2_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return s->checksum_size;
|
||||
}
|
||||
|
||||
AVCodec ff_qdm2_decoder =
|
||||
{
|
||||
AVCodec ff_qdm2_decoder = {
|
||||
.name = "qdm2",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = AV_CODEC_ID_QDM2,
|
||||
|
Loading…
x
Reference in New Issue
Block a user