[FFmpeg-soc] [PATCH] AACENC: Fix HCB selection

Alex Converse alex.converse at gmail.com
Fri May 29 18:41:10 CEST 2009


On Fri, May 29, 2009 at 12:00 AM, Kostya <kostya.shishkov at gmail.com> wrote:
>
> On Thu, May 28, 2009 at 05:53:51PM -0400, Alex Converse wrote:
> > Hi,
> >
> > This patch seems to vastly improve HCB selection in the AAC encoder.
> > The screenshot demonstrates its results. (out-1 is before, out-2 is
> > after, chunk is input)
> >
> > Regards,
> > Alex Converse
>
> I believe it does, the question is why?
> I see two changes - in codebook selection (which does the same thing
> on the first glance) and in its traversal.

The first chunk of the new code iterates over each stage (swb) and
figures out the total cost to get to each state (hcb) by staying in
that state from the previous stage and by transitioning to that state
from the lowest cost state of the previous stage.

The old code seems to also iterate over each chunk and figures out the
cost to get to each state (hcb) by staying in that state from the
previous stage then it seems to compute, as it's alternate cost, the
cost of navigating to that state in the previous stage plus the cost
of the lowest cost stage of *this state* (including run increase
penalties but not the navigation cost). If that cost is lower, we mark
it as a transition from the lowest cost state this stage. That second
quantity and how it is handled doesn't seem to make a lot of sense.

> Does the second part fix some bug, simple ineffectiveness or simply
> needed for changed codebook selection scheme?
>

The second part simply walks us back to the proper place to look at
the previous state on a run > 1. It's hard to evaluate on it's own
since the old code it interfaced with doesn't make a lot of sense.

[...]

--Alex


More information about the FFmpeg-soc mailing list