Removing non decodable count from session info: This value isn't used, and therfore can be removed. This is a step towards the refactor of the session info to use maps.

R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2143004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4667 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/video_coding/main/source/frame_buffer.cc b/webrtc/modules/video_coding/main/source/frame_buffer.cc
index 42d6279..b4a32e4 100644
--- a/webrtc/modules/video_coding/main/source/frame_buffer.cc
+++ b/webrtc/modules/video_coding/main/source/frame_buffer.cc
@@ -272,10 +272,6 @@
     return VCM_OK;
 }
 
-int VCMFrameBuffer::NotDecodablePackets() const {
-  return _sessionInfo.packets_not_decodable();
-}
-
 // Set counted status (as counted by JB or not)
 void VCMFrameBuffer::SetCountedFrame(bool frameCounted) {
     _frameCounted = frameCounted;
diff --git a/webrtc/modules/video_coding/main/source/frame_buffer.h b/webrtc/modules/video_coding/main/source/frame_buffer.h
index 2df3830..d8c9d27 100644
--- a/webrtc/modules/video_coding/main/source/frame_buffer.h
+++ b/webrtc/modules/video_coding/main/source/frame_buffer.h
@@ -79,10 +79,6 @@
 
   int32_t ExtractFromStorage(const EncodedVideoData& frameFromStorage);
 
-  // The number of packets discarded because the decoder can't make use of
-  // them.
-  int NotDecodablePackets() const;
-
   // If _state is kStateDecodable, changes it to kStateIncomplete.
   // Used by the dual decoder. After the mode is changed to kNoErrors from
   // kWithErrors or kSelective errors, any states that have been marked
diff --git a/webrtc/modules/video_coding/main/source/jitter_buffer.cc b/webrtc/modules/video_coding/main/source/jitter_buffer.cc
index 327b8f2..8bf7d78 100644
--- a/webrtc/modules/video_coding/main/source/jitter_buffer.cc
+++ b/webrtc/modules/video_coding/main/source/jitter_buffer.cc
@@ -147,7 +147,6 @@
       incomplete_frames_(),
       last_decoded_state_(),
       first_packet_since_reset_(true),
-      num_not_decodable_packets_(0),
       receive_statistics_(),
       incoming_frame_rate_(0),
       incoming_frame_count_(0),
@@ -215,7 +214,6 @@
     rtt_ms_ = rhs.rtt_ms_;
     first_packet_since_reset_ = rhs.first_packet_since_reset_;
     last_decoded_state_ =  rhs.last_decoded_state_;
-    num_not_decodable_packets_ = rhs.num_not_decodable_packets_;
     decode_error_mode_ = rhs.decode_error_mode_;
     assert(max_nack_list_size_ == rhs.max_nack_list_size_);
     assert(max_packet_age_to_nack_ == rhs.max_packet_age_to_nack_);
@@ -280,7 +278,6 @@
   waiting_for_completion_.latest_packet_time = -1;
   first_packet_since_reset_ = true;
   rtt_ms_ = kDefaultRtt;
-  num_not_decodable_packets_ = 0;
   last_decoded_state_.Reset();
 
   WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCoding,
@@ -321,7 +318,6 @@
   decodable_frames_.Reset(&free_frames_);
   incomplete_frames_.Reset(&free_frames_);
   last_decoded_state_.Reset();  // TODO(mikhal): sync reset.
-  num_not_decodable_packets_ = 0;
   frame_event_->Reset();
   packet_event_->Reset();
   num_consecutive_old_frames_ = 0;
@@ -349,11 +345,6 @@
   *received_key_frames = receive_statistics_[0] + receive_statistics_[2];
 }
 
