[trunk] Move INLINE definition within openjpeg.h header since application may use it
[openjpeg.git] / src / lib / openjp2 / mct.c
index 59664241873cfa6e1665226087486d89b7543b94..d2754dc2666e3ea4b95eebccbc55f99875eaeffa 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (c) 2002-2003, Yannick Verschueren
  * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
  * Copyright (c) 2005, Herve Drolon, FreeImage Team
+ * Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France 
+ * Copyright (c) 2012, CS Systemes d'Information, France
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -200,7 +202,7 @@ OPJ_FLOAT64 opj_mct_getnorm_real(OPJ_UINT32 compno) {
 }
 
 
-opj_bool opj_mct_encode_custom(
+OPJ_BOOL opj_mct_encode_custom(
                                           OPJ_BYTE * pCodingdata,
                                           OPJ_UINT32 n,
                                           OPJ_BYTE ** pData,
@@ -218,6 +220,8 @@ opj_bool opj_mct_encode_custom(
        OPJ_UINT32 lMultiplicator = 1 << 13;
        OPJ_INT32 * lMctPtr;
 
+    OPJ_ARG_NOT_USED(isSigned);
+
        lCurrentData = (OPJ_INT32 *) opj_malloc((pNbComp + lNbMatCoeff) * sizeof(OPJ_INT32));
        if (! lCurrentData) {
                return OPJ_FALSE;
@@ -226,7 +230,7 @@ opj_bool opj_mct_encode_custom(
        lCurrentMatrix = lCurrentData + pNbComp;
 
        for (i =0;i<lNbMatCoeff;++i) {
-               lCurrentMatrix[i] = (OPJ_INT32) (*(lMct++) * lMultiplicator);
+               lCurrentMatrix[i] = (OPJ_INT32) (*(lMct++) * (OPJ_FLOAT32)lMultiplicator);
        }
 
        for (i = 0; i < n; ++i)  {
@@ -251,7 +255,7 @@ opj_bool opj_mct_encode_custom(
        return OPJ_TRUE;
 }
 
-opj_bool opj_mct_decode_custom(
+OPJ_BOOL opj_mct_decode_custom(
                                           OPJ_BYTE * pDecodingData,
                                           OPJ_UINT32 n,
                                           OPJ_BYTE ** pData,
@@ -267,6 +271,8 @@ opj_bool opj_mct_decode_custom(
        OPJ_FLOAT32 * lCurrentResult = 00;
        OPJ_FLOAT32 ** lData = (OPJ_FLOAT32 **) pData;
 
+    OPJ_ARG_NOT_USED(isSigned);
+
        lCurrentData = (OPJ_FLOAT32 *) opj_malloc (2 * pNbComp * sizeof(OPJ_FLOAT32));
        if (! lCurrentData) {
                return OPJ_FALSE;