diff --git a/libvorbis-1.2.0-aotuv-b5.diff b/libvorbis-1.2.0-aotuv-b5.diff index bb96f14..797add4 100644 --- a/libvorbis-1.2.0-aotuv-b5.diff +++ b/libvorbis-1.2.0-aotuv-b5.diff @@ -1,6 +1,186 @@ ---- lib/block.c-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/block.c 2007-08-02 12:25:50.000000000 +0200 -@@ -106,7 +106,7 @@ int vorbis_block_init(vorbis_dsp_state * +--- COPYING ++++ COPYING +@@ -1,4 +1,5 @@ +-Copyright (c) 2002-2004 Xiph.org Foundation ++aoTuV - Copyright (c) 2003-2006 Aoyumi ++libvorbis - Copyright (c) 2002-2005 Xiph.org Foundation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions +--- aoTuV_README-1st.txt ++++ aoTuV_README-1st.txt +@@ -0,0 +1,21 @@ ++aoTuV Beta 5 ++ ++"aoTuV" tunes up Xiph.Org's libvorbis uniquely. ++A license is taken as "BSD-style license" as well as original libvorbis. ++ ++ ++# NOTICE # ++ ++ Manuke's patch is used for improvement in the speed of sort processing. ++ When "#define OPT_SORT" of "lib/psy.h" is deleted, the conventional ++ processing method is used. ++ Thanks! Manuke. ++ ++ ++aoTuV based on ++ ++Copyright (c) 2002-2005 Xiph.Org Foundation ++Copyright (c) 2003-2006 Aoyumi ++ ++ ++AUTHOR : aoyumi +--- aoTuV_technical.txt ++++ aoTuV_technical.txt +@@ -0,0 +1,144 @@ ++aoTuV beta5 technical information ++ ++ ++The differences from the aoTuV beta 4.51... ++ ++ 1. In order to work noise normalization correctly, the value of tone ++ masking is compressed under certain conditions. A floor curve approaches ++ the original audio spectrum line as a result. [New M4] ++ ++ 2. In order to cut down the bitrate, a part of M2 code of beta4 was ++ deleted. ++ ++@3. The ATH curve was changed slightly. ++ ++ 4. Pre-echo decreased slightly. This is based on change of M3 code. ++ ++ 5. In order to decrease artifact by collapse of audio energy, noise ++ normalization processing of point stereo was extended. [32/44.1/48kHz only] ++ ++ 6. The threshold of channel coupling (lossless <=> point) is changed dynamically. This is a method based on a certain idea. [M6] ++ ++...and I tune up many parameters. ++ ++ ++2006/10/24 ++Aoyumi ++ ++---------------------------------------------------------------------------- ++ ++aoTuV beta4.51 technical information ++ ++ ++The differences from the aoTuV beta 4.5... ++ ++ 1. The changed part of "scale.h" of Xiph.Org SVN was reflected in aoTuV. ++ This will solve the problem of the compile by gcc4. ++ ++ 2. A part of portion added by beta4.5 had caused memory access violation. ++ Depending on environment, a problem arises in qualiy-1/-2. This problem was ++ corrected. ++ ++ ++2005/11/17 ++Aoyumi ++ ++---------------------------------------------------------------------------- ++ ++aoTuV beta4.5 technical information ++ ++ ++The differences from the aoTuV beta 4... ++ ++ 1. M4 code of beta3 was deleted. M5 is added as what is replaced with it. ++ The advantage of this method is that the result stabilized more is obtained. ++ Instead, the change width of the bit rate becomes large rather than before. ++ [32/44.1/48kHz only] ++ ++ 2. New M4 was added. There is this for the same purpose as M1. However, ++ it is tuned up only in the low bit rate region according to work and ++ individual parameters. [32/44.1/48kHz only] ++ ++ 3. M2 code was extended. This decreases a specific noise problem. ++ [32/44.1/48kHz only] ++ ++...and I mainly tune up tone/noise masking and noise normalization parameters. ++ ++The above change is applied below quality3. ++ ++ ++2005/11/05 ++Aoyumi ++ ++---------------------------------------------------------------------------- ++ ++aoTuV beta4 technical information ++ ++ ++The differences from the aoTuV beta 3... ++ ++ 1. Adoption of new hypot (point stereo). This works in general better than ++ dipole/round hypot. And when residue is likely to decrease greatly at the ++ time of a reverse phase, added code is made to increase the ratio of lossless. ++ ++ 2. Change of ATH curve. This is not a big change. ++ ++ 3. Residue used for threshold calculation of channel coupling is changed. ++ This one seems to be good selection. ++ ++ 4. HF reduction code of beta3 was deleted. Now, this is not required. ++ ++ 5. The energy deficit of M4 code of beta3 -- correction of a bug Now. ++ ++ 6. The code for pulling downward floor of the frequency range which can ++ be easy to be heard was added (New M2). This works by the low bit rate and ++ has a comparatively good trade-off. ++ ++ 7. Change of threshold calculation of noise normalization. Moreover, it ++ takes phase information into consideration. ++ ++ ++...and I mainly tune up tone/noise masking and noise compander parameters. ++ ++ ++2005/06/18 ++Aoyumi ++ ++---------------------------------------------------------------------------- ++ ++aoTuV beta3 technical information ++ ++ ++The differences from the aoTuV beta 2 and Vorbis 1.1... ++ ++ 1. Dynamic impulse block noise control(q0-10). [32/44.1/48kHz only] ++ Conspicuous pre-echo is reduced. ++ ++ 2. New ATH curve. ++ ++ 3. In order to cancel that a small sound becomes unstable, the noise level ++ of low frequency is lowered under specific conditions. (Only below q3) ++ There is a greatest effect on a piano etc. [32/44.1/48kHz only] ++ ++ 4. The rate of lossless stereo is increased in specific conditions. This ++ improves many of conspicuous problems which a point stereo causes. (e.g ++ drumus's hiss/voice, guitar and brass's distortion) [32/44.1/48kHz only] ++ ++ 5. The action of the noise normalization of point stereo is corrected. It ++ was set to one of the causes of distortion in a long tone (e.g ++ strings/oboe/high tone voice). ++ ++ 6. The HF reduction code was not working normally. This is corrected and ++ it retuned up according to the present condition. [32/44.1/48kHz only] ++ ++ 7. The q-2 mode was added in all sampling frequencies. And nominal bitrate ++ of q-1 are changed into a more nearly average value. Although nominal ++ bitrate is more large at a low sampling frequency, average bitrate hardly ++ differs from the former version. ++ ++ ++...and I mainly tune up tone/noise masking parameters. ++ ++ ++2004/11/21 ++Aoyumi +--- lib/block.c ++++ lib/block.c +@@ -106,7 +106,7 @@ oggpack_writeinit(vbi->packetblob[i]); } } @@ -9,7 +189,7 @@ return(0); } -@@ -287,6 +287,11 @@ int vorbis_analysis_init(vorbis_dsp_stat +@@ -287,6 +287,11 @@ b=v->backend_state; b->psy_g_look=_vp_global_look(vi); @@ -21,7 +201,7 @@ /* Initialize the envelope state storage */ b->ve=_ogg_calloc(1,sizeof(*b->ve)); _ve_envelope_init(b->ve,vi); -@@ -351,6 +356,11 @@ void vorbis_dsp_clear(vorbis_dsp_state * +@@ -351,6 +356,11 @@ drft_clear(&b->fft_look[0]); drft_clear(&b->fft_look[1]); @@ -33,58 +213,296 @@ } ---- lib/modes/setup_X.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/setup_X.h 2007-08-02 12:25:50.000000000 +0200 -@@ -15,13 +15,14 @@ +--- lib/codec_internal.h ++++ lib/codec_internal.h +@@ -82,6 +82,15 @@ + bitrate_manager_state bms; + + ogg_int64_t sample_count; ++ ++ /* encode only ++ added by aoyumi */ ++ float *lownoise_compand_level; ++ float *nblock; /* lW logmdct buffer */ ++ float *tblock; /* temporal masking buffer (impulse block) */ ++ int lW_blocktype; /* last window block type */ ++ int lW_modenumber; /* last window mode number (0=short, 1=long) */ ++ int lW_no; /* the number of continuous window blocks (last window) */ + } private_state; + + /* codec_setup_info contains all the setup information specific to the +--- lib/info.c ++++ lib/info.c +@@ -451,7 +451,7 @@ + } + + static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){ +- char temp[]="Xiph.Org libVorbis I 20070622"; ++ char temp[]="AO; aoTuV b5 [20061024] (based on Xiph.Org's I 20070622)"; + int bytes = strlen(temp); + + /* preamble */ +--- lib/mapping0.c ++++ lib/mapping0.c +@@ -246,11 +246,14 @@ + codec_setup_info *ci=vi->codec_setup; + private_state *b=vb->vd->backend_state; + vorbis_block_internal *vbi=(vorbis_block_internal *)vb->internal; ++ vorbis_info_floor1 *vif=ci->floor_param[vb->W]; + int n=vb->pcmend; + int i,j,k; + + int *nonzero = alloca(sizeof(*nonzero)*vi->channels); + float **gmdct = _vorbis_block_alloc(vb,vi->channels*sizeof(*gmdct)); ++ float **gmdct_org = _vorbis_block_alloc(vb,vi->channels*sizeof(*gmdct_org)); ++ float **res_org = _vorbis_block_alloc(vb,vi->channels*sizeof(*res_org)); + int **ilogmaskch= _vorbis_block_alloc(vb,vi->channels*sizeof(*ilogmaskch)); + int ***floor_posts = _vorbis_block_alloc(vb,vi->channels*sizeof(*floor_posts)); + +@@ -273,6 +276,8 @@ + float *logfft =pcm; + + gmdct[i]=_vorbis_block_alloc(vb,n/2*sizeof(**gmdct)); ++ gmdct_org[i]=_vorbis_block_alloc(vb,n/2*sizeof(**gmdct_org)); ++ res_org[i]=_vorbis_block_alloc(vb,n/2*sizeof(**res_org)); + + scale_dB=todB(&scale) + .345; /* + .345 is a hack; the original + todB estimation used on IEEE 754 +@@ -311,6 +316,7 @@ + /* transform the PCM data */ + /* only MDCT right now.... */ + mdct_forward(b->transform[vb->W][0],pcm,gmdct[i]); ++ memcpy(gmdct_org[i], gmdct[i], n/2*sizeof(**gmdct_org)); + + /* FFT yields more accurate tonal estimation (not phase sensitive) */ + drft_forward(&b->fft_look[vb->W],pcm); +@@ -380,6 +386,11 @@ + + float *logmdct =logfft+n/2; + float *logmask =logfft; ++ ++ float *lastmdct = b->nblock+i*128; ++ float *tempmdct = b->tblock+i*128; ++ ++ float *lowcomp = b->lownoise_compand_level+i; + + vb->mode=modenumber; + +@@ -419,7 +430,15 @@ + us a tonality estimate (the larger the value in the + 'noise_depth' vector, the more tonal that area is) */ + ++ *lowcomp= ++ lb_loudnoise_fix(psy_look, ++ *lowcomp, ++ logmdct, ++ b->lW_modenumber, ++ blocktype, modenumber); ++ + _vp_noisemask(psy_look, ++ *lowcomp, + logmdct, + noise); /* noise does not have by-frequency offset + bias applied yet */ +@@ -467,7 +486,13 @@ + 1, + logmask, + mdct, +- logmdct); ++ logmdct, ++ lastmdct, tempmdct, ++ *lowcomp, ++ vif->n, ++ blocktype, modenumber, ++ vb->nW, ++ b->lW_blocktype, b->lW_modenumber, b->lW_no); + + #if 0 + if(vi->channels==2){ +@@ -510,7 +535,13 @@ + 2, + logmask, + mdct, +- logmdct); ++ logmdct, ++ lastmdct, tempmdct, ++ *lowcomp, ++ vif->n, ++ blocktype, modenumber, ++ vb->nW, ++ b->lW_blocktype, b->lW_modenumber, b->lW_no); + + #if 0 + if(vi->channels==2){ +@@ -533,7 +564,13 @@ + 0, + logmask, + mdct, +- logmdct); ++ logmdct, ++ lastmdct, tempmdct, ++ *lowcomp, ++ vif->n, ++ blocktype, modenumber, ++ vb->nW, ++ b->lW_blocktype, b->lW_modenumber, b->lW_no); + + #if 0 + if(vi->channels==2) +@@ -600,11 +637,6 @@ + psy_look, + info, + mag_memo); +- +- hf_reduction(&ci->psy_g_param, +- psy_look, +- info, +- mag_memo); + } + + memset(sortindex,0,sizeof(*sortindex)*vi->channels); +@@ -636,7 +668,9 @@ + for(i=0;ichannels;i++){ + int submap=info->chmuxlist[i]; + float *mdct =gmdct[i]; ++ float *mdct_org=gmdct_org[i]; + float *res =vb->pcm[i]; ++ float *resorgch=res_org[i]; + int *ilogmask=ilogmaskch[i]= + _vorbis_block_alloc(vb,n/2*sizeof(**gmdct)); + +@@ -659,6 +693,14 @@ + res, + ci->psy_g_param.sliding_lowpass[vb->W][k]); + ++ /* stereo threshold */ ++ _vp_remove_floor(psy_look, ++ mdct_org, ++ ilogmask, ++ resorgch, ++ ci->psy_g_param.sliding_lowpass[vb->W][k]); ++ ++ + _vp_noise_normalize(psy_look,res,res+n/2,sortindex[i]); + + +@@ -691,7 +733,8 @@ + mag_sort, + ilogmaskch, + nonzero, +- ci->psy_g_param.sliding_lowpass[vb->W][k]); ++ ci->psy_g_param.sliding_lowpass[vb->W][k], ++ gmdct, res_org); + } + + /* classify and encode by submap */ +@@ -717,6 +760,11 @@ + couple_bundle,NULL,zerobundle,ch_in_bundle,classifications); + } + ++ /* set last-window type & number */ ++ if((blocktype == b->lW_blocktype) && (modenumber == b->lW_modenumber)) b->lW_no++; ++ else b->lW_no = 1; ++ b->lW_blocktype = blocktype; ++ b->lW_modenumber = modenumber; + /* ok, done encoding. Next protopacket. */ + } + +--- lib/masking.h ++++ lib/masking.h +@@ -23,16 +23,29 @@ + + #define MAX_ATH 88 + static float ATH[]={ +- /*15*/ -51, -52, -53, -54, -55, -56, -57, -58, +- /*31*/ -59, -60, -61, -62, -63, -64, -65, -66, +- /*63*/ -67, -68, -69, -70, -71, -72, -73, -74, +- /*125*/ -75, -76, -77, -78, -80, -81, -82, -83, +- /*250*/ -84, -85, -86, -87, -88, -88, -89, -89, +- /*500*/ -90, -91, -91, -92, -93, -94, -95, -96, +- /*1k*/ -96, -97, -98, -98, -99, -99,-100,-100, +- /*2k*/ -101,-102,-103,-104,-106,-107,-107,-107, +- /*4k*/ -107,-105,-103,-102,-101, -99, -98, -96, +- /*8k*/ -95, -95, -96, -97, -96, -95, -93, -90, ++/* original ATH */ ++ /*15*/ // -51, -52, -53, -54, -55, -56, -57, -58, ++ /*31*/ // -59, -60, -61, -62, -63, -64, -65, -66, ++ /*63*/ // -67, -68, -69, -70, -71, -72, -73, -74, ++ /*125*/ // -75, -76, -77, -78, -80, -81, -82, -83, ++ /*250*/ //-84, -85, -86, -87, -88, -88, -89, -89, ++ /*500*/ //-90, -91, -91, -92, -93, -94, -95, -96, ++ /*1k*/ //-96, -97, -98, -98, -99, -99,-100,-100, ++ /*2k*/ //-101,-102,-103,-104,-106,-107,-107,-107, ++ /*4k*/ //-107,-105,-103,-102,-101, -99, -98, -96, ++ /*8k*/ //-95, -95, -96, -97, -96, -95, -93, -90, ++ /*16k*/ //-80, -70, -50, -40, -30, -30, -30, -30 ++/*Aoyumi's ATH (v6) */ ++ /*15*/ -31, -33, -35, -37, -39, -41, -43, -45, ++ /*31*/ -47, -49, -51, -53, -55, -57, -59, -61, ++ /*63*/ -63, -65, -67, -69, -71, -73, -75, -77, ++ /*125*/ -79, -81, -83, -84, -85, -86, -87, -88, ++ /*250*/ -89, -90, -91, -92, -93, -94, -95, -96, ++ /*500*/ -96, -97, -97, -97, -98, -98, -98, -99, ++ /*1k*/ -98, -97, -97, -98, -99,-100,-101,-101, ++ /*2k*/ -102,-103,-104,-105,-106,-106,-107,-107, ++ /*4k*/ -105,-104,-103,-102,-101, -99, -98, -97, ++ /*8k*/ -96, -95, -95, -96, -97, -97, -93, -89, + /*16k*/ -80, -70, -50, -40, -30, -30, -30, -30 + }; + +--- lib/modes/psych_11.h ++++ lib/modes/psych_11.h +@@ -15,25 +15,31 @@ ********************************************************************/ --static double rate_mapping_X[12]={ -- -1.,-1.,-1.,-1.,-1.,-1., -+static double rate_mapping_X[13]={ -+ -1.,-1.,-1.,-1.,-1.,-1.,-1. - -1.,-1.,-1.,-1.,-1.,-1. +-static double _psy_lowpass_11[3]={4.5,5.5,30.,}; ++static double _psy_lowpass_11[4]={4.1,4.5,5.5,30.,}; + +-static att3 _psy_tone_masteratt_11[3]={ +- {{ 30, 25, 12}, 0, 0}, /* 0 */ +- {{ 30, 25, 12}, 0, 0}, /* 0 */ +- {{ 20, 0, -14}, 0, 0}, /* 0 */ ++static att3 _psy_tone_masteratt_11[4]={ ++ {{ 31, 28, 13}, 0, 0}, /* -2 */ ++ {{ 30, 28, 12}, 0, 0}, /* -1 */ ++ {{ 30, 26, 12}, 0, 0}, /* 0 */ ++ {{ 20, 0, -14}, 0, 0}, /* 10 */ }; - ve_setup_data_template ve_setup_X_stereo={ -- 11, -+// 11, -+ 12, - rate_mapping_X, - quality_mapping_44, - 2, -@@ -72,7 +73,8 @@ ve_setup_data_template ve_setup_X_stereo +-static vp_adjblock _vp_tonemask_adj_11[3]={ ++static vp_adjblock _vp_tonemask_adj_11[4]={ + /* adjust for mode zero */ + /* 63 125 250 500 1 2 4 8 16 */ +- {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 2, 0,99,99,99}}, /* 0 */ +- {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 5, 0, 0,99,99,99}}, /* 1 */ +- {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 2 */ ++ {{-16,-16,-16,-16,-16,-16,-10,-8,-4, 0, 0, 0, 3, 3,99,99,99}}, /* -2 */ ++ {{-16,-16,-16,-16,-16,-16,-10,-8,-4, 0, 0, 0, 0, 0,99,99,99}}, /* -1 */ ++ {{-20,-20,-20,-20,-20,-16,-10,-8,-4,-2, 0, 0, 0, 0,99,99,99}}, /* 0 */ ++ {{-20,-20,-20,-20,-20,-16,-10,-8,-4,-2, 0, 0, 0, 0,99,99,99}}, /* 10 */ }; - ve_setup_data_template ve_setup_X_uncoupled={ -- 11, -+// 11, -+ 12, - rate_mapping_X, - quality_mapping_44, - -1, -@@ -123,7 +125,8 @@ ve_setup_data_template ve_setup_X_uncoup + +-static noise3 _psy_noisebias_11[3]={ ++static noise3 _psy_noisebias_11[4]={ + /* 63 125 250 500 1k 2k 4k 8k 16k*/ ++ {{{-10,-10,-10,-10, -5, -5, -4, 2, 4, 10, 10, 12, 12, 12, 99, 99, 99}, ++ {-12,-12,-12,-12, -7, -7, -2, 3, 3, 4, 4, 5, 6, 12, 99, 99, 99}, ++ {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, ++ + {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 10, 10, 12, 12, 12, 99, 99, 99}, + {-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 4, 5, 5, 10, 99, 99, 99}, + {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, +@@ -47,5 +53,5 @@ + {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}}, }; - ve_setup_data_template ve_setup_XX_stereo={ -- 2, -+// 2, -+ 3, - rate_mapping_X, - quality_mapping_8, - 2, -@@ -174,7 +177,8 @@ ve_setup_data_template ve_setup_XX_stere - }; +-static double _noise_thresh_11[3]={ .3,.5,.5 }; ++static double _noise_thresh_11[4]={ .3,.3,.5,.5 }; - ve_setup_data_template ve_setup_XX_uncoupled={ -- 2, -+// 2, -+ 3, - rate_mapping_X, - quality_mapping_8, - -1, ---- lib/modes/psych_16.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/psych_16.h 2007-08-02 12:25:50.000000000 +0200 +--- lib/modes/psych_16.h ++++ lib/modes/psych_16.h @@ -16,9 +16,13 @@ ********************************************************************/ @@ -100,7 +518,7 @@ { 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4}, { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, -@@ -36,32 +40,38 @@ static adj_stereo _psy_stereo_modes_16[4 +@@ -36,32 +40,38 @@ { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, }; @@ -153,7 +571,7 @@ {-15,-15,-15,-15,-15,-15,-15,-10, -5, -5, -5, 4, 5, 6, 8, 8, 15}, {-30,-30,-30,-30,-30,-24,-20,-14,-10,-10,-10,-10,-10,-10,-10,-10,-10}}}, -@@ -74,13 +84,17 @@ static noise3 _psy_noisebias_16_short[4] +@@ -74,13 +84,17 @@ {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}}, }; @@ -174,7 +592,7 @@ {-15,-15,-15,-15,-15,-15,-15,-10, -5, -5, -5, 0, 0, 0, 0, 4, 10}, {-30,-30,-30,-30,-30,-24,-20,-14,-10,-10,-10,-10,-10,-10,-10,-10,-10}}}, -@@ -93,9 +107,13 @@ static noise3 _psy_noisebias_16_impulse[ +@@ -93,9 +107,13 @@ {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}}, }; @@ -189,7 +607,7 @@ {-10,-10,-10,-10,-10, -5, -2, -2, 0, 0, 0, 4, 5, 6, 8, 8, 15}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}}, -@@ -119,17 +137,17 @@ static noiseguard _psy_noiseguards_16[4] +@@ -119,17 +137,17 @@ {20,20,-1}, }; @@ -214,415 +632,8 @@ }; ---- lib/modes/psych_11.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/psych_11.h 2007-08-02 12:25:50.000000000 +0200 -@@ -15,25 +15,31 @@ - - ********************************************************************/ - --static double _psy_lowpass_11[3]={4.5,5.5,30.,}; -+static double _psy_lowpass_11[4]={4.1,4.5,5.5,30.,}; - --static att3 _psy_tone_masteratt_11[3]={ -- {{ 30, 25, 12}, 0, 0}, /* 0 */ -- {{ 30, 25, 12}, 0, 0}, /* 0 */ -- {{ 20, 0, -14}, 0, 0}, /* 0 */ -+static att3 _psy_tone_masteratt_11[4]={ -+ {{ 31, 28, 13}, 0, 0}, /* -2 */ -+ {{ 30, 28, 12}, 0, 0}, /* -1 */ -+ {{ 30, 26, 12}, 0, 0}, /* 0 */ -+ {{ 20, 0, -14}, 0, 0}, /* 10 */ - }; - --static vp_adjblock _vp_tonemask_adj_11[3]={ -+static vp_adjblock _vp_tonemask_adj_11[4]={ - /* adjust for mode zero */ - /* 63 125 250 500 1 2 4 8 16 */ -- {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 2, 0,99,99,99}}, /* 0 */ -- {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 5, 0, 0,99,99,99}}, /* 1 */ -- {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 2 */ -+ {{-16,-16,-16,-16,-16,-16,-10,-8,-4, 0, 0, 0, 3, 3,99,99,99}}, /* -2 */ -+ {{-16,-16,-16,-16,-16,-16,-10,-8,-4, 0, 0, 0, 0, 0,99,99,99}}, /* -1 */ -+ {{-20,-20,-20,-20,-20,-16,-10,-8,-4,-2, 0, 0, 0, 0,99,99,99}}, /* 0 */ -+ {{-20,-20,-20,-20,-20,-16,-10,-8,-4,-2, 0, 0, 0, 0,99,99,99}}, /* 10 */ - }; - - --static noise3 _psy_noisebias_11[3]={ -+static noise3 _psy_noisebias_11[4]={ - /* 63 125 250 500 1k 2k 4k 8k 16k*/ -+ {{{-10,-10,-10,-10, -5, -5, -4, 2, 4, 10, 10, 12, 12, 12, 99, 99, 99}, -+ {-12,-12,-12,-12, -7, -7, -2, 3, 3, 4, 4, 5, 6, 12, 99, 99, 99}, -+ {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, -+ - {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 10, 10, 12, 12, 12, 99, 99, 99}, - {-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 4, 5, 5, 10, 99, 99, 99}, - {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, -@@ -47,5 +53,5 @@ static noise3 _psy_noisebias_11[3]={ - {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}}, - }; - --static double _noise_thresh_11[3]={ .3,.5,.5 }; -+static double _noise_thresh_11[4]={ .3,.3,.5,.5 }; - ---- lib/modes/setup_32.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/setup_32.h 2007-08-02 12:25:50.000000000 +0200 -@@ -15,22 +15,26 @@ - - ********************************************************************/ - --static double rate_mapping_32[12]={ -- 18000.,28000.,35000.,45000.,56000.,60000., -+static double rate_mapping_32[13]={ -+// 18000.,28000.,35000.,45000.,56000.,60000., -+ 14000.,21000.,28000.,35000.,45000.,56000.,60000., - 75000.,90000.,100000.,115000.,150000.,190000., - }; - --static double rate_mapping_32_un[12]={ -- 30000.,42000.,52000.,64000.,72000.,78000., -+static double rate_mapping_32_un[13]={ -+// 30000.,42000.,52000.,64000.,72000.,78000., -+ 26000.,32000.,42000.,52000.,64000.,72000.,78000., - 86000.,92000.,110000.,120000.,140000.,190000., - }; - --static double _psy_lowpass_32[12]={ -- 12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99. -+static double _psy_lowpass_32[13]={ -+// 12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99. -+ 12.1,12.6,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99. - }; - - ve_setup_data_template ve_setup_32_stereo={ -- 11, -+// 11, -+ 12, - rate_mapping_32, - quality_mapping_44, - 2, -@@ -59,7 +63,7 @@ ve_setup_data_template ve_setup_32_stere - _psy_compand_short_mapping, - _psy_compand_long_mapping, - -- {_noise_start_short_44,_noise_start_long_44}, -+ {_noise_start_short_32,_noise_start_long_32}, - {_noise_part_short_44,_noise_part_long_44}, - _noise_thresh_44, - -@@ -81,7 +85,8 @@ ve_setup_data_template ve_setup_32_stere - }; - - ve_setup_data_template ve_setup_32_uncoupled={ -- 11, -+// 11, -+ 12, - rate_mapping_32_un, - quality_mapping_44, - -1, -@@ -110,7 +115,7 @@ ve_setup_data_template ve_setup_32_uncou - _psy_compand_short_mapping, - _psy_compand_long_mapping, - -- {_noise_start_short_44,_noise_start_long_44}, -+ {_noise_start_short_32,_noise_start_long_32}, - {_noise_part_short_44,_noise_part_long_44}, - _noise_thresh_44, - ---- lib/modes/residue_44u.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/residue_44u.h 2007-08-02 12:25:50.000000000 +0200 -@@ -304,6 +304,7 @@ static vorbis_residue_template _res_44u_ - }; - - static vorbis_mapping_template _mapres_template_44_uncoupled[]={ -+ { _map_nominal_u, _res_44u_n1 }, /* -2 */ - { _map_nominal_u, _res_44u_n1 }, /* -1 */ - { _map_nominal_u, _res_44u_0 }, /* 0 */ - { _map_nominal_u, _res_44u_1 }, /* 1 */ ---- lib/modes/psych_8.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/psych_8.h 2007-08-02 12:25:50.000000000 +0200 -@@ -15,23 +15,29 @@ - - ********************************************************************/ - --static att3 _psy_tone_masteratt_8[3]={ -- {{ 32, 25, 12}, 0, 0}, /* 0 */ -- {{ 30, 25, 12}, 0, 0}, /* 0 */ -- {{ 20, 0, -14}, 0, 0}, /* 0 */ -+static att3 _psy_tone_masteratt_8[4]={ -+ {{ 33, 28, 13}, 0, 0}, /* -2 */ -+ {{ 32, 28, 12}, 0, 0}, /* -1 */ -+ {{ 30, 26, 12}, 0, 0}, /* 0 */ -+ {{ 20, 0, -14}, 0, 0}, /* 10 */ - }; - --static vp_adjblock _vp_tonemask_adj_8[3]={ -+static vp_adjblock _vp_tonemask_adj_8[4]={ - /* adjust for mode zero */ - /* 63 125 250 500 1 2 4 8 16 */ -- {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */ -- {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */ -- {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 1 */ -+ {{-15,-15,-15,-15,-10,-10, -6,-2, 0, 0, 0, 0, 3, 3,99,99,99}}, /* -2 */ -+ {{-15,-15,-15,-15,-10,-10, -6,-2, 0, 0, 0, 0, 0, 0,99,99,99}}, /* -1 */ -+ {{-15,-15,-15,-15,-10,-10, -6,-2, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 0 */ -+ {{-15,-15,-15,-15,-10,-10, -6,-2, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 10 */ - }; - - --static noise3 _psy_noisebias_8[3]={ -+static noise3 _psy_noisebias_8[4]={ - /* 63 125 250 500 1k 2k 4k 8k 16k*/ -+ {{{-10,-10,-10,-10, -5, -5, -5, 3, 4, 8, 8, 8, 10, 10, 99, 99, 99}, -+ {-10,-10,-10,-10, -5, -2, -2, 3, 3, 4, 4, 5, 6, 8, 99, 99, 99}, -+ {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, -+ - {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 8, 8, 8, 10, 10, 99, 99, 99}, - {-10,-10,-10,-10, -5, -5, -5, 0, 0, 4, 4, 4, 4, 4, 99, 99, 99}, - {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, -@@ -46,9 +52,13 @@ static noise3 _psy_noisebias_8[3]={ - }; - - /* stereo mode by base quality level */ --static adj_stereo _psy_stereo_modes_8[3]={ -+static adj_stereo _psy_stereo_modes_8[4]={ - /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ - {{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, -+ { 6, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4}, -+ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, -+ { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, -+ {{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, - { 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, -@@ -62,12 +72,20 @@ static adj_stereo _psy_stereo_modes_8[3] - { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, - }; - --static noiseguard _psy_noiseguards_8[2]={ -+static noiseguard _psy_noiseguards_8[3]={ -+ {10,10,-1}, - {10,10,-1}, - {10,10,-1}, - }; - --static compandblock _psy_compand_8[2]={ -+static compandblock _psy_compand_8[3]={ -+ {{ -+ 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */ -+ 8, 8, 9, 9,10,10,11, 11, /* 15dB */ -+ 12,12,13,13,14,14,15, 16, /* 23dB */ -+ 17,18,19,20,21,22,23, 24, /* 31dB */ -+ 25,26,27,28,29,30,31, 32, /* 39dB */ -+ }}, - {{ - 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */ - 8, 8, 9, 9,10,10,11, 11, /* 15dB */ -@@ -84,19 +102,19 @@ static compandblock _psy_compand_8[2]={ - }}, - }; - --static double _psy_lowpass_8[3]={3.,4.,4.}; --static int _noise_start_8[2]={ -- 64,64, -+static double _psy_lowpass_8[4]={2.6,3.,4.,4.}; -+static int _noise_start_8[3]={ -+ 64,64,64, - }; --static int _noise_part_8[2]={ -- 8,8, -+static int _noise_part_8[3]={ -+ 8,8,8, - }; - --static int _psy_ath_floater_8[3]={ -- -100,-100,-105, -+static int _psy_ath_floater_8[4]={ -+ -100,-100,-100,-105, - }; - --static int _psy_ath_abs_8[3]={ -- -130,-130,-140, -+static int _psy_ath_abs_8[4]={ -+ -130,-130,-130,-140, - }; - ---- lib/modes/setup_16.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/setup_16.h 2007-08-02 12:25:50.000000000 +0200 -@@ -18,36 +18,40 @@ - #include "psych_16.h" - #include "residue_16.h" - --static int blocksize_16_short[3]={ -- 1024,512,512 -+static int blocksize_16_short[4]={ -+ 1024,1024,512,512 - }; --static int blocksize_16_long[3]={ -- 1024,1024,1024 -+static int blocksize_16_long[4]={ -+ 1024,1024,1024,1024 - }; - --static int _floor_mapping_16_short[3]={ -- 9,3,3 -+static int _floor_mapping_16_short[4]={ -+ 9,9,3,3 - }; --static int _floor_mapping_16[3]={ -- 9,9,9 -+static int _floor_mapping_16[4]={ -+ 9,9,9,9 - }; - --static double rate_mapping_16[4]={ -- 12000.,20000.,44000.,86000. -+static double rate_mapping_16[5]={ -+// 12000.,20000.,44000.,86000. -+ 10000.,12000.,20000.,44000.,86000. - }; - --static double rate_mapping_16_uncoupled[4]={ -- 16000.,28000.,64000.,100000. -+static double rate_mapping_16_uncoupled[5]={ -+// 16000.,28000.,64000.,100000. -+ 16000.,18000.,28000.,64000.,100000. - }; - --static double _global_mapping_16[4]={ 1., 2., 3., 4. }; -+static double _global_mapping_16[5]={ 2., 2., 3., 4., 5. }; - --static double quality_mapping_16[4]={ -.1,.05,.5,1. }; -+static double quality_mapping_16[5]={ -.2,-.1,.05,.5,1. }; - --static double _psy_compand_16_mapping[4]={ 0., .8, 1., 1.}; -+//static double _psy_compand_16_mapping[5]={ 0., 0., .8, 1., 1.}; -+static double _psy_compand_16_mapping[5]={ 0., 1., 1.8, 2., 2.}; - - ve_setup_data_template ve_setup_16_stereo={ -- 3, -+// 3, -+ 4, - rate_mapping_16, - quality_mapping_16, - 2, -@@ -98,7 +102,8 @@ ve_setup_data_template ve_setup_16_stere - }; - - ve_setup_data_template ve_setup_16_uncoupled={ -- 3, -+// 3, -+ 4, - rate_mapping_16_uncoupled, - quality_mapping_16, - -1, ---- lib/modes/setup_11.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/setup_11.h 2007-08-02 12:25:50.000000000 +0200 -@@ -17,28 +17,31 @@ - - #include "psych_11.h" - --static int blocksize_11[2]={ -- 512,512 -+static int blocksize_11[3]={ -+ 512,512,512 - }; - --static int _floor_mapping_11[2]={ -- 6,6, -+static int _floor_mapping_11[3]={ -+ 6,6,6 - }; - --static double rate_mapping_11[3]={ -- 8000.,13000.,44000., -+static double rate_mapping_11[4]={ -+// 8000.,13000.,44000., -+ 8000.,10000.,13000.,44000., - }; - --static double rate_mapping_11_uncoupled[3]={ -- 12000.,20000.,50000., -+static double rate_mapping_11_uncoupled[4]={ -+// 12000.,20000.,50000., -+ 14000.,16000.,20000.,50000., - }; - --static double quality_mapping_11[3]={ -- -.1,.0,1. -+static double quality_mapping_11[4]={ -+ -.2,-.1,.0,1. - }; - - ve_setup_data_template ve_setup_11_stereo={ -- 2, -+// 2, -+ 3, - rate_mapping_11, - quality_mapping_11, - 2, -@@ -89,7 +92,8 @@ ve_setup_data_template ve_setup_11_stere - }; - - ve_setup_data_template ve_setup_11_uncoupled={ -- 2, -+// 2, -+ 3, - rate_mapping_11_uncoupled, - quality_mapping_11, - -1, ---- lib/modes/residue_44.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/residue_44.h 2007-08-02 12:25:50.000000000 +0200 -@@ -278,6 +278,7 @@ static vorbis_residue_template _res_44s_ - }; - - static vorbis_mapping_template _mapres_template_44_stereo[]={ -+ { _map_nominal, _res_44s_n1 }, /* -2 */ - { _map_nominal, _res_44s_n1 }, /* -1 */ - { _map_nominal, _res_44s_0 }, /* 0 */ - { _map_nominal, _res_44s_1 }, /* 1 */ ---- lib/modes/setup_22.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/setup_22.h 2007-08-02 12:25:50.000000000 +0200 -@@ -15,18 +15,21 @@ - - ********************************************************************/ - --static double rate_mapping_22[4]={ -- 15000.,20000.,44000.,86000. -+static double rate_mapping_22[5]={ -+// 15000.,20000.,44000.,86000. -+ 14000.,16000.,20000.,44000.,86000. - }; - --static double rate_mapping_22_uncoupled[4]={ -- 16000.,28000.,50000.,90000. -+static double rate_mapping_22_uncoupled[5]={ -+// 16000.,28000.,50000.,90000. -+ 22000.,24000.,28000.,50000.,90000. - }; - --static double _psy_lowpass_22[4]={9.5,11.,30.,99.}; -+static double _psy_lowpass_22[5]={8.5,9.5,11.,30.,99.}; - - ve_setup_data_template ve_setup_22_stereo={ -- 3, -+// 3, -+ 4, - rate_mapping_22, - quality_mapping_16, - 2, -@@ -77,7 +80,8 @@ ve_setup_data_template ve_setup_22_stere - }; - - ve_setup_data_template ve_setup_22_uncoupled={ -- 3, -+// 3, -+ 4, - rate_mapping_22_uncoupled, - quality_mapping_16, - -1, ---- lib/modes/psych_44.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/psych_44.h 2007-08-02 12:25:50.000000000 +0200 +--- lib/modes/psych_44.h ++++ lib/modes/psych_44.h @@ -18,10 +18,26 @@ /* preecho trigger settings *****************************************/ @@ -653,7 +664,7 @@ {-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f, -6.f, {99.},{{99.},{99.}},{0},{0},{{0.},{0.}} -@@ -39,14 +55,17 @@ static vorbis_info_psy_global _psy_globa +@@ -39,14 +55,17 @@ {99.},{{99.},{99.}},{0},{0},{{0.},{0.}} }, {8, /* lines per eighth octave */ @@ -674,7 +685,7 @@ -6.f, {99.},{{99.},{99.}},{0},{0},{{0.},{0.}} }, -@@ -56,26 +75,41 @@ static vorbis_info_psy_global _psy_globa +@@ -56,26 +75,41 @@ static compandblock _psy_compand_44[6]={ /* sub-mode Z short */ {{ @@ -725,7 +736,7 @@ 11,12,13,14,15,16,17, 18, /* 39dB */ }}, /* sub-mode Z long */ -@@ -96,172 +130,189 @@ static compandblock _psy_compand_44[6]={ +@@ -96,172 +130,189 @@ }}, /* mode A long */ {{ @@ -997,7 +1008,7 @@ /* 10 */ {{{-30,-30,-30,-30,-30,-30,-30,-28,-20,-14,-14,-14,-14,-14,-14,-12,-10}, {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-20}, -@@ -269,65 +320,74 @@ static noise3 _psy_noisebias_trans[12]={ +@@ -269,65 +320,74 @@ }; /* noise bias (long block) */ @@ -1109,7 +1120,7 @@ {-26,-26,-26,-26,-26,-26,-26,-22,-20,-19,-19,-19,-19,-18,-17,-16,-12}}}, /* 8 */ {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 0, 0, 0, 0, 1, 2, 3, 7}, -@@ -344,67 +404,85 @@ static noise3 _psy_noisebias_long[12]={ +@@ -344,67 +404,85 @@ }; /* noise bias (impulse block) */ @@ -1227,7 +1238,7 @@ {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}}, /* 10 */ {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-16,-16,-16,-16,-16,-14,-12}, -@@ -413,28 +491,36 @@ static noise3 _psy_noisebias_impulse[12] +@@ -413,28 +491,36 @@ }; /* noise bias (padding block) */ @@ -1274,7 +1285,7 @@ {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}}, /* 3 */ {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14}, -@@ -453,16 +539,22 @@ static noise3 _psy_noisebias_padding[12] +@@ -453,16 +539,22 @@ {-34,-34,-34,-34,-30,-30,-24,-20,-14, -8, -4, -4, -4, -4, -3, -1, 4}, {-34,-34,-34,-34,-34,-30,-26,-20,-16,-13,-13,-13,-13,-13,-11, -8, -6}}}, /* 7 */ @@ -1299,7 +1310,7 @@ {-40,-40,-40,-40,-40,-40,-40,-32,-26,-24,-24,-24,-24,-24,-24,-20,-18}}}, /* 10 */ {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-12,-12,-12,-12,-12,-10, -8}, -@@ -478,14 +570,17 @@ static noiseguard _psy_noiseguards_44[4] +@@ -478,14 +570,17 @@ {10,10,100}, }; @@ -1325,7 +1336,7 @@ }; static vorbis_info_psy _psy_info_template={ -@@ -506,11 +601,13 @@ static vorbis_info_psy _psy_info_templat +@@ -506,11 +601,13 @@ /* ath ****************/ @@ -1344,7 +1355,7 @@ }; /* stereo setup. These don't map directly to quality level, there's -@@ -522,14 +619,22 @@ static int _psy_ath_abs[12]={ +@@ -522,14 +619,22 @@ /* various stereo possibilities */ /* stereo mode by base quality level */ @@ -1372,7 +1383,7 @@ /*{{ 4, 4, 4, 4, 4, 4, 4, 3, 2, 2, 1, 0, 0, 0, 0}, { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 4, 3}, { 1, 2, 3, 4, 5, 5, 6, 6, 6, 6, 6, 7, 8, 8, 8}, -@@ -538,76 +643,76 @@ static adj_stereo _psy_stereo_modes_44[1 +@@ -538,76 +643,76 @@ { 8, 8, 8, 8, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 3}, { 1, 2, 3, 4, 4, 5, 6, 6, 6, 6, 6, 8, 8, 8, 8}, { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}}, @@ -1485,7 +1496,7 @@ {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, -@@ -615,14 +720,16 @@ static adj_stereo _psy_stereo_modes_44[1 +@@ -615,14 +720,16 @@ }; /* tone master attenuation by base quality mode and bitrate tweak */ @@ -1510,7 +1521,7 @@ {{ 20, 9, -4}, 0, 0}, /* 4 */ {{ 20, 6, -6}, 0, 0}, /* 5 */ {{ 20, 3, -10}, 0, 0}, /* 6 */ -@@ -633,34 +740,50 @@ static att3 _psy_tone_masteratt_44[12]={ +@@ -633,34 +740,50 @@ }; /* lowpass by mode **************/ @@ -1573,71 +1584,408 @@ +// 320,320,160,160,320,640,9999,9999,9999,9999,9999,9999 + 320,320,160,160,320,640,9999,9999,9999,9999,9999,9999 +}; ---- lib/modes/setup_8.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/setup_8.h 2007-08-02 12:25:50.000000000 +0200 -@@ -18,32 +18,37 @@ - #include "psych_8.h" - #include "residue_8.h" +--- lib/modes/psych_8.h ++++ lib/modes/psych_8.h +@@ -15,23 +15,29 @@ --static int blocksize_8[2]={ + ********************************************************************/ + +-static att3 _psy_tone_masteratt_8[3]={ +- {{ 32, 25, 12}, 0, 0}, /* 0 */ +- {{ 30, 25, 12}, 0, 0}, /* 0 */ +- {{ 20, 0, -14}, 0, 0}, /* 0 */ ++static att3 _psy_tone_masteratt_8[4]={ ++ {{ 33, 28, 13}, 0, 0}, /* -2 */ ++ {{ 32, 28, 12}, 0, 0}, /* -1 */ ++ {{ 30, 26, 12}, 0, 0}, /* 0 */ ++ {{ 20, 0, -14}, 0, 0}, /* 10 */ + }; + +-static vp_adjblock _vp_tonemask_adj_8[3]={ ++static vp_adjblock _vp_tonemask_adj_8[4]={ + /* adjust for mode zero */ + /* 63 125 250 500 1 2 4 8 16 */ +- {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */ +- {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */ +- {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 1 */ ++ {{-15,-15,-15,-15,-10,-10, -6,-2, 0, 0, 0, 0, 3, 3,99,99,99}}, /* -2 */ ++ {{-15,-15,-15,-15,-10,-10, -6,-2, 0, 0, 0, 0, 0, 0,99,99,99}}, /* -1 */ ++ {{-15,-15,-15,-15,-10,-10, -6,-2, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 0 */ ++ {{-15,-15,-15,-15,-10,-10, -6,-2, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 10 */ + }; + + +-static noise3 _psy_noisebias_8[3]={ ++static noise3 _psy_noisebias_8[4]={ + /* 63 125 250 500 1k 2k 4k 8k 16k*/ ++ {{{-10,-10,-10,-10, -5, -5, -5, 3, 4, 8, 8, 8, 10, 10, 99, 99, 99}, ++ {-10,-10,-10,-10, -5, -2, -2, 3, 3, 4, 4, 5, 6, 8, 99, 99, 99}, ++ {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, ++ + {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 8, 8, 8, 10, 10, 99, 99, 99}, + {-10,-10,-10,-10, -5, -5, -5, 0, 0, 4, 4, 4, 4, 4, 99, 99, 99}, + {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, +@@ -46,9 +52,13 @@ + }; + + /* stereo mode by base quality level */ +-static adj_stereo _psy_stereo_modes_8[3]={ ++static adj_stereo _psy_stereo_modes_8[4]={ + /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ + {{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, ++ { 6, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4}, ++ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, ++ { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, ++ {{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, + { 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, +@@ -62,12 +72,20 @@ + { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, + }; + +-static noiseguard _psy_noiseguards_8[2]={ ++static noiseguard _psy_noiseguards_8[3]={ ++ {10,10,-1}, + {10,10,-1}, + {10,10,-1}, + }; + +-static compandblock _psy_compand_8[2]={ ++static compandblock _psy_compand_8[3]={ ++ {{ ++ 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */ ++ 8, 8, 9, 9,10,10,11, 11, /* 15dB */ ++ 12,12,13,13,14,14,15, 16, /* 23dB */ ++ 17,18,19,20,21,22,23, 24, /* 31dB */ ++ 25,26,27,28,29,30,31, 32, /* 39dB */ ++ }}, + {{ + 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */ + 8, 8, 9, 9,10,10,11, 11, /* 15dB */ +@@ -84,19 +102,19 @@ + }}, + }; + +-static double _psy_lowpass_8[3]={3.,4.,4.}; +-static int _noise_start_8[2]={ +- 64,64, ++static double _psy_lowpass_8[4]={2.6,3.,4.,4.}; ++static int _noise_start_8[3]={ ++ 64,64,64, + }; +-static int _noise_part_8[2]={ +- 8,8, ++static int _noise_part_8[3]={ ++ 8,8,8, + }; + +-static int _psy_ath_floater_8[3]={ +- -100,-100,-105, ++static int _psy_ath_floater_8[4]={ ++ -100,-100,-100,-105, + }; + +-static int _psy_ath_abs_8[3]={ +- -130,-130,-140, ++static int _psy_ath_abs_8[4]={ ++ -130,-130,-130,-140, + }; + +--- lib/modes/residue_16.h ++++ lib/modes/residue_16.h +@@ -84,7 +84,8 @@ + &_resbook_16s_2,&_resbook_16s_2} + }; + +-static vorbis_mapping_template _mapres_template_16_stereo[3]={ ++static vorbis_mapping_template _mapres_template_16_stereo[4]={ ++ { _map_nominal, _res_16s_0 }, /* -1 */ + { _map_nominal, _res_16s_0 }, /* 0 */ + { _map_nominal, _res_16s_1 }, /* 1 */ + { _map_nominal, _res_16s_2 }, /* 2 */ +@@ -156,7 +157,8 @@ + }; + + +-static vorbis_mapping_template _mapres_template_16_uncoupled[3]={ ++static vorbis_mapping_template _mapres_template_16_uncoupled[4]={ ++ { _map_nominal_u, _res_16u_0 }, /* -1 */ + { _map_nominal_u, _res_16u_0 }, /* 0 */ + { _map_nominal_u, _res_16u_1 }, /* 1 */ + { _map_nominal_u, _res_16u_2 }, /* 2 */ +--- lib/modes/residue_44.h ++++ lib/modes/residue_44.h +@@ -278,6 +278,7 @@ + }; + + static vorbis_mapping_template _mapres_template_44_stereo[]={ ++ { _map_nominal, _res_44s_n1 }, /* -2 */ + { _map_nominal, _res_44s_n1 }, /* -1 */ + { _map_nominal, _res_44s_0 }, /* 0 */ + { _map_nominal, _res_44s_1 }, /* 1 */ +--- lib/modes/residue_44u.h ++++ lib/modes/residue_44u.h +@@ -304,6 +304,7 @@ + }; + + static vorbis_mapping_template _mapres_template_44_uncoupled[]={ ++ { _map_nominal_u, _res_44u_n1 }, /* -2 */ + { _map_nominal_u, _res_44u_n1 }, /* -1 */ + { _map_nominal_u, _res_44u_0 }, /* 0 */ + { _map_nominal_u, _res_44u_1 }, /* 1 */ +--- lib/modes/residue_8.h ++++ lib/modes/residue_8.h +@@ -60,7 +60,8 @@ + &_resbook_8s_1,&_resbook_8s_1}, + }; + +-static vorbis_mapping_template _mapres_template_8_stereo[2]={ ++static vorbis_mapping_template _mapres_template_8_stereo[3]={ ++ { _map_nominal, _res_8s_0 }, /* -1 */ + { _map_nominal, _res_8s_0 }, /* 0 */ + { _map_nominal, _res_8s_1 }, /* 1 */ + }; +@@ -103,7 +104,8 @@ + &_resbook_8u_1,&_resbook_8u_1}, + }; + +-static vorbis_mapping_template _mapres_template_8_uncoupled[2]={ ++static vorbis_mapping_template _mapres_template_8_uncoupled[3]={ ++ { _map_nominal_u, _res_8u_0 }, /* -1 */ + { _map_nominal_u, _res_8u_0 }, /* 0 */ + { _map_nominal_u, _res_8u_1 }, /* 1 */ + }; +--- lib/modes/setup_11.h ++++ lib/modes/setup_11.h +@@ -17,28 +17,31 @@ + + #include "psych_11.h" + +-static int blocksize_11[2]={ - 512,512 -+static int blocksize_8[3]={ ++static int blocksize_11[3]={ + 512,512,512 }; --static int _floor_mapping_8[2]={ +-static int _floor_mapping_11[2]={ - 6,6, -+static int _floor_mapping_8[3]={ ++static int _floor_mapping_11[3]={ + 6,6,6 }; --static double rate_mapping_8[3]={ -- 6000.,9000.,32000., -+static double rate_mapping_8[4]={ -+// 6000.,9000.,32000., -+ 5000.,6000.,9000.,32000., +-static double rate_mapping_11[3]={ +- 8000.,13000.,44000., ++static double rate_mapping_11[4]={ ++// 8000.,13000.,44000., ++ 8000.,10000.,13000.,44000., }; --static double rate_mapping_8_uncoupled[3]={ -- 8000.,14000.,42000., -+static double rate_mapping_8_uncoupled[4]={ -+// 8000.,14000.,42000., -+ 8000.,10000.,14000.,42000., +-static double rate_mapping_11_uncoupled[3]={ +- 12000.,20000.,50000., ++static double rate_mapping_11_uncoupled[4]={ ++// 12000.,20000.,50000., ++ 14000.,16000.,20000.,50000., }; --static double quality_mapping_8[3]={ +-static double quality_mapping_11[3]={ - -.1,.0,1. -+static double quality_mapping_8[4]={ ++static double quality_mapping_11[4]={ + -.2,-.1,.0,1. }; --static double _psy_compand_8_mapping[3]={ 0., 1., 1.}; -+//static double _psy_compand_8_mapping[3]={ 0., 1., 1.}; -+static double _psy_compand_8_mapping[4]={ 0., 1., 2., 2.}; - --static double _global_mapping_8[3]={ 1., 2., 3. }; -+//static double _global_mapping_8[3]={ 1., 2., 3. }; -+static double _global_mapping_8[4]={ 2., 2., 3., 4. }; - - ve_setup_data_template ve_setup_8_stereo={ + ve_setup_data_template ve_setup_11_stereo={ - 2, +// 2, + 3, - rate_mapping_8, - quality_mapping_8, + rate_mapping_11, + quality_mapping_11, 2, -@@ -94,7 +99,8 @@ ve_setup_data_template ve_setup_8_stereo +@@ -89,7 +92,8 @@ }; - ve_setup_data_template ve_setup_8_uncoupled={ + ve_setup_data_template ve_setup_11_uncoupled={ - 2, +// 2, + 3, - rate_mapping_8_uncoupled, - quality_mapping_8, + rate_mapping_11_uncoupled, + quality_mapping_11, -1, ---- lib/modes/setup_44.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/setup_44.h 2007-08-02 12:25:50.000000000 +0200 +--- lib/modes/setup_16.h ++++ lib/modes/setup_16.h +@@ -18,36 +18,40 @@ + #include "psych_16.h" + #include "residue_16.h" + +-static int blocksize_16_short[3]={ +- 1024,512,512 ++static int blocksize_16_short[4]={ ++ 1024,1024,512,512 + }; +-static int blocksize_16_long[3]={ +- 1024,1024,1024 ++static int blocksize_16_long[4]={ ++ 1024,1024,1024,1024 + }; + +-static int _floor_mapping_16_short[3]={ +- 9,3,3 ++static int _floor_mapping_16_short[4]={ ++ 9,9,3,3 + }; +-static int _floor_mapping_16[3]={ +- 9,9,9 ++static int _floor_mapping_16[4]={ ++ 9,9,9,9 + }; + +-static double rate_mapping_16[4]={ +- 12000.,20000.,44000.,86000. ++static double rate_mapping_16[5]={ ++// 12000.,20000.,44000.,86000. ++ 10000.,12000.,20000.,44000.,86000. + }; + +-static double rate_mapping_16_uncoupled[4]={ +- 16000.,28000.,64000.,100000. ++static double rate_mapping_16_uncoupled[5]={ ++// 16000.,28000.,64000.,100000. ++ 16000.,18000.,28000.,64000.,100000. + }; + +-static double _global_mapping_16[4]={ 1., 2., 3., 4. }; ++static double _global_mapping_16[5]={ 2., 2., 3., 4., 5. }; + +-static double quality_mapping_16[4]={ -.1,.05,.5,1. }; ++static double quality_mapping_16[5]={ -.2,-.1,.05,.5,1. }; + +-static double _psy_compand_16_mapping[4]={ 0., .8, 1., 1.}; ++//static double _psy_compand_16_mapping[5]={ 0., 0., .8, 1., 1.}; ++static double _psy_compand_16_mapping[5]={ 0., 1., 1.8, 2., 2.}; + + ve_setup_data_template ve_setup_16_stereo={ +- 3, ++// 3, ++ 4, + rate_mapping_16, + quality_mapping_16, + 2, +@@ -98,7 +102,8 @@ + }; + + ve_setup_data_template ve_setup_16_uncoupled={ +- 3, ++// 3, ++ 4, + rate_mapping_16_uncoupled, + quality_mapping_16, + -1, +--- lib/modes/setup_22.h ++++ lib/modes/setup_22.h +@@ -15,18 +15,21 @@ + + ********************************************************************/ + +-static double rate_mapping_22[4]={ +- 15000.,20000.,44000.,86000. ++static double rate_mapping_22[5]={ ++// 15000.,20000.,44000.,86000. ++ 14000.,16000.,20000.,44000.,86000. + }; + +-static double rate_mapping_22_uncoupled[4]={ +- 16000.,28000.,50000.,90000. ++static double rate_mapping_22_uncoupled[5]={ ++// 16000.,28000.,50000.,90000. ++ 22000.,24000.,28000.,50000.,90000. + }; + +-static double _psy_lowpass_22[4]={9.5,11.,30.,99.}; ++static double _psy_lowpass_22[5]={8.5,9.5,11.,30.,99.}; + + ve_setup_data_template ve_setup_22_stereo={ +- 3, ++// 3, ++ 4, + rate_mapping_22, + quality_mapping_16, + 2, +@@ -77,7 +80,8 @@ + }; + + ve_setup_data_template ve_setup_22_uncoupled={ +- 3, ++// 3, ++ 4, + rate_mapping_22_uncoupled, + quality_mapping_16, + -1, +--- lib/modes/setup_32.h ++++ lib/modes/setup_32.h +@@ -15,22 +15,26 @@ + + ********************************************************************/ + +-static double rate_mapping_32[12]={ +- 18000.,28000.,35000.,45000.,56000.,60000., ++static double rate_mapping_32[13]={ ++// 18000.,28000.,35000.,45000.,56000.,60000., ++ 14000.,21000.,28000.,35000.,45000.,56000.,60000., + 75000.,90000.,100000.,115000.,150000.,190000., + }; + +-static double rate_mapping_32_un[12]={ +- 30000.,42000.,52000.,64000.,72000.,78000., ++static double rate_mapping_32_un[13]={ ++// 30000.,42000.,52000.,64000.,72000.,78000., ++ 26000.,32000.,42000.,52000.,64000.,72000.,78000., + 86000.,92000.,110000.,120000.,140000.,190000., + }; + +-static double _psy_lowpass_32[12]={ +- 12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99. ++static double _psy_lowpass_32[13]={ ++// 12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99. ++ 12.1,12.6,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99. + }; + + ve_setup_data_template ve_setup_32_stereo={ +- 11, ++// 11, ++ 12, + rate_mapping_32, + quality_mapping_44, + 2, +@@ -59,7 +63,7 @@ + _psy_compand_short_mapping, + _psy_compand_long_mapping, + +- {_noise_start_short_44,_noise_start_long_44}, ++ {_noise_start_short_32,_noise_start_long_32}, + {_noise_part_short_44,_noise_part_long_44}, + _noise_thresh_44, + +@@ -81,7 +85,8 @@ + }; + + ve_setup_data_template ve_setup_32_uncoupled={ +- 11, ++// 11, ++ 12, + rate_mapping_32_un, + quality_mapping_44, + -1, +@@ -110,7 +115,7 @@ + _psy_compand_short_mapping, + _psy_compand_long_mapping, + +- {_noise_start_short_44,_noise_start_long_44}, ++ {_noise_start_short_32,_noise_start_long_32}, + {_noise_part_short_44,_noise_part_long_44}, + _noise_thresh_44, + +--- lib/modes/setup_44.h ++++ lib/modes/setup_44.h @@ -19,43 +19,47 @@ #include "modes/residue_44.h" #include "modes/psych_44.h" @@ -1705,52 +2053,8 @@ rate_mapping_44_stereo, quality_mapping_44, 2, ---- lib/modes/residue_16.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/residue_16.h 2007-08-02 12:25:50.000000000 +0200 -@@ -84,7 +84,8 @@ static vorbis_residue_template _res_16s_ - &_resbook_16s_2,&_resbook_16s_2} - }; - --static vorbis_mapping_template _mapres_template_16_stereo[3]={ -+static vorbis_mapping_template _mapres_template_16_stereo[4]={ -+ { _map_nominal, _res_16s_0 }, /* -1 */ - { _map_nominal, _res_16s_0 }, /* 0 */ - { _map_nominal, _res_16s_1 }, /* 1 */ - { _map_nominal, _res_16s_2 }, /* 2 */ -@@ -156,7 +157,8 @@ static vorbis_residue_template _res_16u_ - }; - - --static vorbis_mapping_template _mapres_template_16_uncoupled[3]={ -+static vorbis_mapping_template _mapres_template_16_uncoupled[4]={ -+ { _map_nominal_u, _res_16u_0 }, /* -1 */ - { _map_nominal_u, _res_16u_0 }, /* 0 */ - { _map_nominal_u, _res_16u_1 }, /* 1 */ - { _map_nominal_u, _res_16u_2 }, /* 2 */ ---- lib/modes/residue_8.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/residue_8.h 2007-08-02 12:25:50.000000000 +0200 -@@ -60,7 +60,8 @@ static vorbis_residue_template _res_8s_1 - &_resbook_8s_1,&_resbook_8s_1}, - }; - --static vorbis_mapping_template _mapres_template_8_stereo[2]={ -+static vorbis_mapping_template _mapres_template_8_stereo[3]={ -+ { _map_nominal, _res_8s_0 }, /* -1 */ - { _map_nominal, _res_8s_0 }, /* 0 */ - { _map_nominal, _res_8s_1 }, /* 1 */ - }; -@@ -103,7 +104,8 @@ static vorbis_residue_template _res_8u_1 - &_resbook_8u_1,&_resbook_8u_1}, - }; - --static vorbis_mapping_template _mapres_template_8_uncoupled[2]={ -+static vorbis_mapping_template _mapres_template_8_uncoupled[3]={ -+ { _map_nominal_u, _res_8u_0 }, /* -1 */ - { _map_nominal_u, _res_8u_0 }, /* 0 */ - { _map_nominal_u, _res_8u_1 }, /* 1 */ - }; ---- lib/modes/setup_44u.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/modes/setup_44u.h 2007-08-02 12:25:50.000000000 +0200 +--- lib/modes/setup_44u.h ++++ lib/modes/setup_44u.h @@ -17,13 +17,15 @@ #include "modes/residue_44u.h" @@ -1770,216 +2074,121 @@ rate_mapping_44_un, quality_mapping_44, -1, ---- lib/mapping0.c-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/mapping0.c 2007-08-02 12:25:50.000000000 +0200 -@@ -246,11 +246,14 @@ static int mapping0_forward(vorbis_block - codec_setup_info *ci=vi->codec_setup; - private_state *b=vb->vd->backend_state; - vorbis_block_internal *vbi=(vorbis_block_internal *)vb->internal; -+ vorbis_info_floor1 *vif=ci->floor_param[vb->W]; - int n=vb->pcmend; - int i,j,k; +--- lib/modes/setup_8.h ++++ lib/modes/setup_8.h +@@ -18,32 +18,37 @@ + #include "psych_8.h" + #include "residue_8.h" - int *nonzero = alloca(sizeof(*nonzero)*vi->channels); - float **gmdct = _vorbis_block_alloc(vb,vi->channels*sizeof(*gmdct)); -+ float **gmdct_org = _vorbis_block_alloc(vb,vi->channels*sizeof(*gmdct_org)); -+ float **res_org = _vorbis_block_alloc(vb,vi->channels*sizeof(*res_org)); - int **ilogmaskch= _vorbis_block_alloc(vb,vi->channels*sizeof(*ilogmaskch)); - int ***floor_posts = _vorbis_block_alloc(vb,vi->channels*sizeof(*floor_posts)); - -@@ -273,6 +276,8 @@ static int mapping0_forward(vorbis_block - float *logfft =pcm; - - gmdct[i]=_vorbis_block_alloc(vb,n/2*sizeof(**gmdct)); -+ gmdct_org[i]=_vorbis_block_alloc(vb,n/2*sizeof(**gmdct_org)); -+ res_org[i]=_vorbis_block_alloc(vb,n/2*sizeof(**res_org)); - - scale_dB=todB(&scale) + .345; /* + .345 is a hack; the original - todB estimation used on IEEE 754 -@@ -311,6 +316,7 @@ static int mapping0_forward(vorbis_block - /* transform the PCM data */ - /* only MDCT right now.... */ - mdct_forward(b->transform[vb->W][0],pcm,gmdct[i]); -+ memcpy(gmdct_org[i], gmdct[i], n/2*sizeof(**gmdct_org)); - - /* FFT yields more accurate tonal estimation (not phase sensitive) */ - drft_forward(&b->fft_look[vb->W],pcm); -@@ -380,6 +386,11 @@ static int mapping0_forward(vorbis_block - - float *logmdct =logfft+n/2; - float *logmask =logfft; -+ -+ float *lastmdct = b->nblock+i*128; -+ float *tempmdct = b->tblock+i*128; -+ -+ float *lowcomp = b->lownoise_compand_level+i; - - vb->mode=modenumber; - -@@ -419,7 +430,15 @@ static int mapping0_forward(vorbis_block - us a tonality estimate (the larger the value in the - 'noise_depth' vector, the more tonal that area is) */ - -+ *lowcomp= -+ lb_loudnoise_fix(psy_look, -+ *lowcomp, -+ logmdct, -+ b->lW_modenumber, -+ blocktype, modenumber); -+ - _vp_noisemask(psy_look, -+ *lowcomp, - logmdct, - noise); /* noise does not have by-frequency offset - bias applied yet */ -@@ -467,7 +486,13 @@ static int mapping0_forward(vorbis_block - 1, - logmask, - mdct, -- logmdct); -+ logmdct, -+ lastmdct, tempmdct, -+ *lowcomp, -+ vif->n, -+ blocktype, modenumber, -+ vb->nW, -+ b->lW_blocktype, b->lW_modenumber, b->lW_no); - - #if 0 - if(vi->channels==2){ -@@ -510,7 +535,13 @@ static int mapping0_forward(vorbis_block - 2, - logmask, - mdct, -- logmdct); -+ logmdct, -+ lastmdct, tempmdct, -+ *lowcomp, -+ vif->n, -+ blocktype, modenumber, -+ vb->nW, -+ b->lW_blocktype, b->lW_modenumber, b->lW_no); - - #if 0 - if(vi->channels==2){ -@@ -533,7 +564,13 @@ static int mapping0_forward(vorbis_block - 0, - logmask, - mdct, -- logmdct); -+ logmdct, -+ lastmdct, tempmdct, -+ *lowcomp, -+ vif->n, -+ blocktype, modenumber, -+ vb->nW, -+ b->lW_blocktype, b->lW_modenumber, b->lW_no); - - #if 0 - if(vi->channels==2) -@@ -600,11 +637,6 @@ static int mapping0_forward(vorbis_block - psy_look, - info, - mag_memo); -- -- hf_reduction(&ci->psy_g_param, -- psy_look, -- info, -- mag_memo); - } - - memset(sortindex,0,sizeof(*sortindex)*vi->channels); -@@ -636,7 +668,9 @@ static int mapping0_forward(vorbis_block - for(i=0;ichannels;i++){ - int submap=info->chmuxlist[i]; - float *mdct =gmdct[i]; -+ float *mdct_org=gmdct_org[i]; - float *res =vb->pcm[i]; -+ float *resorgch=res_org[i]; - int *ilogmask=ilogmaskch[i]= - _vorbis_block_alloc(vb,n/2*sizeof(**gmdct)); - -@@ -659,6 +693,14 @@ static int mapping0_forward(vorbis_block - res, - ci->psy_g_param.sliding_lowpass[vb->W][k]); - -+ /* stereo threshold */ -+ _vp_remove_floor(psy_look, -+ mdct_org, -+ ilogmask, -+ resorgch, -+ ci->psy_g_param.sliding_lowpass[vb->W][k]); -+ -+ - _vp_noise_normalize(psy_look,res,res+n/2,sortindex[i]); - - -@@ -691,7 +733,8 @@ static int mapping0_forward(vorbis_block - mag_sort, - ilogmaskch, - nonzero, -- ci->psy_g_param.sliding_lowpass[vb->W][k]); -+ ci->psy_g_param.sliding_lowpass[vb->W][k], -+ gmdct, res_org); - } - - /* classify and encode by submap */ -@@ -717,6 +760,11 @@ static int mapping0_forward(vorbis_block - couple_bundle,NULL,zerobundle,ch_in_bundle,classifications); - } - -+ /* set last-window type & number */ -+ if((blocktype == b->lW_blocktype) && (modenumber == b->lW_modenumber)) b->lW_no++; -+ else b->lW_no = 1; -+ b->lW_blocktype = blocktype; -+ b->lW_modenumber = modenumber; - /* ok, done encoding. Next protopacket. */ - } - ---- lib/masking.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/masking.h 2007-08-02 12:25:50.000000000 +0200 -@@ -23,16 +23,29 @@ - - #define MAX_ATH 88 - static float ATH[]={ -- /*15*/ -51, -52, -53, -54, -55, -56, -57, -58, -- /*31*/ -59, -60, -61, -62, -63, -64, -65, -66, -- /*63*/ -67, -68, -69, -70, -71, -72, -73, -74, -- /*125*/ -75, -76, -77, -78, -80, -81, -82, -83, -- /*250*/ -84, -85, -86, -87, -88, -88, -89, -89, -- /*500*/ -90, -91, -91, -92, -93, -94, -95, -96, -- /*1k*/ -96, -97, -98, -98, -99, -99,-100,-100, -- /*2k*/ -101,-102,-103,-104,-106,-107,-107,-107, -- /*4k*/ -107,-105,-103,-102,-101, -99, -98, -96, -- /*8k*/ -95, -95, -96, -97, -96, -95, -93, -90, -+/* original ATH */ -+ /*15*/ // -51, -52, -53, -54, -55, -56, -57, -58, -+ /*31*/ // -59, -60, -61, -62, -63, -64, -65, -66, -+ /*63*/ // -67, -68, -69, -70, -71, -72, -73, -74, -+ /*125*/ // -75, -76, -77, -78, -80, -81, -82, -83, -+ /*250*/ //-84, -85, -86, -87, -88, -88, -89, -89, -+ /*500*/ //-90, -91, -91, -92, -93, -94, -95, -96, -+ /*1k*/ //-96, -97, -98, -98, -99, -99,-100,-100, -+ /*2k*/ //-101,-102,-103,-104,-106,-107,-107,-107, -+ /*4k*/ //-107,-105,-103,-102,-101, -99, -98, -96, -+ /*8k*/ //-95, -95, -96, -97, -96, -95, -93, -90, -+ /*16k*/ //-80, -70, -50, -40, -30, -30, -30, -30 -+/*Aoyumi's ATH (v6) */ -+ /*15*/ -31, -33, -35, -37, -39, -41, -43, -45, -+ /*31*/ -47, -49, -51, -53, -55, -57, -59, -61, -+ /*63*/ -63, -65, -67, -69, -71, -73, -75, -77, -+ /*125*/ -79, -81, -83, -84, -85, -86, -87, -88, -+ /*250*/ -89, -90, -91, -92, -93, -94, -95, -96, -+ /*500*/ -96, -97, -97, -97, -98, -98, -98, -99, -+ /*1k*/ -98, -97, -97, -98, -99,-100,-101,-101, -+ /*2k*/ -102,-103,-104,-105,-106,-106,-107,-107, -+ /*4k*/ -105,-104,-103,-102,-101, -99, -98, -97, -+ /*8k*/ -96, -95, -95, -96, -97, -97, -93, -89, - /*16k*/ -80, -70, -50, -40, -30, -30, -30, -30 +-static int blocksize_8[2]={ +- 512,512 ++static int blocksize_8[3]={ ++ 512,512,512 }; ---- lib/psy.c-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/psy.c 2007-08-02 12:25:50.000000000 +0200 +-static int _floor_mapping_8[2]={ +- 6,6, ++static int _floor_mapping_8[3]={ ++ 6,6,6 + }; + +-static double rate_mapping_8[3]={ +- 6000.,9000.,32000., ++static double rate_mapping_8[4]={ ++// 6000.,9000.,32000., ++ 5000.,6000.,9000.,32000., + }; + +-static double rate_mapping_8_uncoupled[3]={ +- 8000.,14000.,42000., ++static double rate_mapping_8_uncoupled[4]={ ++// 8000.,14000.,42000., ++ 8000.,10000.,14000.,42000., + }; + +-static double quality_mapping_8[3]={ +- -.1,.0,1. ++static double quality_mapping_8[4]={ ++ -.2,-.1,.0,1. + }; + +-static double _psy_compand_8_mapping[3]={ 0., 1., 1.}; ++//static double _psy_compand_8_mapping[3]={ 0., 1., 1.}; ++static double _psy_compand_8_mapping[4]={ 0., 1., 2., 2.}; + +-static double _global_mapping_8[3]={ 1., 2., 3. }; ++//static double _global_mapping_8[3]={ 1., 2., 3. }; ++static double _global_mapping_8[4]={ 2., 2., 3., 4. }; + + ve_setup_data_template ve_setup_8_stereo={ +- 2, ++// 2, ++ 3, + rate_mapping_8, + quality_mapping_8, + 2, +@@ -94,7 +99,8 @@ + }; + + ve_setup_data_template ve_setup_8_uncoupled={ +- 2, ++// 2, ++ 3, + rate_mapping_8_uncoupled, + quality_mapping_8, + -1, +--- lib/modes/setup_X.h ++++ lib/modes/setup_X.h +@@ -15,13 +15,14 @@ + + ********************************************************************/ + +-static double rate_mapping_X[12]={ +- -1.,-1.,-1.,-1.,-1.,-1., ++static double rate_mapping_X[13]={ ++ -1.,-1.,-1.,-1.,-1.,-1.,-1. + -1.,-1.,-1.,-1.,-1.,-1. + }; + + ve_setup_data_template ve_setup_X_stereo={ +- 11, ++// 11, ++ 12, + rate_mapping_X, + quality_mapping_44, + 2, +@@ -72,7 +73,8 @@ + }; + + ve_setup_data_template ve_setup_X_uncoupled={ +- 11, ++// 11, ++ 12, + rate_mapping_X, + quality_mapping_44, + -1, +@@ -123,7 +125,8 @@ + }; + + ve_setup_data_template ve_setup_XX_stereo={ +- 2, ++// 2, ++ 3, + rate_mapping_X, + quality_mapping_8, + 2, +@@ -174,7 +177,8 @@ + }; + + ve_setup_data_template ve_setup_XX_uncoupled={ +- 2, ++// 2, ++ 3, + rate_mapping_X, + quality_mapping_8, + -1, +--- lib/psy.c ++++ lib/psy.c @@ -30,8 +30,34 @@ #include "misc.h" @@ -2017,7 +2226,7 @@ vorbis_look_psy_global *_vp_global_look(vorbis_info *vi){ codec_setup_info *ci=vi->codec_setup; -@@ -284,12 +310,56 @@ void _vp_psy_init(vorbis_look_psy *p,vor +@@ -284,12 +310,56 @@ p->n=n; p->rate=rate; @@ -2080,7 +2289,7 @@ /* set up the lookups for a given blocksize and sample rate */ for(i=0,j=0;i=NOISE_COMPAND_LEVELS)dB=NOISE_COMPAND_LEVELS-1; if(dB<0)dB=0; -@@ -857,18 +940,172 @@ void _vp_offset_and_mix(vorbis_look_psy +@@ -857,18 +940,172 @@ int offset_select, float *logmask, float *mdct, @@ -2422,7 +2631,7 @@ /* AoTuV */ /** @ M1 ** -@@ -907,6 +1144,24 @@ void _vp_offset_and_mix(vorbis_look_psy +@@ -907,6 +1144,24 @@ } } @@ -2447,7 +2656,7 @@ } float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd){ -@@ -958,7 +1213,7 @@ static void precomputed_couple_point(flo +@@ -958,7 +1213,7 @@ int test=(floorA>floorB)-1; int offset=31-abs(floorA-floorB); @@ -2456,7 +2665,7 @@ floormag*=FLOOR1_fromdB_INV_LOOKUP[(floorB&test)|(floorA&(~test))]; -@@ -992,6 +1247,22 @@ static float round_hypot(float a, float +@@ -992,6 +1247,22 @@ if(-a>b)return -sqrt(a*a+b*b); return sqrt(b*b+a*a); } @@ -2479,7 +2688,7 @@ /* revert to round hypot for now */ float **_vp_quantize_couple_memo(vorbis_block *vb, -@@ -1004,16 +1275,27 @@ float **_vp_quantize_couple_memo(vorbis_ +@@ -1004,16 +1275,27 @@ float **ret=_vorbis_block_alloc(vb,vi->coupling_steps*sizeof(*ret)); int limit=g->coupling_pointlimit[p->vi->blockflag][PACKETBLOBS/2]; @@ -2516,7 +2725,7 @@ return(ret); } -@@ -1024,12 +1306,130 @@ static int apsort(const void *a, const v +@@ -1024,12 +1306,130 @@ return (f1f2); } @@ -2648,7 +2857,7 @@ if(p->vi->normal_point_p){ int i,j,k,n=p->n; int **ret=_vorbis_block_alloc(vb,vi->coupling_steps*sizeof(*ret)); -@@ -1048,10 +1448,22 @@ int **_vp_quantize_couple_sort(vorbis_bl +@@ -1048,10 +1448,22 @@ return(ret); } return(NULL); @@ -2671,7 +2880,7 @@ int i,j,n=p->n; vorbis_info_psy *vi=p->vi; int partition=vi->normal_partition; -@@ -1066,11 +1478,12 @@ void _vp_noise_normalize_sort(vorbis_loo +@@ -1066,11 +1478,12 @@ sortedindex[i+j-start]=work[i]-magnitudes; } } @@ -2685,7 +2894,7 @@ vorbis_info_psy *vi=p->vi; int partition=vi->normal_partition; int start=vi->normal_start; -@@ -1084,27 +1497,64 @@ void _vp_noise_normalize(vorbis_look_psy +@@ -1084,27 +1497,64 @@ for(;j+partition<=n;j+=partition){ float acc=0.; int k; @@ -2765,7 +2974,7 @@ } } } -@@ -1123,7 +1573,8 @@ void _vp_couple(int blobno, +@@ -1123,7 +1573,8 @@ int **mag_sort, int **ifloor, int *nonzero, @@ -2775,7 +2984,7 @@ int i,j,k,n=p->n; -@@ -1147,39 +1598,196 @@ void _vp_couple(int blobno, +@@ -1147,39 +1598,196 @@ float *rM=res[vi->coupling_mag[i]]; float *rA=res[vi->coupling_ang[i]]; @@ -2982,7 +3191,7 @@ }else{ couple_lossless(rM[l],rA[l],qM+l,qA+l); } -@@ -1188,40 +1796,106 @@ void _vp_couple(int blobno, +@@ -1188,40 +1796,106 @@ qA[l]=0.; } } @@ -3112,8 +3321,8 @@ + + return(noise_compand_level); } ---- lib/psy.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/psy.h 2007-08-02 12:25:50.000000000 +0200 +--- lib/psy.h ++++ lib/psy.h @@ -15,6 +15,8 @@ ********************************************************************/ @@ -3123,7 +3332,7 @@ #ifndef _V_PSY_H_ #define _V_PSY_H_ #include "smallft.h" -@@ -54,6 +56,9 @@ typedef struct vorbis_info_psy{ +@@ -54,6 +56,9 @@ int noisewindowfixed; float noiseoff[P_NOISECURVES][P_BANDS]; float noisecompand[NOISE_COMPAND_LEVELS]; @@ -3133,7 +3342,7 @@ float max_curve_dB; -@@ -110,7 +115,16 @@ typedef struct { +@@ -110,7 +115,16 @@ int total_octave_lines; long rate; /* cache it */ @@ -3151,7 +3360,7 @@ } vorbis_look_psy; -@@ -129,6 +143,7 @@ extern void _vp_remove_floor(vorbis_look +@@ -129,6 +143,7 @@ int sliding_lowpass); extern void _vp_noisemask(vorbis_look_psy *p, @@ -3159,7 +3368,7 @@ float *logmdct, float *logmask); -@@ -144,7 +159,13 @@ extern void _vp_offset_and_mix(vorbis_lo +@@ -144,7 +159,13 @@ int offset_select, float *logmask, float *mdct, @@ -3174,7 +3383,7 @@ extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd); -@@ -163,7 +184,8 @@ extern void _vp_couple(int blobno, +@@ -163,7 +184,8 @@ int **mag_sort, int **ifloor, int *nonzero, @@ -3184,7 +3393,7 @@ extern void _vp_noise_normalize(vorbis_look_psy *p, float *in,float *out,int *sortedindex); -@@ -176,10 +198,11 @@ extern int **_vp_quantize_couple_sort(vo +@@ -176,10 +198,11 @@ vorbis_info_mapping0 *vi, float **mags); @@ -3200,9 +3409,9 @@ #endif ---- lib/vorbisenc.c-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/vorbisenc.c 2007-08-02 12:25:50.000000000 +0200 -@@ -370,11 +370,16 @@ static void vorbis_encode_tonemask_setup +--- lib/vorbisenc.c ++++ lib/vorbisenc.c +@@ -370,11 +370,16 @@ static void vorbis_encode_compand_setup(vorbis_info *vi,double s,int block, compandblock *in, double *x){ @@ -3221,7 +3430,7 @@ ds=x[is]*(1.-ds)+x[is+1]*ds; is=(int)ds; ds-=is; -@@ -383,9 +388,32 @@ static void vorbis_encode_compand_setup( +@@ -383,9 +388,32 @@ ds=1.; } @@ -3254,212 +3463,3 @@ return; } ---- lib/codec_internal.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/codec_internal.h 2007-08-02 12:25:50.000000000 +0200 -@@ -82,6 +82,15 @@ typedef struct private_state { - bitrate_manager_state bms; - - ogg_int64_t sample_count; -+ -+ /* encode only -+ added by aoyumi */ -+ float *lownoise_compand_level; -+ float *nblock; /* lW logmdct buffer */ -+ float *tblock; /* temporal masking buffer (impulse block) */ -+ int lW_blocktype; /* last window block type */ -+ int lW_modenumber; /* last window mode number (0=short, 1=long) */ -+ int lW_no; /* the number of continuous window blocks (last window) */ - } private_state; - - /* codec_setup_info contains all the setup information specific to the ---- lib/info.c-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/info.c 2007-08-02 12:26:53.000000000 +0200 -@@ -451,7 +451,7 @@ static int _vorbis_pack_info(oggpack_buf - } - - static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){ -- char temp[]="Xiph.Org libVorbis I 20070622"; -+ char temp[]="AO; aoTuV b5 [20061024] (based on Xiph.Org's I 20070622)"; - int bytes = strlen(temp); - - /* preamble */ ---- aoTuV_technical.txt-dist 2007-08-02 12:25:50.000000000 +0200 -+++ aoTuV_technical.txt 2007-08-02 12:25:50.000000000 +0200 -@@ -0,0 +1,144 @@ -+aoTuV beta5 technical information -+ -+ -+The differences from the aoTuV beta 4.51... -+ -+ 1. In order to work noise normalization correctly, the value of tone -+ masking is compressed under certain conditions. A floor curve approaches -+ the original audio spectrum line as a result. [New M4] -+ -+ 2. In order to cut down the bitrate, a part of M2 code of beta4 was -+ deleted. -+ -+@3. The ATH curve was changed slightly. -+ -+ 4. Pre-echo decreased slightly. This is based on change of M3 code. -+ -+ 5. In order to decrease artifact by collapse of audio energy, noise -+ normalization processing of point stereo was extended. [32/44.1/48kHz only] -+ -+ 6. The threshold of channel coupling (lossless <=> point) is changed dynamically. This is a method based on a certain idea. [M6] -+ -+...and I tune up many parameters. -+ -+ -+2006/10/24 -+Aoyumi -+ -+---------------------------------------------------------------------------- -+ -+aoTuV beta4.51 technical information -+ -+ -+The differences from the aoTuV beta 4.5... -+ -+ 1. The changed part of "scale.h" of Xiph.Org SVN was reflected in aoTuV. -+ This will solve the problem of the compile by gcc4. -+ -+ 2. A part of portion added by beta4.5 had caused memory access violation. -+ Depending on environment, a problem arises in qualiy-1/-2. This problem was -+ corrected. -+ -+ -+2005/11/17 -+Aoyumi -+ -+---------------------------------------------------------------------------- -+ -+aoTuV beta4.5 technical information -+ -+ -+The differences from the aoTuV beta 4... -+ -+ 1. M4 code of beta3 was deleted. M5 is added as what is replaced with it. -+ The advantage of this method is that the result stabilized more is obtained. -+ Instead, the change width of the bit rate becomes large rather than before. -+ [32/44.1/48kHz only] -+ -+ 2. New M4 was added. There is this for the same purpose as M1. However, -+ it is tuned up only in the low bit rate region according to work and -+ individual parameters. [32/44.1/48kHz only] -+ -+ 3. M2 code was extended. This decreases a specific noise problem. -+ [32/44.1/48kHz only] -+ -+...and I mainly tune up tone/noise masking and noise normalization parameters. -+ -+The above change is applied below quality3. -+ -+ -+2005/11/05 -+Aoyumi -+ -+---------------------------------------------------------------------------- -+ -+aoTuV beta4 technical information -+ -+ -+The differences from the aoTuV beta 3... -+ -+ 1. Adoption of new hypot (point stereo). This works in general better than -+ dipole/round hypot. And when residue is likely to decrease greatly at the -+ time of a reverse phase, added code is made to increase the ratio of lossless. -+ -+ 2. Change of ATH curve. This is not a big change. -+ -+ 3. Residue used for threshold calculation of channel coupling is changed. -+ This one seems to be good selection. -+ -+ 4. HF reduction code of beta3 was deleted. Now, this is not required. -+ -+ 5. The energy deficit of M4 code of beta3 -- correction of a bug Now. -+ -+ 6. The code for pulling downward floor of the frequency range which can -+ be easy to be heard was added (New M2). This works by the low bit rate and -+ has a comparatively good trade-off. -+ -+ 7. Change of threshold calculation of noise normalization. Moreover, it -+ takes phase information into consideration. -+ -+ -+...and I mainly tune up tone/noise masking and noise compander parameters. -+ -+ -+2005/06/18 -+Aoyumi -+ -+---------------------------------------------------------------------------- -+ -+aoTuV beta3 technical information -+ -+ -+The differences from the aoTuV beta 2 and Vorbis 1.1... -+ -+ 1. Dynamic impulse block noise control(q0-10). [32/44.1/48kHz only] -+ Conspicuous pre-echo is reduced. -+ -+ 2. New ATH curve. -+ -+ 3. In order to cancel that a small sound becomes unstable, the noise level -+ of low frequency is lowered under specific conditions. (Only below q3) -+ There is a greatest effect on a piano etc. [32/44.1/48kHz only] -+ -+ 4. The rate of lossless stereo is increased in specific conditions. This -+ improves many of conspicuous problems which a point stereo causes. (e.g -+ drumus's hiss/voice, guitar and brass's distortion) [32/44.1/48kHz only] -+ -+ 5. The action of the noise normalization of point stereo is corrected. It -+ was set to one of the causes of distortion in a long tone (e.g -+ strings/oboe/high tone voice). -+ -+ 6. The HF reduction code was not working normally. This is corrected and -+ it retuned up according to the present condition. [32/44.1/48kHz only] -+ -+ 7. The q-2 mode was added in all sampling frequencies. And nominal bitrate -+ of q-1 are changed into a more nearly average value. Although nominal -+ bitrate is more large at a low sampling frequency, average bitrate hardly -+ differs from the former version. -+ -+ -+...and I mainly tune up tone/noise masking parameters. -+ -+ -+2004/11/21 -+Aoyumi ---- aoTuV_README-1st.txt-dist 2007-08-02 12:25:50.000000000 +0200 -+++ aoTuV_README-1st.txt 2007-08-02 12:25:50.000000000 +0200 -@@ -0,0 +1,21 @@ -+aoTuV Beta 5 -+ -+"aoTuV" tunes up Xiph.Org's libvorbis uniquely. -+A license is taken as "BSD-style license" as well as original libvorbis. -+ -+ -+# NOTICE # -+ -+ Manuke's patch is used for improvement in the speed of sort processing. -+ When "#define OPT_SORT" of "lib/psy.h" is deleted, the conventional -+ processing method is used. -+ Thanks! Manuke. -+ -+ -+aoTuV based on -+ -+Copyright (c) 2002-2005 Xiph.Org Foundation -+Copyright (c) 2003-2006 Aoyumi -+ -+ -+AUTHOR : aoyumi ---- COPYING-dist 2004-09-20 23:09:21.000000000 +0200 -+++ COPYING 2007-08-02 12:25:50.000000000 +0200 -@@ -1,4 +1,5 @@ --Copyright (c) 2002-2004 Xiph.org Foundation -+aoTuV - Copyright (c) 2003-2006 Aoyumi -+libvorbis - Copyright (c) 2002-2005 Xiph.org Foundation - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions diff --git a/libvorbis-1.2.0-warning-fixes.diff b/libvorbis-1.2.0-warning-fixes.diff index 9b566d1..8cc301c 100644 --- a/libvorbis-1.2.0-warning-fixes.diff +++ b/libvorbis-1.2.0-warning-fixes.diff @@ -1,6 +1,35 @@ ---- lib/mapping0.c-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/mapping0.c 2007-08-02 12:04:35.000000000 +0200 -@@ -586,8 +586,8 @@ static int mapping0_forward(vorbis_block +--- lib/floor1.c ++++ lib/floor1.c +@@ -417,7 +417,7 @@ + int x0, int x1,lsfit_acc *a, + int n,vorbis_info_floor1 *info){ + long i; +- int quantized=vorbis_dBquant(flr+x0); ++ /*int quantized=vorbis_dBquant(flr+x0);*/ + + long xa=0,ya=0,x2a=0,y2a=0,xya=0,na=0, xb=0,yb=0,x2b=0,y2b=0,xyb=0,nb=0; + +@@ -595,7 +595,7 @@ + return (A[pos]+B[pos])>>1; + } + +-static int seq=0; ++/*static int seq=0;*/ + + int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look, + const float *logmdct, /* in */ +@@ -767,7 +767,7 @@ + + long i,j; + vorbis_info_floor1 *info=look->vi; +- long n=look->n; ++ /*long n=look->n;*/ + long posts=look->posts; + codec_setup_info *ci=vb->vd->vi->codec_setup; + int out[VIF_POSIT+2]; +--- lib/mapping0.c ++++ lib/mapping0.c +@@ -623,8 +623,8 @@ float **couple_bundle=alloca(sizeof(*couple_bundle)*vi->channels); int *zerobundle=alloca(sizeof(*zerobundle)*vi->channels); int **sortindex=alloca(sizeof(*sortindex)*vi->channels); @@ -11,7 +40,7 @@ if(info->coupling_steps){ mag_memo=_vp_quantize_couple_memo(vb, -@@ -735,7 +735,7 @@ static int mapping0_inverse(vorbis_block +@@ -783,7 +783,7 @@ codec_setup_info *ci=vi->codec_setup; private_state *b=vd->backend_state; vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)l; @@ -20,8 +49,28 @@ int i,j; long n=vb->pcmend=ci->blocksizes[vb->W]; ---- lib/scales.h-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/scales.h 2007-08-02 12:04:35.000000000 +0200 +--- lib/res0.c ++++ lib/res0.c +@@ -372,7 +372,7 @@ + vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl; + vorbis_info_residue0 *info=look->info; + vorbis_info *vi=vb->vd->vi; +- codec_setup_info *ci=vi->codec_setup; ++ /*codec_setup_info *ci=vi->codec_setup;*/ + + /* move all this setup out later */ + int samples_per_partition=info->grouping; +@@ -500,7 +500,7 @@ + vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl; + vorbis_info_residue0 *info=look->info; + +- vorbis_dsp_state *vd=vb->vd; ++ /*vorbis_dsp_state *vd=vb->vd;*/ + + /* move all this setup out later */ + int samples_per_partition=info->grouping; +--- lib/scales.h ++++ lib/scales.h @@ -25,7 +25,7 @@ #define VORBIS_IEEE_FLOAT32 1 #ifdef VORBIS_IEEE_FLOAT32 @@ -31,7 +80,7 @@ union { ogg_uint32_t i; float f; -@@ -36,7 +36,7 @@ static float unitnorm(float x){ +@@ -36,7 +36,7 @@ } /* Segher was off (too high) by ~ .3 decibel. Center the conversion correctly. */ @@ -40,7 +89,7 @@ union { ogg_uint32_t i; float f; -@@ -50,7 +50,7 @@ static float todB(const float *x){ +@@ -50,7 +50,7 @@ #else @@ -49,52 +98,3 @@ if(x<0)return(-1.f); return(1.f); } ---- lib/res0.c-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/res0.c 2007-08-02 12:04:35.000000000 +0200 -@@ -372,7 +372,7 @@ static long **_01class(vorbis_block *vb, - vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl; - vorbis_info_residue0 *info=look->info; - vorbis_info *vi=vb->vd->vi; -- codec_setup_info *ci=vi->codec_setup; -+ /*codec_setup_info *ci=vi->codec_setup;*/ - - /* move all this setup out later */ - int samples_per_partition=info->grouping; -@@ -500,7 +500,7 @@ static int _01forward(oggpack_buffer *op - vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl; - vorbis_info_residue0 *info=look->info; - -- vorbis_dsp_state *vd=vb->vd; -+ /*vorbis_dsp_state *vd=vb->vd;*/ - - /* move all this setup out later */ - int samples_per_partition=info->grouping; ---- lib/floor1.c-dist 2007-07-24 02:09:47.000000000 +0200 -+++ lib/floor1.c 2007-08-02 12:04:35.000000000 +0200 -@@ -417,7 +417,7 @@ static int accumulate_fit(const float *f - int x0, int x1,lsfit_acc *a, - int n,vorbis_info_floor1 *info){ - long i; -- int quantized=vorbis_dBquant(flr+x0); -+ /*int quantized=vorbis_dBquant(flr+x0);*/ - - long xa=0,ya=0,x2a=0,y2a=0,xya=0,na=0, xb=0,yb=0,x2b=0,y2b=0,xyb=0,nb=0; - -@@ -595,7 +595,7 @@ static int post_Y(int *A,int *B,int pos) - return (A[pos]+B[pos])>>1; - } - --static int seq=0; -+/*static int seq=0;*/ - - int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look, - const float *logmdct, /* in */ -@@ -767,7 +767,7 @@ int floor1_encode(oggpack_buffer *opb,vo - - long i,j; - vorbis_info_floor1 *info=look->vi; -- long n=look->n; -+ /*long n=look->n;*/ - long posts=look->posts; - codec_setup_info *ci=vb->vd->vi->codec_setup; - int out[VIF_POSIT+2]; diff --git a/libvorbis-cflags.diff b/libvorbis-cflags.diff index 231b88f..e5e1646 100644 --- a/libvorbis-cflags.diff +++ b/libvorbis-cflags.diff @@ -1,7 +1,7 @@ ---- configure.in-dist 2005-07-07 16:10:11.000000000 +0200 -+++ configure.in 2005-07-07 16:15:24.000000000 +0200 -@@ -101,10 +101,10 @@ - +--- configure.in ++++ configure.in +@@ -103,10 +103,10 @@ + AC_MSG_RESULT([$GCC_VERSION]) case $host in *86-*-linux*) - DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char" @@ -15,7 +15,7 @@ # glibc < 2.1.3 has a serious FP bug in the math inline header # that will cripple Vorbis. Look to see if the magic FP stack -@@ -150,9 +150,9 @@ +@@ -152,9 +152,9 @@ CFLAGS="-O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT" PROFILE="-pg -g -O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT";; *-*-linux*) diff --git a/libvorbis-doc-fixes.diff b/libvorbis-doc-fixes.diff index 5890fb5..48fc607 100644 --- a/libvorbis-doc-fixes.diff +++ b/libvorbis-doc-fixes.diff @@ -1,5 +1,5 @@ ---- doc/vorbisenc/index.html-dist 2007-07-27 13:03:36.000000000 +0200 -+++ doc/vorbisenc/index.html 2007-07-27 13:04:01.000000000 +0200 +--- doc/vorbisenc/index.html ++++ doc/vorbisenc/index.html @@ -20,8 +20,10 @@

