Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • orc orc
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamerGStreamer
  • orcorc
  • Issues
  • #7
Closed
Open
Issue created Mar 15, 2015 by Bugzilla Migration User@bugzilla-migration

div255 implementation is incorrect

Submitted by Jan Schmidt @thaytan

Link to original bug (#746247)

Description

Created attachment 299452
test div255 app

div255 implements this algorithm everywhere:
d = (s + 128 + (s+128)>>8) >> 8
which produces a result that is off-by-one for roughly half the 0..65535 input range.

A correct implementation is:
d = (s + 1 + (s >> 8)) >> 8

Test python app, and a fix which implements the new algorithm attached.

Attachment 299452, "test div255 app":
test-div255.py

See also

  • Bug 796846
Assignee
Assign to
Time tracking