[Ffmpeg-devel] moving non-SIMD parts of libswscale to LGPL

Michael Niedermayer michaelni
Sat Nov 11 19:32:58 CET 2006


Hi

On Fri, Nov 10, 2006 at 03:47:16PM +0100, Luca Abeni wrote:
> Hi all,
> 
> a good number of swscale authors agreed to relicense the non-SIMD parts
> as LGPL (I still need to contact some authors, I hope there will be no
> problems for what concerns swscale* and rgb2rgb*), so I started looking
> at preparing a patch for this...
> 
> The problem is that I've not been able to contact the authors of
> yuv2rgb* (most of the email addresses listed in the files headers are
> not valid anymore, and my emails bounched).
> Since such files are only used for fast unscaled conversions and swscale
> should be able to work even without them (as pointed out by Michael), I
> tried to compile libswscale without using yuv2rgb*.
> 
> But swscale.c and swscale_template.c use some tables that are contained
> in yuv2rgb.c... Since (I think - please correct me if I am wrong) tables
> are not copyrightable, I linked them in the LGPL version of the

IANAL, tables are copyrightable, what is not copyrightable are things which
are solutions to specific problems, like the ratio between
the circumference and the radius of a circle or the key to decrypt some
message, or such, again IANAL

the coefficients to convert between yuv spaces of 2 international standards
are IMHO not copyrightable again IANAL ...
if you want to be perfectly safe, just look at the specific standards
and scale the values as neccesarily or invert the matrix if they are
written only for the "wrong" direction
ive copy and pasted the tables from the mpeg4 spec below ...


if video_range=0:
                     n-8          n-4
       Y  = ( 219 * 2   * EY ) + 2 .
                     n-8           n-1
       Cb = ( 224 * 2   * EPB ) + 2
                     n-8           n-1
       Cr = ( 224 * 2   * EPR ) + 2
if video_range=1:
              n
       Y = ((2 -1) * EY )
                 n                    n-1
       Cb = ((2 -1) * EPB ) + 2
                n                    n-1
       Cr = ((2 -1) * EPR ) + 2
for n bit video.
For example, for 8 bit video,
video_range=0 gives a range of Y from 16 to 235, Cb and Cr from 16 to 240;
video_range=1 gives a range of Y from 0 to 255, Cb and Cr from 0 to 255.
                                Table 6-9 -- Matrix Coefficients
           Value                Matrix
           0                    (forbidden)
           1                    ITU-R Recommendation BT.709
                                EY = 0,7152 EG + 0,0722 EB + 0,2126 ER
                                EPB = -0,386 EG + 0,500 EB -0,115 ER
                                EPR = -0,454 EG - 0,046 EB + 0,500 ER
           2                    Unspecified Video
                                     Image characteristics are unknown.
           3                    reserved
           4                    FCC
                                EY = 0,59 EG + 0,11 EB + 0,30 ER
                                EPB = -0,331 EG + 0,500 EB -0,169 ER
                                EPR = -0,421 EG - 0,079 EB + 0,500 ER
           5                    ITU-R Recommendation BT.470-2 System B, G
                                EY = 0,587 EG + 0,114 EB + 0,299 ER
                                EPB = -0,331 EG + 0,500 EB -0,169 ER
                                EPR = -0,419 EG - 0,081 EB + 0,500 ER
           6                    SMPTE 170M
                                EY = 0,587 EG + 0,114 EB + 0,299 ER
                                EPB = -0,331 EG + 0,500 EB -0,169 ER
                                EPR = -0,419 EG - 0,081 EB + 0,500 ER
           7                    SMPTE 240M (1987)
                                EY = 0,701 EG + 0,087 EB + 0,212 ER
                                EPB = -0,384 EG + 0,500 EB -0,116 ER
                                EPR = -0,445 EG - 0,055 EB + 0,500 ER
           8-255 reserved


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list