Skip to content

Commit

Permalink
Add Gibss phenomenon hack to end of the packet (as well as the start).
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrady committed Aug 29, 2014
1 parent 0a583f1 commit 88fc18a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions player.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,16 +609,20 @@ static int stuff_buffer_soxr(short *inptr, short *outptr, int stuff) {

const int gpm = 7;

// keep the last (dpm) samples, to mitigate the Gibbs phenomenon
//for (i=0;i<gpm;i++)
// op[frame_size+stuff-1-i]=ip[frame_size+stuff-1-i];

// keep the first (dpm) samples, to mitigate the Gibbs phenomenon
for (i=0;i<gpm;i++) {
*op++ = *ip++;
*op++ = *ip++;
}


// keep the last (dpm) samples, to mitigate the Gibbs phenomenon
op=outptr+(frame_size+stuff-gpm)*sizeof(short);
ip=inptr+(frame_size-gpm)*sizeof(short);
for (i=0;i<gpm;i++) {
*op++ = *ip++;
*op++ = *ip++;
}

// finally, adjust the volume, if necessary
if (volume!=1.0) {
// pthread_mutex_lock(&vol_mutex);
Expand Down

0 comments on commit 88fc18a

Please sign in to comment.