Closed

YV12 to reduced grayscale convertion function and a bmp buffer compare function

Develop an optimised (SSE4, AVX intrinsics) C++ function that extracts the luminance channel out of a YUV12 encoded bitmap buffer. It must be possible to reduce the grayscale levels to 4,8,16,32 or 64 based on an input parameter. if grayscale levels are reduced, the new level should be calculated like this:

newlevel = ((oldlevel mod maxlevels) * maxlevels) + (maxlevels mod 2)

example = (121 mod 32) * 32 + (32 / 2) = 3 * 32 + 16 = 112

The function must be developed in a way that it can be invoked from a .net application and the resulting buffer can be used as buffer for a [url removed, login to view] Buffer.

PInvoke import sample:

[DllImport("[url removed, login to view]", CallingConvention = [url removed, login to view], EntryPoint = "ConvertYV12toGrayscale")]

internal static extern int ConvertYV12toGrayscale(int sourceWidth, int sourceHeight, int sourceStride, IntPtr sourcebuffer, int sourcesize, IntPtr targetbuffer, int targetsize, int dst_stride, int levels);

Buffer to Bitmap convertion sample:

var bmp = new Bitmap(720, 576, [url removed, login to view]);

var bmpdata = [url removed, login to view](new Rectangle(0, 0, 720, 576), [url removed, login to view], [url removed, login to view]);

var result = [url removed, login to view](720, 576, 720, (IntPtr) pbuffer, (int)bufsize, [url removed, login to view], [url removed, login to view] * [url removed, login to view], [url removed, login to view]); [url removed, login to view](bmpdata);

[url removed, login to view]();

A second function needs to be developed (also requires .net interface) that compares two bitmap buffers of same size on a per pixel base. The function must return the number of pixels that are not identical. Input parameters are width, height, stride, buffer1 ptr, buffer2 ptr, buf1 size, buf2 size)

Other:

The source code must be well documented. A MS Visual Studio 2010-2013 solution with sample c# app to open end convert the attached raw buffer & run a compare against another buffer must be included. (Buffer size of sample is 720*576)

Skills: .NET, C++ Programming, x86/x64 Assembler

See more: pixels studio, number function, mod programming, function number, dll in system programming, c programming extern, channel 4 programming, in-stride, convertion, convert this drawing to, c to c convertion, bmp, visual studio 2013 source code, code convert source code dll, convert dll net, dllimport, function sample, import visual studio 2010, convert visual studio visual studio 2010, convert net dll dll

About the Employer:
( 0 reviews ) Germany

Project ID: #7098335

6 freelancers are bidding on average €197 for this job

szymszteinsl

Ready to start work! Ready to start work! Ready to start work! Ready to start work! Ready to start work! Ready to start work! Ready to start work! Ready to start work! Ready to start work! Ready to start work! Ready to More

€200 EUR in 3 days
(44 Reviews)
6.2
murtaza1981

Hi, Please feel free to discuss the project with me............................................................................. Thanks, Murtaza

€250 EUR in 3 days
(8 Reviews)
4.2
drozhkov

I can help you, but suggest to use C++/CLI (not P/Invoke) paddingpaddingpaddingpaddingpaddingpadding

€244 EUR in 4 days
(2 Reviews)
3.4
richardjansson

I am currently studying to become a computer engineer at Lunds University in Sweden. I have much experience of C# and Java and have quite extensive knowledge of image manipulation. At my spare time I've been program More

€155 EUR in 3 days
(0 Reviews)
0.0
gunjanpatel322

I have 4.5 year of Experience in .Net and SQL Server, i had develop some web and desktop based Application. Recently i have completed image compression work in freelancer.

€130 EUR in 3 days
(0 Reviews)
0.0
itLofty

hello i can write this dll .

€200 EUR in 3 days
(0 Reviews)
0.0