Diff for /np2/common/resize.c between versions 1.1 and 1.2

version 1.1, 2003/11/21 06:51:10 version 1.2, 2005/02/07 14:46:08
Line 45  typedef struct { Line 45  typedef struct {
   
 // ---- convert sub  // ---- convert sub
   
 typedef void (*FNCNV)(RSZHDL hdl, BYTE *dst, const BYTE *src);  typedef void (*FNCNV)(RSZHDL hdl, UINT8 *dst, const UINT8 *src);
   
 #if defined(RESIZE_FASTCOPY) || defined(RESIZE_BILINEAR)  #if defined(RESIZE_FASTCOPY) || defined(RESIZE_BILINEAR)
 static void cc16by24(RSZHDL hdl, BYTE *dst, const BYTE *src) {  static void cc16by24(RSZHDL hdl, UINT8 *dst, const UINT8 *src) {
   
         UINT    width;          UINT    width;
         UINT    col;          UINT    col;
Line 64  static void cc16by24(RSZHDL hdl, BYTE *d Line 64  static void cc16by24(RSZHDL hdl, BYTE *d
         } while(--width);          } while(--width);
 }  }
   
 static void cc24by16(RSZHDL hdl, BYTE *dst, const BYTE *src) {  static void cc24by16(RSZHDL hdl, UINT8 *dst, const UINT8 *src) {
   
         UINT    width;          UINT    width;
         UINT    col;          UINT    col;
Line 74  static void cc24by16(RSZHDL hdl, BYTE *d Line 74  static void cc24by16(RSZHDL hdl, BYTE *d
         do {          do {
                 col = *(UINT16 *)src;                  col = *(UINT16 *)src;
                 tmp = (col >> B16SFT) & ((1 << B16BIT) - 1);                  tmp = (col >> B16SFT) & ((1 << B16BIT) - 1);
                 dst[0] = (BYTE)((tmp << (8 - B16BIT)) + (tmp >> (B16BIT * 2 - 8)));                  dst[0] = (UINT8)((tmp << (8 - B16BIT)) + (tmp >> (B16BIT * 2 - 8)));
                 tmp = (col >> G16SFT) & ((1 << G16BIT) - 1);                  tmp = (col >> G16SFT) & ((1 << G16BIT) - 1);
                 dst[1] = (BYTE)((tmp << (8 - G16BIT)) + (tmp >> (G16BIT * 2 - 8)));                  dst[1] = (UINT8)((tmp << (8 - G16BIT)) + (tmp >> (G16BIT * 2 - 8)));
                 tmp = (col >> R16SFT) & ((1 << R16BIT) - 1);                  tmp = (col >> R16SFT) & ((1 << R16BIT) - 1);
                 dst[2] = (BYTE)((tmp << (8 - R16BIT)) + (tmp >> (R16BIT * 2 - 8)));                  dst[2] = (UINT8)((tmp << (8 - R16BIT)) + (tmp >> (R16BIT * 2 - 8)));
                 src += 2;                  src += 2;
                 dst += 3;                  dst += 3;
         } while(--width);          } while(--width);
Line 86  static void cc24by16(RSZHDL hdl, BYTE *d Line 86  static void cc24by16(RSZHDL hdl, BYTE *d
 #endif  #endif
   
 #if defined(RESIZE_FASTCOPY)  #if defined(RESIZE_FASTCOPY)
 static void cc8(RSZHDL hdl, BYTE *dst, const BYTE *src) {  static void cc8(RSZHDL hdl, UINT8 *dst, const UINT8 *src) {
   
         CopyMemory(dst, src, hdl->width);          CopyMemory(dst, src, hdl->width);
 }  }
   
 static void cc16(RSZHDL hdl, BYTE *dst, const BYTE *src) {  static void cc16(RSZHDL hdl, UINT8 *dst, const UINT8 *src) {
   
         CopyMemory(dst, src, hdl->width * 2);          CopyMemory(dst, src, hdl->width * 2);
 }  }
   
 static void cc24(RSZHDL hdl, BYTE *dst, const BYTE *src) {  static void cc24(RSZHDL hdl, UINT8 *dst, const UINT8 *src) {
   
         CopyMemory(dst, src, hdl->width * 3);          CopyMemory(dst, src, hdl->width * 3);
 }  }
Line 109  static const FNCNV cnvcpy[RSZFNMAX] = {c Line 109  static const FNCNV cnvcpy[RSZFNMAX] = {c
 // ----  // ----
   
 #if defined(RESIZE_FASTCOPY)  #if defined(RESIZE_FASTCOPY)
 static void fastcopyfunc(RSZHDL hdl, UINT type, BYTE *dst, int dalign,  static void fastcopyfunc(RSZHDL hdl, UINT type, UINT8 *dst, int dalign,
                                                                                                 const BYTE *src, int salign) {                                                                                          const UINT8 *src, int salign) {
   
         UINT    height;          UINT    height;
         FNCNV   cnv;          FNCNV   cnv;
Line 145  static RSZHDL fastcopy(int width, int he Line 145  static RSZHDL fastcopy(int width, int he
 // ---- area average  // ---- area average
   
 #if defined(RESIZE_AREAAVG)  #if defined(RESIZE_AREAAVG)
 static void aamix8(RSZEX hdl, const BYTE *src, int volume) {  static void aamix8(RSZEX hdl, const UINT8 *src, int volume) {
   
         UINT    *buf;          UINT    *buf;
         UINT    posx;          UINT    posx;
Line 174  static void aamix8(RSZEX hdl, const BYTE Line 174  static void aamix8(RSZEX hdl, const BYTE
         }          }
 }  }
   
 static void aamix16(RSZEX hdl, const BYTE *src, int volume) {  static void aamix16(RSZEX hdl, const UINT8 *src, int volume) {
   
         UINT    *buf;          UINT    *buf;
         UINT    posx;          UINT    posx;
Line 213  static void aamix16(RSZEX hdl, const BYT Line 213  static void aamix16(RSZEX hdl, const BYT
         }          }
 }  }
   
 static void aamix24(RSZEX hdl, const BYTE *src, int volume) {  static void aamix24(RSZEX hdl, const UINT8 *src, int volume) {
   
         UINT    *buf;          UINT    *buf;
         UINT    posx;          UINT    posx;
Line 246  static void aamix24(RSZEX hdl, const BYT Line 246  static void aamix24(RSZEX hdl, const BYT
         }          }
 }  }
   
 static void aaout8(RSZEX hdl, BYTE *dst) {  static void aaout8(RSZEX hdl, UINT8 *dst) {
   
 const UINT      *buf;  const UINT      *buf;
         int             rem;          int             rem;
Line 254  const UINT *buf; Line 254  const UINT *buf;
         buf = hdl->buf;          buf = hdl->buf;
         rem = hdl->width;          rem = hdl->width;
         do {          do {
                 *dst++ = (BYTE)((*buf++) >> (MXBITS + MYBITS));                  *dst++ = (UINT8)((*buf++) >> (MXBITS + MYBITS));
         } while(--rem);          } while(--rem);
 }  }
   
 static void aaout16(RSZEX hdl, BYTE *dst) {  static void aaout16(RSZEX hdl, UINT8 *dst) {
   
 const UINT      *buf;  const UINT      *buf;
         int             rem;          int             rem;
Line 283  const UINT *buf; Line 283  const UINT *buf;
         } while(--rem);          } while(--rem);
 }  }
   
 static void aaout24(RSZEX hdl, BYTE *dst) {  static void aaout24(RSZEX hdl, UINT8 *dst) {
   
 const UINT      *buf;  const UINT      *buf;
         int             rem;          int             rem;
Line 291  const UINT *buf; Line 291  const UINT *buf;
         buf = hdl->buf;          buf = hdl->buf;
         rem = hdl->width * 3;          rem = hdl->width * 3;
         do {          do {
                 *dst++ = (BYTE)((*buf++) >> (MXBITS + MYBITS));                  *dst++ = (UINT8)((*buf++) >> (MXBITS + MYBITS));
         } while(--rem);          } while(--rem);
 }  }
   
 static void aaout16by24(RSZEX hdl, BYTE *dst) {  static void aaout16by24(RSZEX hdl, UINT8 *dst) {
   
 const UINT      *buf;  const UINT      *buf;
         int             rem;          int             rem;
Line 316  const UINT *buf; Line 316  const UINT *buf;
         } while(--rem);          } while(--rem);
 }  }
   
 static void aaout24by16(RSZEX hdl, BYTE *dst) {  static void aaout24by16(RSZEX hdl, UINT8 *dst) {
   
 const UINT      *buf;  const UINT      *buf;
         int             rem;          int             rem;
Line 324  const UINT *buf; Line 324  const UINT *buf;
         buf = hdl->buf;          buf = hdl->buf;
         rem = hdl->width;          rem = hdl->width;
         do {          do {
                 dst[0] = (BYTE)(buf[0] >> (MXBITS + MYBITS - 8 + B16BIT));                  dst[0] = (UINT8)(buf[0] >> (MXBITS + MYBITS - 8 + B16BIT));
                 dst[1] = (BYTE)(buf[1] >> (MXBITS + MYBITS - 8 + G16BIT));                  dst[1] = (UINT8)(buf[1] >> (MXBITS + MYBITS - 8 + G16BIT));
                 dst[2] = (BYTE)(buf[2] >> (MXBITS + MYBITS - 8 + R16BIT));                  dst[2] = (UINT8)(buf[2] >> (MXBITS + MYBITS - 8 + R16BIT));
                 dst += 3;                  dst += 3;
                 buf += 3;                  buf += 3;
         } while(--rem);          } while(--rem);
 }  }
   
 typedef void (*AAMIX)(RSZEX hdl, const BYTE *src, int volume);  typedef void (*AAMIX)(RSZEX hdl, const UINT8 *src, int volume);
 typedef void (*AAOUT)(RSZEX hdl, BYTE *dst);  typedef void (*AAOUT)(RSZEX hdl, UINT8 *dst);
   
 static const AAMIX fnaamix[RSZFNMAX] = {aamix8, aamix16, aamix24,  static const AAMIX fnaamix[RSZFNMAX] = {aamix8, aamix16, aamix24,
                                                                                 aamix24, aamix16};                                                                                  aamix24, aamix16};
 static const AAOUT fnaaout[RSZFNMAX] = {aaout8, aaout16, aaout24,  static const AAOUT fnaaout[RSZFNMAX] = {aaout8, aaout16, aaout24,
                                                                                 aaout16by24, aaout24by16};                                                                                  aaout16by24, aaout24by16};
   
 static void areaavefunc(RSZEX hdl, UINT type, BYTE *dst, int dalign,  static void areaavefunc(RSZEX hdl, UINT type, UINT8 *dst, int dalign,
                                                                                                 const BYTE *src, int salign) {                                                                                          const UINT8 *src, int salign) {
   
         AAMIX   aamix;          AAMIX   aamix;
         AAOUT   aaout;          AAOUT   aaout;

Removed from v.1.1  
changed lines
  Added in v.1.2


RetroPC.NET-CVS <cvs@retropc.net>