December 22, 2024

Facebook created a new unit of time; made it Open Source!

Sponsored

Facebook created a new unit of time called flick (frame-tick). Flick is a very small unit of time, it’s just 705600000th of a second, which is just slightly larger than a nanosecond. Flick was created to solve the problem with usage of second as unit of time. People in multimedia sector, while creating visual effects, have to deal with simulations that have to be run with durations a lot less than a second and using fractions can lead to inaccurate results and errors in calculations. To make the process easier, Facebook created a new unit of time. This new unit of time will be an integer and will be able to represent single frame duration for 24Hz, 25Hz, 30Hz, 48Hz, 50Hz, 60Hz, 90Hz, 100Hz, 120Hz and also 1/1000 divisions of each.

Knowing that you should never, ever use floating point representations for accumulated, simulated time (lest your temporal accuracy degrade over time), the std::chrono time tools in C++ are ideal. However, the highest usable resolution, nanoseconds, doesn’t evenly divide common film & media framerates. This was the genesis of this unit.

While flick does deal with fractions of seconds, this unit will not be focusing on NTSC variations as they use values which are of order 24*1000/1001 and 30*1000/1001, which can never be exact.

Sponsored

Flicks will be supporting common audio sample rates in order to accomodate media playbacks. The list is short, but includes 8kHz, 16kHz, 22.05kHz, 24kHz, 32kHz, 44.1kHz, 48kHz, 88.2kHz, 96kHz and 192kHz. Humans can not hear higher frequencies, but they are are used in audio files that will be later resampled or re-timed.

Facebook Created A New Unit Of Time - Flick

This table below helps you understand why Facebook created a new unit of time

1/24 FPS Frame29400000 flicks
1/25 FPS Frame28224000 flicks
1/30 FPS Frame23520000 flicks
1/48 FPS Frame14700000 flicks
1/50 FPS Frame14112000 flicks
1/60 FPS Frame11760000 flicks
1/90 FPS Frame7840000 flicks
1/100 FPS Frame7056000 flicks
1/120 FPS Frame5880000 flicks
1/8000 FPS Frame88200 flicks
1/16000 FPS Frame44100 flicks
1/22050 FPS Frame32000 flicks
1/24000 FPS Frame29400 flicks
1/32000 FPS Frame22050 flicks
1/44100 FPS Frame16000 flicks
1/48000 FPS Frame14700 flicks
1/88200 FPS Frame8000 flicks
1/96000 FPS Frame7350 flicks
1/192000 FPS Frame3675 flicks

 

Installation

Clone the Flicks project from github and place the flicks.h wherever you install C++ header files. Here Flicks are placed in “util” namespace. A C++ file is given with the project stack to test the unit. There is also a make file available that can be used in Linux and OS X.

The project is Open Source and hosted in GitLab, largest Open Source project repository in the world. Flick is placed as a part of OculusVR project.

Sponsored

Share your Opinion

This site uses Akismet to reduce spam. Learn how your comment data is processed.