Ardour  8.6-511-g145f6d587c
LTCFrame Struct Reference

#include <ltc.h>

Public Attributes

unsigned int frame_units:4
 SMPTE framenumber BCD unit 0..9. More...
 
unsigned int user1:4
 
unsigned int frame_tens:2
 SMPTE framenumber BCD tens 0..3. More...
 
unsigned int dfbit:1
 indicated drop-frame timecode More...
 
unsigned int col_frame:1
 colour-frame: timecode intentionally synchronized to a colour TV field sequence More...
 
unsigned int user2:4
 
unsigned int secs_units:4
 SMPTE seconds BCD unit 0..9. More...
 
unsigned int user3:4
 
unsigned int secs_tens:3
 SMPTE seconds BCD tens 0..6. More...
 
unsigned int biphase_mark_phase_correction:1
 see note on Bit 27 in description and ltc_frame_set_parity . More...
 
unsigned int user4:4
 
unsigned int mins_units:4
 SMPTE minutes BCD unit 0..9. More...
 
unsigned int user5:4
 
unsigned int mins_tens:3
 SMPTE minutes BCD tens 0..6. More...
 
unsigned int binary_group_flag_bit0:1
 indicate user-data char encoding, see table above - bit 43 More...
 
unsigned int user6:4
 
unsigned int hours_units:4
 SMPTE hours BCD unit 0..9. More...
 
unsigned int user7:4
 
unsigned int hours_tens:2
 SMPTE hours BCD tens 0..2. More...
 
unsigned int binary_group_flag_bit1:1
 indicate timecode is local time wall-clock, see table above - bit 58 More...
 
unsigned int binary_group_flag_bit2:1
 indicate user-data char encoding (or parity with 25fps), see table above - bit 59 More...
 
unsigned int user8:4
 
unsigned int sync_word:16
 

Detailed Description

Raw 80 bit LTC frame

The datastream for each video frame of Longitudinal Timecode consists of eighty bit-periods.

At a frame-rate of 30 fps, the bit-rate corresponds to 30 [fps] * 80 [bits/f] = 2400 bits per second. The frequency for a stream of zeros would be 1.2 kHz and for a stream of ones it would be 2.4 kHz.

With all commonly used video-frame-rates and audio-sample-rates, LTC timecode can be recorded easily into a audio-track.

In each frame, 26 of the eighty bits carry the SMPTE time in binary coded decimal (BCD).

These Bits are FRAME-UNITS, FRAME-TENS, SECS-UNITS, SECS-TENS, MINS-UNITS, MINS-TENS, HOURS-UNITS and HOURS-TENS. The BCD digits are loaded 'least significant bit first' (libltc takes care of the architecture specific alignment).

32 bits are assigned as eight groups of four USER-BITS (also sometimes called the "Binary Groups"). This capacity is generally used to carry extra info such as reel number and/or date. The User Bits may be allocated howsoever one wishes as long as both Binary Group Flag Bits are cleared.

The function ltc_frame_to_time can interpret the user-bits as SMPTE Date+Timezone according to SMPTE 309M-1999. similarly ltc_time_to_frame will do the reverse.

The last 16 Bits make up the SYNC WORD. These bits indicate the frame boundary, the tape direction, and the bit-rate of the sync tone. The values of these Bits are fixed as 0011 1111 1111 1101

The Bi-Phase Mark Phase Correction Bit (Bit 27 or 59) may be set or cleared so that that every 80-bit word contains an even number of zeroes. This means that the phase of the pulse train in every Sync Word will be the same.

Bit 10 indicates drop-frame timecode. The Colour Frame Flag col.frm is Bit 11; if the timecode intentionally synchronized to a colour TV field sequence, this bit is set.

Bit 58 is not required for the BCD count for HOURS-TENS (which has a maximum value of two) and has not been given any other special purpose so remains unassigned. This Bit has been RESERVED for future assignment.

The Binary Group Flag Bits (bits 43 and 59) are two bits indicate the format of the User Bits data. SMPTE 12M-1999 defines the previously reserved bit 58 to signals that the time is locked to wall-clock within a tolerance of ± 0.5 seconds.

SMPTE 12M-1999 also changes the numbering schema of the BGF. (BGF1 was renamed to BGF2 and bit 58 becomes BGFB1)

To further complicate matters, the BGFB assignment as well as the biphase_mark_phase_correction (aka parity) bit depends on the timecode-format used.

         25 fps   24, 30 fps
 BGF0      27        43
 BGF1      58        58
 BGF2      43        59
 Parity    59        27

The variable naming chosen for the LTCFrame struct is based on the 24,30 fps standard.

