Prem, thank you for your help. I have tried to use IMGENC1_DynamicParams instead of *IDMJPGE_TIGEM_DynamicParams and set IMGENC1_Params.forceChromaFormat to XDM_DEFAULT.*
The result is same to yesterday. So I think something else was wrong. Frank On Mon, Oct 5, 2009 at 1:02 PM, JayaKumar, PremKumar <[email protected]>wrote: > Hi Frank, > > > > Since you’ve created a JPEG encoder instance using base params, can you > also give a try by using only the base *IIMGENC1_DynamicParams* instead of > extended *IDMJPGE_TIGEM_DynamicParams* in your code? (I see that you need > only base dynamic params to be set in your code.) > > Also, you can try setting the forceChromaFormat in the IIMGENC1_Params to > XDM_DEFAULT in which case your output will have to follow the > inputChromaFormat type. > > > > Regards, > > Prem > > > ------------------------------ > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of * > [email protected] > *Sent:* Sunday, October 04, 2009 3:22 PM > *To:* [email protected] > *Subject:* "JPEG Baseline Profile Encoder on C64x+ " 2.00.002 Can't work > on 6446 Linux > > > > Hi, all, > > I'am tring to use "JPEG Baseline Profile Encoder on C64x+ " 2.00.002 on > 6446 Linux, but can't work. > > I want to encode YUV444 to JPEG on 6446 Linux with "JPEG Baseline Profile > Encoder on C64x+ " 2.00.002, > so I create a codec and a codec server. > > In my application, I create the codec instance successfully, and so as > control(XDM_SETPARAMS). > then I call control(XDM_GETBUFINFO), I get something, but no correct. > when call process(), it failed. And I can get nothing from the > IMG_ENC1_status.extendedError. > > Here is the code, > > My code : > > > > /* CREATE IMAGE ENCODER */ > IIMGENC1_Params params; > /* Setting the sizes of Base Class Objects */ > params.size = sizeof(IIMGENC1_Params); > // params.maxWidth = 3172; > // params.maxHeight = 2048; > // params.maxWidth = 1600; > // params.maxHeight = 1216; > params.maxWidth = 720; > params.maxHeight = 480; > params.maxScans = 0; > params.dataEndianness = XDM_BYTE; > params.forceChromaFormat = 5; // output YUV444 > > IMGENC1_Handle encHandle = IMGENC1_create(ceHandle, encoderName, > ¶ms); > if (encHandle == NULL) { > printf("CEapp-> ERROR: can't open codec %s\n", > encoderName); > } > > /* SET DYNAMIC PARAMS */ > IDMJPGE_TIGEM_DynamicParams dynamicParams; > IMGENC1_Status status; > > dynamicParams.params.size = > sizeof(dynamicParams.params); > dynamicParams.params.numAU = 0; > dynamicParams.params.generateHeader = XDM_ENCODE_AU; > dynamicParams.params.inputWidth = 720; > dynamicParams.params.inputHeight = 480; > dynamicParams.params.captureWidth = 720; > dynamicParams.params.qValue = 70; > dynamicParams.params.inputChromaFormat = 5; // input YUV444 > > //memset(&status, 0, sizeof(status)); > status.size = sizeof(status); > status.extendedError = 0; > if (IMGENC1_control(encHandle, XDM_SETPARAMS, > &dynamicParams.params, &status) != IMGENC1_EOK) > { > printf("XDM_SETPARAMS ERROR -- %x\n", > (int)status.extendedError); > return -1; > } > > /* GET BUFFER INFORMATION */ > if (IMGENC1_control(encHandle, XDM_GETBUFINFO, > &dynamicParams.params, &status) != IMGENC1_EOK) > { > return -1; > } > > int ii; > printf("bufInfo :\n"); > printf("minNumInBufs : %d\n", (int)status.bufInfo.minNumInBufs); > //for (ii = 0; ii < status.bufInfo.minNumInBufs; ++ii) { > // printf("minInBufSize[%d] : %d\n", ii, > (int)status.bufInfo.minInBufSize[ii]); > //} > for (ii = 0; ii < XDM_MAX_IO_BUFFERS; ++ii) { > printf("minInBufSize[%d] : %d\n", ii, > (int)status.bufInfo.minInBufSize[ii]); > } > printf("minNumOutBufs : %d\n", (int)status.bufInfo.minNumOutBufs); > for (ii = 0; ii < status.bufInfo.minNumOutBufs; ++ii) { > printf("minOutBufSize[%d] : %d\n", ii, > (int)status.bufInfo.minOutBufSize[ii]); > } > > I get the following information : > > bufInfo : > minNumInBufs : 16200 > minInBufSize[0] : 1 > minInBufSize[1] : 345600 > minInBufSize[2] : 345600 > minInBufSize[3] : 345600 > minInBufSize[4] : -3 > minInBufSize[5] : -2097185 > minInBufSize[6] : 2080309247 > minInBufSize[7] : -33816577 > minInBufSize[8] : -1 > minInBufSize[9] : -268501250 > minInBufSize[10] : -1 > minInBufSize[11] : -35651587 > minInBufSize[12] : -1612709889 > minInBufSize[13] : -1 > minInBufSize[14] : -16777217 > minInBufSize[15] : -5 > minNumOutBufs : 3 > minOutBufSize[0] : -524297 > minOutBufSize[1] : 242520 > minOutBufSize[2] : -67109889 > > According to the document, > minNumInBufs should be 3, and minInBufSize[0~2] should be 546000 (=720x480) > minNumOutBufs should be 1, and minOutBufSize[0] should not be negative, > maybe minOutBufSize[1] is the correct output buffer size. > > So I call process() like this : > > > > /* declare codec I/O buffer descriptors for the codec's process() > func. */ > XDM_BufDesc inBufDesc; > XDM_BufDesc outBufDesc; > XDAS_Int8* inBufs [ XDM_MAX_IO_BUFFERS ]; > XDAS_Int32 inBufSizes [ XDM_MAX_IO_BUFFERS ]; > XDAS_Int8* outBufs [ XDM_MAX_IO_BUFFERS ]; > XDAS_Int32 outBufSizes[ XDM_MAX_IO_BUFFERS ]; > > #if 0 > inBufDesc.numBufs = status.bufInfo.minNumInBufs; > inBufDesc.bufs[0] = bmp_buf; > inBufDesc.bufSizes[0] = status.bufInfo.minInBufSize[0]; > > for (ii=0; ii< (status.bufInfo.minNumInBufs - 1);ii++ ) { > inBufDesc.bufs[ii+1] = inBufDesc.bufs[ii] + > status.bufInfo.minInBufSize[ii]; > inBufDesc.bufSizes[ii +1] = > status.bufInfo.minInBufSize[ii +1]; > } > #else > inBufDesc.numBufs = 3; > inBufs[0] = bmp_buf; > inBufs[1] = inBufs[0] + status.bufInfo.minInBufSize[1]; > inBufs[2] = inBufs[1] + status.bufInfo.minInBufSize[2]; > inBufSizes[0] = status.bufInfo.minInBufSize[1]; > inBufSizes[1] = status.bufInfo.minInBufSize[2]; > inBufSizes[2] = status.bufInfo.minInBufSize[3]; > #endif > inBufDesc.bufs = inBufs; > inBufDesc.bufSizes = inBufSizes; > > #if 0 > outBufDesc.numBufs = status.bufInfo.minNumOutBufs ; > outBufDesc.bufs[0] = jpg_buf; > outBufDesc.bufSizes[0] = status.bufInfo.minOutBufSize[0]; > > for (ii=0; ii< (status.bufInfo.minNumOutBufs-1); ii++) { > outBufDesc.bufs[ii+1] = outBufDesc.bufs[ii] + > status.bufInfo.minOutBufSize[ii]; > outBufDesc.bufSizes[ii+1] = > status.bufInfo.minOutBufSize[ii+1]; > } > #else > outBufDesc.numBufs = 1; > outBufs[0] = jpg_buf; > outBufSizes[0] = status.bufInfo.minOutBufSize[1]; > #endif > outBufDesc.bufs = outBufs; > outBufDesc.bufSizes = outBufSizes; > > /* declare in and out argument descriptors for process() */ > IMGENC1_InArgs inArgs; > IMGENC1_OutArgs outArgs; > > /* fill in the input arguments structure; we have nothing for this > case */ > inArgs.size = sizeof(inArgs); > outArgs.size = sizeof(outArgs); > outArgs.extendedError = 0; > outArgs.bytesGenerated = 0; > outArgs.currentAU = 0; > > /* encode the frame, pass addrs of the structures we populated > above */ > if (IMGENC1_process(encHandle, &inBufDesc, &outBufDesc, &inArgs, > &outArgs) != IMGENC1_EOK) { > dbg("IMGENC1_process failed, extendedError = 0x%lx\n", > outArgs.extendedError); > retval = -1; > return retval; > } > > then, I get the information : > > ceapp_encodeBuf : IMGENC1_process failed, extendedError = 0xbffdfbff > > > Anyone can help me ? > > > > frank >
_______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