-int VCMJitterBuffer::num_not_decodable_packets() const {
-  CriticalSectionScoped cs(crit_sect_);
-  return num_not_decodable_packets_;
-}
-
 int VCMJitterBuffer::num_discarded_packets() const {
   CriticalSectionScoped cs(crit_sect_);
   return num_discarded_packets_;
@@ -562,8 +553,6 @@
   // decoder. Propagates the missing_frame bit.
   frame->PrepareForDecode(continuous);
 
-  num_not_decodable_packets_ += frame->NotDecodablePackets();
-
   // We have a frame - update the last decoded state and nack list.
   last_decoded_state_.SetState(frame);
   DropPacketsFromNackList(last_decoded_state_.sequence_num());
diff --git a/webrtc/modules/video_coding/main/source/jitter_buffer.h b/webrtc/modules/video_coding/main/source/jitter_buffer.h
index 805c9b9..c7646c1 100644
--- a/webrtc/modules/video_coding/main/source/jitter_buffer.h
+++ b/webrtc/modules/video_coding/main/source/jitter_buffer.h
@@ -299,7 +299,6 @@
   bool first_packet_since_reset_;
 
   // Statistics.
-  int num_not_decodable_packets_;
   // Frame counter for each type (key, delta, golden, key-delta).
   unsigned int receive_statistics_[4];
   // Latest calculated frame rates of incoming stream.
diff --git a/webrtc/modules/video_coding/main/source/jitter_buffer_unittest.cc b/webrtc/modules/video_coding/main/source/jitter_buffer_unittest.cc
index db53b80..b982ace 100644
--- a/webrtc/modules/video_coding/main/source/jitter_buffer_unittest.cc
+++ b/webrtc/modules/video_coding/main/source/jitter_buffer_unittest.cc
@@ -937,8 +937,6 @@
     jitter_buffer_->ReleaseFrame(frame_out);
   }
 
-  EXPECT_EQ(10, jitter_buffer_->num_not_decodable_packets());
-
   // Insert 3 old packets and verify that we have 3 discarded packets
   // Match value to actual latest timestamp decoded.
   timestamp_ -= 33 * 90;
diff --git a/webrtc/modules/video_coding/main/source/session_info.cc b/webrtc/modules/video_coding/main/source/session_info.cc
index 6d90b96..814d279 100644
--- a/webrtc/modules/video_coding/main/source/session_info.cc
+++ b/webrtc/modules/video_coding/main/source/session_info.cc
@@ -30,7 +30,6 @@
       packets_(),
       empty_seq_num_low_(-1),
       empty_seq_num_high_(-1),
-      packets_not_decodable_(0),
       first_packet_seq_num_(-1),
       last_packet_seq_num_(-1) {
 }
@@ -101,7 +100,6 @@
   packets_.clear();
   empty_seq_num_low_ = -1;
   empty_seq_num_high_ = -1;
-  packets_not_decodable_ = 0;
   first_packet_seq_num_ = -1;
   last_packet_seq_num_ = -1;
 }
@@ -247,7 +245,6 @@
     bytes_to_delete += (*it).sizeBytes;
     (*it).sizeBytes = 0;
     (*it).dataPtr = NULL;
-    ++packets_not_decodable_;
   }
   if (bytes_to_delete > 0)
     ShiftSubsequentPackets(end, -bytes_to_delete);
@@ -266,8 +263,7 @@
          kMaxVP8Partitions * sizeof(uint32_t));
   if (packets_.empty())
       return new_length;
-  PacketIterator it = FindNextPartitionBeginning(packets_.begin(),
-                                                 &packets_not_decodable_);
+  PacketIterator it = FindNextPartitionBeginning(packets_.begin());
   while (it != packets_.end()) {
     const int partition_id =
         (*it).codecSpecificHeader.codecHeader.VP8.partitionId;
@@ -282,7 +278,7 @@
            static_cast<uint32_t>(frame_buffer_length));
     new_length += fragmentation->fragmentationLength[partition_id];
     ++partition_end;
-    it = FindNextPartitionBeginning(partition_end, &packets_not_decodable_);
+    it = FindNextPartitionBeginning(partition_end);
     if (partition_id + 1 > fragmentation->fragmentationVectorSize)
       fragmentation->fragmentationVectorSize = partition_id + 1;
   }
@@ -304,14 +300,10 @@
 }
 
 VCMSessionInfo::PacketIterator VCMSessionInfo::FindNextPartitionBeginning(
-    PacketIterator it, int* packets_skipped) const {
+    PacketIterator it) const {
   while (it != packets_.end()) {
     if ((*it).codecSpecificHeader.codecHeader.VP8.beginningOfPartition) {
       return it;
-    } else if (packets_skipped !=  NULL) {
-      // This packet belongs to a partition with a previous loss and can't
-      // be decoded.
-      ++(*packets_skipped);
     }
     ++it;
   }
@@ -479,8 +471,4 @@
     empty_seq_num_low_ = seq_num;
 }
 
