vp8_globals.h (2583B)
1 /* 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 // This file contains codec dependent definitions that are needed in 12 // order to compile the WebRTC codebase, even if this codec is not used. 13 14 #ifndef MODULES_VIDEO_CODING_CODECS_VP8_INCLUDE_VP8_GLOBALS_H_ 15 #define MODULES_VIDEO_CODING_CODECS_VP8_INCLUDE_VP8_GLOBALS_H_ 16 17 #include <cstdint> 18 19 #include "modules/video_coding/codecs/interface/common_constants.h" 20 21 namespace webrtc { 22 23 struct RTPVideoHeaderVP8 { 24 void InitRTPVideoHeaderVP8() { 25 nonReference = false; 26 pictureId = kNoPictureId; 27 tl0PicIdx = kNoTl0PicIdx; 28 temporalIdx = kNoTemporalIdx; 29 layerSync = false; 30 keyIdx = kNoKeyIdx; 31 partitionId = 0; 32 beginningOfPartition = false; 33 } 34 35 friend bool operator==(const RTPVideoHeaderVP8& lhs, 36 const RTPVideoHeaderVP8& rhs) { 37 return lhs.nonReference == rhs.nonReference && 38 lhs.pictureId == rhs.pictureId && lhs.tl0PicIdx == rhs.tl0PicIdx && 39 lhs.temporalIdx == rhs.temporalIdx && 40 lhs.layerSync == rhs.layerSync && lhs.keyIdx == rhs.keyIdx && 41 lhs.partitionId == rhs.partitionId && 42 lhs.beginningOfPartition == rhs.beginningOfPartition; 43 } 44 45 friend bool operator!=(const RTPVideoHeaderVP8& lhs, 46 const RTPVideoHeaderVP8& rhs) { 47 return !(lhs == rhs); 48 } 49 50 bool nonReference; // Frame is discardable. 51 int16_t pictureId; // Picture ID index, 15 bits; 52 // kNoPictureId if PictureID does not exist. 53 int16_t tl0PicIdx; // TL0PIC_IDX, 8 bits; 54 // kNoTl0PicIdx means no value provided. 55 uint8_t temporalIdx; // Temporal layer index, or kNoTemporalIdx. 56 bool layerSync; // This frame is a layer sync frame. 57 // Disabled if temporalIdx == kNoTemporalIdx. 58 int keyIdx; // 5 bits; kNoKeyIdx means not used. 59 int partitionId; // VP8 partition ID 60 bool beginningOfPartition; // True if this packet is the first 61 // in a VP8 partition. Otherwise false 62 }; 63 64 } // namespace webrtc 65 66 #endif // MODULES_VIDEO_CODING_CODECS_VP8_INCLUDE_VP8_GLOBALS_H_