diff --git a/include/libyuv/row.h b/include/libyuv/row.h index 935d95293..a51327468 100644 --- a/include/libyuv/row.h +++ b/include/libyuv/row.h @@ -1445,10 +1445,11 @@ void Convert16To8Row_Any_AVX2(const uint16_t* src_ptr, int scale, int width); -void CopyRow_SSE2(const uint8_t* src, uint8_t* dst, int width); -void CopyRow_AVX(const uint8_t* src, uint8_t* dst, int width); +void CopyRow_SSE2(const uint8_t* src, uint8_t* dst, int count); +void CopyRow_AVX(const uint8_t* src, uint8_t* dst, int count); void CopyRow_ERMS(const uint8_t* src, uint8_t* dst, int width); void CopyRow_NEON(const uint8_t* src, uint8_t* dst, int width); +void CopyRow_MIPS(const uint8_t* src, uint8_t* dst, int count); void CopyRow_C(const uint8_t* src, uint8_t* dst, int count); void CopyRow_Any_SSE2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); void CopyRow_Any_AVX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); @@ -1630,14 +1631,14 @@ void ARGB1555ToARGBRow_Any_SSE2(const uint8_t* src_ptr, void ARGB4444ToARGBRow_Any_SSE2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); -void RGB565ToARGBRow_Any_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, +void RGB565ToARGBRow_Any_AVX2(const uint8_t* src_rgb565, + uint8_t* dst_argb, int width); -void ARGB1555ToARGBRow_Any_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, +void ARGB1555ToARGBRow_Any_AVX2(const uint8_t* src_argb1555, + uint8_t* dst_argb, int width); -void ARGB4444ToARGBRow_Any_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, +void ARGB4444ToARGBRow_Any_AVX2(const uint8_t* src_argb4444, + uint8_t* dst_argb, int width); void RGB24ToARGBRow_Any_NEON(const uint8_t* src_ptr, @@ -1751,9 +1752,7 @@ void J400ToARGBRow_C(const uint8_t* src_y, uint8_t* dst_argb, int width); void J400ToARGBRow_Any_SSE2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); -void J400ToARGBRow_Any_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); +void J400ToARGBRow_Any_AVX2(const uint8_t* src_y, uint8_t* dst_argb, int width); void J400ToARGBRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); @@ -2431,14 +2430,14 @@ void ARGBToRGB565DitherRow_Any_AVX2(const uint8_t* src_ptr, const uint32_t param, int width); -void ARGBToRGB565Row_Any_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, +void ARGBToRGB565Row_Any_AVX2(const uint8_t* src_argb, + uint8_t* dst_rgb, int width); -void ARGBToARGB1555Row_Any_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, +void ARGBToARGB1555Row_Any_AVX2(const uint8_t* src_argb, + uint8_t* dst_rgb, int width); -void ARGBToARGB4444Row_Any_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, +void ARGBToARGB4444Row_Any_AVX2(const uint8_t* src_argb, + uint8_t* dst_rgb, int width); void ABGRToAR30Row_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, diff --git a/source/convert.cc b/source/convert.cc index 375cc732c..b71ba012e 100644 --- a/source/convert.cc +++ b/source/convert.cc @@ -1709,15 +1709,14 @@ int Android420ToI420(const uint8_t* src_y, CopyPlane(src_v, src_stride_v, dst_v, dst_stride_v, halfwidth, halfheight); return 0; // Split UV planes - NV21 - } - if (src_pixel_stride_uv == 2 && vu_off == -1 && - src_stride_u == src_stride_v) { + } else if (src_pixel_stride_uv == 2 && vu_off == -1 && + src_stride_u == src_stride_v) { SplitUVPlane(src_v, src_stride_v, dst_v, dst_stride_v, dst_u, dst_stride_u, halfwidth, halfheight); return 0; // Split UV planes - NV12 - } - if (src_pixel_stride_uv == 2 && vu_off == 1 && src_stride_u == src_stride_v) { + } else if (src_pixel_stride_uv == 2 && vu_off == 1 && + src_stride_u == src_stride_v) { SplitUVPlane(src_u, src_stride_u, dst_u, dst_stride_u, dst_v, dst_stride_v, halfwidth, halfheight); return 0; diff --git a/source/convert_argb.cc b/source/convert_argb.cc index 3d2f307d9..6925414de 100644 --- a/source/convert_argb.cc +++ b/source/convert_argb.cc @@ -1944,14 +1944,13 @@ int Android420ToARGBMatrix(const uint8_t* src_y, src_stride_v, dst_argb, dst_stride_argb, yuvconstants, width, height); // NV21 - } - if (src_pixel_stride_uv == 2 && vu_off == -1 && - src_stride_u == src_stride_v) { + } else if (src_pixel_stride_uv == 2 && vu_off == -1 && + src_stride_u == src_stride_v) { return NV21ToARGBMatrix(src_y, src_stride_y, src_v, src_stride_v, dst_argb, dst_stride_argb, yuvconstants, width, height); // NV12 - } - if (src_pixel_stride_uv == 2 && vu_off == 1 && src_stride_u == src_stride_v) { + } else if (src_pixel_stride_uv == 2 && vu_off == 1 && + src_stride_u == src_stride_v) { return NV12ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, dst_argb, dst_stride_argb, yuvconstants, width, height); } diff --git a/source/mjpeg_decoder.cc b/source/mjpeg_decoder.cc index eaf253013..a7f55a9a5 100644 --- a/source/mjpeg_decoder.cc +++ b/source/mjpeg_decoder.cc @@ -552,13 +552,13 @@ JpegSubsamplingType MJpegDecoder::JpegSubsamplingTypeHelper( if (subsample_x[0] == 1 && subsample_y[0] == 1 && subsample_x[1] == 2 && subsample_y[1] == 2 && subsample_x[2] == 2 && subsample_y[2] == 2) { return kJpegYuv420; - } - if (subsample_x[0] == 1 && subsample_y[0] == 1 && subsample_x[1] == 2 && - subsample_y[1] == 1 && subsample_x[2] == 2 && subsample_y[2] == 1) { + } else if (subsample_x[0] == 1 && subsample_y[0] == 1 && + subsample_x[1] == 2 && subsample_y[1] == 1 && + subsample_x[2] == 2 && subsample_y[2] == 1) { return kJpegYuv422; - } - if (subsample_x[0] == 1 && subsample_y[0] == 1 && subsample_x[1] == 1 && - subsample_y[1] == 1 && subsample_x[2] == 1 && subsample_y[2] == 1) { + } else if (subsample_x[0] == 1 && subsample_y[0] == 1 && + subsample_x[1] == 1 && subsample_y[1] == 1 && + subsample_x[2] == 1 && subsample_y[2] == 1) { return kJpegYuv444; } } else if (number_of_components == 1) { // Grey-scale images. diff --git a/unit_test/planar_test.cc b/unit_test/planar_test.cc index 9f95941ce..b52c0f491 100644 --- a/unit_test/planar_test.cc +++ b/unit_test/planar_test.cc @@ -1192,6 +1192,7 @@ static void TestBlendPlane(int width, free_aligned_buffer_page_end(src_argb_alpha); free_aligned_buffer_page_end(dst_argb_c); free_aligned_buffer_page_end(dst_argb_opt); + return; } TEST_F(LibYUVPlanarTest, BlendPlane_Opt) { @@ -1285,6 +1286,7 @@ static void TestI420Blend(int width, free_aligned_buffer_page_end(dst_y_opt); free_aligned_buffer_page_end(dst_u_opt); free_aligned_buffer_page_end(dst_v_opt); + return; } TEST_F(LibYUVPlanarTest, I420Blend_Opt) { diff --git a/unit_test/video_common_test.cc b/unit_test/video_common_test.cc index 3de4f4c24..93b159fcc 100644 --- a/unit_test/video_common_test.cc +++ b/unit_test/video_common_test.cc @@ -19,8 +19,11 @@ namespace libyuv { // Tests FourCC codes in video common, which are used for ConvertToI420(). static bool TestValidChar(uint32_t onecc) { - return (onecc >= '0' && onecc <= '9') || (onecc >= 'A' && onecc <= 'Z') || - (onecc >= 'a' && onecc <= 'z') || (onecc == ' ') || (onecc == 0xff); + if ((onecc >= '0' && onecc <= '9') || (onecc >= 'A' && onecc <= 'Z') || + (onecc >= 'a' && onecc <= 'z') || (onecc == ' ') || (onecc == 0xff)) { + return true; + } + return false; } static bool TestValidFourCC(uint32_t fourcc, int bpp) {