32 #include "libavutil/intreadwrite.h"
33 #include "libavutil/mem.h"
36 #define DIRAC_PARSE_INFO_PREFIX 0x42424344
56 const uint8_t *buf,
int buf_size)
62 for (i = 0; i < buf_size; i++) {
63 state = (state << 8) | buf[i];
76 for (; i < buf_size; i++) {
86 state = (state << 8) | buf[i];
105 if (start < pc->
buffer || (start+13 > end))
119 int next,
const uint8_t **buf,
int *buf_size)
130 if (*buf_size == 0 && pc->
buffer[4] == 0x10) {
132 *buf_size = pc->
index;
140 pc->
index + (*buf_size -
180 if ((pu.
pu_type&0x08) != 0x08) {
187 if (parse_timing_info) {
190 int pts =
AV_RB32(cur_pu + 13);
214 const uint8_t **poutbuf,
int *poutbuf_size,
215 const uint8_t *buf,
int buf_size)
226 *poutbuf_size = buf_size;
241 *poutbuf_size = buf_size;
static int find_frame_end(DiracParseContext *pc, const uint8_t *buf, int buf_size)
AVCodecParser ff_dirac_parser
int has_b_frames
Size of the frame reordering buffer in the decoder.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
#define PARSER_FLAG_COMPLETE_FRAMES
static void dirac_parse_close(AVCodecParserContext *s)
static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc, int offset)
main external API structure.
static int dirac_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
#define DIRAC_PARSE_INFO_PREFIX
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
Find the end of the current frame in the bitstream.
static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx, int next, const uint8_t **buf, int *buf_size)
#define AV_NOPTS_VALUE
Undefined timestamp value.