#define RGB_OUT(d, r, g, b) RGBA_OUT(d, r, g, b, 0xff)
#endif
-static void glue(yuv420p_to_, RGB_NAME)(AVPicture *dst, AVPicture *src,
+static void glue(yuv420p_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
- uint8_t *y1_ptr, *y2_ptr, *cb_ptr, *cr_ptr, *d, *d1, *d2;
+ const uint8_t *y1_ptr, *y2_ptr, *cb_ptr, *cr_ptr;
+ uint8_t *d, *d1, *d2;
int w, y, cb, cr, r_add, g_add, b_add, width2;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
unsigned int r, g, b;
}
}
-static void glue(yuvj420p_to_, RGB_NAME)(AVPicture *dst, AVPicture *src,
+static void glue(yuvj420p_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
- uint8_t *y1_ptr, *y2_ptr, *cb_ptr, *cr_ptr, *d, *d1, *d2;
+ const uint8_t *y1_ptr, *y2_ptr, *cb_ptr, *cr_ptr;
+ uint8_t *d, *d1, *d2;
int w, y, cb, cr, r_add, g_add, b_add, width2;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
unsigned int r, g, b;
}
}
-static void glue(RGB_NAME, _to_yuv420p)(AVPicture *dst, AVPicture *src,
+static void glue(RGB_NAME, _to_yuv420p)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
int wrap, wrap3, width2;
}
}
-static void glue(RGB_NAME, _to_gray)(AVPicture *dst, AVPicture *src,
+static void glue(RGB_NAME, _to_gray)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
const unsigned char *p;
}
}
-static void glue(gray_to_, RGB_NAME)(AVPicture *dst, AVPicture *src,
+static void glue(gray_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
const unsigned char *p;
}
}
-static void glue(pal8_to_, RGB_NAME)(AVPicture *dst, AVPicture *src,
+static void glue(pal8_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
const unsigned char *p;
#if !defined(FMT_RGBA32) && defined(RGBA_OUT)
/* alpha support */
-static void glue(rgba32_to_, RGB_NAME)(AVPicture *dst, AVPicture *src,
+static void glue(rgba32_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
const uint8_t *s;
}
}
-static void glue(RGB_NAME, _to_rgba32)(AVPicture *dst, AVPicture *src,
+static void glue(RGB_NAME, _to_rgba32)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
const uint8_t *s;
#ifndef FMT_RGB24
-static void glue(rgb24_to_, RGB_NAME)(AVPicture *dst, AVPicture *src,
+static void glue(rgb24_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
const uint8_t *s;
}
}
-static void glue(RGB_NAME, _to_rgb24)(AVPicture *dst, AVPicture *src,
+static void glue(RGB_NAME, _to_rgb24)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
const uint8_t *s;
#ifdef FMT_RGB24
-static void yuv444p_to_rgb24(AVPicture *dst, AVPicture *src,
+static void yuv444p_to_rgb24(AVPicture *dst, const AVPicture *src,
int width, int height)
{
- uint8_t *y1_ptr, *cb_ptr, *cr_ptr, *d, *d1;
+ const uint8_t *y1_ptr, *cb_ptr, *cr_ptr;
+ uint8_t *d, *d1;
int w, y, cb, cr, r_add, g_add, b_add;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
unsigned int r, g, b;
}
}
-static void yuvj444p_to_rgb24(AVPicture *dst, AVPicture *src,
+static void yuvj444p_to_rgb24(AVPicture *dst, const AVPicture *src,
int width, int height)
{
- uint8_t *y1_ptr, *cb_ptr, *cr_ptr, *d, *d1;
+ const uint8_t *y1_ptr, *cb_ptr, *cr_ptr;
+ uint8_t *d, *d1;
int w, y, cb, cr, r_add, g_add, b_add;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
unsigned int r, g, b;
}
}
-static void rgb24_to_yuv444p(AVPicture *dst, AVPicture *src,
+static void rgb24_to_yuv444p(AVPicture *dst, const AVPicture *src,
int width, int height)
{
int src_wrap, x, y;
}
}
-static void rgb24_to_yuvj420p(AVPicture *dst, AVPicture *src,
+static void rgb24_to_yuvj420p(AVPicture *dst, const AVPicture *src,
int width, int height)
{
int wrap, wrap3, width2;
}
}
-static void rgb24_to_yuvj444p(AVPicture *dst, AVPicture *src,
+static void rgb24_to_yuvj444p(AVPicture *dst, const AVPicture *src,
int width, int height)
{
int src_wrap, x, y;
#if defined(FMT_RGB24) || defined(FMT_RGBA32)
-static void glue(RGB_NAME, _to_pal8)(AVPicture *dst, AVPicture *src,
+static void glue(RGB_NAME, _to_pal8)(AVPicture *dst, const AVPicture *src,
int width, int height)
{
const unsigned char *p;
#endif /* defined(FMT_RGB24) || defined(FMT_RGBA32) */
+#ifdef RGBA_IN
+
+static int glue(get_alpha_info_, RGB_NAME)(const AVPicture *src,
+ int width, int height)
+{
+ const unsigned char *p;
+ int src_wrap, ret, x, y;
+ unsigned int r, g, b, a;
+
+ p = src->data[0];
+ src_wrap = src->linesize[0] - BPP * width;
+ ret = 0;
+ for(y=0;y<height;y++) {
+ for(x=0;x<width;x++) {
+ RGBA_IN(r, g, b, a, p);
+ if (a == 0x00) {
+ ret |= FF_ALPHA_TRANSP;
+ } else if (a != 0xff) {
+ ret |= FF_ALPHA_SEMI_TRANSP;
+ }
+ p += BPP;
+ }
+ p += src_wrap;
+ }
+ return ret;
+}
+
+#endif /* RGBA_IN */
+
#undef RGB_IN
#undef RGBA_IN
#undef RGB_OUT