For reference picture sets, there are cases that rps will not always
be used. Once detect the unused flag from encoded bitstream, we should
not add this rps to any list, otherwise pass the incorrect reference
and skip the correct rps.
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
rps = priv->codec_data.h265.rps;
if (rps) {
+ unsigned bf = 0, af = 0;
+
priv->picture.h265.NumDeltaPocsOfRefRpsIdx = rps->num_delta_poc;
for (i = 0; i < rps->num_pics; ++i) {
priv->picture.h265.PicOrderCntVal[i] =
if (rps->used[i]) {
if (i < rps->num_neg_pics) {
priv->picture.h265.NumPocStCurrBefore++;
- priv->picture.h265.RefPicSetStCurrBefore[i] = i;
+ priv->picture.h265.RefPicSetStCurrBefore[bf++] = i;
} else {
- int j = i - rps->num_neg_pics;
priv->picture.h265.NumPocStCurrAfter++;
- priv->picture.h265.RefPicSetStCurrAfter[j] = i;
+ priv->picture.h265.RefPicSetStCurrAfter[af++] = i;
}
}
}