示例#1
0
        public void YV12ConfigResizeTest()
        {
            YV12_BUFFER_CONFIG srcConfig = new YV12_BUFFER_CONFIG();

            int result = yv12config.vp8_yv12_alloc_frame_buffer(ref srcConfig, 640, 480, 0);

            Assert.Equal(0, result);
            Assert.True(srcConfig.buffer_alloc != null);
            Assert.True(srcConfig.buffer_alloc_sz > 0);

            // The native memory buffer must be released before re-using a YV12 buffer with a different size.

            yv12config.vp8_yv12_de_alloc_frame_buffer(ref srcConfig);

            Assert.True(srcConfig.buffer_alloc == null);
            Assert.Equal(0UL, srcConfig.buffer_alloc_sz);

            // Re-uses the same buffer but with a different size frame.
            int reallocResult = yv12config.vp8_yv12_alloc_frame_buffer(ref srcConfig, 1280, 720, 0);

            Assert.Equal(0, reallocResult);
            Assert.True(srcConfig.buffer_alloc != null);
            Assert.True(srcConfig.buffer_alloc_sz > 0);

            yv12config.vp8_yv12_de_alloc_frame_buffer(ref srcConfig);
        }
示例#2
0
        /* note the extension is only for the last row, for intra prediction purpose */
        public static void vp8_extend_mb_row(YV12_BUFFER_CONFIG ybf, byte *YPtr,
                                             byte *UPtr, byte *VPtr)
        {
            int i;

            YPtr += ybf.y_stride * 14;
            UPtr += ybf.uv_stride * 6;
            VPtr += ybf.uv_stride * 6;

            for (i = 0; i < 4; ++i)
            {
                YPtr[i] = YPtr[-1];
                UPtr[i] = UPtr[-1];
                VPtr[i] = VPtr[-1];
            }

            YPtr += ybf.y_stride;
            UPtr += ybf.uv_stride;
            VPtr += ybf.uv_stride;

            for (i = 0; i < 4; ++i)
            {
                YPtr[i] = YPtr[-1];
                UPtr[i] = UPtr[-1];
                VPtr[i] = VPtr[-1];
            }
        }
示例#3
0
        public void YV12ConfigAllocateTest()
        {
            YV12_BUFFER_CONFIG srcConfig = new YV12_BUFFER_CONFIG();

            int result = yv12config.vp8_yv12_alloc_frame_buffer(ref srcConfig, 640, 480, 0);

            Assert.Equal(0, result);

            yv12config.vp8_yv12_de_alloc_frame_buffer(ref srcConfig);
        }
示例#4
0
        public void YV12ConfigCopyTest()
        {
            YV12_BUFFER_CONFIG srcConfig = new YV12_BUFFER_CONFIG();

            int result = yv12config.vp8_yv12_alloc_frame_buffer(ref srcConfig, 640, 480, 0);

            Assert.Equal(0, result);

            YV12_BUFFER_CONFIG dstConfig = srcConfig;

            Assert.Equal(srcConfig, dstConfig);

            //yv12config.vp8_yv12_de_alloc_frame_buffer(ref dstConfig);
        }