From f0944d2467475a46baac0a173d2e690e78e5da53 Mon Sep 17 00:00:00 2001
From: Martin Vignali <martin.vignali@gmail.com>
Date: Mon, 20 Aug 2018 12:49:08 +0200
Subject: [PATCH 2/3] swscale : treat float input data as uint 16bpc

Currently float are converted to 16b uint in input part
using src depth (32 bits) in hScale16To19, make
an invalid shift for the data

So shift the value when using float input
like 16 bpc uint.
---
 libswscale/swscale.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 7f3e22355f..9fc6c84a5c 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -74,8 +74,11 @@ static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW,
     int bits            = desc->comp[0].depth - 1;
     int sh              = bits - 4;
 
-    if((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16)
+    if ((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
         sh= 9;
+    } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
+        sh = 16 - 1 - 4;
+    }
 
     for (i = 0; i < dstW; i++) {
         int j;
-- 
2.14.3 (Apple Git-98)

