Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
0 answers
97 views

I stumbled upon perplexing hardware behavior in the following simple circuit, provided here verbatim: /// Given an WIN-bit signed input, truncates the most significant bits to produce a WOUT-bit ...
3 votes
4 answers
375 views

I have an array of the form a = np.array([1], dtype='uint8'). Now if I add 255 to a it will overflow and be np.array([0]). Is there a built-in way to "clip" to value to 255? NumPy has the ...
1 vote
1 answer
225 views

I'm working with an SDR that has a 12-bit signed ADC/DAC that stores in 16-bit IQ samples. I want to ensure that after all the DSP is done the samples saturate at 12 bits instead of getting truncated ...
-1 votes
4 answers
606 views

I was recently faced with a given problem: There are 8 elements in the vector, each is represented by int8_t. Implement an algorithm in x86_64 that will add two vectors (uint64_t type). Adding ...
6 votes
4 answers
886 views

The problem for signed 2's complement 32-bit integers: satMul2 - multiplies by 2, saturating to Tmin or Tmax if overflow. Examples: satMul2(0x30000000) = 0x60000000 satMul2(0x40000000) = ...
2 votes
2 answers
927 views

CUDA has a nice set of SIMD instructions for integers that allow efficient SIMD computations. Among those, there are some that compute addition and subtraction per byte or per half-word (like __vadd2 ...
0 votes
2 answers
477 views

Looking for a saturating function in Rust. Here I called it fit_to_range(range). let input:i64= something; let saturated:64= input.fit_to_range(7..=4000); assert!((7..=4000).contains(saturated));...
1 vote
0 answers
219 views

Below is the C# Logic for changing saturation of image. Referred from here Note: We are using this saturation matrix R G B A W R [sr+s sr sr 0 0] G [ sg sg+s sg 0 0] B [ sb ...
6 votes
2 answers
963 views

Is there an elegant way to cast a bigger datatype to a smaller one without causing the result to overflow? E.g. casting 260 to uint8_t should result in 255 instead of 4. A possible solution would be: #...
2 votes
0 answers
272 views

I'm using a super simple CSS filter to increase Saturation on a webpage (and it's video's) via Stylus extension, html { filter: Saturation (125%) } it works on the webpage without issue but then the ...
2 votes
1 answer
935 views

I have the following multiplication between 2 16 bit vectors: int16x8_t dx; int16x8_t dy; int16x8_t dxdy = vmulq_s16(dx, dy); In case dx and dy are both large enough, the result will overflow. I ...
0 votes
1 answer
108 views

[I tried to compute a float multiplication, I observed the value was getting saturated to 65536 and was not updating. the issue is only with the below code.]1 Result for the above code I tried this ...
1 vote
2 answers
1k views

I'm wondering if there is any fast bit twiddling trick to do a saturating conversion from a 64-bit unsigned value to a 32-bit unsigned value (it would be nice if it is generalized to other widths but ...
1 vote
2 answers
818 views

The following is the piece of code I am trying to implement: if (n1 > 0 && n2 > 0 && result >= Integer.MAX_VALUE) { result = Integer.MAX_VALUE; } else if (n1 > 0 &&...
2 votes
1 answer
260 views

For CSS filters, would there be any difference is the browser's speed to process saturate(2) as compared to any of the following: saturate(100) saturate(1000) saturate(9999) saturate(56.789) saturate(...

15 30 50 per page
1
2

AltStyle によって変換されたページ (->オリジナル) /