Skip to content

Commit c2ca579

Browse files
committed
cleanup
1 parent d0f5485 commit c2ca579

File tree

4 files changed

+6
-3075
lines changed

4 files changed

+6
-3075
lines changed

Examples/CrossPlatformTest/CrossPlatformTest.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@
3939
<None Update="RawBgr.bin">
4040
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4141
</None>
42-
<None Update="RawBgr2.bin">
43-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
44-
</None>
4542
</ItemGroup>
4643

4744
</Project>

Examples/CrossPlatformTest/Program.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ static void Main(string[] args)
2020
config.EnableSSE = 1;
2121
config.EnableNeon = 1;
2222
config.EnableAvx2 = 1;
23-
config.NumThreads = 1;
23+
config.NumThreads = 4;
2424
Converter.SetConfig(config);
2525

2626
H264Encoder encoder = new H264Encoder();
2727
H264Decoder decoder = new H264Decoder();
2828

2929
decoder.Initialize();
3030

31-
var bytes = File.ReadAllBytes("RawBgr1.bin");
32-
var data = new ImageData(ImageType.Bgra, 1920, 1920, 3200 * 4, bytes);
31+
var bytes = File.ReadAllBytes("RawBgr.bin");
32+
var data = new ImageData(ImageType.Bgra, 1920, 1080, 1920 * 4, bytes);
3333
int w = data.Width;
3434
int h = data.Height;
3535

36-
encoder.Initialize(w, h, 200_000_000, 30, ConfigType.CameraCaptureAdvanced);
36+
encoder.Initialize(w, h, 200_000_000, 30, ConfigType.CameraBasic);
3737

3838
RgbImage rgbb = new RgbImage(w, h);
3939
Stopwatch sw = Stopwatch.StartNew();
@@ -62,14 +62,7 @@ static void Main(string[] args)
6262
//Console.WriteLine($"F:{encoded.FrameType} size: {encoded.Length}");
6363
// Bitmap result = RgbToBitmap(rgbb);
6464
// result.Save("Ok1.bmp");
65-
byte[] datt = new byte[w * h * 3];
66-
67-
unsafe
68-
{
69-
fixed (byte* dataPtr = datt)
70-
Buffer.MemoryCopy((byte*)rgbb.ImageBytes.ToPointer(), dataPtr, datt.Length, datt.Length);
71-
}
72-
File.WriteAllBytes("Output3.bin", datt);
65+
7366
}
7467

7568
}

Examples/CrossPlatformTest/RawBgr2.bin

Lines changed: 0 additions & 3059 deletions
This file was deleted.

Examples/H264SharpNativePInvoke/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static unsafe void Main(string[] args)
6868
//encoded.CopyTo(buffer,offset);
6969

7070

71-
if (decoder.Decode(encoded, noDelay: true, out DecodingState ds, out rgbb))
71+
if (decoder.Decode(encoded, noDelay: true, out DecodingState ds, ref rgbb))
7272
{
7373
//Console.WriteLine($"F:{encoded.FrameType} size: {encoded.Length}");
7474
//var result = rgbb.ToBitmap();

0 commit comments

Comments
 (0)