Skip to content

Commit

Permalink
Merge pull request #76 from mraulet77/master
Browse files Browse the repository at this point in the history
fix slice header extension
  • Loading branch information
jheulot authored Feb 10, 2020
2 parents 5e7d058 + c6876c3 commit 20dde1a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 28 deletions.
6 changes: 1 addition & 5 deletions libavcodec/hevc_ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -3163,11 +3163,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
goto err;
}
if (pps_multilayer_extension_flag) {
av_log(avctx, AV_LOG_ERROR,
"hack with the spec.\n"
"use pps_range_extensions_flag instead of pps_multilayer_extension_flag\n."
"PPS multilayer extension flag is partially implemented.\n");
pps_multilayer_extensions(gb, avctx, pps);
pps_multilayer_extensions(gb, avctx, pps);
}
}

Expand Down
46 changes: 24 additions & 22 deletions libavcodec/hevcdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,6 @@ static int hls_slice_header(HEVCContext *s)
sh->no_output_of_prior_pics_flag = 0;
if (IS_IRAP(s)){
sh->no_output_of_prior_pics_flag = get_bits1(gb);

if (s->decoder_id)
av_log(s->avctx, AV_LOG_ERROR, "IRAP %d\n", s->nal_unit_type);
}

if (s->nal_unit_type == HEVC_NAL_CRA_NUT && s->last_eos == 1)
Expand Down Expand Up @@ -1155,30 +1152,35 @@ static int hls_slice_header(HEVCContext *s)
}


av_log(s->avctx, AV_LOG_WARNING,
"========= SLICE HEADER extension are parsed but still unused\n");
if (sh->slice_segment_header_extension_length) {
uint8_t poc_msb_cycle_val_present_flag = 0;

if(s->ps.pps->poc_reset_info_present_flag){
sh->poc_reset_idc = get_bits(gb,2);
}
if(s->ps.pps->poc_reset_info_present_flag){
sh->poc_reset_idc = get_bits(gb,2);
} else {
sh->poc_reset_idc = 0;
}

if (sh->poc_reset_idc){
sh->poc_reset_period_id = get_bits(gb,6);
}
if (sh->poc_reset_idc){
sh->poc_reset_period_id = get_bits(gb,6);
} else {
sh->poc_reset_period_id = 0;
}

if(sh->poc_reset_idc == 3){
sh->full_poc_reset_flag = get_bits1(gb);
sh->poc_lsb_val = get_bits(gb,s->ps.sps->log2_max_poc_lsb);
}
if(sh->poc_reset_idc == 3){
sh->full_poc_reset_flag = get_bits1(gb);
sh->poc_lsb_val = get_bits(gb,s->ps.sps->log2_max_poc_lsb);
}

//FIXME Not really sure about this
if(s->ps.vps->vps_ext.vps_poc_lsb_aligned_flag && !(( IS_BLA(s) || s->nal_unit_type == HEVC_NAL_CRA_NUT)
&& s->ps.vps->vps_ext.number_ref_layers[s->nuh_layer_id][0] == 0)){
sh->poc_msb_cycle_val_present_flag = get_bits1(gb);
}
//FIXME Not really sure about this !PoCMsbValRequiredFlag && vps_poc
if (s->ps.vps->vps_ext.vps_poc_lsb_aligned_flag && !(( IS_BLA(s) || s->nal_unit_type == HEVC_NAL_CRA_NUT) && (!s->ps.vps->vps_ext.vps_poc_lsb_aligned_flag ||
(s->ps.vps->vps_ext.vps_poc_lsb_aligned_flag && s->ps.vps->vps_ext.number_ref_layers[s->nuh_layer_id][0] == 0)))) {
poc_msb_cycle_val_present_flag = get_bits1(gb);
}

if(sh->poc_msb_cycle_val_present_flag){
sh->poc_msb_cycle_val = get_ue_golomb(gb);
if (poc_msb_cycle_val_present_flag){
sh->poc_msb_cycle_val = get_ue_golomb(gb);
}
}

if (gb->index - curr_index < sh->slice_segment_header_extension_length*8U)
Expand Down
2 changes: 1 addition & 1 deletion libavutil/ffversion.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
#define FFMPEG_VERSION "openhevc-2.0-173-gd58c006d"
#define FFMPEG_VERSION "openhevc-2.0-181-g5e7d0585"
#endif /* AVUTIL_FFVERSION_H */

0 comments on commit 20dde1a

Please sign in to comment.