[FFmpeg-devel] [PATCH] make tiny_psnr work with 32-bit audio

Michael Niedermayer michaelni
Mon Nov 9 02:51:44 CET 2009


On Sun, Nov 08, 2009 at 02:25:38PM -0500, Justin Ruggles wrote:
> Hi,
> 
> I was trying to do some comparisons with 32-bit audio, but tiny_psnr
> kept crashing with a float exception.  Then I noticed it does not really
> support 32-bit integer comparisons.  The attached patch seems to work.
> 
[...]
> @@ -142,6 +142,13 @@
>              if(len==2){
>                  a= (int16_t)(a | (buf[0][++j]<<8));
>                  b= (int16_t)(b | (buf[1][  j]<<8));
> +            } else if (len == 4) {
> +                a= (int32_t)(a | (buf[0][++j]<<8));
> +                b= (int32_t)(b | (buf[1][  j]<<8));
> +                a= (int32_t)(a | (buf[0][++j]<<16));
> +                b= (int32_t)(b | (buf[1][  j]<<16));
> +                a= (int32_t)(a | (buf[0][++j]<<24));
> +                b= (int32_t)(b | (buf[1][  j]<<24));
>              }
>              sse += (a-b) * (a-b);
>          }

iam sure this can be done more compactly

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091109/a8e6e087/attachment.pgp>



More information about the ffmpeg-devel mailing list