polyzz / 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

Closed GoogleCodeExporter closed 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

GoogleCodeExporter commented 9 years ago
set LIBYUV_WIDTH=1272
set LIBYUV_HEIGHT=720
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy3by4_*   | findstr /r 
"^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy3by4_None (480 ms)
[       OK ] libyuvTest.ScaleDownBy3by4_Linear (819 ms)
[       OK ] libyuvTest.ScaleDownBy3by4_Bilinear (911 ms)
[       OK ] libyuvTest.ScaleDownBy3by4_Box (937 ms)

set LIBYUV_WIDTH=1280
set LIBYUV_HEIGHT=720
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy3by4_*   | findstr /r 
"^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy3by4_None (399 ms)
[       OK ] libyuvTest.ScaleDownBy3by4_Linear (562 ms)
[       OK ] libyuvTest.ScaleDownBy3by4_Bilinear (609 ms)
[       OK ] libyuvTest.ScaleDownBy3by4_Box (565 ms)

set LIBYUV_WIDTH=2544
set LIBYUV_HEIGHT=1440
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy3by8_*   | findstr /r 
"^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy3by8_None (721 ms)
[       OK ] libyuvTest.ScaleDownBy3by8_Linear (2209 ms)
[       OK ] libyuvTest.ScaleDownBy3by8_Bilinear (2063 ms)
[       OK ] libyuvTest.ScaleDownBy3by8_Box (1920 ms)

set LIBYUV_WIDTH=2560
set LIBYUV_HEIGHT=1440
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy3by8_*   | findstr /r 
"^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy3by8_None (626 ms)
[       OK ] libyuvTest.ScaleDownBy3by8_Linear (1871 ms)
[       OK ] libyuvTest.ScaleDownBy3by8_Bilinear (1927 ms)
[       OK ] libyuvTest.ScaleDownBy3by8_Box (1913 ms)

set LIBYUV_WIDTH=1276
set LIBYUV_HEIGHT=720
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy2_*   | findstr /r "^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy2_None (239 ms)
[       OK ] libyuvTest.ScaleDownBy2_Linear (287 ms)
[       OK ] libyuvTest.ScaleDownBy2_Bilinear (344 ms)
[       OK ] libyuvTest.ScaleDownBy2_Box (344 ms)

set LIBYUV_WIDTH=1280
set LIBYUV_HEIGHT=720
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy2_*   | findstr /r "^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy2_None (182 ms)
[       OK ] libyuvTest.ScaleDownBy2_Linear (232 ms)
[       OK ] libyuvTest.ScaleDownBy2_Bilinear (279 ms)
[       OK ] libyuvTest.ScaleDownBy2_Box (278 ms)

set LIBYUV_WIDTH=1914
set LIBYUV_HEIGHT=1080
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy3_*   | findstr /r "^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy3_None (759 ms)
[       OK ] libyuvTest.ScaleDownBy3_Linear (773 ms)
[       OK ] libyuvTest.ScaleDownBy3_Bilinear (861 ms)
[       OK ] libyuvTest.ScaleDownBy3_Box (6144 ms)

set LIBYUV_WIDTH=1920
set LIBYUV_HEIGHT=1080
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy3_*   | findstr /r "^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy3_None (760 ms)
[       OK ] libyuvTest.ScaleDownBy3_Linear (770 ms)
[       OK ] libyuvTest.ScaleDownBy3_Bilinear (741 ms)
[       OK ] libyuvTest.ScaleDownBy3_Box (5834 ms)

set LIBYUV_WIDTH=2552
set LIBYUV_HEIGHT=1440
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy4_*   | findstr /r "^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy4_None (407 ms)
[       OK ] libyuvTest.ScaleDownBy4_Linear (1351 ms)
[       OK ] libyuvTest.ScaleDownBy4_Bilinear (1843 ms)
[       OK ] libyuvTest.ScaleDownBy4_Box (1079 ms)

set LIBYUV_WIDTH=2560
set LIBYUV_HEIGHT=1440
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy4_*   | findstr /r "^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy4_None (453 ms)
[       OK ] libyuvTest.ScaleDownBy4_Linear (1626 ms)
[       OK ] libyuvTest.ScaleDownBy4_Bilinear (1788 ms)
[       OK ] libyuvTest.ScaleDownBy4_Box (822 ms)

set LIBYUV_WIDTH=5104
set LIBYUV_HEIGHT=2880
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy8_*   | findstr /r "^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy8_None (1014 ms)
[       OK ] libyuvTest.ScaleDownBy8_Linear (1486 ms)
[       OK ] libyuvTest.ScaleDownBy8_Bilinear (2209 ms)
[       OK ] libyuvTest.ScaleDownBy8_Box (26432 ms)

set LIBYUV_WIDTH=5120
set LIBYUV_HEIGHT=2880
set LIBYUV_REPEAT=3999
set LIBYUV_FLAGS=-1
libyuv_unittest --gtest_filter=*.ScaleDownBy8_*   | findstr /r "^[^_]*_[^_]*ms"
[       OK ] libyuvTest.ScaleDownBy8_None (1116 ms)
[       OK ] libyuvTest.ScaleDownBy8_Linear (1549 ms)
[       OK ] libyuvTest.ScaleDownBy8_Bilinear (2240 ms)
[       OK ] libyuvTest.ScaleDownBy8_Box (18049 ms)

Original comment by fbarch...@google.com on 28 Apr 2015 at 12:32

GoogleCodeExporter commented 9 years ago

Original comment by fbarch...@google.com on 28 Apr 2015 at 12:32