diff options
Diffstat (limited to 'system/pdp_imageproc_mmx.c')
-rw-r--r-- | system/pdp_imageproc_mmx.c | 30 |
1 files changed, 30 insertions, 0 deletions
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) { |