📄 timecode.c
字号:
/*******************************************************************
MPEG time code routine
*******************************************************************/
#define TIMECODE_C
#include "timecode.h"
void read_timecode(VIDEO_STREAM *in, TIMECODE *out);
__int64 timecode2frame(TIMECODE *in, int fps);
void read_timecode(VIDEO_STREAM *in, TIMECODE *out)
{
out->drop = vs_get_bits(in, 1);
out->hh = vs_get_bits(in, 5);
out->mm = vs_get_bits(in, 6);
out->padding = vs_get_bits(in, 1);
out->ss = vs_get_bits(in, 6);
out->ff = vs_get_bits(in, 6);
return;
}
__int64 timecode2frame(TIMECODE *in, int fps)
{
__int64 r,w;
r = in->hh * 60 * 60 * fps;
r += in->mm * 60 * fps;
r += in->ss * fps;
r += in->ff;
if(in->drop){
w = in->hh * 60 + in->mm;
r -= 2 * w;
r += 2 * (w/10);
}
return r;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -