StopProducing / libyuv

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

Scale Any #427

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
All scale functions should support 'any' width efficiently.

ScaleDown2 is done.

most scaling is destination size performance sensitive.
keep uv plane subsampling in mind.  odd is size of destination
319x180 uv = 638x360 y.  use this as destination.
source sizes
1276x720 down2
2552x1440 down4
1914x1080 down3
5104x2880 down8

Original issue reported on code.google.com by fbarch...@google.com on 15 Apr 2015 at 8:21

GoogleCodeExporter commented 9 years ago
Scale down by 3 uses a general purpose box filter.  For odd width it uses C.  
This test confirms performance:

setlocal
set LIBYUV_WIDTH=1914
set LIBYUV_HEIGHT=1080

set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1

@call :runtest .ScaleDownBy3*

set LIBYUV_WIDTH=1920
set LIBYUV_HEIGHT=1080

set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1

@call :runtest .ScaleDownBy3*

Odd width
ScaleDownBy3_Box (19830 ms)

Even
ScaleDownBy3_Box (6406 ms)

Original comment by fbarch...@chromium.org on 15 Apr 2015 at 11:16

GoogleCodeExporter commented 9 years ago
set LIBYUV_WIDTH=1914
set LIBYUV_HEIGHT=1080
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
out\release\libyuv_unittest --gtest_filter=*.ScaleDownBy3_*   | findstr /r 
"^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy3_None (1939 ms)
[       OK ] libyuvTest.ScaleDownBy3_Linear (2989 ms)
[       OK ] libyuvTest.ScaleDownBy3_Bilinear (4555 ms)
[       OK ] libyuvTest.ScaleDownBy3_Box (48681 ms)

set LIBYUV_WIDTH=1920
set LIBYUV_HEIGHT=1080
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
out\release\libyuv_unittest --gtest_filter=*.ScaleDownBy3_*   | findstr /r 
"^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy3_None (1498 ms)
[       OK ] libyuvTest.ScaleDownBy3_Linear (1484 ms)
[       OK ] libyuvTest.ScaleDownBy3_Bilinear (1430 ms)
[       OK ] libyuvTest.ScaleDownBy3_Box (16478 ms)

set LIBYUV_WIDTH=1276
set LIBYUV_HEIGHT=720
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
out\release\libyuv_unittest --gtest_filter=*.ScaleDownBy2_*   | findstr /r 
"^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy2_None (382 ms)
[       OK ] libyuvTest.ScaleDownBy2_Linear (410 ms)
[       OK ] libyuvTest.ScaleDownBy2_Bilinear (520 ms)
[       OK ] libyuvTest.ScaleDownBy2_Box (522 ms)

set LIBYUV_WIDTH=1280
set LIBYUV_HEIGHT=720
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
out\release\libyuv_unittest --gtest_filter=*.ScaleDownBy2_*   | findstr /r 
"^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy2_None (213 ms)
[       OK ] libyuvTest.ScaleDownBy2_Linear (268 ms)
[       OK ] libyuvTest.ScaleDownBy2_Bilinear (328 ms)
[       OK ] libyuvTest.ScaleDownBy2_Box (328 ms)

set LIBYUV_WIDTH=2552
set LIBYUV_HEIGHT=1440
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
out\release\libyuv_unittest --gtest_filter=*.ScaleDownBy4_*   | findstr /r 
"^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy4_None (494 ms)
[       OK ] libyuvTest.ScaleDownBy4_Linear (765 ms)
[       OK ] libyuvTest.ScaleDownBy4_Bilinear (1819 ms)
[       OK ] libyuvTest.ScaleDownBy4_Box (945 ms)

set LIBYUV_WIDTH=2560
set LIBYUV_HEIGHT=1440
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
out\release\libyuv_unittest --gtest_filter=*.ScaleDownBy4_*   | findstr /r 
"^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy4_None (448 ms)
[       OK ] libyuvTest.ScaleDownBy4_Linear (731 ms)
[       OK ] libyuvTest.ScaleDownBy4_Bilinear (2095 ms)
[       OK ] libyuvTest.ScaleDownBy4_Box (1016 ms)

Original comment by fbarch...@chromium.org on 16 Apr 2015 at 10:22

GoogleCodeExporter commented 9 years ago
odd width  [       OK ] libyuvTest.ScaleDownBy3_Box (18169 ms)
even width [       OK ] libyuvTest.ScaleDownBy3_Box (5813 ms)

Original comment by fbarch...@chromium.org on 17 Apr 2015 at 6:20