summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@intel.com>2021-07-16 15:24:11 +0800
committerHe Junyan <junyan.he@intel.com>2021-07-16 23:05:18 +0800
commit4299596d16870b52ae4efc1e49154ec028c1fc7e (patch)
tree826c972809b6012ee507a25a1306d79679e62508 /gst-libs
parent6a9f84a2dec6755bb9b53a50bec6d9611b8c0541 (diff)
downloadgstreamer-plugins-bad-4299596d16870b52ae4efc1e49154ec028c1fc7e.tar.gz
codecs: h265decoder: Fix a typo of NumPocTotalCurr when process ref pic list.
We should use the NumPocTotalCurr value stored in decoder, which is a calculated valid value, rather than use the invalid value in the slice header. Most of the time, the NumPocTotalCurr is 0 and make the tmp_refs a very short length, and causes the decoder's wrong result. By the way, the NumPocTotalCurr is not the correct name specified in H265 spec, its name should be NumPicTotalCurr. We change it to the correct name. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2414>
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/codecs/gsth265decoder.c8
-rw-r--r--gst-libs/gst/codecs/gsth265decoder.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/gst-libs/gst/codecs/gsth265decoder.c b/gst-libs/gst/codecs/gsth265decoder.c
index 081fe7e0a..16d4122a2 100644
--- a/gst-libs/gst/codecs/gsth265decoder.c
+++ b/gst-libs/gst/codecs/gsth265decoder.c
@@ -492,7 +492,7 @@ gst_h265_decoder_process_ref_pic_lists (GstH265Decoder * self,
/* NumRpsCurrTempList0 */
num_tmp_refs = MAX (slice->header.num_ref_idx_l0_active_minus1 + 1,
- slice->header.NumPocTotalCurr);
+ self->NumPicTotalCurr);
while (tmp_refs->len < num_tmp_refs) {
for (i = 0; i < self->NumPocStCurrBefore && tmp_refs->len < num_tmp_refs;
@@ -542,7 +542,7 @@ gst_h265_decoder_process_ref_pic_lists (GstH265Decoder * self,
/* NumRpsCurrTempList1 */
num_tmp_refs = MAX (slice->header.num_ref_idx_l1_active_minus1 + 1,
- slice->header.NumPocTotalCurr);
+ self->NumPicTotalCurr);
while (tmp_refs->len < num_tmp_refs) {
for (i = 0; i < self->NumPocStCurrAfter && tmp_refs->len < num_tmp_refs;
@@ -1405,7 +1405,7 @@ gst_h265_decoder_prepare_rps (GstH265Decoder * self, const GstH265Slice * slice,
numtotalcurr++;
}
- self->NumPocTotalCurr = numtotalcurr;
+ self->NumPicTotalCurr = numtotalcurr;
/* The variable DeltaPocMsbCycleLt[i] is derived as follows: (7-38) */
for (i = 0; i < num_lt_pics; i++) {
@@ -1442,7 +1442,7 @@ gst_h265_decoder_prepare_rps (GstH265Decoder * self, const GstH265Slice * slice,
GST_LOG_OBJECT (self, "NumPocStFoll: %d", self->NumPocStFoll);
GST_LOG_OBJECT (self, "NumPocLtCurr: %d", self->NumPocLtCurr);
GST_LOG_OBJECT (self, "NumPocLtFoll: %d", self->NumPocLtFoll);
- GST_LOG_OBJECT (self, "NumPocTotalCurr: %d", self->NumPocTotalCurr);
+ GST_LOG_OBJECT (self, "NumPicTotalCurr: %d", self->NumPicTotalCurr);
/* the derivation process for the RPS and the picture marking */
gst_h265_decoder_derive_and_mark_rps (self, picture,
diff --git a/gst-libs/gst/codecs/gsth265decoder.h b/gst-libs/gst/codecs/gsth265decoder.h
index 39e65ed12..a45629d0a 100644
--- a/gst-libs/gst/codecs/gsth265decoder.h
+++ b/gst-libs/gst/codecs/gsth265decoder.h
@@ -64,7 +64,7 @@ struct _GstH265Decoder
guint NumPocStFoll;
guint NumPocLtCurr;
guint NumPocLtFoll;
- guint NumPocTotalCurr;
+ guint NumPicTotalCurr;
/*< private >*/
GstH265DecoderPrivate *priv;