History

lavc/hevcdec: move sequence increment/IDR handling to hevc_frame_start()

From hls_slice_header(). It is only done once per frame, so that is a more appropriate place for this code.

Anton Khirnov committed 2 years ago

Commit 82ded1a1 parent a2e77ca1 file · +6 −5Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/hevc/hevcdec.c+6−5
@@ -604,11 +604,6 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) · 603 unmodified lines
604 return 1; // This slice will be skipped later, do not corrupt state604 return 1; // This slice will be skipped later, do not corrupt state
605 }605 }
606 606
607 if ((IS_IDR(s) || IS_BLA(s)) && sh->first_slice_in_pic_flag) {
608 s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK;
609 if (IS_IDR(s))
610 ff_hevc_clear_refs(s);
611 }
612 sh->no_output_of_prior_pics_flag = 0;607 sh->no_output_of_prior_pics_flag = 0;
613 if (IS_IRAP(s))608 if (IS_IRAP(s))
614 sh->no_output_of_prior_pics_flag = get_bits1(gb);609 sh->no_output_of_prior_pics_flag = get_bits1(gb);
@@ -2949,6 +2944,12 @@ static int hevc_frame_start(HEVCContext *s) · 2334 unmodified lines
2949 memset(s->is_pcm, 0, (sps->min_pu_width + 1) * (sps->min_pu_height + 1));2944 memset(s->is_pcm, 0, (sps->min_pu_width + 1) * (sps->min_pu_height + 1));
2950 memset(s->tab_slice_address, -1, pic_size_in_ctb * sizeof(*s->tab_slice_address));2945 memset(s->tab_slice_address, -1, pic_size_in_ctb * sizeof(*s->tab_slice_address));
2951 2946
2947 if ((IS_IDR(s) || IS_BLA(s))) {
2948 s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK;
2949 if (IS_IDR(s))
2950 ff_hevc_clear_refs(s);
2951 }
2952
2952 s->is_decoded = 0;2953 s->is_decoded = 0;
2953 s->slice_idx = 0;2954 s->slice_idx = 0;
2954 s->first_nal_type = s->nal_unit_type;2955 s->first_nal_type = s->nal_unit_type;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t