[sldev] Meaning of RequestImage DiscardLevel field?

Salvador Agati agati at procele.com.br
Wed Sep 24 20:34:50 PDT 2008


  ----- Original Message ----- 
  From: John Hurliman 
  To: Carsten Juttner 
  Cc: Second Life Developer Mailing List 
  Sent: Sunday, September 21, 2008 1:05 AM
  Subject: Re: [sldev] Meaning of RequestImage DiscardLevel field?


  Thank you Carsten, that clarification is correct. For now I'm assuming that DiscardLevel 0 is a request for the full quality (zero discarded levels) and DiscardLevel 5 is requesting the lowest quality level. However, if you start with five quality layers and you discard five of them what are you left with? Is five actually being clamped to four? This still doesn't explain -1. If you send a RequestImage with Priority = 0.0 and DiscardLevel = -1 it will cancel the download, but texture requests often start with a positive priority and a DiscardLevel of -1. Is this a request for the header only, or is it just an uninitialized value in the client that implies zero or four?

  John


  On Fri, Sep 19, 2008 at 3:45 PM, Carsten Juttner <carjay at gmx.net> wrote:

    Robin Cornelius wrote: 
John Hurliman wrote:
  I know that the DiscardLevel field in the RequestImage packet is used to
request different quality levels (not different texture sizes as the
protocol documentation states, SL uses LRCP ordered JPEG2000 files), but
i can't figure out what the values correspond to. In a typical texture
download I'll see values ranging from -1 to 5. Is -1 a special value? Is
there an upper limit? Does a larger number mean a lower quality layer?

    The discard field is directly related to the request quality level as
you are already aware. It should be a simple calculation that the
discard is the number of powers of 2 to scale the image down by for the
reduced quality. So a discard of 0 is the complete image and a discard
of 1 is a 1/2 size, a discard of 2 is a 1/4 size etc.
  
    I think what John was actually referring to here is that quality layers and resolution levels are not the same. In JPEG2k all data is divided into packets for one tile. Each packet contains codestream data for one quality layer for one resolution for one component for one precinct (spatial partition). The order in which you transmit the packets decides what you get first and is signalled by the "progression order". LRCP (Layer-Resolution-Component-Position) is layer-centric meaning that one by one you get all the data for each quality layer, not for each resolution. That means you end up with the lowest quality layer for all resolutions first so it's really a quality-based progression, not a resolution-based.

    Think of the quality layers as going down the bits from MSB to LSB. First you get the rough information, then it progresses to the detailed information (actually for the wavelet coefficients).

    AFAIK, inside the viewer the progression order is not really cared about and the discard levels are merely referring to the dropped resolutions from the highest resolution.

    Also nobody seems to really know what is happening on the server side since we did ask a while ago but never met a Linden who was familiar with that area of the code so it's still a bit of a mystery.

    Regards,
    Carsten




    I'm not used to post here and I' ve got only these 2 messages above related to the subject. Indeed , english is not my native language and I am concious that I'm not an expert as you, in this list,  are.

    Despite of that, I decided to send this post because one of the first things I noted when I began to discover SL was exactly the way images were loaded in the viewer.

    It reminded me when I,  after the college, was a mastering student and had to read and discuss, in the class, the implementation of  an algoritm . I happened at about 20 years ago.
     
    In this book, it was presented an algoritm called "gross information first" and it used in the formula,  power of 2 numbers to calculate the pixel value of a group of pixels of a image.  So, the quality of the image generated with the algoritm was related to 2, 4, 8, 16, 32 or thinking as power of 2,  the values 0,1,2,3,4,5 . 

    I was wondering if this is the case, where the viewer asks for the next quality layer after the previous layer loaded and -1 to ask for data without this type of filtering.

    In this situation, the image, in the server, would  be stored only with the highest quality and the server would  first "filter" the image, with the correct factor, and then,  send it to the viewer, progressively, as requested.

    If someone call me crazy , I won't deny.

    Regards,
    Agathos Frascati SL
    Salvador Agati RL


     

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/sldev/attachments/20080925/fa4433fa/attachment.htm


More information about the SLDev mailing list