scenecut-bias either improperly used or improperly stored/displayed

Issue #376 new
Former user created an issue

In encoder.cpp the input value of scenecut-bias is divided by 100 before its use. Line 2344 changes the (e.g default) value of 5.00 to 0.05. The value "scenecut-bias=0.05" is then incorrectly stored in the encoding parameters string.

x265\x265_2.5\source\encoder\encoder.cpp (2 hits) Line 2344: p->scenecutBias = (double)(p->scenecutBias / 100);

I do not know the internals of the encoder, so am not sure if it is really supposed to be divided or not. If the division is correct, then all of the sprintf's used after the call to Ecnoder::configure() need to be fixed to multiply scenecutBias by 100 to display/store properly. I believe this affects only line 1655 of param.cpp in call to *x265_param2string().

x265\x265_2.5\source\common\param.cpp (6 hits) Line 155: param->scenecutBias = 5.0; Line 947: OPT("scenecut-bias") p->scenecutBias = atof(value); Line 1280: CHECK(param->scenecutBias < 0 || 100 < param->scenecutBias, Line 1379: x265_log(param, X265_LOG_INFO, "Keyframe min / max / scenecut / bias: %d / %d / %d / %.2lf\n", param->keyframeMin, param->keyframeMax, param->scenecutThreshold, param->scenecutBias * 100); Line 1655: s += sprintf(s, " scenecut-bias=%.2f", p->scenecutBias);

x265\x265_2.5\source\x265cli.h (1 hit) Line 413: H1(" --scenecut-bias <0..100.0> Bias for scenecut detection. Default %.2f\n", param->scenecutBias);

Comments (2)

  1. Pradeep Ramachandran Account Deactivated

    x265 uses the bias value like a weight and therefore converts the value specified by the param which is between 0...100 to be between 0...1. When we print the scenecutBias value in the configure() step, the value is multiplied by 100, which ensures that the user sees the value to be consistent with what they'd specified.

    Given this, I don't understand why you say that the param value is improperly stored or used. It looks ok to me. Am I missing something?

  2. at2010

    @pradeep. Ok. So the problem then is that the valued created by line 1655 of param.cpp in call to x265_param2string() has NOT been remultiplied by 100 before it is used. So the output config string shows a value between 0.0 and 1.0 instead of 1...100. For example, the default value of 5.0 is created as 0.05 in x265_param2string(). This is the value that is stored into the resulting media container (mkv, mp4). Any hex editor or mediainfo will display the incorrect value of 0.05

  3. Log in to comment