ADV212 compress performance with 9x7 wavelet transform

Hi,

When I used ADV212 for compression, I found that the image quality after 9/7 wavelet compression is very poor, so I want to consult: Does ADV212 have this characteristic (the compression effect is much worse than Kakadu software)? Or am I using the parameter configuration incorrectly? With ADV212, how can I further improve the compressed image quality when using 9/7 wavelet transform?


The specific description is as follows:
For a 1024 * 1024 * 12bits image, use Kakadu software and ADV212 to evaluate the compression effect.
Using 9/7 wavelet transform, the test results using Kakadu software are as follows

 

Wavelet

Qstep

Rate(bpp)

Raw image size(KB)

Compressed image size(KB)

Compress ratio

Peak Signal  to Noise Ratio

PSNR(dB)

9/7

0.0002

12

1536

990

1.55

85

9/7

0.0002

6

1536

998

1.54

73

9/7

0.0002

3

1536

676

2.27

56

9/7

0.0002

2

1536

479

3.21

48

9/7

0.0002

1.6

1536

378

4.06

45.9

9/7

0.0002

1

1536

242

6.35

41

 

The test found that when the compression parameter is set to 1.6bpp, the actual compression ratio is about 4, at this time PSNR = 45.9dB, and the compressed image quality meets the requirements.

 

Using 9/7 wavelet transform, test results using ADV212 are as follows:

Wavelet

Qfact

target size

Rcval(Byte)

Raw image size(KB)

Compressed image size(KB)

Compress ratio

Peak Signal  to Noise Ratio

PSNR(dB)

9/7

256/256

40000(hex)

1536

214

7.18

45.56

9/7

256/256

10000(hex)

1536

214

7.18

45.56

 

The test found that the compression ratio does not change with the setting of the Rcval parameter. I understand that as described in the ADV212 JPEG2000 Programming Guide, the ADV212 cannot accurately control the offline of the target size after compression, provided that the image quality is guaranteed. But in reality, the image quality is severely lost.

ADV212 JPEG2000 Programming Guide

 

raw_image

compress_9x7 wavelet with Kakadu software

 

compress_9x7 wavelet with ADV212

 

Test metadata is attached.

 image.zip

With ADV212, how can I further improve the compressed image quality when using 9/7 wavelet transform?

