VPU MJPEG quant tables

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VPU MJPEG quant tables

966 Views
kristofferglemb
Contributor III

Hi,

I have a question regarding the order of the jpeg quantization tables passed to the VPU.

I noticed that when using fslvpuwrap or imxvpuapi that the DQT marker of the JPEG has incorrect ordering. It is in "natural order" but it should be in zig zag order according to the specification.

Looking at the VPU API RM it only states this, in table 4 (Q Matrix Format):

0x000 Y_QMat3 ... Y QMat0

0x03C Y_QMat63 ... Y_QMat60

[...]

And I suppose that the Q Matrix here is ordered according to the JPEG specification. In this case both the VPU API (imx-vpu), fslvpuwrap and imxvpulib needs patching. The imx-vpu lib writes the DQT marker exactly as input to the library but needs to reorder the coefficents as above when passing it to the VPU, and the wrapper libraries should input the tables in zig zag scan order.

Do you agree?

Best regards,

Kristoffer

Labels (1)
Tags (2)
0 Kudos
2 Replies

541 Views
joanxie
NXP TechSupport
NXP TechSupport

refer to the VPU API, q matrix is a user-defined matrix, if you use q matrix, one can set the pointer to this matrix, then vpu supports encoding by this q matrix.

0 Kudos

541 Views
kristofferglemb
Contributor III

Sorry, but that was not an answer to my question.

I will try to rephrase it:

The "q matrix" is specified to be in a certain order (zig zag) in the JPEG header (DQT marker). The imx-vpu library from NXP takes this parameter from the user and puts it in the header as is. The libraries fslvpuwrap and imxvpuapi does not provide the correct matrix order to imx-vpu so the matrix is incorrect in the JPEG header.

But to fix this one needs to understand in which order the VPU expects the coeffiecients. My take is that both the wrapper libraries and imx-vpu are wrong.

0 Kudos