Changeset 239415 in webkit


Ignore:
Timestamp:
Dec 19, 2018 5:37:30 PM (5 years ago)
Author:
youenn@apple.com
Message:

Refresh libyuv to M72
https://bugs.webkit.org/show_bug.cgi?id=192864

Reviewed by Alex Christensen.

  • Source/third_party/libyuv: Resynced.
Location:
trunk/Source/ThirdParty/libwebrtc
Files:
9 added
7 deleted
63 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/libwebrtc/ChangeLog

    r239396 r239415  
     12018-12-19  Youenn Fablet  <youenn@apple.com>
     2
     3        Refresh libyuv to M72
     4        https://bugs.webkit.org/show_bug.cgi?id=192864
     5
     6        Reviewed by Alex Christensen.
     7
     8        * Source/third_party/libyuv: Resynced.
     9
    1102018-12-19  Youenn Fablet  <youenn@apple.com>
    211
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/.gn

    r235135 r239415  
    3030
    3131default_args = {
    32   mac_sdk_min = "10.11"
     32  mac_sdk_min = "10.12"
    3333
    3434  # LibYUV does not want to switch to C++14 yet.
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/.vpython

    r229378 r239415  
    3131  version: "version:5.2.2"
    3232>
     33
     34# Used by:
     35#   third_party/catapult
     36wheel: <
     37  name: "infra/python/wheels/pypiwin32/${vpython_platform}"
     38  version: "version:219"
     39  match_tag: <
     40    platform: "win32"
     41  >
     42  match_tag: <
     43    platform: "win_amd64"
     44  >
     45>
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/Android.bp

    r235135 r239415  
    1212        "source/compare_neon.cc",
    1313        "source/compare_neon64.cc",
     14        "source/compare_mmi.cc",
    1415        "source/compare_msa.cc",
    1516        "source/convert.cc",
     
    2627        "source/rotate_common.cc",
    2728        "source/rotate_gcc.cc",
     29        "source/rotate_mmi.cc",
    2830        "source/rotate_msa.cc",
    2931        "source/rotate_neon.cc",
     
    3234        "source/row_common.cc",
    3335        "source/row_gcc.cc",
     36        "source/row_mmi.cc",
    3437        "source/row_msa.cc",
    3538        "source/row_neon.cc",
     
    4043        "source/scale_common.cc",
    4144        "source/scale_gcc.cc",
     45        "source/scale_mmi.cc",
    4246        "source/scale_msa.cc",
    4347        "source/scale_neon.cc",
    4448        "source/scale_neon64.cc",
    4549        "source/video_common.cc",
    46 
    4750        "source/convert_jpeg.cc",
    4851        "source/mjpeg_decoder.cc",
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/Android.mk

    r235135 r239415  
    1010    source/compare_common.cc    \
    1111    source/compare_gcc.cc       \
     12    source/compare_mmi.cc       \
    1213    source/compare_msa.cc       \
    1314    source/compare_neon.cc      \
     
    2627    source/rotate_common.cc     \
    2728    source/rotate_gcc.cc        \
     29    source/rotate_mmi.cc        \
    2830    source/rotate_msa.cc        \
    2931    source/rotate_neon.cc       \
     
    3234    source/row_common.cc        \
    3335    source/row_gcc.cc           \
     36    source/row_mmi.cc           \
    3437    source/row_msa.cc           \
    3538    source/row_neon.cc          \
     
    4043    source/scale_common.cc      \
    4144    source/scale_gcc.cc         \
     45    source/scale_mmi.cc         \
    4246    source/scale_msa.cc         \
    4347    source/scale_neon.cc        \
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/BUILD.gn

    r235135 r239415  
    6868  if (libyuv_use_msa) {
    6969    deps += [ ":libyuv_msa" ]
     70  }
     71
     72  if (libyuv_use_mmi) {
     73    deps += [ ":libyuv_mmi" ]
    7074  }
    7175
     
    230234}
    231235
     236if (libyuv_use_mmi) {
     237  static_library("libyuv_mmi") {
     238    sources = [
     239      # MMI Source Files
     240      "source/compare_mmi.cc",
     241      "source/rotate_mmi.cc",
     242      "source/row_mmi.cc",
     243      "source/scale_mmi.cc",
     244    ]
     245
     246    deps = [
     247      ":libyuv_internal",
     248    ]
     249
     250    public_configs = [ ":libyuv_config" ]
     251  }
     252}
     253
    232254if (libyuv_include_tests) {
    233255  config("libyuv_unittest_warnings_config") {
     
    330352    deps = [
    331353      ":libyuv",
    332       "//build/config:exe_and_shlib_deps",  # for asan on llvm libc++
    333354    ]
    334355    if (is_linux) {
     
    344365    deps = [
    345366      ":libyuv",
    346       "//build/config:exe_and_shlib_deps",  # for new[] on llvm libc++
    347367    ]
    348368    if (is_linux) {
     
    360380    deps = [
    361381      ":libyuv",
    362       "//build/config:exe_and_shlib_deps",  # for new[] on llvm libc++
    363382    ]
    364383
     
    375394    deps = [
    376395      ":libyuv",
    377       "//build/config:exe_and_shlib_deps",  # for asan on llvm libc++
    378     ]
    379   }
    380 }
     396    ]
     397  }
     398}
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/CMakeLists.txt

    r218670 r239415  
    6060
    6161  add_executable(libyuv_unittest ${ly_unittest_sources})
    62   target_link_libraries(libyuv_unittest ${ly_lib_name} ${GTEST_LIBRARY} pthread)
     62  target_link_libraries(libyuv_unittest ${ly_lib_name} ${GTEST_LIBRARY})
     63  find_library(PTHREAD_LIBRARY pthread)
     64  if(NOT PTHREAD_LIBRARY STREQUAL "PTHREAD_LIBRARY-NOTFOUND")
     65    target_link_libraries(libyuv_unittest pthread)
     66  endif()
    6367  if (JPEG_FOUND)
    6468    target_link_libraries(libyuv_unittest ${JPEG_LIBRARY})
     
    6973  endif()
    7074
    71   target_link_libraries(libyuv_unittest gflags)
     75  find_library(GFLAGS_LIBRARY gflags)
     76  if(NOT GFLAGS_LIBRARY STREQUAL "GFLAGS_LIBRARY-NOTFOUND")
     77    target_link_libraries(libyuv_unittest gflags)
     78    add_definitions(-DLIBYUV_USE_GFLAGS)
     79  endif()
    7280endif()
    7381
     
    7684INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert                       DESTINATION bin )
    7785INSTALL ( TARGETS ${ly_lib_static}                                              DESTINATION lib )
    78 INSTALL ( TARGETS ${ly_lib_shared} LIBRARY                              DESTINATION lib )
     86INSTALL ( TARGETS ${ly_lib_shared} LIBRARY                              DESTINATION lib RUNTIME DESTINATION bin )
    7987INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/              DESTINATION include )
    8088
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/DEPS

    r235135 r239415  
    11vars = {
    22  'chromium_git': 'https://chromium.googlesource.com',
    3   'chromium_revision': '80f0c5570649c35a869429b2ab8c381a0a7246cb',
    4   'swarming_revision': '88229872dd17e71658fe96763feaa77915d8cbd6',
     3  'chromium_revision': '35b72bf255d6519506b7e732f9c74205d2ab452d',
     4  'swarming_revision': '486c9b53c4d54dd4b95bb6ce0e31160e600dfc11',
    55  # Three lines of non-changing comments so that
    66  # the commit queue can handle CLs rolling lss
     
    1010  # the commit queue can handle CLs rolling catapult
    1111  # and whatever else without interference from each other.
    12   'catapult_revision': 'e7298f36f7912f2caa122086cfbe71734d04b73f',
     12  'catapult_revision': '0d25dda9b148bcd2dad9e1080b1dc57eaf9d2c2a',
    1313}
    1414
    1515deps = {
    1616  'src/build':
    17     Var('chromium_git') + '/chromium/src/build' + '@' + '39738e75b27f39d4c0030a0b11d5d2ddd34715f7',
     17    Var('chromium_git') + '/chromium/src/build' + '@' + 'f79db013c75bff172913707cd762eba847838fea',
    1818  'src/buildtools':
    19     Var('chromium_git') + '/chromium/buildtools.git' + '@' + 'a09e064635a49f08e585e3b173d5fbc3dd3f485e',
     19    Var('chromium_git') + '/chromium/buildtools.git' + '@' + '9a90d9aaadeb5e04327ed05775f45132e4b3523f',
    2020  'src/testing':
    21     Var('chromium_git') + '/chromium/src/testing' + '@' + '5f7e36cad6434fd3d65674af96653a23ecc9f694',
     21    Var('chromium_git') + '/chromium/src/testing' + '@' + 'd2fde4ae5b8d0a5021e6f79d2f4a62e83ba348bc',
    2222  'src/third_party':
    23     Var('chromium_git') + '/chromium/src/third_party' + '@' + '2c0ced3ddbf84ce1c0759b277d9538da42f23650',
     23    Var('chromium_git') + '/chromium/src/third_party' + '@' + 'f931bb4f2bdcb327d066052df1914cab4bd68c50',
    2424  'src/third_party/catapult':
    2525    Var('chromium_git') + '/catapult.git' + '@' + Var('catapult_revision'),
    2626  'src/third_party/colorama/src':
    2727    Var('chromium_git') + '/external/colorama.git' + '@' + '799604a1041e9b3bc5d2789ecbd7e8db2e18e6b8',
     28  'src/third_party/freetype/src':
     29    Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + '578bcf103a12fb742cdb314565819011d1ac12a7',
    2830  'src/third_party/googletest/src':
    29     Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + '0062e4869f07a3ef235703ddf63af604b712446c',
     31    Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + 'd5266326752f0a1dadbd310932d8f4fd8c3c5e7d',
     32  'src/third_party/harfbuzz-ng/src':
     33    Var('chromium_git') + '/external/github.com/harfbuzz/harfbuzz.git' + '@' + '2b76767bf572364d3d647cdd139f2044a7ad06b2',
    3034  'src/third_party/libjpeg_turbo':
    3135    Var('chromium_git') + '/chromium/deps/libjpeg_turbo.git' + '@' + 'a1750dbc79a8792dde3d3f7d7d8ac28ba01ac9dd',
    3236  'src/third_party/yasm/source/patched-yasm':
    33     Var('chromium_git') + '/chromium/deps/yasm/patched-yasm.git' + '@' + 'b98114e18d8b9b84586b10d24353ab8616d4c5fc',
     37    Var('chromium_git') + '/chromium/deps/yasm/patched-yasm.git' + '@' + '720b70524a4424b15fc57e82263568c8ba0496ad',
    3438  'src/tools':
    35     Var('chromium_git') + '/chromium/src/tools' + '@' + '6202b67fc46a9984097caf237e12e3b8f7a9f7da',
    36   'src/tools/gyp':
    37     Var('chromium_git') + '/external/gyp.git' + '@' + 'd61a9397e668fa9843c4aa7da9e79460fe590bfb',
    38    'src/tools/swarming_client':
    39      Var('chromium_git') + '/infra/luci/client-py.git' + '@' +  Var('swarming_revision'),
     39    Var('chromium_git') + '/chromium/src/tools' + '@' + 'f2c6ed916b94176158763400de308c2afd56b259',
     40  'src/tools/swarming_client':
     41    Var('chromium_git') + '/infra/luci/client-py.git' + '@' +  Var('swarming_revision'),
    4042
    4143  # libyuv-only dependencies (not present in Chromium).
     
    5355
    5456  # Android deps:
     57  'src/third_party/accessibility_test_framework': {
     58      'packages': [
     59          {
     60              'package': 'chromium/third_party/accessibility-test-framework',
     61              'version': 'version:2.1-cr0',
     62          },
     63      ],
     64      'condition': 'checkout_android',
     65      'dep_type': 'cipd',
     66  },
    5567  'src/third_party/auto/src': {
    5668    'url': Var('chromium_git') + '/external/github.com/google/auto.git' + '@' + '8a81a858ae7b78a1aef71ac3905fade0bbd64e82',
    5769    'condition': 'checkout_android',
    5870  },
    59   'src/third_party/auto/src': {
    60     'url': Var('chromium_git') + '/external/github.com/google/auto.git' + '@' + '8a81a858ae7b78a1aef71ac3905fade0bbd64e82',
    61     'condition': 'checkout_android',
    62   },
    6371  'src/base': {
    64     'url': Var('chromium_git') + '/chromium/src/base' + '@' + 'ac3d2b81181b085a9952cb83dba748420eefe691',
    65     'condition': 'checkout_android',
     72    'url': Var('chromium_git') + '/chromium/src/base' + '@' + '6c0497f398c5f6e6af0c66fbf4d77e875eb3f2b1',
     73    'condition': 'checkout_android',
     74  },
     75  'src/third_party/bazel': {
     76      'packages': [
     77          {
     78              'package': 'chromium/third_party/bazel',
     79              'version': 'version:0.10.0',
     80          },
     81      ],
     82      'condition': 'checkout_android',
     83      'dep_type': 'cipd',
     84  },
     85  'src/third_party/bouncycastle': {
     86      'packages': [
     87          {
     88              'package': 'chromium/third_party/bouncycastle',
     89              'version': 'version:1.46-cr0',
     90          },
     91      ],
     92      'condition': 'checkout_android',
     93      'dep_type': 'cipd',
    6694  },
    6795  'src/third_party/android_ndk': {
    68     'url': Var('chromium_git') + '/android_ndk.git' + '@' + 'e951c37287c7d8cd915bf8d4149fd4a06d808b55',
    69     'condition': 'checkout_android',
     96    'url': Var('chromium_git') + '/android_ndk.git' + '@' + '5cd86312e794bdf542a3685c6f10cbb96072990b',
     97    'condition': 'checkout_android',
     98  },
     99  'src/third_party/android_support_test_runner': {
     100      'packages': [
     101          {
     102              'package': 'chromium/third_party/android_support_test_runner',
     103              'version': 'version:0.5-cr0',
     104          },
     105      ],
     106      'condition': 'checkout_android',
     107      'dep_type': 'cipd',
    70108  },
    71109  'src/third_party/android_tools': {
    72     'url': Var('chromium_git') + '/android_tools.git' + '@' + '9a70d48fcdd68cd0e7e968f342bd767ee6323bd1',
    73     'condition': 'checkout_android',
     110    'url': Var('chromium_git') + '/android_tools.git' + '@' + '130499e25286f4d56acafa252fee09f3cc595c49',
     111    'condition': 'checkout_android',
     112  },
     113  'src/third_party/byte_buddy': {
     114      'packages': [
     115          {
     116              'package': 'chromium/third_party/byte_buddy',
     117              'version': 'version:1.4.17-cr0',
     118          },
     119      ],
     120      'condition': 'checkout_android',
     121      'dep_type': 'cipd',
    74122  },
    75123  'src/third_party/ced/src': {
     
    78126  },
    79127  'src/third_party/errorprone/lib': {
    80       'url': Var('chromium_git') + '/chromium/third_party/errorprone.git' + '@' + 'ecc57c2b00627667874744b9ad8efe10734d97a8',
     128      'url': Var('chromium_git') + '/chromium/third_party/errorprone.git' + '@' + '980d49e839aa4984015efed34b0134d4b2c9b6d7',
    81129      'condition': 'checkout_android',
    82130  },
     
    85133    'condition': 'checkout_android',
    86134  },
     135  'src/third_party/gson': {
     136      'packages': [
     137          {
     138              'package': 'chromium/third_party/gson',
     139              'version': 'version:2.8.0-cr0',
     140          },
     141      ],
     142      'condition': 'checkout_android',
     143      'dep_type': 'cipd',
     144  },
     145  'src/third_party/guava': {
     146      'packages': [
     147          {
     148              'package': 'chromium/third_party/guava',
     149              'version': 'version:23.0-cr0',
     150          },
     151      ],
     152      'condition': 'checkout_android',
     153      'dep_type': 'cipd',
     154  },
     155  'src/third_party/hamcrest': {
     156      'packages': [
     157          {
     158              'package': 'chromium/third_party/hamcrest',
     159              'version': 'version:1.3-cr0',
     160          },
     161      ],
     162      'condition': 'checkout_android',
     163      'dep_type': 'cipd',
     164  },
    87165  'src/third_party/icu': {
    88     'url': Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'd888fd2a1be890f4d35e43f68d6d79f42519a357',
     166    'url': Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '297a4dd02b9d36c92ab9b4f121e433c9c3bc14f8',
     167  },
     168  'src/third_party/icu4j': {
     169      'packages': [
     170          {
     171              'package': 'chromium/third_party/icu4j',
     172              'version': 'version:53.1-cr0',
     173          },
     174      ],
     175      'condition': 'checkout_android',
     176      'dep_type': 'cipd',
     177  },
     178  'src/third_party/intellij': {
     179      'packages': [
     180          {
     181              'package': 'chromium/third_party/intellij',
     182              'version': 'version:12.0-cr0',
     183          },
     184      ],
     185      'condition': 'checkout_android',
     186      'dep_type': 'cipd',
    89187  },
    90188  'src/third_party/jsr-305/src': {
     
    97195  },
    98196  'src/third_party/mockito/src': {
    99     'url': Var('chromium_git') + '/external/mockito/mockito.git' + '@' + 'de83ad4598ad4cf5ea53c69a8a8053780b04b850',
    100     'condition': 'checkout_android',
     197    'url': Var('chromium_git') + '/external/mockito/mockito.git' + '@' + '04a2a289a4222f80ad20717c25144981210d2eac',
     198    'condition': 'checkout_android',
     199  },
     200  'src/third_party/objenesis': {
     201      'packages': [
     202          {
     203              'package': 'chromium/third_party/objenesis',
     204              'version': 'version:2.4-cr0',
     205          },
     206      ],
     207      'condition': 'checkout_android',
     208      'dep_type': 'cipd',
     209  },
     210  'src/third_party/ow2_asm': {
     211      'packages': [
     212          {
     213              'package': 'chromium/third_party/ow2_asm',
     214              'version': 'version:5.0.1-cr0',
     215          },
     216      ],
     217      'condition': 'checkout_android',
     218      'dep_type': 'cipd',
     219  },
     220  'src/third_party/r8': {
     221      'packages': [
     222          {
     223              'package': 'chromium/third_party/r8',
     224              'version': 'version:1.0.30',
     225          },
     226      ],
     227      'condition': 'checkout_android',
     228      'dep_type': 'cipd',
    101229  },
    102230  'src/third_party/requests/src': {
     
    104232    'condition': 'checkout_android',
    105233  },
     234  'src/third_party/robolectric': {
     235      'packages': [
     236          {
     237              'package': 'chromium/third_party/robolectric',
     238              'version': 'version:3.5.1',
     239          },
     240      ],
     241      'condition': 'checkout_android',
     242      'dep_type': 'cipd',
     243  },
    106244  'src/third_party/robolectric/robolectric': {
    107245    'url': Var('chromium_git') + '/external/robolectric.git' + '@' + '7e067f1112e1502caa742f7be72d37b5678d3403',
    108246    'condition': 'checkout_android',
    109247  },
     248  'src/third_party/sqlite4java': {
     249      'packages': [
     250          {
     251              'package': 'chromium/third_party/sqlite4java',
     252              'version': 'version:0.282-cr0',
     253          },
     254      ],
     255      'condition': 'checkout_android',
     256      'dep_type': 'cipd',
     257  },
    110258  'src/third_party/ub-uiautomator/lib': {
    111259    'url': Var('chromium_git') + '/chromium/third_party/ub-uiautomator.git' + '@' + '00270549ce3161ae72ceb24712618ea28b4f9434',
    112260    'condition': 'checkout_android',
    113261  },
     262  'src/third_party/xstream': {
     263      'packages': [
     264          {
     265              'package': 'chromium/third_party/xstream',
     266              'version': 'version:1.4.8-cr0',
     267          },
     268      ],
     269      'condition': 'checkout_android',
     270      'dep_type': 'cipd',
     271  },
    114272
    115273  # iOS deps:
    116274  'src/ios': {
    117     'url': Var('chromium_git') + '/chromium/src/ios' + '@' + '299ef76e844a74a1f2f4ce7f06d101861fb49aba',
     275    'url': Var('chromium_git') + '/chromium/src/ios' + '@' + '8e45eb00dffadde7e0669a881991e237b0b7a8eb',
    118276    'condition': 'checkout_ios'
    119277  },
     
    125283    'condition': 'checkout_win',
    126284  },
     285
     286  # === ANDROID_DEPS Generated Code Start ===
     287  # Generated by //tools/android/roll/android_deps/fetch_all.sh
     288  'src/third_party/android_deps/libs/android_arch_core_common': {
     289      'packages': [
     290          {
     291              'package': 'chromium/third_party/android_deps/libs/android_arch_core_common',
     292              'version': 'version:1.0.0-cr0',
     293          },
     294      ],
     295      'condition': 'checkout_android',
     296      'dep_type': 'cipd',
     297  },
     298
     299  'src/third_party/android_deps/libs/android_arch_lifecycle_common': {
     300      'packages': [
     301          {
     302              'package': 'chromium/third_party/android_deps/libs/android_arch_lifecycle_common',
     303              'version': 'version:1.0.0-cr0',
     304          },
     305      ],
     306      'condition': 'checkout_android',
     307      'dep_type': 'cipd',
     308  },
     309
     310  'src/third_party/android_deps/libs/android_arch_lifecycle_runtime': {
     311      'packages': [
     312          {
     313              'package': 'chromium/third_party/android_deps/libs/android_arch_lifecycle_runtime',
     314              'version': 'version:1.0.0-cr0',
     315          },
     316      ],
     317      'condition': 'checkout_android',
     318      'dep_type': 'cipd',
     319  },
     320
     321  'src/third_party/android_deps/libs/com_android_support_animated_vector_drawable': {
     322      'packages': [
     323          {
     324              'package': 'chromium/third_party/android_deps/libs/com_android_support_animated_vector_drawable',
     325              'version': 'version:27.0.0-cr0',
     326          },
     327      ],
     328      'condition': 'checkout_android',
     329      'dep_type': 'cipd',
     330  },
     331
     332  'src/third_party/android_deps/libs/com_android_support_appcompat_v7': {
     333      'packages': [
     334          {
     335              'package': 'chromium/third_party/android_deps/libs/com_android_support_appcompat_v7',
     336              'version': 'version:27.0.0-cr0',
     337          },
     338      ],
     339      'condition': 'checkout_android',
     340      'dep_type': 'cipd',
     341  },
     342
     343  'src/third_party/android_deps/libs/com_android_support_cardview_v7': {
     344      'packages': [
     345          {
     346              'package': 'chromium/third_party/android_deps/libs/com_android_support_cardview_v7',
     347              'version': 'version:27.0.0-cr0',
     348          },
     349      ],
     350      'condition': 'checkout_android',
     351      'dep_type': 'cipd',
     352  },
     353
     354  'src/third_party/android_deps/libs/com_android_support_design': {
     355      'packages': [
     356          {
     357              'package': 'chromium/third_party/android_deps/libs/com_android_support_design',
     358              'version': 'version:27.0.0-cr0',
     359          },
     360      ],
     361      'condition': 'checkout_android',
     362      'dep_type': 'cipd',
     363  },
     364
     365  'src/third_party/android_deps/libs/com_android_support_gridlayout_v7': {
     366      'packages': [
     367          {
     368              'package': 'chromium/third_party/android_deps/libs/com_android_support_gridlayout_v7',
     369              'version': 'version:27.0.0-cr0',
     370          },
     371      ],
     372      'condition': 'checkout_android',
     373      'dep_type': 'cipd',
     374  },
     375
     376  'src/third_party/android_deps/libs/com_android_support_leanback_v17': {
     377      'packages': [
     378          {
     379              'package': 'chromium/third_party/android_deps/libs/com_android_support_leanback_v17',
     380              'version': 'version:27.0.0-cr0',
     381          },
     382      ],
     383      'condition': 'checkout_android',
     384      'dep_type': 'cipd',
     385  },
     386
     387  'src/third_party/android_deps/libs/com_android_support_mediarouter_v7': {
     388      'packages': [
     389          {
     390              'package': 'chromium/third_party/android_deps/libs/com_android_support_mediarouter_v7',
     391              'version': 'version:27.0.0-cr0',
     392          },
     393      ],
     394      'condition': 'checkout_android',
     395      'dep_type': 'cipd',
     396  },
     397
     398  'src/third_party/android_deps/libs/com_android_support_multidex': {
     399      'packages': [
     400          {
     401              'package': 'chromium/third_party/android_deps/libs/com_android_support_multidex',
     402              'version': 'version:1.0.0-cr0',
     403          },
     404      ],
     405      'condition': 'checkout_android',
     406      'dep_type': 'cipd',
     407  },
     408
     409  'src/third_party/android_deps/libs/com_android_support_palette_v7': {
     410      'packages': [
     411          {
     412              'package': 'chromium/third_party/android_deps/libs/com_android_support_palette_v7',
     413              'version': 'version:27.0.0-cr0',
     414          },
     415      ],
     416      'condition': 'checkout_android',
     417      'dep_type': 'cipd',
     418  },
     419
     420  'src/third_party/android_deps/libs/com_android_support_preference_leanback_v17': {
     421      'packages': [
     422          {
     423              'package': 'chromium/third_party/android_deps/libs/com_android_support_preference_leanback_v17',
     424              'version': 'version:27.0.0-cr0',
     425          },
     426      ],
     427      'condition': 'checkout_android',
     428      'dep_type': 'cipd',
     429  },
     430
     431  'src/third_party/android_deps/libs/com_android_support_preference_v14': {
     432      'packages': [
     433          {
     434              'package': 'chromium/third_party/android_deps/libs/com_android_support_preference_v14',
     435              'version': 'version:27.0.0-cr0',
     436          },
     437      ],
     438      'condition': 'checkout_android',
     439      'dep_type': 'cipd',
     440  },
     441
     442  'src/third_party/android_deps/libs/com_android_support_preference_v7': {
     443      'packages': [
     444          {
     445              'package': 'chromium/third_party/android_deps/libs/com_android_support_preference_v7',
     446              'version': 'version:27.0.0-cr0',
     447          },
     448      ],
     449      'condition': 'checkout_android',
     450      'dep_type': 'cipd',
     451  },
     452
     453  'src/third_party/android_deps/libs/com_android_support_recyclerview_v7': {
     454      'packages': [
     455          {
     456              'package': 'chromium/third_party/android_deps/libs/com_android_support_recyclerview_v7',
     457              'version': 'version:27.0.0-cr0',
     458          },
     459      ],
     460      'condition': 'checkout_android',
     461      'dep_type': 'cipd',
     462  },
     463
     464  'src/third_party/android_deps/libs/com_android_support_support_annotations': {
     465      'packages': [
     466          {
     467              'package': 'chromium/third_party/android_deps/libs/com_android_support_support_annotations',
     468              'version': 'version:27.0.0-cr0',
     469          },
     470      ],
     471      'condition': 'checkout_android',
     472      'dep_type': 'cipd',
     473  },
     474
     475  'src/third_party/android_deps/libs/com_android_support_support_compat': {
     476      'packages': [
     477          {
     478              'package': 'chromium/third_party/android_deps/libs/com_android_support_support_compat',
     479              'version': 'version:27.0.0-cr0',
     480          },
     481      ],
     482      'condition': 'checkout_android',
     483      'dep_type': 'cipd',
     484  },
     485
     486  'src/third_party/android_deps/libs/com_android_support_support_core_ui': {
     487      'packages': [
     488          {
     489              'package': 'chromium/third_party/android_deps/libs/com_android_support_support_core_ui',
     490              'version': 'version:27.0.0-cr0',
     491          },
     492      ],
     493      'condition': 'checkout_android',
     494      'dep_type': 'cipd',
     495  },
     496
     497  'src/third_party/android_deps/libs/com_android_support_support_core_utils': {
     498      'packages': [
     499          {
     500              'package': 'chromium/third_party/android_deps/libs/com_android_support_support_core_utils',
     501              'version': 'version:27.0.0-cr0',
     502          },
     503      ],
     504      'condition': 'checkout_android',
     505      'dep_type': 'cipd',
     506  },
     507
     508  'src/third_party/android_deps/libs/com_android_support_support_fragment': {
     509      'packages': [
     510          {
     511              'package': 'chromium/third_party/android_deps/libs/com_android_support_support_fragment',
     512              'version': 'version:27.0.0-cr0',
     513          },
     514      ],
     515      'condition': 'checkout_android',
     516      'dep_type': 'cipd',
     517  },
     518
     519  'src/third_party/android_deps/libs/com_android_support_support_media_compat': {
     520      'packages': [
     521          {
     522              'package': 'chromium/third_party/android_deps/libs/com_android_support_support_media_compat',
     523              'version': 'version:27.0.0-cr0',
     524          },
     525      ],
     526      'condition': 'checkout_android',
     527      'dep_type': 'cipd',
     528  },
     529
     530  'src/third_party/android_deps/libs/com_android_support_support_v13': {
     531      'packages': [
     532          {
     533              'package': 'chromium/third_party/android_deps/libs/com_android_support_support_v13',
     534              'version': 'version:27.0.0-cr0',
     535          },
     536      ],
     537      'condition': 'checkout_android',
     538      'dep_type': 'cipd',
     539  },
     540
     541  'src/third_party/android_deps/libs/com_android_support_support_v4': {
     542      'packages': [
     543          {
     544              'package': 'chromium/third_party/android_deps/libs/com_android_support_support_v4',
     545              'version': 'version:27.0.0-cr0',
     546          },
     547      ],
     548      'condition': 'checkout_android',
     549      'dep_type': 'cipd',
     550  },
     551
     552  'src/third_party/android_deps/libs/com_android_support_support_vector_drawable': {
     553      'packages': [
     554          {
     555              'package': 'chromium/third_party/android_deps/libs/com_android_support_support_vector_drawable',
     556              'version': 'version:27.0.0-cr0',
     557          },
     558      ],
     559      'condition': 'checkout_android',
     560      'dep_type': 'cipd',
     561  },
     562
     563  'src/third_party/android_deps/libs/com_android_support_transition': {
     564      'packages': [
     565          {
     566              'package': 'chromium/third_party/android_deps/libs/com_android_support_transition',
     567              'version': 'version:27.0.0-cr0',
     568          },
     569      ],
     570      'condition': 'checkout_android',
     571      'dep_type': 'cipd',
     572  },
     573
     574  'src/third_party/android_deps/libs/com_google_android_gms_play_services_auth': {
     575      'packages': [
     576          {
     577              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth',
     578              'version': 'version:12.0.1-cr0',
     579          },
     580      ],
     581      'condition': 'checkout_android',
     582      'dep_type': 'cipd',
     583  },
     584
     585  'src/third_party/android_deps/libs/com_google_android_gms_play_services_auth_api_phone': {
     586      'packages': [
     587          {
     588              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth_api_phone',
     589              'version': 'version:12.0.1-cr0',
     590          },
     591      ],
     592      'condition': 'checkout_android',
     593      'dep_type': 'cipd',
     594  },
     595
     596  'src/third_party/android_deps/libs/com_google_android_gms_play_services_auth_base': {
     597      'packages': [
     598          {
     599              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth_base',
     600              'version': 'version:12.0.1-cr0',
     601          },
     602      ],
     603      'condition': 'checkout_android',
     604      'dep_type': 'cipd',
     605  },
     606
     607  'src/third_party/android_deps/libs/com_google_android_gms_play_services_base': {
     608      'packages': [
     609          {
     610              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_base',
     611              'version': 'version:12.0.1-cr0',
     612          },
     613      ],
     614      'condition': 'checkout_android',
     615      'dep_type': 'cipd',
     616  },
     617
     618  'src/third_party/android_deps/libs/com_google_android_gms_play_services_basement': {
     619      'packages': [
     620          {
     621              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_basement',
     622              'version': 'version:12.0.1-cr0',
     623          },
     624      ],
     625      'condition': 'checkout_android',
     626      'dep_type': 'cipd',
     627  },
     628
     629  'src/third_party/android_deps/libs/com_google_android_gms_play_services_cast': {
     630      'packages': [
     631          {
     632              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_cast',
     633              'version': 'version:12.0.1-cr0',
     634          },
     635      ],
     636      'condition': 'checkout_android',
     637      'dep_type': 'cipd',
     638  },
     639
     640  'src/third_party/android_deps/libs/com_google_android_gms_play_services_cast_framework': {
     641      'packages': [
     642          {
     643              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_cast_framework',
     644              'version': 'version:12.0.1-cr0',
     645          },
     646      ],
     647      'condition': 'checkout_android',
     648      'dep_type': 'cipd',
     649  },
     650
     651  'src/third_party/android_deps/libs/com_google_android_gms_play_services_fido': {
     652      'packages': [
     653          {
     654              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_fido',
     655              'version': 'version:12.0.1-cr0',
     656          },
     657      ],
     658      'condition': 'checkout_android',
     659      'dep_type': 'cipd',
     660  },
     661
     662  'src/third_party/android_deps/libs/com_google_android_gms_play_services_gcm': {
     663      'packages': [
     664          {
     665              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_gcm',
     666              'version': 'version:12.0.1-cr0',
     667          },
     668      ],
     669      'condition': 'checkout_android',
     670      'dep_type': 'cipd',
     671  },
     672
     673  'src/third_party/android_deps/libs/com_google_android_gms_play_services_iid': {
     674      'packages': [
     675          {
     676              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_iid',
     677              'version': 'version:12.0.1-cr0',
     678          },
     679      ],
     680      'condition': 'checkout_android',
     681      'dep_type': 'cipd',
     682  },
     683
     684  'src/third_party/android_deps/libs/com_google_android_gms_play_services_instantapps': {
     685      'packages': [
     686          {
     687              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_instantapps',
     688              'version': 'version:12.0.1-cr0',
     689          },
     690      ],
     691      'condition': 'checkout_android',
     692      'dep_type': 'cipd',
     693  },
     694
     695  'src/third_party/android_deps/libs/com_google_android_gms_play_services_location': {
     696      'packages': [
     697          {
     698              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_location',
     699              'version': 'version:12.0.1-cr0',
     700          },
     701      ],
     702      'condition': 'checkout_android',
     703      'dep_type': 'cipd',
     704  },
     705
     706  'src/third_party/android_deps/libs/com_google_android_gms_play_services_tasks': {
     707      'packages': [
     708          {
     709              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_tasks',
     710              'version': 'version:12.0.1-cr0',
     711          },
     712      ],
     713      'condition': 'checkout_android',
     714      'dep_type': 'cipd',
     715  },
     716
     717  'src/third_party/android_deps/libs/com_google_android_gms_play_services_vision': {
     718      'packages': [
     719          {
     720              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_vision',
     721              'version': 'version:12.0.1-cr0',
     722          },
     723      ],
     724      'condition': 'checkout_android',
     725      'dep_type': 'cipd',
     726  },
     727
     728  'src/third_party/android_deps/libs/com_google_android_gms_play_services_vision_common': {
     729      'packages': [
     730          {
     731              'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_vision_common',
     732              'version': 'version:12.0.1-cr0',
     733          },
     734      ],
     735      'condition': 'checkout_android',
     736      'dep_type': 'cipd',
     737  },
     738
     739  'src/third_party/android_deps/libs/com_google_android_play_core': {
     740      'packages': [
     741          {
     742              'package': 'chromium/third_party/android_deps/libs/com_google_android_play_core',
     743              'version': 'version:1.3.0-cr0',
     744          },
     745      ],
     746      'condition': 'checkout_android',
     747      'dep_type': 'cipd',
     748  },
     749
     750  # === ANDROID_DEPS Generated Code End ===
    127751}
    128752
     
    198822    'action': ['python', 'src/build/vs_toolchain.py', 'update'],
    199823  },
     824  {
     825    # Update the Mac toolchain if necessary.
     826    'name': 'mac_toolchain',
     827    'pattern': '.',
     828    'action': ['python', 'src/build/mac_toolchain.py'],
     829  },
    200830  # Pull binutils for linux, enabled debug fission for faster linking /
    201831  # debugging when used with clang on Ubuntu Precise.
     
    214844    'name': 'clang',
    215845    'pattern': '.',
    216     'action': ['python', 'src/tools/clang/scripts/update.py', '--if-needed'],
     846    'action': ['python', 'src/tools/clang/scripts/update.py'],
    217847  },
    218848  {
     
    326956  },
    327957  {
    328     'name': 'Android CIPD Ensure',
    329     'pattern': '.',
    330     'condition': 'checkout_android',
    331     'action': ['src/build/cipd/cipd_wrapper.py',
    332                '--chromium-root', 'src',
    333                '--ensure-file', 'src/build/cipd/android/android.ensure',
     958    # We used to use src as a CIPD root. We moved it to a different directory
     959    # in crrev.com/c/930178 but left the clobber here to ensure that that CL
     960    # could be reverted safely. This can be safely removed once crbug.com/794764
     961    # is resolved.
     962    'name': 'Android Clobber Deprecated CIPD Root',
     963    'pattern': '.',
     964    'condition': 'checkout_android',
     965    'action': ['src/build/cipd/clobber_cipd_root.py',
     966               '--root', 'src',
    334967    ],
    335968  },
     
    341974    # third_party/android_tools/sdk/extras directory.
    342975    'name': 'sdkextras',
     976    'condition': 'checkout_android',
    343977    'pattern': '.',
    344978    # When adding a new sdk extras package to download, add the package
    345979    # directory and zip file to .gitignore in third_party/android_tools.
    346     'action': ['python',
     980    'action': ['vpython',
    347981               'src/build/android/play_services/update.py',
    348982               'download'
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/README.chromium

    r235135 r239415  
    11Name: libyuv
    22URL: http://code.google.com/p/libyuv/
    3 Version: 1703
     3Version: 1722
    44License: BSD
    55License File: LICENSE
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/README.md

    r235135 r239415  
    1111### Development
    1212
    13 See [Getting started] [1] for instructions on how to get started developing.
     13See [Getting started][1] for instructions on how to get started developing.
    1414
    15 You can also browse the [docs directory] [2] for more documentation.
     15You can also browse the [docs directory][2] for more documentation.
    1616
    17 [1]: https://chromium.googlesource.com/libyuv/libyuv/+/master/docs/getting_started.md
    18 [2]: https://chromium.googlesource.com/libyuv/libyuv/+/master/docs/
     17[1]: ./docs/getting_started.md
     18[2]: ./docs/
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/build_overrides/build.gni

    r229378 r239415  
    3434ignore_elf32_limitations = true
    3535
    36 # Use system Xcode installation instead of the Chromium bundled Mac toolchain,
    37 # since it contains only SDK 10.11, not 10.12 which WebRTC needs.
    38 use_system_xcode = true
     36# Use bundled hermetic Xcode installation maintained by Chromium,
     37# except for local iOS builds where it is unsupported.
     38if (host_os == "mac") {
     39  _result = exec_script("//build/mac/should_use_hermetic_xcode.py",
     40                        [ target_os ],
     41                        "value")
     42  assert(_result != 2,
     43         "Do not allow building targets with the default" +
     44             "hermetic toolchain if the minimum OS version is not met.")
     45  use_system_xcode = _result == 0
     46}
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/docs/environment_variables.md

    r235135 r239415  
    77By default the cpu is detected and the most advanced form of SIMD is used.  But you can disable instruction sets selectively, or completely, falling back on C code.  Set the variable to 1 to disable the specified instruction set.
    88
     9## All CPUs
    910    LIBYUV_DISABLE_ASM
     11
     12## Intel CPUs
    1013    LIBYUV_DISABLE_X86
    1114    LIBYUV_DISABLE_SSE2
     
    1518    LIBYUV_DISABLE_AVX
    1619    LIBYUV_DISABLE_AVX2
    17     LIBYUV_DISABLE_AVX512BW
    1820    LIBYUV_DISABLE_ERMS
    1921    LIBYUV_DISABLE_FMA3
     22    LIBYUV_DISABLE_F16C
     23    LIBYUV_DISABLE_AVX512BW
     24    LIBYUV_DISABLE_AVX512VL
     25    LIBYUV_DISABLE_AVX512VBMI
     26    LIBYUV_DISABLE_AVX512VBMI2
     27    LIBYUV_DISABLE_AVX512VBITALG
     28    LIBYUV_DISABLE_AVX512VPOPCNTDQ
     29    LIBYUV_DISABLE_GFNI
     30
     31## ARM CPUs
     32
     33    LIBYUV_DISABLE_NEON
     34
     35## MIPS CPUs
    2036    LIBYUV_DISABLE_MSA
    21     LIBYUV_DISABLE_NEON
     37    LIBYUV_DISABLE_MMI
    2238
    2339# Test Width/Height/Repeat
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/docs/formats.md

    r235135 r239415  
    6767      FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'),
    6868
    69       // 7 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
     69      // 8 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
    7070      FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'),
    7171      FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'),
     
    7575      FOURCC_J400 = FOURCC('J', '4', '0', '0'),  // unofficial fourcc
    7676      FOURCC_H420 = FOURCC('H', '4', '2', '0'),  // unofficial fourcc
     77      FOURCC_H422 = FOURCC('H', '4', '2', '2'),  // unofficial fourcc
    7778
    7879      // 14 Auxiliary aliases.  CanonicalFourCC() maps these to canonical fourcc.
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/docs/getting_started.md

    r235135 r239415  
    2828    ];
    2929
    30 For iOS add `;target_os=['ios'];` to your OSX .gclient and run `GYP_DEFINES="OS=ios" gclient sync.`
     30For iOS add `;target_os=['ios'];` to your OSX .gclient and run `gclient sync.`
    3131
    3232Browse the Git reprository: https://chromium.googlesource.com/libyuv/libyuv/+/master
     
    4949Then run:
    5050
    51     export GYP_DEFINES="OS=android"
    5251    gclient sync
    53 
    54 The sync will generate native build files for your environment using gyp (Windows: Visual Studio, OSX: XCode, Linux: make). This generation can also be forced manually: `gclient runhooks`
    5552
    5653To get just the source (not buildable):
     
    9996ios simulator
    10097
    101     gn gen out/Release "--args=is_debug=false target_os=\"ios\" ios_enable_code_signing=false target_cpu=\"x86\""
    102     gn gen out/Debug "--args=is_debug=true target_os=\"ios\" ios_enable_code_signing=false target_cpu=\"x86\""
    103     ninja -v -C out/Debug libyuv_unittest
    104     ninja -v -C out/Release libyuv_unittest
     98    gn gen out/Release "--args=is_debug=false target_os=\"ios\" ios_enable_code_signing=false use_xcode_clang=true target_cpu=\"x86\""
     99    gn gen out/Debug "--args=is_debug=true target_os=\"ios\" ios_enable_code_signing=false use_xcode_clang=true target_cpu=\"x86\""
     100    ninja -v -C out/Debug libyuv_unittest
     101    ninja -v -C out/Release libyuv_unittest
     102
     103ios disassembly
     104
     105    otool -tV ./out/Release/obj/libyuv_neon/row_neon64.o >row_neon64.txt
    105106
    106107### Android
     
    132133mips
    133134
    134     gn gen out/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"mips64el\" mips_arch_variant=\"r6\" mips_use_msa=true is_component_build=true is_clang=true"
    135     gn gen out/Debug "--args=is_debug=true target_os=\"android\" target_cpu=\"mips64el\" mips_arch_variant=\"r6\" mips_use_msa=true is_component_build=true is_clang=true"
     135    gn gen out/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"mips64el\" mips_arch_variant=\"r6\" mips_use_msa=true is_component_build=true"
     136    gn gen out/Debug "--args=is_debug=true target_os=\"android\" target_cpu=\"mips64el\" mips_arch_variant=\"r6\" mips_use_msa=true is_component_build=true"
    136137    ninja -v -C out/Debug libyuv_unittest
    137138    ninja -v -C out/Release libyuv_unittest
     
    145146    third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d ./out/Release/obj/libyuv_neon/row_neon64.o >row_neon64.txt
    146147
     148    Caveat: Disassembly may require optimize_max be disabled in BUILD.gn
     149
    147150Running tests:
    148151
    149     build/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=*
     152    out/Release/bin/run_libyuv_unittest -vv --gtest_filter=*
    150153
    151154Running test as benchmark:
    152155
    153     build/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=-1  --libyuv_cpu_info=-1"
     156    out/Release/bin/run_libyuv_unittest -vv --gtest_filter=* --libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=-1  --libyuv_cpu_info=-1
    154157
    155158Running test with C code:
    156159
    157     build/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=1 --libyuv_cpu_info=1"
     160    out/Release/bin/run_libyuv_unittest -vv --gtest_filter=* --libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=1 --libyuv_cpu_info=1
    158161
    159162### Build targets
     
    172175    ninja -v -C out/Debug libyuv_unittest
    173176    ninja -v -C out/Release libyuv_unittest
     177
     178### MIPS Linux
     179
     180mips
     181
     182   gn gen out/Release "--args=is_debug=false target_os=\"linux\" target_cpu=\"mips64el\" mips_arch_variant=\"loongson3\" mips_use_mmi=true is_component_build=false use_sysroot=false use_gold=false"
     183   gn gen out/Debug "--args=is_debug=true target_os=\"linux\" target_cpu=\"mips64el\" mips_arch_variant=\"loongson3\" mips_use_mmi=true is_component_build=false use_sysroot=false use_gold=false"
     184   ninja -v -C out/Debug libyuv_unittest
     185   ninja -v -C out/Release libyuv_unittest
    174186
    175187## Building the Library with make
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/basic_types.h

    r235135 r239415  
    3030#include <stdint.h>  // for uintptr_t and C99 types
    3131#endif               // defined(_MSC_VER) && (_MSC_VER < 1600)
     32// Types are deprecated.  Enable this macro for legacy types.
     33#ifdef LIBYUV_LEGACY_TYPES
    3234typedef uint64_t uint64;
    3335typedef int64_t int64;
     
    3840typedef uint8_t uint8;
    3941typedef int8_t int8;
     42#endif  // LIBYUV_LEGACY_TYPES
    4043#endif  // INT_TYPES_DEFINED
    4144
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/compare_row.h

    r235135 r239415  
    4646#endif  // __clang__
    4747
    48 // The following are available for Visual C:
    49 #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \
    50     (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2))
    51 #define HAS_HASHDJB2_AVX2
    52 #endif
    53 
    5448// The following are available for Visual C and GCC:
    5549#if !defined(LIBYUV_DISABLE_X86) && \
     
    6155
    6256// The following are available for Visual C and clangcl 32 bit:
    63 #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \
     57#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) && \
    6458    (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2))
    6559#define HAS_HASHDJB2_AVX2
     
    9185#endif
    9286
     87#if !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
     88#define HAS_HAMMINGDISTANCE_MMI
     89#define HAS_SUMSQUAREERROR_MMI
     90#endif
     91
    9392uint32_t HammingDistance_C(const uint8_t* src_a,
    9493                           const uint8_t* src_b,
     
    109108                             const uint8_t* src_b,
    110109                             int count);
    111 
     110uint32_t HammingDistance_MMI(const uint8_t* src_a,
     111                             const uint8_t* src_b,
     112                             int count);
    112113uint32_t SumSquareError_C(const uint8_t* src_a,
    113114                          const uint8_t* src_b,
     
    125126                            const uint8_t* src_b,
    126127                            int count);
     128uint32_t SumSquareError_MMI(const uint8_t* src_a,
     129                            const uint8_t* src_b,
     130                            int count);
    127131
    128132uint32_t HashDjb2_C(const uint8_t* src, int count, uint32_t seed);
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/convert.h

    r235135 r239415  
    4343               int height);
    4444
    45 // Convert I422 to I420.
    46 LIBYUV_API
    47 int I422ToI420(const uint8_t* src_y,
     45// Convert I444 to NV21.
     46LIBYUV_API
     47int I444ToNV21(const uint8_t* src_y,
    4848               int src_stride_y,
    4949               const uint8_t* src_u,
     
    5353               uint8_t* dst_y,
    5454               int dst_stride_y,
    55                uint8_t* dst_u,
    56                int dst_stride_u,
    57                uint8_t* dst_v,
    58                int dst_stride_v,
     55               uint8_t* dst_vu,
     56               int dst_stride_vu,
     57               int width,
     58               int height);
     59
     60// Convert I422 to I420.
     61LIBYUV_API
     62int I422ToI420(const uint8_t* src_y,
     63               int src_stride_y,
     64               const uint8_t* src_u,
     65               int src_stride_u,
     66               const uint8_t* src_v,
     67               int src_stride_v,
     68               uint8_t* dst_y,
     69               int dst_stride_y,
     70               uint8_t* dst_u,
     71               int dst_stride_u,
     72               uint8_t* dst_v,
     73               int dst_stride_v,
     74               int width,
     75               int height);
     76
     77// Convert I422 to NV21.
     78LIBYUV_API
     79int I422ToNV21(const uint8_t* src_y,
     80               int src_stride_y,
     81               const uint8_t* src_u,
     82               int src_stride_u,
     83               const uint8_t* src_v,
     84               int src_stride_v,
     85               uint8_t* dst_y,
     86               int dst_stride_y,
     87               uint8_t* dst_vu,
     88               int dst_stride_vu,
    5989               int width,
    6090               int height);
     
    125155               uint8_t* dst_v,
    126156               int dst_stride_v,
     157               int width,
     158               int height);
     159
     160// Convert I400 (grey) to NV21.
     161LIBYUV_API
     162int I400ToNV21(const uint8_t* src_y,
     163               int src_stride_y,
     164               uint8_t* dst_y,
     165               int dst_stride_y,
     166               uint8_t* dst_vu,
     167               int dst_stride_vu,
    127168               int width,
    128169               int height);
     
    346387               uint8_t* dst_v,
    347388               int dst_stride_v,
     389               int src_width,
     390               int src_height,
     391               int dst_width,
     392               int dst_height);
     393
     394// JPEG to NV21
     395LIBYUV_API
     396int MJPGToNV21(const uint8_t* sample,
     397               size_t sample_size,
     398               uint8_t* dst_y,
     399               int dst_stride_y,
     400               uint8_t* dst_vu,
     401               int dst_stride_vu,
    348402               int src_width,
    349403               int src_height,
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/convert_argb.h

    r235135 r239415  
    298298                int width,
    299299                int height);
     300
     301// Convert NV12 to RAW.
     302LIBYUV_API
     303int NV12ToRAW(const uint8_t* src_y,
     304              int src_stride_y,
     305              const uint8_t* src_uv,
     306              int src_stride_uv,
     307              uint8_t* dst_raw,
     308              int dst_stride_raw,
     309              int width,
     310              int height);
     311
     312// Convert NV21 to RAW.
     313LIBYUV_API
     314int NV21ToRAW(const uint8_t* src_y,
     315              int src_stride_y,
     316              const uint8_t* src_vu,
     317              int src_stride_vu,
     318              uint8_t* dst_raw,
     319              int dst_stride_raw,
     320              int width,
     321              int height);
    300322
    301323// Convert M420 to ARGB.
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/convert_from.h

    r235135 r239415  
    230230LIBYUV_API
    231231int I420ToRGB565(const uint8_t* src_y,
     232                 int src_stride_y,
     233                 const uint8_t* src_u,
     234                 int src_stride_u,
     235                 const uint8_t* src_v,
     236                 int src_stride_v,
     237                 uint8_t* dst_rgb565,
     238                 int dst_stride_rgb565,
     239                 int width,
     240                 int height);
     241
     242LIBYUV_API
     243int J420ToRGB565(const uint8_t* src_y,
     244                 int src_stride_y,
     245                 const uint8_t* src_u,
     246                 int src_stride_u,
     247                 const uint8_t* src_v,
     248                 int src_stride_v,
     249                 uint8_t* dst_rgb565,
     250                 int dst_stride_rgb565,
     251                 int width,
     252                 int height);
     253
     254LIBYUV_API
     255int H420ToRGB565(const uint8_t* src_y,
    232256                 int src_stride_y,
    233257                 const uint8_t* src_u,
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/cpu_id.h

    r235135 r239415  
    4949static const int kCpuHasMIPS = 0x200000;
    5050static const int kCpuHasMSA = 0x400000;
     51static const int kCpuHasMMI = 0x800000;
    5152
    5253// Optional init function. TestCpuFlag does an auto-init.
     
    8182int MaskCpuFlags(int enable_flags);
    8283
     84// Sets the CPU flags to |cpu_flags|, bypassing the detection code. |cpu_flags|
     85// should be a valid combination of the kCpuHas constants above and include
     86// kCpuInitialized. Use this method when running in a sandboxed process where
     87// the detection code might fail (as it might access /proc/cpuinfo). In such
     88// cases the cpu_info can be obtained from a non sandboxed process by calling
     89// InitCpuFlags() and passed to the sandboxed process (via command line
     90// parameters, IPC...) which can then call this method to initialize the CPU
     91// flags.
     92// Notes:
     93// - when specifying 0 for |cpu_flags|, the auto initialization is enabled
     94//   again.
     95// - enabling CPU features that are not supported by the CPU will result in
     96//   undefined behavior.
     97// TODO(fbarchard): consider writing a helper function that translates from
     98// other library CPU info to libyuv CPU info and add a .md doc that explains
     99// CPU detection.
     100static __inline void SetCpuFlags(int cpu_flags) {
     101  LIBYUV_API extern int cpu_info_;
     102#ifdef __ATOMIC_RELAXED
     103  __atomic_store_n(&cpu_info_, cpu_flags, __ATOMIC_RELAXED);
     104#else
     105  cpu_info_ = cpu_flags;
     106#endif
     107}
     108
    83109// Low level cpuid for X86. Returns zeros on other CPUs.
    84110// eax is the info type that you want.
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/macros_msa.h

    r235135 r239415  
    1717
    1818#if (__mips_isa_rev >= 6)
    19 #define LW(psrc)                                        \
    20   ({                                                    \
    21     uint8_t* psrc_lw_m = (uint8_t*)(psrc); /* NOLINT */ \
    22     uint32_t val_m;                                     \
    23     asm volatile("lw  %[val_m],  %[psrc_lw_m]  \n"      \
    24                  : [val_m] "=r"(val_m)                  \
    25                  : [psrc_lw_m] "m"(*psrc_lw_m));        \
    26     val_m;                                              \
     19#define LW(psrc)                                       \
     20  ({                                                   \
     21    const uint8_t* psrc_lw_m = (const uint8_t*)(psrc); \
     22    uint32_t val_m;                                    \
     23    asm volatile("lw  %[val_m],  %[psrc_lw_m]  \n"     \
     24                 : [val_m] "=r"(val_m)                 \
     25                 : [psrc_lw_m] "m"(*psrc_lw_m));       \
     26    val_m;                                             \
    2727  })
    2828
    2929#if (__mips == 64)
    30 #define LD(psrc)                                        \
    31   ({                                                    \
    32     uint8_t* psrc_ld_m = (uint8_t*)(psrc); /* NOLINT */ \
    33     uint64_t val_m = 0;                                 \
    34     asm volatile("ld  %[val_m],  %[psrc_ld_m]  \n"      \
    35                  : [val_m] "=r"(val_m)                  \
    36                  : [psrc_ld_m] "m"(*psrc_ld_m));        \
    37     val_m;                                              \
     30#define LD(psrc)                                       \
     31  ({                                                   \
     32    const uint8_t* psrc_ld_m = (const uint8_t*)(psrc); \
     33    uint64_t val_m = 0;                                \
     34    asm volatile("ld  %[val_m],  %[psrc_ld_m]  \n"     \
     35                 : [val_m] "=r"(val_m)                 \
     36                 : [psrc_ld_m] "m"(*psrc_ld_m));       \
     37    val_m;                                             \
    3838  })
    3939#else  // !(__mips == 64)
    4040#define LD(psrc)                                                         \
    4141  ({                                                                     \
    42     uint8_t* psrc_ld_m = (uint8_t*)(psrc); /* NOLINT */                  \
     42    const uint8_t* psrc_ld_m = (const uint8_t*)(psrc);                   \
    4343    uint32_t val0_m, val1_m;                                             \
    4444    uint64_t val_m = 0;                                                  \
     
    8282#endif  // !(__mips == 64)
    8383#else   // !(__mips_isa_rev >= 6)
    84 #define LW(psrc)                                        \
    85   ({                                                    \
    86     uint8_t* psrc_lw_m = (uint8_t*)(psrc); /* NOLINT */ \
    87     uint32_t val_m;                                     \
    88     asm volatile("ulw  %[val_m],  %[psrc_lw_m]  \n"     \
    89                  : [val_m] "=r"(val_m)                  \
    90                  : [psrc_lw_m] "m"(*psrc_lw_m));        \
    91     val_m;                                              \
     84#define LW(psrc)                                       \
     85  ({                                                   \
     86    const uint8_t* psrc_lw_m = (const uint8_t*)(psrc); \
     87    uint32_t val_m;                                    \
     88    asm volatile("ulw  %[val_m],  %[psrc_lw_m]  \n"    \
     89                 : [val_m] "=r"(val_m)                 \
     90                 : [psrc_lw_m] "m"(*psrc_lw_m));       \
     91    val_m;                                             \
    9292  })
    9393
    9494#if (__mips == 64)
    95 #define LD(psrc)                                        \
    96   ({                                                    \
    97     uint8_t* psrc_ld_m = (uint8_t*)(psrc); /* NOLINT */ \
    98     uint64_t val_m = 0;                                 \
    99     asm volatile("uld  %[val_m],  %[psrc_ld_m]  \n"     \
    100                  : [val_m] "=r"(val_m)                  \
    101                  : [psrc_ld_m] "m"(*psrc_ld_m));        \
    102     val_m;                                              \
     95#define LD(psrc)                                       \
     96  ({                                                   \
     97    const uint8_t* psrc_ld_m = (const uint8_t*)(psrc); \
     98    uint64_t val_m = 0;                                \
     99    asm volatile("uld  %[val_m],  %[psrc_ld_m]  \n"    \
     100                 : [val_m] "=r"(val_m)                 \
     101                 : [psrc_ld_m] "m"(*psrc_ld_m));       \
     102    val_m;                                             \
    103103  })
    104104#else  // !(__mips == 64)
    105105#define LD(psrc)                                                         \
    106106  ({                                                                     \
    107     uint8_t* psrc_ld_m = (uint8_t*)(psrc); /* NOLINT */                  \
     107    const uint8_t* psrc_ld_m = (const uint8_t*)(psrc);                   \
    108108    uint32_t val0_m, val1_m;                                             \
    109109    uint64_t val_m = 0;                                                  \
     
    139139// TODO(fbarchard): Consider removing __VAR_ARGS versions.
    140140#define LD_B(RTYPE, psrc) *((RTYPE*)(psrc)) /* NOLINT */
    141 #define LD_UB(...) LD_B(v16u8, __VA_ARGS__)
     141#define LD_UB(...) LD_B(const v16u8, __VA_ARGS__)
    142142
    143143#define ST_B(RTYPE, in, pdst) *((RTYPE*)(pdst)) = (in) /* NOLINT */
     
    159159    out1 = LD_B(RTYPE, (psrc) + stride);       \
    160160  }
    161 #define LD_UB2(...) LD_B2(v16u8, __VA_ARGS__)
     161#define LD_UB2(...) LD_B2(const v16u8, __VA_ARGS__)
    162162
    163163#define LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3) \
     
    166166    LD_B2(RTYPE, (psrc) + 2 * stride, stride, out2, out3); \
    167167  }
    168 #define LD_UB4(...) LD_B4(v16u8, __VA_ARGS__)
     168#define LD_UB4(...) LD_B4(const v16u8, __VA_ARGS__)
    169169
    170170/* Description : Store two vectors with stride each having 16 'byte' sized
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/mjpeg_decoder.h

    r235135 r239415  
    169169
    170170  // A buffer holding the input data for a frame.
    171   Buffer buf_{};
    172   BufferVector buf_vec_{};
     171  Buffer buf_;
     172  BufferVector buf_vec_;
    173173
    174174  jpeg_decompress_struct* decompress_struct_;
     
    182182  // Temporaries used to point to scanline outputs.
    183183  int num_outbufs_;  // Outermost size of all arrays below.
    184   uint8_t*** scanlines_{};
    185   int* scanlines_sizes_{};
     184  uint8_t*** scanlines_;
     185  int* scanlines_sizes_;
    186186  // Temporary buffer used for decoding when we can't decode directly to the
    187187  // output buffers. Large enough for just one iMCU row.
    188   uint8_t** databuf_{};
    189   int* databuf_strides_{};
     188  uint8_t** databuf_;
     189  int* databuf_strides_;
    190190};
    191191
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/rotate_row.h

    r235135 r239415  
    5959#define HAS_TRANSPOSEWX16_MSA
    6060#define HAS_TRANSPOSEUVWX16_MSA
     61#endif
     62
     63#if !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
     64#define HAS_TRANSPOSEWX8_MMI
     65#define HAS_TRANSPOSEUVWX8_MMI
    6166#endif
    6267
     
    8893                        int dst_stride,
    8994                        int width);
     95void TransposeWx8_MMI(const uint8_t* src,
     96                      int src_stride,
     97                      uint8_t* dst,
     98                      int dst_stride,
     99                      int width);
    90100void TransposeWx8_Fast_SSSE3(const uint8_t* src,
    91101                             int src_stride,
     
    109119                            int dst_stride,
    110120                            int width);
     121void TransposeWx8_Any_MMI(const uint8_t* src,
     122                          int src_stride,
     123                          uint8_t* dst,
     124                          int dst_stride,
     125                          int width);
    111126void TransposeWx8_Fast_Any_SSSE3(const uint8_t* src,
    112127                                 int src_stride,
     
    157172                         int dst_stride_b,
    158173                         int width);
     174void TransposeUVWx8_MMI(const uint8_t* src,
     175                        int src_stride,
     176                        uint8_t* dst_a,
     177                        int dst_stride_a,
     178                        uint8_t* dst_b,
     179                        int dst_stride_b,
     180                        int width);
    159181void TransposeUVWx16_MSA(const uint8_t* src,
    160182                         int src_stride,
     
    179201                             int dst_stride_b,
    180202                             int width);
     203void TransposeUVWx8_Any_MMI(const uint8_t* src,
     204                            int src_stride,
     205                            uint8_t* dst_a,
     206                            int dst_stride_a,
     207                            uint8_t* dst_b,
     208                            int dst_stride_b,
     209                            int width);
    181210void TransposeUVWx16_Any_MSA(const uint8_t* src,
    182211                             int src_stride,
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/row.h

    r235135 r239415  
    5454#define CLANG_HAS_AVX2 1
    5555#endif  // clang >= 3.4
     56#endif  // __clang__
     57
     58// clang >= 6.0.0 required for AVX512.
     59#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
     60// clang in xcode follows a different versioning scheme.
     61// TODO(fbarchard): fix xcode 9 ios b/789.
     62#if (__clang_major__ >= 7) && !defined(__APPLE__)
     63#define CLANG_HAS_AVX512 1
     64#endif  // clang >= 7
    5665#endif  // __clang__
    5766
     
    106115#define HAS_MIRRORUVROW_SSSE3
    107116#define HAS_NV12TOARGBROW_SSSE3
     117#define HAS_NV12TORGB24ROW_SSSE3
    108118#define HAS_NV12TORGB565ROW_SSSE3
    109119#define HAS_NV21TOARGBROW_SSSE3
     120#define HAS_NV21TORGB24ROW_SSSE3
    110121#define HAS_RAWTOARGBROW_SSSE3
    111122#define HAS_RAWTORGB24ROW_SSSE3
     
    201212#define HAS_MIRRORROW_AVX2
    202213#define HAS_NV12TOARGBROW_AVX2
     214#define HAS_NV12TORGB24ROW_AVX2
    203215#define HAS_NV12TORGB565ROW_AVX2
    204216#define HAS_NV21TOARGBROW_AVX2
     217#define HAS_NV21TORGB24ROW_AVX2
    205218#define HAS_SPLITUVROW_AVX2
    206219#define HAS_UYVYTOARGBROW_AVX2
     
    231244// The following are available for AVX2 Visual C and clangcl 32 bit:
    232245// TODO(fbarchard): Port to gcc.
    233 #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \
     246#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) && \
    234247    (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2))
    235248#define HAS_ARGB1555TOARGBROW_AVX2
     
    272285#define HAS_ABGRTOAR30ROW_AVX2
    273286#define HAS_ARGBTOAR30ROW_AVX2
     287// Fix AVX2 b:118386049 segfault
     288//#define HAS_ARGBTORAWROW_AVX2
     289//#define HAS_ARGBTORGB24ROW_AVX2
    274290#define HAS_CONVERT16TO8ROW_AVX2
    275291#define HAS_CONVERT8TO16ROW_AVX2
     292#define HAS_I210TOAR30ROW_AVX2
    276293#define HAS_I210TOARGBROW_AVX2
    277 #define HAS_I210TOAR30ROW_AVX2
    278294#define HAS_I422TOAR30ROW_AVX2
    279295#define HAS_I422TOUYVYROW_AVX2
     
    281297#define HAS_MERGEUVROW_16_AVX2
    282298#define HAS_MULTIPLYROW_16_AVX2
     299#endif
     300
     301// The following are available for AVX512 clang x86 platforms:
     302// TODO(fbarchard): Port to GCC and Visual C
     303// TODO(fbarchard): re-enable HAS_ARGBTORGB24ROW_AVX512VBMI. Issue libyuv:789
     304#if !defined(LIBYUV_DISABLE_X86) &&                                       \
     305    (defined(__x86_64__) || (defined(__i386__) && !defined(_MSC_VER))) && \
     306    (defined(CLANG_HAS_AVX512))
     307// Fix AVX2 b:118386049 segfault
     308//#define HAS_ARGBTORGB24ROW_AVX512VBMI
    283309#endif
    284310
     
    460486#endif
    461487
     488#if !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
     489#define HAS_ABGRTOUVROW_MMI
     490#define HAS_ABGRTOYROW_MMI
     491#define HAS_ARGB1555TOARGBROW_MMI
     492#define HAS_ARGB1555TOUVROW_MMI
     493#define HAS_ARGB1555TOYROW_MMI
     494#define HAS_ARGB4444TOARGBROW_MMI
     495#define HAS_ARGB4444TOUVROW_MMI
     496#define HAS_ARGB4444TOYROW_MMI
     497#define HAS_ARGBADDROW_MMI
     498#define HAS_ARGBATTENUATEROW_MMI
     499#define HAS_ARGBBLENDROW_MMI
     500#define HAS_ARGBCOLORMATRIXROW_MMI
     501#define HAS_ARGBCOPYALPHAROW_MMI
     502#define HAS_ARGBCOPYYTOALPHAROW_MMI
     503#define HAS_ARGBEXTRACTALPHAROW_MMI
     504#define HAS_ARGBGRAYROW_MMI
     505#define HAS_ARGBMIRRORROW_MMI
     506#define HAS_ARGBMULTIPLYROW_MMI
     507#define HAS_ARGBSEPIAROW_MMI
     508#define HAS_ARGBSHADEROW_MMI
     509#define HAS_ARGBSHUFFLEROW_MMI
     510#define HAS_ARGBSUBTRACTROW_MMI
     511#define HAS_ARGBTOARGB1555ROW_MMI
     512#define HAS_ARGBTOARGB4444ROW_MMI
     513#define HAS_ARGBTORAWROW_MMI
     514#define HAS_ARGBTORGB24ROW_MMI
     515#define HAS_ARGBTORGB565DITHERROW_MMI
     516#define HAS_ARGBTORGB565ROW_MMI
     517#define HAS_ARGBTOUV444ROW_MMI
     518#define HAS_ARGBTOUVJROW_MMI
     519#define HAS_ARGBTOUVROW_MMI
     520#define HAS_ARGBTOYJROW_MMI
     521#define HAS_ARGBTOYROW_MMI
     522#define HAS_BGRATOUVROW_MMI
     523#define HAS_BGRATOYROW_MMI
     524#define HAS_BLENDPLANEROW_MMI
     525#define HAS_COMPUTECUMULATIVESUMROW_MMI
     526#define HAS_CUMULATIVESUMTOAVERAGEROW_MMI
     527#define HAS_HALFFLOATROW_MMI
     528#define HAS_I400TOARGBROW_MMI
     529#define HAS_I422TOUYVYROW_MMI
     530#define HAS_I422TOYUY2ROW_MMI
     531#define HAS_INTERPOLATEROW_MMI
     532#define HAS_J400TOARGBROW_MMI
     533#define HAS_MERGERGBROW_MMI
     534#define HAS_MERGEUVROW_MMI
     535#define HAS_MIRRORROW_MMI
     536#define HAS_MIRRORUVROW_MMI
     537#define HAS_RAWTOARGBROW_MMI
     538#define HAS_RAWTORGB24ROW_MMI
     539#define HAS_RAWTOUVROW_MMI
     540#define HAS_RAWTOYROW_MMI
     541#define HAS_RGB24TOARGBROW_MMI
     542#define HAS_RGB24TOUVROW_MMI
     543#define HAS_RGB24TOYROW_MMI
     544#define HAS_RGB565TOARGBROW_MMI
     545#define HAS_RGB565TOUVROW_MMI
     546#define HAS_RGB565TOYROW_MMI
     547#define HAS_RGBATOUVROW_MMI
     548#define HAS_RGBATOYROW_MMI
     549#define HAS_SOBELROW_MMI
     550#define HAS_SOBELTOPLANEROW_MMI
     551#define HAS_SOBELXROW_MMI
     552#define HAS_SOBELXYROW_MMI
     553#define HAS_SOBELYROW_MMI
     554#define HAS_SPLITRGBROW_MMI
     555#define HAS_SPLITUVROW_MMI
     556#define HAS_UYVYTOUVROW_MMI
     557#define HAS_UYVYTOYROW_MMI
     558#define HAS_YUY2TOUV422ROW_MMI
     559#define HAS_YUY2TOUVROW_MMI
     560#define HAS_YUY2TOYROW_MMI
     561#endif
     562
    462563#if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__)
    463564#if defined(VISUALC_HAS_AVX2)
     
    814915void ARGBToYRow_MSA(const uint8_t* src_argb0, uint8_t* dst_y, int width);
    815916void ARGBToYJRow_MSA(const uint8_t* src_argb0, uint8_t* dst_y, int width);
     917void ARGBToYRow_MMI(const uint8_t* src_argb0, uint8_t* dst_y, int width);
     918void ARGBToYJRow_MMI(const uint8_t* src_argb0, uint8_t* dst_y, int width);
    816919void ARGBToUV444Row_NEON(const uint8_t* src_argb,
    817920                         uint8_t* dst_u,
     
    828931                        int width);
    829932void ARGBToUVRow_MSA(const uint8_t* src_argb0,
     933                     int src_stride_argb,
     934                     uint8_t* dst_u,
     935                     uint8_t* dst_v,
     936                     int width);
     937void ARGBToUV444Row_MMI(const uint8_t* src_argb,
     938                        uint8_t* dst_u,
     939                        uint8_t* dst_v,
     940                        int width);
     941void ARGBToUVRow_MMI(const uint8_t* src_argb0,
    830942                     int src_stride_argb,
    831943                     uint8_t* dst_u,
     
    9171029                         uint8_t* dst_v,
    9181030                         int width);
     1031void ARGBToUVJRow_MMI(const uint8_t* src_rgb0,
     1032                      int src_stride_rgb,
     1033                      uint8_t* dst_u,
     1034                      uint8_t* dst_v,
     1035                      int width);
     1036void BGRAToUVRow_MMI(const uint8_t* src_rgb0,
     1037                     int src_stride_rgb,
     1038                     uint8_t* dst_u,
     1039                     uint8_t* dst_v,
     1040                     int width);
     1041void ABGRToUVRow_MMI(const uint8_t* src_rgb0,
     1042                     int src_stride_rgb,
     1043                     uint8_t* dst_u,
     1044                     uint8_t* dst_v,
     1045                     int width);
     1046void RGBAToUVRow_MMI(const uint8_t* src_rgb0,
     1047                     int src_stride_rgb,
     1048                     uint8_t* dst_u,
     1049                     uint8_t* dst_v,
     1050                     int width);
     1051void RGB24ToUVRow_MMI(const uint8_t* src_rgb0,
     1052                      int src_stride_rgb,
     1053                      uint8_t* dst_u,
     1054                      uint8_t* dst_v,
     1055                      int width);
     1056void RAWToUVRow_MMI(const uint8_t* src_rgb0,
     1057                    int src_stride_rgb,
     1058                    uint8_t* dst_u,
     1059                    uint8_t* dst_v,
     1060                    int width);
     1061void RGB565ToUVRow_MMI(const uint8_t* src_rgb565,
     1062                       int src_stride_rgb565,
     1063                       uint8_t* dst_u,
     1064                       uint8_t* dst_v,
     1065                       int width);
     1066void ARGB1555ToUVRow_MMI(const uint8_t* src_argb1555,
     1067                         int src_stride_argb1555,
     1068                         uint8_t* dst_u,
     1069                         uint8_t* dst_v,
     1070                         int width);
     1071void ARGB4444ToUVRow_MMI(const uint8_t* src_argb4444,
     1072                         int src_stride_argb4444,
     1073                         uint8_t* dst_u,
     1074                         uint8_t* dst_v,
     1075                         int width);
    9191076void BGRAToYRow_NEON(const uint8_t* src_bgra, uint8_t* dst_y, int width);
    9201077void ABGRToYRow_NEON(const uint8_t* src_abgr, uint8_t* dst_y, int width);
     
    9361093void RGB565ToYRow_MSA(const uint8_t* src_rgb565, uint8_t* dst_y, int width);
    9371094void ARGB1555ToYRow_MSA(const uint8_t* src_argb1555, uint8_t* dst_y, int width);
     1095void BGRAToYRow_MMI(const uint8_t* src_argb0, uint8_t* dst_y, int width);
     1096void ABGRToYRow_MMI(const uint8_t* src_argb0, uint8_t* dst_y, int width);
     1097void RGBAToYRow_MMI(const uint8_t* src_argb0, uint8_t* dst_y, int width);
     1098void RGB24ToYRow_MMI(const uint8_t* src_argb0, uint8_t* dst_y, int width);
     1099void RAWToYRow_MMI(const uint8_t* src_argb0, uint8_t* dst_y, int width);
     1100void RGB565ToYRow_MMI(const uint8_t* src_rgb565, uint8_t* dst_y, int width);
     1101void ARGB1555ToYRow_MMI(const uint8_t* src_argb1555, uint8_t* dst_y, int width);
     1102void ARGB4444ToYRow_MMI(const uint8_t* src_argb4444, uint8_t* dst_y, int width);
     1103
    9381104void ARGBToYRow_C(const uint8_t* src_argb0, uint8_t* dst_y, int width);
    9391105void ARGBToYJRow_C(const uint8_t* src_argb0, uint8_t* dst_y, int width);
     
    9781144                            uint8_t* dst_ptr,
    9791145                            int width);
     1146void BGRAToYRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1147void ABGRToYRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1148void RGBAToYRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1149void ARGBToYJRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1150void ARGBToYRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1151void RGB24ToYRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1152void RAWToYRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1153void RGB565ToYRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1154void ARGB1555ToYRow_Any_MMI(const uint8_t* src_ptr,
     1155                            uint8_t* dst_ptr,
     1156                            int width);
     1157void ARGB4444ToYRow_Any_MMI(const uint8_t* src_ptr,
     1158                            uint8_t* dst_ptr,
     1159                            int width);
    9801160
    9811161void ARGBToUVRow_AVX2(const uint8_t* src_argb0,
     
    10631243                            int width);
    10641244void ARGBToUVRow_Any_MSA(const uint8_t* src_ptr,
     1245                         int src_stride_ptr,
     1246                         uint8_t* dst_u,
     1247                         uint8_t* dst_v,
     1248                         int width);
     1249void ARGBToUV444Row_Any_MMI(const uint8_t* src_ptr,
     1250                            uint8_t* dst_u,
     1251                            uint8_t* dst_v,
     1252                            int width);
     1253void ARGBToUVRow_Any_MMI(const uint8_t* src_ptr,
    10651254                         int src_stride_ptr,
    10661255                         uint8_t* dst_u,
     
    11481337                           int width);
    11491338void ARGB1555ToUVRow_Any_MSA(const uint8_t* src_ptr,
     1339                             int src_stride_ptr,
     1340                             uint8_t* dst_u,
     1341                             uint8_t* dst_v,
     1342                             int width);
     1343void ARGBToUVJRow_Any_MMI(const uint8_t* src_ptr,
     1344                          int src_stride_ptr,
     1345                          uint8_t* dst_u,
     1346                          uint8_t* dst_v,
     1347                          int width);
     1348void BGRAToUVRow_Any_MMI(const uint8_t* src_ptr,
     1349                         int src_stride_ptr,
     1350                         uint8_t* dst_u,
     1351                         uint8_t* dst_v,
     1352                         int width);
     1353void ABGRToUVRow_Any_MMI(const uint8_t* src_ptr,
     1354                         int src_stride_ptr,
     1355                         uint8_t* dst_u,
     1356                         uint8_t* dst_v,
     1357                         int width);
     1358void RGBAToUVRow_Any_MMI(const uint8_t* src_ptr,
     1359                         int src_stride_ptr,
     1360                         uint8_t* dst_u,
     1361                         uint8_t* dst_v,
     1362                         int width);
     1363void RGB24ToUVRow_Any_MMI(const uint8_t* src_ptr,
     1364                          int src_stride_ptr,
     1365                          uint8_t* dst_u,
     1366                          uint8_t* dst_v,
     1367                          int width);
     1368void RAWToUVRow_Any_MMI(const uint8_t* src_ptr,
     1369                        int src_stride_ptr,
     1370                        uint8_t* dst_u,
     1371                        uint8_t* dst_v,
     1372                        int width);
     1373void RGB565ToUVRow_Any_MMI(const uint8_t* src_ptr,
     1374                           int src_stride_ptr,
     1375                           uint8_t* dst_u,
     1376                           uint8_t* dst_v,
     1377                           int width);
     1378void ARGB1555ToUVRow_Any_MMI(const uint8_t* src_ptr,
     1379                             int src_stride_ptr,
     1380                             uint8_t* dst_u,
     1381                             uint8_t* dst_v,
     1382                             int width);
     1383void ARGB4444ToUVRow_Any_MMI(const uint8_t* src_ptr,
    11501384                             int src_stride_ptr,
    11511385                             uint8_t* dst_u,
     
    12311465void MirrorRow_NEON(const uint8_t* src, uint8_t* dst, int width);
    12321466void MirrorRow_MSA(const uint8_t* src, uint8_t* dst, int width);
     1467void MirrorRow_MMI(const uint8_t* src, uint8_t* dst, int width);
    12331468void MirrorRow_C(const uint8_t* src, uint8_t* dst, int width);
    12341469void MirrorRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     
    12371472void MirrorRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
    12381473void MirrorRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1474void MirrorRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
    12391475
    12401476void MirrorUVRow_SSSE3(const uint8_t* src,
     
    12501486                     uint8_t* dst_v,
    12511487                     int width);
     1488void MirrorUVRow_MMI(const uint8_t* src_uv,
     1489                     uint8_t* dst_u,
     1490                     uint8_t* dst_v,
     1491                     int width);
    12521492void MirrorUVRow_C(const uint8_t* src_uv,
    12531493                   uint8_t* dst_u,
     
    12591499void ARGBMirrorRow_NEON(const uint8_t* src, uint8_t* dst, int width);
    12601500void ARGBMirrorRow_MSA(const uint8_t* src, uint8_t* dst, int width);
     1501void ARGBMirrorRow_MMI(const uint8_t* src, uint8_t* dst, int width);
    12611502void ARGBMirrorRow_C(const uint8_t* src, uint8_t* dst, int width);
    12621503void ARGBMirrorRow_Any_AVX2(const uint8_t* src_ptr,
     
    12701511                            int width);
    12711512void ARGBMirrorRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1513void ARGBMirrorRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
    12721514
    12731515void SplitUVRow_C(const uint8_t* src_uv,
     
    12911533                    uint8_t* dst_v,
    12921534                    int width);
     1535void SplitUVRow_MMI(const uint8_t* src_uv,
     1536                    uint8_t* dst_u,
     1537                    uint8_t* dst_v,
     1538                    int width);
    12931539void SplitUVRow_Any_SSE2(const uint8_t* src_ptr,
    12941540                         uint8_t* dst_u,
     
    13041550                         int width);
    13051551void SplitUVRow_Any_MSA(const uint8_t* src_ptr,
     1552                        uint8_t* dst_u,
     1553                        uint8_t* dst_v,
     1554                        int width);
     1555void SplitUVRow_Any_MMI(const uint8_t* src_ptr,
    13061556                        uint8_t* dst_u,
    13071557                        uint8_t* dst_v,
     
    13281578                    uint8_t* dst_uv,
    13291579                    int width);
     1580void MergeUVRow_MMI(const uint8_t* src_u,
     1581                    const uint8_t* src_v,
     1582                    uint8_t* dst_uv,
     1583                    int width);
    13301584void MergeUVRow_Any_SSE2(const uint8_t* y_buf,
    13311585                         const uint8_t* uv_buf,
     
    13411595                         int width);
    13421596void MergeUVRow_Any_MSA(const uint8_t* y_buf,
     1597                        const uint8_t* uv_buf,
     1598                        uint8_t* dst_ptr,
     1599                        int width);
     1600void MergeUVRow_Any_MMI(const uint8_t* y_buf,
    13431601                        const uint8_t* uv_buf,
    13441602                        uint8_t* dst_ptr,
     
    13601618                      uint8_t* dst_b,
    13611619                      int width);
     1620void SplitRGBRow_MMI(const uint8_t* src_rgb,
     1621                     uint8_t* dst_r,
     1622                     uint8_t* dst_g,
     1623                     uint8_t* dst_b,
     1624                     int width);
    13621625void SplitRGBRow_Any_SSSE3(const uint8_t* src_ptr,
    13631626                           uint8_t* dst_r,
     
    13701633                          uint8_t* dst_b,
    13711634                          int width);
     1635void SplitRGBRow_Any_MMI(const uint8_t* src_ptr,
     1636                         uint8_t* dst_r,
     1637                         uint8_t* dst_g,
     1638                         uint8_t* dst_b,
     1639                         int width);
    13721640
    13731641void MergeRGBRow_C(const uint8_t* src_r,
     
    13861654                      uint8_t* dst_rgb,
    13871655                      int width);
     1656void MergeRGBRow_MMI(const uint8_t* src_r,
     1657                     const uint8_t* src_g,
     1658                     const uint8_t* src_b,
     1659                     uint8_t* dst_rgb,
     1660                     int width);
    13881661void MergeRGBRow_Any_SSSE3(const uint8_t* y_buf,
    13891662                           const uint8_t* u_buf,
     
    13961669                          uint8_t* dst_rgb,
    13971670                          int width);
     1671void MergeRGBRow_Any_MMI(const uint8_t* src_r,
     1672                         const uint8_t* src_g,
     1673                         const uint8_t* src_b,
     1674                         uint8_t* dst_rgb,
     1675                         int width);
    13981676
    13991677void MergeUVRow_16_C(const uint16_t* src_u,
     
    14741752void ARGBCopyAlphaRow_SSE2(const uint8_t* src, uint8_t* dst, int width);
    14751753void ARGBCopyAlphaRow_AVX2(const uint8_t* src, uint8_t* dst, int width);
     1754void ARGBCopyAlphaRow_MMI(const uint8_t* src, uint8_t* dst, int width);
    14761755void ARGBCopyAlphaRow_Any_SSE2(const uint8_t* src_ptr,
    14771756                               uint8_t* dst_ptr,
     
    14801759                               uint8_t* dst_ptr,
    14811760                               int width);
     1761void ARGBCopyAlphaRow_Any_MMI(const uint8_t* src_ptr,
     1762                              uint8_t* dst_ptr,
     1763                              int width);
    14821764
    14831765void ARGBExtractAlphaRow_C(const uint8_t* src_argb, uint8_t* dst_a, int width);
     
    14941776                             uint8_t* dst_a,
    14951777                             int width);
     1778void ARGBExtractAlphaRow_MMI(const uint8_t* src_argb,
     1779                             uint8_t* dst_a,
     1780                             int width);
    14961781void ARGBExtractAlphaRow_Any_SSE2(const uint8_t* src_ptr,
    14971782                                  uint8_t* dst_ptr,
     
    15061791                                 uint8_t* dst_ptr,
    15071792                                 int width);
     1793void ARGBExtractAlphaRow_Any_MMI(const uint8_t* src_ptr,
     1794                                 uint8_t* dst_ptr,
     1795                                 int width);
    15081796
    15091797void ARGBCopyYToAlphaRow_C(const uint8_t* src, uint8_t* dst, int width);
    15101798void ARGBCopyYToAlphaRow_SSE2(const uint8_t* src, uint8_t* dst, int width);
    15111799void ARGBCopyYToAlphaRow_AVX2(const uint8_t* src, uint8_t* dst, int width);
     1800void ARGBCopyYToAlphaRow_MMI(const uint8_t* src, uint8_t* dst, int width);
    15121801void ARGBCopyYToAlphaRow_Any_SSE2(const uint8_t* src_ptr,
    15131802                                  uint8_t* dst_ptr,
     
    15161805                                  uint8_t* dst_ptr,
    15171806                                  int width);
     1807void ARGBCopyYToAlphaRow_Any_MMI(const uint8_t* src_ptr,
     1808                                 uint8_t* dst_ptr,
     1809                                 int width);
    15181810
    15191811void SetRow_C(uint8_t* dst, uint8_t v8, int width);
     
    15531845                        const uint8_t* shuffler,
    15541846                        int width);
     1847void ARGBShuffleRow_MMI(const uint8_t* src_argb,
     1848                        uint8_t* dst_argb,
     1849                        const uint8_t* shuffler,
     1850                        int width);
    15551851void ARGBShuffleRow_Any_SSSE3(const uint8_t* src_ptr,
    15561852                              uint8_t* dst_ptr,
     
    15691865                            const uint8_t* param,
    15701866                            int width);
     1867void ARGBShuffleRow_Any_MMI(const uint8_t* src_ptr,
     1868                            uint8_t* dst_ptr,
     1869                            const uint8_t* param,
     1870                            int width);
    15711871
    15721872void RGB24ToARGBRow_SSSE3(const uint8_t* src_rgb24,
     
    15921892                         int width);
    15931893void RGB24ToARGBRow_MSA(const uint8_t* src_rgb24, uint8_t* dst_argb, int width);
     1894void RGB24ToARGBRow_MMI(const uint8_t* src_rgb24, uint8_t* dst_argb, int width);
    15941895void RAWToARGBRow_NEON(const uint8_t* src_raw, uint8_t* dst_argb, int width);
    15951896void RAWToARGBRow_MSA(const uint8_t* src_raw, uint8_t* dst_argb, int width);
     1897void RAWToARGBRow_MMI(const uint8_t* src_raw, uint8_t* dst_argb, int width);
    15961898void RAWToRGB24Row_NEON(const uint8_t* src_raw, uint8_t* dst_rgb24, int width);
    15971899void RAWToRGB24Row_MSA(const uint8_t* src_raw, uint8_t* dst_rgb24, int width);
     1900void RAWToRGB24Row_MMI(const uint8_t* src_raw, uint8_t* dst_rgb24, int width);
    15981901void RGB565ToARGBRow_NEON(const uint8_t* src_rgb565,
    15991902                          uint8_t* dst_argb,
     
    16021905                         uint8_t* dst_argb,
    16031906                         int width);
     1907void RGB565ToARGBRow_MMI(const uint8_t* src_rgb565,
     1908                         uint8_t* dst_argb,
     1909                         int width);
    16041910void ARGB1555ToARGBRow_NEON(const uint8_t* src_argb1555,
    16051911                            uint8_t* dst_argb,
     
    16081914                           uint8_t* dst_argb,
    16091915                           int width);
     1916void ARGB1555ToARGBRow_MMI(const uint8_t* src_argb1555,
     1917                           uint8_t* dst_argb,
     1918                           int width);
    16101919void ARGB4444ToARGBRow_NEON(const uint8_t* src_argb4444,
    16111920                            uint8_t* dst_argb,
    16121921                            int width);
    16131922void ARGB4444ToARGBRow_MSA(const uint8_t* src_argb4444,
     1923                           uint8_t* dst_argb,
     1924                           int width);
     1925void ARGB4444ToARGBRow_MMI(const uint8_t* src_argb4444,
    16141926                           uint8_t* dst_argb,
    16151927                           int width);
     
    16641976                            uint8_t* dst_ptr,
    16651977                            int width);
     1978void RGB24ToARGBRow_Any_MMI(const uint8_t* src_ptr,
     1979                            uint8_t* dst_ptr,
     1980                            int width);
    16661981void RAWToARGBRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
    16671982void RAWToARGBRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1983void RAWToARGBRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
    16681984void RAWToRGB24Row_Any_NEON(const uint8_t* src_ptr,
    16691985                            uint8_t* dst_ptr,
    16701986                            int width);
    16711987void RAWToRGB24Row_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     1988void RAWToRGB24Row_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
    16721989void RGB565ToARGBRow_Any_NEON(const uint8_t* src_ptr,
    16731990                              uint8_t* dst_ptr,
    16741991                              int width);
    16751992void RGB565ToARGBRow_Any_MSA(const uint8_t* src_ptr,
     1993                             uint8_t* dst_ptr,
     1994                             int width);
     1995void RGB565ToARGBRow_Any_MMI(const uint8_t* src_ptr,
    16761996                             uint8_t* dst_ptr,
    16771997                             int width);
     
    16822002                               uint8_t* dst_ptr,
    16832003                               int width);
     2004void ARGB1555ToARGBRow_Any_MMI(const uint8_t* src_ptr,
     2005                               uint8_t* dst_ptr,
     2006                               int width);
    16842007void ARGB4444ToARGBRow_Any_NEON(const uint8_t* src_ptr,
    16852008                                uint8_t* dst_ptr,
     
    16872010
    16882011void ARGB4444ToARGBRow_Any_MSA(const uint8_t* src_ptr,
     2012                               uint8_t* dst_ptr,
     2013                               int width);
     2014void ARGB4444ToARGBRow_Any_MMI(const uint8_t* src_ptr,
    16892015                               uint8_t* dst_ptr,
    16902016                               int width);
     
    16972023void ABGRToAR30Row_SSSE3(const uint8_t* src, uint8_t* dst, int width);
    16982024void ARGBToAR30Row_SSSE3(const uint8_t* src, uint8_t* dst, int width);
     2025
     2026void ARGBToRAWRow_AVX2(const uint8_t* src, uint8_t* dst, int width);
     2027void ARGBToRGB24Row_AVX2(const uint8_t* src, uint8_t* dst, int width);
     2028
     2029void ARGBToRGB24Row_AVX512VBMI(const uint8_t* src, uint8_t* dst, int width);
    16992030
    17002031void ARGBToRGB565DitherRow_C(const uint8_t* src_argb,
     
    17522083                               int width);
    17532084
     2085void ARGBToRGB24Row_MMI(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
     2086void ARGBToRAWRow_MMI(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
     2087void ARGBToRGB565Row_MMI(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
     2088void ARGBToARGB1555Row_MMI(const uint8_t* src_argb,
     2089                           uint8_t* dst_rgb,
     2090                           int width);
     2091void ARGBToARGB4444Row_MMI(const uint8_t* src_argb,
     2092                           uint8_t* dst_rgb,
     2093                           int width);
     2094void ARGBToRGB565DitherRow_MMI(const uint8_t* src_argb,
     2095                               uint8_t* dst_rgb,
     2096                               const uint32_t dither4,
     2097                               int width);
     2098
    17542099void ARGBToRGBARow_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
    17552100void ARGBToRGB24Row_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
     
    17652110void J400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width);
    17662111void J400ToARGBRow_MSA(const uint8_t* src_y, uint8_t* dst_argb, int width);
     2112void J400ToARGBRow_MMI(const uint8_t* src_y, uint8_t* dst_argb, int width);
    17672113void J400ToARGBRow_C(const uint8_t* src_y, uint8_t* dst_argb, int width);
    17682114void J400ToARGBRow_Any_SSE2(const uint8_t* src_ptr,
     
    17762122                            int width);
    17772123void J400ToARGBRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     2124void J400ToARGBRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
    17782125
    17792126void I444ToARGBRow_C(const uint8_t* src_y,
     
    19802327                        const struct YuvConstants* yuvconstants,
    19812328                        int width);
     2329void NV12ToRGB24Row_SSSE3(const uint8_t* src_y,
     2330                          const uint8_t* src_uv,
     2331                          uint8_t* dst_rgb24,
     2332                          const struct YuvConstants* yuvconstants,
     2333                          int width);
     2334void NV21ToRGB24Row_SSSE3(const uint8_t* src_y,
     2335                          const uint8_t* src_vu,
     2336                          uint8_t* dst_rgb24,
     2337                          const struct YuvConstants* yuvconstants,
     2338                          int width);
    19822339void NV12ToRGB565Row_SSSE3(const uint8_t* src_y,
    19832340                           const uint8_t* src_uv,
     
    19852342                           const struct YuvConstants* yuvconstants,
    19862343                           int width);
     2344void NV12ToRGB24Row_AVX2(const uint8_t* src_y,
     2345                         const uint8_t* src_uv,
     2346                         uint8_t* dst_rgb24,
     2347                         const struct YuvConstants* yuvconstants,
     2348                         int width);
     2349void NV21ToRGB24Row_AVX2(const uint8_t* src_y,
     2350                         const uint8_t* src_vu,
     2351                         uint8_t* dst_rgb24,
     2352                         const struct YuvConstants* yuvconstants,
     2353                         int width);
    19872354void NV12ToRGB565Row_AVX2(const uint8_t* src_y,
    19882355                          const uint8_t* src_uv,
     
    21702537                            const struct YuvConstants* yuvconstants,
    21712538                            int width);
     2539void NV12ToRGB24Row_Any_SSSE3(const uint8_t* y_buf,
     2540                              const uint8_t* uv_buf,
     2541                              uint8_t* dst_ptr,
     2542                              const struct YuvConstants* yuvconstants,
     2543                              int width);
     2544void NV21ToRGB24Row_Any_SSSE3(const uint8_t* y_buf,
     2545                              const uint8_t* uv_buf,
     2546                              uint8_t* dst_ptr,
     2547                              const struct YuvConstants* yuvconstants,
     2548                              int width);
     2549void NV12ToRGB24Row_Any_AVX2(const uint8_t* y_buf,
     2550                             const uint8_t* uv_buf,
     2551                             uint8_t* dst_ptr,
     2552                             const struct YuvConstants* yuvconstants,
     2553                             int width);
     2554void NV21ToRGB24Row_Any_AVX2(const uint8_t* y_buf,
     2555                             const uint8_t* uv_buf,
     2556                             uint8_t* dst_ptr,
     2557                             const struct YuvConstants* yuvconstants,
     2558                             int width);
    21722559void NV12ToRGB565Row_Any_SSSE3(const uint8_t* y_buf,
    21732560                               const uint8_t* uv_buf,
     
    22562643void I400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width);
    22572644void I400ToARGBRow_MSA(const uint8_t* src_y, uint8_t* dst_argb, int width);
     2645void I400ToARGBRow_MMI(const uint8_t* src_y, uint8_t* dst_argb, int width);
    22582646void I400ToARGBRow_Any_SSE2(const uint8_t* src_ptr,
    22592647                            uint8_t* dst_ptr,
     
    22662654                            int width);
    22672655void I400ToARGBRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     2656void I400ToARGBRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
    22682657
    22692658// ARGB preattenuated alpha blend.
     
    22772666                       int width);
    22782667void ARGBBlendRow_MSA(const uint8_t* src_argb0,
     2668                      const uint8_t* src_argb1,
     2669                      uint8_t* dst_argb,
     2670                      int width);
     2671void ARGBBlendRow_MMI(const uint8_t* src_argb0,
    22792672                      const uint8_t* src_argb1,
    22802673                      uint8_t* dst_argb,
     
    23062699                            uint8_t* dst_ptr,
    23072700                            int width);
     2701void BlendPlaneRow_MMI(const uint8_t* src0,
     2702                       const uint8_t* src1,
     2703                       const uint8_t* alpha,
     2704                       uint8_t* dst,
     2705                       int width);
     2706void BlendPlaneRow_Any_MMI(const uint8_t* y_buf,
     2707                           const uint8_t* u_buf,
     2708                           const uint8_t* v_buf,
     2709                           uint8_t* dst_ptr,
     2710                           int width);
    23082711void BlendPlaneRow_C(const uint8_t* src0,
    23092712                     const uint8_t* src1,
     
    23472750                         int width);
    23482751void ARGBMultiplyRow_Any_MSA(const uint8_t* y_buf,
     2752                             const uint8_t* uv_buf,
     2753                             uint8_t* dst_ptr,
     2754                             int width);
     2755void ARGBMultiplyRow_MMI(const uint8_t* src_argb0,
     2756                         const uint8_t* src_argb1,
     2757                         uint8_t* dst_argb,
     2758                         int width);
     2759void ARGBMultiplyRow_Any_MMI(const uint8_t* y_buf,
    23492760                             const uint8_t* uv_buf,
    23502761                             uint8_t* dst_ptr,
     
    23882799                        uint8_t* dst_ptr,
    23892800                        int width);
     2801void ARGBAddRow_MMI(const uint8_t* src_argb0,
     2802                    const uint8_t* src_argb1,
     2803                    uint8_t* dst_argb,
     2804                    int width);
     2805void ARGBAddRow_Any_MMI(const uint8_t* y_buf,
     2806                        const uint8_t* uv_buf,
     2807                        uint8_t* dst_ptr,
     2808                        int width);
    23902809
    23912810// ARGB subtract images. Same API as Blend, but these require
     
    24242843                         int width);
    24252844void ARGBSubtractRow_Any_MSA(const uint8_t* y_buf,
     2845                             const uint8_t* uv_buf,
     2846                             uint8_t* dst_ptr,
     2847                             int width);
     2848void ARGBSubtractRow_MMI(const uint8_t* src_argb0,
     2849                         const uint8_t* src_argb1,
     2850                         uint8_t* dst_argb,
     2851                         int width);
     2852void ARGBSubtractRow_Any_MMI(const uint8_t* y_buf,
    24262853                             const uint8_t* uv_buf,
    24272854                             uint8_t* dst_ptr,
     
    24492876                             uint8_t* dst_ptr,
    24502877                             int width);
    2451 
     2878void ARGBToRAWRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     2879void ARGBToRGB24Row_Any_AVX2(const uint8_t* src_ptr,
     2880                             uint8_t* dst_ptr,
     2881                             int width);
     2882void ARGBToRGB24Row_Any_AVX512VBMI(const uint8_t* src_ptr,
     2883                                   uint8_t* dst_ptr,
     2884                                   int width);
    24522885void ARGBToRGB565DitherRow_Any_SSE2(const uint8_t* src_ptr,
    24532886                                    uint8_t* dst_ptr,
     
    25062939                               int width);
    25072940void ARGBToRGB565DitherRow_Any_MSA(const uint8_t* src_ptr,
     2941                                   uint8_t* dst_ptr,
     2942                                   const uint32_t param,
     2943                                   int width);
     2944
     2945void ARGBToRGB24Row_Any_MMI(const uint8_t* src_ptr,
     2946                            uint8_t* dst_ptr,
     2947                            int width);
     2948void ARGBToRAWRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     2949void ARGBToRGB565Row_Any_MMI(const uint8_t* src_ptr,
     2950                             uint8_t* dst_ptr,
     2951                             int width);
     2952void ARGBToARGB1555Row_Any_MMI(const uint8_t* src_ptr,
     2953                               uint8_t* dst_ptr,
     2954                               int width);
     2955void ARGBToARGB4444Row_Any_MMI(const uint8_t* src_ptr,
     2956                               uint8_t* dst_ptr,
     2957                               int width);
     2958void ARGBToRGB565DitherRow_Any_MMI(const uint8_t* src_ptr,
    25082959                                   uint8_t* dst_ptr,
    25092960                                   const uint32_t param,
     
    26963147                         int width);
    26973148void YUY2ToYRow_MSA(const uint8_t* src_yuy2, uint8_t* dst_y, int width);
     3149void YUY2ToYRow_MMI(const uint8_t* src_yuy2, uint8_t* dst_y, int width);
    26983150void YUY2ToUVRow_MSA(const uint8_t* src_yuy2,
    26993151                     int src_stride_yuy2,
     
    27013153                     uint8_t* dst_v,
    27023154                     int width);
     3155void YUY2ToUVRow_MMI(const uint8_t* src_yuy2,
     3156                     int src_stride_yuy2,
     3157                     uint8_t* dst_u,
     3158                     uint8_t* dst_v,
     3159                     int width);
    27033160void YUY2ToUV422Row_MSA(const uint8_t* src_yuy2,
     3161                        uint8_t* dst_u,
     3162                        uint8_t* dst_v,
     3163                        int width);
     3164void YUY2ToUV422Row_MMI(const uint8_t* src_yuy2,
    27043165                        uint8_t* dst_u,
    27053166                        uint8_t* dst_v,
     
    27463207                             int width);
    27473208void YUY2ToYRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     3209void YUY2ToYRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
    27483210void YUY2ToUVRow_Any_MSA(const uint8_t* src_ptr,
    27493211                         int src_stride_ptr,
     
    27513213                         uint8_t* dst_v,
    27523214                         int width);
     3215void YUY2ToUVRow_Any_MMI(const uint8_t* src_ptr,
     3216                         int src_stride_ptr,
     3217                         uint8_t* dst_u,
     3218                         uint8_t* dst_v,
     3219                         int width);
    27533220void YUY2ToUV422Row_Any_MSA(const uint8_t* src_ptr,
     3221                            uint8_t* dst_u,
     3222                            uint8_t* dst_v,
     3223                            int width);
     3224void YUY2ToUV422Row_Any_MMI(const uint8_t* src_ptr,
    27543225                            uint8_t* dst_u,
    27553226                            uint8_t* dst_v,
     
    27963267                         int width);
    27973268void UYVYToYRow_MSA(const uint8_t* src_uyvy, uint8_t* dst_y, int width);
     3269void UYVYToYRow_MMI(const uint8_t* src_uyvy, uint8_t* dst_y, int width);
    27983270void UYVYToUVRow_MSA(const uint8_t* src_uyvy,
    27993271                     int src_stride_uyvy,
     
    28013273                     uint8_t* dst_v,
    28023274                     int width);
     3275void UYVYToUVRow_MMI(const uint8_t* src_uyvy,
     3276                     int src_stride_uyvy,
     3277                     uint8_t* dst_u,
     3278                     uint8_t* dst_v,
     3279                     int width);
    28033280void UYVYToUV422Row_MSA(const uint8_t* src_uyvy,
     3281                        uint8_t* dst_u,
     3282                        uint8_t* dst_v,
     3283                        int width);
     3284void UYVYToUV422Row_MMI(const uint8_t* src_uyvy,
    28043285                        uint8_t* dst_u,
    28053286                        uint8_t* dst_v,
     
    28473328                             int width);
    28483329void UYVYToYRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
     3330void UYVYToYRow_Any_MMI(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
    28493331void UYVYToUVRow_Any_MSA(const uint8_t* src_ptr,
    28503332                         int src_stride_ptr,
     
    28523334                         uint8_t* dst_v,
    28533335                         int width);
     3336void UYVYToUVRow_Any_MMI(const uint8_t* src_ptr,
     3337                         int src_stride_ptr,
     3338                         uint8_t* dst_u,
     3339                         uint8_t* dst_v,
     3340                         int width);
    28543341void UYVYToUV422Row_Any_MSA(const uint8_t* src_ptr,
     3342                            uint8_t* dst_u,
     3343                            uint8_t* dst_v,
     3344                            int width);
     3345void UYVYToUV422Row_Any_MMI(const uint8_t* src_ptr,
    28553346                            uint8_t* dst_u,
    28563347                            uint8_t* dst_v,
     
    29323423                       uint8_t* dst_yuy2,
    29333424                       int width);
     3425void I422ToYUY2Row_MMI(const uint8_t* src_y,
     3426                       const uint8_t* src_u,
     3427                       const uint8_t* src_v,
     3428                       uint8_t* dst_yuy2,
     3429                       int width);
    29343430void I422ToUYVYRow_MSA(const uint8_t* src_y,
    29353431                       const uint8_t* src_u,
     
    29373433                       uint8_t* dst_uyvy,
    29383434                       int width);
     3435void I422ToUYVYRow_MMI(const uint8_t* src_y,
     3436                       const uint8_t* src_u,
     3437                       const uint8_t* src_v,
     3438                       uint8_t* dst_uyvy,
     3439                       int width);
    29393440void I422ToYUY2Row_Any_MSA(const uint8_t* y_buf,
    29403441                           const uint8_t* u_buf,
     
    29423443                           uint8_t* dst_ptr,
    29433444                           int width);
     3445void I422ToYUY2Row_Any_MMI(const uint8_t* y_buf,
     3446                           const uint8_t* u_buf,
     3447                           const uint8_t* v_buf,
     3448                           uint8_t* dst_ptr,
     3449                           int width);
    29443450void I422ToUYVYRow_Any_MSA(const uint8_t* y_buf,
    29453451                           const uint8_t* u_buf,
     
    29473453                           uint8_t* dst_ptr,
    29483454                           int width);
     3455void I422ToUYVYRow_Any_MMI(const uint8_t* y_buf,
     3456                           const uint8_t* u_buf,
     3457                           const uint8_t* v_buf,
     3458                           uint8_t* dst_ptr,
     3459                           int width);
    29493460
    29503461// Effects related row functions.
     
    29603471                           int width);
    29613472void ARGBAttenuateRow_MSA(const uint8_t* src_argb,
     3473                          uint8_t* dst_argb,
     3474                          int width);
     3475void ARGBAttenuateRow_MMI(const uint8_t* src_argb,
    29623476                          uint8_t* dst_argb,
    29633477                          int width);
     
    29743488                              uint8_t* dst_ptr,
    29753489                              int width);
     3490void ARGBAttenuateRow_Any_MMI(const uint8_t* src_ptr,
     3491                              uint8_t* dst_ptr,
     3492                              int width);
    29763493
    29773494// Inverse table for unattenuate, shared by C and SSE2.
     
    29973514void ARGBGrayRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width);
    29983515void ARGBGrayRow_MSA(const uint8_t* src_argb, uint8_t* dst_argb, int width);
     3516void ARGBGrayRow_MMI(const uint8_t* src_argb, uint8_t* dst_argb, int width);
    29993517
    30003518void ARGBSepiaRow_C(uint8_t* dst_argb, int width);
     
    30023520void ARGBSepiaRow_NEON(uint8_t* dst_argb, int width);
    30033521void ARGBSepiaRow_MSA(uint8_t* dst_argb, int width);
     3522void ARGBSepiaRow_MMI(uint8_t* dst_argb, int width);
    30043523
    30053524void ARGBColorMatrixRow_C(const uint8_t* src_argb,
     
    30163535                             int width);
    30173536void ARGBColorMatrixRow_MSA(const uint8_t* src_argb,
     3537                            uint8_t* dst_argb,
     3538                            const int8_t* matrix_argb,
     3539                            int width);
     3540void ARGBColorMatrixRow_MMI(const uint8_t* src_argb,
    30183541                            uint8_t* dst_argb,
    30193542                            const int8_t* matrix_argb,
     
    30713594                      int width,
    30723595                      uint32_t value);
     3596void ARGBShadeRow_MMI(const uint8_t* src_argb,
     3597                      uint8_t* dst_argb,
     3598                      int width,
     3599                      uint32_t value);
    30733600
    30743601// Used for blur.
     
    30833610                                  const int32_t* previous_cumsum,
    30843611                                  int width);
     3612
     3613void ComputeCumulativeSumRow_MMI(const uint8_t* row,
     3614                                 int32_t* cumsum,
     3615                                 const int32_t* previous_cumsum,
     3616                                 int width);
    30853617
    30863618void CumulativeSumToAverageRow_C(const int32_t* tl,
     
    31343666                        int width,
    31353667                        int source_y_fraction);
     3668void InterpolateRow_MMI(uint8_t* dst_ptr,
     3669                        const uint8_t* src_ptr,
     3670                        ptrdiff_t src_stride,
     3671                        int width,
     3672                        int source_y_fraction);
    31363673void InterpolateRow_Any_NEON(uint8_t* dst_ptr,
    31373674                             const uint8_t* src_ptr,
     
    31503687                             int source_y_fraction);
    31513688void InterpolateRow_Any_MSA(uint8_t* dst_ptr,
     3689                            const uint8_t* src_ptr,
     3690                            ptrdiff_t src_stride_ptr,
     3691                            int width,
     3692                            int source_y_fraction);
     3693void InterpolateRow_Any_MMI(uint8_t* dst_ptr,
    31523694                            const uint8_t* src_ptr,
    31533695                            ptrdiff_t src_stride_ptr,
     
    31823724                   uint8_t* dst_sobelx,
    31833725                   int width);
     3726void SobelXRow_MMI(const uint8_t* src_y0,
     3727                   const uint8_t* src_y1,
     3728                   const uint8_t* src_y2,
     3729                   uint8_t* dst_sobelx,
     3730                   int width);
    31843731void SobelYRow_C(const uint8_t* src_y0,
    31853732                 const uint8_t* src_y1,
     
    31953742                    int width);
    31963743void SobelYRow_MSA(const uint8_t* src_y0,
     3744                   const uint8_t* src_y1,
     3745                   uint8_t* dst_sobely,
     3746                   int width);
     3747void SobelYRow_MMI(const uint8_t* src_y0,
    31973748                   const uint8_t* src_y1,
    31983749                   uint8_t* dst_sobely,
     
    32143765                  uint8_t* dst_argb,
    32153766                  int width);
     3767void SobelRow_MMI(const uint8_t* src_sobelx,
     3768                  const uint8_t* src_sobely,
     3769                  uint8_t* dst_argb,
     3770                  int width);
    32163771void SobelToPlaneRow_C(const uint8_t* src_sobelx,
    32173772                       const uint8_t* src_sobely,
     
    32273782                          int width);
    32283783void SobelToPlaneRow_MSA(const uint8_t* src_sobelx,
     3784                         const uint8_t* src_sobely,
     3785                         uint8_t* dst_y,
     3786                         int width);
     3787void SobelToPlaneRow_MMI(const uint8_t* src_sobelx,
    32293788                         const uint8_t* src_sobely,
    32303789                         uint8_t* dst_y,
     
    32463805                    uint8_t* dst_argb,
    32473806                    int width);
     3807void SobelXYRow_MMI(const uint8_t* src_sobelx,
     3808                    const uint8_t* src_sobely,
     3809                    uint8_t* dst_argb,
     3810                    int width);
    32483811void SobelRow_Any_SSE2(const uint8_t* y_buf,
    32493812                       const uint8_t* uv_buf,
     
    32553818                       int width);
    32563819void SobelRow_Any_MSA(const uint8_t* y_buf,
     3820                      const uint8_t* uv_buf,
     3821                      uint8_t* dst_ptr,
     3822                      int width);
     3823void SobelRow_Any_MMI(const uint8_t* y_buf,
    32573824                      const uint8_t* uv_buf,
    32583825                      uint8_t* dst_ptr,
     
    32703837                             uint8_t* dst_ptr,
    32713838                             int width);
     3839void SobelToPlaneRow_Any_MMI(const uint8_t* y_buf,
     3840                             const uint8_t* uv_buf,
     3841                             uint8_t* dst_ptr,
     3842                             int width);
    32723843void SobelXYRow_Any_SSE2(const uint8_t* y_buf,
    32733844                         const uint8_t* uv_buf,
     
    32793850                         int width);
    32803851void SobelXYRow_Any_MSA(const uint8_t* y_buf,
     3852                        const uint8_t* uv_buf,
     3853                        uint8_t* dst_ptr,
     3854                        int width);
     3855void SobelXYRow_Any_MMI(const uint8_t* y_buf,
    32813856                        const uint8_t* uv_buf,
    32823857                        uint8_t* dst_ptr,
     
    33593934                         float scale,
    33603935                         int width);
    3361 void ByteToFloatRow_Any_NEON(const uint8_t* src,
    3362                              float* dst,
    3363                              float scale,
     3936void ByteToFloatRow_Any_NEON(const uint8_t* src_ptr,
     3937                             float* dst_ptr,
     3938                             float param,
    33643939                             int width);
    33653940
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/scale_row.h

    r235135 r239415  
    5959#define HAS_FIXEDDIV1_X86
    6060#define HAS_FIXEDDIV_X86
     61#define HAS_SCALEADDROW_SSE2
    6162#define HAS_SCALEARGBCOLS_SSE2
    6263#define HAS_SCALEARGBCOLSUP2_SSE2
     
    7071#define HAS_SCALEROWDOWN38_SSSE3
    7172#define HAS_SCALEROWDOWN4_SSSE3
    72 #define HAS_SCALEADDROW_SSE2
    7373#endif
    7474
     
    8787#if !defined(LIBYUV_DISABLE_NEON) && \
    8888    (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
     89#define HAS_SCALEADDROW_NEON
    8990#define HAS_SCALEARGBCOLS_NEON
     91#define HAS_SCALEARGBFILTERCOLS_NEON
    9092#define HAS_SCALEARGBROWDOWN2_NEON
    9193#define HAS_SCALEARGBROWDOWNEVEN_NEON
     
    9597#define HAS_SCALEROWDOWN38_NEON
    9698#define HAS_SCALEROWDOWN4_NEON
    97 #define HAS_SCALEARGBFILTERCOLS_NEON
    9899#endif
    99100
     
    109110#define HAS_SCALEROWDOWN38_MSA
    110111#define HAS_SCALEROWDOWN4_MSA
     112#endif
     113
     114#if !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
     115#define HAS_FIXEDDIV1_MIPS
     116#define HAS_FIXEDDIV_MIPS
     117#define HAS_SCALEADDROW_16_MMI
     118#define HAS_SCALEADDROW_MMI
     119#define HAS_SCALEARGBCOLS_MMI
     120#define HAS_SCALEARGBCOLSUP2_MMI
     121#define HAS_SCALEARGBROWDOWN2_MMI
     122#define HAS_SCALEARGBROWDOWNEVEN_MMI
     123#define HAS_SCALECOLS_16_MMI
     124#define HAS_SCALECOLS_MMI
     125#define HAS_SCALEROWDOWN2_16_MMI
     126#define HAS_SCALEROWDOWN2_MMI
     127#define HAS_SCALEROWDOWN4_16_MMI
     128#define HAS_SCALEROWDOWN4_MMI
    111129#endif
    112130
     
    148166int FixedDiv_C(int num, int div);
    149167int FixedDiv_X86(int num, int div);
     168int FixedDiv_MIPS(int num, int div);
    150169// Divide num - 1 by div - 1 and return as 16.16 fixed point result.
    151170int FixedDiv1_C(int num, int div);
    152171int FixedDiv1_X86(int num, int div);
     172int FixedDiv1_MIPS(int num, int div);
    153173#ifdef HAS_FIXEDDIV_X86
    154174#define FixedDiv FixedDiv_X86
    155175#define FixedDiv1 FixedDiv1_X86
     176#elif defined HAS_FIXEDDIV_MIPS
     177#define FixedDiv FixedDiv_MIPS
     178#define FixedDiv1 FixedDiv1_MIPS
    156179#else
    157180#define FixedDiv FixedDiv_C
     
    570593                           int x,
    571594                           int dx);
     595void ScaleARGBCols_MMI(uint8_t* dst_argb,
     596                       const uint8_t* src_argb,
     597                       int dst_width,
     598                       int x,
     599                       int dx);
     600void ScaleARGBCols_Any_MMI(uint8_t* dst_ptr,
     601                           const uint8_t* src_ptr,
     602                           int dst_width,
     603                           int x,
     604                           int dx);
    572605
    573606// ARGB Row functions
     
    605638                                 int dst_width);
    606639void ScaleARGBRowDown2Box_MSA(const uint8_t* src_argb,
     640                              ptrdiff_t src_stride,
     641                              uint8_t* dst_argb,
     642                              int dst_width);
     643void ScaleARGBRowDown2_MMI(const uint8_t* src_argb,
     644                           ptrdiff_t src_stride,
     645                           uint8_t* dst_argb,
     646                           int dst_width);
     647void ScaleARGBRowDown2Linear_MMI(const uint8_t* src_argb,
     648                                 ptrdiff_t src_stride,
     649                                 uint8_t* dst_argb,
     650                                 int dst_width);
     651void ScaleARGBRowDown2Box_MMI(const uint8_t* src_argb,
    607652                              ptrdiff_t src_stride,
    608653                              uint8_t* dst_argb,
     
    644689                                  uint8_t* dst_ptr,
    645690                                  int dst_width);
    646 
     691void ScaleARGBRowDown2_Any_MMI(const uint8_t* src_ptr,
     692                               ptrdiff_t src_stride,
     693                               uint8_t* dst_ptr,
     694                               int dst_width);
     695void ScaleARGBRowDown2Linear_Any_MMI(const uint8_t* src_ptr,
     696                                     ptrdiff_t src_stride,
     697                                     uint8_t* dst_ptr,
     698                                     int dst_width);
     699void ScaleARGBRowDown2Box_Any_MMI(const uint8_t* src_ptr,
     700                                  ptrdiff_t src_stride,
     701                                  uint8_t* dst_ptr,
     702                                  int dst_width);
    647703void ScaleARGBRowDownEven_SSE2(const uint8_t* src_argb,
    648704                               ptrdiff_t src_stride,
     
    671727                              int dst_width);
    672728void ScaleARGBRowDownEvenBox_MSA(const uint8_t* src_argb,
     729                                 ptrdiff_t src_stride,
     730                                 int src_stepx,
     731                                 uint8_t* dst_argb,
     732                                 int dst_width);
     733void ScaleARGBRowDownEven_MMI(const uint8_t* src_argb,
     734                              ptrdiff_t src_stride,
     735                              int32_t src_stepx,
     736                              uint8_t* dst_argb,
     737                              int dst_width);
     738void ScaleARGBRowDownEvenBox_MMI(const uint8_t* src_argb,
    673739                                 ptrdiff_t src_stride,
    674740                                 int src_stepx,
     
    701767                                  int dst_width);
    702768void ScaleARGBRowDownEvenBox_Any_MSA(const uint8_t* src_ptr,
     769                                     ptrdiff_t src_stride,
     770                                     int src_stepx,
     771                                     uint8_t* dst_ptr,
     772                                     int dst_width);
     773void ScaleARGBRowDownEven_Any_MMI(const uint8_t* src_ptr,
     774                                  ptrdiff_t src_stride,
     775                                  int32_t src_stepx,
     776                                  uint8_t* dst_ptr,
     777                                  int dst_width);
     778void ScaleARGBRowDownEvenBox_Any_MMI(const uint8_t* src_ptr,
    703779                                     ptrdiff_t src_stride,
    704780                                     int src_stepx,
     
    9371013                                  int dst_width);
    9381014
     1015void ScaleRowDown2_MMI(const uint8_t* src_ptr,
     1016                       ptrdiff_t src_stride,
     1017                       uint8_t* dst,
     1018                       int dst_width);
     1019void ScaleRowDown2_16_MMI(const uint16_t* src_ptr,
     1020                          ptrdiff_t src_stride,
     1021                          uint16_t* dst,
     1022                          int dst_width);
     1023void ScaleRowDown2Linear_MMI(const uint8_t* src_ptr,
     1024                             ptrdiff_t src_stride,
     1025                             uint8_t* dst,
     1026                             int dst_width);
     1027void ScaleRowDown2Linear_16_MMI(const uint16_t* src_ptr,
     1028                                ptrdiff_t src_stride,
     1029                                uint16_t* dst,
     1030                                int dst_width);
     1031void ScaleRowDown2Box_MMI(const uint8_t* src_ptr,
     1032                          ptrdiff_t src_stride,
     1033                          uint8_t* dst,
     1034                          int dst_width);
     1035void ScaleRowDown2Box_16_MMI(const uint16_t* src_ptr,
     1036                             ptrdiff_t src_stride,
     1037                             uint16_t* dst,
     1038                             int dst_width);
     1039void ScaleRowDown2Box_Odd_MMI(const uint8_t* src_ptr,
     1040                              ptrdiff_t src_stride,
     1041                              uint8_t* dst,
     1042                              int dst_width);
     1043void ScaleRowDown4_MMI(const uint8_t* src_ptr,
     1044                       ptrdiff_t src_stride,
     1045                       uint8_t* dst,
     1046                       int dst_width);
     1047void ScaleRowDown4_16_MMI(const uint16_t* src_ptr,
     1048                          ptrdiff_t src_stride,
     1049                          uint16_t* dst,
     1050                          int dst_width);
     1051void ScaleRowDown4Box_MMI(const uint8_t* src_ptr,
     1052                          ptrdiff_t src_stride,
     1053                          uint8_t* dst,
     1054                          int dst_width);
     1055void ScaleRowDown4Box_16_MMI(const uint16_t* src_ptr,
     1056                             ptrdiff_t src_stride,
     1057                             uint16_t* dst,
     1058                             int dst_width);
     1059void ScaleAddRow_MMI(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width);
     1060void ScaleAddRow_16_MMI(const uint16_t* src_ptr,
     1061                        uint32_t* dst_ptr,
     1062                        int src_width);
     1063void ScaleColsUp2_MMI(uint8_t* dst_ptr,
     1064                      const uint8_t* src_ptr,
     1065                      int dst_width,
     1066                      int x,
     1067                      int dx);
     1068void ScaleColsUp2_16_MMI(uint16_t* dst_ptr,
     1069                         const uint16_t* src_ptr,
     1070                         int dst_width,
     1071                         int x,
     1072                         int dx);
     1073void ScaleARGBColsUp2_MMI(uint8_t* dst_argb,
     1074                          const uint8_t* src_argb,
     1075                          int dst_width,
     1076                          int x,
     1077                          int dx);
     1078
     1079void ScaleRowDown2_Any_MMI(const uint8_t* src_ptr,
     1080                           ptrdiff_t src_stride,
     1081                           uint8_t* dst_ptr,
     1082                           int dst_width);
     1083void ScaleRowDown2Linear_Any_MMI(const uint8_t* src_ptr,
     1084                                 ptrdiff_t src_stride,
     1085                                 uint8_t* dst_ptr,
     1086                                 int dst_width);
     1087void ScaleRowDown2Box_Any_MMI(const uint8_t* src_ptr,
     1088                              ptrdiff_t src_stride,
     1089                              uint8_t* dst_ptr,
     1090                              int dst_width);
     1091void ScaleRowDown4_Any_MMI(const uint8_t* src_ptr,
     1092                           ptrdiff_t src_stride,
     1093                           uint8_t* dst_ptr,
     1094                           int dst_width);
     1095void ScaleRowDown4Box_Any_MMI(const uint8_t* src_ptr,
     1096                              ptrdiff_t src_stride,
     1097                              uint8_t* dst_ptr,
     1098                              int dst_width);
     1099void ScaleAddRow_Any_MMI(const uint8_t* src_ptr,
     1100                         uint16_t* dst_ptr,
     1101                         int src_width);
    9391102#ifdef __cplusplus
    9401103}  // extern "C"
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/version.h

    r235135 r239415  
    1212#define INCLUDE_LIBYUV_VERSION_H_
    1313
    14 #define LIBYUV_VERSION 1703
     14#define LIBYUV_VERSION 1722
    1515
    1616#endif  // INCLUDE_LIBYUV_VERSION_H_
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/include/libyuv/video_common.h

    r235135 r239415  
    3131#define FOURCC(a, b, c, d)                                        \
    3232  ((static_cast<uint32_t>(a)) | (static_cast<uint32_t>(b) << 8) | \
    33    (static_cast<uint32_t>(c) << 16) | (static_cast<uint32_t>(d) << 24))
     33   (static_cast<uint32_t>(c) << 16) | /* NOLINT */                \
     34   (static_cast<uint32_t>(d) << 24))  /* NOLINT */
    3435#else
    3536#define FOURCC(a, b, c, d)                                     \
     
    8081  FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'),
    8182
    82   // 7 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
     83  // 8 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
    8384  FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'),
    8485  FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'),
     
    8889  FOURCC_J400 = FOURCC('J', '4', '0', '0'),  // unofficial fourcc
    8990  FOURCC_H420 = FOURCC('H', '4', '2', '0'),  // unofficial fourcc
     91  FOURCC_H422 = FOURCC('H', '4', '2', '2'),  // unofficial fourcc
    9092
    9193  // 14 Auxiliary aliases.  CanonicalFourCC() maps these to canonical fourcc.
     
    156158  FOURCC_BPP_J400 = 8,
    157159  FOURCC_BPP_H420 = 12,
     160  FOURCC_BPP_H422 = 16,
    158161  FOURCC_BPP_H010 = 24,
    159162  FOURCC_BPP_MJPG = 0,  // 0 means unknown.
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/infra/config/PRESUBMIT.py

    r239414 r239415  
    1 # Copyright 2013 The LibYuv Project Authors. All rights reserved.
     1# Copyright 2018 The LibYuv Project Authors. All rights reserved.
    22#
    33# Use of this source code is governed by a BSD-style license
     
    77# be found in the AUTHORS file in the root of the source tree.
    88
    9 # all.gyp and All target are for benefit of android gyp build.
    10 {
    11   'targets': [
    12     {
    13       'target_name': 'All',
    14       'type': 'none',
    15       'dependencies': [
    16         'libyuv.gyp:*',
    17         'libyuv_test.gyp:*',
    18       ],
    19     },
    20   ],
    21 }
     9
     10def CheckChangeOnUpload(input_api, output_api):
     11  return input_api.canned_checks.CheckChangedLUCIConfigs(input_api, output_api)
     12
     13
     14def CheckChangeOnCommit(input_api, output_api):
     15  return input_api.canned_checks.CheckChangedLUCIConfigs(input_api, output_api)
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/infra/config/cq.cfg

    r229378 r239415  
    33
    44version: 1
    5 cq_name: "libyuv"
    65cq_status_url: "https://chromium-cq-status.appspot.com"
    76git_repo_url: "https://chromium.googlesource.com/libyuv/libyuv.git"
     
    1716  try_job {
    1817    buckets {
    19       name: "master.tryserver.libyuv"
     18      name: "luci.libyuv.try"
    2019      builders { name: "win" }
    2120      builders { name: "win_rel" }
     
    4847      builders { name: "android_x86" }
    4948      builders { name: "android_x64" }
    50       builders {
    51         name: "android_mips"
    52         experiment_percentage: 100
    53       }
    5449    }
    5550  }
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/libyuv.gni

    r210942 r239415  
    1414  libyuv_include_tests = !build_with_chromium
    1515  libyuv_disable_jpeg = false
    16   libyuv_use_neon = (current_cpu == "arm64" ||
    17       (current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon)))
    18   libyuv_use_msa = (current_cpu == "mips64el" || current_cpu == "mipsel") &&
    19     mips_use_msa
     16  libyuv_use_neon =
     17      current_cpu == "arm64" ||
     18      (current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon))
     19  libyuv_use_msa =
     20      (current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_msa
     21  libyuv_use_mmi =
     22      (current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_mmi
    2023}
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/linux.mk

    r235135 r239415  
    1414        source/compare_common.o    \
    1515        source/compare_gcc.o       \
     16        source/compare_mmi.o       \
     17        source/compare_msa.o       \
    1618        source/compare_neon64.o    \
    1719        source/compare_neon.o      \
     
    3335        source/rotate_common.o     \
    3436        source/rotate_gcc.o        \
     37        source/rotate_mmi.o        \
     38        source/rotate_msa.o        \
    3539        source/rotate_neon64.o     \
    3640        source/rotate_neon.o       \
     
    3943        source/row_common.o        \
    4044        source/row_gcc.o           \
     45        source/row_mmi.o           \
     46        source/row_msa.o           \
    4147        source/row_neon64.o        \
    4248        source/row_neon.o          \
     
    4753        source/scale_common.o      \
    4854        source/scale_gcc.o         \
     55        source/scale_mmi.o         \
     56        source/scale_msa.o         \
    4957        source/scale_neon64.o      \
    5058        source/scale_neon.o        \
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/compare.cc

    r235135 r239415  
    155155  }
    156156#endif
     157#if defined(HAS_HAMMINGDISTANCE_MMI)
     158  if (TestCpuFlag(kCpuHasMMI)) {
     159    HammingDistance = HammingDistance_MMI;
     160  }
     161#endif
     162
    157163#ifdef _OPENMP
    158164#pragma omp parallel for reduction(+ : diff)
     
    209215  if (TestCpuFlag(kCpuHasMSA)) {
    210216    SumSquareError = SumSquareError_MSA;
     217  }
     218#endif
     219#if defined(HAS_SUMSQUAREERROR_MMI)
     220  if (TestCpuFlag(kCpuHasMMI)) {
     221    SumSquareError = SumSquareError_MMI;
    211222  }
    212223#endif
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/compare_common.cc

    r235135 r239415  
    5656  int i;
    5757  for (i = 0; i < count - 3; i += 4) {
    58     uint32_t x = *((uint32_t*)src_a) ^ *((uint32_t*)src_b);  // NOLINT
     58    uint32_t x = *((const uint32_t*)src_a) ^ *((const uint32_t*)src_b);
    5959    uint32_t u = x - ((x >> 1) & 0x55555555);
    6060    u = ((u >> 2) & 0x33333333) + (u & 0x33333333);
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/convert.cc

    r235135 r239415  
    216216}
    217217
     218// TODO(fbarchard): Implement row conversion.
     219LIBYUV_API
     220int I422ToNV21(const uint8_t* src_y,
     221               int src_stride_y,
     222               const uint8_t* src_u,
     223               int src_stride_u,
     224               const uint8_t* src_v,
     225               int src_stride_v,
     226               uint8_t* dst_y,
     227               int dst_stride_y,
     228               uint8_t* dst_vu,
     229               int dst_stride_vu,
     230               int width,
     231               int height) {
     232  int halfwidth = (width + 1) >> 1;
     233  int halfheight = (height + 1) >> 1;
     234  // Negative height means invert the image.
     235  if (height < 0) {
     236    height = -height;
     237    halfheight = (height + 1) >> 1;
     238    src_y = src_y + (height - 1) * src_stride_y;
     239    src_u = src_u + (height - 1) * src_stride_u;
     240    src_v = src_v + (height - 1) * src_stride_v;
     241    src_stride_y = -src_stride_y;
     242    src_stride_u = -src_stride_u;
     243    src_stride_v = -src_stride_v;
     244  }
     245
     246  // Allocate u and v buffers
     247  align_buffer_64(plane_u, halfwidth * halfheight * 2);
     248  uint8_t* plane_v = plane_u + halfwidth * halfheight;
     249
     250  I422ToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v,
     251             dst_y, dst_stride_y, plane_u, halfwidth, plane_v, halfwidth, width,
     252             height);
     253  MergeUVPlane(plane_v, halfwidth, plane_u, halfwidth, dst_vu, dst_stride_vu,
     254               halfwidth, halfheight);
     255  free_aligned_buffer_64(plane_u);
     256  return 0;
     257}
     258
     259#ifdef I422TONV21_ROW_VERSION
     260// Unittest fails for this version.
     261// 422 chroma is 1/2 width, 1x height
     262// 420 chroma is 1/2 width, 1/2 height
     263// Swap src_u and src_v to implement I422ToNV12
     264LIBYUV_API
     265int I422ToNV21(const uint8_t* src_y,
     266               int src_stride_y,
     267               const uint8_t* src_u,
     268               int src_stride_u,
     269               const uint8_t* src_v,
     270               int src_stride_v,
     271               uint8_t* dst_y,
     272               int dst_stride_y,
     273               uint8_t* dst_vu,
     274               int dst_stride_vu,
     275               int width,
     276               int height) {
     277  int y;
     278  void (*MergeUVRow)(const uint8_t* src_u, const uint8_t* src_v,
     279                     uint8_t* dst_uv, int width) = MergeUVRow_C;
     280  void (*InterpolateRow)(uint8_t * dst_ptr, const uint8_t* src_ptr,
     281                         ptrdiff_t src_stride, int dst_width,
     282                         int source_y_fraction) = InterpolateRow_C;
     283  int halfwidth = (width + 1) >> 1;
     284  int halfheight = (height + 1) >> 1;
     285  if (!src_u || !src_v || !dst_vu || width <= 0 || height == 0) {
     286    return -1;
     287  }
     288  // Negative height means invert the image.
     289  if (height < 0) {
     290    height = -height;
     291    halfheight = (height + 1) >> 1;
     292    src_y = src_y + (height - 1) * src_stride_y;
     293    src_u = src_u + (halfheight - 1) * src_stride_u;
     294    src_v = src_v + (halfheight - 1) * src_stride_v;
     295    src_stride_y = -src_stride_y;
     296    src_stride_u = -src_stride_u;
     297    src_stride_v = -src_stride_v;
     298  }
     299#if defined(HAS_MERGEUVROW_SSE2)
     300  if (TestCpuFlag(kCpuHasSSE2)) {
     301    MergeUVRow = MergeUVRow_Any_SSE2;
     302    if (IS_ALIGNED(halfwidth, 16)) {
     303      MergeUVRow = MergeUVRow_SSE2;
     304    }
     305  }
     306#endif
     307#if defined(HAS_MERGEUVROW_AVX2)
     308  if (TestCpuFlag(kCpuHasAVX2)) {
     309    MergeUVRow = MergeUVRow_Any_AVX2;
     310    if (IS_ALIGNED(halfwidth, 32)) {
     311      MergeUVRow = MergeUVRow_AVX2;
     312    }
     313  }
     314#endif
     315#if defined(HAS_MERGEUVROW_NEON)
     316  if (TestCpuFlag(kCpuHasNEON)) {
     317    MergeUVRow = MergeUVRow_Any_NEON;
     318    if (IS_ALIGNED(halfwidth, 16)) {
     319      MergeUVRow = MergeUVRow_NEON;
     320    }
     321  }
     322#endif
     323#if defined(HAS_MERGEUVROW_MSA)
     324  if (TestCpuFlag(kCpuHasMSA)) {
     325    MergeUVRow = MergeUVRow_Any_MSA;
     326    if (IS_ALIGNED(halfwidth, 16)) {
     327      MergeUVRow = MergeUVRow_MSA;
     328    }
     329  }
     330#endif
     331#if defined(HAS_MERGEUVROW_MMI)
     332  if (TestCpuFlag(kCpuHasMMI)) {
     333    MergeUVRow = MergeUVRow_Any_MMI;
     334    if (IS_ALIGNED(halfwidth, 8)) {
     335      MergeUVRow = MergeUVRow_MMI;
     336    }
     337  }
     338#endif
     339#if defined(HAS_INTERPOLATEROW_SSSE3)
     340  if (TestCpuFlag(kCpuHasSSSE3)) {
     341    InterpolateRow = InterpolateRow_Any_SSSE3;
     342    if (IS_ALIGNED(width, 16)) {
     343      InterpolateRow = InterpolateRow_SSSE3;
     344    }
     345  }
     346#endif
     347#if defined(HAS_INTERPOLATEROW_AVX2)
     348  if (TestCpuFlag(kCpuHasAVX2)) {
     349    InterpolateRow = InterpolateRow_Any_AVX2;
     350    if (IS_ALIGNED(width, 32)) {
     351      InterpolateRow = InterpolateRow_AVX2;
     352    }
     353  }
     354#endif
     355#if defined(HAS_INTERPOLATEROW_NEON)
     356  if (TestCpuFlag(kCpuHasNEON)) {
     357    InterpolateRow = InterpolateRow_Any_NEON;
     358    if (IS_ALIGNED(width, 16)) {
     359      InterpolateRow = InterpolateRow_NEON;
     360    }
     361  }
     362#endif
     363#if defined(HAS_INTERPOLATEROW_MSA)
     364  if (TestCpuFlag(kCpuHasMSA)) {
     365    InterpolateRow = InterpolateRow_Any_MSA;
     366    if (IS_ALIGNED(width, 32)) {
     367      InterpolateRow = InterpolateRow_MSA;
     368    }
     369  }
     370#endif
     371#if defined(HAS_INTERPOLATEROW_MMI)
     372  if (TestCpuFlag(kCpuHasMMI)) {
     373    InterpolateRow = InterpolateRow_Any_MMI;
     374    if (IS_ALIGNED(width, 8)) {
     375      InterpolateRow = InterpolateRow_MMI;
     376    }
     377  }
     378#endif
     379
     380  if (dst_y) {
     381    CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, halfwidth, height);
     382  }
     383  {
     384    // Allocate 2 rows of vu.
     385    int awidth = halfwidth * 2;
     386    align_buffer_64(row_vu_0, awidth * 2);
     387    uint8_t* row_vu_1 = row_vu_0 + awidth;
     388
     389    for (y = 0; y < height - 1; y += 2) {
     390      MergeUVRow(src_v, src_u, row_vu_0, halfwidth);
     391      MergeUVRow(src_v + src_stride_v, src_u + src_stride_u, row_vu_1,
     392                 halfwidth);
     393      InterpolateRow(dst_vu, row_vu_0, awidth, awidth, 128);
     394      src_u += src_stride_u * 2;
     395      src_v += src_stride_v * 2;
     396      dst_vu += dst_stride_vu;
     397    }
     398    if (height & 1) {
     399      MergeUVRow(src_v, src_u, dst_vu, halfwidth);
     400    }
     401    free_aligned_buffer_64(row_vu_0);
     402  }
     403  return 0;
     404}
     405#endif  // I422TONV21_ROW_VERSION
     406
    218407// 444 chroma is 1x width, 1x height
    219408// 420 chroma is 1/2 width, 1/2 height
     
    238427}
    239428
     429// TODO(fbarchard): Implement row conversion.
     430LIBYUV_API
     431int I444ToNV21(const uint8_t* src_y,
     432               int src_stride_y,
     433               const uint8_t* src_u,
     434               int src_stride_u,
     435               const uint8_t* src_v,
     436               int src_stride_v,
     437               uint8_t* dst_y,
     438               int dst_stride_y,
     439               uint8_t* dst_vu,
     440               int dst_stride_vu,
     441               int width,
     442               int height) {
     443  int halfwidth = (width + 1) >> 1;
     444  int halfheight = (height + 1) >> 1;
     445  // Negative height means invert the image.
     446  if (height < 0) {
     447    height = -height;
     448    halfheight = (height + 1) >> 1;
     449    src_y = src_y + (height - 1) * src_stride_y;
     450    src_u = src_u + (height - 1) * src_stride_u;
     451    src_v = src_v + (height - 1) * src_stride_v;
     452    src_stride_y = -src_stride_y;
     453    src_stride_u = -src_stride_u;
     454    src_stride_v = -src_stride_v;
     455  }
     456  // Allocate u and v buffers
     457  align_buffer_64(plane_u, halfwidth * halfheight * 2);
     458  uint8_t* plane_v = plane_u + halfwidth * halfheight;
     459
     460  I444ToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v,
     461             dst_y, dst_stride_y, plane_u, halfwidth, plane_v, halfwidth, width,
     462             height);
     463  MergeUVPlane(plane_v, halfwidth, plane_u, halfwidth, dst_vu, dst_stride_vu,
     464               halfwidth, halfheight);
     465  free_aligned_buffer_64(plane_u);
     466  return 0;
     467}
     468
    240469// I400 is greyscale typically used in MJPG
    241470LIBYUV_API
     
    267496  SetPlane(dst_u, dst_stride_u, halfwidth, halfheight, 128);
    268497  SetPlane(dst_v, dst_stride_v, halfwidth, halfheight, 128);
     498  return 0;
     499}
     500
     501// I400 is greyscale typically used in MJPG
     502LIBYUV_API
     503int I400ToNV21(const uint8_t* src_y,
     504               int src_stride_y,
     505               uint8_t* dst_y,
     506               int dst_stride_y,
     507               uint8_t* dst_vu,
     508               int dst_stride_vu,
     509               int width,
     510               int height) {
     511  int halfwidth = (width + 1) >> 1;
     512  int halfheight = (height + 1) >> 1;
     513  if (!dst_vu || width <= 0 || height == 0) {
     514    return -1;
     515  }
     516  // Negative height means invert the image.
     517  if (height < 0) {
     518    height = -height;
     519    halfheight = (height + 1) >> 1;
     520    src_y = src_y + (height - 1) * src_stride_y;
     521    src_stride_y = -src_stride_y;
     522  }
     523  if (dst_y) {
     524    CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
     525  }
     526  SetPlane(dst_vu, dst_stride_vu, halfwidth * 2, halfheight, 128);
    269527  return 0;
    270528}
     
    503761  }
    504762#endif
     763#if defined(HAS_YUY2TOYROW_MMI)
     764  if (TestCpuFlag(kCpuHasMMI)) {
     765    YUY2ToYRow = YUY2ToYRow_Any_MMI;
     766    YUY2ToUVRow = YUY2ToUVRow_Any_MMI;
     767    if (IS_ALIGNED(width, 8)) {
     768      YUY2ToYRow = YUY2ToYRow_MMI;
     769      if (IS_ALIGNED(width, 16)) {
     770        YUY2ToUVRow = YUY2ToUVRow_MMI;
     771      }
     772    }
     773  }
     774#endif
    505775
    506776  for (y = 0; y < height - 1; y += 2) {
     
    584854  }
    585855#endif
     856#if defined(HAS_UYVYTOYROW_MMI)
     857  if (TestCpuFlag(kCpuHasMMI)) {
     858    UYVYToYRow = UYVYToYRow_Any_MMI;
     859    UYVYToUVRow = UYVYToUVRow_Any_MMI;
     860    if (IS_ALIGNED(width, 16)) {
     861      UYVYToYRow = UYVYToYRow_MMI;
     862      UYVYToUVRow = UYVYToUVRow_MMI;
     863    }
     864  }
     865#endif
    586866
    587867  for (y = 0; y < height - 1; y += 2) {
     
    680960  }
    681961#endif
     962#if defined(HAS_ARGBTOYROW_MMI)
     963  if (TestCpuFlag(kCpuHasMMI)) {
     964    ARGBToYRow = ARGBToYRow_Any_MMI;
     965    if (IS_ALIGNED(width, 8)) {
     966      ARGBToYRow = ARGBToYRow_MMI;
     967    }
     968  }
     969#endif
     970#if defined(HAS_ARGBTOUVROW_MMI)
     971  if (TestCpuFlag(kCpuHasMMI)) {
     972    ARGBToUVRow = ARGBToUVRow_Any_MMI;
     973    if (IS_ALIGNED(width, 16)) {
     974      ARGBToUVRow = ARGBToUVRow_MMI;
     975    }
     976  }
     977#endif
    682978
    683979  for (y = 0; y < height - 1; y += 2) {
     
    7661062  }
    7671063#endif
     1064#if defined(HAS_BGRATOYROW_MMI)
     1065  if (TestCpuFlag(kCpuHasMMI)) {
     1066    BGRAToYRow = BGRAToYRow_Any_MMI;
     1067    if (IS_ALIGNED(width, 8)) {
     1068      BGRAToYRow = BGRAToYRow_MMI;
     1069    }
     1070  }
     1071#endif
     1072#if defined(HAS_BGRATOUVROW_MMI)
     1073  if (TestCpuFlag(kCpuHasMMI)) {
     1074    BGRAToUVRow = BGRAToUVRow_Any_MMI;
     1075    if (IS_ALIGNED(width, 16)) {
     1076      BGRAToUVRow = BGRAToUVRow_MMI;
     1077    }
     1078  }
     1079#endif
    7681080
    7691081  for (y = 0; y < height - 1; y += 2) {
     
    8521164  }
    8531165#endif
     1166#if defined(HAS_ABGRTOYROW_MMI)
     1167  if (TestCpuFlag(kCpuHasMMI)) {
     1168    ABGRToYRow = ABGRToYRow_Any_MMI;
     1169    if (IS_ALIGNED(width, 8)) {
     1170      ABGRToYRow = ABGRToYRow_MMI;
     1171    }
     1172  }
     1173#endif
     1174#if defined(HAS_ABGRTOUVROW_MMI)
     1175  if (TestCpuFlag(kCpuHasMMI)) {
     1176    ABGRToUVRow = ABGRToUVRow_Any_MMI;
     1177    if (IS_ALIGNED(width, 16)) {
     1178      ABGRToUVRow = ABGRToUVRow_MMI;
     1179    }
     1180  }
     1181#endif
    8541182
    8551183  for (y = 0; y < height - 1; y += 2) {
     
    9381266  }
    9391267#endif
     1268#if defined(HAS_RGBATOYROW_MMI)
     1269  if (TestCpuFlag(kCpuHasMMI)) {
     1270    RGBAToYRow = RGBAToYRow_Any_MMI;
     1271    if (IS_ALIGNED(width, 8)) {
     1272      RGBAToYRow = RGBAToYRow_MMI;
     1273    }
     1274  }
     1275#endif
     1276#if defined(HAS_RGBATOUVROW_MMI)
     1277  if (TestCpuFlag(kCpuHasMMI)) {
     1278    RGBAToUVRow = RGBAToUVRow_Any_MMI;
     1279    if (IS_ALIGNED(width, 16)) {
     1280      RGBAToUVRow = RGBAToUVRow_MMI;
     1281    }
     1282  }
     1283#endif
    9401284
    9411285  for (y = 0; y < height - 1; y += 2) {
     
    9681312                int height) {
    9691313  int y;
    970 #if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA))
     1314#if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
     1315     defined(HAS_RGB24TOYROW_MMI))
    9711316  void (*RGB24ToUVRow)(const uint8_t* src_rgb24, int src_stride_rgb24,
    9721317                       uint8_t* dst_u, uint8_t* dst_v, int width) =
     
    10141359    }
    10151360  }
     1361#elif defined(HAS_RGB24TOYROW_MMI)
     1362  if (TestCpuFlag(kCpuHasMMI)) {
     1363    RGB24ToUVRow = RGB24ToUVRow_Any_MMI;
     1364    RGB24ToYRow = RGB24ToYRow_Any_MMI;
     1365    if (IS_ALIGNED(width, 8)) {
     1366      RGB24ToYRow = RGB24ToYRow_MMI;
     1367      if (IS_ALIGNED(width, 16)) {
     1368        RGB24ToUVRow = RGB24ToUVRow_MMI;
     1369      }
     1370    }
     1371  }
    10161372// Other platforms do intermediate conversion from RGB24 to ARGB.
    10171373#else
     
    10471403
    10481404  {
    1049 #if !(defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA))
     1405#if !(defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
     1406      defined(HAS_RGB24TOYROW_MMI))
    10501407    // Allocate 2 rows of ARGB.
    10511408    const int kRowSize = (width * 4 + 31) & ~31;
     
    10541411
    10551412    for (y = 0; y < height - 1; y += 2) {
    1056 #if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA))
     1413#if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
     1414     defined(HAS_RGB24TOYROW_MMI))
    10571415      RGB24ToUVRow(src_rgb24, src_stride_rgb24, dst_u, dst_v, width);
    10581416      RGB24ToYRow(src_rgb24, dst_y, width);
     
    10711429    }
    10721430    if (height & 1) {
    1073 #if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA))
     1431#if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
     1432     defined(HAS_RGB24TOYROW_MMI))
    10741433      RGB24ToUVRow(src_rgb24, 0, dst_u, dst_v, width);
    10751434      RGB24ToYRow(src_rgb24, dst_y, width);
     
    10801439#endif
    10811440    }
    1082 #if !(defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA))
     1441#if !(defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
     1442      defined(HAS_RGB24TOYROW_MMI))
    10831443    free_aligned_buffer_64(row);
    10841444#endif
     
    11001460              int height) {
    11011461  int y;
    1102 #if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA))
     1462#if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
     1463     defined(HAS_RAWTOYROW_MMI))
    11031464  void (*RAWToUVRow)(const uint8_t* src_raw, int src_stride_raw, uint8_t* dst_u,
    11041465                     uint8_t* dst_v, int width) = RAWToUVRow_C;
     
    11451506    }
    11461507  }
     1508#elif defined(HAS_RAWTOYROW_MMI)
     1509  if (TestCpuFlag(kCpuHasMMI)) {
     1510    RAWToUVRow = RAWToUVRow_Any_MMI;
     1511    RAWToYRow = RAWToYRow_Any_MMI;
     1512    if (IS_ALIGNED(width, 8)) {
     1513      RAWToYRow = RAWToYRow_MMI;
     1514      if (IS_ALIGNED(width, 16)) {
     1515        RAWToUVRow = RAWToUVRow_MMI;
     1516      }
     1517    }
     1518  }
    11471519// Other platforms do intermediate conversion from RAW to ARGB.
    11481520#else
     
    11781550
    11791551  {
    1180 #if !(defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA))
     1552#if !(defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
     1553      defined(HAS_RAWTOYROW_MMI))
    11811554    // Allocate 2 rows of ARGB.
    11821555    const int kRowSize = (width * 4 + 31) & ~31;
     
    11851558
    11861559    for (y = 0; y < height - 1; y += 2) {
    1187 #if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA))
     1560#if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
     1561     defined(HAS_RAWTOYROW_MMI))
    11881562      RAWToUVRow(src_raw, src_stride_raw, dst_u, dst_v, width);
    11891563      RAWToYRow(src_raw, dst_y, width);
     
    12021576    }
    12031577    if (height & 1) {
    1204 #if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA))
     1578#if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
     1579     defined(HAS_RAWTOYROW_MMI))
    12051580      RAWToUVRow(src_raw, 0, dst_u, dst_v, width);
    12061581      RAWToYRow(src_raw, dst_y, width);
     
    12111586#endif
    12121587    }
    1213 #if !(defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA))
     1588#if !(defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
     1589      defined(HAS_RAWTOYROW_MMI))
    12141590    free_aligned_buffer_64(row);
    12151591#endif
     
    12311607                 int height) {
    12321608  int y;
    1233 #if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA))
     1609#if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA) || \
     1610     defined(HAS_RGB565TOYROW_MMI))
    12341611  void (*RGB565ToUVRow)(const uint8_t* src_rgb565, int src_stride_rgb565,
    12351612                        uint8_t* dst_u, uint8_t* dst_v, int width) =
     
    12771654    }
    12781655  }
     1656#elif defined(HAS_RGB565TOYROW_MMI)
     1657  if (TestCpuFlag(kCpuHasMMI)) {
     1658    RGB565ToUVRow = RGB565ToUVRow_Any_MMI;
     1659    RGB565ToYRow = RGB565ToYRow_Any_MMI;
     1660    if (IS_ALIGNED(width, 8)) {
     1661      RGB565ToYRow = RGB565ToYRow_MMI;
     1662      if (IS_ALIGNED(width, 16)) {
     1663        RGB565ToUVRow = RGB565ToUVRow_MMI;
     1664      }
     1665    }
     1666  }
    12791667// Other platforms do intermediate conversion from RGB565 to ARGB.
    12801668#else
     
    13171705#endif
    13181706  {
    1319 #if !(defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA))
     1707#if !(defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA) || \
     1708      defined(HAS_RGB565TOYROW_MMI))
    13201709    // Allocate 2 rows of ARGB.
    13211710    const int kRowSize = (width * 4 + 31) & ~31;
     
    13231712#endif
    13241713    for (y = 0; y < height - 1; y += 2) {
    1325 #if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA))
     1714#if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA) || \
     1715     defined(HAS_RGB565TOYROW_MMI))
    13261716      RGB565ToUVRow(src_rgb565, src_stride_rgb565, dst_u, dst_v, width);
    13271717      RGB565ToYRow(src_rgb565, dst_y, width);
     
    13401730    }
    13411731    if (height & 1) {
    1342 #if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA))
     1732#if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA) || \
     1733     defined(HAS_RGB565TOYROW_MMI))
    13431734      RGB565ToUVRow(src_rgb565, 0, dst_u, dst_v, width);
    13441735      RGB565ToYRow(src_rgb565, dst_y, width);
     
    13491740#endif
    13501741    }
    1351 #if !(defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA))
     1742#if !(defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA) || \
     1743      defined(HAS_RGB565TOYROW_MMI))
    13521744    free_aligned_buffer_64(row);
    13531745#endif
     
    13691761                   int height) {
    13701762  int y;
    1371 #if (defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_MSA))
     1763#if (defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_MSA) || \
     1764     defined(HAS_ARGB1555TOYROW_MMI))
    13721765  void (*ARGB1555ToUVRow)(const uint8_t* src_argb1555, int src_stride_argb1555,
    13731766                          uint8_t* dst_u, uint8_t* dst_v, int width) =
     
    14161809    }
    14171810  }
     1811#elif defined(HAS_ARGB1555TOYROW_MMI)
     1812  if (TestCpuFlag(kCpuHasMMI)) {
     1813    ARGB1555ToUVRow = ARGB1555ToUVRow_Any_MMI;
     1814    ARGB1555ToYRow = ARGB1555ToYRow_Any_MMI;
     1815    if (IS_ALIGNED(width, 8)) {
     1816      ARGB1555ToYRow = ARGB1555ToYRow_MMI;
     1817      if (IS_ALIGNED(width, 16)) {
     1818        ARGB1555ToUVRow = ARGB1555ToUVRow_MMI;
     1819      }
     1820    }
     1821  }
    14181822// Other platforms do intermediate conversion from ARGB1555 to ARGB.
    14191823#else
     
    14561860#endif
    14571861  {
    1458 #if !(defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_MSA))
     1862#if !(defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_MSA) || \
     1863      defined(HAS_ARGB1555TOYROW_MMI))
    14591864    // Allocate 2 rows of ARGB.
    14601865    const int kRowSize = (width * 4 + 31) & ~31;
     
    14631868
    14641869    for (y = 0; y < height - 1; y += 2) {
    1465 #if (defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_MSA))
     1870#if (defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_MSA) || \
     1871     defined(HAS_ARGB1555TOYROW_MMI))
    14661872      ARGB1555ToUVRow(src_argb1555, src_stride_argb1555, dst_u, dst_v, width);
    14671873      ARGB1555ToYRow(src_argb1555, dst_y, width);
     
    14821888    }
    14831889    if (height & 1) {
    1484 #if (defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_MSA))
     1890#if (defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_MSA) || \
     1891     defined(HAS_ARGB1555TOYROW_MMI))
    14851892      ARGB1555ToUVRow(src_argb1555, 0, dst_u, dst_v, width);
    14861893      ARGB1555ToYRow(src_argb1555, dst_y, width);
     
    14911898#endif
    14921899    }
    1493 #if !(defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_MSA))
     1900#if !(defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_MSA) || \
     1901      defined(HAS_ARGB1555TOYROW_MMI))
    14941902    free_aligned_buffer_64(row);
    14951903#endif
     
    15111919                   int height) {
    15121920  int y;
    1513 #if defined(HAS_ARGB4444TOYROW_NEON)
     1921#if (defined(HAS_ARGB4444TOYROW_NEON) || defined(HAS_ARGB4444TOYROW_MMI))
    15141922  void (*ARGB4444ToUVRow)(const uint8_t* src_argb4444, int src_stride_argb4444,
    15151923                          uint8_t* dst_u, uint8_t* dst_v, int width) =
     
    15491957    }
    15501958  }
     1959#elif defined(HAS_ARGB4444TOYROW_MMI)
     1960  if (TestCpuFlag(kCpuHasMMI)) {
     1961    ARGB4444ToUVRow = ARGB4444ToUVRow_Any_MMI;
     1962    ARGB4444ToYRow = ARGB4444ToYRow_Any_MMI;
     1963    if (IS_ALIGNED(width, 8)) {
     1964      ARGB4444ToYRow = ARGB4444ToYRow_MMI;
     1965      if (IS_ALIGNED(width, 16)) {
     1966        ARGB4444ToUVRow = ARGB4444ToUVRow_MMI;
     1967      }
     1968    }
     1969  }
    15511970// Other platforms do intermediate conversion from ARGB4444 to ARGB.
    15521971#else
     
    16072026  }
    16082027#endif
     2028#if defined(HAS_ARGBTOYROW_MMI)
     2029  if (TestCpuFlag(kCpuHasMMI)) {
     2030    ARGBToUVRow = ARGBToUVRow_Any_MMI;
     2031    ARGBToYRow = ARGBToYRow_Any_MMI;
     2032    if (IS_ALIGNED(width, 8)) {
     2033      ARGBToYRow = ARGBToYRow_MMI;
     2034      if (IS_ALIGNED(width, 16)) {
     2035        ARGBToUVRow = ARGBToUVRow_MMI;
     2036      }
     2037    }
     2038  }
     2039#endif
    16092040#endif
    16102041
    16112042  {
    1612 #if !defined(HAS_ARGB4444TOYROW_NEON)
     2043#if !(defined(HAS_ARGB4444TOYROW_NEON) || defined(HAS_ARGB4444TOYROW_MMI))
    16132044    // Allocate 2 rows of ARGB.
    16142045    const int kRowSize = (width * 4 + 31) & ~31;
     
    16172048
    16182049    for (y = 0; y < height - 1; y += 2) {
    1619 #if defined(HAS_ARGB4444TOYROW_NEON)
     2050#if (defined(HAS_ARGB4444TOYROW_NEON) || defined(HAS_ARGB4444TOYROW_MMI))
    16202051      ARGB4444ToUVRow(src_argb4444, src_stride_argb4444, dst_u, dst_v, width);
    16212052      ARGB4444ToYRow(src_argb4444, dst_y, width);
     
    16362067    }
    16372068    if (height & 1) {
    1638 #if defined(HAS_ARGB4444TOYROW_NEON)
     2069#if (defined(HAS_ARGB4444TOYROW_NEON) || defined(HAS_ARGB4444TOYROW_MMI))
    16392070      ARGB4444ToUVRow(src_argb4444, 0, dst_u, dst_v, width);
    16402071      ARGB4444ToYRow(src_argb4444, dst_y, width);
     
    16452076#endif
    16462077    }
    1647 #if !defined(HAS_ARGB4444TOYROW_NEON)
     2078#if !(defined(HAS_ARGB4444TOYROW_NEON) || defined(HAS_ARGB4444TOYROW_MMI))
    16482079    free_aligned_buffer_64(row);
    16492080#endif
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/convert_argb.cc

    r235135 r239415  
    886886  }
    887887#endif
     888#if defined(HAS_ARGBATTENUATEROW_MMI)
     889  if (TestCpuFlag(kCpuHasMMI)) {
     890    ARGBAttenuateRow = ARGBAttenuateRow_Any_MMI;
     891    if (IS_ALIGNED(width, 2)) {
     892      ARGBAttenuateRow = ARGBAttenuateRow_MMI;
     893    }
     894  }
     895#endif
    888896
    889897  for (y = 0; y < height; ++y) {
     
    10051013  }
    10061014#endif
     1015#if defined(HAS_I400TOARGBROW_MMI)
     1016  if (TestCpuFlag(kCpuHasMMI)) {
     1017    I400ToARGBRow = I400ToARGBRow_Any_MMI;
     1018    if (IS_ALIGNED(width, 8)) {
     1019      I400ToARGBRow = I400ToARGBRow_MMI;
     1020    }
     1021  }
     1022#endif
    10071023
    10081024  for (y = 0; y < height; ++y) {
     
    10691085    if (IS_ALIGNED(width, 16)) {
    10701086      J400ToARGBRow = J400ToARGBRow_MSA;
     1087    }
     1088  }
     1089#endif
     1090#if defined(HAS_J400TOARGBROW_MMI)
     1091  if (TestCpuFlag(kCpuHasMMI)) {
     1092    J400ToARGBRow = J400ToARGBRow_Any_MMI;
     1093    if (IS_ALIGNED(width, 4)) {
     1094      J400ToARGBRow = J400ToARGBRow_MMI;
    10711095    }
    10721096  }
     
    12021226  }
    12031227#endif
     1228#if defined(HAS_RGB24TOARGBROW_MMI)
     1229  if (TestCpuFlag(kCpuHasMMI)) {
     1230    RGB24ToARGBRow = RGB24ToARGBRow_Any_MMI;
     1231    if (IS_ALIGNED(width, 4)) {
     1232      RGB24ToARGBRow = RGB24ToARGBRow_MMI;
     1233    }
     1234  }
     1235#endif
    12041236
    12051237  for (y = 0; y < height; ++y) {
     
    12611293  }
    12621294#endif
     1295#if defined(HAS_RAWTOARGBROW_MMI)
     1296  if (TestCpuFlag(kCpuHasMMI)) {
     1297    RAWToARGBRow = RAWToARGBRow_Any_MMI;
     1298    if (IS_ALIGNED(width, 4)) {
     1299      RAWToARGBRow = RAWToARGBRow_MMI;
     1300    }
     1301  }
     1302#endif
    12631303
    12641304  for (y = 0; y < height; ++y) {
     
    13281368  }
    13291369#endif
     1370#if defined(HAS_RGB565TOARGBROW_MMI)
     1371  if (TestCpuFlag(kCpuHasMMI)) {
     1372    RGB565ToARGBRow = RGB565ToARGBRow_Any_MMI;
     1373    if (IS_ALIGNED(width, 4)) {
     1374      RGB565ToARGBRow = RGB565ToARGBRow_MMI;
     1375    }
     1376  }
     1377#endif
    13301378
    13311379  for (y = 0; y < height; ++y) {
     
    13951443  }
    13961444#endif
     1445#if defined(HAS_ARGB1555TOARGBROW_MMI)
     1446  if (TestCpuFlag(kCpuHasMMI)) {
     1447    ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_MMI;
     1448    if (IS_ALIGNED(width, 4)) {
     1449      ARGB1555ToARGBRow = ARGB1555ToARGBRow_MMI;
     1450    }
     1451  }
     1452#endif
    13971453
    13981454  for (y = 0; y < height; ++y) {
     
    14591515    if (IS_ALIGNED(width, 16)) {
    14601516      ARGB4444ToARGBRow = ARGB4444ToARGBRow_MSA;
     1517    }
     1518  }
     1519#endif
     1520#if defined(HAS_ARGB4444TOARGBROW_MMI)
     1521  if (TestCpuFlag(kCpuHasMMI)) {
     1522    ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_MMI;
     1523    if (IS_ALIGNED(width, 4)) {
     1524      ARGB4444ToARGBRow = ARGB4444ToARGBRow_MMI;
    14611525    }
    14621526  }
     
    17901854  }
    17911855#endif
     1856#if defined(HAS_NV12TORGB24ROW_SSSE3)
     1857  if (TestCpuFlag(kCpuHasSSSE3)) {
     1858    NV12ToRGB24Row = NV12ToRGB24Row_Any_SSSE3;
     1859    if (IS_ALIGNED(width, 16)) {
     1860      NV12ToRGB24Row = NV12ToRGB24Row_SSSE3;
     1861    }
     1862  }
     1863#endif
     1864#if defined(HAS_NV12TORGB24ROW_AVX2)
     1865  if (TestCpuFlag(kCpuHasAVX2)) {
     1866    NV12ToRGB24Row = NV12ToRGB24Row_Any_AVX2;
     1867    if (IS_ALIGNED(width, 32)) {
     1868      NV12ToRGB24Row = NV12ToRGB24Row_AVX2;
     1869    }
     1870  }
     1871#endif
    17921872
    17931873  for (y = 0; y < height; ++y) {
     
    18331913  }
    18341914#endif
     1915#if defined(HAS_NV21TORGB24ROW_SSSE3)
     1916  if (TestCpuFlag(kCpuHasSSSE3)) {
     1917    NV21ToRGB24Row = NV21ToRGB24Row_Any_SSSE3;
     1918    if (IS_ALIGNED(width, 16)) {
     1919      NV21ToRGB24Row = NV21ToRGB24Row_SSSE3;
     1920    }
     1921  }
     1922#endif
     1923#if defined(HAS_NV21TORGB24ROW_AVX2)
     1924  if (TestCpuFlag(kCpuHasAVX2)) {
     1925    NV21ToRGB24Row = NV21ToRGB24Row_Any_AVX2;
     1926    if (IS_ALIGNED(width, 32)) {
     1927      NV21ToRGB24Row = NV21ToRGB24Row_AVX2;
     1928    }
     1929  }
     1930#endif
    18351931
    18361932  for (y = 0; y < height; ++y) {
     
    18451941}
    18461942
    1847 // TODO(fbarchard): \(fbarchard): NV12ToRAW can be implemented by mirrored
    1848 // matrix. Convert NV12 to RGB24.
     1943// Convert NV12 to RGB24.
    18491944LIBYUV_API
    18501945int NV12ToRGB24(const uint8_t* src_y,
     
    18741969                           dst_rgb24, dst_stride_rgb24, &kYuvI601Constants,
    18751970                           width, height);
     1971}
     1972
     1973// Convert NV12 to RAW.
     1974LIBYUV_API
     1975int NV12ToRAW(const uint8_t* src_y,
     1976              int src_stride_y,
     1977              const uint8_t* src_uv,
     1978              int src_stride_uv,
     1979              uint8_t* dst_raw,
     1980              int dst_stride_raw,
     1981              int width,
     1982              int height) {
     1983  return NV21ToRGB24Matrix(src_y, src_stride_y, src_uv, src_stride_uv, dst_raw,
     1984                           dst_stride_raw, &kYvuI601Constants, width, height);
     1985}
     1986
     1987// Convert NV21 to RAW.
     1988LIBYUV_API
     1989int NV21ToRAW(const uint8_t* src_y,
     1990              int src_stride_y,
     1991              const uint8_t* src_vu,
     1992              int src_stride_vu,
     1993              uint8_t* dst_raw,
     1994              int dst_stride_raw,
     1995              int width,
     1996              int height) {
     1997  return NV12ToRGB24Matrix(src_y, src_stride_y, src_vu, src_stride_vu, dst_raw,
     1998                           dst_stride_raw, &kYvuI601Constants, width, height);
    18761999}
    18772000
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/convert_from.cc

    r235135 r239415  
    303303  }
    304304#endif
     305#if defined(HAS_I422TOYUY2ROW_MMI)
     306  if (TestCpuFlag(kCpuHasMMI)) {
     307    I422ToYUY2Row = I422ToYUY2Row_Any_MMI;
     308    if (IS_ALIGNED(width, 8)) {
     309      I422ToYUY2Row = I422ToYUY2Row_MMI;
     310    }
     311  }
     312#endif
    305313
    306314  for (y = 0; y < height - 1; y += 2) {
     
    382390  }
    383391#endif
     392#if defined(HAS_I422TOUYVYROW_MMI)
     393  if (TestCpuFlag(kCpuHasMMI)) {
     394    I422ToUYVYRow = I422ToUYVYRow_Any_MMI;
     395    if (IS_ALIGNED(width, 8)) {
     396      I422ToUYVYRow = I422ToUYVYRow_MMI;
     397    }
     398  }
     399#endif
    384400
    385401  for (y = 0; y < height; ++y) {
     
    446462    if (IS_ALIGNED(width, 32)) {
    447463      I422ToUYVYRow = I422ToUYVYRow_MSA;
     464    }
     465  }
     466#endif
     467#if defined(HAS_I422TOUYVYROW_MMI)
     468  if (TestCpuFlag(kCpuHasMMI)) {
     469    I422ToUYVYRow = I422ToUYVYRow_Any_MMI;
     470    if (IS_ALIGNED(width, 8)) {
     471      I422ToUYVYRow = I422ToUYVYRow_MMI;
    448472    }
    449473  }
     
    907931}
    908932
     933// Convert I420 to RGB565 with specified color matrix.
     934LIBYUV_API
     935int I420ToRGB565Matrix(const uint8_t* src_y,
     936                       int src_stride_y,
     937                       const uint8_t* src_u,
     938                       int src_stride_u,
     939                       const uint8_t* src_v,
     940                       int src_stride_v,
     941                       uint8_t* dst_rgb565,
     942                       int dst_stride_rgb565,
     943                       const struct YuvConstants* yuvconstants,
     944                       int width,
     945                       int height) {
     946  int y;
     947  void (*I422ToRGB565Row)(const uint8_t* y_buf, const uint8_t* u_buf,
     948                          const uint8_t* v_buf, uint8_t* rgb_buf,
     949                          const struct YuvConstants* yuvconstants, int width) =
     950      I422ToRGB565Row_C;
     951  if (!src_y || !src_u || !src_v || !dst_rgb565 || width <= 0 || height == 0) {
     952    return -1;
     953  }
     954  // Negative height means invert the image.
     955  if (height < 0) {
     956    height = -height;
     957    dst_rgb565 = dst_rgb565 + (height - 1) * dst_stride_rgb565;
     958    dst_stride_rgb565 = -dst_stride_rgb565;
     959  }
     960#if defined(HAS_I422TORGB565ROW_SSSE3)
     961  if (TestCpuFlag(kCpuHasSSSE3)) {
     962    I422ToRGB565Row = I422ToRGB565Row_Any_SSSE3;
     963    if (IS_ALIGNED(width, 8)) {
     964      I422ToRGB565Row = I422ToRGB565Row_SSSE3;
     965    }
     966  }
     967#endif
     968#if defined(HAS_I422TORGB565ROW_AVX2)
     969  if (TestCpuFlag(kCpuHasAVX2)) {
     970    I422ToRGB565Row = I422ToRGB565Row_Any_AVX2;
     971    if (IS_ALIGNED(width, 16)) {
     972      I422ToRGB565Row = I422ToRGB565Row_AVX2;
     973    }
     974  }
     975#endif
     976#if defined(HAS_I422TORGB565ROW_NEON)
     977  if (TestCpuFlag(kCpuHasNEON)) {
     978    I422ToRGB565Row = I422ToRGB565Row_Any_NEON;
     979    if (IS_ALIGNED(width, 8)) {
     980      I422ToRGB565Row = I422ToRGB565Row_NEON;
     981    }
     982  }
     983#endif
     984#if defined(HAS_I422TORGB565ROW_MSA)
     985  if (TestCpuFlag(kCpuHasMSA)) {
     986    I422ToRGB565Row = I422ToRGB565Row_Any_MSA;
     987    if (IS_ALIGNED(width, 8)) {
     988      I422ToRGB565Row = I422ToRGB565Row_MSA;
     989    }
     990  }
     991#endif
     992
     993  for (y = 0; y < height; ++y) {
     994    I422ToRGB565Row(src_y, src_u, src_v, dst_rgb565, yuvconstants, width);
     995    dst_rgb565 += dst_stride_rgb565;
     996    src_y += src_stride_y;
     997    if (y & 1) {
     998      src_u += src_stride_u;
     999      src_v += src_stride_v;
     1000    }
     1001  }
     1002  return 0;
     1003}
     1004
    9091005// Convert I420 to RGB565.
    9101006LIBYUV_API
     
    9191015                 int width,
    9201016                 int height) {
    921   int y;
    922   void (*I422ToRGB565Row)(const uint8_t* y_buf, const uint8_t* u_buf,
    923                           const uint8_t* v_buf, uint8_t* rgb_buf,
    924                           const struct YuvConstants* yuvconstants, int width) =
    925       I422ToRGB565Row_C;
    926   if (!src_y || !src_u || !src_v || !dst_rgb565 || width <= 0 || height == 0) {
    927     return -1;
    928   }
    929   // Negative height means invert the image.
    930   if (height < 0) {
    931     height = -height;
    932     dst_rgb565 = dst_rgb565 + (height - 1) * dst_stride_rgb565;
    933     dst_stride_rgb565 = -dst_stride_rgb565;
    934   }
    935 #if defined(HAS_I422TORGB565ROW_SSSE3)
    936   if (TestCpuFlag(kCpuHasSSSE3)) {
    937     I422ToRGB565Row = I422ToRGB565Row_Any_SSSE3;
    938     if (IS_ALIGNED(width, 8)) {
    939       I422ToRGB565Row = I422ToRGB565Row_SSSE3;
    940     }
    941   }
    942 #endif
    943 #if defined(HAS_I422TORGB565ROW_AVX2)
    944   if (TestCpuFlag(kCpuHasAVX2)) {
    945     I422ToRGB565Row = I422ToRGB565Row_Any_AVX2;
    946     if (IS_ALIGNED(width, 16)) {
    947       I422ToRGB565Row = I422ToRGB565Row_AVX2;
    948     }
    949   }
    950 #endif
    951 #if defined(HAS_I422TORGB565ROW_NEON)
    952   if (TestCpuFlag(kCpuHasNEON)) {
    953     I422ToRGB565Row = I422ToRGB565Row_Any_NEON;
    954     if (IS_ALIGNED(width, 8)) {
    955       I422ToRGB565Row = I422ToRGB565Row_NEON;
    956     }
    957   }
    958 #endif
    959 #if defined(HAS_I422TORGB565ROW_MSA)
    960   if (TestCpuFlag(kCpuHasMSA)) {
    961     I422ToRGB565Row = I422ToRGB565Row_Any_MSA;
    962     if (IS_ALIGNED(width, 8)) {
    963       I422ToRGB565Row = I422ToRGB565Row_MSA;
    964     }
    965   }
    966 #endif
    967 
    968   for (y = 0; y < height; ++y) {
    969     I422ToRGB565Row(src_y, src_u, src_v, dst_rgb565, &kYuvI601Constants, width);
    970     dst_rgb565 += dst_stride_rgb565;
    971     src_y += src_stride_y;
    972     if (y & 1) {
    973       src_u += src_stride_u;
    974       src_v += src_stride_v;
    975     }
    976   }
    977   return 0;
     1017  return I420ToRGB565Matrix(src_y, src_stride_y, src_u, src_stride_u, src_v,
     1018                            src_stride_v, dst_rgb565, dst_stride_rgb565,
     1019                            &kYuvI601Constants, width, height);
     1020}
     1021
     1022// Convert J420 to RGB565.
     1023LIBYUV_API
     1024int J420ToRGB565(const uint8_t* src_y,
     1025                 int src_stride_y,
     1026                 const uint8_t* src_u,
     1027                 int src_stride_u,
     1028                 const uint8_t* src_v,
     1029                 int src_stride_v,
     1030                 uint8_t* dst_rgb565,
     1031                 int dst_stride_rgb565,
     1032                 int width,
     1033                 int height) {
     1034  return I420ToRGB565Matrix(src_y, src_stride_y, src_u, src_stride_u, src_v,
     1035                            src_stride_v, dst_rgb565, dst_stride_rgb565,
     1036                            &kYuvJPEGConstants, width, height);
     1037}
     1038
     1039// Convert H420 to RGB565.
     1040LIBYUV_API
     1041int H420ToRGB565(const uint8_t* src_y,
     1042                 int src_stride_y,
     1043                 const uint8_t* src_u,
     1044                 int src_stride_u,
     1045                 const uint8_t* src_v,
     1046                 int src_stride_v,
     1047                 uint8_t* dst_rgb565,
     1048                 int dst_stride_rgb565,
     1049                 int width,
     1050                 int height) {
     1051  return I420ToRGB565Matrix(src_y, src_stride_y, src_u, src_stride_u, src_v,
     1052                            src_stride_v, dst_rgb565, dst_stride_rgb565,
     1053                            &kYuvH709Constants, width, height);
    9781054}
    9791055
     
    11551231      I422ToARGBRow(src_y, src_u, src_v, row_argb, &kYuvI601Constants, width);
    11561232      ARGBToRGB565DitherRow(row_argb, dst_rgb565,
    1157                             *(uint32_t*)(dither4x4 + ((y & 3) << 2)),  // NOLINT
    1158                             width);                                    // NOLINT
     1233                            *(const uint32_t*)(dither4x4 + ((y & 3) << 2)),
     1234                            width);
    11591235      dst_rgb565 += dst_stride_rgb565;
    11601236      src_y += src_stride_y;
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/convert_from_argb.cc

    r235135 r239415  
    7777  }
    7878#endif
     79#if defined(HAS_ARGBTOUV444ROW_MMI)
     80  if (TestCpuFlag(kCpuHasMMI)) {
     81    ARGBToUV444Row = ARGBToUV444Row_Any_MMI;
     82    if (IS_ALIGNED(width, 8)) {
     83      ARGBToUV444Row = ARGBToUV444Row_MMI;
     84    }
     85  }
     86#endif
    7987#if defined(HAS_ARGBTOYROW_SSSE3)
    8088  if (TestCpuFlag(kCpuHasSSSE3)) {
     
    106114    if (IS_ALIGNED(width, 16)) {
    107115      ARGBToYRow = ARGBToYRow_MSA;
     116    }
     117  }
     118#endif
     119#if defined(HAS_ARGBTOYROW_MMI)
     120  if (TestCpuFlag(kCpuHasMMI)) {
     121    ARGBToYRow = ARGBToYRow_Any_MMI;
     122    if (IS_ALIGNED(width, 8)) {
     123      ARGBToYRow = ARGBToYRow_MMI;
    108124    }
    109125  }
     
    209225#endif
    210226
     227#if defined(HAS_ARGBTOYROW_MMI)
     228  if (TestCpuFlag(kCpuHasMMI)) {
     229    ARGBToYRow = ARGBToYRow_Any_MMI;
     230    if (IS_ALIGNED(width, 8)) {
     231      ARGBToYRow = ARGBToYRow_MMI;
     232    }
     233  }
     234#endif
     235#if defined(HAS_ARGBTOUVROW_MMI)
     236  if (TestCpuFlag(kCpuHasMMI)) {
     237    ARGBToUVRow = ARGBToUVRow_Any_MMI;
     238    if (IS_ALIGNED(width, 16)) {
     239      ARGBToUVRow = ARGBToUVRow_MMI;
     240    }
     241  }
     242#endif
     243
    211244  for (y = 0; y < height; ++y) {
    212245    ARGBToUVRow(src_argb, 0, dst_u, dst_v, width);
     
    299332  }
    300333#endif
     334#if defined(HAS_ARGBTOYROW_MMI)
     335  if (TestCpuFlag(kCpuHasMMI)) {
     336    ARGBToYRow = ARGBToYRow_Any_MMI;
     337    if (IS_ALIGNED(width, 8)) {
     338      ARGBToYRow = ARGBToYRow_MMI;
     339    }
     340  }
     341#endif
     342#if defined(HAS_ARGBTOUVROW_MMI)
     343  if (TestCpuFlag(kCpuHasMMI)) {
     344    ARGBToUVRow = ARGBToUVRow_Any_MMI;
     345    if (IS_ALIGNED(width, 16)) {
     346      ARGBToUVRow = ARGBToUVRow_MMI;
     347    }
     348  }
     349#endif
    301350#if defined(HAS_MERGEUVROW_SSE2)
    302351  if (TestCpuFlag(kCpuHasSSE2)) {
     
    328377    if (IS_ALIGNED(halfwidth, 16)) {
    329378      MergeUVRow_ = MergeUVRow_MSA;
     379    }
     380  }
     381#endif
     382#if defined(HAS_MERGEUVROW_MMI)
     383  if (TestCpuFlag(kCpuHasMMI)) {
     384    MergeUVRow_ = MergeUVRow_Any_MMI;
     385    if (IS_ALIGNED(halfwidth, 8)) {
     386      MergeUVRow_ = MergeUVRow_MMI;
    330387    }
    331388  }
     
    435492  }
    436493#endif
     494#if defined(HAS_ARGBTOYROW_MMI)
     495  if (TestCpuFlag(kCpuHasMMI)) {
     496    ARGBToYRow = ARGBToYRow_Any_MMI;
     497    if (IS_ALIGNED(width, 8)) {
     498      ARGBToYRow = ARGBToYRow_MMI;
     499    }
     500  }
     501#endif
     502#if defined(HAS_ARGBTOUVROW_MMI)
     503  if (TestCpuFlag(kCpuHasMMI)) {
     504    ARGBToUVRow = ARGBToUVRow_Any_MMI;
     505    if (IS_ALIGNED(width, 16)) {
     506      ARGBToUVRow = ARGBToUVRow_MMI;
     507    }
     508  }
     509#endif
     510
    437511#if defined(HAS_MERGEUVROW_SSE2)
    438512  if (TestCpuFlag(kCpuHasSSE2)) {
     
    464538    if (IS_ALIGNED(halfwidth, 16)) {
    465539      MergeUVRow_ = MergeUVRow_MSA;
     540    }
     541  }
     542#endif
     543#if defined(HAS_MERGEUVROW_MMI)
     544  if (TestCpuFlag(kCpuHasMMI)) {
     545    MergeUVRow_ = MergeUVRow_Any_MMI;
     546    if (IS_ALIGNED(halfwidth, 8)) {
     547      MergeUVRow_ = MergeUVRow_MMI;
    466548    }
    467549  }
     
    576658  }
    577659#endif
     660#if defined(HAS_ARGBTOYROW_MMI)
     661  if (TestCpuFlag(kCpuHasMMI)) {
     662    ARGBToYRow = ARGBToYRow_Any_MMI;
     663    if (IS_ALIGNED(width, 8)) {
     664      ARGBToYRow = ARGBToYRow_MMI;
     665    }
     666  }
     667#endif
     668#if defined(HAS_ARGBTOUVROW_MMI)
     669  if (TestCpuFlag(kCpuHasMMI)) {
     670    ARGBToUVRow = ARGBToUVRow_Any_MMI;
     671    if (IS_ALIGNED(width, 16)) {
     672      ARGBToUVRow = ARGBToUVRow_MMI;
     673    }
     674  }
     675#endif
    578676#if defined(HAS_I422TOYUY2ROW_SSE2)
    579677  if (TestCpuFlag(kCpuHasSSE2)) {
     
    605703    if (IS_ALIGNED(width, 32)) {
    606704      I422ToYUY2Row = I422ToYUY2Row_MSA;
     705    }
     706  }
     707#endif
     708#if defined(HAS_I422TOYUY2ROW_MMI)
     709  if (TestCpuFlag(kCpuHasMMI)) {
     710    I422ToYUY2Row = I422ToYUY2Row_Any_MMI;
     711    if (IS_ALIGNED(width, 8)) {
     712      I422ToYUY2Row = I422ToYUY2Row_MMI;
    607713    }
    608714  }
     
    713819  }
    714820#endif
     821#if defined(HAS_ARGBTOYROW_MMI)
     822  if (TestCpuFlag(kCpuHasMMI)) {
     823    ARGBToYRow = ARGBToYRow_Any_MMI;
     824    if (IS_ALIGNED(width, 8)) {
     825      ARGBToYRow = ARGBToYRow_MMI;
     826    }
     827  }
     828#endif
     829#if defined(HAS_ARGBTOUVROW_MMI)
     830  if (TestCpuFlag(kCpuHasMMI)) {
     831    ARGBToUVRow = ARGBToUVRow_Any_MMI;
     832    if (IS_ALIGNED(width, 16)) {
     833      ARGBToUVRow = ARGBToUVRow_MMI;
     834    }
     835  }
     836#endif
    715837#if defined(HAS_I422TOUYVYROW_SSE2)
    716838  if (TestCpuFlag(kCpuHasSSE2)) {
     
    742864    if (IS_ALIGNED(width, 32)) {
    743865      I422ToUYVYRow = I422ToUYVYRow_MSA;
     866    }
     867  }
     868#endif
     869#if defined(HAS_I422TOUYVYROW_MMI)
     870  if (TestCpuFlag(kCpuHasMMI)) {
     871    I422ToUYVYRow = I422ToUYVYRow_Any_MMI;
     872    if (IS_ALIGNED(width, 8)) {
     873      I422ToUYVYRow = I422ToUYVYRow_MMI;
    744874    }
    745875  }
     
    822952  }
    823953#endif
     954#if defined(HAS_ARGBTOYROW_MMI)
     955  if (TestCpuFlag(kCpuHasMMI)) {
     956    ARGBToYRow = ARGBToYRow_Any_MMI;
     957    if (IS_ALIGNED(width, 8)) {
     958      ARGBToYRow = ARGBToYRow_MMI;
     959    }
     960  }
     961#endif
    824962
    825963  for (y = 0; y < height; ++y) {
     
    8801018  }
    8811019#endif
     1020#if defined(HAS_ARGBTORGB24ROW_AVX2)
     1021  if (TestCpuFlag(kCpuHasAVX2)) {
     1022    ARGBToRGB24Row = ARGBToRGB24Row_Any_AVX2;
     1023    if (IS_ALIGNED(width, 32)) {
     1024      ARGBToRGB24Row = ARGBToRGB24Row_AVX2;
     1025    }
     1026  }
     1027#endif
     1028#if defined(HAS_ARGBTORGB24ROW_AVX512VBMI)
     1029  if (TestCpuFlag(kCpuHasAVX512VBMI)) {
     1030    ARGBToRGB24Row = ARGBToRGB24Row_Any_AVX512VBMI;
     1031    if (IS_ALIGNED(width, 32)) {
     1032      ARGBToRGB24Row = ARGBToRGB24Row_AVX512VBMI;
     1033    }
     1034  }
     1035#endif
    8821036#if defined(HAS_ARGBTORGB24ROW_NEON)
    8831037  if (TestCpuFlag(kCpuHasNEON)) {
     
    8931047    if (IS_ALIGNED(width, 16)) {
    8941048      ARGBToRGB24Row = ARGBToRGB24Row_MSA;
     1049    }
     1050  }
     1051#endif
     1052#if defined(HAS_ARGBTORGB24ROW_MMI)
     1053  if (TestCpuFlag(kCpuHasMMI)) {
     1054    ARGBToRGB24Row = ARGBToRGB24Row_Any_MMI;
     1055    if (IS_ALIGNED(width, 4)) {
     1056      ARGBToRGB24Row = ARGBToRGB24Row_MMI;
    8951057    }
    8961058  }
     
    9381100  }
    9391101#endif
     1102#if defined(HAS_ARGBTORAWROW_AVX2)
     1103  if (TestCpuFlag(kCpuHasAVX2)) {
     1104    ARGBToRAWRow = ARGBToRAWRow_Any_AVX2;
     1105    if (IS_ALIGNED(width, 32)) {
     1106      ARGBToRAWRow = ARGBToRAWRow_AVX2;
     1107    }
     1108  }
     1109#endif
    9401110#if defined(HAS_ARGBTORAWROW_NEON)
    9411111  if (TestCpuFlag(kCpuHasNEON)) {
     
    9511121    if (IS_ALIGNED(width, 16)) {
    9521122      ARGBToRAWRow = ARGBToRAWRow_MSA;
     1123    }
     1124  }
     1125#endif
     1126#if defined(HAS_ARGBTORAWROW_MMI)
     1127  if (TestCpuFlag(kCpuHasMMI)) {
     1128    ARGBToRAWRow = ARGBToRAWRow_Any_MMI;
     1129    if (IS_ALIGNED(width, 4)) {
     1130      ARGBToRAWRow = ARGBToRAWRow_MMI;
    9531131    }
    9541132  }
     
    10241202  }
    10251203#endif
     1204#if defined(HAS_ARGBTORGB565DITHERROW_MMI)
     1205  if (TestCpuFlag(kCpuHasMMI)) {
     1206    ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_MMI;
     1207    if (IS_ALIGNED(width, 4)) {
     1208      ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_MMI;
     1209    }
     1210  }
     1211#endif
    10261212
    10271213  for (y = 0; y < height; ++y) {
    10281214    ARGBToRGB565DitherRow(src_argb, dst_rgb565,
    1029                           *(uint32_t*)(dither4x4 + ((y & 3) << 2)),  // NOLINT
    1030                           width); /* NOLINT */
     1215                          *(const uint32_t*)(dither4x4 + ((y & 3) << 2)),
     1216                          width);
    10311217    src_argb += src_stride_argb;
    10321218    dst_rgb565 += dst_stride_rgb565;
     
    10931279  }
    10941280#endif
     1281#if defined(HAS_ARGBTORGB565ROW_MMI)
     1282  if (TestCpuFlag(kCpuHasMMI)) {
     1283    ARGBToRGB565Row = ARGBToRGB565Row_Any_MMI;
     1284    if (IS_ALIGNED(width, 4)) {
     1285      ARGBToRGB565Row = ARGBToRGB565Row_MMI;
     1286    }
     1287  }
     1288#endif
    10951289
    10961290  for (y = 0; y < height; ++y) {
     
    11591353  }
    11601354#endif
     1355#if defined(HAS_ARGBTOARGB1555ROW_MMI)
     1356  if (TestCpuFlag(kCpuHasMMI)) {
     1357    ARGBToARGB1555Row = ARGBToARGB1555Row_Any_MMI;
     1358    if (IS_ALIGNED(width, 4)) {
     1359      ARGBToARGB1555Row = ARGBToARGB1555Row_MMI;
     1360    }
     1361  }
     1362#endif
    11611363
    11621364  for (y = 0; y < height; ++y) {
     
    12221424    if (IS_ALIGNED(width, 8)) {
    12231425      ARGBToARGB4444Row = ARGBToARGB4444Row_MSA;
     1426    }
     1427  }
     1428#endif
     1429#if defined(HAS_ARGBTOARGB4444ROW_MMI)
     1430  if (TestCpuFlag(kCpuHasMMI)) {
     1431    ARGBToARGB4444Row = ARGBToARGB4444Row_Any_MMI;
     1432    if (IS_ALIGNED(width, 4)) {
     1433      ARGBToARGB4444Row = ARGBToARGB4444Row_MMI;
    12241434    }
    12251435  }
     
    14011611  }
    14021612#endif
     1613#if defined(HAS_ARGBTOYJROW_MMI)
     1614  if (TestCpuFlag(kCpuHasMMI)) {
     1615    ARGBToYJRow = ARGBToYJRow_Any_MMI;
     1616    if (IS_ALIGNED(width, 8)) {
     1617      ARGBToYJRow = ARGBToYJRow_MMI;
     1618    }
     1619  }
     1620#endif
    14031621#if defined(HAS_ARGBTOUVJROW_MSA)
    14041622  if (TestCpuFlag(kCpuHasMSA)) {
     
    14061624    if (IS_ALIGNED(width, 32)) {
    14071625      ARGBToUVJRow = ARGBToUVJRow_MSA;
     1626    }
     1627  }
     1628#endif
     1629#if defined(HAS_ARGBTOUVJROW_MMI)
     1630  if (TestCpuFlag(kCpuHasMMI)) {
     1631    ARGBToUVJRow = ARGBToUVJRow_Any_MMI;
     1632    if (IS_ALIGNED(width, 16)) {
     1633      ARGBToUVJRow = ARGBToUVJRow_MMI;
    14081634    }
    14091635  }
     
    15021728  }
    15031729#endif
     1730#if defined(HAS_ARGBTOYJROW_MMI)
     1731  if (TestCpuFlag(kCpuHasMMI)) {
     1732    ARGBToYJRow = ARGBToYJRow_Any_MMI;
     1733    if (IS_ALIGNED(width, 8)) {
     1734      ARGBToYJRow = ARGBToYJRow_MMI;
     1735    }
     1736  }
     1737#endif
    15041738#if defined(HAS_ARGBTOUVJROW_MSA)
    15051739  if (TestCpuFlag(kCpuHasMSA)) {
     
    15071741    if (IS_ALIGNED(width, 32)) {
    15081742      ARGBToUVJRow = ARGBToUVJRow_MSA;
     1743    }
     1744  }
     1745#endif
     1746#if defined(HAS_ARGBTOUVJROW_MMI)
     1747  if (TestCpuFlag(kCpuHasMMI)) {
     1748    ARGBToUVJRow = ARGBToUVJRow_Any_MMI;
     1749    if (IS_ALIGNED(width, 16)) {
     1750      ARGBToUVJRow = ARGBToUVJRow_MMI;
    15091751    }
    15101752  }
     
    15791821  }
    15801822#endif
     1823#if defined(HAS_ARGBTOYJROW_MMI)
     1824  if (TestCpuFlag(kCpuHasMMI)) {
     1825    ARGBToYJRow = ARGBToYJRow_Any_MMI;
     1826    if (IS_ALIGNED(width, 8)) {
     1827      ARGBToYJRow = ARGBToYJRow_MMI;
     1828    }
     1829  }
     1830#endif
    15811831
    15821832  for (y = 0; y < height; ++y) {
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/convert_jpeg.cc

    r235135 r239415  
    191191}
    192192
    193 #ifdef HAVE_JPEG
     193struct NV21Buffers {
     194  uint8_t* y;
     195  int y_stride;
     196  uint8_t* vu;
     197  int vu_stride;
     198  int w;
     199  int h;
     200};
     201
     202static void JpegI420ToNV21(void* opaque,
     203                           const uint8_t* const* data,
     204                           const int* strides,
     205                           int rows) {
     206  NV21Buffers* dest = (NV21Buffers*)(opaque);
     207  I420ToNV21(data[0], strides[0], data[1], strides[1], data[2], strides[2],
     208             dest->y, dest->y_stride, dest->vu, dest->vu_stride, dest->w, rows);
     209  dest->y += rows * dest->y_stride;
     210  dest->vu += ((rows + 1) >> 1) * dest->vu_stride;
     211  dest->h -= rows;
     212}
     213
     214static void JpegI422ToNV21(void* opaque,
     215                           const uint8_t* const* data,
     216                           const int* strides,
     217                           int rows) {
     218  NV21Buffers* dest = (NV21Buffers*)(opaque);
     219  I422ToNV21(data[0], strides[0], data[1], strides[1], data[2], strides[2],
     220             dest->y, dest->y_stride, dest->vu, dest->vu_stride, dest->w, rows);
     221  dest->y += rows * dest->y_stride;
     222  dest->vu += ((rows + 1) >> 1) * dest->vu_stride;
     223  dest->h -= rows;
     224}
     225
     226static void JpegI444ToNV21(void* opaque,
     227                           const uint8_t* const* data,
     228                           const int* strides,
     229                           int rows) {
     230  NV21Buffers* dest = (NV21Buffers*)(opaque);
     231  I444ToNV21(data[0], strides[0], data[1], strides[1], data[2], strides[2],
     232             dest->y, dest->y_stride, dest->vu, dest->vu_stride, dest->w, rows);
     233  dest->y += rows * dest->y_stride;
     234  dest->vu += ((rows + 1) >> 1) * dest->vu_stride;
     235  dest->h -= rows;
     236}
     237
     238static void JpegI400ToNV21(void* opaque,
     239                           const uint8_t* const* data,
     240                           const int* strides,
     241                           int rows) {
     242  NV21Buffers* dest = (NV21Buffers*)(opaque);
     243  I400ToNV21(data[0], strides[0], dest->y, dest->y_stride, dest->vu,
     244             dest->vu_stride, dest->w, rows);
     245  dest->y += rows * dest->y_stride;
     246  dest->vu += ((rows + 1) >> 1) * dest->vu_stride;
     247  dest->h -= rows;
     248}
     249
     250// MJPG (Motion JPeg) to NV21
     251LIBYUV_API
     252int MJPGToNV21(const uint8_t* sample,
     253               size_t sample_size,
     254               uint8_t* dst_y,
     255               int dst_stride_y,
     256               uint8_t* dst_vu,
     257               int dst_stride_vu,
     258               int src_width,
     259               int src_height,
     260               int dst_width,
     261               int dst_height) {
     262  if (sample_size == kUnknownDataSize) {
     263    // ERROR: MJPEG frame size unknown
     264    return -1;
     265  }
     266
     267  // TODO(fbarchard): Port MJpeg to C.
     268  MJpegDecoder mjpeg_decoder;
     269  LIBYUV_BOOL ret = mjpeg_decoder.LoadFrame(sample, sample_size);
     270  if (ret && (mjpeg_decoder.GetWidth() != src_width ||
     271              mjpeg_decoder.GetHeight() != src_height)) {
     272    // ERROR: MJPEG frame has unexpected dimensions
     273    mjpeg_decoder.UnloadFrame();
     274    return 1;  // runtime failure
     275  }
     276  if (ret) {
     277    NV21Buffers bufs = {dst_y,         dst_stride_y, dst_vu,
     278                        dst_stride_vu, dst_width,    dst_height};
     279    // YUV420
     280    if (mjpeg_decoder.GetColorSpace() == MJpegDecoder::kColorSpaceYCbCr &&
     281        mjpeg_decoder.GetNumComponents() == 3 &&
     282        mjpeg_decoder.GetVertSampFactor(0) == 2 &&
     283        mjpeg_decoder.GetHorizSampFactor(0) == 2 &&
     284        mjpeg_decoder.GetVertSampFactor(1) == 1 &&
     285        mjpeg_decoder.GetHorizSampFactor(1) == 1 &&
     286        mjpeg_decoder.GetVertSampFactor(2) == 1 &&
     287        mjpeg_decoder.GetHorizSampFactor(2) == 1) {
     288      ret = mjpeg_decoder.DecodeToCallback(&JpegI420ToNV21, &bufs, dst_width,
     289                                           dst_height);
     290      // YUV422
     291    } else if (mjpeg_decoder.GetColorSpace() ==
     292                   MJpegDecoder::kColorSpaceYCbCr &&
     293               mjpeg_decoder.GetNumComponents() == 3 &&
     294               mjpeg_decoder.GetVertSampFactor(0) == 1 &&
     295               mjpeg_decoder.GetHorizSampFactor(0) == 2 &&
     296               mjpeg_decoder.GetVertSampFactor(1) == 1 &&
     297               mjpeg_decoder.GetHorizSampFactor(1) == 1 &&
     298               mjpeg_decoder.GetVertSampFactor(2) == 1 &&
     299               mjpeg_decoder.GetHorizSampFactor(2) == 1) {
     300      ret = mjpeg_decoder.DecodeToCallback(&JpegI422ToNV21, &bufs, dst_width,
     301                                           dst_height);
     302      // YUV444
     303    } else if (mjpeg_decoder.GetColorSpace() ==
     304                   MJpegDecoder::kColorSpaceYCbCr &&
     305               mjpeg_decoder.GetNumComponents() == 3 &&
     306               mjpeg_decoder.GetVertSampFactor(0) == 1 &&
     307               mjpeg_decoder.GetHorizSampFactor(0) == 1 &&
     308               mjpeg_decoder.GetVertSampFactor(1) == 1 &&
     309               mjpeg_decoder.GetHorizSampFactor(1) == 1 &&
     310               mjpeg_decoder.GetVertSampFactor(2) == 1 &&
     311               mjpeg_decoder.GetHorizSampFactor(2) == 1) {
     312      ret = mjpeg_decoder.DecodeToCallback(&JpegI444ToNV21, &bufs, dst_width,
     313                                           dst_height);
     314      // YUV400
     315    } else if (mjpeg_decoder.GetColorSpace() ==
     316                   MJpegDecoder::kColorSpaceGrayscale &&
     317               mjpeg_decoder.GetNumComponents() == 1 &&
     318               mjpeg_decoder.GetVertSampFactor(0) == 1 &&
     319               mjpeg_decoder.GetHorizSampFactor(0) == 1) {
     320      ret = mjpeg_decoder.DecodeToCallback(&JpegI400ToNV21, &bufs, dst_width,
     321                                           dst_height);
     322    } else {
     323      // Unknown colorspace.
     324      mjpeg_decoder.UnloadFrame();
     325      return 1;
     326    }
     327  }
     328  return ret ? 0 : 1;
     329}
     330
    194331struct ARGBBuffers {
    195332  uint8_t* argb;
     
    323460  return ret ? 0 : 1;
    324461}
    325 #endif
    326 
    327 #endif
     462
     463#endif  // HAVE_JPEG
    328464
    329465#ifdef __cplusplus
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/convert_to_argb.cc

    r235135 r239415  
    2929// sample_size is measured in bytes and is the size of the frame.
    3030//   With MJPEG it is the compressed size of the frame.
     31
     32// TODO(fbarchard): Add the following:
     33// H010ToARGB
     34// I010ToARGB
     35// J400ToARGB
     36// J422ToARGB
     37// J444ToARGB
     38
    3139LIBYUV_API
    3240int ConvertToARGB(const uint8_t* sample,
     
    124132                     inv_crop_height);
    125133      break;
     134    case FOURCC_AR30:
     135      src = sample + (src_width * crop_y + crop_x) * 4;
     136      r = AR30ToARGB(src, src_width * 4, dst_argb, dst_stride_argb, crop_width,
     137                     inv_crop_height);
     138      break;
     139    case FOURCC_AB30:
     140      src = sample + (src_width * crop_y + crop_x) * 4;
     141      r = AB30ToARGB(src, src_width * 4, dst_argb, dst_stride_argb, crop_width,
     142                     inv_crop_height);
     143      break;
    126144    case FOURCC_RGBP:
    127145      src = sample + (src_width * crop_y + crop_x) * 2;
     
    148166    case FOURCC_NV12:
    149167      src = sample + (src_width * crop_y + crop_x);
    150       src_uv = sample + aligned_src_width * (src_height + crop_y / 2) + crop_x;
     168      src_uv =
     169          sample + aligned_src_width * (abs_src_height + crop_y / 2) + crop_x;
    151170      r = NV12ToARGB(src, src_width, src_uv, aligned_src_width, dst_argb,
    152171                     dst_stride_argb, crop_width, inv_crop_height);
     
    154173    case FOURCC_NV21:
    155174      src = sample + (src_width * crop_y + crop_x);
    156       src_uv = sample + aligned_src_width * (src_height + crop_y / 2) + crop_x;
     175      src_uv =
     176          sample + aligned_src_width * (abs_src_height + crop_y / 2) + crop_x;
    157177      // Call NV12 but with u and v parameters swapped.
    158178      r = NV21ToARGB(src, src_width, src_uv, aligned_src_width, dst_argb,
     
    164184                     inv_crop_height);
    165185      break;
     186
    166187    // Triplanar formats
    167188    case FOURCC_I420:
     
    188209    }
    189210
     211    case FOURCC_H420: {
     212      int halfwidth = (src_width + 1) / 2;
     213      int halfheight = (abs_src_height + 1) / 2;
     214      const uint8_t* src_y = sample + (src_width * crop_y + crop_x);
     215      const uint8_t* src_u = sample + src_width * abs_src_height +
     216                             (halfwidth * crop_y + crop_x) / 2;
     217      const uint8_t* src_v = sample + src_width * abs_src_height +
     218                             halfwidth * (halfheight + crop_y / 2) + crop_x / 2;
     219      r = H420ToARGB(src_y, src_width, src_u, halfwidth, src_v, halfwidth,
     220                     dst_argb, dst_stride_argb, crop_width, inv_crop_height);
     221      break;
     222    }
     223
    190224    case FOURCC_J420: {
     225      int halfwidth = (src_width + 1) / 2;
     226      int halfheight = (abs_src_height + 1) / 2;
    191227      const uint8_t* src_y = sample + (src_width * crop_y + crop_x);
    192       const uint8_t* src_u;
    193       const uint8_t* src_v;
    194       int halfwidth = (src_width + 1) / 2;
    195       int halfheight = (abs_src_height + 1) / 2;
    196       src_u = sample + src_width * abs_src_height +
    197               (halfwidth * crop_y + crop_x) / 2;
    198       src_v = sample + src_width * abs_src_height +
    199               halfwidth * (halfheight + crop_y / 2) + crop_x / 2;
     228      const uint8_t* src_u = sample + src_width * abs_src_height +
     229                             (halfwidth * crop_y + crop_x) / 2;
     230      const uint8_t* src_v = sample + src_width * abs_src_height +
     231                             halfwidth * (halfheight + crop_y / 2) + crop_x / 2;
    200232      r = J420ToARGB(src_y, src_width, src_u, halfwidth, src_v, halfwidth,
    201233                     dst_argb, dst_stride_argb, crop_width, inv_crop_height);
     
    205237    case FOURCC_I422:
    206238    case FOURCC_YV16: {
     239      int halfwidth = (src_width + 1) / 2;
    207240      const uint8_t* src_y = sample + src_width * crop_y + crop_x;
    208241      const uint8_t* src_u;
    209242      const uint8_t* src_v;
    210       int halfwidth = (src_width + 1) / 2;
    211243      if (format == FOURCC_YV16) {
    212244        src_v = sample + src_width * abs_src_height + halfwidth * crop_y +
     
    224256      break;
    225257    }
     258
     259    case FOURCC_H422: {
     260      int halfwidth = (src_width + 1) / 2;
     261      const uint8_t* src_y = sample + src_width * crop_y + crop_x;
     262      const uint8_t* src_u =
     263          sample + src_width * abs_src_height + halfwidth * crop_y + crop_x / 2;
     264      const uint8_t* src_v = sample + src_width * abs_src_height +
     265                             halfwidth * (abs_src_height + crop_y) + crop_x / 2;
     266      r = H422ToARGB(src_y, src_width, src_u, halfwidth, src_v, halfwidth,
     267                     dst_argb, dst_stride_argb, crop_width, inv_crop_height);
     268      break;
     269    }
     270
    226271    case FOURCC_I444:
    227272    case FOURCC_YV24: {
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/convert_to_i420.cc

    r235135 r239415  
    156156                     inv_crop_height);
    157157      break;
     158    // TODO(fbarchard): Add AR30 and AB30
    158159    case FOURCC_I400:
    159160      src = sample + src_width * crop_y + crop_x;
     
    164165    case FOURCC_NV12:
    165166      src = sample + (src_width * crop_y + crop_x);
    166       src_uv = sample + (src_width * src_height) +
     167      src_uv = sample + (src_width * abs_src_height) +
    167168               ((crop_y / 2) * aligned_src_width) + ((crop_x / 2) * 2);
    168169      r = NV12ToI420Rotate(src, src_width, src_uv, aligned_src_width, dst_y,
     
    172173    case FOURCC_NV21:
    173174      src = sample + (src_width * crop_y + crop_x);
    174       src_uv = sample + (src_width * src_height) +
     175      src_uv = sample + (src_width * abs_src_height) +
    175176               ((crop_y / 2) * aligned_src_width) + ((crop_x / 2) * 2);
    176177      // Call NV12 but with dst_u and dst_v parameters swapped.
     
    193194      int halfheight = (abs_src_height + 1) / 2;
    194195      if (format == FOURCC_YV12) {
     196        src_v = sample + src_width * abs_src_height + halfwidth * (crop_y / 2) +
     197                (crop_x / 2);
     198        src_u = sample + src_width * abs_src_height +
     199                halfwidth * (halfheight + (crop_y / 2)) + (crop_x / 2);
     200      } else {
     201        src_u = sample + src_width * abs_src_height + halfwidth * (crop_y / 2) +
     202                (crop_x / 2);
    195203        src_v = sample + src_width * abs_src_height +
    196                 (halfwidth * crop_y + crop_x) / 2;
    197         src_u = sample + src_width * abs_src_height +
    198                 halfwidth * (halfheight + crop_y / 2) + crop_x / 2;
    199       } else {
    200         src_u = sample + src_width * abs_src_height +
    201                 (halfwidth * crop_y + crop_x) / 2;
    202         src_v = sample + src_width * abs_src_height +
    203                 halfwidth * (halfheight + crop_y / 2) + crop_x / 2;
     204                halfwidth * (halfheight + (crop_y / 2)) + (crop_x / 2);
    204205      }
    205206      r = I420Rotate(src_y, src_width, src_u, halfwidth, src_v, halfwidth,
     
    216217      if (format == FOURCC_YV16) {
    217218        src_v = sample + src_width * abs_src_height + halfwidth * crop_y +
    218                 crop_x / 2;
     219                (crop_x / 2);
    219220        src_u = sample + src_width * abs_src_height +
    220                 halfwidth * (abs_src_height + crop_y) + crop_x / 2;
     221                halfwidth * (abs_src_height + crop_y) + (crop_x / 2);
    221222      } else {
    222223        src_u = sample + src_width * abs_src_height + halfwidth * crop_y +
    223                 crop_x / 2;
     224                (crop_x / 2);
    224225        src_v = sample + src_width * abs_src_height +
    225                 halfwidth * (abs_src_height + crop_y) + crop_x / 2;
     226                halfwidth * (abs_src_height + crop_y) + (crop_x / 2);
    226227      }
    227228      r = I422ToI420(src_y, src_width, src_u, halfwidth, src_v, halfwidth,
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/cpu_id.cc

    r235135 r239415  
    1818    defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 160040219)
    1919#include <immintrin.h>  // For _xgetbv()
    20 #endif
    21 
    22 #if !defined(__native_client__)
    23 #include <stdlib.h>  // For getenv()
    2420#endif
    2521
     
    178174      return kCpuHasMSA;
    179175    }
     176    if (strcmp(ase, " mmi") == 0) {
     177      return kCpuHasMMI;
     178    }
    180179    return 0;
    181180  }
     
    190189        return 0;
    191190      }
     191    } else if (memcmp(cpuinfo_line, "cpu model", 9) == 0) {
     192      char* p = strstr(cpuinfo_line, "Loongson-3");
     193      if (p) {
     194        fclose(f);
     195        if (strcmp(ase, " mmi") == 0) {
     196          return kCpuHasMMI;
     197        }
     198        return 0;
     199      }
    192200    }
    193201  }
     
    195203  return 0;
    196204}
    197 
    198 // Test environment variable for disabling CPU features. Any non-zero value
    199 // to disable. Zero ignored to make it easy to set the variable on/off.
    200 #if !defined(__native_client__) && !defined(_M_ARM)
    201 
    202 static LIBYUV_BOOL TestEnv(const char* name) {
    203   const char* var = getenv(name);
    204   if (var) {
    205     if (var[0] != '0') {
    206       return LIBYUV_TRUE;
    207     }
    208   }
    209   return LIBYUV_FALSE;
    210 }
    211 #else  // nacl does not support getenv().
    212 static LIBYUV_BOOL TestEnv(const char*) {
    213   return LIBYUV_FALSE;
    214 }
    215 #endif
    216205
    217206static SAFEBUFFERS int GetCpuFlags(void) {
     
    252241    }
    253242  }
    254 
    255   // TODO(fbarchard): Consider moving these to gtest
    256   // Environment variable overrides for testing.
    257   if (TestEnv("LIBYUV_DISABLE_X86")) {
    258     cpu_info &= ~kCpuHasX86;
    259   }
    260   if (TestEnv("LIBYUV_DISABLE_SSE2")) {
    261     cpu_info &= ~kCpuHasSSE2;
    262   }
    263   if (TestEnv("LIBYUV_DISABLE_SSSE3")) {
    264     cpu_info &= ~kCpuHasSSSE3;
    265   }
    266   if (TestEnv("LIBYUV_DISABLE_SSE41")) {
    267     cpu_info &= ~kCpuHasSSE41;
    268   }
    269   if (TestEnv("LIBYUV_DISABLE_SSE42")) {
    270     cpu_info &= ~kCpuHasSSE42;
    271   }
    272   if (TestEnv("LIBYUV_DISABLE_AVX")) {
    273     cpu_info &= ~kCpuHasAVX;
    274   }
    275   if (TestEnv("LIBYUV_DISABLE_AVX2")) {
    276     cpu_info &= ~kCpuHasAVX2;
    277   }
    278   if (TestEnv("LIBYUV_DISABLE_ERMS")) {
    279     cpu_info &= ~kCpuHasERMS;
    280   }
    281   if (TestEnv("LIBYUV_DISABLE_FMA3")) {
    282     cpu_info &= ~kCpuHasFMA3;
    283   }
    284   if (TestEnv("LIBYUV_DISABLE_F16C")) {
    285     cpu_info &= ~kCpuHasF16C;
    286   }
    287   if (TestEnv("LIBYUV_DISABLE_AVX512BW")) {
    288     cpu_info &= ~kCpuHasAVX512BW;
    289   }
    290 
    291243#endif
    292244#if defined(__mips__) && defined(__linux__)
    293245#if defined(__mips_msa)
    294246  cpu_info = MipsCpuCaps("/proc/cpuinfo", " msa");
     247#elif defined(_MIPS_ARCH_LOONGSON3A)
     248  cpu_info = MipsCpuCaps("/proc/cpuinfo", " mmi");
    295249#endif
    296250  cpu_info |= kCpuHasMIPS;
    297   if (getenv("LIBYUV_DISABLE_MSA")) {
    298     cpu_info &= ~kCpuHasMSA;
    299   }
    300251#endif
    301252#if defined(__arm__) || defined(__aarch64__)
     
    316267#endif
    317268  cpu_info |= kCpuHasARM;
    318   if (TestEnv("LIBYUV_DISABLE_NEON")) {
    319     cpu_info &= ~kCpuHasNEON;
    320   }
    321269#endif  // __arm__
    322   if (TestEnv("LIBYUV_DISABLE_ASM")) {
    323     cpu_info = 0;
    324   }
    325270  cpu_info |= kCpuInitialized;
    326271  return cpu_info;
     
    331276int MaskCpuFlags(int enable_flags) {
    332277  int cpu_info = GetCpuFlags() & enable_flags;
    333 #ifdef __ATOMIC_RELAXED
    334   __atomic_store_n(&cpu_info_, cpu_info, __ATOMIC_RELAXED);
    335 #else
    336   cpu_info_ = cpu_info;
    337 #endif
     278  SetCpuFlags(cpu_info);
    338279  return cpu_info;
    339280}
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/planar_functions.cc

    r235135 r239415  
    411411  }
    412412#endif
     413#if defined(HAS_SPLITUVROW_MMI)
     414  if (TestCpuFlag(kCpuHasMMI)) {
     415    SplitUVRow = SplitUVRow_Any_MMI;
     416    if (IS_ALIGNED(width, 8)) {
     417      SplitUVRow = SplitUVRow_MMI;
     418    }
     419  }
     420#endif
    413421
    414422  for (y = 0; y < height; ++y) {
     
    476484    if (IS_ALIGNED(width, 16)) {
    477485      MergeUVRow = MergeUVRow_MSA;
     486    }
     487  }
     488#endif
     489#if defined(HAS_MERGEUVROW_MMI)
     490  if (TestCpuFlag(kCpuHasMMI)) {
     491    MergeUVRow = MergeUVRow_Any_MMI;
     492    if (IS_ALIGNED(width, 8)) {
     493      MergeUVRow = MergeUVRow_MMI;
    478494    }
    479495  }
     
    538554  }
    539555#endif
     556#if defined(HAS_SPLITRGBROW_MMI)
     557  if (TestCpuFlag(kCpuHasMMI)) {
     558    SplitRGBRow = SplitRGBRow_Any_MMI;
     559    if (IS_ALIGNED(width, 4)) {
     560      SplitRGBRow = SplitRGBRow_MMI;
     561    }
     562  }
     563#endif
    540564
    541565  for (y = 0; y < height; ++y) {
     
    594618  }
    595619#endif
     620#if defined(HAS_MERGERGBROW_MMI)
     621  if (TestCpuFlag(kCpuHasMMI)) {
     622    MergeRGBRow = MergeRGBRow_Any_MMI;
     623    if (IS_ALIGNED(width, 8)) {
     624      MergeRGBRow = MergeRGBRow_MMI;
     625    }
     626  }
     627#endif
    596628
    597629  for (y = 0; y < height; ++y) {
     
    649681    if (IS_ALIGNED(width, 64)) {
    650682      MirrorRow = MirrorRow_MSA;
     683    }
     684  }
     685#endif
     686#if defined(HAS_MIRRORROW_MMI)
     687  if (TestCpuFlag(kCpuHasMMI)) {
     688    MirrorRow = MirrorRow_Any_MMI;
     689    if (IS_ALIGNED(width, 8)) {
     690      MirrorRow = MirrorRow_MMI;
    651691    }
    652692  }
     
    735775  }
    736776#endif
     777#if defined(HAS_YUY2TOYROW_MMI)
     778  if (TestCpuFlag(kCpuHasMMI)) {
     779    YUY2ToYRow = YUY2ToYRow_Any_MMI;
     780    YUY2ToUV422Row = YUY2ToUV422Row_Any_MMI;
     781    if (IS_ALIGNED(width, 8)) {
     782      YUY2ToYRow = YUY2ToYRow_MMI;
     783      YUY2ToUV422Row = YUY2ToUV422Row_MMI;
     784    }
     785  }
     786#endif
    737787
    738788  for (y = 0; y < height; ++y) {
     
    821871  }
    822872#endif
     873#if defined(HAS_UYVYTOYROW_MMI)
     874  if (TestCpuFlag(kCpuHasMMI)) {
     875    UYVYToYRow = UYVYToYRow_Any_MMI;
     876    UYVYToUV422Row = UYVYToUV422Row_Any_MMI;
     877    if (IS_ALIGNED(width, 16)) {
     878      UYVYToYRow = UYVYToYRow_MMI;
     879      UYVYToUV422Row = UYVYToUV422Row_MMI;
     880    }
     881  }
     882#endif
    823883
    824884  for (y = 0; y < height; ++y) {
     
    888948    if (IS_ALIGNED(width, 32)) {
    889949      YUY2ToYRow = YUY2ToYRow_MSA;
     950    }
     951  }
     952#endif
     953#if defined(HAS_YUY2TOYROW_MMI)
     954  if (TestCpuFlag(kCpuHasMMI)) {
     955    YUY2ToYRow = YUY2ToYRow_Any_MMI;
     956    if (IS_ALIGNED(width, 8)) {
     957      YUY2ToYRow = YUY2ToYRow_MMI;
    890958    }
    891959  }
     
    10161084  }
    10171085#endif
     1086#if defined(HAS_ARGBMIRRORROW_MMI)
     1087  if (TestCpuFlag(kCpuHasMMI)) {
     1088    ARGBMirrorRow = ARGBMirrorRow_Any_MMI;
     1089    if (IS_ALIGNED(width, 2)) {
     1090      ARGBMirrorRow = ARGBMirrorRow_MMI;
     1091    }
     1092  }
     1093#endif
    10181094
    10191095  // Mirror plane
     
    10471123  if (TestCpuFlag(kCpuHasMSA)) {
    10481124    ARGBBlendRow = ARGBBlendRow_MSA;
     1125  }
     1126#endif
     1127#if defined(HAS_ARGBBLENDROW_MMI)
     1128  if (TestCpuFlag(kCpuHasMMI)) {
     1129    ARGBBlendRow = ARGBBlendRow_MMI;
    10491130  }
    10501131#endif
     
    11381219    if (IS_ALIGNED(width, 32)) {
    11391220      BlendPlaneRow = BlendPlaneRow_AVX2;
     1221    }
     1222  }
     1223#endif
     1224#if defined(HAS_BLENDPLANEROW_MMI)
     1225  if (TestCpuFlag(kCpuHasMMI)) {
     1226    BlendPlaneRow = BlendPlaneRow_Any_MMI;
     1227    if (IS_ALIGNED(width, 8)) {
     1228      BlendPlaneRow = BlendPlaneRow_MMI;
    11401229    }
    11411230  }
     
    12171306  }
    12181307#endif
     1308#if defined(HAS_BLENDPLANEROW_MMI)
     1309  if (TestCpuFlag(kCpuHasMMI)) {
     1310    BlendPlaneRow = BlendPlaneRow_Any_MMI;
     1311    if (IS_ALIGNED(halfwidth, 8)) {
     1312      BlendPlaneRow = BlendPlaneRow_MMI;
     1313    }
     1314  }
     1315#endif
    12191316  if (!IS_ALIGNED(width, 2)) {
    12201317    ScaleRowDown2 = ScaleRowDown2Box_Odd_C;
     
    12491346      if (IS_ALIGNED(halfwidth, 32)) {
    12501347        ScaleRowDown2 = ScaleRowDown2Box_AVX2;
     1348      }
     1349    }
     1350  }
     1351#endif
     1352#if defined(HAS_SCALEROWDOWN2_MMI)
     1353  if (TestCpuFlag(kCpuHasMMI)) {
     1354    ScaleRowDown2 = ScaleRowDown2Box_Odd_MMI;
     1355    if (IS_ALIGNED(width, 2)) {
     1356      ScaleRowDown2 = ScaleRowDown2Box_Any_MMI;
     1357      if (IS_ALIGNED(halfwidth, 8)) {
     1358        ScaleRowDown2 = ScaleRowDown2Box_MMI;
    12511359      }
    12521360    }
     
    13381446  }
    13391447#endif
     1448#if defined(HAS_ARGBMULTIPLYROW_MMI)
     1449  if (TestCpuFlag(kCpuHasMMI)) {
     1450    ARGBMultiplyRow = ARGBMultiplyRow_Any_MMI;
     1451    if (IS_ALIGNED(width, 2)) {
     1452      ARGBMultiplyRow = ARGBMultiplyRow_MMI;
     1453    }
     1454  }
     1455#endif
    13401456
    13411457  // Multiply plane
     
    14151531  }
    14161532#endif
     1533#if defined(HAS_ARGBADDROW_MMI)
     1534  if (TestCpuFlag(kCpuHasMMI)) {
     1535    ARGBAddRow = ARGBAddRow_Any_MMI;
     1536    if (IS_ALIGNED(width, 2)) {
     1537      ARGBAddRow = ARGBAddRow_MMI;
     1538    }
     1539  }
     1540#endif
    14171541
    14181542  // Add plane
     
    14841608    if (IS_ALIGNED(width, 8)) {
    14851609      ARGBSubtractRow = ARGBSubtractRow_MSA;
     1610    }
     1611  }
     1612#endif
     1613#if defined(HAS_ARGBSUBTRACTROW_MMI)
     1614  if (TestCpuFlag(kCpuHasMMI)) {
     1615    ARGBSubtractRow = ARGBSubtractRow_Any_MMI;
     1616    if (IS_ALIGNED(width, 2)) {
     1617      ARGBSubtractRow = ARGBSubtractRow_MMI;
    14861618    }
    14871619  }
     
    17161848    if (IS_ALIGNED(width, 16)) {
    17171849      RAWToRGB24Row = RAWToRGB24Row_MSA;
     1850    }
     1851  }
     1852#endif
     1853#if defined(HAS_RAWTORGB24ROW_MMI)
     1854  if (TestCpuFlag(kCpuHasMMI)) {
     1855    RAWToRGB24Row = RAWToRGB24Row_Any_MMI;
     1856    if (IS_ALIGNED(width, 4)) {
     1857      RAWToRGB24Row = RAWToRGB24Row_MMI;
    17181858    }
    17191859  }
     
    19402080  }
    19412081#endif
     2082#if defined(HAS_ARGBATTENUATEROW_MMI)
     2083  if (TestCpuFlag(kCpuHasMMI)) {
     2084    ARGBAttenuateRow = ARGBAttenuateRow_Any_MMI;
     2085    if (IS_ALIGNED(width, 2)) {
     2086      ARGBAttenuateRow = ARGBAttenuateRow_MMI;
     2087    }
     2088  }
     2089#endif
    19422090
    19432091  for (y = 0; y < height; ++y) {
     
    20402188  }
    20412189#endif
     2190#if defined(HAS_ARGBGRAYROW_MMI)
     2191  if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(width, 2)) {
     2192    ARGBGrayRow = ARGBGrayRow_MMI;
     2193  }
     2194#endif
    20422195
    20432196  for (y = 0; y < height; ++y) {
     
    20852238  }
    20862239#endif
     2240#if defined(HAS_ARGBGRAYROW_MMI)
     2241  if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(width, 2)) {
     2242    ARGBGrayRow = ARGBGrayRow_MMI;
     2243  }
     2244#endif
    20872245
    20882246  for (y = 0; y < height; ++y) {
     
    21262284  if (TestCpuFlag(kCpuHasMSA) && IS_ALIGNED(width, 8)) {
    21272285    ARGBSepiaRow = ARGBSepiaRow_MSA;
     2286  }
     2287#endif
     2288#if defined(HAS_ARGBSEPIAROW_MMI)
     2289  if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(width, 2)) {
     2290    ARGBSepiaRow = ARGBSepiaRow_MMI;
    21282291  }
    21292292#endif
     
    21772340  if (TestCpuFlag(kCpuHasMSA) && IS_ALIGNED(width, 8)) {
    21782341    ARGBColorMatrixRow = ARGBColorMatrixRow_MSA;
     2342  }
     2343#endif
     2344#if defined(HAS_ARGBCOLORMATRIXROW_MMI)
     2345  if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(width, 2)) {
     2346    ARGBColorMatrixRow = ARGBColorMatrixRow_MMI;
    21792347  }
    21802348#endif
     
    23732541  }
    23742542#endif
     2543#if defined(HAS_CUMULATIVESUMTOAVERAGEROW_MMI)
     2544  if (TestCpuFlag(kCpuHasMMI)) {
     2545    ComputeCumulativeSumRow = ComputeCumulativeSumRow_MMI;
     2546  }
     2547#endif
     2548
    23752549  memset(dst_cumsum, 0, width * sizeof(dst_cumsum[0]) * 4);  // 4 int per pixel.
    23762550  for (y = 0; y < height; ++y) {
     
    24292603    ComputeCumulativeSumRow = ComputeCumulativeSumRow_SSE2;
    24302604    CumulativeSumToAverageRow = CumulativeSumToAverageRow_SSE2;
     2605  }
     2606#endif
     2607#if defined(HAS_CUMULATIVESUMTOAVERAGEROW_MMI)
     2608  if (TestCpuFlag(kCpuHasMMI)) {
     2609    ComputeCumulativeSumRow = ComputeCumulativeSumRow_MMI;
    24312610  }
    24322611#endif
     
    25372716  }
    25382717#endif
     2718#if defined(HAS_ARGBSHADEROW_MMI)
     2719  if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(width, 2)) {
     2720    ARGBShadeRow = ARGBShadeRow_MMI;
     2721  }
     2722#endif
    25392723
    25402724  for (y = 0; y < height; ++y) {
     
    26052789    if (IS_ALIGNED(width, 32)) {
    26062790      InterpolateRow = InterpolateRow_MSA;
     2791    }
     2792  }
     2793#endif
     2794#if defined(HAS_INTERPOLATEROW_MMI)
     2795  if (TestCpuFlag(kCpuHasMMI)) {
     2796    InterpolateRow = InterpolateRow_Any_MMI;
     2797    if (IS_ALIGNED(width, 8)) {
     2798      InterpolateRow = InterpolateRow_MMI;
    26072799    }
    26082800  }
     
    27312923  }
    27322924#endif
     2925#if defined(HAS_ARGBSHUFFLEROW_MMI)
     2926  if (TestCpuFlag(kCpuHasMMI)) {
     2927    ARGBShuffleRow = ARGBShuffleRow_Any_MMI;
     2928    if (IS_ALIGNED(width, 2)) {
     2929      ARGBShuffleRow = ARGBShuffleRow_MMI;
     2930    }
     2931  }
     2932#endif
    27332933
    27342934  for (y = 0; y < height; ++y) {
     
    28023002  }
    28033003#endif
     3004#if defined(HAS_ARGBTOYJROW_MMI)
     3005  if (TestCpuFlag(kCpuHasMMI)) {
     3006    ARGBToYJRow = ARGBToYJRow_Any_MMI;
     3007    if (IS_ALIGNED(width, 8)) {
     3008      ARGBToYJRow = ARGBToYJRow_MMI;
     3009    }
     3010  }
     3011#endif
    28043012
    28053013#if defined(HAS_SOBELYROW_SSE2)
     
    28183026  }
    28193027#endif
     3028#if defined(HAS_SOBELYROW_MMI)
     3029  if (TestCpuFlag(kCpuHasMMI)) {
     3030    SobelYRow = SobelYRow_MMI;
     3031  }
     3032#endif
    28203033#if defined(HAS_SOBELXROW_SSE2)
    28213034  if (TestCpuFlag(kCpuHasSSE2)) {
     
    28313044  if (TestCpuFlag(kCpuHasMSA)) {
    28323045    SobelXRow = SobelXRow_MSA;
     3046  }
     3047#endif
     3048#if defined(HAS_SOBELXROW_MMI)
     3049  if (TestCpuFlag(kCpuHasMMI)) {
     3050    SobelXRow = SobelXRow_MMI;
    28333051  }
    28343052#endif
     
    29153133  }
    29163134#endif
     3135#if defined(HAS_SOBELROW_MMI)
     3136  if (TestCpuFlag(kCpuHasMMI)) {
     3137    SobelRow = SobelRow_Any_MMI;
     3138    if (IS_ALIGNED(width, 8)) {
     3139      SobelRow = SobelRow_MMI;
     3140    }
     3141  }
     3142#endif
    29173143  return ARGBSobelize(src_argb, src_stride_argb, dst_argb, dst_stride_argb,
    29183144                      width, height, SobelRow);
     
    29533179  }
    29543180#endif
     3181#if defined(HAS_SOBELTOPLANEROW_MMI)
     3182  if (TestCpuFlag(kCpuHasMMI)) {
     3183    SobelToPlaneRow = SobelToPlaneRow_Any_MMI;
     3184    if (IS_ALIGNED(width, 8)) {
     3185      SobelToPlaneRow = SobelToPlaneRow_MMI;
     3186    }
     3187  }
     3188#endif
    29553189  return ARGBSobelize(src_argb, src_stride_argb, dst_y, dst_stride_y, width,
    29563190                      height, SobelToPlaneRow);
     
    29923226  }
    29933227#endif
     3228#if defined(HAS_SOBELXYROW_MMI)
     3229  if (TestCpuFlag(kCpuHasMMI)) {
     3230    SobelXYRow = SobelXYRow_Any_MMI;
     3231    if (IS_ALIGNED(width, 8)) {
     3232      SobelXYRow = SobelXYRow_MMI;
     3233    }
     3234  }
     3235#endif
    29943236  return ARGBSobelize(src_argb, src_stride_argb, dst_argb, dst_stride_argb,
    29953237                      width, height, SobelXYRow);
     
    32293471  }
    32303472#endif
     3473#if defined(HAS_ARGBCOPYALPHAROW_MMI)
     3474  if (TestCpuFlag(kCpuHasMMI)) {
     3475    ARGBCopyAlphaRow = ARGBCopyAlphaRow_Any_MMI;
     3476    if (IS_ALIGNED(width, 2)) {
     3477      ARGBCopyAlphaRow = ARGBCopyAlphaRow_MMI;
     3478    }
     3479  }
     3480#endif
    32313481
    32323482  for (y = 0; y < height; ++y) {
     
    32873537  }
    32883538#endif
     3539#if defined(HAS_ARGBEXTRACTALPHAROW_MMI)
     3540  if (TestCpuFlag(kCpuHasMMI)) {
     3541    ARGBExtractAlphaRow = IS_ALIGNED(width, 8) ? ARGBExtractAlphaRow_MMI
     3542                                               : ARGBExtractAlphaRow_Any_MMI;
     3543  }
     3544#endif
    32893545
    32903546  for (int y = 0; y < height; ++y) {
     
    33353591    if (IS_ALIGNED(width, 16)) {
    33363592      ARGBCopyYToAlphaRow = ARGBCopyYToAlphaRow_AVX2;
     3593    }
     3594  }
     3595#endif
     3596#if defined(HAS_ARGBCOPYYTOALPHAROW_MMI)
     3597  if (TestCpuFlag(kCpuHasMMI)) {
     3598    ARGBCopyYToAlphaRow = ARGBCopyYToAlphaRow_Any_MMI;
     3599    if (IS_ALIGNED(width, 8)) {
     3600      ARGBCopyYToAlphaRow = ARGBCopyYToAlphaRow_MMI;
    33373601    }
    33383602  }
     
    34073671  }
    34083672#endif
     3673#if defined(HAS_SPLITUVROW_MMI)
     3674  if (TestCpuFlag(kCpuHasMMI)) {
     3675    SplitUVRow = SplitUVRow_Any_MMI;
     3676    if (IS_ALIGNED(width, 8)) {
     3677      SplitUVRow = SplitUVRow_MMI;
     3678    }
     3679  }
     3680#endif
    34093681#if defined(HAS_INTERPOLATEROW_SSSE3)
    34103682  if (TestCpuFlag(kCpuHasSSSE3)) {
     
    34363708    if (IS_ALIGNED(width, 32)) {
    34373709      InterpolateRow = InterpolateRow_MSA;
     3710    }
     3711  }
     3712#endif
     3713#if defined(HAS_INTERPOLATEROW_MMI)
     3714  if (TestCpuFlag(kCpuHasMMI)) {
     3715    InterpolateRow = InterpolateRow_Any_MMI;
     3716    if (IS_ALIGNED(width, 8)) {
     3717      InterpolateRow = InterpolateRow_MMI;
    34383718    }
    34393719  }
     
    35233803  }
    35243804#endif
     3805#if defined(HAS_SPLITUVROW_MMI)
     3806  if (TestCpuFlag(kCpuHasMMI)) {
     3807    SplitUVRow = SplitUVRow_Any_MMI;
     3808    if (IS_ALIGNED(width, 8)) {
     3809      SplitUVRow = SplitUVRow_MMI;
     3810    }
     3811  }
     3812#endif
    35253813#if defined(HAS_INTERPOLATEROW_SSSE3)
    35263814  if (TestCpuFlag(kCpuHasSSSE3)) {
     
    35523840    if (IS_ALIGNED(width, 32)) {
    35533841      InterpolateRow = InterpolateRow_MSA;
     3842    }
     3843  }
     3844#endif
     3845#if defined(HAS_INTERPOLATEROW_MMI)
     3846  if (TestCpuFlag(kCpuHasMMI)) {
     3847    InterpolateRow = InterpolateRow_Any_MMI;
     3848    if (IS_ALIGNED(width, 8)) {
     3849      InterpolateRow = InterpolateRow_MMI;
    35543850    }
    35553851  }
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/rotate.cc

    r235135 r239415  
    4848      TransposeWx8 = TransposeWx8_SSSE3;
    4949    }
     50  }
     51#endif
     52#if defined(HAS_TRANSPOSEWX8_MMI)
     53  if (TestCpuFlag(kCpuHasMMI)) {
     54    TransposeWx8 = TransposeWx8_MMI;
    5055  }
    5156#endif
     
    167172  }
    168173#endif
     174#if defined(HAS_MIRRORROW_MMI)
     175  if (TestCpuFlag(kCpuHasMMI)) {
     176    MirrorRow = MirrorRow_Any_MMI;
     177    if (IS_ALIGNED(width, 8)) {
     178      MirrorRow = MirrorRow_MMI;
     179    }
     180  }
     181#endif
    169182#if defined(HAS_COPYROW_SSE2)
    170183  if (TestCpuFlag(kCpuHasSSE2)) {
     
    185198  if (TestCpuFlag(kCpuHasNEON)) {
    186199    CopyRow = IS_ALIGNED(width, 32) ? CopyRow_NEON : CopyRow_Any_NEON;
     200  }
     201#endif
     202#if defined(HAS_COPYROW_MMI)
     203  if (TestCpuFlag(kCpuHasMMI)) {
     204    CopyRow = IS_ALIGNED(width, 8) ? CopyRow_MMI : CopyRow_Any_MMI;
    187205  }
    188206#endif
     
    233251  }
    234252#endif
     253#if defined(HAS_TRANSPOSEUVWX8_MMI)
     254  if (TestCpuFlag(kCpuHasMMI)) {
     255    TransposeUVWx8 = TransposeUVWx8_Any_MMI;
     256    if (IS_ALIGNED(width, 4)) {
     257      TransposeUVWx8 = TransposeUVWx8_MMI;
     258    }
     259  }
     260#endif
    235261#if defined(HAS_TRANSPOSEUVWX16_MSA)
    236262  if (TestCpuFlag(kCpuHasMSA)) {
     
    330356  if (TestCpuFlag(kCpuHasMSA) && IS_ALIGNED(width, 32)) {
    331357    MirrorUVRow = MirrorUVRow_MSA;
     358  }
     359#endif
     360#if defined(HAS_MIRRORUVROW_MMI)
     361  if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(width, 8)) {
     362    MirrorUVRow = MirrorUVRow_MMI;
    332363  }
    333364#endif
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/rotate_any.cc

    r235135 r239415  
    3636TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, 7)
    3737#endif
     38#ifdef HAS_TRANSPOSEWX8_MMI
     39TANY(TransposeWx8_Any_MMI, TransposeWx8_MMI, 7)
     40#endif
    3841#ifdef HAS_TRANSPOSEWX8_FAST_SSSE3
    3942TANY(TransposeWx8_Fast_Any_SSSE3, TransposeWx8_Fast_SSSE3, 15)
     
    6366TUVANY(TransposeUVWx8_Any_SSE2, TransposeUVWx8_SSE2, 7)
    6467#endif
     68#ifdef HAS_TRANSPOSEUVWX8_MMI
     69TUVANY(TransposeUVWx8_Any_MMI, TransposeUVWx8_MMI, 7)
     70#endif
    6571#ifdef HAS_TRANSPOSEUVWX16_MSA
    6672TUVANY(TransposeUVWx16_Any_MSA, TransposeUVWx16_MSA, 7)
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/rotate_argb.cc

    r235135 r239415  
    5454    if (IS_ALIGNED(height, 4)) {  // Width of dest.
    5555      ScaleARGBRowDownEven = ScaleARGBRowDownEven_MSA;
     56    }
     57  }
     58#endif
     59#if defined(HAS_SCALEARGBROWDOWNEVEN_MMI)
     60  if (TestCpuFlag(kCpuHasMMI)) {
     61    ScaleARGBRowDownEven = ScaleARGBRowDownEven_Any_MMI;
     62    if (IS_ALIGNED(height, 4)) {  // Width of dest.
     63      ScaleARGBRowDownEven = ScaleARGBRowDownEven_MMI;
    5664    }
    5765  }
     
    143151  }
    144152#endif
     153#if defined(HAS_ARGBMIRRORROW_MMI)
     154  if (TestCpuFlag(kCpuHasMMI)) {
     155    ARGBMirrorRow = ARGBMirrorRow_Any_MMI;
     156    if (IS_ALIGNED(width, 2)) {
     157      ARGBMirrorRow = ARGBMirrorRow_MMI;
     158    }
     159  }
     160#endif
    145161#if defined(HAS_COPYROW_SSE2)
    146162  if (TestCpuFlag(kCpuHasSSE2)) {
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/row_any.cc

    r235135 r239415  
    9393ANY31(MergeRGBRow_Any_NEON, MergeRGBRow_NEON, 0, 0, 3, 15)
    9494#endif
     95#ifdef HAS_MERGERGBROW_MMI
     96ANY31(MergeRGBRow_Any_MMI, MergeRGBRow_MMI, 0, 0, 3, 7)
     97#endif
    9598#ifdef HAS_I422TOYUY2ROW_SSE2
    9699ANY31(I422ToYUY2Row_Any_SSE2, I422ToYUY2Row_SSE2, 1, 1, 4, 15)
     
    107110ANY31(I422ToYUY2Row_Any_MSA, I422ToYUY2Row_MSA, 1, 1, 4, 31)
    108111#endif
     112#ifdef HAS_I422TOYUY2ROW_MMI
     113ANY31(I422ToYUY2Row_Any_MMI, I422ToYUY2Row_MMI, 1, 1, 4, 7)
     114#endif
    109115#ifdef HAS_I422TOUYVYROW_NEON
    110116ANY31(I422ToUYVYRow_Any_NEON, I422ToUYVYRow_NEON, 1, 1, 4, 15)
     
    113119ANY31(I422ToUYVYRow_Any_MSA, I422ToUYVYRow_MSA, 1, 1, 4, 31)
    114120#endif
     121#ifdef HAS_I422TOUYVYROW_MMI
     122ANY31(I422ToUYVYRow_Any_MMI, I422ToUYVYRow_MMI, 1, 1, 4, 7)
     123#endif
    115124#ifdef HAS_BLENDPLANEROW_AVX2
    116125ANY31(BlendPlaneRow_Any_AVX2, BlendPlaneRow_AVX2, 0, 0, 1, 31)
     
    118127#ifdef HAS_BLENDPLANEROW_SSSE3
    119128ANY31(BlendPlaneRow_Any_SSSE3, BlendPlaneRow_SSSE3, 0, 0, 1, 7)
     129#endif
     130#ifdef HAS_BLENDPLANEROW_MMI
     131ANY31(BlendPlaneRow_Any_MMI, BlendPlaneRow_MMI, 0, 0, 1, 7)
    120132#endif
    121133#undef ANY31
     
    124136// on arm that subsamples 444 to 422 internally.
    125137// Any 3 planes to 1 with yuvconstants
    126 #define ANY31C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK)                \
    127   void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf,                     \
    128                const uint8_t* v_buf, uint8_t* dst_ptr,                         \
    129                const struct YuvConstants* yuvconstants, int width) {           \
    130     SIMD_ALIGNED(uint8_t temp[64 * 4]);                                        \
    131     memset(temp, 0, 64 * 3); /* for YUY2 and msan */                           \
    132     int r = width & MASK;                                                      \
    133     int n = width & ~MASK;                                                     \
    134     if (n > 0) {                                                               \
    135       ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n);                 \
    136     }                                                                          \
    137     memcpy(temp, y_buf + n, r);                                                \
    138     memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT));                 \
    139     memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT));                \
    140     if (width & 1) {                                                           \
    141       temp[64 + SS(r, UVSHIFT)] = temp[64 + SS(r, UVSHIFT) - 1];               \
    142       temp[128 + SS(r, UVSHIFT)] = temp[128 + SS(r, UVSHIFT) - 1];             \
    143     }                                                                          \
    144     ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, yuvconstants, MASK + 1); \
    145     memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 192,                        \
    146            SS(r, DUVSHIFT) * BPP);                                             \
     138#define ANY31C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK)      \
     139  void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf,           \
     140               const uint8_t* v_buf, uint8_t* dst_ptr,               \
     141               const struct YuvConstants* yuvconstants, int width) { \
     142    SIMD_ALIGNED(uint8_t temp[128 * 4]);                             \
     143    memset(temp, 0, 128 * 3); /* for YUY2 and msan */                \
     144    int r = width & MASK;                                            \
     145    int n = width & ~MASK;                                           \
     146    if (n > 0) {                                                     \
     147      ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n);       \
     148    }                                                                \
     149    memcpy(temp, y_buf + n, r);                                      \
     150    memcpy(temp + 128, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT));      \
     151    memcpy(temp + 256, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT));      \
     152    if (width & 1) {                                                 \
     153      temp[128 + SS(r, UVSHIFT)] = temp[128 + SS(r, UVSHIFT) - 1];   \
     154      temp[256 + SS(r, UVSHIFT)] = temp[256 + SS(r, UVSHIFT) - 1];   \
     155    }                                                                \
     156    ANY_SIMD(temp, temp + 128, temp + 256, temp + 384, yuvconstants, \
     157             MASK + 1);                                              \
     158    memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 384,              \
     159           SS(r, DUVSHIFT) * BPP);                                   \
    147160  }
    148161
     
    162175ANY31C(I422ToARGB1555Row_Any_SSSE3, I422ToARGB1555Row_SSSE3, 1, 0, 2, 7)
    163176ANY31C(I422ToRGB565Row_Any_SSSE3, I422ToRGB565Row_SSSE3, 1, 0, 2, 7)
    164 ANY31C(I422ToRGB24Row_Any_SSSE3, I422ToRGB24Row_SSSE3, 1, 0, 3, 7)
     177ANY31C(I422ToRGB24Row_Any_SSSE3, I422ToRGB24Row_SSSE3, 1, 0, 3, 15)
    165178#endif  // HAS_I444TOARGBROW_SSSE3
    166179#ifdef HAS_I422TORGB24ROW_AVX2
    167 ANY31C(I422ToRGB24Row_Any_AVX2, I422ToRGB24Row_AVX2, 1, 0, 3, 15)
     180ANY31C(I422ToRGB24Row_Any_AVX2, I422ToRGB24Row_AVX2, 1, 0, 3, 31)
    168181#endif
    169182#ifdef HAS_I422TOARGBROW_AVX2
     
    271284ANY21(MergeUVRow_Any_MSA, MergeUVRow_MSA, 0, 1, 1, 2, 15)
    272285#endif
     286#ifdef HAS_MERGEUVROW_MMI
     287ANY21(MergeUVRow_Any_MMI, MergeUVRow_MMI, 0, 1, 1, 2, 7)
     288#endif
    273289
    274290// Math functions.
     
    303319ANY21(ARGBMultiplyRow_Any_MSA, ARGBMultiplyRow_MSA, 0, 4, 4, 4, 3)
    304320#endif
     321#ifdef HAS_ARGBMULTIPLYROW_MMI
     322ANY21(ARGBMultiplyRow_Any_MMI, ARGBMultiplyRow_MMI, 0, 4, 4, 4, 1)
     323#endif
    305324#ifdef HAS_ARGBADDROW_MSA
    306325ANY21(ARGBAddRow_Any_MSA, ARGBAddRow_MSA, 0, 4, 4, 4, 7)
    307326#endif
     327#ifdef HAS_ARGBADDROW_MMI
     328ANY21(ARGBAddRow_Any_MMI, ARGBAddRow_MMI, 0, 4, 4, 4, 1)
     329#endif
    308330#ifdef HAS_ARGBSUBTRACTROW_MSA
    309331ANY21(ARGBSubtractRow_Any_MSA, ARGBSubtractRow_MSA, 0, 4, 4, 4, 7)
    310332#endif
     333#ifdef HAS_ARGBSUBTRACTROW_MMI
     334ANY21(ARGBSubtractRow_Any_MMI, ARGBSubtractRow_MMI, 0, 4, 4, 4, 1)
     335#endif
    311336#ifdef HAS_SOBELROW_SSE2
    312337ANY21(SobelRow_Any_SSE2, SobelRow_SSE2, 0, 1, 1, 4, 15)
     
    318343ANY21(SobelRow_Any_MSA, SobelRow_MSA, 0, 1, 1, 4, 15)
    319344#endif
     345#ifdef HAS_SOBELROW_MMI
     346ANY21(SobelRow_Any_MMI, SobelRow_MMI, 0, 1, 1, 4, 7)
     347#endif
    320348#ifdef HAS_SOBELTOPLANEROW_SSE2
    321349ANY21(SobelToPlaneRow_Any_SSE2, SobelToPlaneRow_SSE2, 0, 1, 1, 1, 15)
     
    327355ANY21(SobelToPlaneRow_Any_MSA, SobelToPlaneRow_MSA, 0, 1, 1, 1, 31)
    328356#endif
     357#ifdef HAS_SOBELTOPLANEROW_MMI
     358ANY21(SobelToPlaneRow_Any_MMI, SobelToPlaneRow_MMI, 0, 1, 1, 1, 7)
     359#endif
    329360#ifdef HAS_SOBELXYROW_SSE2
    330361ANY21(SobelXYRow_Any_SSE2, SobelXYRow_SSE2, 0, 1, 1, 4, 15)
     
    335366#ifdef HAS_SOBELXYROW_MSA
    336367ANY21(SobelXYRow_Any_MSA, SobelXYRow_MSA, 0, 1, 1, 4, 15)
     368#endif
     369#ifdef HAS_SOBELXYROW_MMI
     370ANY21(SobelXYRow_Any_MMI, SobelXYRow_MMI, 0, 1, 1, 4, 7)
    337371#endif
    338372#undef ANY21
     
    342376  void NAMEANY(const uint8_t* y_buf, const uint8_t* uv_buf, uint8_t* dst_ptr, \
    343377               const struct YuvConstants* yuvconstants, int width) {          \
    344     SIMD_ALIGNED(uint8_t temp[64 * 3]);                                       \
    345     memset(temp, 0, 64 * 2); /* for msan */                                   \
     378    SIMD_ALIGNED(uint8_t temp[128 * 3]);                                      \
     379    memset(temp, 0, 128 * 2); /* for msan */                                  \
    346380    int r = width & MASK;                                                     \
    347381    int n = width & ~MASK;                                                    \
     
    350384    }                                                                         \
    351385    memcpy(temp, y_buf + n * SBPP, r * SBPP);                                 \
    352     memcpy(temp + 64, uv_buf + (n >> UVSHIFT) * SBPP2,                        \
     386    memcpy(temp + 128, uv_buf + (n >> UVSHIFT) * SBPP2,                       \
    353387           SS(r, UVSHIFT) * SBPP2);                                           \
    354     ANY_SIMD(temp, temp + 64, temp + 128, yuvconstants, MASK + 1);            \
    355     memcpy(dst_ptr + n * BPP, temp + 128, r * BPP);                           \
     388    ANY_SIMD(temp, temp + 128, temp + 256, yuvconstants, MASK + 1);           \
     389    memcpy(dst_ptr + n * BPP, temp + 256, r * BPP);                           \
    356390  }
    357391
     
    386420#ifdef HAS_NV21TORGB24ROW_NEON
    387421ANY21C(NV21ToRGB24Row_Any_NEON, NV21ToRGB24Row_NEON, 1, 1, 2, 3, 7)
     422#endif
     423#ifdef HAS_NV12TORGB24ROW_SSSE3
     424ANY21C(NV12ToRGB24Row_Any_SSSE3, NV12ToRGB24Row_SSSE3, 1, 1, 2, 3, 15)
     425#endif
     426#ifdef HAS_NV21TORGB24ROW_SSSE3
     427ANY21C(NV21ToRGB24Row_Any_SSSE3, NV21ToRGB24Row_SSSE3, 1, 1, 2, 3, 15)
     428#endif
     429#ifdef HAS_NV12TORGB24ROW_AVX2
     430ANY21C(NV12ToRGB24Row_Any_AVX2, NV12ToRGB24Row_AVX2, 1, 1, 2, 3, 31)
     431#endif
     432#ifdef HAS_NV21TORGB24ROW_AVX2
     433ANY21C(NV21ToRGB24Row_Any_AVX2, NV21ToRGB24Row_AVX2, 1, 1, 2, 3, 31)
    388434#endif
    389435#ifdef HAS_NV12TORGB565ROW_SSSE3
     
    432478ANY11(ARGBToARGB4444Row_Any_SSE2, ARGBToARGB4444Row_SSE2, 0, 4, 2, 3)
    433479#endif
     480#if defined(HAS_ARGBTORGB24ROW_AVX2)
     481ANY11(ARGBToRGB24Row_Any_AVX2, ARGBToRGB24Row_AVX2, 0, 4, 3, 31)
     482#endif
     483#if defined(HAS_ARGBTORGB24ROW_AVX512VBMI)
     484ANY11(ARGBToRGB24Row_Any_AVX512VBMI, ARGBToRGB24Row_AVX512VBMI, 0, 4, 3, 31)
     485#endif
     486#if defined(HAS_ARGBTORAWROW_AVX2)
     487ANY11(ARGBToRAWRow_Any_AVX2, ARGBToRAWRow_AVX2, 0, 4, 3, 31)
     488#endif
    434489#if defined(HAS_ARGBTORGB565ROW_AVX2)
    435490ANY11(ARGBToRGB565Row_Any_AVX2, ARGBToRGB565Row_AVX2, 0, 4, 2, 7)
     
    500555ANY11(I400ToARGBRow_Any_MSA, I400ToARGBRow_MSA, 0, 1, 4, 15)
    501556#endif
     557#if defined(HAS_ARGBTORGB24ROW_MMI)
     558ANY11(ARGBToRGB24Row_Any_MMI, ARGBToRGB24Row_MMI, 0, 4, 3, 3)
     559ANY11(ARGBToRAWRow_Any_MMI, ARGBToRAWRow_MMI, 0, 4, 3, 3)
     560ANY11(ARGBToRGB565Row_Any_MMI, ARGBToRGB565Row_MMI, 0, 4, 2, 3)
     561ANY11(ARGBToARGB1555Row_Any_MMI, ARGBToARGB1555Row_MMI, 0, 4, 2, 3)
     562ANY11(ARGBToARGB4444Row_Any_MMI, ARGBToARGB4444Row_MMI, 0, 4, 2, 3)
     563ANY11(J400ToARGBRow_Any_MMI, J400ToARGBRow_MMI, 0, 1, 4, 3)
     564ANY11(I400ToARGBRow_Any_MMI, I400ToARGBRow_MMI, 0, 1, 4, 7)
     565#endif
    502566#if defined(HAS_RAWTORGB24ROW_NEON)
    503567ANY11(RAWToRGB24Row_Any_NEON, RAWToRGB24Row_NEON, 0, 3, 3, 7)
     
    505569#if defined(HAS_RAWTORGB24ROW_MSA)
    506570ANY11(RAWToRGB24Row_Any_MSA, RAWToRGB24Row_MSA, 0, 3, 3, 15)
     571#endif
     572#if defined(HAS_RAWTORGB24ROW_MMI)
     573ANY11(RAWToRGB24Row_Any_MMI, RAWToRGB24Row_MMI, 0, 3, 3, 3)
    507574#endif
    508575#ifdef HAS_ARGBTOYROW_AVX2
     
    537604ANY11(ARGBToYRow_Any_MSA, ARGBToYRow_MSA, 0, 4, 1, 15)
    538605#endif
     606#ifdef HAS_ARGBTOYROW_MMI
     607ANY11(ARGBToYRow_Any_MMI, ARGBToYRow_MMI, 0, 4, 1, 7)
     608#endif
    539609#ifdef HAS_ARGBTOYJROW_NEON
    540610ANY11(ARGBToYJRow_Any_NEON, ARGBToYJRow_NEON, 0, 4, 1, 7)
     
    543613ANY11(ARGBToYJRow_Any_MSA, ARGBToYJRow_MSA, 0, 4, 1, 15)
    544614#endif
     615#ifdef HAS_ARGBTOYJROW_MMI
     616ANY11(ARGBToYJRow_Any_MMI, ARGBToYJRow_MMI, 0, 4, 1, 7)
     617#endif
    545618#ifdef HAS_BGRATOYROW_NEON
    546619ANY11(BGRAToYRow_Any_NEON, BGRAToYRow_NEON, 0, 4, 1, 7)
     
    549622ANY11(BGRAToYRow_Any_MSA, BGRAToYRow_MSA, 0, 4, 1, 15)
    550623#endif
     624#ifdef HAS_BGRATOYROW_MMI
     625ANY11(BGRAToYRow_Any_MMI, BGRAToYRow_MMI, 0, 4, 1, 7)
     626#endif
    551627#ifdef HAS_ABGRTOYROW_NEON
    552628ANY11(ABGRToYRow_Any_NEON, ABGRToYRow_NEON, 0, 4, 1, 7)
     
    555631ANY11(ABGRToYRow_Any_MSA, ABGRToYRow_MSA, 0, 4, 1, 7)
    556632#endif
     633#ifdef HAS_ABGRTOYROW_MMI
     634ANY11(ABGRToYRow_Any_MMI, ABGRToYRow_MMI, 0, 4, 1, 7)
     635#endif
    557636#ifdef HAS_RGBATOYROW_NEON
    558637ANY11(RGBAToYRow_Any_NEON, RGBAToYRow_NEON, 0, 4, 1, 7)
     
    561640ANY11(RGBAToYRow_Any_MSA, RGBAToYRow_MSA, 0, 4, 1, 15)
    562641#endif
     642#ifdef HAS_RGBATOYROW_MMI
     643ANY11(RGBAToYRow_Any_MMI, RGBAToYRow_MMI, 0, 4, 1, 7)
     644#endif
    563645#ifdef HAS_RGB24TOYROW_NEON
    564646ANY11(RGB24ToYRow_Any_NEON, RGB24ToYRow_NEON, 0, 3, 1, 7)
     
    567649ANY11(RGB24ToYRow_Any_MSA, RGB24ToYRow_MSA, 0, 3, 1, 15)
    568650#endif
     651#ifdef HAS_RGB24TOYROW_MMI
     652ANY11(RGB24ToYRow_Any_MMI, RGB24ToYRow_MMI, 0, 3, 1, 7)
     653#endif
    569654#ifdef HAS_RAWTOYROW_NEON
    570655ANY11(RAWToYRow_Any_NEON, RAWToYRow_NEON, 0, 3, 1, 7)
     
    573658ANY11(RAWToYRow_Any_MSA, RAWToYRow_MSA, 0, 3, 1, 15)
    574659#endif
     660#ifdef HAS_RAWTOYROW_MMI
     661ANY11(RAWToYRow_Any_MMI, RAWToYRow_MMI, 0, 3, 1, 7)
     662#endif
    575663#ifdef HAS_RGB565TOYROW_NEON
    576664ANY11(RGB565ToYRow_Any_NEON, RGB565ToYRow_NEON, 0, 2, 1, 7)
     
    579667ANY11(RGB565ToYRow_Any_MSA, RGB565ToYRow_MSA, 0, 2, 1, 15)
    580668#endif
     669#ifdef HAS_RGB565TOYROW_MMI
     670ANY11(RGB565ToYRow_Any_MMI, RGB565ToYRow_MMI, 0, 2, 1, 7)
     671#endif
    581672#ifdef HAS_ARGB1555TOYROW_NEON
    582673ANY11(ARGB1555ToYRow_Any_NEON, ARGB1555ToYRow_NEON, 0, 2, 1, 7)
     
    585676ANY11(ARGB1555ToYRow_Any_MSA, ARGB1555ToYRow_MSA, 0, 2, 1, 15)
    586677#endif
     678#ifdef HAS_ARGB1555TOYROW_MMI
     679ANY11(ARGB1555ToYRow_Any_MMI, ARGB1555ToYRow_MMI, 0, 2, 1, 7)
     680#endif
    587681#ifdef HAS_ARGB4444TOYROW_NEON
    588682ANY11(ARGB4444ToYRow_Any_NEON, ARGB4444ToYRow_NEON, 0, 2, 1, 7)
    589683#endif
     684#ifdef HAS_ARGB4444TOYROW_MMI
     685ANY11(ARGB4444ToYRow_Any_MMI, ARGB4444ToYRow_MMI, 0, 2, 1, 7)
     686#endif
    590687#ifdef HAS_YUY2TOYROW_NEON
    591688ANY11(YUY2ToYRow_Any_NEON, YUY2ToYRow_NEON, 1, 4, 1, 15)
     
    597694ANY11(YUY2ToYRow_Any_MSA, YUY2ToYRow_MSA, 1, 4, 1, 31)
    598695#endif
     696#ifdef HAS_YUY2TOYROW_MMI
     697ANY11(YUY2ToYRow_Any_MMI, YUY2ToYRow_MMI, 1, 4, 1, 7)
     698#endif
    599699#ifdef HAS_UYVYTOYROW_MSA
    600700ANY11(UYVYToYRow_Any_MSA, UYVYToYRow_MSA, 1, 4, 1, 31)
    601701#endif
     702#ifdef HAS_UYVYTOYROW_MMI
     703ANY11(UYVYToYRow_Any_MMI, UYVYToYRow_MMI, 1, 4, 1, 15)
     704#endif
    602705#ifdef HAS_RGB24TOARGBROW_NEON
    603706ANY11(RGB24ToARGBRow_Any_NEON, RGB24ToARGBRow_NEON, 0, 3, 4, 7)
     
    606709ANY11(RGB24ToARGBRow_Any_MSA, RGB24ToARGBRow_MSA, 0, 3, 4, 15)
    607710#endif
     711#ifdef HAS_RGB24TOARGBROW_MMI
     712ANY11(RGB24ToARGBRow_Any_MMI, RGB24ToARGBRow_MMI, 0, 3, 4, 3)
     713#endif
    608714#ifdef HAS_RAWTOARGBROW_NEON
    609715ANY11(RAWToARGBRow_Any_NEON, RAWToARGBRow_NEON, 0, 3, 4, 7)
     
    612718ANY11(RAWToARGBRow_Any_MSA, RAWToARGBRow_MSA, 0, 3, 4, 15)
    613719#endif
     720#ifdef HAS_RAWTOARGBROW_MMI
     721ANY11(RAWToARGBRow_Any_MMI, RAWToARGBRow_MMI, 0, 3, 4, 3)
     722#endif
    614723#ifdef HAS_RGB565TOARGBROW_NEON
    615724ANY11(RGB565ToARGBRow_Any_NEON, RGB565ToARGBRow_NEON, 0, 2, 4, 7)
     
    618727ANY11(RGB565ToARGBRow_Any_MSA, RGB565ToARGBRow_MSA, 0, 2, 4, 15)
    619728#endif
     729#ifdef HAS_RGB565TOARGBROW_MMI
     730ANY11(RGB565ToARGBRow_Any_MMI, RGB565ToARGBRow_MMI, 0, 2, 4, 3)
     731#endif
    620732#ifdef HAS_ARGB1555TOARGBROW_NEON
    621733ANY11(ARGB1555ToARGBRow_Any_NEON, ARGB1555ToARGBRow_NEON, 0, 2, 4, 7)
     
    624736ANY11(ARGB1555ToARGBRow_Any_MSA, ARGB1555ToARGBRow_MSA, 0, 2, 4, 15)
    625737#endif
     738#ifdef HAS_ARGB1555TOARGBROW_MMI
     739ANY11(ARGB1555ToARGBRow_Any_MMI, ARGB1555ToARGBRow_MMI, 0, 2, 4, 3)
     740#endif
    626741#ifdef HAS_ARGB4444TOARGBROW_NEON
    627742ANY11(ARGB4444ToARGBRow_Any_NEON, ARGB4444ToARGBRow_NEON, 0, 2, 4, 7)
     
    630745ANY11(ARGB4444ToARGBRow_Any_MSA, ARGB4444ToARGBRow_MSA, 0, 2, 4, 15)
    631746#endif
     747#ifdef HAS_ARGB4444TOARGBROW_MMI
     748ANY11(ARGB4444ToARGBRow_Any_MMI, ARGB4444ToARGBRow_MMI, 0, 2, 4, 3)
     749#endif
    632750#ifdef HAS_ARGBATTENUATEROW_SSSE3
    633751ANY11(ARGBAttenuateRow_Any_SSSE3, ARGBAttenuateRow_SSSE3, 0, 4, 4, 3)
     
    648766ANY11(ARGBAttenuateRow_Any_MSA, ARGBAttenuateRow_MSA, 0, 4, 4, 7)
    649767#endif
     768#ifdef HAS_ARGBATTENUATEROW_MMI
     769ANY11(ARGBAttenuateRow_Any_MMI, ARGBAttenuateRow_MMI, 0, 4, 4, 1)
     770#endif
    650771#ifdef HAS_ARGBEXTRACTALPHAROW_SSE2
    651772ANY11(ARGBExtractAlphaRow_Any_SSE2, ARGBExtractAlphaRow_SSE2, 0, 4, 1, 7)
    652773#endif
    653774#ifdef HAS_ARGBEXTRACTALPHAROW_AVX2
    654 ANY11(ARGBExtractAlphaRow_Any_AVX2, ARGBExtractAlphaRow_AVX2, 0, 4, 1, 32)
     775ANY11(ARGBExtractAlphaRow_Any_AVX2, ARGBExtractAlphaRow_AVX2, 0, 4, 1, 31)
    655776#endif
    656777#ifdef HAS_ARGBEXTRACTALPHAROW_NEON
     
    659780#ifdef HAS_ARGBEXTRACTALPHAROW_MSA
    660781ANY11(ARGBExtractAlphaRow_Any_MSA, ARGBExtractAlphaRow_MSA, 0, 4, 1, 15)
     782#endif
     783#ifdef HAS_ARGBEXTRACTALPHAROW_MMI
     784ANY11(ARGBExtractAlphaRow_Any_MMI, ARGBExtractAlphaRow_MMI, 0, 4, 1, 7)
    661785#endif
    662786#undef ANY11
     
    684808ANY11B(ARGBCopyAlphaRow_Any_SSE2, ARGBCopyAlphaRow_SSE2, 0, 4, 4, 7)
    685809#endif
     810#ifdef HAS_ARGBCOPYALPHAROW_MMI
     811ANY11B(ARGBCopyAlphaRow_Any_MMI, ARGBCopyAlphaRow_MMI, 0, 4, 4, 1)
     812#endif
    686813#ifdef HAS_ARGBCOPYYTOALPHAROW_AVX2
    687814ANY11B(ARGBCopyYToAlphaRow_Any_AVX2, ARGBCopyYToAlphaRow_AVX2, 0, 1, 4, 15)
     
    689816#ifdef HAS_ARGBCOPYYTOALPHAROW_SSE2
    690817ANY11B(ARGBCopyYToAlphaRow_Any_SSE2, ARGBCopyYToAlphaRow_SSE2, 0, 1, 4, 7)
     818#endif
     819#ifdef HAS_ARGBCOPYYTOALPHAROW_MMI
     820ANY11B(ARGBCopyYToAlphaRow_Any_MMI, ARGBCopyYToAlphaRow_MMI, 0, 1, 4, 7)
    691821#endif
    692822#undef ANY11B
     
    739869       7)
    740870#endif
     871#if defined(HAS_ARGBTORGB565DITHERROW_MMI)
     872ANY11P(ARGBToRGB565DitherRow_Any_MMI,
     873       ARGBToRGB565DitherRow_MMI,
     874       const uint32_t,
     875       4,
     876       2,
     877       3)
     878#endif
    741879#ifdef HAS_ARGBSHUFFLEROW_SSSE3
    742880ANY11P(ARGBShuffleRow_Any_SSSE3, ARGBShuffleRow_SSSE3, const uint8_t*, 4, 4, 7)
     
    751889ANY11P(ARGBShuffleRow_Any_MSA, ARGBShuffleRow_MSA, const uint8_t*, 4, 4, 7)
    752890#endif
     891#ifdef HAS_ARGBSHUFFLEROW_MMI
     892ANY11P(ARGBShuffleRow_Any_MMI, ARGBShuffleRow_MMI, const uint8_t*, 4, 4, 1)
     893#endif
     894#undef ANY11P
    753895#undef ANY11P
    754896
     
    9191061ANY11T(InterpolateRow_Any_MSA, InterpolateRow_MSA, 1, 1, 31)
    9201062#endif
     1063#ifdef HAS_INTERPOLATEROW_MMI
     1064ANY11T(InterpolateRow_Any_MMI, InterpolateRow_MMI, 1, 1, 7)
     1065#endif
    9211066#undef ANY11T
    9221067
     
    9481093ANY11M(MirrorRow_Any_MSA, MirrorRow_MSA, 1, 63)
    9491094#endif
     1095#ifdef HAS_MIRRORROW_MMI
     1096ANY11M(MirrorRow_Any_MMI, MirrorRow_MMI, 1, 7)
     1097#endif
    9501098#ifdef HAS_ARGBMIRRORROW_AVX2
    9511099ANY11M(ARGBMirrorRow_Any_AVX2, ARGBMirrorRow_AVX2, 4, 7)
     
    9591107#ifdef HAS_ARGBMIRRORROW_MSA
    9601108ANY11M(ARGBMirrorRow_Any_MSA, ARGBMirrorRow_MSA, 4, 15)
     1109#endif
     1110#ifdef HAS_ARGBMIRRORROW_MMI
     1111ANY11M(ARGBMirrorRow_Any_MMI, ARGBMirrorRow_MMI, 4, 1)
    9611112#endif
    9621113#undef ANY11M
     
    10181169ANY12(SplitUVRow_Any_MSA, SplitUVRow_MSA, 0, 2, 0, 31)
    10191170#endif
     1171#ifdef HAS_SPLITUVROW_MMI
     1172ANY12(SplitUVRow_Any_MMI, SplitUVRow_MMI, 0, 2, 0, 7)
     1173#endif
    10201174#ifdef HAS_ARGBTOUV444ROW_SSSE3
    10211175ANY12(ARGBToUV444Row_Any_SSSE3, ARGBToUV444Row_SSSE3, 0, 4, 0, 15)
     
    10381192ANY12(YUY2ToUV422Row_Any_MSA, YUY2ToUV422Row_MSA, 1, 4, 1, 31)
    10391193ANY12(UYVYToUV422Row_Any_MSA, UYVYToUV422Row_MSA, 1, 4, 1, 31)
     1194#endif
     1195#ifdef HAS_YUY2TOUV422ROW_MMI
     1196ANY12(ARGBToUV444Row_Any_MMI, ARGBToUV444Row_MMI, 0, 4, 0, 7)
     1197ANY12(UYVYToUV422Row_Any_MMI, UYVYToUV422Row_MMI, 1, 4, 1, 15)
     1198ANY12(YUY2ToUV422Row_Any_MMI, YUY2ToUV422Row_MMI, 1, 4, 1, 15)
    10401199#endif
    10411200#undef ANY12
     
    10641223#ifdef HAS_SPLITRGBROW_NEON
    10651224ANY13(SplitRGBRow_Any_NEON, SplitRGBRow_NEON, 3, 15)
     1225#endif
     1226#ifdef HAS_SPLITRGBROW_MMI
     1227ANY13(SplitRGBRow_Any_MMI, SplitRGBRow_MMI, 3, 3)
    10661228#endif
    10671229
     
    11191281ANY12S(ARGBToUVRow_Any_MSA, ARGBToUVRow_MSA, 0, 4, 31)
    11201282#endif
     1283#ifdef HAS_ARGBTOUVROW_MMI
     1284ANY12S(ARGBToUVRow_Any_MMI, ARGBToUVRow_MMI, 0, 4, 15)
     1285#endif
    11211286#ifdef HAS_ARGBTOUVJROW_NEON
    11221287ANY12S(ARGBToUVJRow_Any_NEON, ARGBToUVJRow_NEON, 0, 4, 15)
     
    11251290ANY12S(ARGBToUVJRow_Any_MSA, ARGBToUVJRow_MSA, 0, 4, 31)
    11261291#endif
     1292#ifdef HAS_ARGBTOUVJROW_MMI
     1293ANY12S(ARGBToUVJRow_Any_MMI, ARGBToUVJRow_MMI, 0, 4, 15)
     1294#endif
    11271295#ifdef HAS_BGRATOUVROW_NEON
    11281296ANY12S(BGRAToUVRow_Any_NEON, BGRAToUVRow_NEON, 0, 4, 15)
     
    11311299ANY12S(BGRAToUVRow_Any_MSA, BGRAToUVRow_MSA, 0, 4, 31)
    11321300#endif
     1301#ifdef HAS_BGRATOUVROW_MMI
     1302ANY12S(BGRAToUVRow_Any_MMI, BGRAToUVRow_MMI, 0, 4, 15)
     1303#endif
    11331304#ifdef HAS_ABGRTOUVROW_NEON
    11341305ANY12S(ABGRToUVRow_Any_NEON, ABGRToUVRow_NEON, 0, 4, 15)
     
    11371308ANY12S(ABGRToUVRow_Any_MSA, ABGRToUVRow_MSA, 0, 4, 31)
    11381309#endif
     1310#ifdef HAS_ABGRTOUVROW_MMI
     1311ANY12S(ABGRToUVRow_Any_MMI, ABGRToUVRow_MMI, 0, 4, 15)
     1312#endif
    11391313#ifdef HAS_RGBATOUVROW_NEON
    11401314ANY12S(RGBAToUVRow_Any_NEON, RGBAToUVRow_NEON, 0, 4, 15)
     
    11431317ANY12S(RGBAToUVRow_Any_MSA, RGBAToUVRow_MSA, 0, 4, 31)
    11441318#endif
     1319#ifdef HAS_RGBATOUVROW_MMI
     1320ANY12S(RGBAToUVRow_Any_MMI, RGBAToUVRow_MMI, 0, 4, 15)
     1321#endif
    11451322#ifdef HAS_RGB24TOUVROW_NEON
    11461323ANY12S(RGB24ToUVRow_Any_NEON, RGB24ToUVRow_NEON, 0, 3, 15)
     
    11491326ANY12S(RGB24ToUVRow_Any_MSA, RGB24ToUVRow_MSA, 0, 3, 15)
    11501327#endif
     1328#ifdef HAS_RGB24TOUVROW_MMI
     1329ANY12S(RGB24ToUVRow_Any_MMI, RGB24ToUVRow_MMI, 0, 3, 15)
     1330#endif
    11511331#ifdef HAS_RAWTOUVROW_NEON
    11521332ANY12S(RAWToUVRow_Any_NEON, RAWToUVRow_NEON, 0, 3, 15)
     
    11551335ANY12S(RAWToUVRow_Any_MSA, RAWToUVRow_MSA, 0, 3, 15)
    11561336#endif
     1337#ifdef HAS_RAWTOUVROW_MMI
     1338ANY12S(RAWToUVRow_Any_MMI, RAWToUVRow_MMI, 0, 3, 15)
     1339#endif
    11571340#ifdef HAS_RGB565TOUVROW_NEON
    11581341ANY12S(RGB565ToUVRow_Any_NEON, RGB565ToUVRow_NEON, 0, 2, 15)
     
    11611344ANY12S(RGB565ToUVRow_Any_MSA, RGB565ToUVRow_MSA, 0, 2, 15)
    11621345#endif
     1346#ifdef HAS_RGB565TOUVROW_MMI
     1347ANY12S(RGB565ToUVRow_Any_MMI, RGB565ToUVRow_MMI, 0, 2, 15)
     1348#endif
    11631349#ifdef HAS_ARGB1555TOUVROW_NEON
    11641350ANY12S(ARGB1555ToUVRow_Any_NEON, ARGB1555ToUVRow_NEON, 0, 2, 15)
     
    11671353ANY12S(ARGB1555ToUVRow_Any_MSA, ARGB1555ToUVRow_MSA, 0, 2, 15)
    11681354#endif
     1355#ifdef HAS_ARGB1555TOUVROW_MMI
     1356ANY12S(ARGB1555ToUVRow_Any_MMI, ARGB1555ToUVRow_MMI, 0, 2, 15)
     1357#endif
    11691358#ifdef HAS_ARGB4444TOUVROW_NEON
    11701359ANY12S(ARGB4444ToUVRow_Any_NEON, ARGB4444ToUVRow_NEON, 0, 2, 15)
    11711360#endif
     1361#ifdef HAS_ARGB4444TOUVROW_MMI
     1362ANY12S(ARGB4444ToUVRow_Any_MMI, ARGB4444ToUVRow_MMI, 0, 2, 15)
     1363#endif
    11721364#ifdef HAS_YUY2TOUVROW_NEON
    11731365ANY12S(YUY2ToUVRow_Any_NEON, YUY2ToUVRow_NEON, 1, 4, 15)
     
    11791371ANY12S(YUY2ToUVRow_Any_MSA, YUY2ToUVRow_MSA, 1, 4, 31)
    11801372#endif
     1373#ifdef HAS_YUY2TOUVROW_MMI
     1374ANY12S(YUY2ToUVRow_Any_MMI, YUY2ToUVRow_MMI, 1, 4, 15)
     1375#endif
    11811376#ifdef HAS_UYVYTOUVROW_MSA
    11821377ANY12S(UYVYToUVRow_Any_MSA, UYVYToUVRow_MSA, 1, 4, 31)
     1378#endif
     1379#ifdef HAS_UYVYTOUVROW_MMI
     1380ANY12S(UYVYToUVRow_Any_MMI, UYVYToUVRow_MMI, 1, 4, 15)
    11831381#endif
    11841382#undef ANY12S
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/row_common.cc

    r235135 r239415  
    182182  int x;
    183183  for (x = 0; x < width; ++x) {
    184     uint32_t ar30 = *(uint32_t*)src_ar30;
     184    uint32_t ar30 = *(const uint32_t*)src_ar30;
    185185    uint32_t b = (ar30 >> 2) & 0xff;
    186186    uint32_t g = (ar30 >> 12) & 0xff;
     
    196196  int x;
    197197  for (x = 0; x < width; ++x) {
    198     uint32_t ar30 = *(uint32_t*)src_ar30;
     198    uint32_t ar30 = *(const uint32_t*)src_ar30;
    199199    uint32_t b = (ar30 >> 2) & 0xff;
    200200    uint32_t g = (ar30 >> 12) & 0xff;
     
    210210  int x;
    211211  for (x = 0; x < width; ++x) {
    212     uint32_t ar30 = *(uint32_t*)src_ar30;
     212    uint32_t ar30 = *(const uint32_t*)src_ar30;
    213213    uint32_t b = ar30 & 0x3ff;
    214214    uint32_t ga = ar30 & 0xc00ffc00;
     
    27632763// bits of the mantissa from our float and we're done.
    27642764
     2765// Work around GCC 7 punning warning -Wstrict-aliasing
     2766#if defined(__GNUC__)
     2767typedef uint32_t __attribute__((__may_alias__)) uint32_alias_t;
     2768#else
     2769typedef uint32_t uint32_alias_t;
     2770#endif
     2771
    27652772void HalfFloatRow_C(const uint16_t* src,
    27662773                    uint16_t* dst,
     
    27712778  for (i = 0; i < width; ++i) {
    27722779    float value = src[i] * mult;
    2773     dst[i] = (uint16_t)((*(uint32_t*)&value) >> 13);
     2780    dst[i] = (uint16_t)((*(const uint32_alias_t*)&value) >> 13);
    27742781  }
    27752782}
     
    29492956    src_uv += twidth;
    29502957    dst_rgb565 += twidth * 2;
     2958    width -= twidth;
     2959  }
     2960}
     2961#endif
     2962
     2963#if defined(HAS_NV12TORGB24ROW_SSSE3)
     2964void NV12ToRGB24Row_SSSE3(const uint8_t* src_y,
     2965                          const uint8_t* src_uv,
     2966                          uint8_t* dst_rgb24,
     2967                          const struct YuvConstants* yuvconstants,
     2968                          int width) {
     2969  // Row buffer for intermediate ARGB pixels.
     2970  SIMD_ALIGNED(uint8_t row[MAXTWIDTH * 4]);
     2971  while (width > 0) {
     2972    int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
     2973    NV12ToARGBRow_SSSE3(src_y, src_uv, row, yuvconstants, twidth);
     2974    ARGBToRGB24Row_SSSE3(row, dst_rgb24, twidth);
     2975    src_y += twidth;
     2976    src_uv += twidth;
     2977    dst_rgb24 += twidth * 3;
     2978    width -= twidth;
     2979  }
     2980}
     2981#endif
     2982
     2983#if defined(HAS_NV21TORGB24ROW_SSSE3)
     2984void NV21ToRGB24Row_SSSE3(const uint8_t* src_y,
     2985                          const uint8_t* src_vu,
     2986                          uint8_t* dst_rgb24,
     2987                          const struct YuvConstants* yuvconstants,
     2988                          int width) {
     2989  // Row buffer for intermediate ARGB pixels.
     2990  SIMD_ALIGNED(uint8_t row[MAXTWIDTH * 4]);
     2991  while (width > 0) {
     2992    int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
     2993    NV21ToARGBRow_SSSE3(src_y, src_vu, row, yuvconstants, twidth);
     2994    ARGBToRGB24Row_SSSE3(row, dst_rgb24, twidth);
     2995    src_y += twidth;
     2996    src_vu += twidth;
     2997    dst_rgb24 += twidth * 3;
     2998    width -= twidth;
     2999  }
     3000}
     3001#endif
     3002
     3003#if defined(HAS_NV12TORGB24ROW_AVX2)
     3004void NV12ToRGB24Row_AVX2(const uint8_t* src_y,
     3005                         const uint8_t* src_uv,
     3006                         uint8_t* dst_rgb24,
     3007                         const struct YuvConstants* yuvconstants,
     3008                         int width) {
     3009  // Row buffer for intermediate ARGB pixels.
     3010  SIMD_ALIGNED(uint8_t row[MAXTWIDTH * 4]);
     3011  while (width > 0) {
     3012    int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
     3013    NV12ToARGBRow_AVX2(src_y, src_uv, row, yuvconstants, twidth);
     3014#if defined(HAS_ARGBTORGB24ROW_AVX2)
     3015    ARGBToRGB24Row_AVX2(row, dst_rgb24, twidth);
     3016#else
     3017    ARGBToRGB24Row_SSSE3(row, dst_rgb24, twidth);
     3018#endif
     3019    src_y += twidth;
     3020    src_uv += twidth;
     3021    dst_rgb24 += twidth * 3;
     3022    width -= twidth;
     3023  }
     3024}
     3025#endif
     3026
     3027#if defined(HAS_NV21TORGB24ROW_AVX2)
     3028void NV21ToRGB24Row_AVX2(const uint8_t* src_y,
     3029                         const uint8_t* src_vu,
     3030                         uint8_t* dst_rgb24,
     3031                         const struct YuvConstants* yuvconstants,
     3032                         int width) {
     3033  // Row buffer for intermediate ARGB pixels.
     3034  SIMD_ALIGNED(uint8_t row[MAXTWIDTH * 4]);
     3035  while (width > 0) {
     3036    int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
     3037    NV21ToARGBRow_AVX2(src_y, src_vu, row, yuvconstants, twidth);
     3038#if defined(HAS_ARGBTORGB24ROW_AVX2)
     3039    ARGBToRGB24Row_AVX2(row, dst_rgb24, twidth);
     3040#else
     3041    ARGBToRGB24Row_SSSE3(row, dst_rgb24, twidth);
     3042#endif
     3043    src_y += twidth;
     3044    src_vu += twidth;
     3045    dst_rgb24 += twidth * 3;
    29513046    width -= twidth;
    29523047  }
     
    30433138    int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
    30443139    I422ToARGBRow_AVX2(src_y, src_u, src_v, row, yuvconstants, twidth);
    3045     // TODO(fbarchard): ARGBToRGB24Row_AVX2
     3140#if defined(HAS_ARGBTORGB24ROW_AVX2)
     3141    ARGBToRGB24Row_AVX2(row, dst_rgb24, twidth);
     3142#else
    30463143    ARGBToRGB24Row_SSSE3(row, dst_rgb24, twidth);
     3144#endif
    30473145    src_y += twidth;
    30483146    src_u += twidth / 2;
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/row_gcc.cc

    r235135 r239415  
    505505      : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6");
    506506}
     507
     508#ifdef HAS_ARGBTORGB24ROW_AVX2
     509// vpermd for 12+12 to 24
     510static const lvec32 kPermdRGB24_AVX = {0, 1, 2, 4, 5, 6, 3, 7};
     511
     512void ARGBToRGB24Row_AVX2(const uint8_t* src, uint8_t* dst, int width) {
     513  asm volatile(
     514      "vbroadcastf128 %3,%%ymm6                  \n"
     515      "vmovdqa    %4,%%ymm7                      \n"
     516
     517      LABELALIGN
     518      "1:                                        \n"
     519      "vmovdqu    (%0),%%ymm0                    \n"
     520      "vmovdqu    0x20(%0),%%ymm1                \n"
     521      "vmovdqu    0x40(%0),%%ymm2                \n"
     522      "vmovdqu    0x60(%0),%%ymm3                \n"
     523      "lea        0x80(%0),%0                    \n"
     524      "vpshufb    %%ymm6,%%ymm0,%%ymm0           \n"  // xxx0yyy0
     525      "vpshufb    %%ymm6,%%ymm1,%%ymm1           \n"
     526      "vpshufb    %%ymm6,%%ymm2,%%ymm2           \n"
     527      "vpshufb    %%ymm6,%%ymm3,%%ymm3           \n"
     528      "vpermd     %%ymm0,%%ymm7,%%ymm0           \n"  // pack to 24 bytes
     529      "vpermd     %%ymm1,%%ymm7,%%ymm1           \n"
     530      "vpermd     %%ymm2,%%ymm7,%%ymm2           \n"
     531      "vpermd     %%ymm3,%%ymm7,%%ymm3           \n"
     532      "vpermq     $0x3f,%%ymm1,%%ymm4            \n"  // combine 24 + 8
     533      "vpor       %%ymm4,%%ymm0,%%ymm0           \n"
     534      "vmovdqu    %%ymm0,(%1)                    \n"
     535      "vpermq     $0xf9,%%ymm1,%%ymm1            \n"  // combine 16 + 16
     536      "vpermq     $0x4f,%%ymm2,%%ymm4            \n"
     537      "vpor       %%ymm4,%%ymm1,%%ymm1           \n"
     538      "vmovdqu    %%ymm1,0x20(%1)                \n"
     539      "vpermq     $0xfe,%%ymm2,%%ymm2            \n"  // combine 8 + 24
     540      "vpermq     $0x93,%%ymm3,%%ymm3            \n"
     541      "vpor       %%ymm3,%%ymm2,%%ymm2           \n"
     542      "vmovdqu    %%ymm2,0x40(%1)                \n"
     543      "lea        0x60(%1),%1                    \n"
     544      "sub        $0x20,%2                       \n"
     545      "jg         1b                             \n"
     546      "vzeroupper                                \n"
     547      : "+r"(src),                     // %0
     548        "+r"(dst),                     // %1
     549        "+r"(width)                    // %2
     550      : "m"(kShuffleMaskARGBToRGB24),  // %3
     551        "m"(kPermdRGB24_AVX)           // %4
     552      : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6",
     553        "xmm7");
     554}
     555#endif
     556
     557#ifdef HAS_ARGBTORGB24ROW_AVX512VBMI
     558// Shuffle table for converting ARGBToRGB24
     559static const ulvec8 kPermARGBToRGB24_0 = {
     560    0u,  1u,  2u,  4u,  5u,  6u,  8u,  9u,  10u, 12u, 13u,
     561    14u, 16u, 17u, 18u, 20u, 21u, 22u, 24u, 25u, 26u, 28u,
     562    29u, 30u, 32u, 33u, 34u, 36u, 37u, 38u, 40u, 41u};
     563static const ulvec8 kPermARGBToRGB24_1 = {
     564    10u, 12u, 13u, 14u, 16u, 17u, 18u, 20u, 21u, 22u, 24u,
     565    25u, 26u, 28u, 29u, 30u, 32u, 33u, 34u, 36u, 37u, 38u,
     566    40u, 41u, 42u, 44u, 45u, 46u, 48u, 49u, 50u, 52u};
     567static const ulvec8 kPermARGBToRGB24_2 = {
     568    21u, 22u, 24u, 25u, 26u, 28u, 29u, 30u, 32u, 33u, 34u,
     569    36u, 37u, 38u, 40u, 41u, 42u, 44u, 45u, 46u, 48u, 49u,
     570    50u, 52u, 53u, 54u, 56u, 57u, 58u, 60u, 61u, 62u};
     571
     572void ARGBToRGB24Row_AVX512VBMI(const uint8_t* src, uint8_t* dst, int width) {
     573  asm volatile(
     574      "vmovdqa    %3,%%ymm5                      \n"
     575      "vmovdqa    %4,%%ymm6                      \n"
     576      "vmovdqa    %5,%%ymm7                      \n"
     577
     578      LABELALIGN
     579      "1:                                        \n"
     580      "vmovdqu    (%0),%%ymm0                    \n"
     581      "vmovdqu    0x20(%0),%%ymm1                \n"
     582      "vmovdqu    0x40(%0),%%ymm2                \n"
     583      "vmovdqu    0x60(%0),%%ymm3                \n"
     584      "lea        0x80(%0),%0                    \n"
     585      "vpermt2b   %%ymm1,%%ymm5,%%ymm0           \n"
     586      "vpermt2b   %%ymm2,%%ymm6,%%ymm1           \n"
     587      "vpermt2b   %%ymm3,%%ymm7,%%ymm2           \n"
     588      "vmovdqu    %%ymm0,(%1)                    \n"
     589      "vmovdqu    %%ymm1,0x20(%1)                \n"
     590      "vmovdqu    %%ymm2,0x40(%1)                \n"
     591      "lea        0x60(%1),%1                    \n"
     592      "sub        $0x20,%2                       \n"
     593      "jg         1b                             \n"
     594      "vzeroupper                                \n"
     595      : "+r"(src),                // %0
     596        "+r"(dst),                // %1
     597        "+r"(width)               // %2
     598      : "m"(kPermARGBToRGB24_0),  // %3
     599        "m"(kPermARGBToRGB24_1),  // %4
     600        "m"(kPermARGBToRGB24_2)   // %5
     601      : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5", "xmm6", "xmm7");
     602}
     603#endif
     604
     605#ifdef HAS_ARGBTORAWROW_AVX2
     606void ARGBToRAWRow_AVX2(const uint8_t* src, uint8_t* dst, int width) {
     607  asm volatile(
     608      "vbroadcastf128 %3,%%ymm6                  \n"
     609      "vmovdqa    %4,%%ymm7                      \n"
     610
     611      LABELALIGN
     612      "1:                                        \n"
     613      "vmovdqu    (%0),%%ymm0                    \n"
     614      "vmovdqu    0x20(%0),%%ymm1                \n"
     615      "vmovdqu    0x40(%0),%%ymm2                \n"
     616      "vmovdqu    0x60(%0),%%ymm3                \n"
     617      "lea        0x80(%0),%0                    \n"
     618      "vpshufb    %%ymm6,%%ymm0,%%ymm0           \n"  // xxx0yyy0
     619      "vpshufb    %%ymm6,%%ymm1,%%ymm1           \n"
     620      "vpshufb    %%ymm6,%%ymm2,%%ymm2           \n"
     621      "vpshufb    %%ymm6,%%ymm3,%%ymm3           \n"
     622      "vpermd     %%ymm0,%%ymm7,%%ymm0           \n"  // pack to 24 bytes
     623      "vpermd     %%ymm1,%%ymm7,%%ymm1           \n"
     624      "vpermd     %%ymm2,%%ymm7,%%ymm2           \n"
     625      "vpermd     %%ymm3,%%ymm7,%%ymm3           \n"
     626      "vpermq     $0x3f,%%ymm1,%%ymm4            \n"  // combine 24 + 8
     627      "vpor       %%ymm4,%%ymm0,%%ymm0           \n"
     628      "vmovdqu    %%ymm0,(%1)                    \n"
     629      "vpermq     $0xf9,%%ymm1,%%ymm1            \n"  // combine 16 + 16
     630      "vpermq     $0x4f,%%ymm2,%%ymm4            \n"
     631      "vpor       %%ymm4,%%ymm1,%%ymm1           \n"
     632      "vmovdqu    %%ymm1,0x20(%1)                \n"
     633      "vpermq     $0xfe,%%ymm2,%%ymm2            \n"  // combine 8 + 24
     634      "vpermq     $0x93,%%ymm3,%%ymm3            \n"
     635      "vpor       %%ymm3,%%ymm2,%%ymm2           \n"
     636      "vmovdqu    %%ymm2,0x40(%1)                \n"
     637      "lea        0x60(%1),%1                    \n"
     638      "sub        $0x20,%2                       \n"
     639      "jg         1b                             \n"
     640      "vzeroupper                                \n"
     641      : "+r"(src),                   // %0
     642        "+r"(dst),                   // %1
     643        "+r"(width)                  // %2
     644      : "m"(kShuffleMaskARGBToRAW),  // %3
     645        "m"(kPermdRGB24_AVX)         // %4
     646      : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6",
     647        "xmm7");
     648}
     649#endif
    507650
    508651void ARGBToRGB565Row_SSE2(const uint8_t* src, uint8_t* dst, int width) {
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/row_msa.cc

    r235135 r239415  
    164164    v8u16 reg8_m, reg9_m;                                                 \
    165165                                                                          \
    166     src0_m = (v16u8)__msa_ld_b((v16i8*)s, 0);                             \
    167     src1_m = (v16u8)__msa_ld_b((v16i8*)s, 16);                            \
    168     src2_m = (v16u8)__msa_ld_b((v16i8*)s, 32);                            \
    169     src3_m = (v16u8)__msa_ld_b((v16i8*)s, 48);                            \
    170     src4_m = (v16u8)__msa_ld_b((v16i8*)t, 0);                             \
    171     src5_m = (v16u8)__msa_ld_b((v16i8*)t, 16);                            \
    172     src6_m = (v16u8)__msa_ld_b((v16i8*)t, 32);                            \
    173     src7_m = (v16u8)__msa_ld_b((v16i8*)t, 48);                            \
     166    src0_m = (v16u8)__msa_ld_b((void*)s, 0);                              \
     167    src1_m = (v16u8)__msa_ld_b((void*)s, 16);                             \
     168    src2_m = (v16u8)__msa_ld_b((void*)s, 32);                             \
     169    src3_m = (v16u8)__msa_ld_b((void*)s, 48);                             \
     170    src4_m = (v16u8)__msa_ld_b((void*)t, 0);                              \
     171    src5_m = (v16u8)__msa_ld_b((void*)t, 16);                             \
     172    src6_m = (v16u8)__msa_ld_b((void*)t, 32);                             \
     173    src7_m = (v16u8)__msa_ld_b((void*)t, 48);                             \
    174174    vec0_m = (v16u8)__msa_ilvr_b((v16i8)src0_m, (v16i8)src4_m);           \
    175175    vec1_m = (v16u8)__msa_ilvr_b((v16i8)src1_m, (v16i8)src5_m);           \
     
    202202    argb0 = (v16u8)__msa_pckev_b((v16i8)reg9_m, (v16i8)reg8_m);           \
    203203    argb1 = (v16u8)__msa_pckev_b((v16i8)reg1_m, (v16i8)reg0_m);           \
    204     src0_m = (v16u8)__msa_ld_b((v16i8*)s, 64);                            \
    205     src1_m = (v16u8)__msa_ld_b((v16i8*)s, 80);                            \
    206     src2_m = (v16u8)__msa_ld_b((v16i8*)s, 96);                            \
    207     src3_m = (v16u8)__msa_ld_b((v16i8*)s, 112);                           \
    208     src4_m = (v16u8)__msa_ld_b((v16i8*)t, 64);                            \
    209     src5_m = (v16u8)__msa_ld_b((v16i8*)t, 80);                            \
    210     src6_m = (v16u8)__msa_ld_b((v16i8*)t, 96);                            \
    211     src7_m = (v16u8)__msa_ld_b((v16i8*)t, 112);                           \
     204    src0_m = (v16u8)__msa_ld_b((void*)s, 64);                             \
     205    src1_m = (v16u8)__msa_ld_b((void*)s, 80);                             \
     206    src2_m = (v16u8)__msa_ld_b((void*)s, 96);                             \
     207    src3_m = (v16u8)__msa_ld_b((void*)s, 112);                            \
     208    src4_m = (v16u8)__msa_ld_b((void*)t, 64);                             \
     209    src5_m = (v16u8)__msa_ld_b((void*)t, 80);                             \
     210    src6_m = (v16u8)__msa_ld_b((void*)t, 96);                             \
     211    src7_m = (v16u8)__msa_ld_b((void*)t, 112);                            \
    212212    vec2_m = (v16u8)__msa_ilvr_b((v16i8)src0_m, (v16i8)src4_m);           \
    213213    vec3_m = (v16u8)__msa_ilvr_b((v16i8)src1_m, (v16i8)src5_m);           \
     
    943943
    944944  for (x = 0; x < width; x += 16) {
    945     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb, 0);
    946     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb, 16);
    947     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb, 32);
    948     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb, 48);
     945    src0 = (v16u8)__msa_ld_b((void*)src_argb, 0);
     946    src1 = (v16u8)__msa_ld_b((void*)src_argb, 16);
     947    src2 = (v16u8)__msa_ld_b((void*)src_argb, 32);
     948    src3 = (v16u8)__msa_ld_b((void*)src_argb, 48);
    949949    dst0 = (v16u8)__msa_vshf_b(shuffler0, (v16i8)src1, (v16i8)src0);
    950950    dst1 = (v16u8)__msa_vshf_b(shuffler1, (v16i8)src2, (v16i8)src1);
     
    967967
    968968  for (x = 0; x < width; x += 16) {
    969     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb, 0);
    970     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb, 16);
    971     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb, 32);
    972     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb, 48);
     969    src0 = (v16u8)__msa_ld_b((void*)src_argb, 0);
     970    src1 = (v16u8)__msa_ld_b((void*)src_argb, 16);
     971    src2 = (v16u8)__msa_ld_b((void*)src_argb, 32);
     972    src3 = (v16u8)__msa_ld_b((void*)src_argb, 48);
    973973    dst0 = (v16u8)__msa_vshf_b(shuffler0, (v16i8)src1, (v16i8)src0);
    974974    dst1 = (v16u8)__msa_vshf_b(shuffler1, (v16i8)src2, (v16i8)src1);
     
    988988
    989989  for (x = 0; x < width; x += 8) {
    990     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb, 0);
    991     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb, 16);
     990    src0 = (v16u8)__msa_ld_b((void*)src_argb, 0);
     991    src1 = (v16u8)__msa_ld_b((void*)src_argb, 16);
    992992    vec0 = (v16u8)__msa_srai_b((v16i8)src0, 3);
    993993    vec1 = (v16u8)__msa_slli_b((v16i8)src0, 3);
     
    10241024
    10251025  for (x = 0; x < width; x += 8) {
    1026     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb, 0);
    1027     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb, 16);
     1026    src0 = (v16u8)__msa_ld_b((void*)src_argb, 0);
     1027    src1 = (v16u8)__msa_ld_b((void*)src_argb, 16);
    10281028    vec0 = (v16u8)__msa_srai_b((v16i8)src0, 3);
    10291029    vec1 = (v16u8)__msa_slli_b((v16i8)src0, 2);
     
    10671067
    10681068  for (x = 0; x < width; x += 8) {
    1069     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb, 0);
    1070     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb, 16);
     1069    src0 = (v16u8)__msa_ld_b((void*)src_argb, 0);
     1070    src1 = (v16u8)__msa_ld_b((void*)src_argb, 16);
    10711071    vec0 = (v16u8)__msa_srai_b((v16i8)src0, 4);
    10721072    vec1 = (v16u8)__msa_srai_b((v16i8)src1, 4);
     
    10991099
    11001100  for (x = width; x > 0; x -= 16) {
    1101     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb, 0);
    1102     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb, 16);
    1103     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb, 32);
    1104     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb, 48);
     1101    src0 = (v16u8)__msa_ld_b((void*)src_argb, 0);
     1102    src1 = (v16u8)__msa_ld_b((void*)src_argb, 16);
     1103    src2 = (v16u8)__msa_ld_b((void*)src_argb, 32);
     1104    src3 = (v16u8)__msa_ld_b((void*)src_argb, 48);
    11051105    reg0 = (v16u8)__msa_pckev_b((v16i8)src1, (v16i8)src0);
    11061106    reg1 = (v16u8)__msa_pckev_b((v16i8)src3, (v16i8)src2);
     
    11651165
    11661166  for (x = 0; x < width; x += 4) {
    1167     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 0);
    1168     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb1, 0);
     1167    src0 = (v16u8)__msa_ld_b((void*)src_argb0, 0);
     1168    src1 = (v16u8)__msa_ld_b((void*)src_argb1, 0);
    11691169    vec0 = (v8u16)__msa_ilvr_b((v16i8)src0, (v16i8)src0);
    11701170    vec1 = (v8u16)__msa_ilvl_b((v16i8)src0, (v16i8)src0);
     
    12011201
    12021202  for (x = 0; x < width; x += 8) {
    1203     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 0);
    1204     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 16);
    1205     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb1, 0);
    1206     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb1, 16);
     1203    src0 = (v16u8)__msa_ld_b((void*)src_argb0, 0);
     1204    src1 = (v16u8)__msa_ld_b((void*)src_argb0, 16);
     1205    src2 = (v16u8)__msa_ld_b((void*)src_argb1, 0);
     1206    src3 = (v16u8)__msa_ld_b((void*)src_argb1, 16);
    12071207    dst0 = __msa_adds_u_b(src0, src2);
    12081208    dst1 = __msa_adds_u_b(src1, src3);
     
    12221222
    12231223  for (x = 0; x < width; x += 8) {
    1224     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 0);
    1225     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 16);
    1226     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb1, 0);
    1227     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb1, 16);
     1224    src0 = (v16u8)__msa_ld_b((void*)src_argb0, 0);
     1225    src1 = (v16u8)__msa_ld_b((void*)src_argb0, 16);
     1226    src2 = (v16u8)__msa_ld_b((void*)src_argb1, 0);
     1227    src3 = (v16u8)__msa_ld_b((void*)src_argb1, 16);
    12281228    dst0 = __msa_subs_u_b(src0, src2);
    12291229    dst1 = __msa_subs_u_b(src1, src3);
     
    12461246
    12471247  for (x = 0; x < width; x += 8) {
    1248     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb, 0);
    1249     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb, 16);
     1248    src0 = (v16u8)__msa_ld_b((void*)src_argb, 0);
     1249    src1 = (v16u8)__msa_ld_b((void*)src_argb, 16);
    12501250    vec0 = (v8u16)__msa_ilvr_b((v16i8)src0, (v16i8)src0);
    12511251    vec1 = (v8u16)__msa_ilvl_b((v16i8)src0, (v16i8)src0);
     
    13171317
    13181318  for (x = 0; x < width; x += 8) {
    1319     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb, 0);
    1320     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb, 16);
     1319    src0 = (v16u8)__msa_ld_b((void*)src_argb, 0);
     1320    src1 = (v16u8)__msa_ld_b((void*)src_argb, 16);
    13211321    vec0 = (v16u8)__msa_pckev_b((v16i8)src1, (v16i8)src0);
    13221322    vec1 = (v16u8)__msa_pckod_b((v16i8)src1, (v16i8)src0);
     
    15151515
    15161516  for (x = 0; x < width; x += 16) {
    1517     src0 = (v8u16)__msa_ld_h((v8u16*)src_argb1555, 0);
    1518     src1 = (v8u16)__msa_ld_h((v8u16*)src_argb1555, 16);
     1517    src0 = (v8u16)__msa_ld_h((void*)src_argb1555, 0);
     1518    src1 = (v8u16)__msa_ld_h((void*)src_argb1555, 16);
    15191519    vec0 = src0 & const_0x1F;
    15201520    vec1 = src1 & const_0x1F;
     
    15671567
    15681568  for (x = 0; x < width; x += 16) {
    1569     src0 = (v8u16)__msa_ld_h((v8u16*)src_rgb565, 0);
    1570     src1 = (v8u16)__msa_ld_h((v8u16*)src_rgb565, 16);
     1569    src0 = (v8u16)__msa_ld_h((void*)src_rgb565, 0);
     1570    src1 = (v8u16)__msa_ld_h((void*)src_rgb565, 16);
    15711571    vec0 = src0 & const_0x1F;
    15721572    vec1 = src0 & const_0x7E0;
     
    16121612
    16131613  for (x = 0; x < width; x += 16) {
    1614     src0 = (v16u8)__msa_ld_b((v16i8*)src_rgb24, 0);
    1615     src1 = (v16u8)__msa_ld_b((v16i8*)src_rgb24, 16);
    1616     src2 = (v16u8)__msa_ld_b((v16i8*)src_rgb24, 32);
     1614    src0 = (v16u8)__msa_ld_b((void*)src_rgb24, 0);
     1615    src1 = (v16u8)__msa_ld_b((void*)src_rgb24, 16);
     1616    src2 = (v16u8)__msa_ld_b((void*)src_rgb24, 32);
    16171617    vec0 = (v16u8)__msa_sldi_b((v16i8)src1, (v16i8)src0, 12);
    16181618    vec1 = (v16u8)__msa_sldi_b((v16i8)src2, (v16i8)src1, 8);
     
    16371637
    16381638  for (x = 0; x < width; x += 16) {
    1639     src0 = (v16u8)__msa_ld_b((v16i8*)src_raw, 0);
    1640     src1 = (v16u8)__msa_ld_b((v16i8*)src_raw, 16);
    1641     src2 = (v16u8)__msa_ld_b((v16i8*)src_raw, 32);
     1639    src0 = (v16u8)__msa_ld_b((void*)src_raw, 0);
     1640    src1 = (v16u8)__msa_ld_b((void*)src_raw, 16);
     1641    src2 = (v16u8)__msa_ld_b((void*)src_raw, 32);
    16421642    vec0 = (v16u8)__msa_sldi_b((v16i8)src1, (v16i8)src0, 12);
    16431643    vec1 = (v16u8)__msa_sldi_b((v16i8)src2, (v16i8)src1, 8);
     
    16671667
    16681668  for (x = 0; x < width; x += 16) {
    1669     src0 = (v8u16)__msa_ld_b((v8i16*)src_argb1555, 0);
    1670     src1 = (v8u16)__msa_ld_b((v8i16*)src_argb1555, 16);
     1669    src0 = (v8u16)__msa_ld_b((void*)src_argb1555, 0);
     1670    src1 = (v8u16)__msa_ld_b((void*)src_argb1555, 16);
    16711671    vec0 = src0 & const_0x1F;
    16721672    vec1 = src1 & const_0x1F;
     
    17261726
    17271727  for (x = 0; x < width; x += 16) {
    1728     src0 = (v8u16)__msa_ld_b((v8i16*)src_rgb565, 0);
    1729     src1 = (v8u16)__msa_ld_b((v8i16*)src_rgb565, 16);
     1728    src0 = (v8u16)__msa_ld_b((void*)src_rgb565, 0);
     1729    src1 = (v8u16)__msa_ld_b((void*)src_rgb565, 16);
    17301730    vec0 = src0 & const_0x1F;
    17311731    vec1 = src0 & const_0x7E0;
     
    17901790
    17911791  for (x = 0; x < width; x += 16) {
    1792     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 0);
    1793     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 16);
    1794     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 32);
     1792    src0 = (v16u8)__msa_ld_b((void*)src_argb0, 0);
     1793    src1 = (v16u8)__msa_ld_b((void*)src_argb0, 16);
     1794    src2 = (v16u8)__msa_ld_b((void*)src_argb0, 32);
    17951795    reg0 = (v16u8)__msa_vshf_b(mask0, zero, (v16i8)src0);
    17961796    reg1 = (v16u8)__msa_vshf_b(mask1, (v16i8)src1, (v16i8)src0);
     
    18311831
    18321832  for (x = 0; x < width; x += 16) {
    1833     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 0);
    1834     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 16);
    1835     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 32);
     1833    src0 = (v16u8)__msa_ld_b((void*)src_argb0, 0);
     1834    src1 = (v16u8)__msa_ld_b((void*)src_argb0, 16);
     1835    src2 = (v16u8)__msa_ld_b((void*)src_argb0, 32);
    18361836    reg0 = (v16u8)__msa_vshf_b(mask0, zero, (v16i8)src0);
    18371837    reg1 = (v16u8)__msa_vshf_b(mask1, (v16i8)src1, (v16i8)src0);
     
    18781878
    18791879  for (x = 0; x < width; x += 16) {
    1880     src0 = (v8u16)__msa_ld_b((v8i16*)s, 0);
    1881     src1 = (v8u16)__msa_ld_b((v8i16*)s, 16);
    1882     src2 = (v8u16)__msa_ld_b((v8i16*)t, 0);
    1883     src3 = (v8u16)__msa_ld_b((v8i16*)t, 16);
     1880    src0 = (v8u16)__msa_ld_b((void*)s, 0);
     1881    src1 = (v8u16)__msa_ld_b((void*)s, 16);
     1882    src2 = (v8u16)__msa_ld_b((void*)t, 0);
     1883    src3 = (v8u16)__msa_ld_b((void*)t, 16);
    18841884    vec0 = src0 & const_0x1F;
    18851885    vec1 = src1 & const_0x1F;
     
    19601960
    19611961  for (x = 0; x < width; x += 16) {
    1962     src0 = (v8u16)__msa_ld_b((v8i16*)s, 0);
    1963     src1 = (v8u16)__msa_ld_b((v8i16*)s, 16);
    1964     src2 = (v8u16)__msa_ld_b((v8i16*)t, 0);
    1965     src3 = (v8u16)__msa_ld_b((v8i16*)t, 16);
     1962    src0 = (v8u16)__msa_ld_b((void*)s, 0);
     1963    src1 = (v8u16)__msa_ld_b((void*)s, 16);
     1964    src2 = (v8u16)__msa_ld_b((void*)t, 0);
     1965    src3 = (v8u16)__msa_ld_b((void*)t, 16);
    19661966    vec0 = src0 & const_0x1F;
    19671967    vec1 = src1 & const_0x1F;
     
    20422042
    20432043  for (x = 0; x < width; x += 16) {
    2044     inp0 = (v16u8)__msa_ld_b((v16i8*)s, 0);
    2045     inp1 = (v16u8)__msa_ld_b((v16i8*)s, 16);
    2046     inp2 = (v16u8)__msa_ld_b((v16i8*)s, 32);
    2047     inp3 = (v16u8)__msa_ld_b((v16i8*)t, 0);
    2048     inp4 = (v16u8)__msa_ld_b((v16i8*)t, 16);
    2049     inp5 = (v16u8)__msa_ld_b((v16i8*)t, 32);
     2044    inp0 = (v16u8)__msa_ld_b((void*)s, 0);
     2045    inp1 = (v16u8)__msa_ld_b((void*)s, 16);
     2046    inp2 = (v16u8)__msa_ld_b((void*)s, 32);
     2047    inp3 = (v16u8)__msa_ld_b((void*)t, 0);
     2048    inp4 = (v16u8)__msa_ld_b((void*)t, 16);
     2049    inp5 = (v16u8)__msa_ld_b((void*)t, 32);
    20502050    src1 = (v16u8)__msa_sldi_b((v16i8)inp1, (v16i8)inp0, 12);
    20512051    src5 = (v16u8)__msa_sldi_b((v16i8)inp4, (v16i8)inp3, 12);
     
    21472147
    21482148  for (x = 0; x < width; x += 16) {
    2149     inp0 = (v16u8)__msa_ld_b((v16i8*)s, 0);
    2150     inp1 = (v16u8)__msa_ld_b((v16i8*)s, 16);
    2151     inp2 = (v16u8)__msa_ld_b((v16i8*)s, 32);
    2152     inp3 = (v16u8)__msa_ld_b((v16i8*)t, 0);
    2153     inp4 = (v16u8)__msa_ld_b((v16i8*)t, 16);
    2154     inp5 = (v16u8)__msa_ld_b((v16i8*)t, 32);
     2149    inp0 = (v16u8)__msa_ld_b((void*)s, 0);
     2150    inp1 = (v16u8)__msa_ld_b((void*)s, 16);
     2151    inp2 = (v16u8)__msa_ld_b((void*)s, 32);
     2152    inp3 = (v16u8)__msa_ld_b((void*)t, 0);
     2153    inp4 = (v16u8)__msa_ld_b((void*)t, 16);
     2154    inp5 = (v16u8)__msa_ld_b((void*)t, 32);
    21552155    src1 = (v16u8)__msa_sldi_b((v16i8)inp1, (v16i8)inp0, 12);
    21562156    src5 = (v16u8)__msa_sldi_b((v16i8)inp4, (v16i8)inp3, 12);
     
    23542354
    23552355  for (x = 0; x < width; x += 16) {
    2356     src0 = (v16u8)__msa_ld_b((v16i8*)src_sobelx, 0);
    2357     src1 = (v16u8)__msa_ld_b((v16i8*)src_sobely, 0);
     2356    src0 = (v16u8)__msa_ld_b((void*)src_sobelx, 0);
     2357    src1 = (v16u8)__msa_ld_b((void*)src_sobely, 0);
    23582358    vec0 = __msa_adds_u_b(src0, src1);
    23592359    dst0 = (v16u8)__msa_vshf_b(mask0, (v16i8)alpha, (v16i8)vec0);
     
    23762376
    23772377  for (x = 0; x < width; x += 32) {
    2378     src0 = (v16u8)__msa_ld_b((v16i8*)src_sobelx, 0);
    2379     src1 = (v16u8)__msa_ld_b((v16i8*)src_sobelx, 16);
    2380     src2 = (v16u8)__msa_ld_b((v16i8*)src_sobely, 0);
    2381     src3 = (v16u8)__msa_ld_b((v16i8*)src_sobely, 16);
     2378    src0 = (v16u8)__msa_ld_b((void*)src_sobelx, 0);
     2379    src1 = (v16u8)__msa_ld_b((void*)src_sobelx, 16);
     2380    src2 = (v16u8)__msa_ld_b((void*)src_sobely, 0);
     2381    src3 = (v16u8)__msa_ld_b((void*)src_sobely, 16);
    23822382    dst0 = __msa_adds_u_b(src0, src2);
    23832383    dst1 = __msa_adds_u_b(src1, src3);
     
    23992399
    24002400  for (x = 0; x < width; x += 16) {
    2401     src0 = (v16u8)__msa_ld_b((v16i8*)src_sobelx, 0);
    2402     src1 = (v16u8)__msa_ld_b((v16i8*)src_sobely, 0);
     2401    src0 = (v16u8)__msa_ld_b((void*)src_sobelx, 0);
     2402    src1 = (v16u8)__msa_ld_b((void*)src_sobely, 0);
    24032403    vec0 = __msa_adds_u_b(src0, src1);
    24042404    vec1 = (v16u8)__msa_ilvr_b((v16i8)src0, (v16i8)src1);
     
    24252425
    24262426  for (x = 0; x < width; x += 16) {
    2427     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 0);
    2428     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 16);
    2429     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 32);
    2430     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 48);
     2427    src0 = (v16u8)__msa_ld_b((void*)src_argb0, 0);
     2428    src1 = (v16u8)__msa_ld_b((void*)src_argb0, 16);
     2429    src2 = (v16u8)__msa_ld_b((void*)src_argb0, 32);
     2430    src3 = (v16u8)__msa_ld_b((void*)src_argb0, 48);
    24312431    ARGBTOY(src0, src1, src2, src3, const_0x4B0F, const_0x26, const_0x40, 7,
    24322432            dst0);
     
    24452445
    24462446  for (x = 0; x < width; x += 16) {
    2447     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 0);
    2448     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 16);
    2449     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 32);
    2450     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 48);
     2447    src0 = (v16u8)__msa_ld_b((void*)src_argb0, 0);
     2448    src1 = (v16u8)__msa_ld_b((void*)src_argb0, 16);
     2449    src2 = (v16u8)__msa_ld_b((void*)src_argb0, 32);
     2450    src3 = (v16u8)__msa_ld_b((void*)src_argb0, 48);
    24512451    ARGBTOY(src0, src1, src2, src3, const_0x4200, const_0x1981, const_0x1080, 8,
    24522452            dst0);
     
    24652465
    24662466  for (x = 0; x < width; x += 16) {
    2467     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 0);
    2468     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 16);
    2469     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 32);
    2470     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 48);
     2467    src0 = (v16u8)__msa_ld_b((void*)src_argb0, 0);
     2468    src1 = (v16u8)__msa_ld_b((void*)src_argb0, 16);
     2469    src2 = (v16u8)__msa_ld_b((void*)src_argb0, 32);
     2470    src3 = (v16u8)__msa_ld_b((void*)src_argb0, 48);
    24712471    ARGBTOY(src0, src1, src2, src3, const_0x8142, const_0x19, const_0x1080, 8,
    24722472            dst0);
     
    24852485
    24862486  for (x = 0; x < width; x += 16) {
    2487     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 0);
    2488     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 16);
    2489     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 32);
    2490     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 48);
     2487    src0 = (v16u8)__msa_ld_b((void*)src_argb0, 0);
     2488    src1 = (v16u8)__msa_ld_b((void*)src_argb0, 16);
     2489    src2 = (v16u8)__msa_ld_b((void*)src_argb0, 32);
     2490    src3 = (v16u8)__msa_ld_b((void*)src_argb0, 48);
    24912491    ARGBTOY(src0, src1, src2, src3, const_0x1900, const_0x4281, const_0x1080, 8,
    24922492            dst0);
     
    25192519
    25202520  for (x = 0; x < width; x += 32) {
    2521     src0 = (v16u8)__msa_ld_b((v16i8*)s, 0);
    2522     src1 = (v16u8)__msa_ld_b((v16i8*)s, 16);
    2523     src2 = (v16u8)__msa_ld_b((v16i8*)s, 32);
    2524     src3 = (v16u8)__msa_ld_b((v16i8*)s, 48);
    2525     src4 = (v16u8)__msa_ld_b((v16i8*)t, 0);
    2526     src5 = (v16u8)__msa_ld_b((v16i8*)t, 16);
    2527     src6 = (v16u8)__msa_ld_b((v16i8*)t, 32);
    2528     src7 = (v16u8)__msa_ld_b((v16i8*)t, 48);
     2521    src0 = (v16u8)__msa_ld_b((void*)s, 0);
     2522    src1 = (v16u8)__msa_ld_b((void*)s, 16);
     2523    src2 = (v16u8)__msa_ld_b((void*)s, 32);
     2524    src3 = (v16u8)__msa_ld_b((void*)s, 48);
     2525    src4 = (v16u8)__msa_ld_b((void*)t, 0);
     2526    src5 = (v16u8)__msa_ld_b((void*)t, 16);
     2527    src6 = (v16u8)__msa_ld_b((void*)t, 32);
     2528    src7 = (v16u8)__msa_ld_b((void*)t, 48);
    25292529    src0 = __msa_aver_u_b(src0, src4);
    25302530    src1 = __msa_aver_u_b(src1, src5);
     
    25372537    vec0 = __msa_aver_u_b(src4, src6);
    25382538    vec1 = __msa_aver_u_b(src5, src7);
    2539     src0 = (v16u8)__msa_ld_b((v16i8*)s, 64);
    2540     src1 = (v16u8)__msa_ld_b((v16i8*)s, 80);
    2541     src2 = (v16u8)__msa_ld_b((v16i8*)s, 96);
    2542     src3 = (v16u8)__msa_ld_b((v16i8*)s, 112);
    2543     src4 = (v16u8)__msa_ld_b((v16i8*)t, 64);
    2544     src5 = (v16u8)__msa_ld_b((v16i8*)t, 80);
    2545     src6 = (v16u8)__msa_ld_b((v16i8*)t, 96);
    2546     src7 = (v16u8)__msa_ld_b((v16i8*)t, 112);
     2539    src0 = (v16u8)__msa_ld_b((void*)s, 64);
     2540    src1 = (v16u8)__msa_ld_b((void*)s, 80);
     2541    src2 = (v16u8)__msa_ld_b((void*)s, 96);
     2542    src3 = (v16u8)__msa_ld_b((void*)s, 112);
     2543    src4 = (v16u8)__msa_ld_b((void*)t, 64);
     2544    src5 = (v16u8)__msa_ld_b((void*)t, 80);
     2545    src6 = (v16u8)__msa_ld_b((void*)t, 96);
     2546    src7 = (v16u8)__msa_ld_b((void*)t, 112);
    25472547    src0 = __msa_aver_u_b(src0, src4);
    25482548    src1 = __msa_aver_u_b(src1, src5);
     
    27472747
    27482748  for (x = 0; x < width; x += 16) {
    2749     src0 = (v16u8)__msa_ld_b((v16i8*)src_y, 0);
     2749    src0 = (v16u8)__msa_ld_b((void*)src_y, 0);
    27502750    vec0 = (v8i16)__msa_ilvr_b((v16i8)src0, (v16i8)src0);
    27512751    vec1 = (v8i16)__msa_ilvl_b((v16i8)src0, (v16i8)src0);
     
    27932793
    27942794  for (x = 0; x < width; x += 16) {
    2795     src0 = (v16u8)__msa_ld_b((v16i8*)src_y, 0);
     2795    src0 = (v16u8)__msa_ld_b((void*)src_y, 0);
    27962796    vec0 = (v16u8)__msa_ilvr_b((v16i8)src0, (v16i8)src0);
    27972797    vec1 = (v16u8)__msa_ilvl_b((v16i8)src0, (v16i8)src0);
     
    28252825
    28262826  for (x = 0; x < width; x += 8) {
    2827     src0 = (v16u8)__msa_ld_b((v16i8*)src_yuy2, 0);
     2827    src0 = (v16u8)__msa_ld_b((void*)src_yuy2, 0);
    28282828    src1 = (v16u8)__msa_pckev_b((v16i8)src0, (v16i8)src0);
    28292829    src2 = (v16u8)__msa_pckod_b((v16i8)src0, (v16i8)src0);
     
    28532853
    28542854  for (x = 0; x < width; x += 8) {
    2855     src0 = (v16u8)__msa_ld_b((v16i8*)src_uyvy, 0);
     2855    src0 = (v16u8)__msa_ld_b((void*)src_uyvy, 0);
    28562856    src1 = (v16u8)__msa_pckod_b((v16i8)src0, (v16i8)src0);
    28572857    src2 = (v16u8)__msa_pckev_b((v16i8)src0, (v16i8)src0);
     
    28852885  if (128 == y1_fraction) {
    28862886    for (x = 0; x < width; x += 32) {
    2887       src0 = (v16u8)__msa_ld_b((v16i8*)s, 0);
    2888       src1 = (v16u8)__msa_ld_b((v16i8*)s, 16);
    2889       src2 = (v16u8)__msa_ld_b((v16i8*)t, 0);
    2890       src3 = (v16u8)__msa_ld_b((v16i8*)t, 16);
     2887      src0 = (v16u8)__msa_ld_b((void*)s, 0);
     2888      src1 = (v16u8)__msa_ld_b((void*)s, 16);
     2889      src2 = (v16u8)__msa_ld_b((void*)t, 0);
     2890      src3 = (v16u8)__msa_ld_b((void*)t, 16);
    28912891      dst0 = __msa_aver_u_b(src0, src2);
    28922892      dst1 = __msa_aver_u_b(src1, src3);
     
    29032903
    29042904  for (x = 0; x < width; x += 32) {
    2905     src0 = (v16u8)__msa_ld_b((v16i8*)s, 0);
    2906     src1 = (v16u8)__msa_ld_b((v16i8*)s, 16);
    2907     src2 = (v16u8)__msa_ld_b((v16i8*)t, 0);
    2908     src3 = (v16u8)__msa_ld_b((v16i8*)t, 16);
     2905    src0 = (v16u8)__msa_ld_b((void*)s, 0);
     2906    src1 = (v16u8)__msa_ld_b((void*)s, 16);
     2907    src2 = (v16u8)__msa_ld_b((void*)t, 0);
     2908    src3 = (v16u8)__msa_ld_b((void*)t, 16);
    29092909    vec0 = (v8u16)__msa_ilvr_b((v16i8)src2, (v16i8)src0);
    29102910    vec1 = (v8u16)__msa_ilvl_b((v16i8)src2, (v16i8)src0);
     
    29482948
    29492949  for (x = 0; x < width; x += 16) {
    2950     src0 = (v16u8)__msa_ld_b((v16i8*)src_raw, 0);
    2951     src1 = (v16u8)__msa_ld_b((v16i8*)src_raw, 16);
    2952     src2 = (v16u8)__msa_ld_b((v16i8*)src_raw, 32);
     2950    src0 = (v16u8)__msa_ld_b((void*)src_raw, 0);
     2951    src1 = (v16u8)__msa_ld_b((void*)src_raw, 16);
     2952    src2 = (v16u8)__msa_ld_b((void*)src_raw, 32);
    29532953    src3 = (v16u8)__msa_sldi_b((v16i8)src1, (v16i8)src0, 8);
    29542954    src4 = (v16u8)__msa_sldi_b((v16i8)src2, (v16i8)src1, 8);
     
    29712971
    29722972  for (x = 0; x < width; x += 16) {
    2973     src0 = (v16u8)__msa_ld_b((v16i8*)src_u, 0);
    2974     src1 = (v16u8)__msa_ld_b((v16i8*)src_v, 0);
     2973    src0 = (v16u8)__msa_ld_b((void*)src_u, 0);
     2974    src1 = (v16u8)__msa_ld_b((void*)src_v, 0);
    29752975    dst0 = (v16u8)__msa_ilvr_b((v16i8)src1, (v16i8)src0);
    29762976    dst1 = (v16u8)__msa_ilvl_b((v16i8)src1, (v16i8)src0);
     
    29892989
    29902990  for (i = 0; i < width; i += 16) {
    2991     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb, 0);
    2992     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb, 16);
    2993     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb, 32);
    2994     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb, 48);
     2991    src0 = (v16u8)__msa_ld_b((void*)src_argb, 0);
     2992    src1 = (v16u8)__msa_ld_b((void*)src_argb, 16);
     2993    src2 = (v16u8)__msa_ld_b((void*)src_argb, 32);
     2994    src3 = (v16u8)__msa_ld_b((void*)src_argb, 48);
    29952995    vec0 = (v16u8)__msa_pckod_b((v16i8)src1, (v16i8)src0);
    29962996    vec1 = (v16u8)__msa_pckod_b((v16i8)src3, (v16i8)src2);
     
    30163016
    30173017  for (x = 0; x < width; x += 8) {
    3018     src0 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 0);
    3019     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb0, 16);
    3020     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb1, 0);
    3021     src3 = (v16u8)__msa_ld_b((v16i8*)src_argb1, 16);
     3018    src0 = (v16u8)__msa_ld_b((void*)src_argb0, 0);
     3019    src1 = (v16u8)__msa_ld_b((void*)src_argb0, 16);
     3020    src2 = (v16u8)__msa_ld_b((void*)src_argb1, 0);
     3021    src3 = (v16u8)__msa_ld_b((void*)src_argb1, 16);
    30223022    vec0 = (v8u16)__msa_ilvr_b(zero, (v16i8)src0);
    30233023    vec1 = (v8u16)__msa_ilvl_b(zero, (v16i8)src0);
     
    30843084
    30853085  for (x = 0; x < width; x += 8) {
    3086     src0 = (v16u8)__msa_ld_b((v16i8*)dst_argb, 0);
    3087     src1 = (v16u8)__msa_ld_b((v16i8*)dst_argb, 16);
    3088     src2 = (v16u8)__msa_ld_b((v16i8*)dst_argb, 32);
    3089     src3 = (v16u8)__msa_ld_b((v16i8*)dst_argb, 48);
     3086    src0 = (v16u8)__msa_ld_b((void*)dst_argb, 0);
     3087    src1 = (v16u8)__msa_ld_b((void*)dst_argb, 16);
     3088    src2 = (v16u8)__msa_ld_b((void*)dst_argb, 32);
     3089    src3 = (v16u8)__msa_ld_b((void*)dst_argb, 48);
    30903090    vec0 = (v8i16)__msa_ilvr_b(zero, (v16i8)src0);
    30913091    vec1 = (v8i16)__msa_ilvl_b(zero, (v16i8)src0);
     
    31873187  v8i16 max = __msa_ldi_h(255);
    31883188
    3189   src0 = __msa_ld_b((v16i8*)matrix_argb, 0);
     3189  src0 = __msa_ld_b((void*)matrix_argb, 0);
    31903190  vec0 = (v8i16)__msa_ilvr_b(zero, src0);
    31913191  vec1 = (v8i16)__msa_ilvl_b(zero, src0);
    31923192
    31933193  for (x = 0; x < width; x += 8) {
    3194     src1 = (v16u8)__msa_ld_b((v16i8*)src_argb, 0);
    3195     src2 = (v16u8)__msa_ld_b((v16i8*)src_argb, 16);
     3194    src1 = (v16u8)__msa_ld_b((void*)src_argb, 0);
     3195    src2 = (v16u8)__msa_ld_b((void*)src_argb, 16);
    31963196    vec2 = (v8i16)__msa_ilvr_b(zero, (v16i8)src1);
    31973197    vec3 = (v8i16)__msa_ilvl_b(zero, (v16i8)src1);
     
    32903290
    32913291  for (x = 0; x < width; x += 32) {
    3292     src0 = (v16u8)__msa_ld_b((v16i8*)src_uv, 0);
    3293     src1 = (v16u8)__msa_ld_b((v16i8*)src_uv, 16);
    3294     src2 = (v16u8)__msa_ld_b((v16i8*)src_uv, 32);
    3295     src3 = (v16u8)__msa_ld_b((v16i8*)src_uv, 48);
     3292    src0 = (v16u8)__msa_ld_b((void*)src_uv, 0);
     3293    src1 = (v16u8)__msa_ld_b((void*)src_uv, 16);
     3294    src2 = (v16u8)__msa_ld_b((void*)src_uv, 32);
     3295    src3 = (v16u8)__msa_ld_b((void*)src_uv, 48);
    32963296    dst0 = (v16u8)__msa_pckev_b((v16i8)src1, (v16i8)src0);
    32973297    dst1 = (v16u8)__msa_pckev_b((v16i8)src3, (v16i8)src2);
     
    33303330  for (x = 0; x < width; x += 32) {
    33313331    src_uv -= 64;
    3332     src2 = (v16u8)__msa_ld_b((v16i8*)src_uv, 0);
    3333     src3 = (v16u8)__msa_ld_b((v16i8*)src_uv, 16);
    3334     src0 = (v16u8)__msa_ld_b((v16i8*)src_uv, 32);
    3335     src1 = (v16u8)__msa_ld_b((v16i8*)src_uv, 48);
     3332    src2 = (v16u8)__msa_ld_b((void*)src_uv, 0);
     3333    src3 = (v16u8)__msa_ld_b((void*)src_uv, 16);
     3334    src0 = (v16u8)__msa_ld_b((void*)src_uv, 32);
     3335    src1 = (v16u8)__msa_ld_b((void*)src_uv, 48);
    33363336    dst0 = (v16u8)__msa_vshf_b(mask1, (v16i8)src1, (v16i8)src0);
    33373337    dst1 = (v16u8)__msa_vshf_b(mask1, (v16i8)src3, (v16i8)src2);
     
    33603360
    33613361  for (x = 0; x < width; x += 16) {
    3362     src0 = (v16u8)__msa_ld_b((v16i8*)src_y0, 0);
    3363     src1 = (v16u8)__msa_ld_b((v16i8*)src_y0, 16);
    3364     src2 = (v16u8)__msa_ld_b((v16i8*)src_y1, 0);
    3365     src3 = (v16u8)__msa_ld_b((v16i8*)src_y1, 16);
    3366     src4 = (v16u8)__msa_ld_b((v16i8*)src_y2, 0);
    3367     src5 = (v16u8)__msa_ld_b((v16i8*)src_y2, 16);
     3362    src0 = (v16u8)__msa_ld_b((void*)src_y0, 0);
     3363    src1 = (v16u8)__msa_ld_b((void*)src_y0, 16);
     3364    src2 = (v16u8)__msa_ld_b((void*)src_y1, 0);
     3365    src3 = (v16u8)__msa_ld_b((void*)src_y1, 16);
     3366    src4 = (v16u8)__msa_ld_b((void*)src_y2, 0);
     3367    src5 = (v16u8)__msa_ld_b((void*)src_y2, 16);
    33683368    vec0 = (v8i16)__msa_vshf_b(mask0, (v16i8)src1, (v16i8)src0);
    33693369    vec1 = (v8i16)__msa_vshf_b(mask1, (v16i8)src1, (v16i8)src0);
     
    34103410
    34113411  for (x = 0; x < width; x += 16) {
    3412     src0 = (v16u8)__msa_ld_b((v16i8*)src_y0, 0);
    3413     src1 = (v16u8)__msa_ld_b((v16i8*)src_y1, 0);
     3412    src0 = (v16u8)__msa_ld_b((void*)src_y0, 0);
     3413    src1 = (v16u8)__msa_ld_b((void*)src_y1, 0);
    34143414    vec0 = (v8i16)__msa_ilvr_b((v16i8)zero, (v16i8)src0);
    34153415    vec1 = (v8i16)__msa_ilvl_b((v16i8)zero, (v16i8)src0);
     
    34583458
    34593459  for (i = 0; i < width; i += 32) {
    3460     src0 = (v8u16)__msa_ld_h((v8i16*)src, 0);
    3461     src1 = (v8u16)__msa_ld_h((v8i16*)src, 16);
    3462     src2 = (v8u16)__msa_ld_h((v8i16*)src, 32);
    3463     src3 = (v8u16)__msa_ld_h((v8i16*)src, 48);
     3460    src0 = (v8u16)__msa_ld_h((void*)src, 0);
     3461    src1 = (v8u16)__msa_ld_h((void*)src, 16);
     3462    src2 = (v8u16)__msa_ld_h((void*)src, 32);
     3463    src3 = (v8u16)__msa_ld_h((void*)src, 48);
    34643464    vec0 = (v4u32)__msa_ilvr_h(zero, (v8i16)src0);
    34653465    vec1 = (v4u32)__msa_ilvl_h(zero, (v8i16)src0);
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/row_neon.cc

    r235135 r239415  
    26052605}
    26062606
     2607// %y passes a float as a scalar vector for vector * scalar multiply.
     2608// the regoster must be d0 to d15 and indexed with [0] or [1] to access
     2609// the float in the first or second float of the d-reg
     2610
    26072611void HalfFloat1Row_NEON(const uint16_t* src,
    26082612                        uint16_t* dst,
     
    26102614                        int width) {
    26112615  asm volatile(
    2612       "vdup.32    q0, %3                         \n"
    26132616
    26142617      "1:                                        \n"
     
    26192622      "vcvt.f32.u32  q2, q2                      \n"  // 8 floats
    26202623      "vcvt.f32.u32  q3, q3                      \n"
    2621       "vmul.f32   q2, q2, q0                     \n"  // adjust exponent
    2622       "vmul.f32   q3, q3, q0                     \n"
     2624      "vmul.f32   q2, q2, %y3                    \n"  // adjust exponent
     2625      "vmul.f32   q3, q3, %y3                    \n"
    26232626      "vqshrn.u32 d2, q2, #13                    \n"  // isolate halffloat
    26242627      "vqshrn.u32 d3, q3, #13                    \n"
     
    26282631        "+r"(dst),              // %1
    26292632        "+r"(width)             // %2
    2630       : "r"(1.9259299444e-34f)  // %3
    2631       : "cc", "memory", "q0", "q1", "q2", "q3");
    2632 }
    2633 
    2634 // TODO(fbarchard): multiply by element.
     2633      : "w"(1.9259299444e-34f)  // %3
     2634      : "cc", "memory", "q1", "q2", "q3");
     2635}
     2636
    26352637void HalfFloatRow_NEON(const uint16_t* src,
    26362638                       uint16_t* dst,
     
    26382640                       int width) {
    26392641  asm volatile(
    2640       "vdup.32    q0, %3                         \n"
    26412642
    26422643      "1:                                        \n"
     
    26472648      "vcvt.f32.u32  q2, q2                      \n"  // 8 floats
    26482649      "vcvt.f32.u32  q3, q3                      \n"
    2649       "vmul.f32   q2, q2, q0                     \n"  // adjust exponent
    2650       "vmul.f32   q3, q3, q0                     \n"
     2650      "vmul.f32   q2, q2, %y3                    \n"  // adjust exponent
     2651      "vmul.f32   q3, q3, %y3                    \n"
    26512652      "vqshrn.u32 d2, q2, #13                    \n"  // isolate halffloat
    26522653      "vqshrn.u32 d3, q3, #13                    \n"
     
    26562657        "+r"(dst),                      // %1
    26572658        "+r"(width)                     // %2
    2658       : "r"(scale * 1.9259299444e-34f)  // %3
    2659       : "cc", "memory", "q0", "q1", "q2", "q3");
     2659      : "w"(scale * 1.9259299444e-34f)  // %3
     2660      : "cc", "memory", "q1", "q2", "q3");
    26602661}
    26612662
     
    26652666                         int width) {
    26662667  asm volatile(
    2667       "vdup.32    q0, %3                         \n"
    26682668
    26692669      "1:                                        \n"
     
    26752675      "vcvt.f32.u32  q2, q2                      \n"  // 8 floats
    26762676      "vcvt.f32.u32  q3, q3                      \n"
    2677       "vmul.f32   q2, q2, d0[0]                  \n"  // scale
    2678       "vmul.f32   q3, q3, d0[0]                  \n"
     2677      "vmul.f32   q2, q2, %y3                    \n"  // scale
     2678      "vmul.f32   q3, q3, %y3                    \n"
    26792679      "vst1.8     {q2, q3}, [%1]!                \n"  // store 8 floats
    26802680      "bgt        1b                             \n"
     
    26822682        "+r"(dst),   // %1
    26832683        "+r"(width)  // %2
    2684       : "r"(scale)   // %3
    2685       : "cc", "memory", "q0", "q1", "q2", "q3");
     2684      : "w"(scale)   // %3
     2685      : "cc", "memory", "q1", "q2", "q3");
    26862686}
    26872687
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/scale.cc

    r235135 r239415  
    119119  }
    120120#endif
     121#if defined(HAS_SCALEROWDOWN2_MMI)
     122  if (TestCpuFlag(kCpuHasMMI)) {
     123    ScaleRowDown2 =
     124        filtering == kFilterNone
     125            ? ScaleRowDown2_Any_MMI
     126            : (filtering == kFilterLinear ? ScaleRowDown2Linear_Any_MMI
     127                                          : ScaleRowDown2Box_Any_MMI);
     128    if (IS_ALIGNED(dst_width, 8)) {
     129      ScaleRowDown2 = filtering == kFilterNone ? ScaleRowDown2_MMI
     130                                               : (filtering == kFilterLinear
     131                                                      ? ScaleRowDown2Linear_MMI
     132                                                      : ScaleRowDown2Box_MMI);
     133    }
     134  }
     135#endif
    121136
    122137  if (filtering == kFilterLinear) {
     
    170185  }
    171186#endif
     187#if defined(HAS_SCALEROWDOWN2_16_MMI)
     188  if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(dst_width, 4)) {
     189    ScaleRowDown2 = filtering == kFilterNone ? ScaleRowDown2_16_MMI
     190                                             : (filtering == kFilterLinear
     191                                                    ? ScaleRowDown2Linear_16_MMI
     192                                                    : ScaleRowDown2Box_16_MMI);
     193  }
     194#endif
    172195
    173196  if (filtering == kFilterLinear) {
     
    242265  }
    243266#endif
     267#if defined(HAS_SCALEROWDOWN4_MMI)
     268  if (TestCpuFlag(kCpuHasMMI)) {
     269    ScaleRowDown4 =
     270        filtering ? ScaleRowDown4Box_Any_MMI : ScaleRowDown4_Any_MMI;
     271    if (IS_ALIGNED(dst_width, 8)) {
     272      ScaleRowDown4 = filtering ? ScaleRowDown4Box_MMI : ScaleRowDown4_MMI;
     273    }
     274  }
     275#endif
    244276
    245277  if (filtering == kFilterLinear) {
     
    283315    ScaleRowDown4 =
    284316        filtering ? ScaleRowDown4Box_16_SSE2 : ScaleRowDown4_16_SSE2;
     317  }
     318#endif
     319#if defined(HAS_SCALEROWDOWN4_16_MMI)
     320  if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(dst_width, 8)) {
     321    ScaleRowDown4 = filtering ? ScaleRowDown4Box_16_MMI : ScaleRowDown4_16_MMI;
    285322  }
    286323#endif
     
    850887    }
    851888#endif
     889#if defined(HAS_SCALEADDROW_MMI)
     890    if (TestCpuFlag(kCpuHasMMI)) {
     891      ScaleAddRow = ScaleAddRow_Any_MMI;
     892      if (IS_ALIGNED(src_width, 8)) {
     893        ScaleAddRow = ScaleAddRow_MMI;
     894      }
     895    }
     896#endif
    852897
    853898    for (j = 0; j < dst_height; ++j) {
     
    905950#endif
    906951
     952#if defined(HAS_SCALEADDROW_16_MMI)
     953    if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(src_width, 4)) {
     954      ScaleAddRow = ScaleAddRow_16_MMI;
     955    }
     956#endif
    907957    for (j = 0; j < dst_height; ++j) {
    908958      int boxheight;
     
    9861036    if (IS_ALIGNED(src_width, 32)) {
    9871037      InterpolateRow = InterpolateRow_MSA;
     1038    }
     1039  }
     1040#endif
     1041#if defined(HAS_INTERPOLATEROW_MMI)
     1042  if (TestCpuFlag(kCpuHasMMI)) {
     1043    InterpolateRow = InterpolateRow_Any_MMI;
     1044    if (IS_ALIGNED(src_width, 16)) {
     1045      InterpolateRow = InterpolateRow_MMI;
    9881046    }
    9891047  }
     
    12081266    }
    12091267#endif
     1268#if defined(HAS_SCALECOLS_MMI)
     1269    if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(dst_width, 8)) {
     1270      ScaleFilterCols = ScaleColsUp2_MMI;
     1271    }
     1272#endif
    12101273  }
    12111274
     
    13351398    }
    13361399#endif
     1400#if defined(HAS_SCALECOLS_16_MMI)
     1401    if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(dst_width, 8)) {
     1402      ScaleFilterCols = ScaleColsUp2_16_MMI;
     1403    }
     1404#endif
    13371405  }
    13381406
     
    14201488    }
    14211489#endif
     1490#if defined(HAS_SCALECOLS_MMI)
     1491    if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(dst_width, 8)) {
     1492      ScaleCols = ScaleColsUp2_MMI;
     1493    }
     1494#endif
    14221495  }
    14231496
     
    14541527    if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(dst_width, 8)) {
    14551528      ScaleCols = ScaleColsUp2_16_SSE2;
     1529    }
     1530#endif
     1531#if defined(HAS_SCALECOLS_16_MMI)
     1532    if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(dst_width, 8)) {
     1533      ScaleCols = ScaleColsUp2_16_MMI;
    14561534    }
    14571535#endif
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/scale_any.cc

    r235135 r239415  
    88 *  be found in the AUTHORS file in the root of the source tree.
    99 */
     10
     11#include <string.h>  // For memset/memcpy
    1012
    1113#include "libyuv/scale.h"
     
    4244#ifdef HAS_SCALEARGBCOLS_MSA
    4345CANY(ScaleARGBCols_Any_MSA, ScaleARGBCols_MSA, ScaleARGBCols_C, 4, 3)
     46#endif
     47#ifdef HAS_SCALEARGBCOLS_MMI
     48CANY(ScaleARGBCols_Any_MMI, ScaleARGBCols_MMI, ScaleARGBCols_C, 4, 0)
    4449#endif
    4550#ifdef HAS_SCALEARGBFILTERCOLS_NEON
     
    166171      31)
    167172#endif
     173#ifdef HAS_SCALEROWDOWN2_MMI
     174SDANY(ScaleRowDown2_Any_MMI, ScaleRowDown2_MMI, ScaleRowDown2_C, 2, 1, 7)
     175SDANY(ScaleRowDown2Linear_Any_MMI,
     176      ScaleRowDown2Linear_MMI,
     177      ScaleRowDown2Linear_C,
     178      2,
     179      1,
     180      7)
     181SDANY(ScaleRowDown2Box_Any_MMI,
     182      ScaleRowDown2Box_MMI,
     183      ScaleRowDown2Box_C,
     184      2,
     185      1,
     186      7)
     187SDODD(ScaleRowDown2Box_Odd_MMI,
     188      ScaleRowDown2Box_MMI,
     189      ScaleRowDown2Box_Odd_C,
     190      2,
     191      1,
     192      7)
     193#endif
    168194#ifdef HAS_SCALEROWDOWN4_SSSE3
    169195SDANY(ScaleRowDown4_Any_SSSE3, ScaleRowDown4_SSSE3, ScaleRowDown4_C, 4, 1, 7)
     
    202228      15)
    203229#endif
     230#ifdef HAS_SCALEROWDOWN4_MMI
     231SDANY(ScaleRowDown4_Any_MMI, ScaleRowDown4_MMI, ScaleRowDown4_C, 4, 1, 7)
     232SDANY(ScaleRowDown4Box_Any_MMI,
     233      ScaleRowDown4Box_MMI,
     234      ScaleRowDown4Box_C,
     235      4,
     236      1,
     237      7)
     238#endif
    204239#ifdef HAS_SCALEROWDOWN34_SSSE3
    205240SDANY(ScaleRowDown34_Any_SSSE3,
     
    382417      4,
    383418      3)
     419#endif
     420#ifdef HAS_SCALEARGBROWDOWN2_MMI
     421SDANY(ScaleARGBRowDown2_Any_MMI,
     422      ScaleARGBRowDown2_MMI,
     423      ScaleARGBRowDown2_C,
     424      2,
     425      4,
     426      1)
     427SDANY(ScaleARGBRowDown2Linear_Any_MMI,
     428      ScaleARGBRowDown2Linear_MMI,
     429      ScaleARGBRowDown2Linear_C,
     430      2,
     431      4,
     432      1)
     433SDANY(ScaleARGBRowDown2Box_Any_MMI,
     434      ScaleARGBRowDown2Box_MMI,
     435      ScaleARGBRowDown2Box_C,
     436      2,
     437      4,
     438      1)
    384439#endif
    385440#undef SDANY
     
    434489       3)
    435490#endif
     491#ifdef HAS_SCALEARGBROWDOWNEVEN_MMI
     492SDAANY(ScaleARGBRowDownEven_Any_MMI,
     493       ScaleARGBRowDownEven_MMI,
     494       ScaleARGBRowDownEven_C,
     495       4,
     496       1)
     497SDAANY(ScaleARGBRowDownEvenBox_Any_MMI,
     498       ScaleARGBRowDownEvenBox_MMI,
     499       ScaleARGBRowDownEvenBox_C,
     500       4,
     501       1)
     502#endif
     503
     504#ifdef SASIMDONLY
     505// This also works and uses memcpy and SIMD instead of C, but is slower on ARM
     506
     507// Add rows box filter scale down.  Using macro from row_any
     508#define SAROW(NAMEANY, ANY_SIMD, SBPP, BPP, MASK)                      \
     509  void NAMEANY(const uint8_t* src_ptr, uint16_t* dst_ptr, int width) { \
     510    SIMD_ALIGNED(uint16_t dst_temp[32]);                               \
     511    SIMD_ALIGNED(uint8_t src_temp[32]);                                \
     512    memset(dst_temp, 0, 32 * 2); /* for msan */                        \
     513    int r = width & MASK;                                              \
     514    int n = width & ~MASK;                                             \
     515    if (n > 0) {                                                       \
     516      ANY_SIMD(src_ptr, dst_ptr, n);                                   \
     517    }                                                                  \
     518    memcpy(src_temp, src_ptr + n * SBPP, r * SBPP);                    \
     519    memcpy(dst_temp, dst_ptr + n * BPP, r * BPP);                      \
     520    ANY_SIMD(src_temp, dst_temp, MASK + 1);                            \
     521    memcpy(dst_ptr + n * BPP, dst_temp, r * BPP);                      \
     522  }
     523
     524#ifdef HAS_SCALEADDROW_SSE2
     525SAROW(ScaleAddRow_Any_SSE2, ScaleAddRow_SSE2, 1, 2, 15)
     526#endif
     527#ifdef HAS_SCALEADDROW_AVX2
     528SAROW(ScaleAddRow_Any_AVX2, ScaleAddRow_AVX2, 1, 2, 31)
     529#endif
     530#ifdef HAS_SCALEADDROW_NEON
     531SAROW(ScaleAddRow_Any_NEON, ScaleAddRow_NEON, 1, 2, 15)
     532#endif
     533#ifdef HAS_SCALEADDROW_MSA
     534SAROW(ScaleAddRow_Any_MSA, ScaleAddRow_MSA, 1, 2, 15)
     535#endif
     536#ifdef HAS_SCALEADDROW_MMI
     537SAROW(ScaleAddRow_Any_MMI, ScaleAddRow_MMI, 1, 2, 7)
     538#endif
     539#undef SAANY
     540
     541#else
    436542
    437543// Add rows box filter scale down.
     
    457563SAANY(ScaleAddRow_Any_MSA, ScaleAddRow_MSA, ScaleAddRow_C, 15)
    458564#endif
     565#ifdef HAS_SCALEADDROW_MMI
     566SAANY(ScaleAddRow_Any_MMI, ScaleAddRow_MMI, ScaleAddRow_C, 7)
     567#endif
    459568#undef SAANY
     569
     570#endif  // SASIMDONLY
    460571
    461572#ifdef __cplusplus
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/scale_argb.cc

    r235135 r239415  
    112112  }
    113113#endif
     114#if defined(HAS_SCALEARGBROWDOWN2_MMI)
     115  if (TestCpuFlag(kCpuHasMMI)) {
     116    ScaleARGBRowDown2 =
     117        filtering == kFilterNone
     118            ? ScaleARGBRowDown2_Any_MMI
     119            : (filtering == kFilterLinear ? ScaleARGBRowDown2Linear_Any_MMI
     120                                          : ScaleARGBRowDown2Box_Any_MMI);
     121    if (IS_ALIGNED(dst_width, 2)) {
     122      ScaleARGBRowDown2 =
     123          filtering == kFilterNone
     124              ? ScaleARGBRowDown2_MMI
     125              : (filtering == kFilterLinear ? ScaleARGBRowDown2Linear_MMI
     126                                            : ScaleARGBRowDown2Box_MMI);
     127    }
     128  }
     129#endif
    114130
    115131  if (filtering == kFilterLinear) {
     
    238254  }
    239255#endif
     256#if defined(HAS_SCALEARGBROWDOWNEVEN_MMI)
     257  if (TestCpuFlag(kCpuHasMMI)) {
     258    ScaleARGBRowDownEven = filtering ? ScaleARGBRowDownEvenBox_Any_MMI
     259                                     : ScaleARGBRowDownEven_Any_MMI;
     260    if (IS_ALIGNED(dst_width, 2)) {
     261      ScaleARGBRowDownEven =
     262          filtering ? ScaleARGBRowDownEvenBox_MMI : ScaleARGBRowDownEven_MMI;
     263    }
     264  }
     265#endif
    240266
    241267  if (filtering == kFilterLinear) {
     
    419445  }
    420446#endif
     447#if defined(HAS_INTERPOLATEROW_MMI)
     448  if (TestCpuFlag(kCpuHasMMI)) {
     449    InterpolateRow = InterpolateRow_Any_MMI;
     450    if (IS_ALIGNED(dst_width, 2)) {
     451      InterpolateRow = InterpolateRow_MMI;
     452    }
     453  }
     454#endif
    421455  if (src_width >= 32768) {
    422456    ScaleARGBFilterCols =
     
    462496    if (IS_ALIGNED(dst_width, 4)) {
    463497      ScaleARGBFilterCols = ScaleARGBCols_MSA;
     498    }
     499  }
     500#endif
     501#if defined(HAS_SCALEARGBCOLS_MMI)
     502  if (!filtering && TestCpuFlag(kCpuHasMMI)) {
     503    ScaleARGBFilterCols = ScaleARGBCols_Any_MMI;
     504    if (IS_ALIGNED(dst_width, 1)) {
     505      ScaleARGBFilterCols = ScaleARGBCols_MMI;
    464506    }
    465507  }
     
    470512    if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(dst_width, 8)) {
    471513      ScaleARGBFilterCols = ScaleARGBColsUp2_SSE2;
     514    }
     515#endif
     516#if defined(HAS_SCALEARGBCOLSUP2_MMI)
     517    if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(dst_width, 4)) {
     518      ScaleARGBFilterCols = ScaleARGBColsUp2_MMI;
    472519    }
    473520#endif
     
    667714  }
    668715#endif
     716#if defined(HAS_SCALEARGBCOLS_MMI)
     717  if (!filtering && TestCpuFlag(kCpuHasMMI)) {
     718    ScaleARGBFilterCols = ScaleARGBCols_Any_MMI;
     719    if (IS_ALIGNED(dst_width, 1)) {
     720      ScaleARGBFilterCols = ScaleARGBCols_MMI;
     721    }
     722  }
     723#endif
    669724  if (!filtering && src_width * 2 == dst_width && x < 0x8000) {
    670725    ScaleARGBFilterCols = ScaleARGBColsUp2_C;
     
    672727    if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(dst_width, 8)) {
    673728      ScaleARGBFilterCols = ScaleARGBColsUp2_SSE2;
     729    }
     730#endif
     731#if defined(HAS_SCALEARGBCOLSUP2_MMI)
     732    if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(dst_width, 4)) {
     733      ScaleARGBFilterCols = ScaleARGBColsUp2_MMI;
    674734    }
    675735#endif
     
    798858  }
    799859#endif
     860#if defined(HAS_SCALEARGBCOLS_MMI)
     861  if (TestCpuFlag(kCpuHasMMI)) {
     862    ScaleARGBCols = ScaleARGBCols_Any_MMI;
     863    if (IS_ALIGNED(dst_width, 1)) {
     864      ScaleARGBCols = ScaleARGBCols_MMI;
     865    }
     866  }
     867#endif
    800868  if (src_width * 2 == dst_width && x < 0x8000) {
    801869    ScaleARGBCols = ScaleARGBColsUp2_C;
     
    803871    if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(dst_width, 8)) {
    804872      ScaleARGBCols = ScaleARGBColsUp2_SSE2;
     873    }
     874#endif
     875#if defined(HAS_SCALEARGBCOLSUP2_MMI)
     876    if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(dst_width, 4)) {
     877      ScaleARGBCols = ScaleARGBColsUp2_MMI;
    805878    }
    806879#endif
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/scale_common.cc

    r235135 r239415  
    543543// Same as 8 bit arm blender but return is cast to uint16_t
    544544#define BLENDER(a, b, f) \
    545   (uint16_t)((int)(a) + ((((int)((f)) * ((int)(b) - (int)(a))) + 0x8000) >> 16))
     545  (uint16_t)(            \
     546      (int)(a) +         \
     547      (int)((((int64_t)((f)) * ((int64_t)(b) - (int)(a))) + 0x8000) >> 16))
    546548
    547549void ScaleFilterCols_16_C(uint16_t* dst_ptr,
     
    10741076  }
    10751077#endif
     1078#if defined(HAS_INTERPOLATEROW_MMI)
     1079  if (TestCpuFlag(kCpuHasMMI)) {
     1080    InterpolateRow = InterpolateRow_Any_MMI;
     1081    if (IS_ALIGNED(dst_width_bytes, 8)) {
     1082      InterpolateRow = InterpolateRow_MMI;
     1083    }
     1084  }
     1085#endif
    10761086  for (j = 0; j < dst_height; ++j) {
    10771087    int yi;
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/scale_neon.cc

    r235135 r239415  
    505505}
    506506
    507 void ScaleAddRows_NEON(const uint8_t* src_ptr,
    508                        ptrdiff_t src_stride,
    509                        uint16_t* dst_ptr,
    510                        int src_width,
    511                        int src_height) {
    512   const uint8_t* src_tmp;
    513   asm volatile(
    514       "1:                                        \n"
    515       "mov       %0, %1                          \n"
    516       "mov       r12, %5                         \n"
    517       "veor      q2, q2, q2                      \n"
    518       "veor      q3, q3, q3                      \n"
    519       "2:                                        \n"
    520       // load 16 pixels into q0
    521       "vld1.8     {q0}, [%0], %3                 \n"
    522       "vaddw.u8   q3, q3, d1                     \n"
    523       "vaddw.u8   q2, q2, d0                     \n"
    524       "subs       r12, r12, #1                   \n"
    525       "bgt        2b                             \n"
    526       "vst1.16    {q2, q3}, [%2]!                \n"  // store pixels
    527       "add        %1, %1, #16                    \n"
    528       "subs       %4, %4, #16                    \n"  // 16 processed per loop
    529       "bgt        1b                             \n"
    530       : "=&r"(src_tmp),    // %0
    531         "+r"(src_ptr),     // %1
    532         "+r"(dst_ptr),     // %2
    533         "+r"(src_stride),  // %3
    534         "+r"(src_width),   // %4
    535         "+r"(src_height)   // %5
    536       :
    537       : "memory", "cc", "r12", "q0", "q1", "q2", "q3"  // Clobber List
     507// Add a row of bytes to a row of shorts.  Used for box filter.
     508// Reads 16 bytes and accumulates to 16 shorts at a time.
     509void ScaleAddRow_NEON(const uint8_t* src_ptr,
     510                      uint16_t* dst_ptr,
     511                      int src_width) {
     512  asm volatile(
     513      "1:                                        \n"
     514      "vld1.16    {q1, q2}, [%1]                 \n"  // load accumulator
     515      "vld1.8     {q0}, [%0]!                    \n"  // load 16 bytes
     516      "vaddw.u8   q2, q2, d1                     \n"  // add
     517      "vaddw.u8   q1, q1, d0                     \n"
     518      "vst1.16    {q1, q2}, [%1]!                \n"  // store accumulator
     519      "subs       %2, %2, #16                    \n"  // 16 processed per loop
     520      "bgt        1b                             \n"
     521      : "+r"(src_ptr),   // %0
     522        "+r"(dst_ptr),   // %1
     523        "+r"(src_width)  // %2
     524      :
     525      : "memory", "cc", "q0", "q1", "q2"  // Clobber List
    538526      );
    539527}
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/source/scale_neon64.cc

    r235135 r239415  
    516516}
    517517
    518 void ScaleAddRows_NEON(const uint8_t* src_ptr,
    519                        ptrdiff_t src_stride,
    520                        uint16_t* dst_ptr,
    521                        int src_width,
    522                        int src_height) {
    523   const uint8_t* src_tmp;
    524   asm volatile(
    525       "1:                                        \n"
    526       "mov       %0, %1                          \n"
    527       "mov       w12, %w5                        \n"
    528       "eor       v2.16b, v2.16b, v2.16b          \n"
    529       "eor       v3.16b, v3.16b, v3.16b          \n"
    530       "2:                                        \n"
    531       // load 16 pixels into q0
    532       "ld1       {v0.16b}, [%0], %3              \n"
    533       "uaddw2    v3.8h, v3.8h, v0.16b            \n"
    534       "uaddw     v2.8h, v2.8h, v0.8b             \n"
    535       "subs      w12, w12, #1                    \n"
    536       "b.gt      2b                              \n"
    537       "st1      {v2.8h, v3.8h}, [%2], #32        \n"  // store pixels
    538       "add      %1, %1, #16                      \n"
    539       "subs     %w4, %w4, #16                    \n"  // 16 processed per loop
     518// Add a row of bytes to a row of shorts.  Used for box filter.
     519// Reads 16 bytes and accumulates to 16 shorts at a time.
     520void ScaleAddRow_NEON(const uint8_t* src_ptr,
     521                      uint16_t* dst_ptr,
     522                      int src_width) {
     523  asm volatile(
     524      "1:                                        \n"
     525      "ld1      {v1.8h, v2.8h}, [%1]             \n"  // load accumulator
     526      "ld1      {v0.16b}, [%0], #16              \n"  // load 16 bytes
     527      "uaddw2   v2.8h, v2.8h, v0.16b             \n"  // add
     528      "uaddw    v1.8h, v1.8h, v0.8b              \n"
     529      "st1      {v1.8h, v2.8h}, [%1], #32        \n"  // store accumulator
     530      "subs     %w2, %w2, #16                    \n"  // 16 processed per loop
    540531      "b.gt     1b                               \n"
    541       : "=&r"(src_tmp),    // %0
    542         "+r"(src_ptr),     // %1
    543         "+r"(dst_ptr),     // %2
    544         "+r"(src_stride),  // %3
    545         "+r"(src_width),   // %4
    546         "+r"(src_height)   // %5
    547       :
    548       : "memory", "cc", "w12", "v0", "v1", "v2", "v3"  // Clobber List
     532      : "+r"(src_ptr),   // %0
     533        "+r"(dst_ptr),   // %1
     534        "+r"(src_width)  // %2
     535      :
     536      : "memory", "cc", "v0", "v1", "v2"  // Clobber List
    549537      );
    550538}
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/tools_libyuv/autoroller/roll_deps.py

    r235135 r239415  
    99
    1010# This is a modified copy of the script in
    11 # https://chromium.googlesource.com/external/webrtc/+/master/tools-webrtc/autoroller/roll_deps.py
     11# https://webrtc.googlesource.com/src/+/master/tools_webrtc/autoroller/roll_deps.py
    1212# customized for libyuv.
    1313
     
    2323import subprocess
    2424import sys
    25 import urllib
     25import urllib2
    2626
    2727
     
    9191    m = COMMIT_POSITION_RE.match(line.strip())
    9292    if m:
    93       return m.group(1)
     93      return int(m.group(1))
    9494  logging.error('Failed to parse commit position id from:\n%s\n',
    9595                commit_message)
     
    110110  env = os.environ.copy()
    111111  if extra_env:
    112     assert all(type(value) == str for value in extra_env.values())
     112    assert all(isinstance(value, str) for value in extra_env.values())
    113113    logging.debug('extra env: %s', extra_env)
    114114    env.update(extra_env)
     
    170170def ReadUrlContent(url):
    171171  """Connect to a remote host and read the contents. Returns a list of lines."""
    172   conn = urllib.urlopen(url)
     172  conn = urllib2.urlopen(url)
    173173  try:
    174174    return conn.readlines()
     
    211211      # The deps url is either an URL and a condition, or just the URL.
    212212      if isinstance(deps_url_spec, dict):
     213        if deps_url_spec.get('dep_type') == 'cipd':
     214          continue
    213215        deps_url = deps_url_spec['url']
    214216      else:
     
    346348          'target_os = ["android", "unix", "mac", "ios", "win"];\n'
    347349          'Then run "gclient sync" again.' % local_dep_dir)
    348     _, stderr = _RunCommand(
    349       ['roll-dep-svn', '--no-verify-revision', dep.path, dep.new_rev],
    350       working_dir=CHECKOUT_SRC_DIR, ignore_exit_code=True)
    351     if stderr:
    352       logging.warning('roll-dep-svn: %s', stderr)
     350    _RunCommand(
     351      ['gclient', 'setdep', '--revision', '%s@%s' % (dep.path, dep.new_rev)],
     352      working_dir=CHECKOUT_SRC_DIR)
    353353
    354354
     
    398398
    399399
    400 def _UploadCL(dry_run, rietveld_email=None):
    401   logging.info('Uploading CL...')
    402   if not dry_run:
    403     cmd = ['git', 'cl', 'upload', '-f']
    404     if rietveld_email:
    405       cmd.append('--email=%s' % rietveld_email)
    406     _RunCommand(cmd, extra_env={'EDITOR': 'true'})
    407 
    408 
    409 def _SendToCQ(dry_run, skip_cq):
    410   logging.info('Sending the CL to the CQ...')
    411   if not dry_run and not skip_cq:
    412     _RunCommand(['git', 'cl', 'set_commit'])
    413     logging.info('Sent the CL to the CQ.')
     400def ChooseCQMode(skip_cq, cq_over, current_commit_pos, new_commit_pos):
     401  if skip_cq:
     402    return 0
     403  if (new_commit_pos - current_commit_pos) < cq_over:
     404    return 1
     405  return 2
     406
     407
     408def _UploadCL(commit_queue_mode):
     409  """Upload the committed changes as a changelist to Gerrit.
     410
     411  commit_queue_mode:
     412    - 2: Submit to commit queue.
     413    - 1: Run trybots but do not submit to CQ.
     414    - 0: Skip CQ, upload only.
     415  """
     416  cmd = ['git', 'cl', 'upload', '--force', '--bypass-hooks', '--send-mail']
     417  if commit_queue_mode >= 2:
     418    logging.info('Sending the CL to the CQ...')
     419    cmd.extend(['--use-commit-queue'])
     420  elif commit_queue_mode >= 1:
     421    logging.info('Starting CQ dry run...')
     422    cmd.extend(['--cq-dry-run'])
     423  extra_env = {
     424      'EDITOR': 'true',
     425      'SKIP_GCE_AUTH_FOR_GIT': '1',
     426  }
     427  stdout, stderr = _RunCommand(cmd, extra_env=extra_env)
     428  logging.debug('Output from "git cl upload":\nstdout:\n%s\n\nstderr:\n%s',
     429      stdout, stderr)
    414430
    415431
     
    421437                 help=('Chromium Git revision to roll to. Defaults to the '
    422438                       'Chromium HEAD revision if omitted.'))
    423   p.add_argument('-u', '--rietveld-email',
    424                  help=('E-mail address to use for creating the CL at Rietveld'
    425                        'If omitted a previously cached one will be used or an '
    426                        'error will be thrown during upload.'))
    427439  p.add_argument('--dry-run', action='store_true', default=False,
    428440                 help=('Calculate changes and modify DEPS, but don\'t create '
     
    433445                 help=('Ignore if the current branch is not master or if there '
    434446                       'are uncommitted changes (default: %(default)s).'))
    435   p.add_argument('--skip-cq', action='store_true', default=False,
    436                  help='Skip sending the CL to the CQ (default: %(default)s)')
     447  grp = p.add_mutually_exclusive_group()
     448  grp.add_argument('--skip-cq', action='store_true', default=False,
     449                   help='Skip sending the CL to the CQ (default: %(default)s)')
     450  grp.add_argument('--cq-over', type=int, default=1,
     451                   help=('Commit queue dry run if the revision difference '
     452                         'is below this number (default: %(default)s)'))
    437453  p.add_argument('-v', '--verbose', action='store_true', default=False,
    438454                 help='Be extra verbose in printing of log messages.')
     
    479495  UpdateDepsFile(deps_filename, current_cr_rev, new_cr_rev, changed_deps)
    480496  _LocalCommit(commit_msg, opts.dry_run)
    481   _UploadCL(opts.dry_run, opts.rietveld_email)
    482   _SendToCQ(opts.dry_run, opts.skip_cq)
     497  commit_queue_mode = ChooseCQMode(opts.skip_cq, opts.cq_over,
     498                                   current_commit_pos, new_commit_pos)
     499  logging.info('Uploading CL...')
     500  if not opts.dry_run:
     501    _UploadCL(commit_queue_mode)
    483502  return 0
    484503
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/unit_test/convert_test.cc

    r235135 r239415  
    282282TESTAPLANARTOP(Android420, NV21, 2, 1, 0, 2, 2, I420, 2, 2)
    283283
     284// wrapper to keep API the same
     285int I400ToNV21(const uint8_t* src_y,
     286               int src_stride_y,
     287               const uint8_t* /* src_u */,
     288               int /* src_stride_u */,
     289               const uint8_t* /* src_v */,
     290               int /* src_stride_v */,
     291               uint8_t* dst_y,
     292               int dst_stride_y,
     293               uint8_t* dst_vu,
     294               int dst_stride_vu,
     295               int width,
     296               int height) {
     297  return I400ToNV21(src_y, src_stride_y, dst_y, dst_stride_y, dst_vu,
     298                    dst_stride_vu, width, height);
     299}
     300
    284301#define TESTPLANARTOBPI(SRC_FMT_PLANAR, SRC_SUBSAMP_X, SRC_SUBSAMP_Y,         \
    285302                        FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, W1280, N, NEG, OFF) \
     
    375392TESTPLANARTOBP(I420, 2, 2, NV12, 2, 2)
    376393TESTPLANARTOBP(I420, 2, 2, NV21, 2, 2)
     394TESTPLANARTOBP(I422, 2, 1, NV21, 2, 2)
     395TESTPLANARTOBP(I444, 1, 1, NV21, 2, 2)
     396TESTPLANARTOBP(I400, 2, 2, NV21, 2, 2)
    377397
    378398#define TESTBIPLANARTOPI(SRC_FMT_PLANAR, SRC_SUBSAMP_X, SRC_SUBSAMP_Y,         \
     
    567587TESTPLANARTOB(H420, 2, 2, RGB24, 3, 3, 1)
    568588TESTPLANARTOB(I420, 2, 2, RGB565, 2, 2, 1)
     589TESTPLANARTOB(J420, 2, 2, RGB565, 2, 2, 1)
     590TESTPLANARTOB(H420, 2, 2, RGB565, 2, 2, 1)
    569591TESTPLANARTOB(I420, 2, 2, ARGB1555, 2, 2, 1)
    570592TESTPLANARTOB(I420, 2, 2, ARGB4444, 2, 2, 1)
     
    735757TESTBIPLANARTOB(NV12, 2, 2, RGB24, 3, 2)
    736758TESTBIPLANARTOB(NV21, 2, 2, RGB24, 3, 2)
     759TESTBIPLANARTOB(NV12, 2, 2, RAW, 3, 2)
     760TESTBIPLANARTOB(NV21, 2, 2, RAW, 3, 2)
    737761TESTBIPLANARTOB(NV12, 2, 2, RGB565, 2, 9)
    738762
     
    10231047      FMT_A##To##FMT_B(src_argb, kStrideA, dst_argb_opt, kStrideB, kWidth, \
    10241048                       kHeight);                                           \
    1025       int max_diff = 0;                                                    \
    10261049      for (int i = 0; i < kStrideB * kHeightB; ++i) {                      \
    1027         int abs_diff = abs(static_cast<int>(dst_argb_c[i]) -               \
    1028                            static_cast<int>(dst_argb_opt[i]));             \
    1029         if (abs_diff > max_diff) {                                         \
    1030           max_diff = abs_diff;                                             \
    1031         }                                                                  \
     1050        EXPECT_NEAR(dst_argb_c[i], dst_argb_opt[i], DIFF);                 \
    10321051      }                                                                    \
    1033       EXPECT_LE(max_diff, DIFF);                                           \
    10341052      free_aligned_buffer_page_end(src_argb);                              \
    10351053      free_aligned_buffer_page_end(dst_argb_c);                            \
     
    10511069                 HEIGHT_B, DIFF)
    10521070
     1071// TODO(fbarchard): make ARM version of C code that matches NEON.
    10531072TESTATOB(ARGB, 4, 4, 1, ARGB, 4, 4, 1, 0)
    10541073TESTATOB(ARGB, 4, 4, 1, BGRA, 4, 4, 1, 0)
     
    13621381}
    13631382
    1364 TEST_F(LibYUVConvertTest, MJPGToI420) {
    1365   const int kOff = 10;
    1366   const int kMinJpeg = 64;
    1367   const int kImageSize = benchmark_width_ * benchmark_height_ >= kMinJpeg
    1368                              ? benchmark_width_ * benchmark_height_
    1369                              : kMinJpeg;
    1370   const int kSize = kImageSize + kOff;
    1371   align_buffer_page_end(orig_pixels, kSize);
    1372   align_buffer_page_end(dst_y_opt, benchmark_width_ * benchmark_height_);
    1373   align_buffer_page_end(dst_u_opt, SUBSAMPLE(benchmark_width_, 2) *
    1374                                        SUBSAMPLE(benchmark_height_, 2));
    1375   align_buffer_page_end(dst_v_opt, SUBSAMPLE(benchmark_width_, 2) *
    1376                                        SUBSAMPLE(benchmark_height_, 2));
    1377 
    1378   // EOI, SOI to make MJPG appear valid.
    1379   memset(orig_pixels, 0, kSize);
    1380   orig_pixels[0] = 0xff;
    1381   orig_pixels[1] = 0xd8;  // SOI.
    1382   orig_pixels[kSize - kOff + 0] = 0xff;
    1383   orig_pixels[kSize - kOff + 1] = 0xd9;  // EOI.
    1384 
    1385   for (int times = 0; times < benchmark_iterations_; ++times) {
    1386     int ret =
    1387         MJPGToI420(orig_pixels, kSize, dst_y_opt, benchmark_width_, dst_u_opt,
    1388                    SUBSAMPLE(benchmark_width_, 2), dst_v_opt,
    1389                    SUBSAMPLE(benchmark_width_, 2), benchmark_width_,
    1390                    benchmark_height_, benchmark_width_, benchmark_height_);
    1391     // Expect failure because image is not really valid.
    1392     EXPECT_EQ(1, ret);
    1393   }
    1394 
    1395   free_aligned_buffer_page_end(dst_y_opt);
    1396   free_aligned_buffer_page_end(dst_u_opt);
    1397   free_aligned_buffer_page_end(dst_v_opt);
    1398   free_aligned_buffer_page_end(orig_pixels);
     1383// Test data created in GIMP.  In export jpeg, disable thumbnails etc,
     1384// choose a subsampling, and use low quality (50) to keep size small.
     1385// Generated with xxd -i test.jpg
     1386// test 0 is J400
     1387static const uint8_t kTest0Jpg[] = {
     1388    0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01,
     1389    0x01, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43,
     1390    0x00, 0x10, 0x0b, 0x0c, 0x0e, 0x0c, 0x0a, 0x10, 0x0e, 0x0d, 0x0e, 0x12,
     1391    0x11, 0x10, 0x13, 0x18, 0x28, 0x1a, 0x18, 0x16, 0x16, 0x18, 0x31, 0x23,
     1392    0x25, 0x1d, 0x28, 0x3a, 0x33, 0x3d, 0x3c, 0x39, 0x33, 0x38, 0x37, 0x40,
     1393    0x48, 0x5c, 0x4e, 0x40, 0x44, 0x57, 0x45, 0x37, 0x38, 0x50, 0x6d, 0x51,
     1394    0x57, 0x5f, 0x62, 0x67, 0x68, 0x67, 0x3e, 0x4d, 0x71, 0x79, 0x70, 0x64,
     1395    0x78, 0x5c, 0x65, 0x67, 0x63, 0xff, 0xc2, 0x00, 0x0b, 0x08, 0x00, 0x10,
     1396    0x00, 0x20, 0x01, 0x01, 0x11, 0x00, 0xff, 0xc4, 0x00, 0x17, 0x00, 0x01,
     1397    0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1398    0x00, 0x00, 0x00, 0x03, 0x04, 0x01, 0x02, 0xff, 0xda, 0x00, 0x08, 0x01,
     1399    0x01, 0x00, 0x00, 0x00, 0x01, 0x43, 0x7e, 0xa7, 0x97, 0x57, 0xff, 0xc4,
     1400    0x00, 0x1b, 0x10, 0x00, 0x03, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00,
     1401    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x11, 0x00, 0x03,
     1402    0x10, 0x12, 0x13, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01, 0x05,
     1403    0x02, 0x3b, 0xc0, 0x6f, 0x66, 0x76, 0x56, 0x23, 0x87, 0x99, 0x0d, 0x26,
     1404    0x62, 0xf6, 0xbf, 0xff, 0xc4, 0x00, 0x1e, 0x10, 0x00, 0x02, 0x01, 0x03,
     1405    0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1406    0x00, 0x11, 0x21, 0x02, 0x12, 0x32, 0x10, 0x31, 0x71, 0x81, 0xa1, 0xff,
     1407    0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x06, 0x3f, 0x02, 0x4b, 0xb3, 0x28,
     1408    0x32, 0xd2, 0xed, 0xf9, 0x1d, 0x3e, 0x13, 0x51, 0x73, 0x83, 0xff, 0xc4,
     1409    0x00, 0x1c, 0x10, 0x01, 0x01, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x00,
     1410    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x00, 0x21, 0x51,
     1411    0x31, 0x61, 0x81, 0xf0, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01,
     1412    0x3f, 0x21, 0x65, 0x6e, 0x31, 0x86, 0x28, 0xf9, 0x30, 0xdc, 0x27, 0xdb,
     1413    0xa9, 0x01, 0xf3, 0xde, 0x02, 0xa0, 0xed, 0x1e, 0x34, 0x68, 0x23, 0xf9,
     1414    0xc6, 0x48, 0x5d, 0x7a, 0x35, 0x02, 0xf5, 0x6f, 0xff, 0xda, 0x00, 0x08,
     1415    0x01, 0x01, 0x00, 0x00, 0x00, 0x10, 0x35, 0xff, 0xc4, 0x00, 0x1f, 0x10,
     1416    0x01, 0x00, 0x02, 0x01, 0x04, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
     1417    0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, 0x31, 0x41, 0x61, 0x71, 0x91,
     1418    0x21, 0x81, 0xd1, 0xb1, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01,
     1419    0x3f, 0x10, 0x0b, 0x30, 0xe9, 0x58, 0xbe, 0x1a, 0xfd, 0x88, 0xab, 0x8b,
     1420    0x34, 0x74, 0x80, 0x4b, 0xb5, 0xd5, 0xab, 0xcd, 0x46, 0x96, 0x2e, 0xec,
     1421    0xbd, 0xaa, 0x78, 0x47, 0x5c, 0x47, 0xa7, 0x30, 0x49, 0xad, 0x88, 0x7c,
     1422    0x40, 0x74, 0x30, 0xff, 0x00, 0x23, 0x1d, 0x03, 0x0b, 0xb7, 0xd4, 0xff,
     1423    0xd9};
     1424static const size_t kTest0JpgLen = 421;
     1425
     1426// test 1 is J444
     1427static const uint8_t kTest1Jpg[] = {
     1428    0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01,
     1429    0x01, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43,
     1430    0x00, 0x10, 0x0b, 0x0c, 0x0e, 0x0c, 0x0a, 0x10, 0x0e, 0x0d, 0x0e, 0x12,
     1431    0x11, 0x10, 0x13, 0x18, 0x28, 0x1a, 0x18, 0x16, 0x16, 0x18, 0x31, 0x23,
     1432    0x25, 0x1d, 0x28, 0x3a, 0x33, 0x3d, 0x3c, 0x39, 0x33, 0x38, 0x37, 0x40,
     1433    0x48, 0x5c, 0x4e, 0x40, 0x44, 0x57, 0x45, 0x37, 0x38, 0x50, 0x6d, 0x51,
     1434    0x57, 0x5f, 0x62, 0x67, 0x68, 0x67, 0x3e, 0x4d, 0x71, 0x79, 0x70, 0x64,
     1435    0x78, 0x5c, 0x65, 0x67, 0x63, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x11, 0x12,
     1436    0x12, 0x18, 0x15, 0x18, 0x2f, 0x1a, 0x1a, 0x2f, 0x63, 0x42, 0x38, 0x42,
     1437    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1438    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1439    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1440    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1441    0x63, 0x63, 0xff, 0xc2, 0x00, 0x11, 0x08, 0x00, 0x10, 0x00, 0x20, 0x03,
     1442    0x01, 0x11, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xc4, 0x00,
     1443    0x17, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1444    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x01, 0x02, 0xff, 0xc4,
     1445    0x00, 0x16, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1446    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x03, 0xff, 0xda,
     1447    0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x10, 0x03, 0x10, 0x00, 0x00, 0x01,
     1448    0x40, 0x8f, 0x26, 0xe8, 0xf4, 0xcc, 0xf9, 0x69, 0x2b, 0x1b, 0x2a, 0xcb,
     1449    0xff, 0xc4, 0x00, 0x1b, 0x10, 0x00, 0x03, 0x00, 0x02, 0x03, 0x00, 0x00,
     1450    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x11,
     1451    0x00, 0x03, 0x10, 0x12, 0x13, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00,
     1452    0x01, 0x05, 0x02, 0x3b, 0x80, 0x6f, 0x56, 0x76, 0x56, 0x23, 0x87, 0x99,
     1453    0x0d, 0x26, 0x62, 0xf6, 0xbf, 0xff, 0xc4, 0x00, 0x19, 0x11, 0x01, 0x00,
     1454    0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1455    0x00, 0x00, 0x01, 0x00, 0x10, 0x11, 0x02, 0x12, 0xff, 0xda, 0x00, 0x08,
     1456    0x01, 0x03, 0x01, 0x01, 0x3f, 0x01, 0xf1, 0x00, 0x27, 0x45, 0xbb, 0x31,
     1457    0xaf, 0xff, 0xc4, 0x00, 0x1a, 0x11, 0x00, 0x02, 0x03, 0x01, 0x01, 0x00,
     1458    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
     1459    0x02, 0x10, 0x11, 0x41, 0x12, 0xff, 0xda, 0x00, 0x08, 0x01, 0x02, 0x01,
     1460    0x01, 0x3f, 0x01, 0xf6, 0x4b, 0x5f, 0x48, 0xb3, 0x69, 0x63, 0x35, 0x72,
     1461    0xbf, 0xff, 0xc4, 0x00, 0x1e, 0x10, 0x00, 0x02, 0x01, 0x03, 0x05, 0x00,
     1462    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11,
     1463    0x21, 0x02, 0x12, 0x32, 0x10, 0x31, 0x71, 0x81, 0xa1, 0xff, 0xda, 0x00,
     1464    0x08, 0x01, 0x01, 0x00, 0x06, 0x3f, 0x02, 0x4b, 0xb3, 0x28, 0x32, 0xd2,
     1465    0xed, 0xf9, 0x1d, 0x3e, 0x13, 0x51, 0x73, 0x83, 0xff, 0xc4, 0x00, 0x1c,
     1466    0x10, 0x01, 0x01, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00,
     1467    0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x00, 0x21, 0x51, 0x31, 0x61,
     1468    0x81, 0xf0, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01, 0x3f, 0x21,
     1469    0x75, 0x6e, 0x31, 0x94, 0x28, 0xf9, 0x30, 0xdc, 0x27, 0xdb, 0xa9, 0x01,
     1470    0xf3, 0xde, 0x02, 0xa0, 0xed, 0x1e, 0x34, 0x68, 0x23, 0xf9, 0xc6, 0x48,
     1471    0x5d, 0x7a, 0x35, 0x02, 0xf5, 0x6f, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01,
     1472    0x00, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x26, 0x61, 0xd4, 0xff,
     1473    0xc4, 0x00, 0x1a, 0x11, 0x00, 0x03, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00,
     1474    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x21,
     1475    0x31, 0x41, 0x51, 0xff, 0xda, 0x00, 0x08, 0x01, 0x03, 0x01, 0x01, 0x3f,
     1476    0x10, 0x54, 0xa8, 0xbf, 0x50, 0x87, 0xb0, 0x9d, 0x8b, 0xc4, 0x6a, 0x26,
     1477    0x6b, 0x2a, 0x9c, 0x1f, 0xff, 0xc4, 0x00, 0x18, 0x11, 0x01, 0x01, 0x01,
     1478    0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1479    0x00, 0x01, 0x00, 0x11, 0x21, 0x51, 0xff, 0xda, 0x00, 0x08, 0x01, 0x02,
     1480    0x01, 0x01, 0x3f, 0x10, 0x70, 0xe1, 0x3e, 0xd1, 0x8e, 0x0d, 0xe1, 0xb5,
     1481    0xd5, 0x91, 0x76, 0x43, 0x82, 0x45, 0x4c, 0x7b, 0x7f, 0xff, 0xc4, 0x00,
     1482    0x1f, 0x10, 0x01, 0x00, 0x02, 0x01, 0x04, 0x03, 0x01, 0x00, 0x00, 0x00,
     1483    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, 0x31, 0x41, 0x61,
     1484    0x71, 0x91, 0x21, 0x81, 0xd1, 0xb1, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01,
     1485    0x00, 0x01, 0x3f, 0x10, 0x1b, 0x30, 0xe9, 0x58, 0xbe, 0x1a, 0xfd, 0x8a,
     1486    0xeb, 0x8b, 0x34, 0x74, 0x80, 0x4b, 0xb5, 0xd5, 0xab, 0xcd, 0x46, 0x96,
     1487    0x2e, 0xec, 0xbd, 0xaa, 0x78, 0x47, 0x5c, 0x47, 0xa7, 0x30, 0x49, 0xad,
     1488    0x88, 0x7c, 0x40, 0x74, 0x30, 0xff, 0x00, 0x23, 0x1d, 0x03, 0x0b, 0xb7,
     1489    0xd4, 0xff, 0xd9};
     1490static const size_t kTest1JpgLen = 735;
     1491
     1492// test 2 is J420
     1493static const uint8_t kTest2Jpg[] = {
     1494    0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01,
     1495    0x01, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43,
     1496    0x00, 0x10, 0x0b, 0x0c, 0x0e, 0x0c, 0x0a, 0x10, 0x0e, 0x0d, 0x0e, 0x12,
     1497    0x11, 0x10, 0x13, 0x18, 0x28, 0x1a, 0x18, 0x16, 0x16, 0x18, 0x31, 0x23,
     1498    0x25, 0x1d, 0x28, 0x3a, 0x33, 0x3d, 0x3c, 0x39, 0x33, 0x38, 0x37, 0x40,
     1499    0x48, 0x5c, 0x4e, 0x40, 0x44, 0x57, 0x45, 0x37, 0x38, 0x50, 0x6d, 0x51,
     1500    0x57, 0x5f, 0x62, 0x67, 0x68, 0x67, 0x3e, 0x4d, 0x71, 0x79, 0x70, 0x64,
     1501    0x78, 0x5c, 0x65, 0x67, 0x63, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x11, 0x12,
     1502    0x12, 0x18, 0x15, 0x18, 0x2f, 0x1a, 0x1a, 0x2f, 0x63, 0x42, 0x38, 0x42,
     1503    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1504    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1505    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1506    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1507    0x63, 0x63, 0xff, 0xc2, 0x00, 0x11, 0x08, 0x00, 0x10, 0x00, 0x20, 0x03,
     1508    0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xc4, 0x00,
     1509    0x18, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1510    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x05, 0x01, 0x02, 0x04, 0xff,
     1511    0xc4, 0x00, 0x16, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
     1512    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x02, 0xff,
     1513    0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x10, 0x03, 0x10, 0x00, 0x00,
     1514    0x01, 0x20, 0xe7, 0x28, 0xa3, 0x0b, 0x2e, 0x2d, 0xcf, 0xff, 0xc4, 0x00,
     1515    0x1b, 0x10, 0x00, 0x03, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
     1516    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x11, 0x00, 0x03, 0x10,
     1517    0x12, 0x13, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01, 0x05, 0x02,
     1518    0x3b, 0x80, 0x6f, 0x56, 0x76, 0x56, 0x23, 0x87, 0x99, 0x0d, 0x26, 0x62,
     1519    0xf6, 0xbf, 0xff, 0xc4, 0x00, 0x17, 0x11, 0x01, 0x00, 0x03, 0x00, 0x00,
     1520    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1521    0x01, 0x11, 0x21, 0xff, 0xda, 0x00, 0x08, 0x01, 0x03, 0x01, 0x01, 0x3f,
     1522    0x01, 0xc8, 0x53, 0xff, 0xc4, 0x00, 0x16, 0x11, 0x01, 0x01, 0x01, 0x00,
     1523    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1524    0x00, 0x11, 0x32, 0xff, 0xda, 0x00, 0x08, 0x01, 0x02, 0x01, 0x01, 0x3f,
     1525    0x01, 0xd2, 0xc7, 0xff, 0xc4, 0x00, 0x1e, 0x10, 0x00, 0x02, 0x01, 0x03,
     1526    0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1527    0x00, 0x11, 0x21, 0x02, 0x12, 0x32, 0x10, 0x31, 0x71, 0x81, 0xa1, 0xff,
     1528    0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x06, 0x3f, 0x02, 0x4b, 0xb3, 0x28,
     1529    0x32, 0xd2, 0xed, 0xf9, 0x1d, 0x3e, 0x13, 0x51, 0x73, 0x83, 0xff, 0xc4,
     1530    0x00, 0x1c, 0x10, 0x01, 0x01, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x00,
     1531    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x00, 0x21, 0x51,
     1532    0x31, 0x61, 0x81, 0xf0, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01,
     1533    0x3f, 0x21, 0x75, 0x6e, 0x31, 0x94, 0x28, 0xf9, 0x30, 0xdc, 0x27, 0xdb,
     1534    0xa9, 0x01, 0xf3, 0xde, 0x02, 0xa0, 0xed, 0x1e, 0x34, 0x68, 0x23, 0xf9,
     1535    0xc6, 0x48, 0x5d, 0x7a, 0x35, 0x02, 0xf5, 0x6f, 0xff, 0xda, 0x00, 0x0c,
     1536    0x03, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x13, 0x5f,
     1537    0xff, 0xc4, 0x00, 0x17, 0x11, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
     1538    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11,
     1539    0x21, 0xff, 0xda, 0x00, 0x08, 0x01, 0x03, 0x01, 0x01, 0x3f, 0x10, 0x0e,
     1540    0xa1, 0x3a, 0x76, 0xff, 0xc4, 0x00, 0x17, 0x11, 0x01, 0x01, 0x01, 0x01,
     1541    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1542    0x01, 0x00, 0x21, 0x11, 0xff, 0xda, 0x00, 0x08, 0x01, 0x02, 0x01, 0x01,
     1543    0x3f, 0x10, 0x57, 0x0b, 0x08, 0x70, 0xdb, 0xff, 0xc4, 0x00, 0x1f, 0x10,
     1544    0x01, 0x00, 0x02, 0x01, 0x04, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
     1545    0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, 0x31, 0x41, 0x61, 0x71, 0x91,
     1546    0x21, 0x81, 0xd1, 0xb1, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01,
     1547    0x3f, 0x10, 0x1b, 0x30, 0xe9, 0x58, 0xbe, 0x1a, 0xfd, 0x8a, 0xeb, 0x8b,
     1548    0x34, 0x74, 0x80, 0x4b, 0xb5, 0xd5, 0xab, 0xcd, 0x46, 0x96, 0x2e, 0xec,
     1549    0xbd, 0xaa, 0x78, 0x47, 0x5c, 0x47, 0xa7, 0x30, 0x49, 0xad, 0x88, 0x7c,
     1550    0x40, 0x74, 0x30, 0xff, 0x00, 0x23, 0x1d, 0x03, 0x0b, 0xb7, 0xd4, 0xff,
     1551    0xd9};
     1552static const size_t kTest2JpgLen = 685;
     1553
     1554// test 3 is J422
     1555static const uint8_t kTest3Jpg[] = {
     1556    0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01,
     1557    0x01, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43,
     1558    0x00, 0x10, 0x0b, 0x0c, 0x0e, 0x0c, 0x0a, 0x10, 0x0e, 0x0d, 0x0e, 0x12,
     1559    0x11, 0x10, 0x13, 0x18, 0x28, 0x1a, 0x18, 0x16, 0x16, 0x18, 0x31, 0x23,
     1560    0x25, 0x1d, 0x28, 0x3a, 0x33, 0x3d, 0x3c, 0x39, 0x33, 0x38, 0x37, 0x40,
     1561    0x48, 0x5c, 0x4e, 0x40, 0x44, 0x57, 0x45, 0x37, 0x38, 0x50, 0x6d, 0x51,
     1562    0x57, 0x5f, 0x62, 0x67, 0x68, 0x67, 0x3e, 0x4d, 0x71, 0x79, 0x70, 0x64,
     1563    0x78, 0x5c, 0x65, 0x67, 0x63, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x11, 0x12,
     1564    0x12, 0x18, 0x15, 0x18, 0x2f, 0x1a, 0x1a, 0x2f, 0x63, 0x42, 0x38, 0x42,
     1565    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1566    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1567    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1568    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1569    0x63, 0x63, 0xff, 0xc2, 0x00, 0x11, 0x08, 0x00, 0x10, 0x00, 0x20, 0x03,
     1570    0x01, 0x21, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xc4, 0x00,
     1571    0x17, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1572    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x01, 0x02, 0xff, 0xc4,
     1573    0x00, 0x17, 0x01, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1574    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0xff,
     1575    0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x10, 0x03, 0x10, 0x00, 0x00,
     1576    0x01, 0x43, 0x8d, 0x1f, 0xa2, 0xb3, 0xca, 0x1b, 0x57, 0x0f, 0xff, 0xc4,
     1577    0x00, 0x1b, 0x10, 0x00, 0x03, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00,
     1578    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x11, 0x00, 0x03,
     1579    0x10, 0x12, 0x13, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01, 0x05,
     1580    0x02, 0x3b, 0x80, 0x6f, 0x56, 0x76, 0x56, 0x23, 0x87, 0x99, 0x0d, 0x26,
     1581    0x62, 0xf6, 0xbf, 0xff, 0xc4, 0x00, 0x19, 0x11, 0x00, 0x02, 0x03, 0x01,
     1582    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1583    0x00, 0x01, 0x02, 0x10, 0x11, 0x21, 0xff, 0xda, 0x00, 0x08, 0x01, 0x03,
     1584    0x01, 0x01, 0x3f, 0x01, 0x51, 0xce, 0x8c, 0x75, 0xff, 0xc4, 0x00, 0x18,
     1585    0x11, 0x00, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1586    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x61, 0x21, 0xff, 0xda,
     1587    0x00, 0x08, 0x01, 0x02, 0x01, 0x01, 0x3f, 0x01, 0xa6, 0xd9, 0x2f, 0x84,
     1588    0xe8, 0xf0, 0xff, 0xc4, 0x00, 0x1e, 0x10, 0x00, 0x02, 0x01, 0x03, 0x05,
     1589    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1590    0x11, 0x21, 0x02, 0x12, 0x32, 0x10, 0x31, 0x71, 0x81, 0xa1, 0xff, 0xda,
     1591    0x00, 0x08, 0x01, 0x01, 0x00, 0x06, 0x3f, 0x02, 0x4b, 0xb3, 0x28, 0x32,
     1592    0xd2, 0xed, 0xf9, 0x1d, 0x3e, 0x13, 0x51, 0x73, 0x83, 0xff, 0xc4, 0x00,
     1593    0x1c, 0x10, 0x01, 0x01, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x00, 0x00,
     1594    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x00, 0x21, 0x51, 0x31,
     1595    0x61, 0x81, 0xf0, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01, 0x3f,
     1596    0x21, 0x75, 0x6e, 0x31, 0x94, 0x28, 0xf9, 0x30, 0xdc, 0x27, 0xdb, 0xa9,
     1597    0x01, 0xf3, 0xde, 0x02, 0xa0, 0xed, 0x1e, 0x34, 0x68, 0x23, 0xf9, 0xc6,
     1598    0x48, 0x5d, 0x7a, 0x35, 0x02, 0xf5, 0x6f, 0xff, 0xda, 0x00, 0x0c, 0x03,
     1599    0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x2e, 0x45, 0xff,
     1600    0xc4, 0x00, 0x18, 0x11, 0x00, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
     1601    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x21,
     1602    0x31, 0xff, 0xda, 0x00, 0x08, 0x01, 0x03, 0x01, 0x01, 0x3f, 0x10, 0x53,
     1603    0x50, 0xba, 0x54, 0xc1, 0x67, 0x4f, 0xff, 0xc4, 0x00, 0x18, 0x11, 0x00,
     1604    0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1605    0x00, 0x00, 0x00, 0x01, 0x11, 0x21, 0x00, 0x10, 0xff, 0xda, 0x00, 0x08,
     1606    0x01, 0x02, 0x01, 0x01, 0x3f, 0x10, 0x18, 0x81, 0x5c, 0x04, 0x1a, 0xca,
     1607    0x91, 0xbf, 0xff, 0xc4, 0x00, 0x1f, 0x10, 0x01, 0x00, 0x02, 0x01, 0x04,
     1608    0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
     1609    0x00, 0x11, 0x31, 0x41, 0x61, 0x71, 0x91, 0x21, 0x81, 0xd1, 0xb1, 0xff,
     1610    0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01, 0x3f, 0x10, 0x1b, 0x30, 0xe9,
     1611    0x58, 0xbe, 0x1a, 0xfd, 0x8a, 0xeb, 0x8b, 0x34, 0x74, 0x80, 0x4b, 0xb5,
     1612    0xd5, 0xab, 0xcd, 0x46, 0x96, 0x2e, 0xec, 0xbd, 0xaa, 0x78, 0x47, 0x5c,
     1613    0x47, 0xa7, 0x30, 0x49, 0xad, 0x88, 0x7c, 0x40, 0x74, 0x30, 0xff, 0x00,
     1614    0x23, 0x1d, 0x03, 0x0b, 0xb7, 0xd4, 0xff, 0xd9};
     1615static const size_t kTest3JpgLen = 704;
     1616
     1617// test 4 is J422 vertical - not supported
     1618static const uint8_t kTest4Jpg[] = {
     1619    0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01,
     1620    0x01, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43,
     1621    0x00, 0x10, 0x0b, 0x0c, 0x0e, 0x0c, 0x0a, 0x10, 0x0e, 0x0d, 0x0e, 0x12,
     1622    0x11, 0x10, 0x13, 0x18, 0x28, 0x1a, 0x18, 0x16, 0x16, 0x18, 0x31, 0x23,
     1623    0x25, 0x1d, 0x28, 0x3a, 0x33, 0x3d, 0x3c, 0x39, 0x33, 0x38, 0x37, 0x40,
     1624    0x48, 0x5c, 0x4e, 0x40, 0x44, 0x57, 0x45, 0x37, 0x38, 0x50, 0x6d, 0x51,
     1625    0x57, 0x5f, 0x62, 0x67, 0x68, 0x67, 0x3e, 0x4d, 0x71, 0x79, 0x70, 0x64,
     1626    0x78, 0x5c, 0x65, 0x67, 0x63, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x11, 0x12,
     1627    0x12, 0x18, 0x15, 0x18, 0x2f, 0x1a, 0x1a, 0x2f, 0x63, 0x42, 0x38, 0x42,
     1628    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1629    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1630    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1631    0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
     1632    0x63, 0x63, 0xff, 0xc2, 0x00, 0x11, 0x08, 0x00, 0x10, 0x00, 0x20, 0x03,
     1633    0x01, 0x12, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xc4, 0x00,
     1634    0x18, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1635    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x01, 0x02, 0x03, 0xff,
     1636    0xc4, 0x00, 0x16, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
     1637    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0xff,
     1638    0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x10, 0x03, 0x10, 0x00, 0x00,
     1639    0x01, 0xd2, 0x98, 0xe9, 0x03, 0x0c, 0x00, 0x46, 0x21, 0xd9, 0xff, 0xc4,
     1640    0x00, 0x1b, 0x10, 0x00, 0x03, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00,
     1641    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x11, 0x00, 0x03,
     1642    0x10, 0x12, 0x13, 0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01, 0x05,
     1643    0x02, 0x3b, 0x80, 0x6f, 0x56, 0x76, 0x56, 0x23, 0x87, 0x99, 0x0d, 0x26,
     1644    0x62, 0xf6, 0xbf, 0xff, 0xc4, 0x00, 0x17, 0x11, 0x01, 0x01, 0x01, 0x01,
     1645    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1646    0x00, 0x11, 0x01, 0x21, 0xff, 0xda, 0x00, 0x08, 0x01, 0x03, 0x01, 0x01,
     1647    0x3f, 0x01, 0x98, 0xb1, 0xbd, 0x47, 0xff, 0xc4, 0x00, 0x18, 0x11, 0x00,
     1648    0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1649    0x00, 0x00, 0x00, 0x00, 0x01, 0x12, 0x11, 0x21, 0xff, 0xda, 0x00, 0x08,
     1650    0x01, 0x02, 0x01, 0x01, 0x3f, 0x01, 0xb6, 0x35, 0xa2, 0xe1, 0x47, 0xff,
     1651    0xc4, 0x00, 0x1e, 0x10, 0x00, 0x02, 0x01, 0x03, 0x05, 0x00, 0x00, 0x00,
     1652    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x21, 0x02,
     1653    0x12, 0x32, 0x10, 0x31, 0x71, 0x81, 0xa1, 0xff, 0xda, 0x00, 0x08, 0x01,
     1654    0x01, 0x00, 0x06, 0x3f, 0x02, 0x4b, 0xb3, 0x28, 0x32, 0xd2, 0xed, 0xf9,
     1655    0x1d, 0x3e, 0x13, 0x51, 0x73, 0x83, 0xff, 0xc4, 0x00, 0x1c, 0x10, 0x01,
     1656    0x01, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1657    0x00, 0x00, 0x00, 0x01, 0x11, 0x00, 0x21, 0x51, 0x31, 0x61, 0x81, 0xf0,
     1658    0xff, 0xda, 0x00, 0x08, 0x01, 0x01, 0x00, 0x01, 0x3f, 0x21, 0x75, 0x6e,
     1659    0x31, 0x94, 0x28, 0xf9, 0x30, 0xdc, 0x27, 0xdb, 0xa9, 0x01, 0xf3, 0xde,
     1660    0x02, 0xa0, 0xed, 0x1e, 0x34, 0x68, 0x23, 0xf9, 0xc6, 0x48, 0x5d, 0x7a,
     1661    0x35, 0x02, 0xf5, 0x6f, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02,
     1662    0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x24, 0xaf, 0xff, 0xc4, 0x00, 0x19,
     1663    0x11, 0x00, 0x03, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1664    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x51, 0x21, 0x31, 0xff,
     1665    0xda, 0x00, 0x08, 0x01, 0x03, 0x01, 0x01, 0x3f, 0x10, 0x59, 0x11, 0xca,
     1666    0x42, 0x60, 0x9f, 0x69, 0xff, 0xc4, 0x00, 0x19, 0x11, 0x00, 0x02, 0x03,
     1667    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     1668    0x00, 0x00, 0x01, 0x11, 0x21, 0x31, 0x61, 0xff, 0xda, 0x00, 0x08, 0x01,
     1669    0x02, 0x01, 0x01, 0x3f, 0x10, 0xb0, 0xd7, 0x27, 0x51, 0xb6, 0x41, 0xff,
     1670    0xc4, 0x00, 0x1f, 0x10, 0x01, 0x00, 0x02, 0x01, 0x04, 0x03, 0x01, 0x00,
     1671    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, 0x31,
     1672    0x41, 0x61, 0x71, 0x91, 0x21, 0x81, 0xd1, 0xb1, 0xff, 0xda, 0x00, 0x08,
     1673    0x01, 0x01, 0x00, 0x01, 0x3f, 0x10, 0x1b, 0x30, 0xe9, 0x58, 0xbe, 0x1a,
     1674    0xfd, 0x8a, 0xeb, 0x8b, 0x34, 0x74, 0x80, 0x4b, 0xb5, 0xd5, 0xab, 0xcd,
     1675    0x46, 0x96, 0x2e, 0xec, 0xbd, 0xaa, 0x78, 0x47, 0x5c, 0x47, 0xa7, 0x30,
     1676    0x49, 0xad, 0x88, 0x7c, 0x40, 0x74, 0x30, 0xff, 0x00, 0x23, 0x1d, 0x03,
     1677    0x0b, 0xb7, 0xd4, 0xff, 0xd9};
     1678static const size_t kTest4JpgLen = 701;
     1679
     1680TEST_F(LibYUVConvertTest, TestMJPGSize) {
     1681  int width = 0;
     1682  int height = 0;
     1683  int ret = MJPGSize(kTest2Jpg, kTest2JpgLen, &width, &height);
     1684  EXPECT_EQ(0, ret);
     1685
     1686  printf("test jpeg size %d x %d\n", width, height);
    13991687}
    14001688
    1401 TEST_F(LibYUVConvertTest, MJPGToARGB) {
    1402   const int kOff = 10;
    1403   const int kMinJpeg = 64;
    1404   const int kImageSize = benchmark_width_ * benchmark_height_ >= kMinJpeg
    1405                              ? benchmark_width_ * benchmark_height_
    1406                              : kMinJpeg;
    1407   const int kSize = kImageSize + kOff;
    1408   align_buffer_page_end(orig_pixels, kSize);
    1409   align_buffer_page_end(dst_argb_opt, benchmark_width_ * benchmark_height_ * 4);
    1410 
    1411   // EOI, SOI to make MJPG appear valid.
    1412   memset(orig_pixels, 0, kSize);
    1413   orig_pixels[0] = 0xff;
    1414   orig_pixels[1] = 0xd8;  // SOI.
    1415   orig_pixels[kSize - kOff + 0] = 0xff;
    1416   orig_pixels[kSize - kOff + 1] = 0xd9;  // EOI.
    1417 
    1418   for (int times = 0; times < benchmark_iterations_; ++times) {
    1419     int ret = MJPGToARGB(orig_pixels, kSize, dst_argb_opt, benchmark_width_ * 4,
    1420                          benchmark_width_, benchmark_height_, benchmark_width_,
    1421                          benchmark_height_);
    1422     // Expect failure because image is not really valid.
    1423     EXPECT_EQ(1, ret);
    1424   }
    1425 
    1426   free_aligned_buffer_page_end(dst_argb_opt);
    1427   free_aligned_buffer_page_end(orig_pixels);
     1689TEST_F(LibYUVConvertTest, TestMJPGToI420) {
     1690  int width = 0;
     1691  int height = 0;
     1692  int ret = MJPGSize(kTest2Jpg, kTest2JpgLen, &width, &height);
     1693  EXPECT_EQ(0, ret);
     1694
     1695  int half_width = (width + 1) / 2;
     1696  int half_height = (height + 1) / 2;
     1697  int benchmark_iterations = benchmark_iterations_ * benchmark_width_ *
     1698                             benchmark_height_ / (width * height);
     1699
     1700  align_buffer_page_end(dst_y, width * height);
     1701  align_buffer_page_end(dst_u, half_width * half_height);
     1702  align_buffer_page_end(dst_v, half_width * half_height);
     1703  for (int times = 0; times < benchmark_iterations; ++times) {
     1704    ret = MJPGToI420(kTest2Jpg, kTest2JpgLen, dst_y, width, dst_u, half_width,
     1705                     dst_v, half_width, width, height, width, height);
     1706  }
     1707  // Expect sucesss
     1708  EXPECT_EQ(0, ret);
     1709
     1710  // Test result matches known hash value.
     1711  uint32_t dst_y_hash = HashDjb2(dst_y, width * height, 5381);
     1712  uint32_t dst_u_hash = HashDjb2(dst_u, half_width * half_height, 5381);
     1713  uint32_t dst_v_hash = HashDjb2(dst_v, half_width * half_height, 5381);
     1714  EXPECT_EQ(dst_y_hash, 2682851208u);
     1715  EXPECT_EQ(dst_u_hash, 2501859930u);
     1716  EXPECT_EQ(dst_v_hash, 2126459123u);
     1717
     1718  free_aligned_buffer_page_end(dst_y);
     1719  free_aligned_buffer_page_end(dst_u);
     1720  free_aligned_buffer_page_end(dst_v);
    14281721}
    14291722
     1723TEST_F(LibYUVConvertTest, TestMJPGToI420_NV21) {
     1724  int width = 0;
     1725  int height = 0;
     1726  int ret = MJPGSize(kTest2Jpg, kTest2JpgLen, &width, &height);
     1727  EXPECT_EQ(0, ret);
     1728
     1729  int half_width = (width + 1) / 2;
     1730  int half_height = (height + 1) / 2;
     1731  int benchmark_iterations = benchmark_iterations_ * benchmark_width_ *
     1732                             benchmark_height_ / (width * height);
     1733
     1734  // Convert to NV21
     1735  align_buffer_page_end(dst_y, width * height);
     1736  align_buffer_page_end(dst_vu, half_width * half_height * 2);
     1737
     1738  for (int times = 0; times < benchmark_iterations; ++times) {
     1739    ret = MJPGToNV21(kTest2Jpg, kTest2JpgLen, dst_y, width, dst_vu,
     1740                     half_width * 2, width, height, width, height);
     1741  }
     1742  // Expect sucesss
     1743  EXPECT_EQ(0, ret);
     1744
     1745  // Convert to I420
     1746  align_buffer_page_end(dst2_y, width * height);
     1747  align_buffer_page_end(dst2_u, half_width * half_height);
     1748  align_buffer_page_end(dst2_v, half_width * half_height);
     1749  for (int times = 0; times < benchmark_iterations; ++times) {
     1750    ret = MJPGToI420(kTest2Jpg, kTest2JpgLen, dst2_y, width, dst2_u, half_width,
     1751                     dst2_v, half_width, width, height, width, height);
     1752  }
     1753  // Expect sucesss
     1754  EXPECT_EQ(0, ret);
     1755
     1756  // Convert I420 to NV21
     1757  align_buffer_page_end(dst3_y, width * height);
     1758  align_buffer_page_end(dst3_vu, half_width * half_height * 2);
     1759
     1760  I420ToNV21(dst2_y, width, dst2_u, half_width, dst2_v, half_width, dst3_y,
     1761             width, dst3_vu, half_width * 2, width, height);
     1762
     1763  for (int i = 0; i < width * height; ++i) {
     1764    EXPECT_EQ(dst_y[i], dst3_y[i]);
     1765  }
     1766  for (int i = 0; i < half_width * half_height * 2; ++i) {
     1767    EXPECT_EQ(dst_vu[i], dst3_vu[i]);
     1768    EXPECT_EQ(dst_vu[i], dst3_vu[i]);
     1769  }
     1770
     1771  free_aligned_buffer_page_end(dst3_y);
     1772  free_aligned_buffer_page_end(dst3_vu);
     1773
     1774  free_aligned_buffer_page_end(dst2_y);
     1775  free_aligned_buffer_page_end(dst2_u);
     1776  free_aligned_buffer_page_end(dst2_v);
     1777
     1778  free_aligned_buffer_page_end(dst_y);
     1779  free_aligned_buffer_page_end(dst_vu);
     1780}
     1781
     1782TEST_F(LibYUVConvertTest, TestMJPGToNV21_420) {
     1783  int width = 0;
     1784  int height = 0;
     1785  int ret = MJPGSize(kTest2Jpg, kTest2JpgLen, &width, &height);
     1786  EXPECT_EQ(0, ret);
     1787
     1788  int half_width = (width + 1) / 2;
     1789  int half_height = (height + 1) / 2;
     1790  int benchmark_iterations = benchmark_iterations_ * benchmark_width_ *
     1791                             benchmark_height_ / (width * height);
     1792
     1793  align_buffer_page_end(dst_y, width * height);
     1794  align_buffer_page_end(dst_uv, half_width * half_height * 2);
     1795  for (int times = 0; times < benchmark_iterations; ++times) {
     1796    ret = MJPGToNV21(kTest2Jpg, kTest2JpgLen, dst_y, width, dst_uv,
     1797                     half_width * 2, width, height, width, height);
     1798  }
     1799  // Expect sucesss
     1800  EXPECT_EQ(0, ret);
     1801
     1802  // Test result matches known hash value.
     1803  uint32_t dst_y_hash = HashDjb2(dst_y, width * height, 5381);
     1804  uint32_t dst_uv_hash = HashDjb2(dst_uv, half_width * half_height * 2, 5381);
     1805  EXPECT_EQ(dst_y_hash, 2682851208u);
     1806  EXPECT_EQ(dst_uv_hash, 1069662856u);
     1807
     1808  free_aligned_buffer_page_end(dst_y);
     1809  free_aligned_buffer_page_end(dst_uv);
     1810}
     1811
     1812TEST_F(LibYUVConvertTest, TestMJPGToNV21_422) {
     1813  int width = 0;
     1814  int height = 0;
     1815  int ret = MJPGSize(kTest3Jpg, kTest3JpgLen, &width, &height);
     1816  EXPECT_EQ(0, ret);
     1817
     1818  int half_width = (width + 1) / 2;
     1819  int half_height = (height + 1) / 2;
     1820  int benchmark_iterations = benchmark_iterations_ * benchmark_width_ *
     1821                             benchmark_height_ / (width * height);
     1822
     1823  align_buffer_page_end(dst_y, width * height);
     1824  align_buffer_page_end(dst_uv, half_width * half_height * 2);
     1825  for (int times = 0; times < benchmark_iterations; ++times) {
     1826    ret = MJPGToNV21(kTest3Jpg, kTest3JpgLen, dst_y, width, dst_uv,
     1827                     half_width * 2, width, height, width, height);
     1828  }
     1829  // Expect sucesss
     1830  EXPECT_EQ(0, ret);
     1831
     1832  // Test result matches known hash value.
     1833  uint32_t dst_y_hash = HashDjb2(dst_y, width * height, 5381);
     1834  uint32_t dst_uv_hash = HashDjb2(dst_uv, half_width * half_height * 2, 5381);
     1835  EXPECT_EQ(dst_y_hash, 2682851208u);
     1836  EXPECT_EQ(dst_uv_hash, 3543430771u);
     1837
     1838  free_aligned_buffer_page_end(dst_y);
     1839  free_aligned_buffer_page_end(dst_uv);
     1840}
     1841
     1842TEST_F(LibYUVConvertTest, TestMJPGToNV21_400) {
     1843  int width = 0;
     1844  int height = 0;
     1845  int ret = MJPGSize(kTest0Jpg, kTest0JpgLen, &width, &height);
     1846  EXPECT_EQ(0, ret);
     1847
     1848  int half_width = (width + 1) / 2;
     1849  int half_height = (height + 1) / 2;
     1850  int benchmark_iterations = benchmark_iterations_ * benchmark_width_ *
     1851                             benchmark_height_ / (width * height);
     1852
     1853  align_buffer_page_end(dst_y, width * height);
     1854  align_buffer_page_end(dst_uv, half_width * half_height * 2);
     1855  for (int times = 0; times < benchmark_iterations; ++times) {
     1856    ret = MJPGToNV21(kTest0Jpg, kTest0JpgLen, dst_y, width, dst_uv,
     1857                     half_width * 2, width, height, width, height);
     1858  }
     1859  // Expect sucesss
     1860  EXPECT_EQ(0, ret);
     1861
     1862  // Test result matches known hash value.
     1863  uint32_t dst_y_hash = HashDjb2(dst_y, width * height, 5381);
     1864  uint32_t dst_uv_hash = HashDjb2(dst_uv, half_width * half_height * 2, 5381);
     1865  EXPECT_EQ(dst_y_hash, 330644005u);
     1866  EXPECT_EQ(dst_uv_hash, 135214341u);
     1867
     1868  free_aligned_buffer_page_end(dst_y);
     1869  free_aligned_buffer_page_end(dst_uv);
     1870}
     1871
     1872TEST_F(LibYUVConvertTest, TestMJPGToNV21_444) {
     1873  int width = 0;
     1874  int height = 0;
     1875  int ret = MJPGSize(kTest1Jpg, kTest1JpgLen, &width, &height);
     1876  EXPECT_EQ(0, ret);
     1877
     1878  int half_width = (width + 1) / 2;
     1879  int half_height = (height + 1) / 2;
     1880  int benchmark_iterations = benchmark_iterations_ * benchmark_width_ *
     1881                             benchmark_height_ / (width * height);
     1882
     1883  align_buffer_page_end(dst_y, width * height);
     1884  align_buffer_page_end(dst_uv, half_width * half_height * 2);
     1885  for (int times = 0; times < benchmark_iterations; ++times) {
     1886    ret = MJPGToNV21(kTest1Jpg, kTest1JpgLen, dst_y, width, dst_uv,
     1887                     half_width * 2, width, height, width, height);
     1888  }
     1889  // Expect sucesss
     1890  EXPECT_EQ(0, ret);
     1891
     1892  // Test result matches known hash value.
     1893  uint32_t dst_y_hash = HashDjb2(dst_y, width * height, 5381);
     1894  uint32_t dst_uv_hash = HashDjb2(dst_uv, half_width * half_height * 2, 5381);
     1895  EXPECT_EQ(dst_y_hash, 2682851208u);
     1896  EXPECT_EQ(dst_uv_hash, 506143297u);
     1897
     1898  free_aligned_buffer_page_end(dst_y);
     1899  free_aligned_buffer_page_end(dst_uv);
     1900}
     1901
     1902TEST_F(LibYUVConvertTest, TestMJPGToARGB) {
     1903  int width = 0;
     1904  int height = 0;
     1905  int ret = MJPGSize(kTest3Jpg, kTest3JpgLen, &width, &height);
     1906  EXPECT_EQ(0, ret);
     1907
     1908  int benchmark_iterations = benchmark_iterations_ * benchmark_width_ *
     1909                             benchmark_height_ / (width * height);
     1910
     1911  align_buffer_page_end(dst_argb, width * height * 4);
     1912  for (int times = 0; times < benchmark_iterations; ++times) {
     1913    ret = MJPGToARGB(kTest3Jpg, kTest3JpgLen, dst_argb, width * 4, width,
     1914                     height, width, height);
     1915  }
     1916  // Expect sucesss
     1917  EXPECT_EQ(0, ret);
     1918
     1919  // Test result matches known hash value.
     1920  uint32_t dst_argb_hash = HashDjb2(dst_argb, width * height, 5381);
     1921  EXPECT_EQ(dst_argb_hash, 2355976473u);
     1922
     1923  free_aligned_buffer_page_end(dst_argb);
     1924}
     1925
     1926static int ShowJPegInfo(const uint8_t* sample, size_t sample_size) {
     1927  MJpegDecoder mjpeg_decoder;
     1928  LIBYUV_BOOL ret = mjpeg_decoder.LoadFrame(sample, sample_size);
     1929
     1930  int width = mjpeg_decoder.GetWidth();
     1931  int height = mjpeg_decoder.GetHeight();
     1932
     1933  // YUV420
     1934  if (mjpeg_decoder.GetColorSpace() == MJpegDecoder::kColorSpaceYCbCr &&
     1935      mjpeg_decoder.GetNumComponents() == 3 &&
     1936      mjpeg_decoder.GetVertSampFactor(0) == 2 &&
     1937      mjpeg_decoder.GetHorizSampFactor(0) == 2 &&
     1938      mjpeg_decoder.GetVertSampFactor(1) == 1 &&
     1939      mjpeg_decoder.GetHorizSampFactor(1) == 1 &&
     1940      mjpeg_decoder.GetVertSampFactor(2) == 1 &&
     1941      mjpeg_decoder.GetHorizSampFactor(2) == 1) {
     1942    printf("JPeg is J420, %dx%d %d bytes\n", width, height,
     1943           static_cast<int>(sample_size));
     1944    // YUV422
     1945  } else if (mjpeg_decoder.GetColorSpace() == MJpegDecoder::kColorSpaceYCbCr &&
     1946             mjpeg_decoder.GetNumComponents() == 3 &&
     1947             mjpeg_decoder.GetVertSampFactor(0) == 1 &&
     1948             mjpeg_decoder.GetHorizSampFactor(0) == 2 &&
     1949             mjpeg_decoder.GetVertSampFactor(1) == 1 &&
     1950             mjpeg_decoder.GetHorizSampFactor(1) == 1 &&
     1951             mjpeg_decoder.GetVertSampFactor(2) == 1 &&
     1952             mjpeg_decoder.GetHorizSampFactor(2) == 1) {
     1953    printf("JPeg is J422, %dx%d %d bytes\n", width, height,
     1954           static_cast<int>(sample_size));
     1955    // YUV444
     1956  } else if (mjpeg_decoder.GetColorSpace() == MJpegDecoder::kColorSpaceYCbCr &&
     1957             mjpeg_decoder.GetNumComponents() == 3 &&
     1958             mjpeg_decoder.GetVertSampFactor(0) == 1 &&
     1959             mjpeg_decoder.GetHorizSampFactor(0) == 1 &&
     1960             mjpeg_decoder.GetVertSampFactor(1) == 1 &&
     1961             mjpeg_decoder.GetHorizSampFactor(1) == 1 &&
     1962             mjpeg_decoder.GetVertSampFactor(2) == 1 &&
     1963             mjpeg_decoder.GetHorizSampFactor(2) == 1) {
     1964    printf("JPeg is J444, %dx%d %d bytes\n", width, height,
     1965           static_cast<int>(sample_size));
     1966    // YUV400
     1967  } else if (mjpeg_decoder.GetColorSpace() ==
     1968                 MJpegDecoder::kColorSpaceGrayscale &&
     1969             mjpeg_decoder.GetNumComponents() == 1 &&
     1970             mjpeg_decoder.GetVertSampFactor(0) == 1 &&
     1971             mjpeg_decoder.GetHorizSampFactor(0) == 1) {
     1972    printf("JPeg is J400, %dx%d %d bytes\n", width, height,
     1973           static_cast<int>(sample_size));
     1974  } else {
     1975    // Unknown colorspace.
     1976    printf("JPeg is Unknown colorspace.\n");
     1977  }
     1978  mjpeg_decoder.UnloadFrame();
     1979  return ret;
     1980}
     1981
     1982TEST_F(LibYUVConvertTest, TestMJPGInfo) {
     1983  EXPECT_EQ(1, ShowJPegInfo(kTest0Jpg, kTest0JpgLen));
     1984  EXPECT_EQ(1, ShowJPegInfo(kTest1Jpg, kTest1JpgLen));
     1985  EXPECT_EQ(1, ShowJPegInfo(kTest2Jpg, kTest2JpgLen));
     1986  EXPECT_EQ(1, ShowJPegInfo(kTest3Jpg, kTest3JpgLen));
     1987  EXPECT_EQ(1,
     1988            ShowJPegInfo(kTest4Jpg, kTest4JpgLen));  // Valid but unsupported.
     1989}
    14301990#endif  // HAVE_JPEG
    14311991
     
    15072067  free_aligned_buffer_page_end(dst_u_2);
    15082068  free_aligned_buffer_page_end(dst_v_2);
     2069  free_aligned_buffer_page_end(src_y);
     2070}
     2071
     2072TEST_F(LibYUVConvertTest, I420CropOddY) {
     2073  const int SUBSAMP_X = 2;
     2074  const int SUBSAMP_Y = 2;
     2075  const int kWidth = benchmark_width_;
     2076  const int kHeight = benchmark_height_;
     2077  const int crop_y = 1;
     2078  const int kDestWidth = benchmark_width_;
     2079  const int kDestHeight = benchmark_height_ - crop_y * 2;
     2080  const int kStrideU = SUBSAMPLE(kWidth, SUBSAMP_X);
     2081  const int kStrideV = SUBSAMPLE(kWidth, SUBSAMP_X);
     2082  const int sample_size = kWidth * kHeight +
     2083                          kStrideU * SUBSAMPLE(kHeight, SUBSAMP_Y) +
     2084                          kStrideV * SUBSAMPLE(kHeight, SUBSAMP_Y);
     2085  align_buffer_page_end(src_y, sample_size);
     2086  uint8_t* src_u = src_y + kWidth * kHeight;
     2087  uint8_t* src_v = src_u + kStrideU * SUBSAMPLE(kHeight, SUBSAMP_Y);
     2088
     2089  align_buffer_page_end(dst_y, kDestWidth * kDestHeight);
     2090  align_buffer_page_end(dst_u, SUBSAMPLE(kDestWidth, SUBSAMP_X) *
     2091                                   SUBSAMPLE(kDestHeight, SUBSAMP_Y));
     2092  align_buffer_page_end(dst_v, SUBSAMPLE(kDestWidth, SUBSAMP_X) *
     2093                                   SUBSAMPLE(kDestHeight, SUBSAMP_Y));
     2094
     2095  for (int i = 0; i < kHeight * kWidth; ++i) {
     2096    src_y[i] = (fastrand() & 0xff);
     2097  }
     2098  for (int i = 0; i < SUBSAMPLE(kHeight, SUBSAMP_Y) * kStrideU; ++i) {
     2099    src_u[i] = (fastrand() & 0xff);
     2100  }
     2101  for (int i = 0; i < SUBSAMPLE(kHeight, SUBSAMP_Y) * kStrideV; ++i) {
     2102    src_v[i] = (fastrand() & 0xff);
     2103  }
     2104  memset(dst_y, 1, kDestWidth * kDestHeight);
     2105  memset(dst_u, 2,
     2106         SUBSAMPLE(kDestWidth, SUBSAMP_X) * SUBSAMPLE(kDestHeight, SUBSAMP_Y));
     2107  memset(dst_v, 3,
     2108         SUBSAMPLE(kDestWidth, SUBSAMP_X) * SUBSAMPLE(kDestHeight, SUBSAMP_Y));
     2109
     2110  MaskCpuFlags(benchmark_cpu_info_);
     2111  for (int i = 0; i < benchmark_iterations_; ++i) {
     2112    ConvertToI420(src_y, sample_size, dst_y, kDestWidth, dst_u,
     2113                  SUBSAMPLE(kDestWidth, SUBSAMP_X), dst_v,
     2114                  SUBSAMPLE(kDestWidth, SUBSAMP_X), 0, crop_y, kWidth, kHeight,
     2115                  kDestWidth, kDestHeight, libyuv::kRotate0,
     2116                  libyuv::FOURCC_I420);
     2117  }
     2118
     2119  for (int i = 0; i < kDestHeight; ++i) {
     2120    for (int j = 0; j < kDestWidth; ++j) {
     2121      EXPECT_EQ(src_y[crop_y * kWidth + i * kWidth + j],
     2122                dst_y[i * kDestWidth + j]);
     2123    }
     2124  }
     2125  for (int i = 0; i < SUBSAMPLE(kDestHeight, SUBSAMP_Y); ++i) {
     2126    for (int j = 0; j < SUBSAMPLE(kDestWidth, SUBSAMP_X); ++j) {
     2127      EXPECT_EQ(src_u[(crop_y / 2 + i) * kStrideU + j],
     2128                dst_u[i * SUBSAMPLE(kDestWidth, SUBSAMP_X) + j]);
     2129    }
     2130  }
     2131  for (int i = 0; i < SUBSAMPLE(kDestHeight, SUBSAMP_Y); ++i) {
     2132    for (int j = 0; j < SUBSAMPLE(kDestWidth, SUBSAMP_X); ++j) {
     2133      EXPECT_EQ(src_v[(crop_y / 2 + i) * kStrideV + j],
     2134                dst_v[i * SUBSAMPLE(kDestWidth, SUBSAMP_X) + j]);
     2135    }
     2136  }
     2137
     2138  free_aligned_buffer_page_end(dst_y);
     2139  free_aligned_buffer_page_end(dst_u);
     2140  free_aligned_buffer_page_end(dst_v);
    15092141  free_aligned_buffer_page_end(src_y);
    15102142}
     
    24593091}
    24603092
     3093// Test RGB24 to ARGB and back to RGB24
     3094TEST_F(LibYUVConvertTest, TestARGBToRGB24) {
     3095  const int kSize = 256;
     3096  align_buffer_page_end(orig_rgb24, kSize * 3);
     3097  align_buffer_page_end(argb_pixels, kSize * 4);
     3098  align_buffer_page_end(dest_rgb24, kSize * 3);
     3099
     3100  // Test grey scale
     3101  for (int i = 0; i < kSize * 3; ++i) {
     3102    orig_rgb24[i] = i;
     3103  }
     3104
     3105  RGB24ToARGB(orig_rgb24, 0, argb_pixels, 0, kSize, 1);
     3106  ARGBToRGB24(argb_pixels, 0, dest_rgb24, 0, kSize, 1);
     3107
     3108  for (int i = 0; i < kSize * 3; ++i) {
     3109    EXPECT_EQ(orig_rgb24[i], dest_rgb24[i]);
     3110  }
     3111
     3112  free_aligned_buffer_page_end(orig_rgb24);
     3113  free_aligned_buffer_page_end(argb_pixels);
     3114  free_aligned_buffer_page_end(dest_rgb24);
     3115}
     3116
    24613117}  // namespace libyuv
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/unit_test/cpu_test.cc

    r235135 r239415  
    2121TEST_F(LibYUVBaseTest, TestCpuHas) {
    2222  int cpu_flags = TestCpuFlag(-1);
    23   printf("Cpu Flags %x\n", cpu_flags);
     23  printf("Cpu Flags %d\n", cpu_flags);
    2424#if defined(__arm__) || defined(__aarch64__)
    2525  int has_arm = TestCpuFlag(kCpuHasARM);
    26   printf("Has ARM %x\n", has_arm);
     26  printf("Has ARM %d\n", has_arm);
    2727  int has_neon = TestCpuFlag(kCpuHasNEON);
    28   printf("Has NEON %x\n", has_neon);
     28  printf("Has NEON %d\n", has_neon);
    2929#endif
    3030  int has_x86 = TestCpuFlag(kCpuHasX86);
     
    4545  int has_avx512vbitalg = TestCpuFlag(kCpuHasAVX512VBITALG);
    4646  int has_avx512vpopcntdq = TestCpuFlag(kCpuHasAVX512VPOPCNTDQ);
    47   printf("Has X86 %x\n", has_x86);
    48   printf("Has SSE2 %x\n", has_sse2);
    49   printf("Has SSSE3 %x\n", has_ssse3);
    50   printf("Has SSE4.1 %x\n", has_sse41);
    51   printf("Has SSE4.2 %x\n", has_sse42);
    52   printf("Has AVX %x\n", has_avx);
    53   printf("Has AVX2 %x\n", has_avx2);
    54   printf("Has ERMS %x\n", has_erms);
    55   printf("Has FMA3 %x\n", has_fma3);
    56   printf("Has F16C %x\n", has_f16c);
    57   printf("Has GFNI %x\n", has_gfni);
    58   printf("Has AVX512BW %x\n", has_avx512bw);
    59   printf("Has AVX512VL %x\n", has_avx512vl);
    60   printf("Has AVX512VBMI %x\n", has_avx512vbmi);
    61   printf("Has AVX512VBMI2 %x\n", has_avx512vbmi2);
    62   printf("Has AVX512VBITALG %x\n", has_avx512vbitalg);
    63   printf("Has AVX512VPOPCNTDQ %x\n", has_avx512vpopcntdq);
     47  printf("Has X86 %d\n", has_x86);
     48  printf("Has SSE2 %d\n", has_sse2);
     49  printf("Has SSSE3 %d\n", has_ssse3);
     50  printf("Has SSE41 %d\n", has_sse41);
     51  printf("Has SSE42 %d\n", has_sse42);
     52  printf("Has AVX %d\n", has_avx);
     53  printf("Has AVX2 %d\n", has_avx2);
     54  printf("Has ERMS %d\n", has_erms);
     55  printf("Has FMA3 %d\n", has_fma3);
     56  printf("Has F16C %d\n", has_f16c);
     57  printf("Has GFNI %d\n", has_gfni);
     58  printf("Has AVX512BW %d\n", has_avx512bw);
     59  printf("Has AVX512VL %d\n", has_avx512vl);
     60  printf("Has AVX512VBMI %d\n", has_avx512vbmi);
     61  printf("Has AVX512VBMI2 %d\n", has_avx512vbmi2);
     62  printf("Has AVX512VBITALG %d\n", has_avx512vbitalg);
     63  printf("Has AVX512VPOPCNTDQ %d\n", has_avx512vpopcntdq);
    6464
    6565#if defined(__mips__)
    6666  int has_mips = TestCpuFlag(kCpuHasMIPS);
    67   printf("Has MIPS %x\n", has_mips);
     67  printf("Has MIPS %d\n", has_mips);
    6868  int has_msa = TestCpuFlag(kCpuHasMSA);
    69   printf("Has MSA %x\n", has_msa);
     69  printf("Has MSA %d\n", has_msa);
     70  int has_mmi = TestCpuFlag(kCpuHasMMI);
     71  printf("Has MMI %d\n", has_mmi);
    7072#endif
    7173}
     
    159161}
    160162
     163TEST_F(LibYUVBaseTest, TestSetCpuFlags) {
     164  // Reset any masked flags that may have been set so auto init is enabled.
     165  MaskCpuFlags(0);
     166
     167  int original_cpu_flags = TestCpuFlag(-1);
     168
     169  // Test setting different CPU configurations.
     170  int cpu_flags = kCpuHasARM | kCpuHasNEON | kCpuInitialized;
     171  SetCpuFlags(cpu_flags);
     172  EXPECT_EQ(cpu_flags, TestCpuFlag(-1));
     173
     174  cpu_flags = kCpuHasX86 | kCpuInitialized;
     175  SetCpuFlags(cpu_flags);
     176  EXPECT_EQ(cpu_flags, TestCpuFlag(-1));
     177
     178  // Test that setting 0 turns auto-init back on.
     179  SetCpuFlags(0);
     180  EXPECT_EQ(original_cpu_flags, TestCpuFlag(-1));
     181
     182  // Restore the CPU flag mask.
     183  MaskCpuFlags(benchmark_cpu_info_);
     184}
     185
    161186}  // namespace libyuv
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/unit_test/scale_argb_test.cc

    r235135 r239415  
    304304TEST_SCALETO(ARGBScale, 1, 1)
    305305TEST_SCALETO(ARGBScale, 320, 240)
    306 TEST_SCALETO(ARGBScale, 352, 288)
    307306TEST_SCALETO(ARGBScale, 569, 480)
    308307TEST_SCALETO(ARGBScale, 640, 360)
    309308TEST_SCALETO(ARGBScale, 1280, 720)
     309TEST_SCALETO(ARGBScale, 1920, 1080)
    310310#undef TEST_SCALETO1
    311311#undef TEST_SCALETO
     
    320320                             const uint8_t* src_v,
    321321                             int src_stride_v,
    322                              uint32 /* src_fourcc */,
     322                             uint32_t /* src_fourcc */,
    323323                             int src_width,
    324324                             int src_height,
    325325                             uint8_t* dst_argb,
    326326                             int dst_stride_argb,
    327                              uint32 /* dst_fourcc */,
     327                             uint32_t /* dst_fourcc */,
    328328                             int dst_width,
    329329                             int dst_height,
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/unit_test/scale_test.cc

    r235135 r239415  
    337337TEST_SCALETO(Scale, 1, 1)
    338338TEST_SCALETO(Scale, 320, 240)
    339 TEST_SCALETO(Scale, 352, 288)
    340339TEST_SCALETO(Scale, 569, 480)
    341340TEST_SCALETO(Scale, 640, 360)
    342341TEST_SCALETO(Scale, 1280, 720)
     342TEST_SCALETO(Scale, 1920, 1080)
    343343#undef TEST_SCALETO1
    344344#undef TEST_SCALETO
     
    438438                                    uint16_t* dst,
    439439                                    int dst_width);
     440extern "C" void ScaleRowUp2_16_MMI(const uint16_t* src_ptr,
     441                                   ptrdiff_t src_stride,
     442                                   uint16_t* dst,
     443                                   int dst_width);
    440444extern "C" void ScaleRowUp2_16_C(const uint16_t* src_ptr,
    441445                                 ptrdiff_t src_stride,
     
    461465    if (has_neon) {
    462466      ScaleRowUp2_16_NEON(&orig_pixels[0], 640, &dst_pixels_opt[0], 1280);
     467    } else {
     468      ScaleRowUp2_16_C(&orig_pixels[0], 640, &dst_pixels_opt[0], 1280);
     469    }
     470#elif !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
     471    int has_mmi = TestCpuFlag(kCpuHasMMI);
     472    if (has_mmi) {
     473      ScaleRowUp2_16_MMI(&orig_pixels[0], 640, &dst_pixels_opt[0], 1280);
    463474    } else {
    464475      ScaleRowUp2_16_C(&orig_pixels[0], 640, &dst_pixels_opt[0], 1280);
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/unit_test/unit_test.cc

    r235135 r239415  
    3939#endif
    4040
     41// Test environment variable for disabling CPU features. Any non-zero value
     42// to disable. Zero ignored to make it easy to set the variable on/off.
     43#if !defined(__native_client__) && !defined(_M_ARM)
     44static LIBYUV_BOOL TestEnv(const char* name) {
     45  const char* var = getenv(name);
     46  if (var) {
     47    if (var[0] != '0') {
     48      return LIBYUV_TRUE;
     49    }
     50  }
     51  return LIBYUV_FALSE;
     52}
     53#else  // nacl does not support getenv().
     54static LIBYUV_BOOL TestEnv(const char*) {
     55  return LIBYUV_FALSE;
     56}
     57#endif
     58
     59int TestCpuEnv(int cpu_info) {
     60#if defined(__arm__) || defined(__aarch64__)
     61  if (TestEnv("LIBYUV_DISABLE_NEON")) {
     62    cpu_info &= ~libyuv::kCpuHasNEON;
     63  }
     64#endif
     65#if defined(__mips__) && defined(__linux__)
     66  if (TestEnv("LIBYUV_DISABLE_MSA")) {
     67    cpu_info &= ~libyuv::kCpuHasMSA;
     68  }
     69  if (TestEnv("LIBYUV_DISABLE_MMI")) {
     70    cpu_info &= ~libyuv::kCpuHasMMI;
     71  }
     72#endif
     73#if !defined(__pnacl__) && !defined(__CLR_VER) &&                   \
     74    (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \
     75     defined(_M_IX86))
     76  if (TestEnv("LIBYUV_DISABLE_X86")) {
     77    cpu_info &= ~libyuv::kCpuHasX86;
     78  }
     79  if (TestEnv("LIBYUV_DISABLE_SSE2")) {
     80    cpu_info &= ~libyuv::kCpuHasSSE2;
     81  }
     82  if (TestEnv("LIBYUV_DISABLE_SSSE3")) {
     83    cpu_info &= ~libyuv::kCpuHasSSSE3;
     84  }
     85  if (TestEnv("LIBYUV_DISABLE_SSE41")) {
     86    cpu_info &= ~libyuv::kCpuHasSSE41;
     87  }
     88  if (TestEnv("LIBYUV_DISABLE_SSE42")) {
     89    cpu_info &= ~libyuv::kCpuHasSSE42;
     90  }
     91  if (TestEnv("LIBYUV_DISABLE_AVX")) {
     92    cpu_info &= ~libyuv::kCpuHasAVX;
     93  }
     94  if (TestEnv("LIBYUV_DISABLE_AVX2")) {
     95    cpu_info &= ~libyuv::kCpuHasAVX2;
     96  }
     97  if (TestEnv("LIBYUV_DISABLE_ERMS")) {
     98    cpu_info &= ~libyuv::kCpuHasERMS;
     99  }
     100  if (TestEnv("LIBYUV_DISABLE_FMA3")) {
     101    cpu_info &= ~libyuv::kCpuHasFMA3;
     102  }
     103  if (TestEnv("LIBYUV_DISABLE_F16C")) {
     104    cpu_info &= ~libyuv::kCpuHasF16C;
     105  }
     106  if (TestEnv("LIBYUV_DISABLE_AVX512BW")) {
     107    cpu_info &= ~libyuv::kCpuHasAVX512BW;
     108  }
     109  if (TestEnv("LIBYUV_DISABLE_AVX512VL")) {
     110    cpu_info &= ~libyuv::kCpuHasAVX512VL;
     111  }
     112  if (TestEnv("LIBYUV_DISABLE_AVX512VBMI")) {
     113    cpu_info &= ~libyuv::kCpuHasAVX512VBMI;
     114  }
     115  if (TestEnv("LIBYUV_DISABLE_AVX512VBMI2")) {
     116    cpu_info &= ~libyuv::kCpuHasAVX512VBMI2;
     117  }
     118  if (TestEnv("LIBYUV_DISABLE_AVX512VBITALG")) {
     119    cpu_info &= ~libyuv::kCpuHasAVX512VBITALG;
     120  }
     121  if (TestEnv("LIBYUV_DISABLE_AVX512VPOPCNTDQ")) {
     122    cpu_info &= ~libyuv::kCpuHasAVX512VPOPCNTDQ;
     123  }
     124  if (TestEnv("LIBYUV_DISABLE_GFNI")) {
     125    cpu_info &= ~libyuv::kCpuHasGFNI;
     126  }
     127#endif
     128  if (TestEnv("LIBYUV_DISABLE_ASM")) {
     129    cpu_info = libyuv::kCpuInitialized;
     130  }
     131  return cpu_info;
     132}
     133
    41134// For quicker unittests, default is 128 x 72.  But when benchmarking,
    42135// default to 720p.  Allow size to specify.
     
    88181    benchmark_cpu_info_ = FLAGS_libyuv_cpu_info;
    89182  }
     183  disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
     184  benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
    90185  libyuv::MaskCpuFlags(benchmark_cpu_info_);
    91186  benchmark_pixels_div1280_ =
     
    142237    benchmark_cpu_info_ = FLAGS_libyuv_cpu_info;
    143238  }
     239  disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
     240  benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
    144241  libyuv::MaskCpuFlags(benchmark_cpu_info_);
    145242  benchmark_pixels_div1280_ =
     
    196293    benchmark_cpu_info_ = FLAGS_libyuv_cpu_info;
    197294  }
     295  disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
     296  benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
    198297  libyuv::MaskCpuFlags(benchmark_cpu_info_);
    199298  benchmark_pixels_div1280_ =
     
    250349    benchmark_cpu_info_ = FLAGS_libyuv_cpu_info;
    251350  }
     351  disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
     352  benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
    252353  libyuv::MaskCpuFlags(benchmark_cpu_info_);
    253354  benchmark_pixels_div1280_ =
     
    304405    benchmark_cpu_info_ = FLAGS_libyuv_cpu_info;
    305406  }
     407  disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
     408  benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
    306409  libyuv::MaskCpuFlags(benchmark_cpu_info_);
    307410  benchmark_pixels_div1280_ =
     
    358461    benchmark_cpu_info_ = FLAGS_libyuv_cpu_info;
    359462  }
     463  disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
     464  benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
    360465  libyuv::MaskCpuFlags(benchmark_cpu_info_);
    361466  benchmark_pixels_div1280_ =
     
    412517    benchmark_cpu_info_ = FLAGS_libyuv_cpu_info;
    413518  }
     519  disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
     520  benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
    414521  libyuv::MaskCpuFlags(benchmark_cpu_info_);
    415522  benchmark_pixels_div1280_ =
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/unit_test/video_common_test.cc

    r235135 r239415  
    8080  EXPECT_TRUE(TestValidFourCC(FOURCC_R444, FOURCC_BPP_R444));
    8181  EXPECT_TRUE(TestValidFourCC(FOURCC_H420, FOURCC_BPP_H420));
     82  EXPECT_TRUE(TestValidFourCC(FOURCC_H422, FOURCC_BPP_H422));
    8283  EXPECT_TRUE(TestValidFourCC(FOURCC_H010, FOURCC_BPP_H010));
    8384  EXPECT_TRUE(TestValidFourCC(FOURCC_MJPG, FOURCC_BPP_MJPG));
  • trunk/Source/ThirdParty/libwebrtc/Source/third_party/libyuv/util/cpuid.c

    r235135 r239415  
    7272    int has_msa = TestCpuFlag(kCpuHasMSA);
    7373    printf("Has MSA %x\n", has_msa);
     74    int has_mmi = TestCpuFlag(kCpuHasMMI);
     75    printf("Has MMI %x\n", has_mmi);
    7476  }
    7577  if (has_x86) {
Note: See TracChangeset for help on using the changeset viewer.