X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Favs2_parser.c;h=b7d5d7774e0d9a7914bcf8e0c2783e77fcf9dd25;hb=e5af9203098a889f36b759652615046254d45102;hp=1c9b3423ffa99b9839722e2b6d857ad3fb8c271b;hpb=14fe81b3a88dfe4dbac12e8715f9a3f05b5ef1bf;p=ffmpeg diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c index 1c9b3423ffa..b7d5d7774e0 100644 --- a/libavcodec/avs2_parser.c +++ b/libavcodec/avs2_parser.c @@ -21,10 +21,10 @@ #include "parser.h" -#define SLICE_MAX_START_CODE 0x000001af +#define AVS2_SLICE_MAX_START_CODE 0x000001AF -#define ISPIC(x) ((x) == 0xB3 || (x) == 0xB6) -#define ISUNIT(x) ((x) == 0xB0 || (x) == 0xB1 || (x) == 0xB2 || ISPIC(x)) +#define AVS2_ISPIC(x) ((x) == 0xB3 || (x) == 0xB6) +#define AVS2_ISUNIT(x) ((x) == 0xB0 || (x) == 0xB1 || (x) == 0xB2 || AVS2_ISPIC(x)) static int avs2_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) { @@ -34,9 +34,9 @@ static int avs2_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_siz if (!pic_found) { for (; cur < buf_size; ++cur) { - state = (state<<8) | buf[cur]; - if (ISUNIT(buf[cur])){ - ++cur; + state = (state << 8) | buf[cur]; + if (AVS2_ISUNIT(buf[cur])){ + cur++; pic_found = 1; break; } @@ -46,9 +46,9 @@ static int avs2_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_siz if (pic_found) { if (!buf_size) return END_NOT_FOUND; - for (; cur < buf_size; ++cur) { + for (; cur < buf_size; cur++) { state = (state << 8) | buf[cur]; - if ((state & 0xFFFFFF00) == 0x100 && state > SLICE_MAX_START_CODE) { + if ((state & 0xFFFFFF00) == 0x100 && state > AVS2_SLICE_MAX_START_CODE) { pc->frame_start_found = 0; pc->state = -1; return cur - 3; @@ -86,10 +86,9 @@ static int avs2_parse(AVCodecParserContext *s, AVCodecContext *avctx, return next; } -AVCodecParser ff_avs2_parser = { +const AVCodecParser ff_avs2_parser = { .codec_ids = { AV_CODEC_ID_AVS2 }, .priv_data_size = sizeof(ParseContext), .parser_parse = avs2_parse, .parser_close = ff_parse_close, - .split = ff_mpeg4video_split, };