[FFmpeg-devel] [PATCH] Alpha channel decoding for HuffYUV v2

Michael Niedermayer michaelni
Wed Jan 13 23:32:23 CET 2010


On Wed, Jan 13, 2010 at 02:47:43PM -0500, Alexander Strange wrote:
> This implements alpha decoding for 32-bit files and fills it with 255 for 24-bit files.
> 
> Tested on:
> http://samples.mplayerhq.hu/V-codecs/HuffYUV/camera2_hfyu32.avi (32-bit)
> http://samples.mplayerhq.hu/V-codecs/HuffYUV/angels_480-huffyuvcompress.avi (24-bit)
> on x86-64 vs. the official decoder output.
> 
> About this part:
> > @@ -406,7 +408,7 @@ static av_cold void alloc_temp(HYuvContext *s){
> >              s->temp[i]= av_malloc(s->width + 16);
> >          }
> >      }else{
> > -        s->temp[0]= av_malloc(4*s->width + 16);
> > +        s->temp[0]= av_mallocz(4*s->width + 16);
> >      }
> >  }
> 
> I think it's necessary for 24-bit files, because decode_bgr_1() won't write anything to the alpha channel if it finds a code not in the joint table in the first row of the first frame. But that's pretty rare, so I haven't found any samples that decode wrong without the change.
> 

>  dsputil.c |   11 +++++++++--
>  dsputil.h |    2 +-
>  huffyuv.c |   16 ++++++++++------
>  3 files changed, 20 insertions(+), 9 deletions(-)
> e55267b32220e7b1c384f3dcfc6ee2c9ff2c162d  0001-Implement-alpha-channel-decoding-for-BGR-HuffYUV.patch
> From 495aa71c742a31f1aaa203b9cbc723b888debfc1 Mon Sep 17 00:00:00 2001
> From: Alexander Strange <astrange at ithinksw.com>
> Date: Wed, 13 Jan 2010 01:13:15 -0500
> Subject: [PATCH] Implement alpha channel decoding for BGR HuffYUV.
> 
> Since BGR24 is decoded as BGR32, fill its alpha channel with 255
> using the appropriate predictors.
> ---
>  libavcodec/dsputil.c |   11 +++++++++--
>  libavcodec/dsputil.h |    2 +-
>  libavcodec/huffyuv.c |   16 ++++++++++------
>  3 files changed, 20 insertions(+), 9 deletions(-)

ok

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100113/b8fda897/attachment.pgp>



More information about the ffmpeg-devel mailing list