Example #1
0
    def test_12(self):
        """
        YV12 -> IYUV
        """
        a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='IYUV', filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_420)

        self.assertEqual(ret, '385c87ed96b9298be9a410ff041fe4232b27a9aa')
Example #2
0
    def test_5(self):
        """
        YV12 -> 422
        """
        a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='422', filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_422)

        self.assertEqual(ret, 'c700a31a209df30b72c1097898740d4c42d63a42')
Example #3
0
    def test_1(self):
        """
        convert YV12 into itself
        """
        a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='YV12', filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_420)

        self.assertEqual(ret, 'c9120ccf583b410b75379c48325dd50ec8d16ce8')
Example #4
0
    def test_2(self):
        """
        YV12 -> UYVY
        """
        a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='UYVY', filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_422)

        self.assertEqual(ret, 'f50fc0500b217256a87c7cd1e867da0c49c51ace')
Example #5
0
    def test_3(self):
        """
        YV12 -> YVYU
        """
        a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='YVYU', filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_422)

        self.assertEqual(ret, '68ac533290a89625b910731c93fbecba89b61870')
Example #6
0
    def test_21(self):
        """
        convert YV12 into NV12
        """
        a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='NV12', filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_420)

        self.assertEqual(ret, 'e24ac66dc32cff5dff16297dfaab761ab962143c')
Example #7
0
    def test_13(self):
        """
        YV12 -> YUY2
        """
        a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='YUY2', filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_420)

        self.assertEqual(ret, '410b438c1aedc7e2ee6d68405f411bbfa8131b7a')
Example #8
0
    def test_13(self):
        """
        YV12 -> YUY2
        """
        a = YCbCr(width=352,
                  height=288,
                  filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='YUY2',
                  filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_420)

        self.assertEqual(ret, '410b438c1aedc7e2ee6d68405f411bbfa8131b7a')
Example #9
0
    def test_5(self):
        """
        YV12 -> 422
        """
        a = YCbCr(width=352,
                  height=288,
                  filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='422',
                  filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_422)

        self.assertEqual(ret, 'c700a31a209df30b72c1097898740d4c42d63a42')
Example #10
0
    def test_3(self):
        """
        YV12 -> YVYU
        """
        a = YCbCr(width=352,
                  height=288,
                  filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='YVYU',
                  filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_422)

        self.assertEqual(ret, '68ac533290a89625b910731c93fbecba89b61870')
Example #11
0
    def test_2(self):
        """
        YV12 -> UYVY
        """
        a = YCbCr(width=352,
                  height=288,
                  filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='UYVY',
                  filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_422)

        self.assertEqual(ret, 'f50fc0500b217256a87c7cd1e867da0c49c51ace')
Example #12
0
    def test_1(self):
        """
        convert YV12 into itself
        """
        a = YCbCr(width=352,
                  height=288,
                  filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='YV12',
                  filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_420)

        self.assertEqual(ret, 'c9120ccf583b410b75379c48325dd50ec8d16ce8')
Example #13
0
    def test_21(self):
        """
        convert YV12 into NV12
        """
        a = YCbCr(width=352,
                  height=288,
                  filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='NV12',
                  filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_420)

        self.assertEqual(ret, 'e24ac66dc32cff5dff16297dfaab761ab962143c')
Example #14
0
    def test_12(self):
        """
        YV12 -> IYUV
        """
        a = YCbCr(width=352,
                  height=288,
                  filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='IYUV',
                  filename_out=OUT)
        a.convert()

        ret = get_sha1(OUT, SIZE_420)

        self.assertEqual(ret, '385c87ed96b9298be9a410ff041fe4232b27a9aa')
Example #15
0
    def test_4(self):
        """
        YV12 -> UVYU -> YV12
        """
        a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='UYVY', filename_out=OUT)
        a.convert()

        b = YCbCr(width=352, height=288, filename=OUT,
                  yuv_format_in='UYVY',
                  yuv_format_out='YV12', filename_out=OUT1)
        b.convert()

        ret = get_sha1(OUT1, SIZE_422)

        self.assertEqual(ret, 'b8934d77e0d71e77e90b4ba777a0cb978679d8ec')
Example #16
0
    def test_17(self):
        """
        YV12 -> YVYU -> flip left-right
        """
        a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='YVYU', filename_out=OUT)
        a.convert()

        a = YCbCr(width=352, height=288, filename=OUT,
                  yuv_format_in='YVYU',
                  filename_out=OUT1)
        a.fliplr()

        ret = get_sha1(OUT1, SIZE_422)

        self.assertEqual(ret, 'a5bdbfdeb0259f6d0bd85ddd97d58f6fc7965ca9')
Example #17
0
    def test_20(self):
        """
        YV12 -> YVYU -> crop
        """
        a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='YVYU', filename_out=OUT)
        a.convert()

        a = YCbCr(width=352, height=288, filename=OUT,
                  yuv_format_in='YVYU',
                  crop_rect=(0, 0, 15, 15),
                  filename_out=OUT1)
        a.crop()

        ret = get_sha1(OUT1, 512)

        self.assertEqual(ret, '4bf3179e43e7ca6d490bf1d996dff84ef64be664')
Example #18
0
    def test_17(self):
        """
        YV12 -> YVYU -> flip left-right
        """
        a = YCbCr(width=352,
                  height=288,
                  filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='YVYU',
                  filename_out=OUT)
        a.convert()

        a = YCbCr(width=352,
                  height=288,
                  filename=OUT,
                  yuv_format_in='YVYU',
                  filename_out=OUT1)
        a.fliplr()

        ret = get_sha1(OUT1, SIZE_422)

        self.assertEqual(ret, 'a5bdbfdeb0259f6d0bd85ddd97d58f6fc7965ca9')
Example #19
0
    def test_20(self):
        """
        YV12 -> YVYU -> crop
        """
        a = YCbCr(width=352,
                  height=288,
                  filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='YVYU',
                  filename_out=OUT)
        a.convert()

        a = YCbCr(width=352,
                  height=288,
                  filename=OUT,
                  yuv_format_in='YVYU',
                  crop_rect=(0, 0, 15, 15),
                  filename_out=OUT1)
        a.crop()

        ret = get_sha1(OUT1, 512)

        self.assertEqual(ret, '4bf3179e43e7ca6d490bf1d996dff84ef64be664')
Example #20
0
    def test_4(self):
        """
        YV12 -> UVYU -> YV12
        """
        a = YCbCr(width=352,
                  height=288,
                  filename='foreman_cif_frame_0.yuv',
                  yuv_format_in='YV12',
                  yuv_format_out='UYVY',
                  filename_out=OUT)
        a.convert()

        b = YCbCr(width=352,
                  height=288,
                  filename=OUT,
                  yuv_format_in='UYVY',
                  yuv_format_out='YV12',
                  filename_out=OUT1)
        b.convert()

        ret = get_sha1(OUT1, SIZE_422)

        self.assertEqual(ret, 'b8934d77e0d71e77e90b4ba777a0cb978679d8ec')