[FFmpeg-devel] [PATCH] lavc/cfhd:fixed alpha channel decoding in gbrap12

Gagandeep Singh deepgagan231197 at gmail.com
Tue Mar 20 14:16:08 EET 2018


On Tue, 20 Mar 2018, 16:31 Kieran Kunhya, <kierank at obe.tv> wrote:

> >
> > ticket #6265, oops forgot this
> >
>
> Can you confirm this makes the png in the ticket look as expected?
> I was expecting the companding curve to also change for alpha.
>
> Kieran
>

preserving the limits (max and min)
---
 libavcodec/cfhd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index d64acab8d4..a950dc0f28 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -103,6 +103,8 @@ static inline void process_alpha(int16_t *alpha, int
width)
         channel <<= 8;
         channel  -= 128;
         channel  /= 223;
+        channel   = FFMIN(channel, (1 << 12) - 1);
+        channel   = FFMAX(channel, 0);
         alpha[i]  = channel;
     }
 }
-- 
2.14.1



> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list