[FFmpeg-devel] FFmpeg code Attribution

Aaron Boxer boxerab at gmail.com
Thu Mar 24 15:32:08 CET 2016


On Thu, Mar 24, 2016 at 8:23 AM, Alex Beregszaszi <alex at rtfs.hu> wrote:

> On Wed, Mar 23, 2016 at 10:35 PM, Aaron Boxer <boxerab at gmail.com> wrote:
>
> > On Wed, Mar 23, 2016 at 3:59 PM, Michael Bradshaw <mjbshaw at gmail.com>
> > wrote:
> >
> > > On Wed, Mar 23, 2016 at 12:24 PM, Aaron Boxer <boxerab at gmail.com>
> wrote:
> > > > Hello Again,
> > > >
> > > > I took a look at the FFmpeg j2k code. Now, I've worked with OpenJPEG
> > for
> > > > many years, and I would say at least 20% of the code in FFmpeg was
> > either
> > > > directly copied from OpenJPEG, or is very similar to OpenJPEG code.
> > > >
> > > > I think the people who did the work on the FFmpeg codec would readily
> > > admit
> > > > that they copied a certain amount directly from the other project.
> > > >
> > > > So, I think that the OpenJPEG BSD license should appear on those
> files
> > > with
> > > > copied code from OpenJPEG, to comply with the BSD license. I can list
> > > some
> > > > of the files (there aren't many) if people are interested.
> > >
> > > Go ahead and list the files and sections of code you're concerned
> > > about (or the commits that introduced the code). Chances are that's
> > > going to come up in the thread anyway, so might as well do it from the
> > > get-go.
> > >
> >
> > Here is the most obvious example:
> >
> > j2kenc.c (from FFmpeg)
> >
> > static int getnmsedec_sig(int x, int bpno)
> > {
> >     if (bpno > NMSEDEC_FRACBITS)
> >         return lut_nmsedec_sig[(x >> (bpno - NMSEDEC_FRACBITS)) & ((1 <<
> > NMSEDEC_BITS) - 1)];
> >     return lut_nmsedec_sig0[x & ((1 << NMSEDEC_BITS) - 1)];
> > }
> >
> > static int getnmsedec_ref(int x, int bpno)
> > {
> >     if (bpno > NMSEDEC_FRACBITS)
> >         return lut_nmsedec_ref[(x >> (bpno - NMSEDEC_FRACBITS)) & ((1 <<
> > NMSEDEC_BITS) - 1)];
> >     return lut_nmsedec_ref0[x & ((1 << NMSEDEC_BITS) - 1)];
> > }
> >
> >
> >
> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> >
> > t1.c (from OpenJPEG)
> >
> > int16_t opj_t1_getnmsedec_sig(uint32_t x, uint32_t bitpos)
> > {
> >     if (bitpos > 0) {
> >         return lut_nmsedec_sig[(x >> (bitpos)) & ((1 << T1_NMSEDEC_BITS)
> -
> > 1)];
> >     }
> >
> >     return lut_nmsedec_sig0[x & ((1 << T1_NMSEDEC_BITS) - 1)];
> > }
> >
> > int16_t opj_t1_getnmsedec_ref(uint32_t x, uint32_t bitpos)
> > {
> >     if (bitpos > 0) {
> >         return lut_nmsedec_ref[(x >> (bitpos)) & ((1 << T1_NMSEDEC_BITS)
> -
> > 1)];
> >     }
> >
> >     return lut_nmsedec_ref0[x & ((1 << T1_NMSEDEC_BITS) - 1)];
> > }
> >
> >
> >
> ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> >
> > I will post more later.
> >
>
>
> Not having seen the specification I do have a question: Is it possible this
> code piece is in the spec? Many specs contain sample code or a description
> leading to very similar implementations.
>
> I think this is important to double check and try to stay not biased.
>

The final draft of the standard can be found here:

http://web.archive.org/web/20060619205049/http://www.jpeg.org/public/fcd15444-1.pdf

(if you don't want to pay 200 swiss francs for the current version)

I am quite sure that the standard does not contain any code samples.

There were originally two reference implementations, one in Java and one in
C.
Both of these are now abandonware.

OpenJPEG was an upstart codec that became a reference implementation last
year.
Currently the only actively developed reference implementation for the
standard.

Cheers,
Aaron


More information about the ffmpeg-devel mailing list