Browse Source

lavc/hevc_parse: Don't take a HEVCContext

It's not even used anymore, and the checks are no longer
functionally important.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
tags/n3.1
Derek Buitenhuis 9 years ago
parent
commit
4791a910c0
4 changed files with 9 additions and 10 deletions
  1. +1
    -1
      libavcodec/hevc.c
  2. +2
    -2
      libavcodec/hevc.h
  3. +5
    -6
      libavcodec/hevc_parse.c
  4. +1
    -1
      libavcodec/hevc_parser.c

+ 1
- 1
libavcodec/hevc.c View File

@@ -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 /* split the input packet into NAL units, so we know the upper bound on the
* number of slices in the frame */ * 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); s->nal_length_size);
if (ret < 0) { if (ret < 0) {
av_log(s->avctx, AV_LOG_ERROR, av_log(s->avctx, AV_LOG_ERROR,


+ 2
- 2
libavcodec/hevc.h View File

@@ -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. * 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); HEVCNAL *nal);


/** /**
* Split an input packet into NAL units. * 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); AVCodecContext *avctx, int is_nalff, int nal_length_size);


int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id, int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,


+ 5
- 6
libavcodec/hevc_parse.c View File

@@ -29,14 +29,13 @@


/* FIXME: This is adapted from ff_h264_decode_nal, avoiding duplication /* FIXME: This is adapted from ff_h264_decode_nal, avoiding duplication
* between these functions would be nice. */ * 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) HEVCNAL *nal)
{ {
int i, si, di; int i, si, di;
uint8_t *dst; uint8_t *dst;


if (s)
nal->skipped_bytes = 0;
nal->skipped_bytes = 0;
#define STARTCODE_TEST \ #define STARTCODE_TEST \
if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \ if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
if (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; dst[di++] = 0;
si += 3; si += 3;


if (s && nal->skipped_bytes_pos) {
if (nal->skipped_bytes_pos) {
nal->skipped_bytes++; nal->skipped_bytes++;
if (nal->skipped_bytes_pos_size < nal->skipped_bytes) { if (nal->skipped_bytes_pos_size < nal->skipped_bytes) {
nal->skipped_bytes_pos_size *= 2; 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) AVCodecContext *avctx, int is_nalff, int nal_length_size)
{ {
int consumed, ret = 0; 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]; 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) if (consumed < 0)
return consumed; return consumed;




+ 1
- 1
libavcodec/hevc_parser.c View File

@@ -239,7 +239,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
src_length = 20; 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) if (consumed < 0)
return consumed; return consumed;




Loading…
Cancel
Save