[FFmpeg-devel] [PATCH v4] avutil/csp: create avpriv API for colorspace structs

Ronald S. Bultje rsbultje at gmail.com
Fri May 20 16:39:37 EEST 2022


Hi,

On Fri, May 20, 2022 at 9:11 AM Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Fri, May 20, 2022 at 07:26:56AM -0400, Ronald S. Bultje wrote:
> > On Fri, May 20, 2022 at 6:28 AM Michael Niedermayer <
> michael at niedermayer.cc>
> > > 1. exactly representing values
> >
> > This isn't actually what I meant when I made the argument. If the spec
> says
> > "0.137", I'd expect to be able to git grep the source code for "0.137"
> and
> > find where it's defined. This is lost with AVRational, where it becomes {
> > 137, 1000 }. This may sound silly, but I find this helpful.
> >
> > One way to address this is to add the exact value in a comment, like
> > "(AVRational) { 137, 1000 }, // 0.137". This isn't pretty but retains
> > grep-discoverability.
>
> We use fixed point numbers in multiple places without
> loosing grep-discoverability
> for example
>
[..]

> the advantage over a comment is that a comment can be forgotten
> the argument for a macro cannot be forgotten and still succeed build
>

That sounds reasonable, I'm OK with this approach.

Ronald


More information about the ffmpeg-devel mailing list