-int VCMSessionInfo::packets_not_decodable() const {
-  return packets_not_decodable_;
-}
-
 }  // namespace webrtc
diff --git a/webrtc/modules/video_coding/main/source/session_info.h b/webrtc/modules/video_coding/main/source/session_info.h
index c7950d3..039f097 100644
--- a/webrtc/modules/video_coding/main/source/session_info.h
+++ b/webrtc/modules/video_coding/main/source/session_info.h
@@ -107,8 +107,7 @@
   // |it| is expected to point to the last packet of the previous partition,
   // or to the first packet of the frame. |packets_skipped| is incremented
   // for each packet found which doesn't have the beginning bit set.
-  PacketIterator FindNextPartitionBeginning(PacketIterator it,
-                                            int* packets_skipped) const;
+  PacketIterator FindNextPartitionBeginning(PacketIterator it) const;
 
   // Returns an iterator pointing to the last packet of the partition pointed to
   // by |it|.
@@ -153,8 +152,6 @@
   PacketList packets_;
   int empty_seq_num_low_;
   int empty_seq_num_high_;
-  // Number of packets discarded because the decoder can't use them.
-  int packets_not_decodable_;
 
   // The following two variables correspond to the first and last media packets
   // in a session defined by the first packet flag and the marker bit.
diff --git a/webrtc/modules/video_coding/main/source/session_info_unittest.cc b/webrtc/modules/video_coding/main/source/session_info_unittest.cc
index 1317d78..2fab94d 100644
--- a/webrtc/modules/video_coding/main/source/session_info_unittest.cc
+++ b/webrtc/modules/video_coding/main/source/session_info_unittest.cc
@@ -219,7 +219,6 @@
                                   frame_data),
             packet_buffer_size());
 
-  EXPECT_EQ(0, session_.packets_not_decodable());
   EXPECT_EQ(10 * packet_buffer_size(), session_.SessionLength());
   for (int i = 0; i < 10; ++i) {
     SCOPED_TRACE("Calling VerifyPacket");
@@ -237,7 +236,6 @@
                                   kWithErrors,
                                   frame_data),
             packet_buffer_size());
-  EXPECT_EQ(0, session_.packets_not_decodable());
   EXPECT_TRUE(session_.decodable());
 }
 
@@ -253,7 +251,6 @@
                                   kSelectiveErrors,
                                   frame_data),
             packet_buffer_size());
-  EXPECT_EQ(0, session_.packets_not_decodable());
   EXPECT_FALSE(session_.decodable());
 
   packet_.seqNum -= 1;
@@ -264,7 +261,6 @@
                                   kSelectiveErrors,
                                   frame_data),
             packet_buffer_size());
-  EXPECT_EQ(0, session_.packets_not_decodable());
   EXPECT_TRUE(session_.decodable());
 
   packet_.isFirstPacket = false;
@@ -277,7 +273,6 @@
                                     kSelectiveErrors,
                                     frame_data),
               packet_buffer_size());
-    EXPECT_EQ(0, session_.packets_not_decodable());
     EXPECT_TRUE(session_.decodable());
   }
 
@@ -288,7 +283,6 @@
                                   kSelectiveErrors,
                                   frame_data),
             packet_buffer_size());
-  EXPECT_EQ(0, session_.packets_not_decodable());
   EXPECT_TRUE(session_.decodable());
 }
 
@@ -614,7 +608,6 @@
   EXPECT_TRUE(VerifyPartition(0, 2, 1));
   SCOPED_TRACE("Calling VerifyPartition");
   EXPECT_TRUE(VerifyPartition(1, 1, 3));
-  EXPECT_EQ(1, session_.packets_not_decodable());
 }
 
 TEST_F(TestVP8Partitions, TwoPartitionsNoLossWrap) {
@@ -686,7 +679,6 @@
   EXPECT_TRUE(VerifyPartition(0, 2, 0));
   SCOPED_TRACE("Calling VerifyPartition");
   EXPECT_TRUE(VerifyPartition(1, 2, 2));
-  EXPECT_EQ(0, session_.packets_not_decodable());
 }
 
 TEST_F(TestVP8Partitions, TwoPartitionsLossWrap) {
@@ -758,7 +750,6 @@
   EXPECT_TRUE(VerifyPartition(0, 2, 0));
   SCOPED_TRACE("Calling VerifyPartition");
   EXPECT_TRUE(VerifyPartition(1, 1, 2));
-  EXPECT_EQ(1, session_.packets_not_decodable());
 }
 
 
