29 int num_tiles_in_slice = 0;
30 unsigned slice_pic_parameter_set_id;
37 pps = ps->
pps[slice_pic_parameter_set_id];
41 sps = ps->
sps[
pps->pps_seq_parameter_set_id];
45 memset(sh, 0,
sizeof(*sh));
48 if (!
pps->single_tile_in_pic_flag) {
55 if (
pps->arbitrary_slice_present_flag)
65 num_tiles_in_slice = num_remaining_tiles_in_slice_minus1 + 2;
67 for (
int i = 0;
i < num_tiles_in_slice - 1; ++
i)
82 if (
sps->sps_alf_flag) {
83 int ChromaArrayType =
sps->chroma_format_idc;
95 if (ChromaArrayType == 3) {
96 int sliceChromaAlfEnabledFlag = 0;
97 int sliceChroma2AlfEnabledFlag = 0;
100 sliceChromaAlfEnabledFlag = 1;
101 sliceChroma2AlfEnabledFlag = 0;
103 sliceChromaAlfEnabledFlag = 0;
104 sliceChroma2AlfEnabledFlag = 1;
106 sliceChromaAlfEnabledFlag = 1;
107 sliceChroma2AlfEnabledFlag = 1;
109 sliceChromaAlfEnabledFlag = 0;
110 sliceChroma2AlfEnabledFlag = 0;
116 if (sliceChromaAlfEnabledFlag) {
121 if (sliceChroma2AlfEnabledFlag) {
129 if (
sps->sps_pocs_flag)
149 sps = ps->
sps[
pps->pps_seq_parameter_set_id];
153 if (
sps->sps_pocs_flag) {
154 int PicOrderCntMsb = 0;
160 int MaxPicOrderCntLsb = 1 << (
sps->log2_max_pic_order_cnt_lsb_minus4 + 4);
161 int prevPicOrderCntLsb = poc->
PicOrderCntVal & (MaxPicOrderCntLsb - 1);
162 int prevPicOrderCntMsb = poc->
PicOrderCntVal - prevPicOrderCntLsb;
166 PicOrderCntMsb = prevPicOrderCntMsb + MaxPicOrderCntLsb;
169 PicOrderCntMsb = prevPicOrderCntMsb - MaxPicOrderCntLsb;
171 PicOrderCntMsb = prevPicOrderCntMsb;
179 int SubGopLength = 1 <<
sps->log2_sub_gop_length;
181 if (tid > (SubGopLength > 1 ? 1 +
av_log2(SubGopLength - 1) : 0))
189 int ExpectedTemporalId;
193 poc->
DocOffset = (prevDocOffset + 1) % SubGopLength;
196 ExpectedTemporalId = 0;
200 while (tid != ExpectedTemporalId) {
203 ExpectedTemporalId = 0;
207 PocOffset = (
int)(SubGopLength * ((2.0 * poc->
DocOffset + 1) / (1 << tid) - 2));