Hi Everyone,

I was at a conference all last week and fell way behind on my
email.  Since Mat's message below is the latest, I'll assume this
is the best version of quantize_xrpow so far?  

(but it seems to be missing the .5, 

>           XRPOW_FTOI(x, rx);
should be
>           XRPOW_FTOI(x-.5, rx);

?

I just committed the new quantize_xrpow with the -.5 fix, and
quantize_xrpow_ISO from Acy's last message, but also went back to the
old fft.c routines.  Takehiro's code had the minor force_ms problem,
but also produced changes in the bitstream.  Not unusual if you change
something like the fft, but it breaks my validation tests.  In such
cases I want to make sure I understand exactly where the differences
are coming from.  I hope to do this with the new fft in the next few
days.

Mark

(the force_ms problems were caused by the fact that the old
force_ms mode was removed one or two revisions ago.  The new force_ms
mode just encodes as regular jstereo and forces all frames to be
mid/side.  The old force_ms mode was a messy hack.



> 
> > From: Mathew Hendry [mailto:[EMAIL PROTECTED]]
> > 
> 
> /*
> Timings for the MSVC asm version, before and after, testing "fools.wav"
> 
>         Func          Func+Child           Hit
>         Time   %         Time      %      Count  Function
> ---------------------------------------------------------
>      860.617   6.2      860.617   6.2    84439 _quantize_xrpow
>      789.424   5.7      789.424   5.7    84439 _quantize_xrpow
> */
> 
> void quantize_xrpow(FLOAT8 xr[576], int ix[576], gr_info *cod_info) {
>   /* quantize on xr^(3/4) instead of xr */
>   const FLOAT8 quantizerStepSize = cod_info->quantizerStepSize;
>   const FLOAT8 istep = pow(2.0, quantizerStepSize * -0.1875);
>   
> #ifndef _MSC_VER
>   {
>       FLOAT8 x;
>       int j, rx;
>       for (j = 576 / 4; j > 0; --j) {
>           x = *xr++ * istep;
>           XRPOW_FTOI(x, rx);
>           XRPOW_FTOI(x + QUANTFAC(rx), *ix++);
>           x = *xr++ * istep;
>           XRPOW_FTOI(x, rx);
>           XRPOW_FTOI(x + QUANTFAC(rx), *ix++);
>           x = *xr++ * istep;
>           XRPOW_FTOI(x, rx);
>           XRPOW_FTOI(x + QUANTFAC(rx), *ix++);
>           x = *xr++ * istep;
>           XRPOW_FTOI(x, rx);
>           XRPOW_FTOI(x + QUANTFAC(rx), *ix++);
>       }
>   }
> #else
> /* def _MSC_VER */
>   {
>       /* asm from Acy Stapp <[EMAIL PROTECTED]> */
>       int rx[4];
>       _asm {
>           fld qword ptr [istep]
>           mov esi, dword ptr [xr]
>           lea edi, dword ptr [adj43asm]
>           mov edx, dword ptr [ix]
>           mov ecx, 576/4
>       } loop1: _asm {
>           fld qword ptr [esi]         // 0
>           fld qword ptr [esi+8]       // 1 0
>           fld qword ptr [esi+16]      // 2 1 0
>           fld qword ptr [esi+24]      // 3 2 1 0
> 
>           fxch st(3)                  // 0 2 1 3
>           fmul st(0), st(4)
>           fxch st(2)                  // 1 2 0 3
>           fmul st(0), st(4)
>           fxch st(1)                  // 2 1 0 3
>           fmul st(0), st(4)
>           fxch st(3)                  // 3 1 0 2
>           fmul st(0), st(4)
> 
>           add esi, 32
>           add edx, 16
> 
>           fxch st(2)                  // 0 1 3 2
>           fist dword ptr [rx]
>           fxch st(1)                  // 1 0 3 2
>           fist dword ptr [rx+4]
>           fxch st(3)                  // 2 0 3 1
>           fist dword ptr [rx+8]
>           fxch st(2)                  // 3 0 2 1
>           fist dword ptr [rx+12]
> 
>           dec ecx
> 
>           mov eax, dword ptr [rx]
>           mov ebx, dword ptr [rx+4]
>           fxch st(1)                  // 0 3 2 1
>           fadd qword ptr [edi+eax*8]
>           fxch st(3)                  // 1 3 2 0
>           fadd qword ptr [edi+ebx*8]
> 
>           mov eax, dword ptr [rx+8]
>           mov ebx, dword ptr [rx+12]
>           fxch st(2)                  // 2 3 1 0
>           fadd qword ptr [edi+eax*8]
>           fxch st(1)                  // 3 2 1 0
>           fadd qword ptr [edi+ebx*8]
> 
>           fxch st(3)                  // 0 2 1 3
>           fistp dword ptr [edx-16]    // 2 1 3
>           fxch st(1)                  // 1 2 3
>           fistp dword ptr [edx-12]    // 2 3
>           fistp dword ptr [edx-8]     // 3
>           fistp dword ptr [edx-4]
> 
>           jnz loop1
> 
>           mov dword ptr [xr], esi
>           mov dword ptr [ix], edx
>           fstp st(0)
>       }
>   }
> #endif
> }
> 
> -- Mat.
> --
> MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )
> 
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to