00001
00002
00003
00004
00005
00006
00007 This program is free software; you can redistribute it and/or modify
00008 it under the terms of the GNU General Public License as published by
00009 the Free Software Foundation; either version 2 of the License, or
00010 (at your option) any later version.
00011
00012 This program is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015 GNU General Public License for more details.
00016
00017 You should have received a copy of the GNU General Public License
00018 along with this program; if not, write to the Free Software
00019 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020
00021 This file is a modified version of RTjpeg 0.1.2, (C) Justin Schoeman 1998
00022 */
00023
00024 #include <asm/types.h>
00025
00026
00027
00028
00029
00030 #ifdef USE_MMX
00031 #include "mmx.h"
00032 #endif
00033
00034 typedef unsigned char __u8;
00035 typedef signed char __s8;
00036 typedef unsigned short __u16;
00037 typedef signed short __s16;
00038 typedef unsigned long __u32;
00039 typedef signed long __s32;
00040 typedef unsigned long long __u64;
00041
00042 typedef struct
00043 {
00044 #ifndef MMX
00045 static __s32 RTjpeg_ws[64+31];
00046 #endif
00047 __u8 RTjpeg_alldata[2*64+4*64+4*64+4*64+4*64+32];
00048
00049 __s16 *RTjpeg_block;
00050 __s32 *RTjpeg_lqt;
00051 __s32 *RTjpeg_cqt;
00052 __u32 *RTjpeg_liqt;
00053 __u32 *RTjpeg_ciqt;
00054
00055 unsigned char RTjpeg_lb8;
00056 unsigned char RTjpeg_cb8;
00057 int RTjpeg_width, RTjpeg_height;
00058 int RTjpeg_Ywidth, RTjpeg_Cwidth;
00059 int RTjpeg_Ysize, RTjpeg_Csize;
00060
00061 __s16 *RTjpeg_old=NULL;
00062
00063 #ifdef USE_MMX
00064 mmx_t RTjpeg_lmask;
00065 mmx_t RTjpeg_cmask;
00066 #else
00067 __u16 RTjpeg_lmask;
00068 __u16 RTjpeg_cmask;
00069 #endif
00070 int RTjpeg_mtest=0;
00071
00072 unsigned long tbls[128];
00073 } rtjpeg_t;
00074
00075 extern void RTjpeg_init_Q(__u8 Q);
00076 extern void RTjpeg_init_compress(long unsigned int *buf, int width, int height, __u8 Q);
00077 extern void RTjpeg_init_decompress(long unsigned int *buf, int width, int height);
00078 extern int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp);
00079 extern int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp);
00080 extern void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp);
00081 extern void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp);
00082 extern int RTjpeg_compress8(__s8 *sp, unsigned char *bp);
00083 extern void RTjpeg_decompress8(__s8 *sp, __u8 *bp);
00084
00085 extern void RTjpeg_init_mcompress(void);
00086 extern int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask);
00087 extern int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask);
00088 extern int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask);
00089 extern void RTjpeg_set_test(int i);
00090
00091 extern void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb, int stride);
00092 extern void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb, int stride);
00093 extern void RTjpeg_yuvrgb8(__u8 *buf, __u8 *rgb, int stride);
00094 extern void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb, int stride);
00095 extern void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb, int stride);
00096 extern void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb, int stride);
00097
00098