From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3EA1A410EC for ; Sun, 15 May 2022 16:50:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1B14E68B49C; Sun, 15 May 2022 19:50:11 +0300 (EEST) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7367B68B295 for ; Sun, 15 May 2022 19:50:05 +0300 (EEST) Received: by mail-ej1-f44.google.com with SMTP id m20so24555026ejj.10 for ; Sun, 15 May 2022 09:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=4YoLvPDp/salyw3+MlhnTNbkUyveOTSDDPWSvIsUhQ4=; b=VBoSCKQut8O2vseIjbvS6NATQkn7oIivBYQBf4V1CgKVSxTdU58eKpDKUTvf6eHnUK VOGTKJCRCqNImZt037F9/s4WQppsKJbr1g7/XXppAZ44uVoL5+027M6T4BW469/N8tRN MyAVGo/dC0Xc8mBaTLcgIG3P2MqjmPldOB69mpcrxnzJtjkk8Ek70TQQwqjY9pjD3VT+ c+K21WNZTHJGFqlQ+751wUzI6yD2ybxTku/USHhyml79XyLSVQrzrA6mSlTyZOKLc2Hr eL6gpVocpURZGyvFKGLcmVX9Gy6Lq2F884PE8ToJbFpgYRy+uzayFNcm2JzzwzWAz2jU TpUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=4YoLvPDp/salyw3+MlhnTNbkUyveOTSDDPWSvIsUhQ4=; b=MOMppuSoK5u9HR8O39mbEc+WG2kCnJ8ugww1EYv/CYivmyAPA3IuAc4TIn/tB0c8FS LihndDmNmmn863/0PC42RqUISeGvgNKRlj4Wj4sUrJdu7PZqV6jxwh9BxH8zsbviC8ew H5jfgDZCOlXS3StOtxdYTM1dgjVBoZNyFLBi6iujdUANYLUwoYgRf4xC6efyWzepW0Ci UTh+OtGTVFPmuJQwEvtTv9DHX3wnRhxszwWs74hjcetKKIBt/n+tQKM0yPOevs3w456l ujia4cw8jv/gyrV7EHUXx3QqjGA0kCNMLWYZjeAOuHnRLnHd2Ei2cU51F28mQ8IKEiUw GHaA== X-Gm-Message-State: AOAM531qlCOKqPhYjCqx6OYmpNyu2flkrr1SRDk9GIOx04nO9IfF+TQx yAaJpZ2kVOpTd2PzCNStnZPEYaoWDNkoq/7cFxczXExo X-Google-Smtp-Source: ABdhPJxxEccxRTl4MHgaxoFWmI+g8KRn/Li8LSH9xIfi2r3Dt8dwuhzHm1kMhodP/CZ2QloWMH3PFd8sLeb3gGvUGBA= X-Received: by 2002:a17:907:1c82:b0:6f4:60e5:1ddd with SMTP id nb2-20020a1709071c8200b006f460e51dddmr12186344ejc.274.1652633403392; Sun, 15 May 2022 09:50:03 -0700 (PDT) MIME-Version: 1.0 References: <20220513154208.17941-1-leo.izen@gmail.com> <20220513212245.GN396728@pb2> In-Reply-To: <20220513212245.GN396728@pb2> From: "Ronald S. Bultje" Date: Sun, 15 May 2022 12:49:51 -0400 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] avutil/csp: create public API for colorspace structs X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Hi, On Fri, May 13, 2022 at 5:22 PM Michael Niedermayer wrote: > 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 > To explain: when I designed this stuff, I chose to keep them in float so that we can use the literal values from the specs, which are themselves in floating point. That would not be possible anymore, and would therefore make it slightly harder to read for a casual observer. (Otherwise no opinion, I'm typically used to fixed-point rather than floating-point myself also.) Ronald _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".