diff options
author | Alexander Strange <astrange@ithinksw.com> | 2010-01-14 04:32:49 +0300 |
---|---|---|
committer | Alexander Strange <astrange@ithinksw.com> | 2010-01-14 04:32:49 +0300 |
commit | f267d3ac75942bd0fabb38361e00192b8254ba76 (patch) | |
tree | dca4fac9fd11b778c1882d7139d7f65b18f92d3f /libavcodec/dsputil.c | |
parent | ff5ab5c8c9b87908639861a6d29d6cf330c4ed56 (diff) |
Implement alpha channel decoding for BGR HuffYUV.
Since BGR24 is decoded as BGR32, fill its alpha channel with 255
using the appropriate predictors.
Originally committed as revision 21211 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index a2a313abf6..41a63778bb 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -3632,35 +3632,42 @@ static int add_hfyu_left_prediction_c(uint8_t *dst, const uint8_t *src, int w, i #define B 3 #define G 2 #define R 1 +#define A 0 #else #define B 0 #define G 1 #define R 2 +#define A 3 #endif -static void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue){ +static void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue, int *alpha){ int i; - int r,g,b; + int r,g,b,a; r= *red; g= *green; b= *blue; + a= *alpha; for(i=0; i<w; i++){ b+= src[4*i+B]; g+= src[4*i+G]; r+= src[4*i+R]; + a+= src[4*i+A]; dst[4*i+B]= b; dst[4*i+G]= g; dst[4*i+R]= r; + dst[4*i+A]= a; } *red= r; *green= g; *blue= b; + *alpha= a; } #undef B #undef G #undef R +#undef A #define BUTTERFLY2(o1,o2,i1,i2) \ o1= (i1)+(i2);\ |