diff --git a/include/libyuv/row.h b/include/libyuv/row.h index a51327468..935d95293 100644 --- a/include/libyuv/row.h +++ b/include/libyuv/row.h @@ -1445,11 +1445,10 @@ void Convert16To8Row_Any_AVX2(const uint16_t* src_ptr, int scale, 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_SSE2(const uint8_t* src, uint8_t* dst, int width); +void CopyRow_AVX(const uint8_t* src, uint8_t* dst, int width); 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); @@ -1631,14 +1630,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_rgb565, - uint8_t* dst_argb, +void RGB565ToARGBRow_Any_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, int width); -void ARGB1555ToARGBRow_Any_AVX2(const uint8_t* src_argb1555, - uint8_t* dst_argb, +void ARGB1555ToARGBRow_Any_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, int width); -void ARGB4444ToARGBRow_Any_AVX2(const uint8_t* src_argb4444, - uint8_t* dst_argb, +void ARGB4444ToARGBRow_Any_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, int width); void RGB24ToARGBRow_Any_NEON(const uint8_t* src_ptr, @@ -1752,7 +1751,9 @@ 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_y, uint8_t* dst_argb, int width); +void J400ToARGBRow_Any_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); void J400ToARGBRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); @@ -2430,14 +2431,14 @@ void ARGBToRGB565DitherRow_Any_AVX2(const uint8_t* src_ptr, const uint32_t param, int width); -void ARGBToRGB565Row_Any_AVX2(const uint8_t* src_argb, - uint8_t* dst_rgb, +void ARGBToRGB565Row_Any_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, int width); -void ARGBToARGB1555Row_Any_AVX2(const uint8_t* src_argb, - uint8_t* dst_rgb, +void ARGBToARGB1555Row_Any_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, int width); -void ARGBToARGB4444Row_Any_AVX2(const uint8_t* src_argb, - uint8_t* dst_rgb, +void ARGBToARGB4444Row_Any_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, 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 b71ba012e..375cc732c 100644 --- a/source/convert.cc +++ b/source/convert.cc @@ -1709,14 +1709,15 @@ 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 - } else if (src_pixel_stride_uv == 2 && vu_off == -1 && - src_stride_u == src_stride_v) { + } + 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 - } else if (src_pixel_stride_uv == 2 && vu_off == 1 && - src_stride_u == src_stride_v) { + } + 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 6925414de..3d2f307d9 100644 --- a/source/convert_argb.cc +++ b/source/convert_argb.cc @@ -1944,13 +1944,14 @@ int Android420ToARGBMatrix(const uint8_t* src_y, src_stride_v, dst_argb, dst_stride_argb, yuvconstants, width, height); // NV21 - } else if (src_pixel_stride_uv == 2 && vu_off == -1 && - src_stride_u == src_stride_v) { + } + 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 - } else if (src_pixel_stride_uv == 2 && vu_off == 1 && - src_stride_u == src_stride_v) { + } + 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 a7f55a9a5..eaf253013 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; - } 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) { + } + 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; - } 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) { + } + 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 b52c0f491..9f95941ce 100644 --- a/unit_test/planar_test.cc +++ b/unit_test/planar_test.cc @@ -1192,7 +1192,6 @@ 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) { @@ -1286,7 +1285,6 @@ 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 93b159fcc..3de4f4c24 100644 --- a/unit_test/video_common_test.cc +++ b/unit_test/video_common_test.cc @@ -19,11 +19,8 @@ namespace libyuv { // Tests FourCC codes in video common, which are used for ConvertToI420(). static bool TestValidChar(uint32_t onecc) { - if ((onecc >= '0' && onecc <= '9') || (onecc >= 'A' && onecc <= 'Z') || - (onecc >= 'a' && onecc <= 'z') || (onecc == ' ') || (onecc == 0xff)) { - return true; - } - return false; + return (onecc >= '0' && onecc <= '9') || (onecc >= 'A' && onecc <= 'Z') || + (onecc >= 'a' && onecc <= 'z') || (onecc == ' ') || (onecc == 0xff); } static bool TestValidFourCC(uint32_t fourcc, int bpp) {