AnsweredAssumed Answered

vpu jpeg decoder successfully, but can't get output YUV data

Question asked by Moon Yao on Jan 24, 2013
Latest reply on Mar 14, 2013 by Prabhuram Murugan

I use vpu to decode jpeg,  some code as below, after vpu_DecGetOutputInfo call successfully, I always can't get any decoded YUV data from frame buffer indicated by outInfo.indexFrameDisplay. platform is i.mx53 and linux. data of frame buffer are always 0s. indexFrameDisplay and indexFrameDecoded always 0.

 

// get output after decode code snippet
retVal = vpu_DecGetOutputInfo(pObj->handle, &outInfo);
if(retVal != RETCODE_SUCCESS)
 {
  printf("vpu_DecGetOutputInfo failed: %d\n", retVal);
  exit(1);
 }

if(outInfo.indexFrameDisplay != -1 && outInfo.indexFrameDisplay != -2 && outInfo.indexFrameDisplay != -3  && outInfo.prescanResult > 0 && outInfo.indexFrameDisplay >= 0)
  {
  picture = (AVFrame *)data;
  startFrameAddr = pObj->frame_buffer_desc[outInfo.indexFrameDisplay].virt_uaddr;
  picture->data[0] = (char *)startFrameAddr;
  picture->data[1] = (char *)(startFrameAddr + pObj->width * pObj->height);
  picture->data[2] =(char *)(picture->data[1] + pObj->width/2 * pObj->height/2);

  picture->linesize[0] = pObj->width;
  picture->linesize[1] = pObj->width / 2;
  picture->linesize[2] = pObj->width / 2;
  picture->height = pObj->height;
  picture->width = pObj->width; 


 } 
  


// open decoder code snippets
  memset(&openParam, 0, sizeof(DecOpenParam));
  openParam.bitstreamBuffer = pObj->bitstream_mem_desc.phy_addr;
  openParam.bitstreamBufferSize = pObj->bitstream_mem_desc.size;
  openParam.bitstreamFormat = STD_MJPG;
  openParam.filePlayEnable = 0;
  openParam.dynamicAllocEnable = 0;


  if(vpu_DecOpen(&pObj->handle, &openParam) != RETCODE_SUCCESS)
  {
  printf("decoder open failure \n");
  exit(1);
  }






 

Outcomes