[Ffmpeg-devel] [RFC] [PATCH] FLC/FLX/DTA encoder

Uoti Urpala uoti.urpala
Wed Feb 28 04:05:24 CET 2007


On Wed, 2007-02-28 at 12:35 +1100, Steven Johnson wrote:
> Uoti Urpala wrote:
> Code I can understand.  Taking what you posted on face value as an
> optimal solution in palette_size^3 time, If I was to take your code and
> modify it to replace the code I wrote, what sort of licence applies
> (GPL, LGPL, some other?).

GPL or LGPL, if you want to use it and the choice matters I suppose I
could license it under LGPL.

>   Most of the code would be the same, assuming
> it works, with tweaks to get rid of global data, handle palettes, etc,
> so your licence on this effects its usability.  Although I was less than
> thrilled by the goto's.

As I said it was written as "throwaway" code but optimized. Making it
look pretty wasn't particularly high on the list of priorities. I think
the gotos are not a problem though - IMO gotos are often the most
appropriate construct to use in algorithmic code where the real
structure of control flow really IS nontrivial, and use of other
constructs would just be trying to hide that (under even more complexity
such as extra state variables). 

> Old : New : Matches Count
> 0 : 10 : 9
> 0 : 11 : 8
> 1 : 10 : 10
> 1 : 11 : 7
> Every other permutation matches 0 times.
> 
> Should give Indexes:
> 0 becomes 11
> 1 becomes 10
> 2..255 becomes 0..9,12..255
> 
> Would it, using this algorithm?
> What index to index match does it pick for 2..255 matching 0..9,12..255,
> as all permutations equal 0?

It'll pick some optimal permutation. If you have a "preferred" one for
every case it probably isn't always going to match that. I tested the
program with your example (with values 20-9, 20-8 etc and 20 for rest)
and the resulting permutation was:
11 10 2 3 ... 8 9 12 13 ... 254 255 1 0
so 0->10, 1->11, 2..9->2..9, 10..253->12..255, 254..255->0..1





More information about the ffmpeg-devel mailing list