shithub: openh264

Download patch

ref: bcf1af9ac102fabb2003be298b5de9672cc29492
parent: 70547036dd08627fe5e0e0fc6d6b094fa16e8d1b
parent: a25f7b7c849b0ea84f808e8aabed92a0d142f4a6
author: Licai Guo <licaguo@cisco.com>
date: Fri Apr 11 11:43:39 EDT 2014

Merge pull request #670 from mstorsjo/consistent-for-loop-declaration

Declare for loop variables consistently in GetIntraPredictorTest

--- a/test/encoder/EncUT_GetIntraPredictor.cpp
+++ b/test/encoder/EncUT_GetIntraPredictor.cpp
@@ -477,15 +477,16 @@
 TEST(GetIntraPredictorTest, TestGetI16x16LumaPredPlane) {
   const int32_t kiStride = rand()%16+16;
 
+  int32_t i, j;
+
   uint8_t *pPred = new uint8_t[16*kiStride];
   uint8_t *pRef  = new uint8_t[16*kiStride+1];
-  for (int i=0; i<16*kiStride+1; i++)
+  for (i=0; i<16*kiStride+1; i++)
     pRef[i]=rand()%256+1;
 
   pRef += kiStride + 1;
 
   int32_t iA=0, iB=0, iC=0, iH=0, iV=0;
-  int32_t i, j;
   uint8_t *pTop = &pRef[-kiStride];
   uint8_t *pLeft = &pRef[-1];
   int32_t iPredStride = 16;
@@ -514,9 +515,11 @@
 TEST(GetIntraPredictorTest, TestGetI16x16LumaPredDc) {
   const int32_t kiStride = rand()%16+16;
 
+  int i;
+
   uint8_t *pPred = new uint8_t[256];
   uint8_t *pRef  = new uint8_t[16*kiStride];
-  for (int i=0; i<16*kiStride; i++)
+  for (i=0; i<16*kiStride; i++)
     pRef[i] = rand() % 256 + 1;
 
   pRef += kiStride;
@@ -523,7 +526,7 @@
 
   int32_t iTmp = (kiStride << 4) - kiStride;
   int32_t iSum = 0;
-  uint8_t i = 15;
+  i = 15;
   uint8_t uiMean = 0;
 
   do {
@@ -533,7 +536,7 @@
   uiMean = ( 16 + iSum ) >> 5;
 
   WelsI16x16LumaPredDc_c(pPred, pRef, kiStride);
-  for (int i=0; i<256; i++)
+  for (i=0; i<256; i++)
     EXPECT_EQ(pPred[i],uiMean);
 
   pRef -= kiStride;
@@ -545,15 +548,17 @@
 TEST(GetIntraPredictorTest, TestGetI16x16LumaPredDcTop) {
   const int32_t kiStride = rand()%16+16;
 
+  int i;
+
   uint8_t *pPred = new uint8_t[256];
   uint8_t *pRef  = new uint8_t[16*kiStride];
-  for (int i=0; i<16*kiStride; i++)
+  for (i=0; i<16*kiStride; i++)
     pRef[i] = rand() % 256 + 1;
 
   pRef += kiStride;
 
   int32_t iSum = 0;
-  uint8_t i = 15;
+  i = 15;
   uint8_t uiMean = 0;
   do {
     iSum += pRef[-kiStride+i];
@@ -561,7 +566,7 @@
   uiMean = ( 8 + iSum ) >> 4;
 
   WelsI16x16LumaPredDcTop_c(pPred, pRef, kiStride);
-  for (int i=0; i<256; i++)
+  for (i=0; i<256; i++)
     EXPECT_EQ(pPred[i],uiMean);
 
   pRef -= kiStride;