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

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

Issue 1328113004: Work on flexible mode and screen sharing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase + comments Created 5 years, 1 month 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 "webrtc/typedefs.h" 14 #include "webrtc/typedefs.h"
15 15
16 namespace webrtc { 16 namespace webrtc {
17 17
18 // Forward declarations 18 // Forward declarations
19 class VCMFrameBuffer; 19 class VCMFrameBuffer;
20 class VCMPacket; 20 class VCMPacket;
21 21
22 class VCMDecodingState { 22 class VCMDecodingState {
23 public: 23 public:
24 // The max number of bits used to reference back
25 // to a previous frame when using flexible mode.
26 static const uint16_t kNumRefBits = 7;
27 static const uint16_t kFrameDecodedLength = 1 << kNumRefBits;
28
24 VCMDecodingState(); 29 VCMDecodingState();
25 ~VCMDecodingState(); 30 ~VCMDecodingState();
26 // Check for old frame 31 // Check for old frame
27 bool IsOldFrame(const VCMFrameBuffer* frame) const; 32 bool IsOldFrame(const VCMFrameBuffer* frame) const;
28 // Check for old packet 33 // Check for old packet
29 bool IsOldPacket(const VCMPacket* packet) const; 34 bool IsOldPacket(const VCMPacket* packet) const;
30 // Check for frame continuity based on current decoded state. Use best method 35 // Check for frame continuity based on current decoded state. Use best method
31 // possible, i.e. temporal info, picture ID or sequence number. 36 // possible, i.e. temporal info, picture ID or sequence number.
32 bool ContinuousFrame(const VCMFrameBuffer* frame) const; 37 bool ContinuousFrame(const VCMFrameBuffer* frame) const;
33 void SetState(const VCMFrameBuffer* frame); 38 void SetState(const VCMFrameBuffer* frame);
(...skipping 11 matching lines...) Expand all
45 bool in_initial_state() const; 50 bool in_initial_state() const;
46 // Return true when sync is on - decode all layers. 51 // Return true when sync is on - decode all layers.
47 bool full_sync() const; 52 bool full_sync() const;
48 53
49 private: 54 private:
50 void UpdateSyncState(const VCMFrameBuffer* frame); 55 void UpdateSyncState(const VCMFrameBuffer* frame);
51 // Designated continuity functions 56 // Designated continuity functions
52 bool ContinuousPictureId(int picture_id) const; 57 bool ContinuousPictureId(int picture_id) const;
53 bool ContinuousSeqNum(uint16_t seq_num) const; 58 bool ContinuousSeqNum(uint16_t seq_num) const;
54 bool ContinuousLayer(int temporal_id, int tl0_pic_id) const; 59 bool ContinuousLayer(int temporal_id, int tl0_pic_id) const;
60 bool ContinuousFrameRefs(const VCMFrameBuffer* frame) const;
55 bool UsingPictureId(const VCMFrameBuffer* frame) const; 61 bool UsingPictureId(const VCMFrameBuffer* frame) const;
62 bool UsingFlexibleMode(const VCMFrameBuffer* frame) const;
63 bool AheadOfFramesDecodedClearedTo(uint16_t index) const;
56 64
57 // Keep state of last decoded frame. 65 // Keep state of last decoded frame.
58 // TODO(mikhal/stefan): create designated classes to handle these types. 66 // TODO(mikhal/stefan): create designated classes to handle these types.
59 uint16_t sequence_num_; 67 uint16_t sequence_num_;
60 uint32_t time_stamp_; 68 uint32_t time_stamp_;
61 int picture_id_; 69 int picture_id_;
62 int temporal_id_; 70 int temporal_id_;
63 int tl0_pic_id_; 71 int tl0_pic_id_;
64 bool full_sync_; // Sync flag when temporal layers are used. 72 bool full_sync_; // Sync flag when temporal layers are used.
65 bool in_initial_state_; 73 bool in_initial_state_;
74
75 // Used to check references in flexible mode.
76 bool frame_decoded_[kFrameDecodedLength];
77 uint16_t frame_decoded_cleared_to_;
66 }; 78 };
67 79
68 } // namespace webrtc 80 } // namespace webrtc
69 81
70 #endif // WEBRTC_MODULES_VIDEO_CODING_DECODING_STATE_H_ 82 #endif // WEBRTC_MODULES_VIDEO_CODING_DECODING_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698