refactor(codecs): pool luminance rows and gate timing on optimised builds

EncodeRow8/16 reuse one pooled scratch row for RGB-to-gray output
instead of allocating per row; drop unused JPEG marker constants; the
24 MP timing test skips itself when the JIT optimiser is disabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 10:12:49 +00:00
1 parent 78dad093ab
commit f2c0709ef2
3 files changed
+28 -31

No files matched your search

+2 -2
View File
@@ -3,8 +3,8 @@ namespace Titano.Core.Codecs.Jpeg;
/// <summary>Constants shared by the JPEG encoder and decoders (ITU T.81 Annex K).</summary>
internal static class JpegTables
{
public const byte Soi = 0xD8, Eoi = 0xD9, Sos = 0xDA, Dqt = 0xDB, Dnl = 0xDC, Dri = 0xDD, Dht = 0xC4, Dac = 0xCC;
public const byte Sof0 = 0xC0, Sof1 = 0xC1, Sof2 = 0xC2, Sof3 = 0xC3, Rst0 = 0xD0, App0 = 0xE0, App1 = 0xE1, App14 = 0xEE, Com = 0xFE;
public const byte Soi = 0xD8, Eoi = 0xD9, Sos = 0xDA, Dqt = 0xDB, Dri = 0xDD, Dht = 0xC4, Dac = 0xCC;
public const byte Sof0 = 0xC0, Sof1 = 0xC1, Sof2 = 0xC2, Sof3 = 0xC3, Rst0 = 0xD0, App0 = 0xE0, App1 = 0xE1, App14 = 0xEE;
/// <summary>Natural (row-major) index of the coefficient at each zig-zag position.</summary>
public static ReadOnlySpan<byte> NaturalOrder =>