[FFmpeg-devel] [PATCH v2 12/17] swscale/csputils: add internal colorspace math helpers

Niklas Haas ffmpeg at haasn.xyz
Fri Dec 20 13:15:30 EET 2024


On Thu, 19 Dec 2024 19:17:52 +0100 Michael Niedermayer <michael at niedermayer.cc> wrote:
> Hi
>
> On Mon, Dec 16, 2024 at 12:17:33PM +0100, Niklas Haas wrote:
> > From: Niklas Haas <git at haasn.dev>
> >
> > Logic is, for the most part, a straight port of similar logic in
> > liplacebo's colorspace.c, with some general edits and refactors.
> > ---
> >  libswscale/Makefile   |   1 +
> >  libswscale/csputils.c | 418 ++++++++++++++++++++++++++++++++++++++++++
> >  libswscale/csputils.h | 114 ++++++++++++
> >  3 files changed, 533 insertions(+)
> >  create mode 100644 libswscale/csputils.c
> >  create mode 100644 libswscale/csputils.h
>
> should be ok.
> I wonder if this couldnt all be done using fix point integers making
> it all bitexact though

It could be done, although we will most likely end up wanting to convert to
floats for the final processing code in any case, for performance. I will leave
it as is for now to avoid regressing the already-tested logic before merging,
but I think it would be doable to convert this math to fixed point in the
future.

For accuracy reasons, it would be better to switch from using matrix inversions
to computing matrix divisions instead, and there's a chance we may have to do
this anyway to avoid precision loss when using fixed point integers. (Which are
only bitexact when no overflow occurs..)

>
> thx
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Democracy is the form of government in which you can choose your dictator
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list