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

Alexander Strange astrange
Wed Jan 13 20:47:43 CET 2010

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Implement-alpha-channel-decoding-for-BGR-HuffYUV.patch
Type: application/octet-stream
Size: 5815 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100113/f2c9a00e/attachment.obj>

More information about the ffmpeg-devel mailing list