23 #include "libavutil/common.h"
28 #define START_CODE 0x000001
40 for (i = 0; i < buf_size; i++) {
48 nut = (pc->
state64 >> 2 * 8 + 1) & 0x3F;
51 (nut >= 41 && nut <= 44) || (nut >= 48 && nut <= 55)) {
58 int first_slice_segment_in_pic_flag = buf[i] >> 7;
59 if (first_slice_segment_in_pic_flag) {
75 const uint8_t **poutbuf,
int *poutbuf_size,
76 const uint8_t *buf,
int buf_size)
93 *poutbuf_size = buf_size;
104 for (i = 0; i < buf_size; i++) {
105 state = (state << 8) | buf[i];
106 if (((state >> 8) & 0xFFFFFF) ==
START_CODE) {
107 int nut = (state >> 1) & 0x3F;
static int hevc_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
#define PARSER_FLAG_COMPLETE_FRAMES
static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf, int buf_size)
Find the end of the current frame in the bitstream.
static char * split(char *message, char delim)
void ff_parse_close(AVCodecParserContext *s)
#define START_CODE
start_code_prefix_one_3bytes
main external API structure.
AVCodecParser ff_hevc_parser
uint64_t state64
contains the last 8 bytes in MSB order
static int hevc_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.