c_cpp 在H.264比特流数据中找到下一个NALU的功能。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp 在H.264比特流数据中找到下一个NALU的功能。相关的知识,希望对你有一定的参考价值。

/*
* Find next NAL unit from the specified H.264 bitstream data.
*/
static auto find_next_nal_unit(const uint8_t *start, const uint8_t *end) -> const uint8_t *
{
    const uint8_t *p = start;

    /* Simply lookup "0x000001" pattern */
    while (p <= end - 3 && (p[0] || p[1] || p[2] != 1))
        ++p;

    if (p > end - 3)
        /* No more NAL unit in this bitstream */
        return nullptr;

    /* Include 8 bits leading zero */
    if (p > start && *(p - 1) == 0)
        return (p - 1);

    return p;
}

以上是关于c_cpp 在H.264比特流数据中找到下一个NALU的功能。的主要内容,如果未能解决你的问题,请参考以下文章