1 Star 0 Fork 3

jszhong / TS_Analysis

forked from yeeeeeeeeee / TS_Analysis 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
h264.h 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
huzhe007 提交于 2020-01-01 14:29 . init
/*
*TS 视频格式分析
*TS Format Analysis
*
*雷霄骅 Lei Xiaohua
*leixiaohua1020@126.com
*中国传媒大学/数字电视技术
*Communication University of China / Digital TV Technology
*http://blog.csdn.net/leixiaohua1020
*/
/*
Copyright (C) 2009 Anton Burdinuk
clark15b@gmail.com
*/
#ifndef __H264_H
#define __H264_H
#include "common.h"
namespace h264
{
class counter
{
private:
u_int32_t ctx;
u_int64_t frame_num; // JVT NAL (h.264) frame counter
public:
counter(void):ctx(0),frame_num(0) {}
void parse(const char* p,int l)
{
for(int i=0;i<l;i++)
{
ctx=(ctx<<8)+((unsigned char*)p)[i];
if((ctx&0xffffff1f)==0x00000109) // NAL access unit
frame_num++;
}
}
u_int64_t get_frame_num(void) const { return frame_num; }
void reset(void)
{
ctx=0;
frame_num=0;
}
};
}
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhong-jingshuai/TS_Analysis.git
git@gitee.com:zhong-jingshuai/TS_Analysis.git
zhong-jingshuai
TS_Analysis
TS_Analysis
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891