00001 00018 #ifndef _BLOCK_H_ 00019 #define _BLOCK_H_ 00020 00021 #include "global.h" 00022 #include "transform8x8.h" 00023 00024 static const byte QP_SCALE_CR[52]= 00025 { 00026 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11, 00027 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27, 00028 28,29,29,30,31,32,32,33,34,34,35,35,36,36,37,37, 00029 37,38,38,38,39,39,39,39 00030 00031 }; 00032 00034 static const unsigned char subblk_offset_x[3][8][4] = 00035 { 00036 { 00037 {0, 4, 0, 4}, 00038 {0, 4, 0, 4}, 00039 {0, 0, 0, 0}, 00040 {0, 0, 0, 0}, 00041 {0, 0, 0, 0}, 00042 {0, 0, 0, 0}, 00043 {0, 0, 0, 0}, 00044 {0, 0, 0, 0}, 00045 }, 00046 { 00047 {0, 4, 0, 4}, 00048 {0, 4, 0, 4}, 00049 {0, 4, 0, 4}, 00050 {0, 4, 0, 4}, 00051 {0, 0, 0, 0}, 00052 {0, 0, 0, 0}, 00053 {0, 0, 0, 0}, 00054 {0, 0, 0, 0}, 00055 }, 00056 { 00057 {0, 4, 0, 4}, 00058 {8,12, 8,12}, 00059 {0, 4, 0, 4}, 00060 {8,12, 8,12}, 00061 {0, 4, 0, 4}, 00062 {8,12, 8,12}, 00063 {0, 4, 0, 4}, 00064 {8,12, 8,12} 00065 } 00066 }; 00067 00068 00069 static const unsigned char subblk_offset_y[3][8][4] = 00070 { 00071 { 00072 {0, 0, 4, 4}, 00073 {0, 0, 4, 4}, 00074 {0, 0, 0, 0}, 00075 {0, 0, 0, 0}, 00076 {0, 0, 0, 0}, 00077 {0, 0, 0, 0}, 00078 {0, 0, 0, 0}, 00079 {0, 0, 0, 0} 00080 }, 00081 { 00082 {0, 0, 4, 4}, 00083 {8, 8,12,12}, 00084 {0, 0, 4, 4}, 00085 {8, 8,12,12}, 00086 {0, 0, 0, 0}, 00087 {0, 0, 0, 0}, 00088 {0, 0, 0, 0}, 00089 {0, 0, 0, 0} 00090 }, 00091 { 00092 {0, 0, 4, 4}, 00093 {0, 0, 4, 4}, 00094 {8, 8,12,12}, 00095 {8, 8,12,12}, 00096 {0, 0, 4, 4}, 00097 {0, 0, 4, 4}, 00098 {8, 8,12,12}, 00099 {8, 8,12,12} 00100 } 00101 }; 00102 00103 static const byte decode_block_scan[16] = {0, 1, 4, 5, 2, 3, 6, 7, 8, 9, 12, 13, 10, 11, 14, 15}; 00104 00105 extern void iMBtrans4x4(Macroblock *currMB, ColorPlane pl, int smb); 00106 extern void iMBtrans8x8(Macroblock *currMB, ColorPlane pl); 00107 00108 extern void itrans_sp_cr(Macroblock *currMB, int uv); 00109 00110 extern void intrapred_chroma (Macroblock *currMB, int uv); 00111 00112 extern void Inv_Residual_trans_4x4(Macroblock *currMB, ColorPlane pl, int ioff, int joff); 00113 extern void Inv_Residual_trans_8x8(Macroblock *currMB, ColorPlane pl, int ioff,int joff); 00114 00115 extern void itrans4x4 (Macroblock *currMB, ColorPlane pl, int ioff, int joff); 00116 extern void itrans4x4_ls(Macroblock *currMB, ColorPlane pl, int ioff, int joff); 00117 extern void itrans_sp (Macroblock *currMB, ColorPlane pl, int ioff, int joff); 00118 extern int intrapred (Macroblock *currMB, ColorPlane pl, int ioff,int joff,int i4,int j4); 00119 extern void itrans_2 (Macroblock *currMB, ColorPlane pl); 00120 extern void iTransform (Macroblock *currMB, ColorPlane pl, int need_4x4_transform, int smb); 00121 00122 extern void copy_image_data (imgpel **imgBuf1, imgpel **imgBuf2, int off1, int off2, int width, int height); 00123 extern void copy_image_data_16x16 (imgpel **imgBuf1, imgpel **imgBuf2, int off1, int off2); 00124 extern void copy_image_data_8x8 (imgpel **imgBuf1, imgpel **imgBuf2, int off1, int off2); 00125 extern void copy_image_data_4x4 (imgpel **imgBuf1, imgpel **imgBuf2, int off1, int off2); 00126 00127 #endif 00128