这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Melirius
Copy link
Contributor

@Melirius Melirius commented Mar 2, 2025

Description

Handling of the number of pixels in ModularEncode functions is strange: being applied to a sequence of stream images like in ModularFrameEncoder::ComputeTree or to an individual image like in other cases, it overestimates the number of pixels processed due to special treatment of *total_pixels == 0 case.

If initially total_pixels = 0 then we have after the function total_pixels = 2 * (number of pixels in the image) increased by this part and GatherTreeData , in any other case we have total_pixels += (number of pixels in the image) increased by GatherTreeData (modulo edge cases).

It looks like that the intention was to not allow zero in the number of pixels as it crashes LearnTree function. However, it can be done in a more straightforward way without pixel number overestimation.

In my testing the proposed change also leads to a slightly better compression, of the order of $6\times10^{-3}$ %. However, some of the tests are failing due to increase of the file size, so I mark this as draft before I can find out the cause.

Pull Request Checklist

  • CLA Signed: Have you signed the Contributor License Agreement (individual or corporate, as appropriate)? Only contributions from signed contributors can be accepted.
  • Authors: Have you considered adding your name to the AUTHORS file?
  • Code Style: Have you ensured your code adheres to the project's coding style guidelines? You can use ./ci.sh lint for automatic code formatting.

@Melirius Melirius marked this pull request as draft March 2, 2025 17:38
@Melirius Melirius mentioned this pull request Mar 4, 2025
3 tasks
@eustas
Copy link
Contributor

eustas commented May 6, 2025

Supplanted by #4209

@eustas eustas closed this May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants