Skip to content

Commit 2f63587

Browse files
committed
gpujpeg_preprocessor_decode_no_transform: fix cond
When selecting dummy/memcpy decode, the incompatible input/output CS was considered only for ch_count=3, which is obviously insufficient. This would perhaps allow decoding from YUVA 4:4:4:4 to RGBA without color-space conversion. (The idea of checking the CS difference only for 3+ channels is that if the image contains 1 channel, we do not transcode it anyhow when in is eg. BT.601 and out BT.709, similarly for "RGB" grayscale).
1 parent c567947 commit 2f63587

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gpujpeg_postprocessor.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ gpujpeg_preprocessor_select_decode_kernel(struct gpujpeg_coder* coder)
383383

384384
static int gpujpeg_preprocessor_decode_no_transform(struct gpujpeg_coder * coder)
385385
{
386-
if ( coder->param.comp_count == 3 && coder->param_image.color_space != coder->param.color_space_internal ) {
386+
if ( coder->param.comp_count >= 3 && coder->param_image.color_space != coder->param.color_space_internal ) {
387387
/*fprintf(stderr, "Decoding JPEG to a planar pixel format is supported only when no color transformation is required. "
388388
"JPEG internal color space is set to \"%s\", image is \"%s\".\n",
389389
gpujpeg_color_space_get_name(coder->param.color_space_internal),

0 commit comments

Comments
 (0)