Now I get sane sample values, except that they are so low... For
testing, I'm still using "Master Audio 5.0 96khz.dts". In the decoded
samples, I get peaks at 1500 or so, and these are supposed to be 24-bit
values. When converted to 16-bit au, I get peaks at -7 and +6, so it's
very close to silence:

$ au2ascii < out.au |tr ' ' '\n' |sort -n |uniq -c
      1 -7
      1 -6
      6 -5
     40 -4
    879 -3
  19613 -2
 234702 -1
1738350 0
 233593 1
  19517 2
    863 3
     59 4
      6 5

This low level would make more sense for residual encoded channel, but
as far as I see, the residual_encode flag is false. Do you agree that
this file does *not* use residual encoding?

If I convert the reference .flac file I have and do the same statistics,
I get peaks at -2253 and +2520. So that's a factor 400 difference in
audio level.

Is there some scaling somewhere that I'm missing?

For the decoder output, I convert the integer samples to float using

  out[j] += ldexpf (sample_buf[j], shift);

where shift = 1 - bit_resolution = -23.

My public wip repo still at http://www.southpole.se/~nisse/libav.git,
branch xll.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to