| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_DECODING_STATE_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_DECODING_STATE_H_ |
| 12 #define WEBRTC_MODULES_VIDEO_CODING_DECODING_STATE_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_DECODING_STATE_H_ |
| 13 | 13 |
| 14 #include <map> | |
| 15 #include <set> | |
| 16 #include <vector> | |
| 17 | |
| 18 #include "webrtc/typedefs.h" | 14 #include "webrtc/typedefs.h" |
| 19 | 15 |
| 20 namespace webrtc { | 16 namespace webrtc { |
| 21 | 17 |
| 22 // Forward declarations | 18 // Forward declarations |
| 23 struct NaluInfo; | |
| 24 class VCMFrameBuffer; | 19 class VCMFrameBuffer; |
| 25 class VCMPacket; | 20 class VCMPacket; |
| 26 | 21 |
| 27 class VCMDecodingState { | 22 class VCMDecodingState { |
| 28 public: | 23 public: |
| 29 // The max number of bits used to reference back | 24 // The max number of bits used to reference back |
| 30 // to a previous frame when using flexible mode. | 25 // to a previous frame when using flexible mode. |
| 31 static const uint16_t kNumRefBits = 7; | 26 static const uint16_t kNumRefBits = 7; |
| 32 static const uint16_t kFrameDecodedLength = 1 << kNumRefBits; | 27 static const uint16_t kFrameDecodedLength = 1 << kNumRefBits; |
| 33 | 28 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 59 private: | 54 private: |
| 60 void UpdateSyncState(const VCMFrameBuffer* frame); | 55 void UpdateSyncState(const VCMFrameBuffer* frame); |
| 61 // Designated continuity functions | 56 // Designated continuity functions |
| 62 bool ContinuousPictureId(int picture_id) const; | 57 bool ContinuousPictureId(int picture_id) const; |
| 63 bool ContinuousSeqNum(uint16_t seq_num) const; | 58 bool ContinuousSeqNum(uint16_t seq_num) const; |
| 64 bool ContinuousLayer(int temporal_id, int tl0_pic_id) const; | 59 bool ContinuousLayer(int temporal_id, int tl0_pic_id) const; |
| 65 bool ContinuousFrameRefs(const VCMFrameBuffer* frame) const; | 60 bool ContinuousFrameRefs(const VCMFrameBuffer* frame) const; |
| 66 bool UsingPictureId(const VCMFrameBuffer* frame) const; | 61 bool UsingPictureId(const VCMFrameBuffer* frame) const; |
| 67 bool UsingFlexibleMode(const VCMFrameBuffer* frame) const; | 62 bool UsingFlexibleMode(const VCMFrameBuffer* frame) const; |
| 68 bool AheadOfFramesDecodedClearedTo(uint16_t index) const; | 63 bool AheadOfFramesDecodedClearedTo(uint16_t index) const; |
| 69 bool HaveSpsAndPps(const std::vector<NaluInfo>& nalus) const; | |
| 70 | 64 |
| 71 // Keep state of last decoded frame. | 65 // Keep state of last decoded frame. |
| 72 // TODO(mikhal/stefan): create designated classes to handle these types. | 66 // TODO(mikhal/stefan): create designated classes to handle these types. |
| 73 uint16_t sequence_num_; | 67 uint16_t sequence_num_; |
| 74 uint32_t time_stamp_; | 68 uint32_t time_stamp_; |
| 75 int picture_id_; | 69 int picture_id_; |
| 76 int temporal_id_; | 70 int temporal_id_; |
| 77 int tl0_pic_id_; | 71 int tl0_pic_id_; |
| 78 bool full_sync_; // Sync flag when temporal layers are used. | 72 bool full_sync_; // Sync flag when temporal layers are used. |
| 79 bool in_initial_state_; | 73 bool in_initial_state_; |
| 80 | 74 |
| 81 // Used to check references in flexible mode. | 75 // Used to check references in flexible mode. |
| 82 bool frame_decoded_[kFrameDecodedLength]; | 76 bool frame_decoded_[kFrameDecodedLength]; |
| 83 uint16_t frame_decoded_cleared_to_; | 77 uint16_t frame_decoded_cleared_to_; |
| 84 std::set<int> received_sps_; | |
| 85 std::map<int, int> received_pps_; | |
| 86 }; | 78 }; |
| 87 | 79 |
| 88 } // namespace webrtc | 80 } // namespace webrtc |
| 89 | 81 |
| 90 #endif // WEBRTC_MODULES_VIDEO_CODING_DECODING_STATE_H_ | 82 #endif // WEBRTC_MODULES_VIDEO_CODING_DECODING_STATE_H_ |
| OLD | NEW |