diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-03 17:30:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-04 15:10:09 +0100 |
commit | b317f9459f4c8f96b01bf20ce33a7f243d33a02c (patch) | |
tree | aa3e9a013f26401df286356058bd3ed858214c0f /libavutil/mathematics.h | |
parent | de5b6c736bcba27357b98782afdc642128cf1f89 (diff) | |
download | ffmpeg-b317f9459f4c8f96b01bf20ce33a7f243d33a02c.tar.gz |
avutil/mathematics: add av_add_stable()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/mathematics.h')
-rw-r--r-- | libavutil/mathematics.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavutil/mathematics.h b/libavutil/mathematics.h index bfb5414312..a8b1d8eb31 100644 --- a/libavutil/mathematics.h +++ b/libavutil/mathematics.h @@ -141,6 +141,20 @@ int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod); int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb); /** + * Add a value to a timestamp. + * + * This function gurantees that when the same value is repeatly added that + * no accumulation of rounding errors occurs. + * + * @param ts Input timestamp + * @param ts_tb Input timestamp timebase + * @param inc value to add to ts + * @param inc_tb inc timebase + */ +int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc); + + + /** * @} */ |