Video dec: for RGB(A) choose shift-changing dec

Avoid cross-decoding (eg. RGBA->RGB, RGB->RGBA) if device supports both
codecs. Ideally, avoiding this results in using merely memcpy (if shifts match).
This commit is contained in:
Martin Pulec
2015-07-31 10:50:24 +02:00
parent b1692527db
commit b8aa2edb3c

View File

@@ -992,13 +992,16 @@ static codec_t choose_codec_and_decoder(struct state_video_decoder *decoder, str
out_codec == DXT5)
&& decoder->video_mode != VIDEO_NORMAL)
continue; /* it is a exception, see NOTES #1 */
if(desc.color_spec == RGBA || /* another exception - we may change shifts */
desc.color_spec == RGB)
continue;
*decode_line = (decoder_t) memcpy;
decoder->decoder_type = LINE_DECODER;
if(desc.color_spec == RGBA || /* another exception - we may change shifts */
desc.color_spec == RGB) {
*decode_line = desc.color_spec == RGBA ?
vc_copylineRGBA : vc_copylineRGB;
}
goto after_linedecoder_lookup;
}
}