[Ffmpeg-devel] [PATCH] access all bitrates for amr nb encoding

Michael Niedermayer michaelni
Tue Feb 20 00:49:41 CET 2007


On Mon, Feb 19, 2007 at 02:30:14PM +0100, Benoit Fouet wrote:
> > getting rid of *_opts can be done by simply keeping a single 
> > opt_names, opt_values and opt_name_count and simply going over them every
> > time a context must be initalized, i dont know if that is a good idea but
> > its possible,
> i've not yet worked out the correlation between options and context... i
> mean, for instance, how options for input file(s) are not used for
> output... but i go on reading :)
> >  there are also 2 or so places where you would need to append
> > a option to override some flags in opt_*
> >
> >   
> i don't understand that.

you dont have to unless you want to get rid of *_opts :)

> > either way theres one thing which i think has not been disscussed yet and
> > that is how to route the options in a generic way to the correct context
> >
> > if a option matches exactly then it should be set in all contextx (if thats
> > now done once with split avctx/avformat_opts or every time a context is inited
> > doesnt matter)
> >
> >   
> are there many options that work for two out of {audio; video; subtitle} ?

13 are are marked as for audio and video in AVCodecContext but there are 
likely more which theoretically should be marked for audio+video

> > if there is no exact match bit it starts with "a"/"v"/"s" and the remainder
> > has a match then it would be set only for audio/video/subtitles, does that 
> > work? or do we have some name clashes here?
> >
> > [...]
> >   
> i'm not sure i understand you (once again :) )
> i've not a clear vision of all this works, actually... so it's quite
> hard to follow you.

option parsing works very simply
first the old parsing is done (this is irrelevant for us)

then what isnt handled is feeded into the AVOption code which puts the
name into opt_names and the value into avctx_opts/avformat_opts
that is done in opt_default()

then at appropriate places in the code the stuff from
avctx_opts/avformat_opts is copied into the actual contexts

the problem with audio/video is that there is just 1 avctx_opts which can
not hold 2 different bitrates ...

if its simply split and the options are appropriately put into each then the
problem is solved

independant of that the avctx_opts/avformat_opts * (audio/video/subtitles)
could be changed to a single name/value array which are used instead of
avctx_opts/avformat_opts (i dont know if this is a good idea, i would have
to see the change first to judge which way is cleaner)

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070220/2ff444a3/attachment.pgp>

More information about the ffmpeg-devel mailing list