1 Star 0 Fork 1

GavinDtl/h264_parse

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test_h264_stream.c 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
Keishi Hattori 提交于 2009-09-22 14:47 . nal parser done
#include <stdlib.h>
#include "CuTest.h"
#include "h264_stream.h"
#include "test_h264_stream.h"
void test_h264_stream_read_bits(CuTest* tc)
{
uint8_t data[3] = {0xae, 0xcf, 0x0b};
h264_stream_t *s = h264_stream_new(data, 3);
CuAssertIntEquals(tc, 1, h264_stream_read_bits(s, 1));
CuAssertIntEquals(tc, 1, h264_stream_read_bits(s, 2));
CuAssertIntEquals(tc, 14, h264_stream_read_bits(s, 5));
CuAssertIntEquals(tc, 13250, h264_stream_read_bits(s, 14));
CuAssertIntEquals(tc, 3, h264_stream_read_bits(s, 2));
}
void test_h264_stream_read_bytes(CuTest* tc)
{
uint8_t data[3] = {0xae, 0xcf, 0x0b};
h264_stream_t *s = h264_stream_new(data, 3);
CuAssertIntEquals(tc, 0xaecf, h264_stream_read_bytes(s, 2));
CuAssertIntEquals(tc, 0, h264_stream_read_bits(s, 2));
CuAssertIntEquals(tc, 0x0b, h264_stream_read_bytes(s, 1));
}
CuSuite* test_h264_stream_get_suite(void) {
CuSuite* suite = CuSuiteNew();
SUITE_ADD_TEST(suite, test_h264_stream_read_bits);
SUITE_ADD_TEST(suite, test_h264_stream_read_bytes);
return suite;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/GavinDtl/h264_parse.git
git@gitee.com:GavinDtl/h264_parse.git
GavinDtl
h264_parse
h264_parse
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385