diff --git a/src/output.zig b/src/output.zig index 3bd687b..3d1e3ef 100644 --- a/src/output.zig +++ b/src/output.zig @@ -57,12 +57,18 @@ const Scan = struct { } }; -fn parse_block(block: *util.BlockQuantized, dc_diff: *i16, dc_rle: *RLE_Seq, dc_freqs: []u32, ac_freqs: []u32) !void { +inline fn get_size(v: i16) u8 { + _ = v; +} + +fn parse_block(block: *util.BlockQuantized, dc_diff: *i16, rle: *RLE_Seq, dc_freqs: []u32, ac_freqs: []u32) !void { _ = ac_freqs; _ = dc_freqs; - _ = dc_rle; - _ = dc_diff; - _ = block; + const diff = block[0] - dc_diff.*; + try rle.append(RLE_Unit{ + .symbol = get_size(diff), + .value = diff, + }); } pub fn generate_jpg(buff: util.Buffers, alloc: std.mem.Allocator) !void {