Skip to content

Widen dequantized product to 64 bits in highbd quantize helpers - #5567

Open
edcote wants to merge 1 commit into
AOMediaCodec:mainfrom
edcote:fix-highbd-quantize-ubsan
Open

edcote wants to merge 1 commit into
AOMediaCodec:mainfrom
edcote:fix-highbd-quantize-ubsan

Conversation

@edcote

@edcote edcote commented Oct 16, 2026

Copy link
Copy Markdown
Contributor
  • Multiplying the quantized coefficient magnitude by the dequantizer step in 32-bit signed arithmetic before passing the product to the 64-bit rounding macro can overflow signed 32-bit integers.
  • Casting the quantized coefficient magnitude to the 64-bit intermediate transform type before multiplication prevents signed integer overflow and matches the floating-point and trellis quantizer paths.

- Multiplying the quantized coefficient magnitude by the dequantizer step in
  32-bit signed arithmetic before passing the product to the 64-bit rounding
  macro can overflow signed 32-bit integers.
- Casting the quantized coefficient magnitude to the 64-bit intermediate
  transform type before multiplication prevents signed integer overflow and
  matches the floating-point and trellis quantizer paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants