History

dcadec: fix xxch_dmix_coeff and xxch_dmix_sf after merge

Michael Niedermayer committed 12 years ago

Commit 4e4dbb91 parent c867be01 file · +6 −6Browse files

Unified · Split

libavcodec/dcadec.c+6−6
@@ -478,6 +478,8 @@ typedef struct { · 477 unmodified lines
478 FmtConvertContext fmt_conv;478 FmtConvertContext fmt_conv;
479} DCAContext;479} DCAContext;
480 480
481static float dca_dmix_code(unsigned code);
482
481static const uint16_t dca_vlc_offs[] = {483static const uint16_t dca_vlc_offs[] = {
482 0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364,484 0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364,
483 5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508,485 5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508,
@@ -568,7 +570,7 @@ static int dca_parse_audio_coding_header(DCAContext *s, int base_channel, · 84 unmodified lines
568 static const int bitlen[11] = { 0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3 };570 static const int bitlen[11] = { 0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3 };
569 static const int thr[11] = { 0, 1, 3, 3, 3, 3, 7, 7, 7, 7, 7 };571 static const int thr[11] = { 0, 1, 3, 3, 3, 3, 7, 7, 7, 7, 7 };
570 int hdr_pos = 0, hdr_size = 0;572 int hdr_pos = 0, hdr_size = 0;
571 float sign, mag, scale_factor;573 float scale_factor;
572 int this_chans, acc_mask;574 int this_chans, acc_mask;
573 int embedded_downmix;575 int embedded_downmix;
574 int nchans, mask[8];576 int nchans, mask[8];
@@ -598,8 +600,8 @@ static int dca_parse_audio_coding_header(DCAContext *s, int base_channel, · 23 unmodified lines
598 /* check for downmixing information */600 /* check for downmixing information */
599 if (get_bits1(&s->gb)) {601 if (get_bits1(&s->gb)) {
600 embedded_downmix = get_bits1(&s->gb);602 embedded_downmix = get_bits1(&s->gb);
601 scale_factor =603 coeff = get_bits(&s->gb, 6);
602 1.0f / dca_dmixtable[(get_bits(&s->gb, 6) - 1) << 2];604 scale_factor = -1.0f / dca_dmix_code(FFMAX(coeff<<2, 4)-3);
603 605
604 s->xxch_dmix_sf[s->xxch_chset] = scale_factor;606 s->xxch_dmix_sf[s->xxch_chset] = scale_factor;
605 607
@@ -619,10 +621,8 @@ static int dca_parse_audio_coding_header(DCAContext *s, int base_channel, · 13 unmodified lines
619 }621 }
620 622
621 coeff = get_bits(&s->gb, 7);623 coeff = get_bits(&s->gb, 7);
622 sign = (coeff & 64) ? 1.0 : -1.0;
623 mag = dca_dmixtable[((coeff & 63) - 1) << 2];
624 ichan = dca_xxch2index(s, 1 << i);624 ichan = dca_xxch2index(s, 1 << i);
625 s->xxch_dmix_coeff[j][ichan] = sign * mag;625 s->xxch_dmix_coeff[j][ichan] = dca_dmix_code(FFMAX(coeff<<2, 3)-3);
626 }626 }
627 }627 }
628 }628 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t