35 for (; cur < buf_size; ++cur) {
36 state = (state << 8) | buf[cur];
48 for (; cur < buf_size; ++cur) {
49 state = (state << 8) | buf[cur];
50 if ((state & 0xFFFFFF00) == 0x100 &&
AVS3_ISUNIT(state & 0xFF)) {
71 if (buf[0] == 0x0 && buf[1] == 0x0 && buf[2] == 0x1) {
95 int sample_precision =
get_bits(&gb, 3);
96 if (sample_precision == 1) {
98 }
else if (sample_precision == 2) {
126 "AVS3 parse seq HDR: profile %d; coded size: %dx%d; frame rate code: %d\n",
135 int pic_code_type = buf[8] & 0x3;
136 if (pic_code_type == 1 || pic_code_type == 3) {
148 const uint8_t **poutbuf,
int *poutbuf_size,
149 const uint8_t *buf,
int buf_size)
168 *poutbuf_size = buf_size;
static int avs3_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static const AVRational ff_avs3_frame_rate_tab[16]
int width
Dimensions of the decoded video intended for presentation.
int coded_width
Dimensions of the coded video.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
#define AVS3_PROFILE_BASELINE_MAIN10
int ff_mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
#define AVS3_INTRA_PIC_START_CODE
bitstream reader API header.
int has_b_frames
Size of the frame reordering buffer in the decoder.
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static char * split(char *message, char delim)
void ff_parse_close(AVCodecParserContext *s)
int width
picture width / height.
AVCodecParser ff_avs3_parser
main external API structure.
uint32_t state
contains the last few bytes in MSB order
static void skip_bits(GetBitContext *s, int n)
#define AVS3_SEQ_START_CODE
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define AVS3_INTER_PIC_START_CODE
static void parse_avs3_nal_units(AVCodecParserContext *s, const uint8_t *buf, int buf_size, AVCodecContext *avctx)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define PARSER_FLAG_COMPLETE_FRAMES
static int avs3_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.