| 41 | using namespace parser::reader; |
| 42 | |
| 43 | void ref_pic_list_struct::parse(SubByteReaderLogging & reader, |
| 44 | unsigned listIdx, |
| 45 | unsigned rplsIdx, |
| 46 | std::shared_ptr<seq_parameter_set_rbsp> sps) |
| 47 | { |
| 48 | assert(sps != nullptr); |
| 49 | SubByteReaderLoggingSubLevel subLevel(reader, |
| 50 | formatArray("ref_pic_list_struct", listIdx, rplsIdx)); |
| 51 | |
| 52 | this->num_ref_entries = reader.readUEV("num_ref_entries"); |
| 53 | if (sps->sps_long_term_ref_pics_flag && rplsIdx < sps->sps_num_ref_pic_lists[listIdx] && |
| 54 | this->num_ref_entries > 0) |
| 55 | { |
| 56 | this->ltrp_in_header_flag = reader.readFlag("ltrp_in_header_flag"); |
| 57 | } |
| 58 | unsigned j = 0; |
| 59 | for (unsigned i = 0; i < this->num_ref_entries; i++) |
| 60 | { |
| 61 | if (sps->sps_inter_layer_prediction_enabled_flag) |
| 62 | { |
| 63 | this->inter_layer_ref_pic_flag[i] = |
| 64 | reader.readFlag(formatArray("inter_layer_ref_pic_flag", i)); |
| 65 | } |
| 66 | if (!this->inter_layer_ref_pic_flag[i]) |
| 67 | { |
| 68 | if (sps->sps_long_term_ref_pics_flag) |
| 69 | { |
| 70 | this->st_ref_pic_flag[i] = reader.readFlag(formatArray("st_ref_pic_flag", i)); |
| 71 | } |
| 72 | if (this->getStRefPicFlag(i)) |
| 73 | { |
| 74 | this->abs_delta_poc_st[i] = reader.readUEV(formatArray("abs_delta_poc_st", i)); |
| 75 | |
| 76 | // (149) |
| 77 | if ((sps->sps_weighted_pred_flag || sps->sps_weighted_bipred_flag) && i != 0) |
| 78 | this->AbsDeltaPocSt[i] = abs_delta_poc_st[i]; |
| 79 | else |
| 80 | this->AbsDeltaPocSt[i] = abs_delta_poc_st[i] + 1; |
| 81 | |
| 82 | if (this->AbsDeltaPocSt[i]) |
| 83 | { |
| 84 | this->strp_entry_sign_flag[i] = reader.readFlag(formatArray("strp_entry_sign_flag", i)); |
| 85 | } |
| 86 | } |
| 87 | else if (!this->ltrp_in_header_flag) |
| 88 | { |
| 89 | auto numBits = sps->sps_log2_max_pic_order_cnt_lsb_minus4 + 4; |
| 90 | this->rpls_poc_lsb_lt[j++] = reader.readBits(formatArray("rpls_poc_lsb_lt", i), numBits); |
| 91 | } |
| 92 | } |
| 93 | else |
| 94 | { |
| 95 | this->ilrp_idx[i] = reader.readUEV(formatArray("ilrp_idx", i)); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | // (148) |
| 100 | this->NumLtrpEntries = 0; |
nothing calls this directly
no test coverage detected