Single (3) / first (1) / last (2) / intermediate (0) context is fixed#90
Single (3) / first (1) / last (2) / intermediate (0) context is fixed#90sulyokabel wants to merge 1 commit into
Conversation
…. (Does not affect the result.)
|
Please provide an explanation of what this is supposed to fix, under what conditions it is manifested, and what its impact is expected to be. As you can see by the traffic in this repository, changes to the encoder/decoder are extremely rare. |
|
The 'point context' is different for the last and the current items. In the code above my modifications you can see the next 'correct' code for the last item: // create single (3) / first (1) / last (2) / intermediate (0) context from last point return But later the calculation of context for the current item have different 'pattern' and does not match with the corresponding comment. (See my proposed modifications.) |
|
so you changed the code to match the comment? Maybe it's too late for such a thing. This change is going to change the wire format of LAZ files, correct? Even if current files are incorrect relative to the comment, older readers are not going to be able to accommodate this change if I understand correctly. I'm curious what you encountered that prompted you to make this change. Why do you think it is necessary? I don't think it is enough if the reason is simply to make the code match the comment (we should fix the comment and provide more information as to what historically happened). |
|
No, the goal is not to match the comment. I started to study the LAZ format for my own. I found that the current format is extremely complicated, but I understand that the efficiency is the main point. Furthermode the code is more complicated and should be simplified, if it is possible. Maybe the complex code with many unnecessary repetition resulted in a wrong version3 of encoder/decoder that fixed in version4. |
It is no problem to simplify the code as an academic discovery scenario. Given the operational reality of the LAZ format, we have to be extremely low risk in changing any of the encoder implementation details. The person who originally wrote it died, the wire format doesn't really allow for in-place evolution, and massive amounts of data are stored in it.
Definitely, but I don't think model and encoder code can be effectively changed without great risk of breaking things. Also make sure to look at https://github.com/hobuinc/laz-perf/ for an alternative implementation. It has less repetition, but it doesn't really change anything in regards to the model or encoder – it simply wraps it up in an easier-to-use package. |
|
I understand your decision. Only one last argument on my proposal: Its values are single = 3, first = 1, last = 2, and intermediate = 0 and it is computed: (This makes hard to implement LAZ reader for others, but as I mentioned, the correction fortunately does not affect the final result.) |
Does not affect the result.