# HG changeset patch # User rguyom # Date 1039035053 0 # Node ID 638ac2c26646bca16c063ab44ffc93e5e876840c # Parent 86835828d5b5da90b710c6d78d147ca4f0e4b395 Reduce fixed-point replay gain support precision with Tremor. Avoid overflows (sounded cracky sometimes). diff -r 86835828d5b5 -r 638ac2c26646 libmpcodecs/ad_libvorbis.c --- a/libmpcodecs/ad_libvorbis.c Wed Dec 04 20:27:36 2002 +0000 +++ b/libmpcodecs/ad_libvorbis.c Wed Dec 04 20:50:53 2002 +0000 @@ -133,7 +133,7 @@ if(ov->rg_scale > 15.) ov->rg_scale = 15.; #ifdef TREMOR - ov->rg_scale_int = (int)(ov->rg_scale*256.f); + ov->rg_scale_int = (int)(ov->rg_scale*128.f); #endif mp_msg(MSGT_DECAUDIO,MSGL_V,"OggVorbis: Bitstream is %d channel%s, %dHz, %dbit/s %cBR\n",(int)ov->vi.channels,ov->vi.channels>1?"s":"",(int)ov->vi.rate,(int)ov->vi.bitrate_nominal, (ov->vi.bitrate_lower!=ov->vi.bitrate_nominal)||(ov->vi.bitrate_upper!=ov->vi.bitrate_nominal)?'V':'C'); @@ -212,7 +212,7 @@ #ifdef TREMOR ogg_int32_t *mono=pcm[i]; for(j=0;jrg_scale_int)>>(9+8); + int val=(mono[j]*ov->rg_scale_int)>>(9+7); #else float *mono=pcm[i]; for(j=0;j