dilagurung / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

scale - point sampler has difference #232

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
out\Debug\convert.exe faces_1280x720_ARGB.raw faces_352x288_P420.yuv
out\Debug\convert.exe -f 0 faces_352x288_P420.yuv faces_699x531_P420.yuv
out\Debug\convert.exe -f 0 faces_699x531_P420.yuv face2_352x288_P420.yuv 
out\Debug\psnr.exe -s 352 288 -v faces_352x288_P420.yuv face2_352x288_P420.yuv
Global:  30.622569       38.437915       41.345400       32.120150          1

Original issue reported on code.google.com by fbarch...@chromium.org on 20 May 2013 at 9:49

GoogleCodeExporter commented 9 years ago
Also for this formula, it would be use to use a constant for 32768.
y = (dy >> 1) - 32768;

Original comment by fbarch...@google.com on 23 May 2013 at 1:33

GoogleCodeExporter commented 9 years ago
r645 was ok
svn up -r 645 source/scale.cc

out\Debug\convert.exe faces_352x288_ARGB.raw faces_352x288_P420.yuv
out\Debug\convert.exe -f 0 faces_352x288_P420.yuv faces_699x531_P420.yuv
out\Debug\convert.exe -f 0 faces_699x531_P420.yuv face2_352x288_P420.yuv 
out\Debug\psnr.exe -s 352 288 -v faces_352x288_P420.yuv face2_352x288_P420.yuv
Frame    PSNR-Y          PSNR-U          PSNR-V          PSNR-All        Frame
    0    41.197008       46.917811       49.997085       42.544299        min

Original comment by fbarch...@google.com on 28 May 2013 at 11:05

GoogleCodeExporter commented 9 years ago
This is showing the old code for point sampling was the same as ffmpeg for r645 
upsampling, but different in r705.

out\Debug\convert.exe -f 0 faces_352x288_P420.yuv faces_640x480_P420.yuv
ffmpeg -y -f rawvideo -pix_fmt yuv420p -s 352x288 -i faces_352x288_P420.yuv 
-sws_flags neighbor -vf scale=640:480 -f rawvideo facef_640x480_P420.yuv
out\Debug\psnr.exe faces_640x480_P420.yuv facef_640x480_P420.yuv

Was r645
Frame    PSNR-Y          PSNR-U          PSNR-V          PSNR-All        Frame
Global: 128.000000      128.000000      128.000000      128.000000          1
Avg:    128.000000      128.000000      128.000000      128.000000          1
Min:    128.000000      128.000000      128.000000      128.000000          0

Now r705
d:\src\libyuv\trunk>out\Debug\psnr.exe faces_640x480_P420.yuv 
facef_640x480_P420.yuv
Frame    PSNR-Y          PSNR-U          PSNR-V          PSNR-All        Frame
Global:  32.353306       40.023221       43.114150       33.845889          1
Avg:     32.353306       40.023221       43.114150       33.845889          1
Min:     32.353306       40.023221       43.114150       33.845889          0

Original comment by fbarch...@google.com on 29 May 2013 at 4:43

GoogleCodeExporter commented 9 years ago
r706 fixes point upsampling.  exactly matches ffmpeg
r707 fixes point downsampling.  exactly matches ffmpeg and up and then down is 
lossless.

For point sampler, the remaining task is specialized scalers should match 
general purpose one.

Original comment by fbarch...@google.com on 29 May 2013 at 5:42

GoogleCodeExporter commented 9 years ago
r708 fixes point down sample to 1/2 size.  exactly matches ffmpeg and general 
purpose scaling.
Performance improved:
Was ScaleDownBy2_None (6547 ms)
Now ScaleDownBy2_None (4471 ms)

Original comment by fbarch...@google.com on 29 May 2013 at 7:31

GoogleCodeExporter commented 9 years ago
r709 fixes 1/4 and 1/8 size for point.
Original issue of up sample and then down sample is lossless
out\Debug\convert.exe faces_1280x720_ARGB.raw faces_352x288_P420.yuv
out\Debug\convert.exe -f 0 faces_352x288_P420.yuv faces_699x531_P420.yuv
out\Debug\convert.exe -f 0 faces_699x531_P420.yuv face2_352x288_P420.yuv 
out\Debug\psnr.exe -s 352 288 -v faces_352x288_P420.yuv face2_352x288_P420.yuv
Size: 352x288
Frame    PSNR-Y          PSNR-U          PSNR-V          PSNR-All        Frame
    0   128.000000      128.000000      128.000000      128.000000
Global: 128.000000      128.000000      128.000000      128.000000          1
Avg:    128.000000      128.000000      128.000000      128.000000          1
Min:    128.000000      128.000000      128.000000      128.000000          0

Bilinear is close, but not identical.
out\Debug\convert.exe -f 1 faces_352x288_P420.yuv faces_699x531_P420.yuv
out\Debug\convert.exe -f 1 faces_699x531_P420.yuv face2_352x288_P420.yuv
out\Debug\psnr.exe -s 352 288 -v faces_352x288_P420.yuv face2_352x288_P420.yuv
Size: 352x288
Frame    PSNR-Y          PSNR-U          PSNR-V          PSNR-All        Frame
    0    40.454419       46.045956       47.859297       41.744798        min
Global:  40.454419       46.045956       47.859297       41.744798          1
Avg:     40.454419       46.045956       47.859297       41.744798          1
Min:     40.454419       46.045956       47.859297       41.744798          0

Original comment by fbarch...@google.com on 30 May 2013 at 5:40

GoogleCodeExporter commented 9 years ago

Original comment by fbarch...@google.com on 30 May 2013 at 7:17