Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

vatrcvr.cc File Reference

#include <sys/time.h>
#include "agent.h"
#include "rtp.h"
#include "adaptive-receiver.h"
#include "vat.h"

Include dependency graph for vatrcvr.cc:

Include dependency graph

Go to the source code of this file.

Compounds

class  VatRcvr
struct  VatRcvr.statcntr
class  VatRcvrClass

Defines

#define MAXSTAT   16

Functions

int absdiff (int x, int y)
int newoffset (int nvar, int playout, int maxdel, int mindel, int lecture)

Variables

const char rcsid []
VatRcvrClass class_vat_rcvr


Define Documentation

#define MAXSTAT   16
 

Definition at line 78 of file vatrcvr.cc.

Referenced by VatRcvr::VatRcvr().


Function Documentation

int absdiff int  x,
int  y
[inline]
 

Definition at line 93 of file vatrcvr.cc.

00094 {
00095         register int r = y - x;
00096         return (r < 0? -r : r);
00097 }

int newoffset int  nvar,
int  playout,
int  maxdel,
int  mindel,
int  lecture
[inline, static]
 

Definition at line 99 of file vatrcvr.cc.

References FRAMESIZE.

Referenced by VatRcvr::adapt().

00103 {
00104         register int offset = nvar;
00105         if (offset > maxdel)
00106                 offset = maxdel;
00107         register int diff = playout - offset;
00108 
00109         if (diff > 0) {
00110                 // offset going down: in LectureMode, drop at most
00111                 // one frametime per talkspurt.  In ConferenceMode,
00112                 // drop at most 1/2 of difference.
00113                 if (lecture) {
00114                         if (diff > FRAMESIZE) {
00115                                 if (playout > (maxdel * 3) / 4 &&
00116                                     diff > 10 * FRAMESIZE)
00117                                         diff = 5 * FRAMESIZE;
00118                                 else
00119                                         diff = FRAMESIZE;
00120                         }
00121                 } else
00122                         diff >>= 1;
00123                 offset = playout - diff;
00124         } else if (-diff > maxdel) {
00125                 // offset going way up: only allow 3/4 of max.
00126                 offset = (maxdel * 3) / 4;
00127         }
00128         if (offset > (maxdel * 7) / 8)
00129                 offset = (maxdel * 7) / 8;
00130         else if (offset < mindel)
00131                 offset = mindel;
00132         return (offset);
00133 }


Variable Documentation

VatRcvrClass class_vat_rcvr [static]
 

const char rcsid[] [static]
 

Initial value:

"@(#) $Header: /nfs/jade/vint/CVSROOT/ns-2/apps/vatrcvr.cc,v 1.6 2000/09/01 03:04:08 haoboy Exp $"

Definition at line 47 of file vatrcvr.cc.


Generated on Tue Apr 20 12:30:30 2004 for NS2.26SourcesOriginal by doxygen 1.3.3