Video Compression

VideoNerd

JPEG Lossless coding of still images (with ffmpeg tool’s  jpegls) tends to be slightly better than png-format (for both live images and computer-generated)

 

How to apply JPEG Lossles coding:

ffmpeg -i test.png -vcodec jpegls -pix_fmt rgb24 -y test_ls.jpg

Note: it’s recommended to set '-pred 2' the median prediction instead of the left (default):

ffmpeg -i test.png -vcodec jpegls -pred 2 -pix_fmt rgb24 -y test_ls.jpg

 

In the study over ~1500 images it was found that JPEG-LS is beneficial for natural images:

Appendix:  JPEG-LS Sample Encoder

JPEG-LS Sample Encoder  official version. I have Visual Studio 2019 Solution of Sample Encoder (Samples project), pls. ask me directly via my email slavah264@gmail.com to get the built solution. 

JPEG-LS Sample Encoder (convert_c exe file and corresponding dll-file) for Windows is located here

Example of running JPEG-LS encoder (input file is required as bmp-file):

convert-c.exe   test.bmp   output.jls  none 0

input file: ‘test.bmp’

output file: ‘output.jls’ , played by ffplay

interleaving mode:  none

near-lossless:    0

 

To enable near-lossless ±1 value in a pixel type: convert-c.exe   test.bmp   output.jls  none 1

Note: to convert jls-file to bmp we can use ffmpeg tool:    ffmpeg -i test.jls -pix_fmt rgb24 -y test.bmp

Note: the ffmpeg supports other video lossless codecs, e.g. ffv1, the spec.

ffmpeg -video_size 384x320 -i swbf.yuv -c:v ffv1 -context 1 -coder 0 swbf_lossless.mkv

where

-context 1   take greater context

-coder  0    Golomb-Rice VLC

 

Leave a Reply

Your email address will not be published. Required fields are marked *