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;
    
    }...
  • 相关阅读:
    linux升级node版本
    mysql视图
    mysql全文本搜索
    mysql数据处理函数
    mysql数据分组
    mysql组合查询
    Django添加生产环境配置
    费用保险单,如何失焦时自动补零
    div+css滚动条
    phpadmin导入数据提示文件最大限制的修改方法
  • 原文地址:https://www.cnblogs.com/maxpak/p/4885309.html
Copyright © 2011-2022 走看看