From 97ba6afb37f357cdb0c86195c57ebef1c0b9140e Mon Sep 17 00:00:00 2001 From: Emil Vardar Date: Fri, 16 Aug 2024 08:43:00 +0000 Subject: [PATCH] Propagate the base QP value from frame header to Decoded callback in dav1d decoder. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current version of the dav1d decoder does not propagate any QP value to the Decoded callback. This CL updates this such that the base QP gets propagated from the frame header. Bug: None Change-Id: Ib7624b7e27d2c973f1821df5688cbb444e4847a2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359740 Reviewed-by: Erik Språng Commit-Queue: Emil Vardar (xWF) Cr-Commit-Position: refs/heads/main@{#42790} --- modules/video_coding/codecs/av1/dav1d_decoder.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/video_coding/codecs/av1/dav1d_decoder.cc b/modules/video_coding/codecs/av1/dav1d_decoder.cc index 82c0d92cb6..5a60c7ff6a 100644 --- a/modules/video_coding/codecs/av1/dav1d_decoder.cc +++ b/modules/video_coding/codecs/av1/dav1d_decoder.cc @@ -191,8 +191,15 @@ int32_t Dav1dDecoder::Decode(const EncodedImage& encoded_image, .set_color_space(encoded_image.ColorSpace()) .build(); - decode_complete_callback_->Decoded(decoded_frame, absl::nullopt, - absl::nullopt); + // Corresponds to QP_base in + // J. Han et al., "A Technical Overview of AV1," in Proceedings of the IEEE, + // vol. 109, no. 9, pp. 1435-1462, Sept. 2021, + // doi: 10.1109/JPROC.2021.3058584. keywords: + // {Encoding;Codecs;Decoding;Streaming media;Video compression;Media;Alliance + // of Open Media;AV1;video compression}, + absl::optional qp = dav1d_picture.frame_hdr->quant.yac; + decode_complete_callback_->Decoded(decoded_frame, + /*decode_time_ms=*/absl::nullopt, qp); return WEBRTC_VIDEO_CODEC_OK; }