70 if (marker == 0xFF92 || marker == 0xFF4F ||
71 marker == 0xFF90 || marker == 0xFF93 ||
75 if (marker > 0xFF00)
return 1;
95 for (i = 0; i < buf_size; i++) {
96 state = state << 8 | buf[
i];
97 state64 = state64 << 8 | buf[
i];
109 m->
skip_bytes = (state64 & 0xFFFFFFFF) - 10 > 0?
110 (state64 & 0xFFFFFFFF) - 10 : 0;
116 if (state64 == 0x6A5020200D0A870A) {
129 if (state == 0x0000000C && m->
bytes_read >= 3) {
131 }
else if ((state & 0xFFFF) == 0xFF4F) {
140 }
else if ((state & 0xFFFF) == 0xFFD9) {
161 const uint8_t **poutbuf,
int *poutbuf_size,
162 const uint8_t *buf,
int buf_size)
181 *poutbuf_size = buf_size;
static void reset_context(JPEG2000ParserContext *m)
uint8_t reading_file_header
static uint8_t info_marker(uint16_t marker)
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
void ff_parse_close(AVCodecParserContext *s)
main external API structure.
AVCodecParser ff_jpeg2000_parser
static int jpeg2000_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
uint32_t state
contains the last few bytes in MSB order
uint64_t state64
contains the last 8 bytes in MSB order
#define PARSER_FLAG_COMPLETE_FRAMES
static int find_frame_end(JPEG2000ParserContext *m, const uint8_t *buf, int buf_size)
Find the end of the current frame in the bitstream.
uint8_t codestream_frame_end
uint8_t skipped_codestream