===========================
  Usage of the extractor
===========================

JSVM version: JSVM_4_7

1. Extracting options
-------------------------------------------------------------------------------------------------
The following options are supported: "-l", "-t", "-f", "-e", "-b" and "-sl". 

Options "-l", "-t" and "-f" can be used in combination with each other. Other 
options can only be used separately. 

To display the options, use the command (assume that the excutable file is extract.exe): 
< extract >. Then the following text will be displayed:

Usage: bin\BitStreamExtractorStatic.exe InputStream 
       [OutputStream [-e] | [-sl] | [-l] [-t] [-f] | -b]]
options:
        -l L       -> extract all layers with dependency_id  <= L
        -t T       -> extract all layers with temporal_level <= T
        -f F       -> extract all layers with quality_level  <= F
        -e AxB@C:D -> extract a layer (possibly truncated) with
                       - A frame width [luma samples]
                       - B frame height [luma samples]
                       - C frame rate [Hz]
                       - D bit rate [kbit/s]
        -b B       -> extract a layer (possibly truncated) with the target bitrate = B
        -sl SL     -> extract the layer with layer id = SL and the dependent lower layers
        -ql        -> information about quality layers are used during extraction
        -qlord     -> ordered/toplayer quality layer extraction
  			- simulates truncation using normal ql even if MLQL assigner was used.


2. To extract according to temporal level (-t)
-------------------------------------------------------------------------------------------------
Command: <extract instream outstream -t tl>
 tl is the target temporal level. The extraction will extract all layers with 
 temporal level <= tl. For AVC-incompatible layers, the temporal level means 
 temporal_level.

3. To extract according to dependency_id (-l)
-------------------------------------------------------------------------------------------------
Command: <extract instream outstream -l d>
 d is the target value of dependency_id. The extraction will extract all layers with 
 dependency_id <= d.

4. To extract according to quality_level (-f)
-------------------------------------------------------------------------------------------------
Command: <extract instream outstream -f ql>
 ql is the target quality_level. If ql is an integer number, the command will extract 
 all layers with quality_level <= ql. If ql is a decimal fraction (x.y), then the
 command will extract all layers with quality_level <= x and truncate the FGS layer with
 quality_level = x+1 to have 0.y*100% of the data in the extracted bitstream. 
 For example,if ql = 1.6, then the command will extract all layers with quality_level <= 1
 and truncate the FGS layer with quality_level = 2 to have 60% of the data in the extracted 
 bitstream.

5. To extract according to a combination of frame size, frame rate and bitrate (-e)
-------------------------------------------------------------------------------------------------
Command: <extract instream outstream -e AxB@C:D>
 A is frame width in luma samples, B is frame height in luma samples, 
 C is frame rate, D is bitrate(kbps). The extraction will extract all layers with 
 frame size and frame rate smaller than or equal to the target frame size 
 and frame rate, respectively, and with the overall bitrate equal to the 
 target bitrate with FGS truncation being allowed. 

6. To display the information of contained scalable layers
-------------------------------------------------------------------------------------------------
Command: < extract instream > 
 instream is the file name (including path is needed) of the scalable bitsream
Example: 
       Layer   Resolution   Framerate    Bitrate      DTQ
         0     176x144       3.7500     106.00     (0,0,0)
         1     176x144       3.7500     206.00     (0,0,1)
         2     176x144       3.7500     341.00     (0,0,2)
         3     176x144       7.5000     430.00     (0,1,0)
         4     176x144       7.5000     454.00     (0,1,1)
         5     176x144       7.5000     508.00     (0,1,2)
         6     176x144      15.0000     594.00     (0,2,0)
         7     176x144      15.0000     631.00     (0,2,1)
         8     176x144      15.0000     721.00     (0,2,2)
         9     352x288       3.7500     666.00     (1,0,0)
        10     352x288       3.7500    1010.00     (1,0,1)
        11     352x288       7.5000    1364.00     (1,1,0)
        12     352x288       7.5000    1454.00     (1,1,1)
        13     352x288      15.0000    1838.00     (1,2,0)
        14     352x288      15.0000    1963.00     (1,2,1)
        15     352x288      30.0000    2192.00     (1,3,0)
        16     352x288      30.0000    2358.00     (1,3,1)

For AVC-incompatible layers, DTQ represents (Dependency_id, Temporal_level and Quality_level).
For AVC-compatible layers, T is just for indication of the temproal level or frame rate. 

7. To extract according to scalable layer number (-sl)
-------------------------------------------------------------------------------------------------
Command: <extract instream outstream -sl n> 
 n is the layer number of the scalable layer, outstream is the file name (including 
 path is needed) of the extracted bitsream
Example: <extract instream outstream -sl 10> will extract the scalable layer 10 as in the above example. 

8. To extract according to a target bitrate (-b)
-------------------------------------------------------------------------------------------------
Command: < extract instream outstream -b br>
 br is the target bitrate. The extraction process is as follows. 
 1) If there is a layer having a bitrate exactly equal to br, that layer is extracted. 
    Otherwise go to step 2. 
 2) The layer A having a bitrate smaller than but closest to br is found. If layer A is
    the highest layer, layer A is extracted. Otherwise, go to step 3. 
 3) If the next higher layer B to layer A is not a FGS layer, then layer A is extracted. 
    Otherise go to step 4.
 4) If the bitrate of layer B is greater than br, layer B is truncated to br. At the same time,
    all scalable layers with the same dependency_id and quality_level as this truncated scalable 
    layer will be truncated. Otherwise, let layer A be replaced with layer B, and go to step 3.

