Skip to content

Commit

Permalink
Fix decoding 16-bit lpc subframes
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Aug 29, 2014
1 parent 6325e74 commit 450bdb4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,8 @@ var FLACDecoder = AV.Decoder.extend(function() {

if (this.bps <= 16) {
for (var i = predictor_order; i < blockSize - 1; i += 2) {
var c = coeffs[0],
d = decoded[i - predictor_order],
s0 = 0, s1 = 0;
var d = decoded[i - predictor_order],
s0 = 0, s1 = 0, c = 0;

for (var j = predictor_order - 1; j > 0; j--) {
c = coeffs[j];
Expand All @@ -342,6 +341,7 @@ var FLACDecoder = AV.Decoder.extend(function() {
s1 += c * d;
}

c = coeffs[0];
s0 += c * d;
d = decoded[i] += (s0 >> qlevel);
s1 += c * d;
Expand Down

2 comments on commit 450bdb4

@master255
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

@hontongwanchana
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``src/decoder.js

Please sign in to comment.