[FFmpeg-devel] [PATCH v1] filter select - avoid 2 times rounding

Nicolas George george at nsup.org
Fri Jul 19 20:23:59 EEST 2019


Ulf Zibis (12019-07-19):
> So please give an alternative theory than a rounding issue, why I
> actually experience a different result.

Code with doubles is very fragile, changing anything in the structure of
your formula will give slightly different results. You were just lucky
that this change made your use case work.

> In the current code there is a 1st rounding with "(double)(time_base.nom
> / time_base.den)" and then a 2nd with multipliying this value with
> "frame->pts". In my code there is only 1 rounding after division of
> (int64_t)(frame->pts * time_base.nom) with "(double)time_base.den".

There is no rounding, all is done in double.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190719/dd3ba3ff/attachment.sig>


More information about the ffmpeg-devel mailing list