mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-30 22:50:48 +00:00
avfilter/paletteuse: fix error dithering accuracy
This commit is contained in:
parent
29bbc1be48
commit
b0f5227558
@ -133,9 +133,9 @@ static int query_formats(AVFilterContext *ctx)
|
||||
|
||||
static av_always_inline int dither_color(uint32_t px, int er, int eg, int eb, int scale, int shift)
|
||||
{
|
||||
return av_clip_uint8((px >> 16 & 0xff) + ((er * scale) >> shift)) << 16
|
||||
| av_clip_uint8((px >> 8 & 0xff) + ((eg * scale) >> shift)) << 8
|
||||
| av_clip_uint8((px & 0xff) + ((eb * scale) >> shift));
|
||||
return av_clip_uint8((px >> 16 & 0xff) + ((er * scale) / (1<<shift))) << 16
|
||||
| av_clip_uint8((px >> 8 & 0xff) + ((eg * scale) / (1<<shift))) << 8
|
||||
| av_clip_uint8((px & 0xff) + ((eb * scale) / (1<<shift)));
|
||||
}
|
||||
|
||||
static av_always_inline int diff(const uint8_t *c1, const uint8_t *c2)
|
||||
|
Loading…
Reference in New Issue
Block a user