Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: celt/tests/test_unit_cwrs32.c

Issue 28553003: Updating Opus to a pre-release of 1.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/opus
Patch Set: Removing failing file Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « celt/stack_alloc.h ('k') | celt/tests/test_unit_mathops.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: celt/tests/test_unit_cwrs32.c
diff --git a/celt/tests/test_unit_cwrs32.c b/celt/tests/test_unit_cwrs32.c
index 4695f2dde854ae29848bfa6f905d47709a3e6ec6..ac2a8d129c95d305b804dabb51246a76a14c0235 100644
--- a/celt/tests/test_unit_cwrs32.c
+++ b/celt/tests/test_unit_cwrs32.c
@@ -53,22 +53,20 @@
#ifdef TEST_CUSTOM_MODES
-#define NDIMS (46)
+#define NDIMS (44)
static const int pn[NDIMS]={
2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 18, 20, 22,
24, 26, 28, 30, 32, 36, 40, 44, 48,
52, 56, 60, 64, 72, 80, 88, 96, 104,
- 112, 120, 128, 144, 160, 176, 192, 208, 224,
- 240
+ 112, 120, 128, 144, 160, 176, 192, 208
};
static const int pkmax[NDIMS]={
128, 128, 128, 128, 88, 52, 36, 26, 22,
18, 16, 15, 13, 12, 12, 11, 10, 9,
9, 8, 8, 7, 7, 7, 7, 6, 6,
6, 6, 6, 5, 5, 5, 5, 5, 5,
- 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4
+ 4, 4, 4, 4, 4, 4, 4, 4
};
#else /* TEST_CUSTOM_MODES */
@@ -97,27 +95,37 @@ int main(void){
for(pseudo=1;pseudo<41;pseudo++)
{
int k;
+#if defined(SMALL_FOOTPRINT)
opus_uint32 uu[KMAX+2U];
+#endif
opus_uint32 inc;
opus_uint32 nc;
opus_uint32 i;
k=get_pulses(pseudo);
if (k>pkmax[t])break;
printf("Testing CWRS with N=%i, K=%i...\n",n,k);
+#if defined(SMALL_FOOTPRINT)
nc=ncwrs_urow(n,k,uu);
+#else
+ nc=CELT_PVQ_V(n,k);
+#endif
inc=nc/20000;
if(inc<1)inc=1;
for(i=0;i<nc;i+=inc){
+#if defined(SMALL_FOOTPRINT)
opus_uint32 u[KMAX+2U];
- int y[NMAX];
- int sy;
- int yy[5];
+#endif
+ int y[NMAX];
+ int sy;
opus_uint32 v;
opus_uint32 ii;
- int kk;
- int j;
+ int j;
+#if defined(SMALL_FOOTPRINT)
memcpy(u,uu,(k+2U)*sizeof(*u));
cwrsi(n,k,i,y,u);
+#else
+ cwrsi(n,k,i,y);
+#endif
sy=0;
for(j=0;j<n;j++)sy+=ABS(y[j]);
if(sy!=k){
@@ -128,7 +136,12 @@ int main(void){
/*printf("%6u of %u:",i,nc);
for(j=0;j<n;j++)printf(" %+3i",y[j]);
printf(" ->");*/
+#if defined(SMALL_FOOTPRINT)
ii=icwrs(n,k,&v,y,u);
+#else
+ ii=icwrs(n,y);
+ v=CELT_PVQ_V(n,k);
+#endif
if(ii!=i){
fprintf(stderr,"Combination-index mismatch (%lu!=%lu).\n",
(long)ii,(long)i);
@@ -139,81 +152,6 @@ int main(void){
(long)v,(long)nc);
return 2;
}
-#ifndef SMALL_FOOTPRINT
- if(n==2){
- cwrsi2(k,i,yy);
- for(j=0;j<2;j++)if(yy[j]!=y[j]){
- fprintf(stderr,"N=2 pulse vector mismatch ({%i,%i}!={%i,%i}).\n",
- yy[0],yy[1],y[0],y[1]);
- return 3;
- }
- ii=icwrs2(yy,&kk);
- if(ii!=i){
- fprintf(stderr,"N=2 combination-index mismatch (%lu!=%lu).\n",
- (long)ii,(long)i);
- return 4;
- }
- if(kk!=k){
- fprintf(stderr,"N=2 pulse count mismatch (%i,%i).\n",kk,k);
- return 5;
- }
- v=ncwrs2(k);
- if(v!=nc){
- fprintf(stderr,"N=2 combination count mismatch (%lu,%lu).\n",
- (long)v,(long)nc);
- return 6;
- }
- }
- else if(n==3){
- cwrsi3(k,i,yy);
- for(j=0;j<3;j++)if(yy[j]!=y[j]){
- fprintf(stderr,"N=3 pulse vector mismatch "
- "({%i,%i,%i}!={%i,%i,%i}).\n",yy[0],yy[1],yy[2],y[0],y[1],y[2]);
- return 7;
- }
- ii=icwrs3(yy,&kk);
- if(ii!=i){
- fprintf(stderr,"N=3 combination-index mismatch (%lu!=%lu).\n",
- (long)ii,(long)i);
- return 8;
- }
- if(kk!=k){
- fprintf(stderr,"N=3 pulse count mismatch (%i!=%i).\n",kk,k);
- return 9;
- }
- v=ncwrs3(k);
- if(v!=nc){
- fprintf(stderr,"N=3 combination count mismatch (%lu!=%lu).\n",
- (long)v,(long)nc);
- return 10;
- }
- }
- else if(n==4){
- cwrsi4(k,i,yy);
- for(j=0;j<4;j++)if(yy[j]!=y[j]){
- fprintf(stderr,"N=4 pulse vector mismatch "
- "({%i,%i,%i,%i}!={%i,%i,%i,%i}.\n",
- yy[0],yy[1],yy[2],yy[3],y[0],y[1],y[2],y[3]);
- return 11;
- }
- ii=icwrs4(yy,&kk);
- if(ii!=i){
- fprintf(stderr,"N=4 combination-index mismatch (%lu!=%lu).\n",
- (long)ii,(long)i);
- return 12;
- }
- if(kk!=k){
- fprintf(stderr,"N=4 pulse count mismatch (%i!=%i).\n",kk,k);
- return 13;
- }
- v=ncwrs4(k);
- if(v!=nc){
- fprintf(stderr,"N=4 combination count mismatch (%lu!=%lu).\n",
- (long)v,(long)nc);
- return 14;
- }
- }
-#endif /* SMALL_FOOTPRINT */
/*printf(" %6u\n",i);*/
}
/*printf("\n");*/
« no previous file with comments | « celt/stack_alloc.h ('k') | celt/tests/test_unit_mathops.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698