00001
00019 #include "global.h"
00020
00021 #include "image.h"
00022 #include "mb_access.h"
00023 #include "elements.h"
00024 #include "transform8x8.h"
00025 #include "transform.h"
00026 #include "quant.h"
00027
00028
00029
00036 void itrans8x8(Macroblock *currMB,
00037 ColorPlane pl,
00038 int ioff,
00039 int joff)
00040 {
00041 ImageParameters *p_Img = currMB->p_Img;
00042 Slice *currSlice = currMB->p_Slice;
00043 int i,j;
00044
00045 imgpel **mpr = currSlice->mb_pred[pl];
00046 imgpel **mb_rec = currSlice->mb_rec[pl];
00047 int **m7 = currSlice->mb_rres[pl];
00048 int max_imgpel_value = p_Img->max_imgpel_value_comp[pl];
00049
00050 if (currMB->is_lossless == TRUE)
00051 {
00052 for( j = joff; j < joff + 8; j++)
00053 {
00054 for( i = ioff; i < ioff + 8; i++)
00055 mb_rec[j][i] = (imgpel) iClip1(max_imgpel_value, (m7[j][i] + (long)mpr[j][i]));
00056 }
00057 }
00058 else
00059 {
00060 inverse8x8(m7, m7, joff, ioff);
00061 for( j = joff; j < joff + 8; j++)
00062 {
00063 for( i = ioff; i < ioff + 8; i++)
00064
00065 mb_rec[j][i] = (imgpel) iClip1(max_imgpel_value, mpr[j][i] + rshift_rnd_sf(m7[j][i], DQ_BITS_8));
00066 }
00067 }
00068 }