This commit is contained in:
Rene Zeldenthuis
2024-04-02 01:16:17 +02:00
parent b8abcdcdee
commit 4b50b52ae0
7 changed files with 64 additions and 26 deletions

View File

@@ -1,7 +1,11 @@
#pragma once
#include <stddef.h>
#include <stdint.h>
// http://www.ietf.org/rfc/rfc2345.txt Each table is an array of 64 values given in zig-zag order, identical to the format used in a JFIF DQT marker segment.
constexpr size_t jpeg_quantization_table_length = 64;
typedef struct __attribute__((packed))
{
enum jpg_section_flag : uint8_t
@@ -99,5 +103,5 @@ typedef struct __attribute__((packed)) // 0xffe0
typedef struct __attribute__((packed)) // 0xffdb
{
uint8_t id; // 0= quantLuminance, 1= quantChrominance
uint8_t data[64];
uint8_t data[jpeg_quantization_table_length];
} jpg_section_dqt_t;