MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_timecode_set_smpte

Function ff_timecode_set_smpte

libavutil/timecode_internal.c:33–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void ff_timecode_set_smpte(unsigned *drop, unsigned *hh, unsigned *mm, unsigned *ss, unsigned *ff,
34 AVRational rate, uint32_t tcsmpte, int prevent_df, int skip_field)
35{
36 *hh = bcd2uint(tcsmpte & 0x3f); // 6-bit hours
37 *mm = bcd2uint(tcsmpte>>8 & 0x7f); // 7-bit minutes
38 *ss = bcd2uint(tcsmpte>>16 & 0x7f); // 7-bit seconds
39 *ff = bcd2uint(tcsmpte>>24 & 0x3f); // 6-bit frames
40 *drop = tcsmpte & 1<<30 && !prevent_df; // 1-bit drop if not arbitrary bit
41
42 if (av_cmp_q(rate, (AVRational) {30, 1}) == 1) {
43 *ff <<= 1;
44 if (!skip_field) {
45 if (av_cmp_q(rate, (AVRational) {50, 1}) == 0)
46 *ff += !!(tcsmpte & 1 << 7);
47 else
48 *ff += !!(tcsmpte & 1 << 23);
49 }
50 }
51}

Callers 3

ff_alloc_timecode_seiFunction · 0.85
nvenc_fill_time_codeFunction · 0.85

Calls 2

av_cmp_qFunction · 0.85
bcd2uintFunction · 0.70

Tested by

no test coverage detected