[FFmpeg-cvslog] ac3enc: remove bandwidth reduction as fallback for bit allocation failure.

Justin Ruggles git at videolan.org
Mon May 2 03:46:01 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Fri Apr 15 22:45:05 2011 -0400| [a1d0f511fc3a758146d9384ccaab31743d8bd600] | committer: Justin Ruggles

ac3enc: remove bandwidth reduction as fallback for bit allocation failure.

It was only needed at low bitrates, which now already use a low bandwidth, so
the bandwidth reduction is no longer needed.

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

 libavcodec/ac3enc.c |   30 ------------------------------
 1 files changed, 0 insertions(+), 30 deletions(-)

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index b61021f..6d899f5 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1123,27 +1123,6 @@ static int downgrade_exponents(AC3EncodeContext *s)
 
 
 /**
- * Reduce the bandwidth to reduce the number of bits used for a given SNR offset.
- * This is a second fallback for when bit allocation still fails after exponents
- * have been downgraded.
- * @return non-zero if bandwidth reduction was unsuccessful
- */
-static int reduce_bandwidth(AC3EncodeContext *s, int min_bw_code)
-{
-    int ch;
-
-    if (s->bandwidth_code[0] > min_bw_code) {
-        for (ch = 0; ch < s->fbw_channels; ch++) {
-            s->bandwidth_code[ch]--;
-            s->nb_coefs[ch] = s->bandwidth_code[ch] * 3 + 73;
-        }
-        return 0;
-    }
-    return -1;
-}
-
-
-/**
  * Perform bit allocation search.
  * Finds the SNR offset value that maximizes quality and fits in the specified
  * frame size.  Output is the SNR offset and a set of bit allocation pointers
@@ -1168,15 +1147,6 @@ static int compute_bit_allocation(AC3EncodeContext *s)
             continue;
         }
 
-        /* fallback 2: reduce bandwidth */
-        /* only do this if the user has not specified a specific cutoff
-           frequency */
-        if (!s->cutoff && !reduce_bandwidth(s, 0)) {
-            process_exponents(s);
-            ret = compute_bit_allocation(s);
-            continue;
-        }
-
         /* fallbacks were not enough... */
         break;
     }



More information about the ffmpeg-cvslog mailing list