This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Error when calling IMGENC1_Control



On DM355 I am trying to compress a 5MPixel image (2592x1944).

I get en error message when calling IMGENC1_control. The portion of the code producing error is included below. Error returned is -1, and extended error is 49161 (0xC009).

I have looked at the bit definitions and bit 14 indicates "Unsupported input parameter or configuration". Bits 0-7 are codec specific and I have not information for those bits.

What could be the reason for the error? 

 

    dynamicparams.size = sizeof(dynamicparams);
    dynamicparams.numAU = XDM_DEFAULT;     // number of Access units to encode.
                        // (if want to feed the data in chunks to save buffer space)
    dynamicparams.inputChromaFormat = XDM_YUV_422ILE;    // format of the input data. see enum XDM_ChromaFormat for all formats
    dynamicparams.inputHeight = height; // this value is set to 1944
    dynamicparams.inputWidth = width; // this variable is set to 2592
    dynamicparams.captureWidth = 0; // set to zero to use image width. don't know what it's for.
    dynamicparams.generateHeader = XDM_ENCODE_AU; // don't knwo what it's for but this is what dvtb used.
    dynamicparams.qValue = Q; // compress JPEG qith quality = 75%
   
    memset(&status, 0, sizeof(status));
    status.size = sizeof(status); // define the size of status structure

    res = IMGENC1_control(ieh, XDM_SETPARAMS, &dynamicparams, &status);
    if (res != IMGENC1_EOK)
    {
        printf("Error (%d), Extended Error (%d) in image Encoder Control:setparams\n", res, status.extendedError);
        IMGENC1_delete(ieh);
        Engine_close(ceh);   
        CERuntime_exit();
        return -1;
    }
    printf("CE params set OK\n");

 

 

 

  • I got it.

    When creating a JPEG Encoder instance using IMGENC1_create, maximum width and height of an image need to be specified. In my code (not shown) I had maximum for width and height of the picture assigned 2048 and 1536, respectively (leftover from previous image sensor). Once I had them assigned to 2592 and 1944 the code started working.

    Thanks for listening.