Hello,
I modified the DMAI image_encode_io sample to change some settings of the jpeg encoder.
My changes:
#include <ti/sdo/codecs/jpegenc/ijpegenc.h>
....
....
Void appMain(Args * args)
{
int ret = 0, i = 0;
IJPEGENC_DynamicParams dynJpgParams;
IJPEGENCQtab qTab; /* quantization tab */
IMGENC1_Handle hImgEnc = NULL;
IMGENC1_Status imgStatus;
....
....
for(i = 0; i < 64; i++){
qTab.luma[i] = 0x55;
qTab.chroma[i] = 0xaa;
}
hImgEnc = Ienc1_getVisaHandle(hIe);
dynParams.size = sizeof(IJPEGENC_DynamicParams);
dynJpgParams.imgencDynamicParams = dynParams;
dynJpgParams.rstInterval = 84; // default 84
dynJpgParams.disableEOI = 0; // default 0
dynJpgParams.rotation = 270; // can be 0 (default), 90, 180, 270
// dynJpgParams.customQ = &qTab; // default NULL
dynJpgParams.customQ = NULL; // default NULL
imgStatus.size = sizeof(imgStatus);
ret = IMGENC1_control(hImgEnc, IJPEGENC_SETPARAMS, (IIMGENC1_DynamicParams *)&dynJpgParams, &imgStatus);
....
....
Rotating the image works fine, but I can't set my own quantization tab (no error message).
Instead the first 20 values in my quantization tab (qTab) are changed by IMGENC1_control() to
0x...00 00 00 00 00 00 00 00 b4 d2 0d 41 00 00 00 00 00 00 00 00- even if I set customQ to NULL.
If I look at the pointers, I see the following paritioning:
imgStatus|qTab|dynJpgParams
Is there something wrong in my code?
Is there a bug in the jpeg encoder?
Is anybody able to set a user defined quantization tab?
S. Stiller