00001
00032 #ifndef LL_PATCH_DCT_H
00033 #define LL_PATCH_DCT_H
00034
00035 class LLVector3;
00036
00037
00038 const U8 ZERO_CODE = 0x0;
00039 const U8 ZERO_EOB = 0x2;
00040 const U8 POSITIVE_VALUE = 0x6;
00041 const U8 NEGATIVE_VALUE = 0x7;
00042
00043 const S8 NORMAL_PATCH_SIZE = 16;
00044 const S8 LARGE_PATCH_SIZE = 32;
00045
00046 const U8 END_OF_PATCHES = 97;
00047
00048 #define _PATCH_SIZE_16_AND_32_ONLY
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 class LLGroupHeader
00059 {
00060 public:
00061 U16 stride;
00062 U8 patch_size;
00063 U8 layer_type;
00064 };
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 class LLPatchHeader
00076 {
00077 public:
00078 F32 dc_offset;
00079 U16 range;
00080 U8 quant_wbits;
00081 U16 patchids;
00082 };
00083
00084
00085 void init_patch_compressor(S32 patch_size, S32 patch_stride, S32 layer_type);
00086 void prescan_patch(F32 *patch, LLPatchHeader *php, F32 &zmax, F32 &zmin);
00087 void compress_patch(F32 *patch, S32 *cpatch, LLPatchHeader *php, S32 prequant);
00088 void get_patch_group_header(LLGroupHeader *gopp);
00089
00090
00091 void set_group_of_patch_header(LLGroupHeader *gopp);
00092 void init_patch_decompressor(S32 size);
00093 void decompress_patch(F32 *patch, S32 *cpatch, LLPatchHeader *ph);
00094 void decompress_patchv(LLVector3 *v, S32 *cpatch, LLPatchHeader *ph);
00095
00096 #endif