Monday, January 22, 2018

Facebook's New Unit of Time

Thesis: People who think every unit needs to be a power of 10 don't understand the importance of proper divisors.

Case study: Engineers at Facebook just invented a new unit for synchronizing video frames, called a "Flick", which -- to avoid rounding errors with floating-point math -- needs to be evenly divisible into any of the common video frequencies: 24hz, 25hz, 30hz, 48hz, 50hz, 60hz, 90hz, 100hz, or 120hz. And also multiples of those by 1,000. And also common audio sampling rates like: 8kHz, 16kHz, 22.05kHz, 24kHz, 32kHz, 44.1kHz, 48kHz, 88.2kHz, 96kHz, and 192kHz. Since the least common multiple (LCM) of all those numbers is 70,5600,000 (see: Wolfram Alphalink) the "Flick" is therefore defined as 1/705600000 of a second.

3 comments:

  1. Wow.

    Turns out their flick factor is also a multiple of 15750, so analog NTSC is also covered.

    ReplyDelete
  2. Dividing by 3.579545 MHz wasn't quite as rewarding, but produces "curious" results, for reasons I'm guessing shouldn't be surprising.

    ReplyDelete
    Replies
    1. Part of the discussion is that (from flicks.h, lines 33-36):

      "The NTSC variations (~29.97, etc) are actually defined as 24 * 1000/1001 and 30 * 1000/1001, which are impossible to represent exactly in a way where 1 second is exact, so we don't bother - they'll be inexact in any circumstance."

      Not sure if that's precisely the same issue or not.

      Delete