+91 94 448 29 228 --- E-Mail ID:networksimulators2@gmail.com

EvalVid Source Code

In this section we are going to discuss about the how the frame loss is calculated during video transmission process in simulation tool Evalvid with their source code.

  • Based on the video trace file, the sender trace file, and the receiver trace file, the lost frames can be indicated.
  •  If a frame is lost due to packet loss, the ET component sets the vop_coded bit of this video object plane (VOP) header in the original compressed video file to 0.
  • The setting of this bit to 0 indicates that no subsequent data exists for this VOP. This type of frame is referred to as a vop-not-coded frame.
  • While a frame is completely received and the vop_coded bit is set to 1, this type of frame is referred to as a decodable frame.
  • After setting the vop_coded bit to 0 for all the lost frames, the processed file is then used to represent the compressed video file received by the receiver side.

Sample Evalvid Source Code.

void resetbits(unsigned pos)
{
  pos_ = pos;
  bit_ = CHAR_BIT;}
unsigned nextbits(unsigned char *s, unsigned n)
{
  unsigned i = 0, v = 0;
  while (i < n) {
    if (!bit_) pos_++, bit_ = CHAR_BIT;
    if (bit_ == CHAR_BIT && (n - i) / CHAR_BIT) {
      while ((n - i) / CHAR_BIT) {
        v = v << CHAR_BIT | s[pos_++];
        i += CHAR_BIT;
      }
      continue;    }
    v = v << 1 | GETBIT(s[pos_], --bit_);
    i++;
  }
  return v;}
unsigned skipbits(unsigned char *s, unsigned b)
{
  unsigned count = 0;
  if (b > 1) return 0;
  for (;;) {
    if (!bit_) pos_++, bit_ = CHAR_BIT;
    if (b == GETBIT(s[pos_], --bit_)) count++; else break;
  }
  return count;}
int mark_not_coded(unsigned char *p, unsigned n, unsigned nti)
{
  unsigned sc;
  resetbits(0);
  if (sc != SC_VOP) goto X;
VOP:
  nextbits(p, 2);               
  skipbits(p, 1);               
  if (!nextbits(p, 1)) goto X;  
  nextbits(p, nti);           
  if (!nextbits(p, 1)) goto X;  
  CLRBIT(p[pos_], bit_ - 1);
  if (nextbits(p, 1)) goto X;   
NO_VOP:
 return currentpos();
X: return 0;}

 


NS2 Member Accounts | |
© 2005 - 2018 Vanet Projects

© 2005 - 2018 Matlab Projects