Support YUV444P10LE in make_part_black().
authorCarl Hetherington <cth@carlh.net>
Sat, 10 Sep 2022 18:59:52 +0000 (20:59 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 10 Sep 2022 18:59:52 +0000 (20:59 +0200)
src/lib/image.cc
test/image_test.cc

index 5866ee5b418a82b01eec841e832a9fd0bb8db86c..9aecac8347a40bbbd0e7e4ff5a7fd2f85e608908 100644 (file)
@@ -478,6 +478,21 @@ Image::make_part_black (int const start, int const width)
                }
                break;
        }
+       case AV_PIX_FMT_YUV444P10LE:
+       {
+               y_part();
+               for (int i = 1; i < 3; ++i) {
+                       auto p = reinterpret_cast<int16_t*>(data()[i]);
+                       int const h = sample_size(i).height;
+                       for (int y = 0; y < h; ++y) {
+                               for (int x = start; x < (start + width); ++x) {
+                                       p[x] = ten_bit_uv;
+                               }
+                               p += stride()[i] / 2;
+                       }
+               }
+               break;
+       }
        default:
                throw PixelFormatError ("make_part_black()", _pixel_format);
        }
index 2ec40c70bc95b91ddb7c6fe4d24a8961fe614481..56e6819436886b187f39861f2207ea198994bda0 100644 (file)
@@ -584,6 +584,7 @@ BOOST_AUTO_TEST_CASE (make_part_black_test)
                AV_PIX_FMT_BGRA,
                AV_PIX_FMT_YUV420P,
                AV_PIX_FMT_YUV422P10LE,
+               AV_PIX_FMT_YUV444P10LE
        };
 
        list<std::pair<int, int>> positions = {