Skip to content

Commit

Permalink
writer: DHT header writer docu
Browse files Browse the repository at this point in the history
the piece of code is incomprehensible so document a bit
  • Loading branch information
MartinPulec committed Aug 12, 2024
1 parent 48aa64a commit 1ef3f81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gpujpeg_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ gpujpeg_writer_write_header(struct gpujpeg_encoder* encoder)

gpujpeg_writer_write_sof0(encoder);

unsigned dht_type_emitted = 0U;
// emit GPUJPEG_COMPONENT_CHROMINANCE only if needed (not used for RGB or grayscale)
unsigned dht_type_emitted = 0U; ///< bitfield of already output component types (CHROMINANCE/LUMINANCE)
for ( int i = 0; i < encoder->coder.param.comp_count; ++i ) {
if ((dht_type_emitted & (1U << encoder->coder.component[i].type)) == 0) {
gpujpeg_writer_write_dht(encoder, encoder->coder.component[i].type, GPUJPEG_HUFFMAN_DC); // DC table
Expand Down

0 comments on commit 1ef3f81

Please sign in to comment.