Parents
  • 0
    •  Analog Employees 
    on Dec 3, 2019 1:53 PM over 1 year ago

    Hi,

    The data sheet has the maximum tile sizes.

    For 9/7 wavelet it's 1.048 million samples per tile.

    For example when 1024x768 is: 1024x768x2 = 1572864 samples which is already higher than that spec. Please refer here for expert suggestion -https://ez.analog.com/video/f/q-a/10551/adv212-maximum-encoding-resolution/29827#29827

    Thanks,

    Poornima

  • Hi Poornima,

       Thank you for your reply.

        Actually, I have devided the full image into 4 tiles,each tile size is 1024*256*12 bits, which is lower than 1.048 million samples per tile. On the other hand, as i understand, sample number means pixel number for gray image. It seems that you define it as bytes?

        The raw image before compression and the compressed j2c file has attached above, would you please analysis them further? I am still confusing why the compressed image quality with ADV212 when using 9/7 wavelet transform is so poor.

    Watting for your reply.

    Thanks,

    Hanger

  • Hi Poornima,

    I am checking this compression performance with our own circuit board for ADV212, which is working on HIPI encode mode.

    Waitting for your reply.

    Thanks,

    Hanger

  • 0
    •  Analog Employees 
    on Dec 5, 2019 11:55 AM over 1 year ago in reply to Hanger

    Hi,

     Is it possible you to check the same with our eval board ? Then only we can able to confirm whether any connection problem on your custom board.

     Did you refer this thread? https://ez.analog.com/video/f/q-a/10325/adv212-code-buffer/30654#30654

    Thanks,

    Poornima

  • Hi Poornima,

    I don't have an evaluation board in my hand.But I can confirm that it is not a connection problem with the custom board, because the compression quality of the 5/3 wavelet transform is comparable to that of Kakadu software.

    Therefore, I am curious, is there any special parameter configuration when using 9/7 wavelet transform to obtain good compression performance?

    Waitting for your reply.

    Thanks,

    Hanger

  • 0
    •  Analog Employees 
    on Dec 6, 2019 1:03 PM over 1 year ago in reply to Hanger

    Hi,

     Generally 9/7 has better quality for lower bitrate but it can't be used for lossless which is what the 5/3 is normally used.
     For the 9/7 wavelet, the limit is 1.048M Samples which is 1024x1024 with a single component. RCTYPE should be target rate and RCVAL should be 1/2 the size in bytes of your input frame size for 2:1.The datasheet has the tile size limits on the front page.Please refer here https://ez.analog.com/video/f/q-a/10325/adv212-code-buffer/30651#30651.

    For further detailed information refer to the AN790_HowToUse_ADV202.pdf present under ADV202_ADV212 Application Notes at ftp://ftp.analog.com/pub/Digital_Imaging/ADV202_212_ApplicationNotes/ADV202_Getting_Started/

    Please make sure with below things,
         5/3 + RCTYPE = No Truncation is 100% mathematically lossless.  The entropy coding process is inherently lossless-- we just truncate it to do rate control.Wavelet kernel and rate control are two completely separate things. 5/3 isn't "lossless JPEG2000" by itself. It's an integer kernel and the 9/7 is floating point.  9/7 with no truncation will be very close to mathematically lossless but because it's not integer, it won't be 100%. Refer here ez.analog.com/.../adv212---using-5-3-wavelet-kernel-and-rcval ).
        Ensure that the WKERNEL = 0 in the 0x5 Big-ending Byte offset.Please refer Page-44 in programming Guide.

    Thanks,

    Poornima

  • Hi Poornima,

    As you described, "9/7 with no truncation will be very close to mathematically lossless but because it's not integer, it won't be 100%. " However, when I test, the PSNR is only 45.56dB at the highest, and the compression performance is far lower than the 5/3 wavelet transform?(detailed in table1)
    My configuration parameters are as follows:
    WKERNEL =  0  (irreversible 9 x 7 using fixed table(lossy))
    CBSIZE       = 3    (128*32)
    RCTYPE = 0 (no truncation)
    RCVAL = 40000(hex)
    QFact = 0 (256/256 factor (1x))
    XFORMLEV = 5 (5 levels of transform)
    tile size = 1024*256
    image depth = 12bit/pixel
    Finally, the PSNR is only 45.56dB
    Do I have problems with these configuration parameters? With 9/7 wavelet transform, what other parameters can I configure to improve compression performance?

    Using 5/3 wavelet transform, test results using ADV212 are as follows:

                                                                                table1

    Wavelet

    Qfact

    target size

    Rcval(Byte)

    Raw image size(KB)

    Compressed image size(KB)

    Compress ratio

    Peak Signal  to Noise Ratio

    PSNR(dB)

    5/3

    256/256

    60000(hex)

    1536

    966

    1.59

    loseless

    5/3

    256/256

    40000(hex)

    1536

    966

    1.59

    loseless

    5/3

    256/256

    30000(hex)

    1536

    769

    1.99

    69.13

    5/3

    256/256

    20000(hex)

    1536

    513

    2.99

    59.19

    5/3

    256/256

    15555(hex)

    1536

    342

    4.49

    51.98

    5/3

    256/256

    10000(hex)

    1536

    257

    5.95

    49.4

    5/3

    256/256

    08000(hex)

    1536

    129

    11.9

    43.76

     

    Waitting for your reply.

    Thanks,

    Hanger

Reply
  • Hi Poornima,

    As you described, "9/7 with no truncation will be very close to mathematically lossless but because it's not integer, it won't be 100%. " However, when I test, the PSNR is only 45.56dB at the highest, and the compression performance is far lower than the 5/3 wavelet transform?(detailed in table1)
    My configuration parameters are as follows:
    WKERNEL =  0  (irreversible 9 x 7 using fixed table(lossy))
    CBSIZE       = 3    (128*32)
    RCTYPE = 0 (no truncation)
    RCVAL = 40000(hex)
    QFact = 0 (256/256 factor (1x))
    XFORMLEV = 5 (5 levels of transform)
    tile size = 1024*256
    image depth = 12bit/pixel
    Finally, the PSNR is only 45.56dB
    Do I have problems with these configuration parameters? With 9/7 wavelet transform, what other parameters can I configure to improve compression performance?

    Using 5/3 wavelet transform, test results using ADV212 are as follows:

                                                                                table1

    Wavelet

    Qfact

    target size

    Rcval(Byte)

    Raw image size(KB)

    Compressed image size(KB)

    Compress ratio

    Peak Signal  to Noise Ratio

    PSNR(dB)

    5/3

    256/256

    60000(hex)

    1536

    966

    1.59

    loseless

    5/3

    256/256

    40000(hex)

    1536

    966

    1.59

    loseless

    5/3

    256/256

    30000(hex)

    1536

    769

    1.99

    69.13

    5/3

    256/256

    20000(hex)

    1536

    513

    2.99

    59.19

    5/3

    256/256

    15555(hex)

    1536

    342

    4.49

    51.98

    5/3

    256/256

    10000(hex)

    1536

    257

    5.95

    49.4

    5/3

    256/256

    08000(hex)

    1536

    129

    11.9

    43.76

     

    Waitting for your reply.

    Thanks,

    Hanger

Children