diff options
author | Tom Schouten <doelie@users.sourceforge.net> | 2003-02-28 09:48:54 +0000 |
---|---|---|
committer | Tom Schouten <doelie@users.sourceforge.net> | 2003-02-28 09:48:54 +0000 |
commit | 8227dc75b8e236f7f9629d1bc49fae0addee3def (patch) | |
tree | 13f2aec426201ee87dd0cbda0860082315dfa1ae /system/pdp_resample.c | |
parent | a0aef64af84622e8d6d02c7714fb82178dea0286 (diff) |
pdp config
svn path=/trunk/externals/pdp/; revision=440
Diffstat (limited to 'system/pdp_resample.c')
-rw-r--r-- | system/pdp_resample.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/system/pdp_resample.c b/system/pdp_resample.c index 12bc639..16a34df 100644 --- a/system/pdp_resample.c +++ b/system/pdp_resample.c @@ -137,3 +137,34 @@ void pdp_resample_zoom_tiled_bilin(s16 *src_image, s16 *dst_image, s32 w, s32 h, } */ + + +void pdp_resample_halve(s16 *src_image, s16 *dst_image, s32 src_w, s32 src_h) +{ + + int dst_x,dst_y; + int src_x = 0; + int src_y = 0; + int dst_w = src_w >> 1; + int dst_h = src_h >> 1; + s32 tmp1,tmp2,tmp3,tmp4; + + for(dst_y = 0; dst_y < dst_h * dst_w; dst_y += dst_w){ + for (dst_x = 0; dst_x < dst_w; dst_x++){ + + tmp1 = (s32)src_image[src_y + src_x]; + tmp2 = (s32)src_image[src_y + src_x + 1]; + tmp3 = (s32)src_image[src_y + src_x + src_w]; + tmp4 = (s32)src_image[src_y + src_x + src_w + 1]; + + tmp1 += tmp2; + tmp3 += tmp4; + + src_x += 2; + + dst_image[dst_x+dst_y] = (s16)((tmp1 + tmp3)>>2); + } + src_y += src_w << 1; + src_x = 0; + } +} |