Fix halveRoIForDepth, use the same as in openfx-io