[FFmpeg-devel] [PATCH] v2: lavu/pixdesc: favour formats where depth and subsampling exactly match

Michael Niedermayer michael at niedermayer.cc
Thu Sep 15 21:00:07 EEST 2022


On Wed, Sep 14, 2022 at 03:43:04PM -0700, Philip Langdale wrote:
> On Wed, 14 Sep 2022 23:08:16 +0200
> Michael Niedermayer <michael at niedermayer.cc> wrote:
[...]
> > > +            // Favour formats where bit depth exactly matches. If
> > > all other
> > > +            // scoring is equal, we'd rather use the bit depth
> > > that most closely
> > > +            // matches the source.  
> > 
> > ok
> > 
> > 
> > > +            loss |= FF_LOSS_EXCESS_DEPTH;
> > > +            score -= 1 << -depth_delta;  
> > 
> > but does that do that ?
> > a 1bpp -> 16bpp has a considerable -depth_delta
> > 
> > do we need the << at all ?
> 
> The idea here is to have the scoring reflect the gap. Are you saying
> you'd just apply the depth_delta as-is (just a small number 1 <= n <=
> 15)?

yes it makes this less constrained
with the shifts there are only 32 distinct values with a int

I presume the shifts where there to give the loss some material sense
as in PSNR or SAD or something like that, 8 bits output having 4 times
worse precission than 10 bit for example. 

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220915/b09d5d8c/attachment.sig>


More information about the ffmpeg-devel mailing list