From b8306cc9bb70899853b9870a7d64cd4fe99b3207 Mon Sep 17 00:00:00 2001 From: Johannes Kron Date: Thu, 28 Nov 2019 13:48:07 +0100 Subject: [PATCH] Remove temporary 8-bit H264 HDR fix Bug: webrtc:10575, chromium:956468 Change-Id: Ie49af9c9624962bd19147833a167e5830bb81fe2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161004 Reviewed-by: Sergey Silkin Commit-Queue: Johannes Kron Cr-Commit-Position: refs/heads/master@{#29948} --- .../codecs/h264/h264_decoder_impl.cc | 21 ++----------------- .../codecs/h264/h264_decoder_impl.h | 1 - 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/modules/video_coding/codecs/h264/h264_decoder_impl.cc index 7327c412ca..fa5af98ef2 100644 --- a/modules/video_coding/codecs/h264/h264_decoder_impl.cc +++ b/modules/video_coding/codecs/h264/h264_decoder_impl.cc @@ -151,9 +151,7 @@ void H264DecoderImpl::AVFreeBuffer2(void* opaque, uint8_t* data) { } H264DecoderImpl::H264DecoderImpl() - : kEnable8bitHdrFix_( - !field_trial::IsEnabled("WebRTC-8bitH264HdrKillSwitch")), - pool_(true), + : pool_(true), decoded_image_callback_(nullptr), has_reported_init_(false), has_reported_error_(false) {} @@ -330,24 +328,9 @@ int32_t H264DecoderImpl::Decode(const EncodedImage& input_image, const ColorSpace& color_space = input_image.ColorSpace() ? *input_image.ColorSpace() : ExtractH264ColorSpace(av_context_.get()); - // 8-bit HDR is currently not being rendered correctly in Chrome on Windows. - // If the ColorSpace transfer function is set to ST2084, convert the 8-bit - // buffer to a 10-bit buffer. This way 8-bit HDR content is rendered correctly - // in Chrome. This is a temporary fix until the root cause has been fixed in - // Chrome/WebRTC. - // TODO(chromium:956468): Remove this code and fix the underlying problem. - bool hdr_color_space = - color_space.transfer() == ColorSpace::TransferID::kSMPTEST2084; - - rtc::scoped_refptr decoded_buffer; - if (kEnable8bitHdrFix_ && hdr_color_space) { - decoded_buffer = I010Buffer::Copy(*cropped_buffer); - } else { - decoded_buffer = cropped_buffer; - } VideoFrame decoded_frame = VideoFrame::Builder() - .set_video_frame_buffer(decoded_buffer) + .set_video_frame_buffer(cropped_buffer) .set_timestamp_rtp(input_image.Timestamp()) .set_color_space(color_space) .build(); diff --git a/modules/video_coding/codecs/h264/h264_decoder_impl.h b/modules/video_coding/codecs/h264/h264_decoder_impl.h index 711496acd8..3c038e6425 100644 --- a/modules/video_coding/codecs/h264/h264_decoder_impl.h +++ b/modules/video_coding/codecs/h264/h264_decoder_impl.h @@ -77,7 +77,6 @@ class H264DecoderImpl : public H264Decoder { const char* ImplementationName() const override; private: - const bool kEnable8bitHdrFix_; // Called by FFmpeg when it needs a frame buffer to store decoded frames in. // The |VideoFrame| returned by FFmpeg at |Decode| originate from here. Their // buffers are reference counted and freed by FFmpeg using |AVFreeBuffer2|.