Skip to main content

codec_factor

Function codec_factor 

Source
pub const fn codec_factor(codec: VideoCodec) -> f64
Expand description

Bits a codec needs, relative to H.264, for the same quality.

HEVC and AV1 were measured on NVENC against h264_nvenc at equal PSNR-Y (0.61 to 0.71 and 0.56 to 0.61 over 40 to 48 dB), MPEG-4 Part 2 on mpeg4 against h264_vulkan (3.3x at 40 dB falling to 2.1x at 48). The software encoders the pinned SDK links were measured the same way, against h264_nvenc on the colour clip at 1920x816, at the PSNR-Y h264_nvenc reaches at each level’s H.264 rate: libvpx-vp9 (cpu-used 4) needs 0.60x at very-low rising to 0.87x at very-high, so VP9 is the middle of that, 0.75. libsvtav1 (preset 8) needs 0.47x rising to 0.93x, where av1_nvenc on the same frames needs 0.49x to 0.61x; one AV1 factor serves both encoders, so it is the higher of their middles, 0.70, which gives av1_nvenc more than it needs rather than libsvtav1 far less. The same runs put HEVC at 0.60x to 0.73x, in line with its factor. A browser’s WebCodecs VP9 and AV1 encoders take the same factors.