Post Go back to editing

Encode a large pixels in ADV202/ADV212

Hi,

I am finding method to encode a large pixel (width 2000x height 3000) in ADV202/212.

I received a suggestion pixel shall be divided by 6 tiles (1tile= 2000 x 500) in the previous thred.

But i can not understand how to input 6 tile and can ADV202 encode automatically.

Let tell me register setting.

Kubo

  • Hi Kubo,

    The part will not do this automatically.  You have to do the tiling before and add timing / blanking and then program the ADV212 for your tile size and timing.  As far as the ADV212 knows, each tile is an independent image.

    There is an app note on "custom specific mode" on the Design Support Files page which describes how to set the registers for an arbitrary tile size like you are trying to do.

    Dave

  • Hi Dave,

    I think that tile is not equal to pixel as tile is process unit to encode.

    Programable tile/image size with widths up to 4096 in single component mode

    in Analog devices the ADV202 Preliminary Technical Data, March 19,  2004.

    And Maximum tile/image height is up to 4096pixels in this document.

    Therefore, i belive that it can encode 2000 x 3000 pixels (CMOS sensor output).

    Can it enode as one J2K file, when i will input 6 tiles (1 tile = 2000x500 pixels) ?

    Otherwise, i must arrage 6 files, after one J2K file is generated by 1 tile and totally repeat 6 times.

    Please give me a good idea.

    --

    Kubo

    Stop Earthquake in JP

  • Hi Kubo,

    A tile is made up of X * Y pixels.  A pixel is made up of 1 or more samples.

    There are more limitations than just width.  On the front page of the data sheet, you'll see there is a tile size limitation of 1.048 million samples for the 9/7 wavelet and 1/4 that for the 5/3 wavelet.  For monochrome data, that would be 1 sample per pixel so that would be 1.048 million pixels per tile.

    2000x3000 is FAR over the tile size spec.

    If you tile it, the part will put out one J2C/JP2 file per 2000x500 tile.  Unfortunately, combining those files into one J2K file isn't easy though you will find a few other threads on this board that discuss how to do it.

    You would basically end up with 6 J2C/JP2 files for one 2000x3000 image.  How do you plan to decode them?  If they don't need to all be in one file, that makes this much easier.

    Dave

  • Hi Dave,

    Thanks for your explanation.

    I understood for a tile.

    I have a plan to use free JPEG2000 viewer (Irfan etc), if i can encode a large pixel (2000x3000).

    Best Regards,

    Kubo

  • Hi Kubo,

    One thing to note:  A lot fo the JPEG2000 software viewers have issues with YCbCr color space.  I normally use Kakadu.

    If you are viewing with a software decoder then I would keep the codestreams for the pieces separate and you can merge them on the PC side for decode.  That's exactly what I do with the TileSimulator program on the Design Support Files page.

    Dave

  • Hi Dave,

    We also need to encode an image with total samples (1440x900=1.3M or 2.6M for YCbCr 4:2:2) larger than both the 1.048 Msamples/image limit in Custom Specific mode and the max tile sizes suppported.  Our output will be saved to a file(s) and ultimately viewed using a software decoder.

    Can you please elaborate on your last response.  When you suggest keeping the codestreams separate, does that mean using raw mode with separate ADV212 chips (or making three passes with one chip if the data rate permits) for each component?  Will each separate component input still need to be separated into tiles?  How many different codestreams per image will be created and merged on the PC side for decode?  Can you provide more details on how they are merged on the PC side for decode?  Finally, is there an advantage to working in either RGB or YCbCr input format for this example?  My input is in RGB but I can change to YCbCr or YCbYCr 4:2:2 if it helps.

    Thanks,

    Keith,

  • Hello Keith,

    The tile size spec is conservative.  You can exceed it but you limit the compression parameters that are workable and you risk issues with pathologic content with white noise.  For some customers, that isn't a problem.... just to put that out there.

    No.. I mean that each component or tile is a separate JP2/J2C.  I imply nothing about the modes of the ADV212.  You would get a codestream for each tile where each tile could be either a single component or a piece of the image or any combination thereof to stay within the samples/tile limit.

    In the tile simulator program, I break the image up into tiles as you specify in the program and each tile has a separate codestream.  I decode each tile separately and composite the tiles back together *AFTER* software compression.  There are settings there for overlap as well since windows allows you to blend bitmaps. I think I used a CBitmap object's direct memory access and just wrote the output from Kakadu directly into it.  It's been a while though!

    Computers tend to be RGB-- if you are doing single component then you can leave it RGB.

    Dave

  • Hi,
    I could encode, when  Y line of large pixel is power of 2.
    For example, i think that pixel size is 3000 (X size) and 22 tile of 128 (Y size).
    I send the 1st tile (3000 x 128 line) to ADV212 and encode it .
    I repeatd to encode 22 tiles and changed the part of JP2 before next tile is processed.
    The procedure of the change is the below.









































































































































































































































































































































































































































































































































































































































































































    Pink color means a
      place of the modification
    Red color means a place of the delete
    The zero will be included after the end
      code  (FF D9) of JPEG2000
    byte Modification
    Packet header 32
    the first JPEG2000 file
    FF FF FF F1 00 00 00 00 01 04
      00 02 00 00 00 CE
    ADV202 header 16
    FF 4F SOC 2
    FF 51 SIZ 2
    00 29 00 00 00 00 08 00
    00 00 00 80 YSIZ 4 00 00 0B 00 Y size of picture=128line x 22file
    00 00 00 00 00 00 00 00 00 00
      08 00 00 00 00 80 00 00 00 00 00 00 00 00 00 01 07 01 01
    29
    FF 52 COD 2
    00 0C 00 00 00 01 00 05 05 03
      00 01
    12
    FF 5C QCD 2
    00 13 20 40 48 48 50 48 48 50
      48 48 50 48 48 50 48 48 50
    19
    FF 90 SOT 2
    00 0A 2
    00 00 2 index of tile1(index is started at
      0)
    00 00 00 00 size of tile1 4 the sum of byte between code "FF 90" and before code
      "FF D9"
    data size of tile1
    00 1 index of tile1(index is started at
      0)
    01 1 16 the number (22 file) of tile that is
      combined
    FF 93 2
    FF 05 50 36 9D 14 5A 1D E0 BC
    FF D9 2 Delete
    Second JPEG2000 file
    FF FF FF F1 00 00 00 00 01 04
      00 02 00 00 00 CE
    ADV202 header 16 Delete the pink part in between tile 2 and
      tile 21shalll be changed
    FF 4F SOC 2 Delete
    FF 51 SIZ 2 Delete
    00 29 00 00 00 00 08 00 Delete
    00 00 00 80 YSIZ 4 Delete
    00 00 00 00 00 00 00 00 00 00
      08 00 00 00 00 80 00 00 00 00 00 00 00 00 00 01 07 01 01
    29 Delete
    FF 52 COD 2 Delete
    00 0C 00 00 00 01 00 05 05 03
      00 01
    12 Delete
    FF 5C QCD 2 Delete
    00 13 20 40 48 48 50 48 48 50
      48 48 50 48 48 50 48 48 50
    19 Delete
    FF 90 SOT 2
    00 0A 2
    00 00 2 00 01 index of tile2 (index is started at
      0)
    00 00 00 00 size of tile2 4 the sum of byte between code "FF 90" and before code
      "FF D9"
    data size of tile1
    00 1 01 index of tile2 (index is started at
      0)
    01 1 16 the number (22 file) of tile that is
      combined
    FF 93 SOD 2
    FF 05 50 36 9D 14 5A 1D E0 BC
    FF D9 2 Delete
    22th JPEG2000 file
    FF FF FF F1 00 00 00 00 01 04
      00 02 00 00 00 CE
    ADV202 header 16 Delete
    FF 4F SOC 2 Delete
    FF 51 SIZ 2 Delete
    00 29 00 00 00 00 08 00 Delete
    00 00 00 80 YSIZ 4 Delete
    00 00 00 00 00 00 00 00 00 00
      08 00 00 00 00 80 00 00 00 00 00 00 00 00 00 01 07 01 01
    29 Delete
    FF 52 COD 2 Delete
    00 0C 00 00 00 01 00 05 05 03
      00 01
    12 Delete
    FF 5C QCD 2 Delete
    00 13 20 40 48 48 50 48 48 50
      48 48 50 48 48 50 48 48 50
    19 Delete
    FF 90 SOT 2
    00 0A 2
    00 00 2 00 15 index of tile22 (index is started at
      0)
    00 00 00 00 4 data size of tile22(data size in
      last file mustl be "000000")
    00 1 15 index of tile22 (index is started at
      0)
    01 1 16 the number (22 file) of tile that is
      combined
    FF 93 2
    FF 05 50 36 9D 14 5A 1D E0 BC
    FF D9 2
  • This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin