简体   繁体   English

使用莫顿码压缩数据-如何?

[英]Using morton codes to compress data - how?

I've been reading something about morton codes and I got that locality is preserved in the sequence of generated numbers. 我一直在阅读有关莫顿码的信息,但我知道在生成的数字序列中保留了局部性。

What I don't understand is how this information can be used to compress data or to efficiently construct data in parallel. 我不了解的是如何使用这些信息来压缩数据或有效地并行构造数据。

Source: http://www.forceflow.be/2013/10/07/morton-encodingdecoding-through-bit-interleaving-implementations/ 资料来源: http : //www.forceflow.be/2013/10/07/morton-encodingdecoding-through-bit-interleaving-implementations/

Morton ordering isn't inherently related to data compression on its own. Morton排序本身并不与数据压缩内在相关。 It's just a way of laying out spatial data in memory such that queries about a contiguous block of space tend to map to contiguous blocks of memory - making for good cache efficiency. 这只是一种在内存中布置空间数据的方式,这样有关连续空间块的查询往往会映射到连续存储器块,从而提高了缓存效率。

In the algorithm paper referenced in the link you cite, Morton order is used to improve efficiency of disc reads & writes. 在您引用的链接中引用的算法文件中,Morton顺序用于提高光盘读写的效率。

The algorithm converts a complex triangle mesh into a high-resolution voxel intermediate representation (stored in Morton order), and then converts that representation into a sparse (compressed) output form. 该算法将复杂的三角形网格转换为高分辨率的体素中间表示形式(以Morton顺序存储),然后将该表示形式转换为稀疏(压缩)输出形式。

One of the properties of Morton order is that it matches the order obtained from depth-first traversal of an octree (or quadtree in 2D). 莫顿阶的特性之一是,它与从八叉树(或2D中的四叉树)的深度优先遍历获得的顺序匹配。 This gives a convenient alignment between the output octree data structure and the intermediate. 这样可以在输出八叉树数据结构和中间结构之间方便地对齐。 So constructing a node in the output octree requires data from a contiguous set of indices in the intermediate structure. 因此,在输出八叉树中构造一个节点需要来自中间结构中一组相邻索引的数据。 This lets the algorithm read only the data it needs at a given step, keeping the memory footprint low and cache efficiency high. 这样,算法就可以在给定的步骤中仅读取所需的数据,从而保持较低的内存占用量和较高的缓存效率。

So the Morton ordering here provides no particular compression or parallelization advantage on its own - you could write an equivalent algorithm with the same compression output that used linear ordering in its intermediate, but its writes and reads would be much more scattered and so it probably wouldn't process data nearly as quickly. 因此,此处的Morton排序本身并没有提供任何特殊的压缩或并行化优势-您可以编写具有与在其中间使用线性排序相同的压缩输出的等效算法,但其读写操作会更加分散,因此可能不会处理数据的速度几乎没有这么快。

But if you're using quadtrees or octrees to compress data, Morton ordering can make your indexing of data cleaner and higher performance. 但是,如果您使用四叉树或八叉树来压缩数据,则莫顿排序可以使您的数据索引更整洁,性能更高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何压缩范围内的数据框? - How to compress a data frame within a range? 非立方区域的莫顿曲线,是 2 的幂 - Morton curve for non cubic areas that are a power of two 我应该如何存储和计算二进制代码之间的汉明距离? - How should I store and compute Hamming distance between binary codes? 我如何压缩部分排序的最佳 50000 字节 - How can i compress best possible 50000 bytes which are partly sorted 如何压缩一个非常大的数字(通过用 ascii 值替换文本文件中的字符获得的大数字)? - How can I compress a very large number(big number obtained by replacing characters in a text file by its ascii values)? 谷歌Adwords促销代码背后的数学是什么以及如何在自定义应用程序中复制它们? - What's the math behind Google Adwords Promotional Codes and how to replicate them in a custom app? 调整数学并行代码 - Tuning Mathematical Parallel Codes 使用python查找序列在数据帧中重复的次数 - finding how many times a sequence repeats in a data frame using python 如何使用data属性获取点击商品的总价? - How to get total price of clicked items using data attribute? 将两个或多个数字压缩为一个字节 - Compress two or more numbers into one byte
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM