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;
    
    }...
  • 相关阅读:
    直接插入排序
    希尔排序
    堆排序
    红黑树
    hashMap原理
    JAVA随笔4
    JAVA随笔3(集合框架,流)
    Linux环境下如何生成core文件
    Centos6 升级glibc-2.17,解决Requires: libc.so.6(GLIBC_2.14)(64bit)错误解决方法
    MediaWiki搭建步骤
  • 原文地址:https://www.cnblogs.com/maxpak/p/4885309.html
Copyright © 2011-2022 走看看