From 8227dc75b8e236f7f9629d1bc49fae0addee3def Mon Sep 17 00:00:00 2001 From: Tom Schouten Date: Fri, 28 Feb 2003 09:48:54 +0000 Subject: pdp config svn path=/trunk/externals/pdp/; revision=440 --- system/Makefile | 22 ++++++++++++++++------ system/pdp.c | 37 ++++++++++++++++++++++++++++++++----- system/pdp_imageproc_mmx.c | 30 ++++++++++++++++++++++++++++++ system/pdp_imageproc_portable.c | 18 ++++++++++++++++++ system/pdp_packet.c | 10 +++++++--- system/pdp_resample.c | 31 +++++++++++++++++++++++++++++++ 6 files changed, 134 insertions(+), 14 deletions(-) (limited to 'system') diff --git a/system/Makefile b/system/Makefile index acdb944..227e72e 100644 --- a/system/Makefile +++ b/system/Makefile @@ -1,20 +1,30 @@ -target: all_objects + +OBJECTS = pdp.o pdp_ut.o pdp_packet.o pdp_type.o pdp_queue.o pdp_comm.o \ + pdp_control.o pdp_llconv.o pdp_resample.o + +OBJECTS_MMX = pdp_imageproc_mmx.o pdp_llconv_mmx.o +OBJECTS_PORTABLE = pdp_imageproc_portable.o pdp_llconv_portable.o + + include ../Makefile.config -include Makefile.$(PDP_TARGET) +all: $(PDP_TARGET) common_objects -OBJECTS = pdp.o pdp_ut.o pdp_packet.o pdp_type.o pdp_queue.o pdp_comm.o \ - pdp_control.o pdp_llconv.o pdp_resample.o +linux_mmx: $(OBJECTS_MMX) + make -C mmx + +linux: $(OBJECTS_PORTABLE) + +darwin: $(OBJECTS_PORTABLE) pdp_main_clean: rm -f pdp.o -all_objects: pdp_main_clean $(OBJECTS) platform_targets +common_objects: pdp_main_clean $(OBJECTS) clean: rm -f *~ rm -f *.o make -C mmx clean - diff --git a/system/pdp.c b/system/pdp.c index e3c311b..5475c8d 100644 --- a/system/pdp.c +++ b/system/pdp.c @@ -18,7 +18,7 @@ * */ - +#include "pdp_config.h" #include "pdp.h" #include @@ -63,8 +63,13 @@ void pdp_scope_setup(void); void pdp_scale_setup(void); void pdp_zoom_setup(void); void pdp_scan_setup(void); +void pdp_scanxy_setup(void); void pdp_sdl_setup(void); void pdp_cheby_setup(void); +void pdp_grey2mask_setup(void); +void pdp_constant_setup(void); +void pdp_slice_cut_setup(void); +void pdp_slice_glue_setup(void); @@ -92,9 +97,6 @@ void pdp_setup(void){ pdp_mul_setup(); pdp_mix_setup(); pdp_randmix_setup(); - pdp_xv_setup(); - pdp_qt_setup(); - pdp_v4l_setup(); pdp_reg_setup(); pdp_conv_setup(); pdp_bq_setup(); @@ -112,9 +114,34 @@ void pdp_setup(void){ pdp_scale_setup(); pdp_zoom_setup(); pdp_scan_setup(); - pdp_sdl_setup(); + pdp_scanxy_setup(); pdp_cheby_setup(); + pdp_grey2mask_setup(); + pdp_constant_setup(); + + + /* experimental stuff */ + pdp_slice_cut_setup(); + pdp_slice_glue_setup(); + + + /* optional modules */ + +#ifdef HAVE_PDP_QT + pdp_qt_setup(); +#endif + +#ifdef HAVE_PDP_XV + pdp_xv_setup(); +#endif +#ifdef HAVE_PDP_SDL + pdp_sdl_setup(); +#endif + +#ifdef HAVE_PDP_V4L + pdp_v4l_setup(); +#endif } diff --git a/system/pdp_imageproc_mmx.c b/system/pdp_imageproc_mmx.c index 4c347c6..fde790f 100644 --- a/system/pdp_imageproc_mmx.c +++ b/system/pdp_imageproc_mmx.c @@ -26,6 +26,36 @@ #include "pdp_imageproc.h" #include "m_pd.h" +/* round image dims to next multiple of 8 */ +u32 pdp_imageproc_legalwidth(int i) +{ + if (i>1024) return 1024; + if (i>0) return ((((i-1)>>3)+1)<<3); + return 8; + +} + +u32 pdp_imageproc_legalheight(int i) +{ + if (i>1024) return 1024; + if (i>0) return ((((i-1)>>3)+1)<<3); + return 8; +} +u32 pdp_imageproc_legalwidth_round_down(int i) +{ + if (i>1024) return 1024; + if (i>8) return ((i>>3)<<3); + return 8; + +} + +u32 pdp_imageproc_legalheight_round_down(int i) +{ + if (i>1024) return 1024; + if (i>8) return ((i>>3)<<3); + return 8; +} + // utility stuff inline static s16 float2fixed(float f) { diff --git a/system/pdp_imageproc_portable.c b/system/pdp_imageproc_portable.c index 6feddd3..86b91b8 100644 --- a/system/pdp_imageproc_portable.c +++ b/system/pdp_imageproc_portable.c @@ -24,6 +24,24 @@ #include #include "pdp_imageproc.h" +/* all image dims are legal */ +u32 pdp_imageproc_legalwidth(int i) +{ + if (i>1024) return 1024; + if (i>0) return i; + return 1; +} + +u32 pdp_imageproc_legalheight(int i) +{ + if (i>1024) return 1024; + if (i>0) return i; + return 1; +} +u32 pdp_imageproc_legalwidth_round_down(int i) {return pdp_imageproc_legalwidth(i);} +u32 pdp_imageproc_legalheight_round_down(int i) {return pdp_imageproc_legalheight(i);} + + // utility stuff inline static s32 float2fixed(float f) { diff --git a/system/pdp_packet.c b/system/pdp_packet.c index 0c0b2c2..894c443 100644 --- a/system/pdp_packet.c +++ b/system/pdp_packet.c @@ -80,10 +80,13 @@ pdp_packet_new(unsigned int datatype, unsigned int datasize /*without header*/) /* remark: if p->size >= totalsize we can give away the packet */ /* but that would lead to unefficient use if we have a lot of packets */ /* of different sizes */ - if ((p->users == 0) && (p->size == totalsize) && (p->type == datatype)){ + if ((p->users == 0) && (p->size == totalsize)){ //post("pdp_new_object: can reuse %d", i); - p->users = 1; - return i; + memset(p, 0, PDP_HEADER_SIZE); //initialize header to 0 + p->type = datatype; + p->size = totalsize; + p->users = 1; + return i; } else{ //post("pdp_new_object: can't reuse %d, (%d users)", i, p->users); @@ -96,6 +99,7 @@ pdp_packet_new(unsigned int datatype, unsigned int datasize /*without header*/) align = ((unsigned int)p) & (PDP_ALIGN - 1); if (align) post("pdp_new_object: warning data misaligned by %x", align); pdp_stack[i] = p; + memset(p, 0, PDP_HEADER_SIZE); //initialize header to 0 p->type = datatype; p->size = totalsize; p->users = 1; 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; + } +} -- cgit v1.2.1