zoukankan      html  css  js  c++  java
  • YUV422/YUV420播放

     

    YUV播放器,directX,VS2008 MFC完成  CSDN下载 http://download.csdn.net/detail/xjt1988xjt/2386621#comment

    默认是播放yuv420,  Buffer size 为 width*height*1.5, 数据处理为

    FORMAT = MAKEFOURCC('Y','V','1','2');
    ... LPBYTE PtrY
    = buffer; LPBYTE PtrU = buffer + width*height; LPBYTE PtrV = buffer + (int)width*height*1.25; for (int i=0; i<height; i++) {   memcpy(lpSurf, PtrY, width);   PtrY += width;   lpSurf += ddsd.1Pitch; } for (int i=0; i<height/2; i++) {   memcpy(lpSurf, PtrV, width/2);   PtrV += width/2;   lpSurf += ddsd.1Pitch/2; } for (int i=0; i<height/2; i++) {   memcpy(lpSurf, PtrU, width/2);   PtrU += width/2;   lpSurf += ddsd.1Pitch/2; }
    ...

    422 处理时, buffer size 为  width*height*2

    FORMAT = MAKEFOURCC('U','Y','V','Y');...
    
    LPBYTE PtrY = buffer;
    
    LPBYTE PtrV = buffer + width*height;
    
    LPBYTE PtrY = buffer + (int)width*height*1.5;
    
    for (int i=0; i<height; i++)
    
    {
    
      memcpy(lpSurf, PtrY, width);
    
      PtrY += width;
    
      lpSurf += width;
    
    }
    
    for (int i=0; i<height/2; i++)
    
    {
    
      memcpy(lpSurf, PtrV, width);
    
      PtrV += width;
    
      lpSurf += width;
    
    }
    
    for (int i=0; i<height/2; i++)
    
    {
    
      memcpy(lpSurf, PtrU, width);
    
      PtrU += width;
    
      lpSurf += width;
    
    }...
  • 相关阅读:
    Object.keys
    数组内容深拷贝的应用
    CSS如何让页脚固定在页面底部
    vue eslint开发 关掉 tab错误提示
    input框,需要隐式显示的时候,不让它自动填充的办法
    关于BFC
    File协议与HTTP协议 以及区别
    关于缓存
    深拷贝浅拷贝 遇到了bug
    聚餐学习
  • 原文地址:https://www.cnblogs.com/maxpak/p/4885309.html
Copyright © 2011-2022 走看看