On Fri, May 13, 2022 at 11:42:08AM -0400, Leo Izen wrote: > This commit moves some of the functionality from avfilter/colorspace > into avutil/csp and exposes it as a public API so it can be used by > libavcodec and/or libavformat. [...] > diff --git a/libavutil/csp.h b/libavutil/csp.h > new file mode 100644 > index 0000000000..1bcde7ddd3 > --- /dev/null > +++ b/libavutil/csp.h > @@ -0,0 +1,49 @@ > +/* > + * Copyright (c) 2016 Ronald S. Bultje > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with FFmpeg; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > + */ > + > +#ifndef AVUTIL_CSP_H > +#define AVUTIL_CSP_H > + > +#include "libavutil/frame.h" > +#include "libavutil/pixfmt.h" > + > +struct LumaCoefficients { > + double cr, cg, cb; > +}; > + > +struct PrimaryCoefficients { > + double xr, yr, xg, yg, xb, yb; > +}; > + > +struct WhitepointCoefficients { > + double xw, yw; > +}; I think we should avoid floating point so as to ensure reproduceable results and simplify regerssion testing thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Modern terrorism, a quick summary: Need oil, start war with country that has oil, kill hundread thousand in war. Let country fall into chaos, be surprised about raise of fundamantalists. Drop more bombs, kill more people, be surprised about them taking revenge and drop even more bombs and strip your own citizens of their rights and freedoms. to be continued