transferIDCT.c
上传用户:tuheem
上传日期:2007-05-01
资源大小:21889k
文件大小:1k
- #include "portab.h"
- void transferIDCT_add(int16_t *sourceS16, uint8_t *destU8, int stride) {
- int x, y;
- stride -= 8;
- for (y=0; y<8; y++) {
- for (x=0; x<8; x++) {
- #define SUM16 (*(destU8) + *(sourceS16))
- if (SUM16 > 255) *(destU8) = 255;
- else if (SUM16 < 0) *(destU8) = 0;
- else *(destU8) = SUM16;
- sourceS16++;
- destU8++;
- }
- destU8 += stride;
- }
- }
- void transferIDCT_copy(int16_t *sourceS16, uint8_t *destU8, int stride) {
- int x, y;
- stride -= 8;
- for (y=0; y<8; y++) {
- for (x=0; x<8; x++) {
- if (*(sourceS16) > 255) *(destU8) = 255;
- else if (*(sourceS16) < 0) *(destU8) = 0;
- else *(destU8) = (unsigned char) *(sourceS16);
- sourceS16++;
- destU8++;
- }
- destU8 += stride;
- }
- }