Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: webrtc/modules/video_coding/decoding_state.h

Issue 2341713002: Use sps and pps to determine decodability of H.264 frames. (Closed)
Patch Set: comments addressed. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
14 #include "webrtc/typedefs.h" 18 #include "webrtc/typedefs.h"
15 19
16 namespace webrtc { 20 namespace webrtc {
17 21
18 // Forward declarations 22 // Forward declarations
23 struct NaluInfo;
19 class VCMFrameBuffer; 24 class VCMFrameBuffer;
20 class VCMPacket; 25 class VCMPacket;
21 26
22 class VCMDecodingState { 27 class VCMDecodingState {
23 public: 28 public:
24 // The max number of bits used to reference back 29 // The max number of bits used to reference back
25 // to a previous frame when using flexible mode. 30 // to a previous frame when using flexible mode.
26 static const uint16_t kNumRefBits = 7; 31 static const uint16_t kNumRefBits = 7;
27 static const uint16_t kFrameDecodedLength = 1 << kNumRefBits; 32 static const uint16_t kFrameDecodedLength = 1 << kNumRefBits;
28 33
(...skipping 25 matching lines...) Expand all
54 private: 59 private:
55 void UpdateSyncState(const VCMFrameBuffer* frame); 60 void UpdateSyncState(const VCMFrameBuffer* frame);
56 // Designated continuity functions 61 // Designated continuity functions
57 bool ContinuousPictureId(int picture_id) const; 62 bool ContinuousPictureId(int picture_id) const;
58 bool ContinuousSeqNum(uint16_t seq_num) const; 63 bool ContinuousSeqNum(uint16_t seq_num) const;
59 bool ContinuousLayer(int temporal_id, int tl0_pic_id) const; 64 bool ContinuousLayer(int temporal_id, int tl0_pic_id) const;
60 bool ContinuousFrameRefs(const VCMFrameBuffer* frame) const; 65 bool ContinuousFrameRefs(const VCMFrameBuffer* frame) const;
61 bool UsingPictureId(const VCMFrameBuffer* frame) const; 66 bool UsingPictureId(const VCMFrameBuffer* frame) const;
62 bool UsingFlexibleMode(const VCMFrameBuffer* frame) const; 67 bool UsingFlexibleMode(const VCMFrameBuffer* frame) const;
63 bool AheadOfFramesDecodedClearedTo(uint16_t index) const; 68 bool AheadOfFramesDecodedClearedTo(uint16_t index) const;
69 bool HaveSpsAndPps(const std::vector<NaluInfo>& nalus) const;
64 70
65 // Keep state of last decoded frame. 71 // Keep state of last decoded frame.
66 // TODO(mikhal/stefan): create designated classes to handle these types. 72 // TODO(mikhal/stefan): create designated classes to handle these types.
67 uint16_t sequence_num_; 73 uint16_t sequence_num_;
68 uint32_t time_stamp_; 74 uint32_t time_stamp_;
69 int picture_id_; 75 int picture_id_;
70 int temporal_id_; 76 int temporal_id_;
71 int tl0_pic_id_; 77 int tl0_pic_id_;
72 bool full_sync_; // Sync flag when temporal layers are used. 78 bool full_sync_; // Sync flag when temporal layers are used.
73 bool in_initial_state_; 79 bool in_initial_state_;
74 80
75 // Used to check references in flexible mode. 81 // Used to check references in flexible mode.
76 bool frame_decoded_[kFrameDecodedLength]; 82 bool frame_decoded_[kFrameDecodedLength];
77 uint16_t frame_decoded_cleared_to_; 83 uint16_t frame_decoded_cleared_to_;
84 std::set<int> received_sps_;
85 std::map<int, int> received_pps_;
78 }; 86 };
79 87
80 } // namespace webrtc 88 } // namespace webrtc
81 89
82 #endif // WEBRTC_MODULES_VIDEO_CODING_DECODING_STATE_H_ 90 #endif // WEBRTC_MODULES_VIDEO_CODING_DECODING_STATE_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc ('k') | webrtc/modules/video_coding/decoding_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698