[FFmpeg-devel] [PATCH 9/9] Move ff_ac3_critical_band_size_tab in ac3.c for non-hardcoded tables.

Reimar Döffinger Reimar.Doeffinger
Tue Jan 25 20:55:31 CET 2011


On Tue, Jan 25, 2011 at 10:07:29AM -0500, Justin Ruggles wrote:
> On 01/24/2011 08:59 PM, Diego Elio Petten? wrote:
> 
> > This symbol is only ever used to calculate the non-hardcoded tables, so
> > only enable it in that case, and static to the source unit that uses it.
> > ---
> >  libavcodec/ac3.c    |    6 ++++++
> >  libavcodec/ac3tab.c |    5 -----
> >  2 files changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/libavcodec/ac3.c b/libavcodec/ac3.c
> > index 0f442fa..a8b4e0b 100644
> > --- a/libavcodec/ac3.c
> > +++ b/libavcodec/ac3.c
> > @@ -70,6 +70,12 @@ static const uint8_t bin_to_band_tab[253] = {
> >  };
> >  
> >  #else /* CONFIG_HARDCODED_TABLES */
> > +static const uint8_t ff_ac3_critical_band_size_tab[AC3_CRITICAL_BANDS]={
> > +    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
> > +    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
> > +    3, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 24, 24, 24
> > +};
> > +
> >  static uint8_t band_start_tab[51];
> >  static uint8_t bin_to_band_tab[253];
> >  #endif
> > diff --git a/libavcodec/ac3tab.c b/libavcodec/ac3tab.c
> > index 4fc0824..7c0ebcd 100644
> > --- a/libavcodec/ac3tab.c
> > +++ b/libavcodec/ac3tab.c
> > @@ -292,11 +292,6 @@ const uint16_t ff_ac3_fast_gain_tab[8]= {
> >      0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400,
> >  };
> >  
> > -const uint8_t ff_ac3_critical_band_size_tab[AC3_CRITICAL_BANDS]={
> > -    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
> > -    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
> > -    3, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 24, 24, 24
> > -};
> >  /**
> >   * Default channel map for a dependent substream defined by acmod
> >   */
> 
> 
> ok.

Wouldn't it make more sense to simply get rid of ff_ac3_critical_band_size_tab
and just use only band_start_tab?



More information about the ffmpeg-devel mailing list