On 01/22/2014 11:29 AM, John Stebbins wrote:
On 01/14/2014 09:11 AM, John Stebbins wrote:
On 01/13/2014 11:09 AM, Justin Ruggles wrote:
On 01/13/2014 01:08 PM, Justin Ruggles wrote:
On 01/13/2014 01:04 PM, John Stebbins wrote:
Amplification of quiet sounds is enhanced.
Inspired by gbooker's A52Decoder.
---
   libavcodec/ac3dec.c | 11 ++++++++---
   1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 87638e7..0416dbc 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -772,8 +772,13 @@ static int decode_audio_block(AC3DecodeContext
*s, int blk)
       i = !s->channel_mode;
       do {
           if (get_bits1(gbc)) {
-            s->dynamic_range[i] =
powf(dynamic_range_tab[get_bits(gbc, 8)],
-                                       s->drc_scale);
+            /* Allow asymmetric application of DRC when drc_scale > 1.
+               Amplification of quiet sounds is enhanced */
+            float range = dynamic_range_tab[get_bits(gbc, 8)];
+            if (range > 1.0 || s->drc_scale <= 1.0)
+                s->dynamic_range[i] = powf(range, s->drc_scale);
+            else
+                s->dynamic_range[i] = range;
           } else if (blk == 0) {
               s->dynamic_range[i] = 1.0f;
           }
@@ -1487,7 +1492,7 @@ static av_cold int
ac3_decode_end(AVCodecContext *avctx)
   #define OFFSET(x) offsetof(AC3DecodeContext, x)
   #define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
   static const AVOption options[] = {
-    { "drc_scale", "percentage of dynamic range compression to
apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 1.0}, 0.0, 1.0,
PAR },
+    { "drc_scale", "percentage of dynamic range compression to
apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 1.0}, 0.0, 6.0,
PAR },
       { NULL},
   };
Would you mind adding some documentation to muxers.texi?
Sorry, I meant encoders.texi

-Justin


Did you want me to take a stab at adding decoders.texi?  I'll probably make a 
hash of it, but it would be a start.

Ping.  Were you waiting for me to take a stab at creating decoders.texi?  Or 
just preoccupied?


Sorry, mainly preoccupied. The patch itself is fine. Creating decoders.texi and documenting it would be nice. Can be a separate patch though.

-Justin

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

Reply via email to