zoukankan      html  css  js  c++  java
  • YUYV&YV12&mtk6763

    stImgInOut.stImgInfo.enImageType = UV_IMAGE_TYPE_YV12;
    stImgInOut.stImgInfo.as32Pitch[0] = pStreamImgBuf->getImgWidthStride(0);
    stImgInOut.stImgInfo.as32Pitch[1] = pStreamImgBuf->getImgWidthStride(1);
    stImgInOut.stImgInfo.as32Pitch[2] = pStreamImgBuf->getImgWidthStride(2);
    stImgInOut.stImgInfo.pau8Plane[0] = (uvUInt8*)pStreamImgBuf->getVirAddr();
    stImgInOut.stImgInfo.pau8Plane[1] = stImgInOut.stImgInfo.pau8Plane[0] + stImgInOut.stImgInfo.as32Pitch[0] * stImgInOut.stImgInfo.s32Height;
    stImgInOut.stImgInfo.pau8Plane[2] = stImgInOut.stImgInfo.pau8Plane[1] + ((stImgInOut.stImgInfo.as32Pitch[1] * stImgInOut.stImgInfo.s32Height)>>1);

    stImgInOut.stImgInfo.enImageType = UV_IMAGE_TYPE_YUYV;
    stImgInOut.stImgInfo.as32Pitch[0] = pStreamImgBuf->getImgWidthStride(0) << 1;
    stImgInOut.stImgInfo.pau8Plane[0] = (uvUInt8*)pStreamImgBuf->getVirAddr();

    DUMP:

    char file_name[128] = {''};
    memset(file_name,'',sizeof(file_name));
    sprintf(file_name,"sdcard/uvfbpre/fbpre_befor_%dx%d.yuv",pStreamImgBuf->getImgWidth(),pStreamImgBuf->getImgHeight());

    FILE *fp = fopen(file_name, "wb");
    if (NULL != fp)
    {


    if(stImgInOut.stImgInfo.enImageType == UV_IMAGE_TYPE_YUYV)
    {
    fwrite(stImgInOut.stImgInfo.pau8Plane[0], 1,pStreamImgBuf->getBufSize(), fp);
    }
    else if(stImgInOut.stImgInfo.enImageType == UV_IMAGE_TYPE_YV12)
    {
    // fwrite(stImgInOut.stImgInfo.pau8Plane[0], 1,pStreamImgBuf->getImgWidthStride(0)*pStreamImgBuf->getImgHeight(), fp);
    // fwrite(stImgInOut.stImgInfo.pau8Plane[1], 1,(pStreamImgBuf->getImgWidthStride(1)*pStreamImgBuf->getImgHeight())>>1, fp);
    // fwrite(stImgInOut.stImgInfo.pau8Plane[2], 1,(pStreamImgBuf->getImgWidthStride(2)*pStreamImgBuf->getImgHeight())>>1, fp);

    //上面这种方式针对YV12三个平面不连续的dump方式
    fwrite(stImgInOut.stImgInfo.pau8Plane[0], 1,pStreamImgBuf->getBufSize(), fp);


    }

  • 相关阅读:
    每日学习
    每日学习——iframe标签伪造ajax
    每日总结
    LA 3667 Ruler
    hdu 2066 一个人的旅行 (dij+heap)
    LA 3507 Keep the Customer Satisfied (Greedy)
    hdu 2527 Safe Or Unsafe
    LA 4636 Cubist Artwork
    hdu 4514 湫湫系列故事——设计风景线(树DP)
    LA 4328 Priest John's Busiest Day (Greedy)
  • 原文地址:https://www.cnblogs.com/reality-soul/p/9303367.html
Copyright © 2011-2022 走看看