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

EvalVid Source Code

EvalVid Source Code – In this section we are going to discuss about the how the frame loss is calculate, during video transmission process also 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 indicate.
  •  If a frame is lost due to packet loss, also the ET component sets the vop_coded. bit of this video object plane (VOP) header in the original compress 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 refer to as a vop-not-coded frame.
  • While a frame is completely receive and the vop_coded bit is set to 1, this type of frame is refer to as a decodable frame.
  • After setting the vop_coded bit to 0 for all the lost frames, the process file is then used to represent the compressed video file receive 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 - 2020 Vanet Projects

© 2005 - 2020 Matlab Projects