ac3dec: make drc_scale exponentially
authorJohn Stebbins <stebbins@jetheaddev.com>
Wed, 20 Nov 2013 17:26:45 +0000 (09:26 -0800)
committerAnton Khirnov <anton@khirnov.net>
Mon, 9 Dec 2013 07:54:42 +0000 (08:54 +0100)
The a52 spec suggests that "partial compression" should scale the
drc value in this manner.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/ac3dec.c

index 7172e63..e1c6962 100644 (file)
@@ -756,8 +756,8 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
     i = !s->channel_mode;
     do {
         if (get_bits1(gbc)) {
     i = !s->channel_mode;
     do {
         if (get_bits1(gbc)) {
-            s->dynamic_range[i] = ((dynamic_range_tab[get_bits(gbc, 8)] - 1.0) *
-                                  s->drc_scale) + 1.0;
+            s->dynamic_range[i] = powf(dynamic_range_tab[get_bits(gbc, 8)],
+                                       s->drc_scale);
         } else if (blk == 0) {
             s->dynamic_range[i] = 1.0f;
         }
         } else if (blk == 0) {
             s->dynamic_range[i] = 1.0f;
         }