[FFmpeg-devel] [PATCH] [libavutil] Add saturated add/sub operations for int64_t.

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri May 1 12:37:23 EEST 2020


Am Fr., 1. Mai 2020 um 02:46 Uhr schrieb Dale Curtis <dalecurtis at chromium.org>:
>
> On Thu, Apr 30, 2020 at 5:21 PM James Almer <jamrial at gmail.com> wrote:
>
> > On 4/30/2020 7:19 PM, Dale Curtis wrote:
> > > Many places are using their own custom code for handling overflow
> > > around timestamps or other int64_t values. There are enough of these
> > > now that having some common saturated math functions seems sound.
> > >
> > > This adds implementations that just use the builtin functions for
> > > recent gcc, clang when available or implements its own version for
> > > older compilers.
> >
> > These look like 64 bit versions of av_sat_add32 and av_sat_sub32, from
> > common.h, so you should probably add them there and rename them
> > accordingly.
> >
> >
> Ah! I was looking for those, but missed them. Thanks. Done.

This patch is not ok, please split it.

Carl Eugen


More information about the ffmpeg-devel mailing list