[FFmpeg-devel] [PATCH] support for hardcoded mpegaudiodec tables

Reimar Döffinger Reimar.Doeffinger
Mon Oct 26 19:00:10 CET 2009


On Thu, Oct 22, 2009 at 11:13:10PM +0200, Reimar D?ffinger wrote:
> On Thu, Oct 22, 2009 at 10:23:59PM +0200, Michael Niedermayer wrote:
> > On Thu, Oct 22, 2009 at 09:40:27PM +0200, Reimar D?ffinger wrote:
> > > On Thu, Oct 22, 2009 at 08:58:32PM +0200, Michael Niedermayer wrote:
> > > > On Thu, Oct 22, 2009 at 09:04:08AM +0200, Reimar D?ffinger wrote:
> > [...]
> > > > > Also just using printf does not work if you want the generated file not to
> > > > > look like a complete mess.
> > > > 
> > > > IMHO the generated file is not for human consumtion, its just an
> > > > intermediate to get the table into the object file
> > > > but nothing stops one to do a
> > > > if(++x % 8 ==0) printf("\n");
> > > > as well
> > > 
> > > Well, I admit I've never tested it since years, I just remember that
> > > in the past some compilers did not accept arbitrary-size lines (at least
> > > not in the area of MBs).
> > 
> > printf("%d\n", value);
> > does not generate such line
> 
> Ok.
> Still, I have to admit that I'd like to be able to misuse those table prints
> to check for optimization possibilities or some such, so having them
> somewhat human-readable is a plus.
> Also my proposal it hopefully is a one-time effort to implement.
> Have a look at the attached patch and say if you think if this looks
> like a sensible approach to you (obviously it lacks docs etc.).
> I think though that the Makefile should be changed to at least pass
> on CONFIG_SMALL to those host programs, too.

I hope the lack of comment doesn't mean it's so ugly nobody wants to look at it :-).
The _tablegen.c file probably should also have a "header" variable that
will be printed at the top of the generated for e.g. #include headers.
Or probably better, tableinit should be allowed to print whatever it needs,
making the tables[] array just an optional helper.



More information about the ffmpeg-devel mailing list