
NvJpg decoder test is used to test nvjpeg library based HW decoder.  
The color format of decoded output of decoder is YUV420.

Steps to build
______________

Build NvJpg decoder from <sdk>\Tests\Multimedia\Sources\Tests\NvJpgDecoder folder using below nact command 

nact platforms=NXFP2 specs=NX BUILD=Release,Develop

Steps to run 
_____________
Run <sdk>\Tests\Outputs\<NX-NXFP2-a32/a64>\Tests\testMultimedia_NvJpgDecoder\<Develop/Release>\testMultimedia_NvJpgDecoder.nsp from Target manager.

Command line parameter : 

--in <JPEG file> --out <Output path>

--in <JPEG file>      : Input JPEG file to decode. 
--out <Output path>   : decoded output yuv file. 
--incrc <Input CRC>   : Input CRC refrence number. (Optional)
--outcrc <output CRC> : Output CRC refrence number. (Optional)
--rgb  <0 or 1>       : 0:Decodes in YUV format(default), 1:Decodes in RGB format (Optional)
--swpath <0 or 1>     : 0:Decodes using HW path (default), 1:Decodes using SW path (Optional)
--LoopCount <loop count> :  0: for decoding only one image (default), n: for decoding n number of times same image. (One time nvjpeg initialization check)


As mention earlier CRC parameters are optional in test.
without CRC :
    eg : --in C:\temp\Input.jpg --out C:\temp\output.yuv
         --in sdcard:/Input.jpg --out sdcard:/temp/output.yuv

     
With CRC :
    To make use of the --incrc/--outcrc or both generate a reference CRC first.
    1. Provide a dummy value as argument in the --incrc/--outcrc and run the test for multiple iterations
        eg --incrc 45 --outcrc 67
    2. Compare the decoded yuv files and values of input/output CRC(in log)for various iterations and they should be same. 
    3. Use the printed CRC as reference value for future test. 
     
    eg :  
    --in C:\temp\Input.jpg  --out C:\temp\ooutput.yuv --incrc 45 --outcrc 67
    --in sdcard:/Input.jpg  --out sdcard:/temp/output.yuv  --incrc 45 --outcrc 67
    
 
For rgb : To generate rgb file output, default its yuv
    eg : --in C:\temp\Input.jpg --out C:\temp\output.yuv --rgb 1
         --in sdcard:/Input.jpg --out sdcard:/temp/output.yuv --rgb 1
         

For swpath : To use SW path, default its HW
    eg : --in C:\temp\Input.jpg --out C:\temp\output.yuv --swpath  1
         --in sdcard:/Input.jpg --out sdcard:/temp/output.yuv --swpath  1
    
The decoded output.yuv/.rgb file will be saved at <Output path>.

Please note:
            1. The tests are restricted for 16x16 to 4kx4K image input
            2. JEPG progressive images uses the SW path