patch-tools_find_sts_main_c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. $OpenBSD: patch-tools_find_sts_main_c,v 1.2 2009/12/14 00:33:08 jakemsr Exp $
  2. --- tools/find_sts_main.c.orig Thu Dec 26 09:18:30 2002
  3. +++ tools/find_sts_main.c Wed Dec 9 19:23:23 2009
  4. @@ -75,6 +75,11 @@ cst_sts *find_sts(cst_wave *sig, cst_track *lpc)
  5. double *resd;
  6. int size,start,end;
  7. short *sigplus;
  8. + struct dummy {
  9. + unsigned short *frame;
  10. + int size;
  11. + unsigned char *residual;
  12. + } *stsw;
  13. sts = cst_alloc(cst_sts,lpc->num_frames);
  14. start = 0;
  15. @@ -93,14 +98,16 @@ cst_sts *find_sts(cst_wave *sig, cst_track *lpc)
  16. lpc->frames[i],lpc->num_channels,
  17. resd,
  18. size);
  19. - sts[i].size = size;
  20. - sts[i].frame = cst_alloc(unsigned short,lpc->num_channels-1);
  21. +
  22. + stsw = (struct dummy *)(sts+i);
  23. + stsw->size = size;
  24. + stsw->frame = cst_alloc(unsigned short,lpc->num_channels-1);
  25. for (j=1; j < lpc->num_channels; j++)
  26. - sts[i].frame[j-1] = (unsigned short)
  27. + stsw->frame[j-1] = (unsigned short)
  28. (((lpc->frames[i][j]-lpc_min)/lpc_range)*65535);
  29. - sts[i].residual = cst_alloc(unsigned char,size);
  30. + stsw->residual = cst_alloc(unsigned char,size);
  31. for (j=0; j < size; j++)
  32. - sts[i].residual[j] = cst_short_to_ulaw((short)resd[j]);
  33. + stsw->residual[j] = cst_short_to_ulaw((short)resd[j]);
  34. start = end;
  35. }