| 31 | } |
| 32 | |
| 33 | void 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 | } |
no test coverage detected