Index: webrtc/modules/interface/module_common_types.h |
diff --git a/webrtc/modules/interface/module_common_types.h b/webrtc/modules/interface/module_common_types.h |
index 1202eee0435c3774b7daf45a2eb20384dc6d4205..99e8eed0e830bf987a96c63d080f761ff06eb6b4 100644 |
--- a/webrtc/modules/interface/module_common_types.h |
+++ b/webrtc/modules/interface/module_common_types.h |
@@ -32,8 +32,15 @@ struct RTPAudioHeader { |
}; |
const int16_t kNoPictureId = -1; |
+const int16_t kMaxOneBytePictureId = 0x7F; // 7 bits |
+const int16_t kMaxTwoBytePictureId = 0x7FFF; // 15 bits |
const int16_t kNoTl0PicIdx = -1; |
const uint8_t kNoTemporalIdx = 0xFF; |
+const uint8_t kNoSpatialIdx = 0xFF; |
+const uint8_t kNoGofIdx = 0xFF; |
+const size_t kMaxVp9RefPics = 3; |
+const size_t kMaxVp9FramesInGof = 16; |
+const size_t kMaxVp9NumberOfSpatialLayers = 8; |
const int kNoKeyIdx = -1; |
struct RTPVideoHeaderVP8 { |
@@ -62,6 +69,80 @@ struct RTPVideoHeaderVP8 { |
// in a VP8 partition. Otherwise false |
}; |
+struct GofInfoVP9 { |
+ void CopyGofInfoVP9(const GofInfoVP9& src) { |
+ numFramesInGof = src.numFramesInGof; |
+ for (size_t i = 0; i < numFramesInGof; ++i) { |
+ temporalIdx[i] = src.temporalIdx[i]; |
+ temporalUpSwitch[i] = src.temporalUpSwitch[i]; |
+ numRefPics[i] = src.numRefPics[i]; |
+ for (size_t r = 0; r < numRefPics[i]; ++r) { |
+ pidDiff[i][r] = src.pidDiff[i][r]; |
+ } |
+ } |
+ } |
+ |
+ size_t numFramesInGof; |
+ uint8_t temporalIdx[kMaxVp9FramesInGof]; |
+ bool temporalUpSwitch[kMaxVp9FramesInGof]; |
+ size_t numRefPics[kMaxVp9FramesInGof]; |
+ int16_t pidDiff[kMaxVp9FramesInGof][kMaxVp9RefPics]; |
+}; |
+ |
+struct RTPVideoHeaderVP9 { |
+ void InitRTPVideoHeaderVP9() { |
+ interPicPredicted = false; |
+ flexibleMode = false; |
+ beginningOfFrame = false; |
+ endOfFrame = false; |
+ ssDataAvailable = false; |
+ pictureId = kNoPictureId; |
+ maxPictureId = kMaxTwoBytePictureId; |
+ tl0PicIdx = kNoTl0PicIdx; |
+ temporalIdx = kNoTemporalIdx; |
+ spatialIdx = kNoSpatialIdx; |
+ temporalUpSwitch = false; |
+ interLayerPredicted = false; |
+ gofIdx = kNoGofIdx; |
+ numRefPics = 0; |
+ } |
+ |
+ bool interPicPredicted; // This layer frame is dependent on previously coded |
stefan-webrtc
2015/07/14 09:40:10
If you don't mind, I would prefer none of these me
åsapersson
2015/07/14 10:53:54
Done.
|
+ // frame(s). |
+ bool flexibleMode; // This frame is in flexible mode. |
+ bool beginningOfFrame; // True if this packet is the first in a VP9 layer |
+ // frame. |
+ bool endOfFrame; // True if this packet is the last in a VP9 layer frame. |
+ bool ssDataAvailable; // True if SS data is available in this payload |
+ // descriptor. |
+ int16_t pictureId; // Picture ID index, 15 bits; |
+ // kNoPictureId if PictureID does not exist. |
+ int16_t maxPictureId; // Maximum picture ID index; either 0x7F or 0x7FFF; |
+ int16_t tl0PicIdx; // TL0PIC_IDX, 8 bits; |
+ // kNoTl0PicIdx means no value provided. |
+ uint8_t temporalIdx; // Temporal layer index, or kNoTemporalIdx. |
+ uint8_t spatialIdx; // Spatial layer index, or kNoSpatialIdx. |
+ bool temporalUpSwitch; // True if upswitch to higher frame rate is possible |
+ // starting from this frame. |
+ bool interLayerPredicted; // Frame is dependent on directly lower spatial |
+ // layer frame. |
+ |
+ uint8_t gofIdx; // Index to predefined temporal frame info in SS data. |
+ |
+ size_t |
+ numRefPics; // Number of reference pictures used by current layer frame. |
+ int16_t pidDiff[kMaxVp9RefPics]; // P_DIFF signaled to derive the PictureID |
+ // of the reference pictures. |
+ int16_t refPictureId[kMaxVp9RefPics]; // PictureID of the reference pictures. |
+ |
+ // SS data. |
+ size_t numSpatialLayers; |
+ bool spatialLayerResolutionPresent; |
+ uint16_t width[kMaxVp9NumberOfSpatialLayers]; |
+ uint16_t height[kMaxVp9NumberOfSpatialLayers]; |
+ GofInfoVP9 gof; |
+}; |
+ |
// The packetization types that we support: single, aggregated, and fragmented. |
enum H264PacketizationTypes { |
kH264SingleNalu, // This packet contains a single NAL unit. |
@@ -85,6 +166,7 @@ struct RTPVideoHeaderH264 { |
union RTPVideoTypeHeader { |
RTPVideoHeaderVP8 VP8; |
+ RTPVideoHeaderVP9 VP9; |
RTPVideoHeaderH264 H264; |
}; |