transferIDCT.c
资源名称:VC++视频传输.rar [点击查看]
上传用户:hxb_1234
上传日期:2010-03-30
资源大小:8328k
文件大小:1k
源码类别:
VC书籍
开发平台:
Visual C++
- #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;
- }
- }