@@ -831,7 +822,6 @@
   EXPECT_TRUE(VerifyPartition(0, 2, 1));
   SCOPED_TRACE("Calling VerifyPartition");
   EXPECT_TRUE(VerifyPartition(2, 2, 5));
-  EXPECT_EQ(0, session_.packets_not_decodable());
 }
 
 TEST_F(TestVP8Partitions, ThreePartitionsLossInSecond) {
@@ -932,7 +922,6 @@
   EXPECT_TRUE(VerifyPartition(0, 2, 1));
   SCOPED_TRACE("Calling VerifyPartition");
   EXPECT_TRUE(VerifyPartition(2, 2, 6));
-  EXPECT_EQ(2, session_.packets_not_decodable());
 }
 
 TEST_F(TestVP8Partitions, AggregationOverTwoPackets) {
@@ -986,7 +975,6 @@
                                                  frame_buffer_size(),
                                                  &fragmentation_),
             3 * packet_buffer_size());
-  EXPECT_EQ(0, session_.packets_not_decodable());
   SCOPED_TRACE("Calling VerifyPartition");
   EXPECT_TRUE(VerifyPartition(0, 2, 0));
   // This partition is aggregated in partition 0
@@ -1010,7 +998,6 @@
 
   EXPECT_EQ(0, session_.MakeDecodable());
   EXPECT_EQ(0, session_.SessionLength());
-  EXPECT_EQ(0, session_.packets_not_decodable());
 }
 
 TEST_F(TestNalUnits, OneIsolatedNaluLoss) {
@@ -1038,7 +1025,6 @@
 
   EXPECT_EQ(0, session_.MakeDecodable());
   EXPECT_EQ(2 * packet_buffer_size(), session_.SessionLength());
-  EXPECT_EQ(0, session_.packets_not_decodable());
   SCOPED_TRACE("Calling VerifyNalu");
   EXPECT_TRUE(VerifyNalu(0, 1, 0));
   SCOPED_TRACE("Calling VerifyNalu");
@@ -1070,7 +1056,6 @@
 
   EXPECT_EQ(packet_buffer_size(), session_.MakeDecodable());
   EXPECT_EQ(packet_buffer_size(), session_.SessionLength());
-  EXPECT_EQ(1, session_.packets_not_decodable());
   SCOPED_TRACE("Calling VerifyNalu");
   EXPECT_TRUE(VerifyNalu(0, 1, 0));
 }
@@ -1100,7 +1085,6 @@
 
   EXPECT_EQ(packet_buffer_size(), session_.MakeDecodable());
   EXPECT_EQ(packet_buffer_size(), session_.SessionLength());
-  EXPECT_EQ(1, session_.packets_not_decodable());
   SCOPED_TRACE("Calling VerifyNalu");
   EXPECT_TRUE(VerifyNalu(0, 1, 0));
 }
@@ -1141,7 +1125,6 @@
             packet_buffer_size());
 
   EXPECT_EQ(0, session_.MakeDecodable());
-  EXPECT_EQ(0, session_.packets_not_decodable());
   EXPECT_EQ(3 * packet_buffer_size(), session_.SessionLength());
   SCOPED_TRACE("Calling VerifyNalu");
   EXPECT_TRUE(VerifyNalu(0, 1, 0));
@@ -1172,7 +1155,6 @@
 
   EXPECT_EQ(2 * packet_buffer_size(), session_.MakeDecodable());
   EXPECT_EQ(0, session_.SessionLength());
-  EXPECT_EQ(2, session_.packets_not_decodable());
 }
 
 TEST_F(TestNalUnits, ReorderWrapLosses) {
@@ -1202,7 +1184,6 @@
 
   EXPECT_EQ(2 * packet_buffer_size(), session_.MakeDecodable());
   EXPECT_EQ(0, session_.SessionLength());
-  EXPECT_EQ(2, session_.packets_not_decodable());
 }
 
 }  // namespace webrtc