[XviD-devel] versioning

Christoph Lampert xvid-devel@xvid.org
Thu, 25 Jul 2002 09:31:04 +0200 (CEST)


Hi,

I agree that versioning is necessary soon. 
My advice would only be: A value of 0 for a flag should always mean
"off" for a feature! 

That way, the whole API structure can be initialized using 

memset(&Struct,0x00,sizeof(Struct))   // clear everything
Struct.somefield=something;
Struct.someotherfield=something;  // just fill fields you know about

independent of the verson and even if the API gets bigger and you don't
accidentially activate anything and crash the encoder. The behaviour of
the program with this type of init would not change, if the API is
extended (and the program recompiled). 

E.g. if would not be a problem to add "b-frames" support, if max_bframes=0
would cause the encoder to behave exactly in the way of XviD without
b-frames does ( and what max_bframes=-1 does now). 
I don't really like the method of 0 meaning "no bframes" and 
-1 meaning "no bframes at all" :-( This should be changed in final
version. 
We could e.g. use "max_pframe_distance" instead, which corresponds to 
max_bframes+1, so 0 means "all off", 1 means "PPPPP" but without lowdelay
and 3 means PBBP. 

The other idea would really be an "extensions" field pointer, like DivX
has. It's not really necessary, if the zero-rule is used, but otherwise,
it would be an easy way to let 1 value of NULL switch off all extended
features. 
E.g. the normal API would be "Simple Profile" and the extension could be
new option for "Advanced Simple profile". 

gruel

-- 
Christoph H. Lampert chl@math.uni-bonn.de | Diese Signature wurde maschi-     
Beringstr. 6, Raum 14 Tel. (0228) 73-2948 | nell erstellt und bedarf
Sprechstunden: keine, aber meistens da    | keiner Unterschrift. AZ 27B-6