summaryrefslogtreecommitdiff
path: root/libswscale/output.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-07-08 12:59:36 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-07-09 12:29:03 +0200
commit75285325500672a806ba93bfc1e0ace9c9e566c1 (patch)
tree9168cd4f75619e31e4cdcc8ed306c4fa0a10f2b8 /libswscale/output.c
parent997f9cfc1295769be8d3180860ceebbc16f59069 (diff)
swscale/output: Implement dither none for yuv2rgb_write_full()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libswscale/output.c')
-rw-r--r--libswscale/output.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index e855ad606a..0a3515f3ca 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -1912,6 +1912,17 @@ static av_always_inline void yuv2rgb_write_full(SwsContext *c,
int r,g,b;
switch (c->dither) {
+ case SWS_DITHER_NONE:
+ if (isrgb8) {
+ r = av_clip_uintp2(R >> 27, 3);
+ g = av_clip_uintp2(G >> 27, 3);
+ b = av_clip_uintp2(B >> 28, 2);
+ } else {
+ r = av_clip_uintp2(R >> 29, 1);
+ g = av_clip_uintp2(G >> 28, 2);
+ b = av_clip_uintp2(B >> 29, 1);
+ }
+ break;
default:
case SWS_DITHER_AUTO:
case SWS_DITHER_ED: