登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

面包会有的

... ...

 
 
 

日志

 
 

读取264文件时,寻找分隔0x03  

2011-10-07 20:13:23|  分类: H264 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

在做RTP发送实时流前,要做一个测试,用一个从摄像头实时流编码得到的264文件来做模拟,面临读入文件的问题,要把文件中的0x03识别出来,

1晨不变(595024447) 19:54:55
在函数EBSPtoRBSP里

QQ群友提供了一个信息,所以

 

jm86

//ldecod/inc/defines.h

//Start code and Emulation Prevention need this to be defined in identical manner at encoder and decoder
#define ZEROBYTES_SHORTSTARTCODE 2 //indicates the number of zero bytes in the short start-code prefix

//ldecod\src\nal.c
int EBSPtoRBSP(byte *streamBuffer, int end_bytepos, int begin_bytepos)
{
  int i, j, count;
  count = 0;
 
  if(end_bytepos < begin_bytepos)
    return end_bytepos;
 
  j = begin_bytepos;
 
  for(i = begin_bytepos; i < end_bytepos; i++)
  { //starting from begin_bytepos to avoid header information
    if(count == ZEROBYTES_SHORTSTARTCODE && streamBuffer[i] == 0x03)
    {
      i++;
      count = 0;
    }
    streamBuffer[j] = streamBuffer[i];
    if(streamBuffer[i] == 0x00)
      count++;
    else
      count = 0;
    j++;
  }
 
  return j;
}

  评论这张
 
阅读(1015)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018