Skip to content

Commit

Permalink
aacenc: Fix determination of Mid/Side Mode.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
saintdev authored and aconverse committed Jun 29, 2011
1 parent d3a6c2a commit 98add74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavcodec/aacenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 98add74

Please sign in to comment.