Skip to content

Commit 3880d91

Browse files
committed
gpujpeg_dct_cpu: allocate CPU quant data buf
Since the commit 41fb824 (2025-01-25), the buffer is no longer allocated automatically but is used by this piece of code. CPU iDCT is never used, however (but could be used instead of GPU implemetation as indicated by added commented-out code).
1 parent de0f3a8 commit 3880d91

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/gpujpeg_dct_cpu.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ gpujpeg_idct_cpu(struct gpujpeg_decoder* decoder)
206206

207207
// Get coder
208208
struct gpujpeg_coder* coder = &decoder->coder;
209+
if ( coder->data_quantized == NULL ) {
210+
if ( gpujpeg_coder_allocate_cpu_huffman_buf(coder) != 0 ) {
211+
abort();
212+
}
213+
}
209214

210215
// Perform IDCT and dequantization
211216
for ( int comp = 0; comp < coder->param.comp_count; comp++ ) {

src/gpujpeg_decoder.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ gpujpeg_decoder_decode(struct gpujpeg_decoder* decoder, uint8_t* image, size_t i
325325
if (0 != gpujpeg_idct_gpu(decoder)) {
326326
return -1;
327327
}
328+
// gpujpeg_idct_cpu(decoder);
328329

329330
GPUJPEG_CUSTOM_TIMER_STOP(coder->duration_dct_quantization, coder->param.perf_stats, decoder->stream, return -1);
330331

0 commit comments

Comments
 (0)