You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
avfilter/vf_fsppdsp: Use standard clamping
This is obviously what is intended and what the MMX code does; yet I cannot rule out that it changes the output for some inputs: I have observed individual src values which would lead to temp values just above 512 if they came in pairs (i.e. if both inputs were simultaneously huge). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "vf_fsppdsp.h"
|
||||
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
|
||||
@@ -70,7 +71,7 @@ void ff_store_slice_c(uint8_t *dst, int16_t *src,
|
||||
#define STORE(pos) \
|
||||
temp = (src[x + pos] + (d[pos] >> log2_scale)) >> (6 - log2_scale); \
|
||||
src[x + pos] = src[x + pos - 8 * src_stride] = 0; \
|
||||
if (temp & 0x100) temp = ~(temp >> 31); \
|
||||
temp = av_clip_uint8(temp); \
|
||||
dst[x + pos] = temp;
|
||||
|
||||
for (int y = 0; y < height; y++) {
|
||||
@@ -99,7 +100,7 @@ void ff_store_slice2_c(uint8_t *dst, int16_t *src,
|
||||
#define STORE2(pos) \
|
||||
temp = (src[x + pos] + src[x + pos + 16 * src_stride] + (d[pos] >> log2_scale)) >> (6 - log2_scale); \
|
||||
src[x + pos + 16 * src_stride] = 0; \
|
||||
if (temp & 0x100) temp = ~(temp >> 31); \
|
||||
temp = av_clip_uint8(temp); \
|
||||
dst[x + pos] = temp;
|
||||
|
||||
for (int y = 0; y < height; y++) {
|
||||
|
||||
Reference in New Issue
Block a user