HEVC discardable flag wrong
B-frame == discardable frame is wrong for HEVC (and already H.264). Instead, one has the following criterion (see 18.104.22.168 of the spec):
"A sub-layer non-reference (SLNR) picture is not included in any of RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr of any picture with the same value of TemporalId, and may be discarded without affecting the decodability of other pictures with the same value of TemporalId."
"If a picture has nal_unit_type equal to TRAIL_N, TSA_N, STSA_N, RADL_N, RASL_N, RSV_VCL_N10, RSV_VCL_N12 or RSV_VCL_N14, the picture is an SLNR picture. Otherwise, the picture is a sub-layer reference picture."
If sps_max_sub_layers_minus1 of the corresponding SPS is 0, then one can infer that this picture is not referenced at all if it is an SLNR picture.
PS: This goes only for the picture. An SLNR access unit may contain parameter sets that are referenced lateron. (It seems you are not checking this for H.264 either.)