• Robert Bares's avatar
    Allow negative height when ConvertToI420/ARGB is called with NV12/NV21 · a8aa921c
    Robert Bares authored
    ConvertToI420 and ConvertToARGB support the use of a negative height
    parameter to flip the image vertically. When converting from NV12 or
    NV21 this parameter was misinterpreted, resulting in invalid output.
    This CL introduces the use of abs_src_height to correctly calculate
    the location of the source UV plane.
    
    The sign of crop_height is not used, to reduce confusion ConvertToI420
    and ConvertToARGB no longer accept negative crop height.
    
    Unit tests for Android420ToI420 are updated to fix miscalculation of
    src_stride_uv, fix incorrect pixel strides, and to test inversion.
    New unit tests are included to test inversion for ConvertToARGB,
    ConvertToI420, Android420ToARGB, and Android420ToABGR.
    For consistency the test NV12Crop is renamed ConvertToI420_NV12_Crop.
    
    Bug: libyuv:446
    Test: out/Release/libyuv_unittest --gtest_filter=*.ConvertTo*:*.Android420To*
    Change-Id: Idc98e62671cb30272cfa7e24fafbc8b73712f7c6
    Reviewed-on: https://chromium-review.googlesource.com/994074
    Commit-Queue: Frank Barchard <fbarchard@chromium.org>
    Reviewed-by: 's avatarFrank Barchard <fbarchard@chromium.org>
    a8aa921c
Name
Last commit
Last update
build_overrides Loading commit data...
docs Loading commit data...
include Loading commit data...
infra/config Loading commit data...
source Loading commit data...
tools_libyuv Loading commit data...
unit_test Loading commit data...
util Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
AUTHORS Loading commit data...
Android.bp Loading commit data...
Android.mk Loading commit data...
BUILD.gn Loading commit data...
CM_linux_packages.cmake Loading commit data...
CMakeLists.txt Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
OWNERS Loading commit data...
PATENTS Loading commit data...
PRESUBMIT.py Loading commit data...
README.chromium Loading commit data...
README.md Loading commit data...
all.gyp Loading commit data...
cleanup_links.py Loading commit data...
codereview.settings Loading commit data...
download_vs_toolchain.py Loading commit data...
gyp_libyuv Loading commit data...
gyp_libyuv.py Loading commit data...
libyuv.gni Loading commit data...
libyuv.gyp Loading commit data...
libyuv.gypi Loading commit data...
libyuv_nacl.gyp Loading commit data...
libyuv_test.gyp Loading commit data...
linux.mk Loading commit data...
public.mk Loading commit data...
pylintrc Loading commit data...
winarm.mk Loading commit data...