libvorbisenc api overview
diff --git a/libvorbis-lib64.dif b/libvorbis-lib64.dif index e370190..a3ec72a 100644 --- a/libvorbis-lib64.dif +++ b/libvorbis-lib64.dif @@ -1,12 +1,12 @@ ---- vorbis.m4-dist 2002-09-19 15:24:06.000000000 +0200 -+++ vorbis.m4 2002-09-19 15:25:08.000000000 +0200 +--- vorbis.m4 ++++ vorbis.m4 @@ -18,9 +18,9 @@ if test "x$vorbis_libraries" != "x" ; then VORBIS_LIBS="-L$vorbis_libraries" elif test "x$vorbis_prefix" != "x" ; then - VORBIS_LIBS="-L$vorbis_prefix/lib" + VORBIS_LIBS="-L$vorbis_prefix/lib64" - elif test "x$prefix" != "xNONE" -a test "x$prefix" != "x/usr"; then + elif test "x$prefix" != "xNONE" -a "x$prefix" != "x/usr"; then - VORBIS_LIBS="-L$prefix/lib" + VORBIS_LIBS="-L$prefix/lib64" fi diff --git a/libvorbis-m4.dif b/libvorbis-m4.dif index 0011385..a54708f 100644 --- a/libvorbis-m4.dif +++ b/libvorbis-m4.dif @@ -1,11 +1,11 @@ ---- vorbis.m4-dist 2002-07-09 15:08:57.000000000 +0200 -+++ vorbis.m4 2002-09-19 15:24:06.000000000 +0200 +--- vorbis.m4 ++++ vorbis.m4 @@ -19,7 +19,7 @@ VORBIS_LIBS="-L$vorbis_libraries" elif test "x$vorbis_prefix" != "x" ; then VORBIS_LIBS="-L$vorbis_prefix/lib" - elif test "x$prefix" != "xNONE"; then -+ elif test "x$prefix" != "xNONE" -a test "x$prefix" != "x/usr"; then ++ elif test "x$prefix" != "xNONE" -a "x$prefix" != "x/usr"; then VORBIS_LIBS="-L$prefix/lib" fi diff --git a/libvorbis-pkgconfig.patch b/libvorbis-pkgconfig.patch index 5bd1f81..d172e45 100644 --- a/libvorbis-pkgconfig.patch +++ b/libvorbis-pkgconfig.patch @@ -1,8 +1,8 @@ Index: vorbis.pc.in -=================================================================== ---- vorbis.pc.in.orig 2004-07-20 09:24:27.000000000 +0200 -+++ vorbis.pc.in 2008-04-27 05:29:10.000000000 +0200 -@@ -8,7 +8,8 @@ includedir=@includedir@ +================================================================================ +--- vorbis.pc.in ++++ vorbis.pc.in +@@ -8,7 +8,8 @@ Name: vorbis Description: vorbis is the primary Ogg Vorbis library Version: @VERSION@ @@ -13,11 +13,9 @@ Index: vorbis.pc.in +Libs: -L${libdir} -lvorbis +Libs.private: -lm Cflags: -I${includedir} -Index: vorbisenc.pc.in -=================================================================== ---- vorbisenc.pc.in.orig 2004-07-20 09:24:27.000000000 +0200 -+++ vorbisenc.pc.in 2008-04-27 05:27:54.000000000 +0200 -@@ -8,7 +8,7 @@ includedir=@includedir@ +--- vorbisenc.pc.in ++++ vorbisenc.pc.in +@@ -8,7 +8,7 @@ Name: vorbisenc Description: vorbisenc is a library that provides a convenient API for setting up an encoding environment using libvorbis Version: @VERSION@ @@ -26,11 +24,9 @@ Index: vorbisenc.pc.in Conflicts: Libs: -L${libdir} -lvorbisenc Cflags: -I${includedir} -Index: vorbisfile.pc.in -=================================================================== ---- vorbisfile.pc.in.orig 2004-07-20 09:24:27.000000000 +0200 -+++ vorbisfile.pc.in 2008-04-27 05:28:15.000000000 +0200 -@@ -8,7 +8,7 @@ includedir=@includedir@ +--- vorbisfile.pc.in ++++ vorbisfile.pc.in +@@ -8,7 +8,7 @@ Name: vorbisfile Description: vorbisfile is a library that provides a convenient high-level API for decoding and basic manipulation of all Vorbis I audio streams Version: @VERSION@ diff --git a/libvorbis-r14598-r14600-CVE-2008-1420.diff b/libvorbis-r14598-r14600-CVE-2008-1420.diff index 3db2f58..4e0d92a 100644 --- a/libvorbis-r14598-r14600-CVE-2008-1420.diff +++ b/libvorbis-r14598-r14600-CVE-2008-1420.diff @@ -1,30 +1,34 @@ Index: /trunk/vorbis/lib/res0.c -=================================================================== ---- /trunk/vorbis/lib/res0.c (revision 13578) -+++ /trunk/vorbis/lib/res0.c (revision 14598) -@@ -224,4 +224,18 @@ - if(info->booklist[j]>=ci->books)goto errout; - -+ /* verify the phrasebook is not specifying an impossible or -+ inconsistent partitioning scheme. */ -+ { -+ int entries = ci->book_param[info->groupbook]->entries; -+ int dim = ci->book_param[info->groupbook]->dim; -+ int partvals = 1; -+ while(dim>0){ -+ partvals *= info->partitions; -+ if(partvals > entries) goto errout; -+ dim--; -+ } -+ if(partvals != entries) goto errout; -+ } -+ - return(info); - errout: -@@ -264,5 +278,5 @@ - } - -- look->partvals=rint(pow((float)look->parts,(float)dim)); -+ look->partvals=look->phrasebook->entries; - look->stages=maxstage; - look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap)); +================================================================================ +--- libvorbis/BUILD/libvorbis-1.2.0/lib/res0.c ++++ libvorbis/BUILD/libvorbis-1.2.0/lib/res0.c +@@ -223,6 +223,20 @@ + for(j=0;jbooklist[j]>=ci->books)goto errout; + ++ /* verify the phrasebook is not specifying an impossible or ++ inconsistent partitioning scheme. */ ++ { ++ int entries = ci->book_param[info->groupbook]->entries; ++ int dim = ci->book_param[info->groupbook]->dim; ++ int partvals = 1; ++ while(dim>0){ ++ partvals *= info->partitions; ++ if(partvals > entries) goto errout; ++ dim--; ++ } ++ if(partvals != entries) goto errout; ++ } ++ + return(info); + errout: + res0_free_info(info); +@@ -263,7 +277,7 @@ + } + } + +- look->partvals=rint(pow((float)look->parts,(float)dim)); ++ look->partvals=look->phrasebook->entries; + look->stages=maxstage; + look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap)); + for(j=0;jpartvals;j++){ diff --git a/libvorbis-r14602-CVE-2008-1419.diff b/libvorbis-r14602-CVE-2008-1419.diff index 1f34e68..cfc73f7 100644 --- a/libvorbis-r14602-CVE-2008-1419.diff +++ b/libvorbis-r14602-CVE-2008-1419.diff @@ -1,11 +1,13 @@ Index: /trunk/vorbis/lib/codebook.c -=================================================================== ---- /trunk/vorbis/lib/codebook.c (revision 13293) -+++ /trunk/vorbis/lib/codebook.c (revision 14602) -@@ -226,5 +226,5 @@ - switch(s->maptype){ - case 1: -- quantvals=_book_maptype1_quantvals(s); -+ quantvals=(s->dim==0?0:_book_maptype1_quantvals(s)); - break; - case 2: +================================================================================ +--- libvorbis/BUILD/libvorbis-1.2.0/lib/codebook.c ++++ libvorbis/BUILD/libvorbis-1.2.0/lib/codebook.c +@@ -225,7 +225,7 @@ + int quantvals=0; + switch(s->maptype){ + case 1: +- quantvals=_book_maptype1_quantvals(s); ++ quantvals=(s->dim==0?0:_book_maptype1_quantvals(s)); + break; + case 2: + quantvals=s->entries*s->dim; diff --git a/libvorbis-r14604-CVE-2008-1423.diff b/libvorbis-r14604-CVE-2008-1423.diff index e745cac..a30bcdf 100644 --- a/libvorbis-r14604-CVE-2008-1423.diff +++ b/libvorbis-r14604-CVE-2008-1423.diff @@ -1,11 +1,13 @@ Index: /trunk/vorbis/lib/codebook.c -=================================================================== ---- /trunk/vorbis/lib/codebook.c (revision 14602) -+++ /trunk/vorbis/lib/codebook.c (revision 14604) -@@ -159,4 +159,6 @@ - s->entries=oggpack_read(opb,24); - if(s->entries==-1)goto _eofout; -+ -+ if(_ilog(s->dim)+_ilog(s->entries)>24)goto _eofout; - - /* codeword ordering.... length ordered or unordered? */ +================================================================================ +--- libvorbis/BUILD/libvorbis-1.2.0/lib/codebook.c ++++ libvorbis/BUILD/libvorbis-1.2.0/lib/codebook.c +@@ -159,6 +159,8 @@ + s->entries=oggpack_read(opb,24); + if(s->entries==-1)goto _eofout; + ++ if(_ilog(s->dim)+_ilog(s->entries)>24)goto _eofout; ++ + /* codeword ordering.... length ordered or unordered? */ + switch((int)oggpack_read(opb,1)){ + case 0: diff --git a/libvorbis.changes b/libvorbis.changes index 7a31416..6f7ab61 100644 --- a/libvorbis.changes +++ b/libvorbis.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Nov 20 16:48:52 CET 2008 - pth@suse.de + +- Fix the test in libvorbis-m4.dif and adapt libvorbis-lib64.dif. + ------------------------------------------------------------------- Wed May 14 16:41:31 CEST 2008 - tiwai@suse.de diff --git a/libvorbis.spec b/libvorbis.spec index 6679208..f610d44 100644 --- a/libvorbis.spec +++ b/libvorbis.spec @@ -2,9 +2,16 @@ # spec file for package libvorbis (Version 1.2.0) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. -# This file and all modifications and additions to the pristine -# package are under the same license as the package itself. # +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + # Please submit bugfixes or comments via http://bugs.opensuse.org/ # @@ -15,7 +22,7 @@ Name: libvorbis BuildRequires: libogg-devel pkgconfig Summary: The Vorbis General Audio Compression Codec Version: 1.2.0 -Release: 52 +Release: 78 Group: System/Libraries License: BSD 3-Clause Url: http://www.vorbis.com/ @@ -137,6 +144,8 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %doc %{_docdir}/%{name} %changelog +* Thu Nov 20 2008 pth@suse.de +- Fix the test in libvorbis-m4.dif and adapt libvorbis-lib64.dif. * Wed May 14 2008 tiwai@suse.de - VUL-0: Multiple vulnerabilities in libogg and libvorbis (bnc#372246)