[Ffmpeg-devel] [PATCH] rms calculation for tiny_psnr and more
Michael Niedermayer
michaelni
Wed Apr 12 11:51:50 CEST 2006
Hi
On Wed, Apr 12, 2006 at 04:06:46AM +0000, Benjamin Larsson wrote:
> This patch includes a ISO/IEC 13818-3 compatible rms calculator for
> 16bit pcm data. It also includes skip and stride options for tiny_psnr.
> The patch is abit messy to make the regressions test pass.
[...]
> - $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
> + $(CC) -lm $(LDFLAGS) $(CFLAGS) -o $@ $<
iam against this and all FPU useage in tiny_psnr as the primary purpose
of tiny_psnr are our regression tests and floats are not guarenteed to be
binary identical on different platforms
[...]
> @@ -116,18 +125,25 @@
> f[1]= fopen(argv[2], "rb");
> fseek(f[shift<0], shift < 0 ? -shift : shift, SEEK_SET);
>
> + if (skip_bytes>0) {
> + fseek(f[0],skip_bytes,SEEK_CUR);
> + fseek(f[1],skip_bytes,SEEK_CUR);
> + }
the if() is useless complexity
[..]
> + if (argc>5) {
IMHO always print it and update the regression test files
> + //print extended information
> + samples = i/(len);
> + rms = (float)sqrt( (1.0/samples) * ((sse/(float)(1<<30)) ));
rms = dev / (F<<15) if iam not misstaken
something like:
"%d.%07d", dev / (F<<15), (dev % (F<<15)) * 1000000LL / (F<<15)
should maybe do what you want
[...]
--
Michael
In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is
More information about the ffmpeg-devel
mailing list