shithub: openh264

Download patch

ref: 61117c85d86e8fc4f73c8fc48dc7ab51664cedd4
parent: 8c461786cdaf5fc28d6b5756e2438af2f1771d2c
author: Martin Storsjö <martin@martin.st>
date: Fri Jan 10 18:44:23 EST 2014

Mark pointers to quantization functions const where possible

--- a/codec/encoder/core/inc/encode_mb_aux.h
+++ b/codec/encoder/core/inc/encode_mb_aux.h
@@ -106,10 +106,10 @@
 void WelsHadamardT4Dc_sse2 (int16_t* pLumaDc, int16_t* pDct);
 int32_t WelsHadamardQuant2x2Skip_mmx (int16_t* pRes, int16_t iFF,  int16_t iMF);
 
-void WelsQuant4x4_sse2 (int16_t* pDct, int16_t* pFF,  int16_t* pMF);
-void WelsQuant4x4Dc_sse2 (int16_t* pDct,  int16_t iFF, int16_t iMF);
-void WelsQuantFour4x4_sse2 (int16_t* pDct, int16_t* pFF,  int16_t* pMF);
-void WelsQuantFour4x4Max_sse2 (int16_t* pDct, int16_t* pFF,  int16_t* pMF, int16_t* pMax);
+void WelsQuant4x4_sse2 (int16_t* pDct, const int16_t* pFF, const int16_t* pMF);
+void WelsQuant4x4Dc_sse2 (int16_t* pDct, const int16_t iFF, const int16_t iMF);
+void WelsQuantFour4x4_sse2 (int16_t* pDct, const int16_t* pFF, const int16_t* pMF);
+void WelsQuantFour4x4Max_sse2 (int16_t* pDct, const int16_t* pFF, const int16_t* pMF, int16_t* pMax);
 
 
 /****************************************************************************
--- a/codec/encoder/core/inc/wels_func_ptr_def.h
+++ b/codec/encoder/core/inc/wels_func_ptr_def.h
@@ -61,8 +61,8 @@
 typedef int32_t (*PCalculateSingleCtrFunc) (int16_t* pDct);
 
 typedef void (*PTransformHadamard4x4Func) (int16_t* pLumaDc, int16_t* pDct);
-typedef void (*PQuantizationFunc) (int16_t* pDct, int16_t* pFF,  int16_t* pMF);
-typedef void (*PQuantizationMaxFunc) (int16_t* pDct, int16_t* pFF,  int16_t* pMF, int16_t* pMax);
+typedef void (*PQuantizationFunc) (int16_t* pDct, const int16_t* pFF, const int16_t* pMF);
+typedef void (*PQuantizationMaxFunc) (int16_t* pDct, const int16_t* pFF, const int16_t* pMF, int16_t* pMax);
 typedef void (*PQuantizationDcFunc) (int16_t* pDct, int16_t iFF,  int16_t iMF);
 typedef BOOL_T (*PQuantizationSkipFunc) (int16_t* pDct, int16_t iFF,  int16_t iMF);
 typedef int32_t (*PQuantizationHadamardFunc) (int16_t* pRes, const int16_t kiFF, int16_t iMF, int16_t* pDct,
--- a/codec/encoder/core/src/encode_mb_aux.cpp
+++ b/codec/encoder/core/src/encode_mb_aux.cpp
@@ -165,7 +165,7 @@
 #define WELS_ABS_LC(a) ((iSign ^ (int32_t)(a)) - iSign)
 #define NEW_QUANT(pDct, iFF, iMF) (((iFF)+ WELS_ABS_LC(pDct))*(iMF)) >>16
 #define WELS_NEW_QUANT(pDct,iFF,iMF)	WELS_ABS_LC(NEW_QUANT(pDct, iFF, iMF))
-void WelsQuant4x4_c (int16_t* pDct, int16_t* pFF,  int16_t* pMF) {
+void WelsQuant4x4_c (int16_t* pDct, const int16_t* pFF,  const int16_t* pMF) {
   int32_t i, j, iSign;
   for (i = 0; i < 16; i += 4) {
     j = i & 0x07;
@@ -194,7 +194,7 @@
   }
 }
 
-void WelsQuantFour4x4_c (int16_t* pDct, int16_t* pFF,  int16_t* pMF) {
+void WelsQuantFour4x4_c (int16_t* pDct, const int16_t* pFF, const int16_t* pMF) {
   int32_t i, j, iSign;
 
   for (i = 0; i < 64; i += 4) {
@@ -210,7 +210,7 @@
   }
 }
 
-void WelsQuantFour4x4Max_c (int16_t* pDct, int16_t* pFF,  int16_t* pMF, int16_t* pMax) {
+void WelsQuantFour4x4Max_c (int16_t* pDct, const int16_t* pFF, const int16_t* pMF, int16_t* pMax) {
   int32_t i, j, k, iSign;
   int16_t iMaxAbs;
   for (k = 0; k < 4; k++) {