[FFmpeg-cvslog] ac3enc: fix 'channel_coupling' option to actually allow 'auto'.

Justin Ruggles git at videolan.org
Thu Aug 11 21:09:22 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Wed Aug 10 10:21:10 2011 -0400| [9542ca9fb743d3fb595ec24c23f96037b15d6b53] | committer: Justin Ruggles

ac3enc: fix 'channel_coupling' option to actually allow 'auto'.

Use 'auto' as the default value.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9542ca9fb743d3fb595ec24c23f96037b15d6b53
---

 libavcodec/ac3enc.c               |    8 ++++++--
 libavcodec/ac3enc_opts_template.c |    2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 291a60d..af837c3 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -2211,8 +2211,12 @@ static av_cold void set_bandwidth(AC3EncodeContext *s)
             cpl_start = s->options.cpl_start;
         } else {
             cpl_start = ac3_coupling_start_tab[s->channel_mode-2][s->bit_alloc.sr_code][s->frame_size_code/2];
-            if (cpl_start < 0)
-                s->cpl_enabled = 0;
+            if (cpl_start < 0) {
+                if (s->options.channel_coupling < 0)
+                    s->cpl_enabled = 0;
+                else
+                    cpl_start = 15;
+            }
         }
     }
     if (s->cpl_enabled) {
diff --git a/libavcodec/ac3enc_opts_template.c b/libavcodec/ac3enc_opts_template.c
index 7c0eead..342dcad 100644
--- a/libavcodec/ac3enc_opts_template.c
+++ b/libavcodec/ac3enc_opts_template.c
@@ -73,7 +73,7 @@ static const AVOption eac3_options[] = {
 /* Other Encoding Options */
 {"stereo_rematrixing", "Stereo Rematrixing", OFFSET(stereo_rematrixing), FF_OPT_TYPE_INT, {.dbl = 1 }, 0, 1, AC3ENC_PARAM},
 #if AC3ENC_TYPE != AC3ENC_TYPE_AC3_FIXED
-{"channel_coupling",   "Channel Coupling",   OFFSET(channel_coupling),   FF_OPT_TYPE_INT, {.dbl = 1 }, 0, 1, AC3ENC_PARAM, "channel_coupling"},
+{"channel_coupling",   "Channel Coupling",   OFFSET(channel_coupling),   FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 1, AC3ENC_PARAM, "channel_coupling"},
     {"auto", "Selected by the Encoder", 0, FF_OPT_TYPE_CONST, {.dbl = -1 }, INT_MIN, INT_MAX, AC3ENC_PARAM, "channel_coupling"},
 {"cpl_start_band", "Coupling Start Band", OFFSET(cpl_start), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 15, AC3ENC_PARAM, "cpl_start_band"},
     {"auto", "Selected by the Encoder", 0, FF_OPT_TYPE_CONST, {.dbl = -1 }, INT_MIN, INT_MAX, AC3ENC_PARAM, "cpl_start_band"},



More information about the ffmpeg-cvslog mailing list