[FFmpeg-cvslog] aacenc: Fix determination of Mid/Side Mode.

Nathan Caldwell git at videolan.org
Thu Jun 30 04:44:02 CEST 2011


ffmpeg | branch: master | Nathan Caldwell <saintdev at gmail.com> | Tue Jun 28 21:11:39 2011 -0600| [98add74e85967441d6b7263d1eee79aa2d98cd82] | committer: Alex Converse

aacenc: Fix determination of Mid/Side Mode.

In adjust_frame_information(), msc is incremented for each sfb in each
sub-window then compared against max_sfb which is for a single sub-window.

This resulted in frames using EIGHT_SHORT_SEQUENCE where the first few
sub-windows increment msc to a value that results in ms_mode == 2. Even
though only some of the bands are actually using Mid/Side.

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

 libavcodec/aacenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index dd8a83c..eae9332 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -364,7 +364,7 @@ static void adjust_frame_information(AACEncContext *apc, ChannelElement *cpe, in
         if (msc == 0 || ics0->max_sfb == 0)
             cpe->ms_mode = 0;
         else
-            cpe->ms_mode = msc < ics0->max_sfb ? 1 : 2;
+            cpe->ms_mode = msc < ics0->max_sfb * ics0->num_windows ? 1 : 2;
     }
 }
 



More information about the ffmpeg-cvslog mailing list