You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于HM Test Model 16.9中绝对差之和(SAD)的获取与输出配置问询

Getting Sum of Absolute Difference (SAD) from HM Test Model 16.9 & Saving to Text File

Hey there! I’ve worked with HM Test Model 16.9 extensively, so I can walk you through how to extract and save SAD values—even though the official manual might not cover this in detail. Here's a step-by-step breakdown:

1. Enable SAD Calculation via Configuration File

HM uses .cfg files for encoder/decoder settings, and you’ll need to tweak a couple of parameters to turn on SAD output:

  • First, enable distortion metric output globally:
    OutputDistortionMetrics=1
    
    This flag tells the codec to generate and print all enabled distortion metrics, including SAD.
  • Next, explicitly specify SAD as a metric to calculate (it’s often enabled by default, but setting it manually avoids surprises):
    DistortionMetricList=SAD
    
    If you want to output other metrics alongside SAD (like SSD or PSNR), just separate them with commas: DistortionMetricList=SAD,SSD,PSNR.

2. Redirect Output to a Text File

HM’s encoder/decoder prints logs to the console by default. To save these logs (including SAD values) to a text file, use command-line redirection when you run the tool.

For example, if your encoder command looks like this:

TAppEncoderStatic -c encoder_lowdelay_main.cfg -i input.yuv -o output.bin

Modify it to add redirection:

TAppEncoderStatic -c encoder_lowdelay_main.cfg -i input.yuv -o output.bin > sad_results.log 2>&1

The > sad_results.log part sends standard output to the file, and 2>&1 ensures error messages are also included (useful for debugging if something goes wrong).

3. Extract SAD Values from the Log File

Once the encoding/decoding process finishes, open sad_results.log with any text editor. You’ll find SAD values broken down per frame, plus a total sum at the end, looking something like this:

SAD: total = 98765432, average = 45.67

If you only need the overall total, just search for the final "total" entry in the log.

Quick Extra Tips

  • This method works for both the encoder (TAppEncoderStatic) and decoder (TAppDecoderStatic)—just apply the same config file tweaks and command-line redirection.
  • Double-check that no other config parameter is overriding OutputDistortionMetrics (some custom configs might disable this by default to speed up processing).

内容的提问来源于stack exchange,提问作者kaito87

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 04:02:54