kleopatra999 / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

Incorrect rounding in vp9_temporal_filter_apply_c #787

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The C and assembler version of temporal filter disagree if strength is 0.

What steps will reproduce the problem?
======================================

Encoding a stream with C versus assembler.

1. ../libvpx/configure --enable-debug --enable-debug-libs 
--disable-optimizations --disable-vp8 --disable-runtime_cpu_detect 
--disable-mmx --disable-sse --disable-sse2 --disable-sse3 --disable-ssse3 
--disable-sse4_1 --disable-avx
2. make
3. ./vpxenc rush_hour_444.y4m --target-bitrate=5000 --psnr --ivf 
--experimental-bitstream --profile=1 -o rush_c.ivf
4. ../libvpx/configure --disable-vp8
5. ./vpxenc rush_hour_444.y4m --target-bitrate=5000 --psnr --ivf 
--experimental-bitstream --profile=1 -o rush_asm.ivf

What is the expected output? 
============================

The expected output is that both streams are identical when encoded with C or 
assembler.

What do you see instead?
========================

The assembler encoded stream has a 0.235dB higher PSNR and 20% smaller filesize 
than the C encoded stream.

What version are you using?
===========================

Latest libvpx/master on x86 with SSE2

Please provide any additional information below.
================================================

I think there is a possible bug in libvpx/vp9/encoder/vp9_temporal_filter.c in 
function vp9_temporal_filter_apply_c.

There is a line:

    modifier  += 1 << (strength - 1);

but this behaves badly if strength is 0.  (modifier becomes a large negative 
value and this ends up corrupting the temporal filtering process.)

Original issue reported on code.google.com by peter.de...@gmail.com on 15 May 2014 at 2:11

GoogleCodeExporter commented 9 years ago
Please update your code to the latest version. Checkout for the related code 
around this:  
https://code.google.com/p/webm/source/browse/vp9/encoder/vp9_temporal_filter.c?r
epo=libvpx

Original comment by ya...@google.com on 30 May 2014 at 2:23