The Binary Group Flag Bits should be used only as shown in the truth table below. The Unassigned entries in the table should not be used, as they may be allocated specific meanings in the future.

                                                BGF0      BGF1    BGF2
      user-bits                     timecode    Bit 43   Bit 58  Bit 59 (30fps, 24 fps)
                                   |        |   Bit 27   Bit 58  Bit 43 (25fps)
 No User Bits format specified     |   ?    |     0       0        0
 Eight-bit character set (1)       |   ?    |     1       0        0
 Date and Timezone set             |   ?    |     0       0        1
 Page/Line multiplex (2)           |   ?    |     1       0        1
 Character set not specified       |  clk   |     0       1        0
 Reserved                          |   ?    |     1       1        0
 Date and Timezone set             |  clk   |     0       1        1
 Page/Line multiplex (2)           |  clk   |     1       1        1

(1) ISO/IEC 646 or ISO/IEC 2022 character set. If the seven-bit ISO codes are being used, they shall be converted to eight-bit codes by setting the eighth bit to zero. 4 ISO codes can be encoded, user7 and user8 are to be used for the first code with LSB 7 and MSB in 8. the remaining ISO codes are to be distributed in the same manner to user5/6 user3/4 and user1/2 accordingly.

(2) The Page/Line indicates ANSI/SMPTE-262M is used for the user-bits. It is multiplex system that can be used to encode large amounts of data in the binary groups through the use of time multiplexing.

libltc does not use any of the BGF - except for the Parity bit which can be calculated and set with ltc_frame_set_parity. Setting and interpreting the BGF is left to the application using libltc. However libltc provides functionality to parse or set date and timezoe according to SMPTE 309M-1999.

further information: http://www.philrees.co.uk/articles/timecode.htm and http://www.barney-wol.net/time/timecode.html

Definition at line 218 of file ltc.h.

Member Data Documentation

◆ binary_group_flag_bit0

unsigned int LTCFrame::binary_group_flag_bit0

indicate user-data char encoding, see table above - bit 43

Definition at line 238 of file ltc.h.

◆ binary_group_flag_bit1

unsigned int LTCFrame::binary_group_flag_bit1

indicate timecode is local time wall-clock, see table above - bit 58

Definition at line 245 of file ltc.h.

◆ binary_group_flag_bit2

unsigned int LTCFrame::binary_group_flag_bit2

indicate user-data char encoding (or parity with 25fps), see table above - bit 59

Definition at line 246 of file ltc.h.

◆ biphase_mark_phase_correction

unsigned int LTCFrame::biphase_mark_phase_correction

see note on Bit 27 in description and ltc_frame_set_parity .

Definition at line 231 of file ltc.h.

◆ col_frame

unsigned int LTCFrame::col_frame

colour-frame: timecode intentionally synchronized to a colour TV field sequence

Definition at line 224 of file ltc.h.

◆ dfbit

unsigned int LTCFrame::dfbit

indicated drop-frame timecode

Definition at line 223 of file ltc.h.

◆ frame_tens

unsigned int LTCFrame::frame_tens

SMPTE framenumber BCD tens 0..3.

Definition at line 222 of file ltc.h.

◆ frame_units

unsigned int LTCFrame::frame_units

SMPTE framenumber BCD unit 0..9.

Definition at line 219 of file ltc.h.

◆ hours_tens

unsigned int LTCFrame::hours_tens

SMPTE hours BCD tens 0..2.

Definition at line 244 of file ltc.h.

◆ hours_units

unsigned int LTCFrame::hours_units

SMPTE hours BCD unit 0..9.

Definition at line 241 of file ltc.h.

◆ mins_tens

unsigned int LTCFrame::mins_tens

SMPTE minutes BCD tens 0..6.

Definition at line 237 of file ltc.h.

◆ mins_units

unsigned int LTCFrame::mins_units

SMPTE minutes BCD unit 0..9.

Definition at line 234 of file ltc.h.

◆ secs_tens

unsigned int LTCFrame::secs_tens

SMPTE seconds BCD tens 0..6.

Definition at line 230 of file ltc.h.

◆ secs_units

unsigned int LTCFrame::secs_units

SMPTE seconds BCD unit 0..9.

Definition at line 227 of file ltc.h.

◆ sync_word

unsigned int LTCFrame::sync_word

Definition at line 249 of file ltc.h.

◆ user1

unsigned int LTCFrame::user1

Definition at line 220 of file ltc.h.

◆ user2

unsigned int LTCFrame::user2

Definition at line 225 of file ltc.h.

◆ user3

unsigned int LTCFrame::user3

Definition at line 228 of file ltc.h.

◆ user4

unsigned int LTCFrame::user4

Definition at line 232 of file ltc.h.

◆ user5

unsigned int LTCFrame::user5

Definition at line 235 of file ltc.h.

◆ user6

unsigned int LTCFrame::user6

Definition at line 239 of file ltc.h.

◆ user7

unsigned int LTCFrame::user7

Definition at line 242 of file ltc.h.

◆ user8

unsigned int LTCFrame::user8

Definition at line 247 of file ltc.h.


The documentation for this struct was generated from the following file: