diff options
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/hevc.c | 2 | ||||
-rw-r--r-- | libavcodec/hevc.h | 4 | ||||
-rw-r--r-- | libavcodec/hevc_parse.c | 11 | ||||
-rw-r--r-- | libavcodec/hevc_parser.c | 2 |
4 files changed, 9 insertions, 10 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 0d53a33d53..785aa7e604 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -2866,7 +2866,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) /* split the input packet into NAL units, so we know the upper bound on the * number of slices in the frame */ - ret = ff_hevc_split_packet(s, &s->pkt, buf, length, s->avctx, s->is_nalff, + ret = ff_hevc_split_packet(&s->pkt, buf, length, s->avctx, s->is_nalff, s->nal_length_size); if (ret < 0) { av_log(s->avctx, AV_LOG_ERROR, diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h index c91f815857..5865f65f1c 100644 --- a/libavcodec/hevc.h +++ b/libavcodec/hevc.h @@ -1080,13 +1080,13 @@ void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size); /** * Extract the raw (unescaped) HEVC bitstream. */ -int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length, +int ff_hevc_extract_rbsp(const uint8_t *src, int length, HEVCNAL *nal); /** * Split an input packet into NAL units. */ -int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, int length, +int ff_hevc_split_packet(HEVCPacket *pkt, const uint8_t *buf, int length, AVCodecContext *avctx, int is_nalff, int nal_length_size); int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id, diff --git a/libavcodec/hevc_parse.c b/libavcodec/hevc_parse.c index d557cc7f04..6ee8496419 100644 --- a/libavcodec/hevc_parse.c +++ b/libavcodec/hevc_parse.c @@ -29,14 +29,13 @@ /* FIXME: This is adapted from ff_h264_decode_nal, avoiding duplication * between these functions would be nice. */ -int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length, +int ff_hevc_extract_rbsp(const uint8_t *src, int length, HEVCNAL *nal) { int i, si, di; uint8_t *dst; - if (s) - nal->skipped_bytes = 0; + nal->skipped_bytes = 0; #define STARTCODE_TEST \ if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \ if (src[i + 2] != 3) { \ @@ -110,7 +109,7 @@ int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length, dst[di++] = 0; si += 3; - if (s && nal->skipped_bytes_pos) { + if (nal->skipped_bytes_pos) { nal->skipped_bytes++; if (nal->skipped_bytes_pos_size < nal->skipped_bytes) { nal->skipped_bytes_pos_size *= 2; @@ -205,7 +204,7 @@ static int hls_nal_unit(HEVCNAL *nal, AVCodecContext *avctx) } -int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, int length, +int ff_hevc_split_packet(HEVCPacket *pkt, const uint8_t *buf, int length, AVCodecContext *avctx, int is_nalff, int nal_length_size) { int consumed, ret = 0; @@ -269,7 +268,7 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in } nal = &pkt->nals[pkt->nb_nals]; - consumed = ff_hevc_extract_rbsp(s, buf, extract_length, nal); + consumed = ff_hevc_extract_rbsp(buf, extract_length, nal); if (consumed < 0) return consumed; diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c index 4625e6149a..59893bb3e1 100644 --- a/libavcodec/hevc_parser.c +++ b/libavcodec/hevc_parser.c @@ -239,7 +239,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf, src_length = 20; } - consumed = ff_hevc_extract_rbsp(NULL, buf, src_length, nal); + consumed = ff_hevc_extract_rbsp(buf, src_length, nal); if (consumed < 0) return consumed; |