Changeset 4784

Show
Ignore:
Timestamp:
04/28/10 15:09:39 (4 years ago)
Author:
soohyunc
Message:

create a field in pktbuf (i.e., bool tag) to indicate if this packet belongs to
the same video frame or not.

  • if tag is set (true), then this packets belong to the same frame.
  • if tag is set to false at the very last packets for the frame.

based on this information, CC module can compute the average packet size in
bytes.

  • first, compute the arithmetic average packet size per frame
  • then, use this average size to compute EWMA packet size

then, cwnd (in bytes) can be computed:

  • cwnd (in bytes) = psize * cwnd (in packets)
Location:
vic/branches/cc
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • vic/branches/cc/cc/tfwc_sndr.cpp

    r4783 r4784  
    144144        record_ = (u_int16_t *)malloc(sizeof(u_int16_t) * PSR); 
    145145        clear_record(PSR); 
     146        // EWMA packet size 
     147        asize_ = 0; 
     148        pcnt_ = 0; 
    146149        psize_ = 0; 
    147150        lambda_ = .75; 
     
    160163        record_[seqno_%PSR] = pb->len; 
    161164        //print_psize(now_, record_[seqno_%PSR]); 
    162          
    163         // EWMA'd packet size 
    164         psize_ = lambda_ * pb->len + (1 - lambda_) * psize_;     
     165 
     166        // arithmetic average 
     167        asize_ += pb->len; 
     168        asize_ /= ++pcnt_; 
     169 
     170        // tag finished (end of frame) 
     171        if (!(pb->tag)) { 
     172                // EWMA'd packet size 
     173                psize_ = lambda_ * asize_ + (1 - lambda_) * psize_;      
     174                pcnt_ = 0; 
     175        } 
    165176 
    166177        // timestamp vector for loss history update 
  • vic/branches/cc/cc/tfwc_sndr.h

    r4783 r4784  
    176176 
    177177        // packet size 
    178         int psize_; 
    179         double lambda_; 
     178        int asize_;             // average packet size per frame 
     179        int pcnt_;              // packet counter per frame 
     180        int psize_;             // EWMA packet size  
     181        double lambda_; // EWMA coeff 
    180182 
    181183private: 
  • vic/branches/cc/codec/encoder-h261.cpp

    r4782 r4784  
    964964 
    965965        pktbuf* pb = pool_->alloc(vf->ts_, RTP_PT_H261); 
     966        pb->tag = true; 
    966967        bs_ = &pb->data[HDRSIZE]; 
    967968        bc_ = bs_; 
     
    10531054                } 
    10541055        } 
     1056        pb->tag = false; 
    10551057        cc += flush(pb, ((bc_ - bs_) << 3) + nbb_, 0); 
    10561058 
  • vic/branches/cc/net/pktbuf.h

    r4211 r4784  
    9292        int len; 
    9393        int ref; 
     94        bool tag; 
    9495        u_int8_t* dp; 
    9596        u_int8_t data[PKTBUF_SIZE];