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);


    }

  • 相关阅读:
    HDU1548:A strange lift
    hdu1978_How many ways dfs+记忆化搜索
    HDU1518:Square(DFS)
    HDU ACM 1495 非常可乐(广搜BFS)
    HDU1372:Knight Moves(BFS)
    662_二叉树最大宽度
    590_N叉树的后序遍历
    一直在坚持
    动态链接库DLL的操作顺序
    最近木马的查杀方法/各类杀毒软件的使用
  • 原文地址:https://www.cnblogs.com/reality-soul/p/9303367.html
Copyright © 2011-2022 走看看