From 27d1e03d7bdf8fcfe7292c06e40bc3e2fca9158e Mon Sep 17 00:00:00 2001 From: Denis Oliver Kropp Date: Tue, 19 Oct 2010 15:56:15 +0200 Subject: pluggit --- src/stretch_up_down_16.h | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/stretch_up_down_16.h (limited to 'src/stretch_up_down_16.h') diff --git a/src/stretch_up_down_16.h b/src/stretch_up_down_16.h new file mode 100644 index 0000000..103dfc3 --- /dev/null +++ b/src/stretch_up_down_16.h @@ -0,0 +1,68 @@ +#define STRETCH_HVX_N_H "stretch_hvx_16.h" +#define uN u16 + +/**********************************************************************************************************************/ +/* Upscaling */ + +#define POINT_0 0 +#define LINE_0 0 +#define MINUS_1 1 +#define POINT_TO_RATIO(p,ps) ( ((p) & 0x3ffff) >> (18-SHIFT_L6) ) +#define LINE_TO_RATIO(l,ls) ( ((l) & 0x3ffff) >> (18-SHIFT_L5) ) + +#define POINT_L(p,ps) ( (((p)) >> 18) ) +#define POINT_R(p,ps) ( (((p)) >> 18) + 1 ) + +#define LINE_T(l,ls) ( (((l)) >> 18) ) +#define LINE_B(l,ls) ( (((l)) >> 18) + 1 ) + +#define UPDOWN 1 +#include "stretch_hvx_N.h" +#undef UPDOWN + +#undef POINT_0 +#undef LINE_0 +#undef MINUS_1 +#undef POINT_TO_RATIO +#undef LINE_TO_RATIO +#undef POINT_L +#undef POINT_R +#undef LINE_T +#undef LINE_B + +/**********************************************************************************************************************/ +/* Downscaling */ + +#define POINT_0 hfraq +#define LINE_0 vfraq +#define MINUS_1 0 +#define POINT_TO_RATIO(p,ps) ( (((((p)) & 0x3ffff) ? : 0x40000) << SHIFT_L6) / (ps) ) +#define LINE_TO_RATIO(l,ls) ( (((((l)) & 0x3ffff) ? : 0x40000) << SHIFT_L5) / (ls) ) + +#define POINT_L(p,ps) ( (((p)-1) >> 18) - 1 ) +#define POINT_R(p,ps) ( (((p)-1) >> 18) ) + +#define LINE_T(l,ls) ( (((l)-1) >> 18) - 1 ) +#define LINE_B(l,ls) ( (((l)-1) >> 18) ) + +#define UPDOWN 0 +#include "stretch_hvx_N.h" +#undef UPDOWN + +#undef POINT_0 +#undef LINE_0 +#undef MINUS_1 +#undef POINT_TO_RATIO +#undef LINE_TO_RATIO +#undef POINT_L +#undef POINT_R +#undef LINE_T +#undef LINE_B + +/**********************************************************************************************************************/ + +#undef STRETCH_HVX_N_H +#undef uN + +//#include "stretch_up_down_table.h" + -- cgit