avcodec/hevcdec: remove HEVCContext usage from hevc_sei

Based on the H264 SEI implementation.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2017-04-29 22:01:03 -03:00
parent f52fbf4f3e
commit c4b08c8a4e
5 changed files with 177 additions and 164 deletions

View File

@@ -192,6 +192,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
GetBitContext *gb;
SliceHeader *sh = &h->sh;
HEVCParamSets *ps = &h->ps;
HEVCSEIContext *sei = &h->sei;
H2645Packet *pkt = &ctx->pkt;
const uint8_t *buf_end = buf + buf_size;
int state = -1, i;
@@ -212,7 +213,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
h->avctx = avctx;
ff_hevc_reset_sei(h);
ff_hevc_reset_sei(sei);
if (!buf_size)
return 0;
@@ -265,7 +266,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
break;
case HEVC_NAL_SEI_PREFIX:
case HEVC_NAL_SEI_SUFFIX:
ff_hevc_decode_nal_sei(h);
ff_hevc_decode_nal_sei(gb, avctx, sei, ps, h->nal_unit_type);
break;
case HEVC_NAL_TRAIL_N:
case HEVC_NAL_TRAIL_R:
@@ -290,8 +291,8 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
}
sh->first_slice_in_pic_flag = get_bits1(gb);
s->picture_structure = h->picture_struct;
s->field_order = h->picture_struct;
s->picture_structure = h->sei.picture_timing.picture_struct;
s->field_order = h->sei.picture_timing.picture_struct;
if (IS_IRAP(h)) {
s->key_frame = 1;