I want to use custom quantification table for the jpegenc codec.
I'm using DVSDK 3.10 with gstreamer_ti :
gst-launch -v ticapturesrc num-buffers=1 video-standard=1080i ! TIVidResize ! 'video/x-raw-yuv, width=720, height=288' !
TIC6xColorspace engineName=codecServer ! queue ! TIImgenc1 engineName=codec
Server codecName=jpegenc iColorSpace=YUV420P oColorSpace=YUV420P ! filesink ....
When i use my custom quantification table, i have always the same wrong header in my jpeg file generated:
FF DB 00 84
00 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
01 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
FF DA
and the image it's near 64kB and with another jpeg codec with the table below i'm near 11kB.
My code :
IDMJPGE_TIGEM_Params JPEG_Params = {
{
sizeof(IDMJPGE_TIGEM_Params), /* Size of params structure */
288,
720,
0,
XDM_BYTE,
XDM_YUV_420P,
},
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
};
IDMJPGE_TIGEM_CustomQuantTables DQT_table = {
{ /*Luma*/
14,9,8,14,21,35,45,54,
10,10,12,16,23,51,53,49,
12,11,14,21,35,50,61,50,
12,15,19,25,45,77,71,55,
16,19,33,50,60,97,92,68,
21,31,49,57,72,93,101,82,
43,57,69,77,92,108,107,90,
64,82,84,87,100,89,92,88
},
{ /*chroma*/
15,16,21,42,88,88,88,88,
16,18,23,59,88,88,88,88,
21,23,50,88,88,88,88,88,
42,59,88,88,88,88,88,88,
88,88,88,88,88,88,88,88,
88,88,88,88,88,88,88,88,
88,88,88,88,88,88,88,88,
88,88,88,88,88,88,88,88
}
};
IDMJPGE_TIGEM_DynamicParams JPEG_DynParams = {
{
sizeof(IDMJPGE_TIGEM_DynamicParams),
XDM_DEFAULT,
XDM_YUV_420P,
288,
720,
720,
XDM_ENCODE_AU,
35,
},
288,
0,
&DQT_table,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
XDM_DEFAULT,
};
imgenc1->hIe = Ienc1_create(imgenc1->hEngine, (Char*)imgenc1->codecName,
(IMGENC1_Params*)&JPEG_Params, (IMGENC1_DynamicParams*)&JPEG_DynParams);
Does someone already try to use custom quant table with succes ?
NOTE : There is a difference between the user guide PDF and the idmjpge.h in the struct definition (see DRI / customQuantTable).
Any help will be appreciate !