Posts by Jesse Lin

    Hi Kevin

    You're right that the location you find is distorted.

    I tested your code and found that the maximum difference value of VA comes to 108(jpeg_artifacts_va).

    But the maximum difference value of opencv comes to 18(jpeg_artifacts_opencv).

    The difference in VA is five times that of OPENCV. And the difference between the maximum values is 90.

    And please refer the "Compare.png" of attachment. You can easily find their difference.

    Best Regards,

    Jesse Lin



      (34.49 kB, downloaded 1 times, last: )
    • Compare.png

      (547.64 kB, downloaded 2 times, last: )

    Hi Kevin

    1. When you used C# for encoding, did you use subsampling as well?

    I use the wrapped function for testing. So I can't be sure if the function is using sampling.

    But I have tested whether sampling can cause such distortion.You can refer attachment "mE5MtVCL_YCBCR".

    2. What did you use to decode the JPEG image? Did you write your own script?

    3. Did you decode the JPEG in the simulation or in hardware?

    Because the color JPEG operator will output binary data that have JPEG header.And then use the binary data to write it as a JPEG file.

    And open(decode) it by Windows Photo Viewer or Photoshop.

    Best Regards

    Jesse Lin

    Hi Kevin

    If the operator use 4:2:2 subsampling. It will like this table.

    Y(0,0)Cb(0,0)Cr(0,0) Y(1,0)Cb(0,0)Cr(0,0) Y(2,0)Cb(2,0)Cr(2,0) Y(3,0)Cb(2,0)Cr(2,0)
    Y(0,1)Cb(0,1)Cr(0,1) Y(1,1)Cb(0,1)Cr(0,1) Y(2,1)Cb(2,1)Cr(2,1) Y(3,1)Cb(2,1)Cr(2,1)


    So the column 0 and column 1 color will be close , and column 2 and column 3 color will be close.

    But my issue is row 0 and row 1 color will be close, Please refer attachment "JPEG.png".

    And if you sure the operator use 4:2:2 subsampling.

    The JPEG_Encoder_Color_850MPs_VCL operator help may need to be corrected.

    Jesse Lin

    Hi Kevin

    I use C# to compress image with JPEG encoder.

    Because forum will auto scale image , so I upload the image on google drive.

    This is quality level 100…o5X5FsQT/view?usp=sharing

    This is quality level 50…-r-7ZnRi/view?usp=sharing

    You can see 8x8 matrix of distortion at quality level 50 image. Distortion in the horizontal direction does not exist alone.

    This is my perception of JPEG compression distortion.

    And I watch the video. DCT uses an 8x8 matrix to reserve the required frequencies.

    Can you help me to confirm whether JPEG encoder color operator has filtered out the horizontal frequency?


    Jesse Lin


    Hi Kevin

    Would you tell me how to calculate the size for example of 1186120 with JpegGrayR ?

    I tried to sample the YCBCR image to 420 and then convert back to RGB image. You can refer

    The converted image(YCbCrToRGB.png) looks normal with horizontal edges.

    But after JPEG compression, every two lines in the horizontal direction, you will find that the values of the upper and lower lines are quite close.

    Could it be generated during JPEG compression?


    Jesse Lin


    • JPEG.png

      (2.03 MB, downloaded 8 times, last: )
    • YCbCrToRGB.png

      (2.04 MB, downloaded 3 times, last: )


    I use the JPEG encoder color operator to compress image.

    I found that the image quality after decompression is a bit abnormal in the horizontal direction.

    A is the de-mosaicing color image of "BayerImage" .

    B is compressed from A by JPEG.

    C is composed of JPEG Gray R,JPEG Gray G, and JPEG Gray B.

    You can see the horizontal edge of B that the resolution is reduced. But the vertical edge of B that the resolution hasn't changed much.

    When compressing the three grayscale images into JPEG respectively, then compose the three JPEG grayscale images into a color image. The horizontal edge of C that the resolution hasn't changed much.

    Please refer "Compare.JPG".

    Why is there a difference between the resolution of the horizontal edge and the resolution of the vertical edge after JPEG encoder color operator compression?

    Jesse Lin

    Hi Björn Rudde

    Thank for your support that let me learn something.

    The VA design saves a lot of buffer resources.:thumbup::thumbup::thumbup:

    Hi Oliver

    Thank for your approach.

    We find a better way without InsertImage that can reduce the consideration of synchronization.

    You can refer this design and simulation it.

    Hope it will be helpful to your future application.


    Hi Johannes this design has solved the problem.

    And I don't known why camera will send extra byte.

    So I did some tests for your reference.

    Camera output test pattern.

    Test 1 : use mE5MA_VCX-QP_Dualx1_v1_EditSiSo

    DMA0 : EditSiSo_DMA0.bmp

    The test pattern will output continuous pixels from 0 to 255, but the extra bytes are all 0.

    DMA1 :EditSiSo_DMA1.bmp

    After the second line of DMA1, the value should all be 0, but there has some pixel is not 0(in second line).

    Test 2 : use

    Result :


    it did not shift.

    Thank for your reply.

    Jesse Lin

    Hi Johannes

    I built your design but the result is still the same.

    Please refer this video[Link].

    And I test to remove operator SYNC. VA :

    The image is correct.Please refer this video[Link].

    Camera parameter :

    Line rate : 50k Hz

    Bandwidth : 8192 * 50k = 409.6 MB/s

    parameter file : genicam-parameters.genicam.parameters.txt

    PCIe performance :


    About the operator ImageFlowControl, because I don't have the license so can not test it.

    If you need more information please tell me.

    Thank you.

    Jesse Lin

    Hi Sir

    In this design ( I want to expand a line to original image height.

    But the original image will shift 16 pixel at second line after SYNC.

    DMA0 image : DMA0.bmp

    DMA1 image :DMA1.bmp

    Because after this module will use three RAM of resource. So only one RAM can be used in this part.

    How to sync to max without line shift?

    Thank you.

    Environment :

    Runtime : version 5.7.076313

    Visual Applets : version 3.2.1

    Xilinx : Vivado 2018.2

    Dear Björn Rudde

    I only find two JPEG_Encoder operators in operator library.(VA version : 3.2.1)

    So I thought I could only use these two operators.


    How can I find the operator JPEG_Encoder_Color_850MPs_VCL in Visual Applets ?

    Or just copy the operator by the example?

    Thank you

    Jesse Lin

    Hi Sir

    Would you provide an example about RGB image convert to jpeg without parameters operators?

    Because I just have JPEG license. The example of JPEG in VA3.2 need to use parameters operators.

    Thank you.

    Jesse Lin

    Hi Johannes

    It is the link property Max. Img Width of DMA 3 in VisualApplets.

    I create a class for storage parameter properties and need get the all properties of Width .

    So I used Fg_getParameterPropertyEx to get value,range,access..etc.

    When I get those properties, I will allocate memory by those properties.


    About question 3. Is it the number of byte of the last image transferred on DMA 3?

    When I used blob operator, it will output uncertain length.

    I used SisoImage.getPixelCount to get the number of byte of the last image transferred on DMA in C# wrapper.

    Is it correct?

    When I used getPixelCount ,it always return 0.