From cc83e32cdb938c519f9c14aca6061f583caa8e10 Mon Sep 17 00:00:00 2001 From: Qiu Jianlin Date: Wed, 31 Jan 2024 11:13:07 +0800 Subject: [PATCH] Fix H.265 bitstream parser incorrect PPS reference. H.265 bitstream parser currently always assume pps id to be 0 when calculating the last slice QP. This assumption is incorrect. Bug: webrtc:13485 Change-Id: I06918df035e8e4a8e68eb3002a49b824ffd5f516 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337080 Commit-Queue: Jianlin Qiu Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/main@{#41636} --- common_video/h265/h265_bitstream_parser.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common_video/h265/h265_bitstream_parser.cc b/common_video/h265/h265_bitstream_parser.cc index f270f228c1..9247d5d272 100644 --- a/common_video/h265/h265_bitstream_parser.cc +++ b/common_video/h265/h265_bitstream_parser.cc @@ -531,8 +531,7 @@ absl::optional H265BitstreamParser::GetLastSliceQp() const { if (!last_slice_qp_delta_ || !last_slice_pps_id_) { return absl::nullopt; } - uint32_t pps_id = 0; - const H265PpsParser::PpsState* pps = GetPPS(pps_id); + const H265PpsParser::PpsState* pps = GetPPS(last_slice_pps_id_.value()); if (!pps) return absl::nullopt; const int parsed_qp = 26 + pps->init_qp_minus26 + *last_slice_qp_delta_;