diff options
author | John Koleszar <jkoleszar@google.com> | 2010-11-04 15:05:45 -0400 |
---|---|---|
committer | John Koleszar <jkoleszar@google.com> | 2010-11-05 08:42:46 -0400 |
commit | f7e187d3626f029490b8b619fb80da1b0e77dcfe (patch) | |
tree | 601183902f8c58362b7baa219a6933e803be47e5 /vp8/encoder/onyx_int.h | |
parent | bd05d9e480623536e35b76cf3cfd6b8884d254ba (diff) | |
download | libvpx-f7e187d3626f029490b8b619fb80da1b0e77dcfe.tar libvpx-f7e187d3626f029490b8b619fb80da1b0e77dcfe.tar.gz libvpx-f7e187d3626f029490b8b619fb80da1b0e77dcfe.tar.bz2 libvpx-f7e187d3626f029490b8b619fb80da1b0e77dcfe.zip |
improve average framerate calculation
Change Ice204e86 identified a problem with bitrate undershoot due to
low precision in the timestamps passed to the library. This patch
takes a different approach by calculating the duration of this frame
and passing it to the library, rather than using a fixed duration
and letting the library average it out with higher precision
timestamps. This part of the fix only applies to vpxenc.
This patch also attempts to fix the problem for generic applications
that may have made the same mistake vpxenc did. Instead of
calculating this frame's duration by the difference of this frame's
and the last frame's start time, we use the end times instead. This
allows the framerate calculation to scavenge "unclaimed" time from
the last frame. For instance:
start | end | calculated duration
======+=======+====================
0ms 33ms 33ms
33ms 66ms 33ms
66ms 99ms 33ms
100ms 133ms 34ms
Change-Id: I92be4b3518e0bd530e97f90e69e75330a4c413fc
Diffstat (limited to 'vp8/encoder/onyx_int.h')
-rw-r--r-- | vp8/encoder/onyx_int.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index 81e32f031..134e03075 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -399,6 +399,7 @@ typedef struct int inter_frame_target; double output_frame_rate; long long last_time_stamp_seen; + long long last_end_time_stamp_seen; long long first_time_stamp_ever; int ni_av_qi; |