ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Video-Capture-V4l/RTjpeg/codec/modules/RTb2s_raw.c
Revision: 1.1
Committed: Fri May 5 20:21:52 2000 UTC (26 years, 5 months ago) by pcg
Content type: text/plain
Branch: MAIN
CVS Tags: rel-0_9, rel-0_902, HEAD
Log Message:
Initial check-in

File Contents

# User Rev Content
1 pcg 1.1 int RTjpeg_b2s(s16 *data, s8 *strm, u8 bt8)
2     {
3     int ci=1, co=1, tmp;
4    
5     (u8)strm[0]=(u8)(data[RTjpeg_ZZ[0]]>254) ? 254:((data[RTjpeg_ZZ[0]]<0)?0:data[RTjpeg_ZZ[0]]);
6    
7     for(ci=1; ci<=63; ci++)
8     if(data[RTjpeg_ZZ[ci]]>0)
9     {
10     strm[co++]=(s8)(data[RTjpeg_ZZ[ci]]>127)?127:data[RTjpeg_ZZ[ci]];
11     } else
12     {
13     strm[co++]=(s8)(data[RTjpeg_ZZ[ci]]<-128)?-128:data[RTjpeg_ZZ[ci]];
14     }
15     /*
16     for(; ci<64; ci++)
17     if(data[RTjpeg_ZZ[ci]]>0)
18     {
19     strm[co++]=(s8)(data[RTjpeg_ZZ[ci]]>63)?63:data[RTjpeg_ZZ[ci]];
20     } else if(data[RTjpeg_ZZ[ci]]<0)
21     {
22     strm[co++]=(s8)(data[RTjpeg_ZZ[ci]]<-64)?-64:data[RTjpeg_ZZ[ci]];
23     } else
24     {
25     tmp=ci;
26     do
27     {
28     ci++;
29     } while((ci<64)&&(data[RTjpeg_ZZ[ci]]==0));
30     strm[co++]=(s8)(63+(ci-tmp));
31     ci--;
32     }
33     */
34     return (int)co;
35     }