Hi On Fri, Dec 06, 2024 at 03:32:12PM +0100, Niklas Haas wrote: > From: Niklas Haas <g...@haasn.dev> > > This is a lightweight wrapper around the underlying color management system, > whose job it is merely to manage the 3DLUT state and apply them to the frame > data. This is where we might add platform-specific optimizations in the > future. > > I also plan on adding support for more pixel formats in the future. In > particular, we could support YUV or XYZ input formats directly using only > negligible additional code in the 3DLUT setup functions. This would eliminate > the major source of slowdown, which is currently the roundtrip to RGBA64. > --- > libswscale/Makefile | 1 + > libswscale/lut3d.c | 290 ++++++++++++++++++++++++++++++++++++++++++++ > libswscale/lut3d.h | 98 +++++++++++++++ > 3 files changed, 389 insertions(+) > create mode 100644 libswscale/lut3d.c > create mode 100644 libswscale/lut3d.h > > diff --git a/libswscale/Makefile b/libswscale/Makefile > index c4e45d494e..267952d870 100644 > --- a/libswscale/Makefile > +++ b/libswscale/Makefile > @@ -14,6 +14,7 @@ OBJS = alphablend.o \ > graph.o \ > half2float.o \ > input.o \ > + lut3d.o \ > options.o \ > output.o \ > rgb2rgb.o \ > diff --git a/libswscale/lut3d.c b/libswscale/lut3d.c > new file mode 100644 > index 0000000000..e62820b244 > --- /dev/null > +++ b/libswscale/lut3d.c > @@ -0,0 +1,290 @@ > +/* > + * Copyright (C) 2024 Niklas Haas > + * > + * 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 > + */ > + > +#include <assert.h> > +#include <string.h> > + > +#include "libavutil/attributes.h" > +#include "libavutil/avassert.h" > +#include "libavutil/mem.h" > + > +#include "cms.h" > +#include "csputils.h" > +#include "lut3d.h" > + > +SwsLut3D *sws_lut3d_alloc(void) > +{ > + SwsLut3D *lut3d = av_malloc(sizeof(*lut3d)); > + if (!lut3d) > + return NULL; > + > + lut3d->dynamic = false; > + return lut3d; > +} > + > +void sws_lut3d_free(SwsLut3D **plut3d) > +{ > + av_freep(plut3d); > +} > + > +bool sws_lut3d_test_fmt(enum AVPixelFormat fmt, int output) > +{ > + return fmt == AV_PIX_FMT_RGBA64; > +} > + > +enum AVPixelFormat sws_lut3d_pick_pixfmt(SwsFormat fmt, int output) > +{ > + return AV_PIX_FMT_RGBA64; > +} > +
> +/** > + * v0 and v1 are 'black' and 'white' > + * v1 and v2 are closest RGB/CMY vertices probably typo v2, v3 instead thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 1 "Used only once" - "Some unspecified defect prevented a second use" "In good condition" - "Can be repaird by experienced expert" "As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".