--- branches/dev-api-4/xvidcore/src/quant/quant_mpeg4.c 2003/06/02 11:47:30 1052 +++ branches/dev-api-4/xvidcore/src/quant/quant_mpeg4.c 2003/06/09 01:25:19 1053 @@ -44,7 +44,7 @@ #include "quant_mpeg4.h" #include "quant_matrix.h" -// function pointers +/* function pointers */ quant_intraFuncPtr quant4_intra; quant_intraFuncPtr dequant4_intra; dequant_interFuncPtr dequant4_inter; @@ -55,8 +55,10 @@ #define VM18Q 4 -// divide-by-multiply table -// need 17 bit shift (16 causes slight errors when q > 19) +/* + * divide-by-multiply table + * need 17 bit shift (16 causes slight errors when q > 19) + */ #define SCALEBITS 17 #define FIX(X) ((1UL << SCALEBITS) / (X) + 1) @@ -72,13 +74,12 @@ FIX(56), FIX(58), FIX(60), FIX(62) }; -/* quantize intra-block - - // const int32_t quantd = DIV_DIV(VM18P*quant, VM18Q); - // - // level = DIV_DIV(16 * data[i], default_intra_matrix[i]); - // coeff[i] = (level + quantd) / quant2; -*/ +/* quantize intra-block + * + * const int32_t quantd = DIV_DIV(VM18P*quant, VM18Q); + * level = DIV_DIV(16 * data[i], default_intra_matrix[i]); + * coeff[i] = (level + quantd) / quant2; + */ void quant4_intra_c(int16_t * coeff, @@ -116,9 +117,11 @@ -/* dequantize intra-block & clamp to [-2048,2047] - // data[i] = (coeff[i] * default_intra_matrix[i] * quant2) >> 4; -*/ +/* + * dequantize intra-block & clamp to [-2048,2047] + * + * data[i] = (coeff[i] * default_intra_matrix[i] * quant2) >> 4; + */ void dequant4_intra_c(int16_t * data, @@ -146,7 +149,7 @@ level = (level * intra_matrix[i] * quant) >> 3; data[i] = (level <= 2048 ? -(int16_t) level : -2048); - } else // if (coeff[i] > 0) + } else /* if (coeff[i] > 0) */ { uint32_t level = coeff[i]; @@ -158,11 +161,11 @@ -/* quantize inter-block - - // level = DIV_DIV(16 * data[i], default_intra_matrix[i]); - // coeff[i] = (level + quantd) / quant2; - // sum += abs(level); +/* quantize inter-block + * + * level = DIV_DIV(16 * data[i], default_intra_matrix[i]); + * coeff[i] = (level + quantd) / quant2; + * sum += abs(level); */ uint32_t @@ -224,7 +227,7 @@ level = ((2 * level + 1) * inter_matrix[i] * quant) >> 4; data[i] = (level <= 2048 ? -level : -2048); - } else // if (coeff[i] > 0) + } else /* if (coeff[i] > 0) */ { uint32_t level = coeff[i]; @@ -235,7 +238,7 @@ sum ^= data[i]; } - // mismatch control + /* mismatch control */ if ((sum & 1) == 0) { data[63] ^= 1;