[FFmpeg-cvslog] swscale/output: Implement dither none for yuv2rgb_write_full()

Michael Niedermayer git at videolan.org
Fri Jul 9 16:19:48 EEST 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Jul  8 12:59:36 2021 +0200| [75285325500672a806ba93bfc1e0ace9c9e566c1] | committer: Michael Niedermayer

swscale/output: Implement dither none for yuv2rgb_write_full()

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=75285325500672a806ba93bfc1e0ace9c9e566c1
---

 libswscale/output.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

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:



More information about the ffmpeg-cvslog mailing list