Skip to content

Commit 668d981

Browse files
committed
gpujpeg_reader: use gpujpeg_table_quantization_print
use already defined function and drop its duplicate quant_table_dump() + fixed wrong interpretation of Pq=1 (would have print 10-bit instead of correct 16-bit)
1 parent 9fcac42 commit 668d981

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/gpujpeg_reader.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -616,19 +616,6 @@ gpujpeg_reader_read_com(uint8_t** image, const uint8_t* image_end, bool ff_cs_it
616616
return 0;
617617
}
618618

619-
static void
620-
quant_table_dump(int Pq, int Tq, const struct gpujpeg_table_quantization* table)
621-
{
622-
printf("quantization table 0x%02x (%d-bit, dst: %d):", Pq << 4 | Tq, Pq == 0 ? 8 : 10, Tq);
623-
for ( int i = 0; i < 64; ++i ) {
624-
if ( i % 8 == 0 ) {
625-
printf("\n");
626-
}
627-
printf("%hu\t", table->table[i]);
628-
}
629-
printf("\n\n");
630-
}
631-
632619
/**
633620
* Read quantization table definition block from image
634621
*
@@ -681,7 +668,8 @@ gpujpeg_reader_read_dqt(struct gpujpeg_decoder* decoder, uint8_t** image, const
681668
gpujpeg_table_quantization_decoder_compute(table);
682669

683670
if (decoder->coder.param.verbose >= GPUJPEG_LL_DEBUG2) {
684-
quant_table_dump(Pq, Tq, table);
671+
printf("Quantization table 0x%02x (%d-bit, dst: %d):\n", index, (Pq + 1) * 8, Tq);
672+
gpujpeg_table_quantization_print(table);
685673
}
686674
}
687675
return 0;

0 commit comments

Comments
 (0)