>From be1f61e61ad9921f32855ff207b5b710ad595554 Mon Sep 17 00:00:00 2001 From: Keiji Costantini Date: Wed, 13 Aug 2008 17:58:00 +0200 Subject: [PATCH] created initialize_converters - initializes convert_to_y (for now) --- swscale_C.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/swscale_C.c b/swscale_C.c index 6751f49..79dc00d 100644 --- a/swscale_C.c +++ b/swscale_C.c @@ -740,6 +740,59 @@ inline static void hcscale_C(uint16_t *dst, long dstWidth, uint8_t *src1, uint8_ } } +/** + * Initializes context converter pointers. + */ +static inline void *initialize_converters(SwsContext *c) +{ + + if (c->srcFormat==PIX_FMT_YUYV422 || c->srcFormat==PIX_FMT_GRAY16BE) + { + c->convert_to_y=yuy2ToY_C; + } + else if (c->srcFormat==PIX_FMT_UYVY422 || c->srcFormat==PIX_FMT_GRAY16LE) + { + c->convert_to_y=uyvyToY_C; + } + else if (c->srcFormat==PIX_FMT_RGB32) + { + c->convert_to_y=bgr32ToY_C; + } + else if (c->srcFormat==PIX_FMT_BGR24) + { + c->convert_to_y=bgr24ToY_C; + } + else if (c->srcFormat==PIX_FMT_BGR565) + { + c->convert_to_y=bgr16ToY_C; + } + else if (c->srcFormat==PIX_FMT_BGR555) + { + c->convert_to_y=bgr15ToY_C; + } + else if (c->srcFormat==PIX_FMT_BGR32) + { + c->convert_to_y=rgb32ToY_C; + } + else if (c->srcFormat==PIX_FMT_RGB24) + { + c->convert_to_y=rgb24ToY_C; + } + else if (c->srcFormat==PIX_FMT_RGB565) + { + c->convert_to_y=rgb16ToY_C; + } + else if (c->srcFormat==PIX_FMT_RGB555) + { + c->convert_to_y=rgb15ToY_C; + } + else if (c->srcFormat==PIX_FMT_RGB8 || c->srcFormat==PIX_FMT_BGR8 || c->srcFormat==PIX_FMT_PAL8 || c->srcFormat==PIX_FMT_BGR4_BYTE || c->srcFormat==PIX_FMT_RGB4_BYTE) + { + c->convert_to_y=palToY_C; + } +} + + int swScale_C(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]){ -- 1.5.6.4