From 38ac7bf0ab9e63da92f3ab4a24a22d620ef314d4 Mon Sep 17 00:00:00 2001 From: Elad Alon Date: Tue, 23 Apr 2019 13:03:18 +0200 Subject: [PATCH] Add Vp8FrameConfig::IntraFrame() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simple function to check if the frame described by Vp8FrameConfig will be an intra frame. Bug: None Change-Id: I0ba0476762a152e1be3711352024fc6e1bd35f12 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133560 Reviewed-by: Erik Språng Commit-Queue: Elad Alon Cr-Commit-Position: refs/heads/master@{#27709} --- api/video_codecs/vp8_frame_config.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/video_codecs/vp8_frame_config.h b/api/video_codecs/vp8_frame_config.h index e610a87672..a420ac0fdd 100644 --- a/api/video_codecs/vp8_frame_config.h +++ b/api/video_codecs/vp8_frame_config.h @@ -47,6 +47,12 @@ struct Vp8FrameConfig { bool Updates(Buffer buffer) const; + bool IntraFrame() const { + // Intra frames do not reference any buffers, and update all buffers. + return last_buffer_flags == kUpdate && golden_buffer_flags == kUpdate && + arf_buffer_flags == kUpdate; + } + bool drop_frame; BufferFlags last_buffer_flags; BufferFlags golden_buffer_flags;