Lossless is broken
Lossless encoding appears broken:
$ git log --oneline -1
efc905a7 (HEAD, tag: v3.0.2) cleanup: update changelog and bump to 3.0.2
$ ./SvtAv1EncApp --version
SVT-AV1 v3.0.2 (release)
$ ./SvtAv1EncApp -i ~/Movies/cif/bus_cif.y4m -n 5 -b /tmp/x.ivf --lossless 1 --preset 10
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]: SVT-AV1 Encoder Lib v3.0.2
Svt[info]: SVT [build] : Apple LLVM 13.1.6 (clang-1316.0.21.2.5) 64 bit
Svt[info]: LIB Build date: Apr 3 2025 15:27:44
Svt[info]: -------------------------------------------
Svt[warn]: TPL is disabled for aq_mode 0
Svt[info]: Level of Parallelism: 5
Svt[info]: Number of PPCS 54
Svt[info]: [asm level on system : up to avx2]
Svt[info]: [asm level selected : up to avx2]
Svt[info]: -------------------------------------------
Svt[info]: SVT [config]: main profile tier (auto) level (auto)
Svt[info]: SVT [config]: width / height / fps numerator / fps denominator : 352 / 288 / 30 / 1
Svt[info]: SVT [config]: bit-depth / color format : 8 / YUV420
Svt[info]: SVT [config]: preset / tune / pred struct : 10 / PSNR / random access
Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type : 161 / 16 / key frame
Svt[info]: SVT [config]: BRC mode : Lossless Coding
Svt[info]: SVT [config]: AQ mode / variance boost : 0 / 0
Svt[info]: SVT [config]: sharpness / luminance-based QP bias : 0 / 0
Svt[info]: Svt[info]: -------------------------------------------
Encoding 5
SUMMARY --------------------------------- Channel 1 --------------------------------
Total Frames Frame Rate Byte Count Bitrate
5 30.00 fps 347134 16662.43 kbps
Channel 1
Average Speed: 58.469 fps
Total Encoding Time: 86 ms
Total Execution Time: 139 ms
Average Latency: 71 ms
Max Latency: 84 ms
$ ffmpeg -i /tmp/x.ivf -i ~/Movies/cif/bus_cif.y4m -lavfi psnr=shortest=1 -f null -v info -nostats - 2>&1|grep PSNR
[Parsed_psnr_0 @ 0x7f9ba7108300] PSNR y:102.169555 u:inf v:99.159255 average:102.169555 min:96.940768 max:inf
So the resulting file is not a losslessly compressed version of the input file. When I test this with other encoders (e.g. x265, libaom, libvpx), their lossless flag works correctly. Likewise, x264 --qp=0 or --crf=0 generates a lossless file.
Also, another (more minor) thing:
$ ./SvtAv1EncApp --help|grep -- --n' '
--n Number of frames to encode. If `n` is larger than the input, the encoder will loop back and continue encoding, default is 0 [0: until EOF, 1-`(2^63)-1`]
$ ./SvtAv1EncApp -i ~/Movies/cif/bus_cif.y4m --n 5 -o /tmp/x.ivf --lossless 1 --preset 10
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]: SVT-AV1 Encoder Lib v3.0.2
Svt[info]: SVT [build] : Apple LLVM 13.1.6 (clang-1316.0.21.2.5) 64 bit
Svt[info]: LIB Build date: Apr 3 2025 15:27:44
Svt[info]: -------------------------------------------
Unprocessed tokens: --n
Unprocessed arguments: 5
The documentation should probably be updated to reflect that the argument has a single dash (-n) instead of 2 dashes (--n).