[FFmpeg-devel] [PATCH 1/7] Thin rgb2rgb a little part 1 of many
Måns Rullgård
mans
Wed Jan 19 01:49:40 CET 2011
Luca Barbato <lu_zero at gentoo.org> writes:
> ---
> libswscale/Makefile | 2 +-
> libswscale/rgb2rgb.c | 66 ---------------------------------------
> libswscale/swscale_functions.c | 67 ++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 68 insertions(+), 67 deletions(-)
> create mode 100644 libswscale/swscale_functions.c
>
> diff --git a/libswscale/Makefile b/libswscale/Makefile
> index 8c5c4b9..7a3e95c 100644
> --- a/libswscale/Makefile
> +++ b/libswscale/Makefile
> @@ -5,7 +5,7 @@ FFLIBS = avutil
>
> HEADERS = swscale.h
>
> -OBJS = options.o rgb2rgb.o swscale.o utils.o yuv2rgb.o
> +OBJS = options.o rgb2rgb.o swscale.o utils.o yuv2rgb.o swscale_functions.o
>
> OBJS-$(ARCH_BFIN) += bfin/internal_bfin.o \
> bfin/swscale_bfin.o \
> diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
> index 7226853..059bdab 100644
> --- a/libswscale/rgb2rgb.c
> +++ b/libswscale/rgb2rgb.c
> @@ -32,72 +32,6 @@
>
> #define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
>
> -void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
> -void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
> -void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
> -void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
[...]
> diff --git a/libswscale/swscale_functions.c b/libswscale/swscale_functions.c
> new file mode 100644
> index 0000000..0ebfa7c
> --- /dev/null
> +++ b/libswscale/swscale_functions.c
> @@ -0,0 +1,67 @@
> +#include <inttypes.h>
stdint.h is enough here.
> +void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
> +void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
> +void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
> +void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
Are you planning to get rid of these entirely later on? Any given
scaler context should only at most two functions (when an intermediate
format is used), and these it seems natural to put pointers to those
in the context struct rather than globally.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list