fraunhoferhhi / vvenc

VVenC, the Fraunhofer Versatile Video Encoder
https://www.hhi.fraunhofer.de/en/departments/vca/technologies-and-solutions/h266-vvc.html
BSD 3-Clause Clear License
943 stars 170 forks source link

Can we run VVenc in a CRF mode? #306

Closed hassount closed 1 year ago

hassount commented 1 year ago

Looking for the appropriate command line parameter to run VVenc in the highest objective quality (psnr, ssim, vmaf) mode which is usually the CRF mode. This would usually be enabling content adaptive frame and block level qp selection to maximize the objective quality of the output.

According to the wikis:

--qpa seems to be directed only to subjective tuning --qp seems to be only a fixed qp mode (no content adaptivity) multipass encoding seems to be specific to vbr modes which seems to be slightly worse in quality than fixed QP mode

But there's no clear way of of having a mode similar to x265 --crf <> usage.

jungleboynx commented 1 year ago

There's no crf mode at present although the quantizer values vary in qp mode. --qpa [on] enable perceptually motivated QP adaptation based on XPSNR model (0: off, 1: on)

crhelmrich commented 1 year ago

Hi,

parameter to run VVenc in the highest objective quality (psnr, ... --qp seems to be only a fixed qp mode (no content adaptivity)

Can you clarify what you are looking for? Is it a constant PSNR across the video frames?

Using --qp ... with --qpa 0 currently gives you the highest objective performance in terms of PSNR, and --qp ... with --qpa 1 results (on most camera captured input) in the highest objective performance in terms of (MS-)SSIM and XPSNR.

Note, also, that using --qp does activate some content adaptivity, increasing the objective performance (when measured in BD-rate) by a few percent.

Christian

hassount commented 1 year ago

Thank you @crhelmrich and @jungleboynx for the additional info. Are there any plans to support a CRF mode similar to the x265 --crf [] implementation to increase the quality further ?

crhelmrich commented 1 year ago

An x265 expert writes at https://slhck.info/video/2017/02/24/crf-guide.html (emphasis mine):

CRF is a “constant quality” encoding mode. ... It will compress different frames by different amounts, thus varying the QP as necessary to maintain a certain level of perceived quality. ... it means that the encoder can save bits, while retaining perceptual quality...

This behavior is exactly what you get when using --qp ... with --qpa 1 (the default) in VVenC. Optimizing for objective quality according to PSNR is something else and in VVenC can be achieved as I explained in my previous post.

Christian

adamjw24 commented 1 year ago

Assuming resolved