Commit f2975c71 authored by Sam Hocevar's avatar Sam Hocevar

  * Fixed the ac3dec compilation under BeOS.
  * Removed a useless #include in aout_sdl.c.
parent fdd0e7d3
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_sdl.c : audio sdl functions library * aout_sdl.c : audio sdl functions library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: aout_sdl.c,v 1.10 2001/03/21 13:42:34 sam Exp $ * $Id: aout_sdl.c,v 1.11 2001/04/26 11:23:16 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <errno.h> /* ENOMEM */ #include <errno.h> /* ENOMEM */
#include <fcntl.h> /* open(), O_WRONLY */ #include <fcntl.h> /* open(), O_WRONLY */
#include <sys/ioctl.h> /* ioctl() */
#include <string.h> /* strerror() */ #include <string.h> /* strerror() */
#include <unistd.h> /* write(), close() */ #include <unistd.h> /* write(), close() */
#include <stdio.h> /* "intf_msg.h" */ #include <stdio.h> /* "intf_msg.h" */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_bit_allocate.c: ac3 allocation tables * ac3_bit_allocate.c: ac3 allocation tables
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: ac3_bit_allocate.c,v 1.18 2001/04/20 12:14:34 reno Exp $ * $Id: ac3_bit_allocate.c,v 1.19 2001/04/26 11:23:16 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca> * Aaron Holtzman <aholtzma@engr.uvic.ca>
...@@ -152,12 +152,12 @@ static const s16 baptab[] = { 0, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, ...@@ -152,12 +152,12 @@ static const s16 baptab[] = { 0, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4,
10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14,
14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15 }; 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15 };
static __inline__ u16 max (s16 a, s16 b) static __inline__ u16 max_value (s16 a, s16 b)
{ {
return (a > b ? a : b); return (a > b ? a : b);
} }
static __inline__ u16 min (s16 a, s16 b) static __inline__ u16 min_value (s16 a, s16 b)
{ {
return (a < b ? a : b); return (a < b ? a : b);
} }
...@@ -167,9 +167,9 @@ static __inline__ s16 logadd (s16 a, s16 b) ...@@ -167,9 +167,9 @@ static __inline__ s16 logadd (s16 a, s16 b)
s16 c; s16 c;
if ((c = a - b) >= 0) { if ((c = a - b) >= 0) {
return (a + latab[min(((c) >> 1), 255)]); return (a + latab[min_value(((c) >> 1), 255)]);
} else { } else {
return (b + latab[min(((-c) >> 1), 255)]); return (b + latab[min_value(((-c) >> 1), 255)]);
} }
} }
...@@ -179,14 +179,14 @@ static __inline__ s16 calc_lowcomp (s16 a, s16 b0, s16 b1, s16 bin) ...@@ -179,14 +179,14 @@ static __inline__ s16 calc_lowcomp (s16 a, s16 b0, s16 b1, s16 bin)
if ((b0 + 256) == b1) if ((b0 + 256) == b1)
a = 384; a = 384;
else if (b0 > b1) else if (b0 > b1)
a = max(0, a - 64); a = max_value(0, a - 64);
} else if (bin < 20) { } else if (bin < 20) {
if ((b0 + 256) == b1) if ((b0 + 256) == b1)
a = 320; a = 320;
else if (b0 > b1) else if (b0 > b1)
a = max(0, a - 64) ; a = max_value(0, a - 64) ;
} else } else
a = max(0, a - 128); a = max_value(0, a - 128);
return a; return a;
} }
...@@ -306,7 +306,7 @@ static void ba_compute_psd (bit_allocate_t * p_bit, s16 start, s16 end, s16 exps ...@@ -306,7 +306,7 @@ static void ba_compute_psd (bit_allocate_t * p_bit, s16 start, s16 end, s16 exps
k = masktab[start]; k = masktab[start];
do { do {
lastbin = min(bndtab[k] + bndsz[k], end); lastbin = min_value(bndtab[k] + bndsz[k], end);
p_bit->bndpsd[k] = p_bit->psd[j]; p_bit->bndpsd[k] = p_bit->psd[j];
j++; j++;
...@@ -356,15 +356,15 @@ static void ba_compute_excitation (bit_allocate_t * p_bit, s16 start, s16 end, ...@@ -356,15 +356,15 @@ static void ba_compute_excitation (bit_allocate_t * p_bit, s16 start, s16 end,
} }
} }
for (bin = begin; bin < min(bndend, 22); bin++) { for (bin = begin; bin < min_value(bndend, 22); bin++) {
if (!(is_lfe && (bin == 6))) if (!(is_lfe && (bin == 6)))
lowcomp = calc_lowcomp (lowcomp, p_bit->bndpsd[bin], lowcomp = calc_lowcomp (lowcomp, p_bit->bndpsd[bin],
p_bit->bndpsd[bin+1], bin); p_bit->bndpsd[bin+1], bin);
fastleak -= p_bit->fdecay ; fastleak -= p_bit->fdecay ;
fastleak = max(fastleak, p_bit->bndpsd[bin] - fgain); fastleak = max_value(fastleak, p_bit->bndpsd[bin] - fgain);
slowleak -= p_bit->sdecay ; slowleak -= p_bit->sdecay ;
slowleak = max(slowleak, p_bit->bndpsd[bin] - p_bit->sgain); slowleak = max_value(slowleak, p_bit->bndpsd[bin] - p_bit->sgain);
p_bit->excite[bin] = max(fastleak - lowcomp, slowleak); p_bit->excite[bin] = max_value(fastleak - lowcomp, slowleak);
} }
begin = 22; begin = 22;
} else { /* For coupling channel */ } else { /* For coupling channel */
...@@ -373,10 +373,10 @@ static void ba_compute_excitation (bit_allocate_t * p_bit, s16 start, s16 end, ...@@ -373,10 +373,10 @@ static void ba_compute_excitation (bit_allocate_t * p_bit, s16 start, s16 end,
for (bin = begin; bin < bndend; bin++) { for (bin = begin; bin < bndend; bin++) {
fastleak -= p_bit->fdecay; fastleak -= p_bit->fdecay;
fastleak = max(fastleak, p_bit->bndpsd[bin] - fgain); fastleak = max_value(fastleak, p_bit->bndpsd[bin] - fgain);
slowleak -= p_bit->sdecay; slowleak -= p_bit->sdecay;
slowleak = max(slowleak, p_bit->bndpsd[bin] - p_bit->sgain); slowleak = max_value(slowleak, p_bit->bndpsd[bin] - p_bit->sgain);
p_bit->excite[bin] = max(fastleak, slowleak) ; p_bit->excite[bin] = max_value(fastleak, slowleak) ;
} }
} }
...@@ -397,7 +397,7 @@ static void ba_compute_mask (bit_allocate_t * p_bit, s16 start, s16 end, u16 fsc ...@@ -397,7 +397,7 @@ static void ba_compute_mask (bit_allocate_t * p_bit, s16 start, s16 end, u16 fsc
if (p_bit->bndpsd[bin] < p_bit->dbknee) { if (p_bit->bndpsd[bin] < p_bit->dbknee) {
p_bit->excite[bin] += ((p_bit->dbknee - p_bit->bndpsd[bin]) >> 2); p_bit->excite[bin] += ((p_bit->dbknee - p_bit->bndpsd[bin]) >> 2);
} }
p_bit->mask[bin] = max(p_bit->excite[bin], hth[fscod][bin]); p_bit->mask[bin] = max_value(p_bit->excite[bin], hth[fscod][bin]);
} }
/* Perform delta bit modulation if necessary */ /* Perform delta bit modulation if necessary */
...@@ -432,7 +432,7 @@ static void ba_compute_bap (bit_allocate_t * p_bit, s16 start, s16 end, s16 snro ...@@ -432,7 +432,7 @@ static void ba_compute_bap (bit_allocate_t * p_bit, s16 start, s16 end, s16 snro
j = masktab[start]; j = masktab[start];
do { do {
lastbin = min(bndtab[j] + bndsz[j], end); lastbin = min_value(bndtab[j] + bndsz[j], end);
p_bit->mask[j] -= snroffset; p_bit->mask[j] -= snroffset;
p_bit->mask[j] -= p_bit->floor; p_bit->mask[j] -= p_bit->floor;
...@@ -443,7 +443,7 @@ static void ba_compute_bap (bit_allocate_t * p_bit, s16 start, s16 end, s16 snro ...@@ -443,7 +443,7 @@ static void ba_compute_bap (bit_allocate_t * p_bit, s16 start, s16 end, s16 snro
p_bit->mask[j] += p_bit->floor; p_bit->mask[j] += p_bit->floor;
for (k = i; k < lastbin; k++) { for (k = i; k < lastbin; k++) {
address = (p_bit->psd[i] - p_bit->mask[j]) >> 5; address = (p_bit->psd[i] - p_bit->mask[j]) >> 5;
address = min(63, max(0, address)); address = min_value(63, max_value(0, address));
bap[i] = baptab[address]; bap[i] = baptab[address];
i++; i++;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_imdct.c: ac3 DCT * ac3_imdct.c: ac3 DCT
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_imdct.c,v 1.15 2001/04/20 12:14:34 reno Exp $ * $Id: ac3_imdct.c,v 1.16 2001/04/26 11:23:16 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca> * Aaron Holtzman <aholtzma@engr.uvic.ca>
...@@ -41,6 +41,10 @@ ...@@ -41,6 +41,10 @@
#include "ac3_downmix.h" #include "ac3_downmix.h"
#ifndef M_PI
# define M_PI 3.14159265358979323846
#endif
void imdct_do_256(imdct_t * p_imdct, float x[],float y[], int id); void imdct_do_256(imdct_t * p_imdct, float x[],float y[], int id);
void imdct_do_512(imdct_t * p_imdct, float x[],float y[], int id); void imdct_do_512(imdct_t * p_imdct, float x[],float y[], int id);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_rematrix.c: ac3 audio rematrixing * ac3_rematrix.c: ac3 audio rematrixing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_rematrix.c,v 1.13 2001/04/20 12:14:34 reno Exp $ * $Id: ac3_rematrix.c,v 1.14 2001/04/26 11:23:16 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca> * Aaron Holtzman <aholtzma@engr.uvic.ca>
...@@ -41,7 +41,7 @@ struct rematrix_band_s { ...@@ -41,7 +41,7 @@ struct rematrix_band_s {
static const struct rematrix_band_s rematrix_band[] = { {13,24}, {25,36}, {37 ,60}, {61,252}}; static const struct rematrix_band_s rematrix_band[] = { {13,24}, {25,36}, {37 ,60}, {61,252}};
static __inline__ u32 min (u32 a, u32 b) static __inline__ u32 min_value (u32 a, u32 b)
{ {
return (a < b ? a : b); return (a < b ? a : b);
} }
...@@ -68,7 +68,7 @@ void rematrix (ac3dec_t * p_ac3dec) ...@@ -68,7 +68,7 @@ void rematrix (ac3dec_t * p_ac3dec)
continue; continue;
start = rematrix_band[i].start; start = rematrix_band[i].start;
end = min(rematrix_band[i].end ,12 * p_ac3dec->audblk.cplbegf + 36); end = min_value(rematrix_band[i].end ,12 * p_ac3dec->audblk.cplbegf + 36);
for (j=start;j < end; j++) { for (j=start;j < end; j++) {
left = 0.5f * (p_ac3dec->coeffs.fbw[0][j] + p_ac3dec->coeffs.fbw[1][j]); left = 0.5f * (p_ac3dec->coeffs.fbw[0][j] + p_ac3dec->coeffs.fbw[1][j]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment