diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-12-23 09:51:42 +0100 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-29 12:30:23 +0200 |
commit | 300c40e660175de950da43b6542bea59418ee3a9 (patch) | |
tree | 390dbe9a1f100e5b26bdec0b0615016ab5173723 | |
parent | 2a57bdaa7e6bd9caa6d3f30da089803ca7026d91 (diff) | |
download | gstreamer-plugins-bad-300c40e660175de950da43b6542bea59418ee3a9.tar.gz |
openjpegdec: Only use 10 bit YUV formats for exactly 10 bit images, not <= 16 bit
And use the generic converter to AYUV64 for everything else.
-rw-r--r-- | ext/openjpeg/gstopenjpegdec.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/ext/openjpeg/gstopenjpegdec.c b/ext/openjpeg/gstopenjpegdec.c index da2efdd18..ca178e2cf 100644 --- a/ext/openjpeg/gstopenjpegdec.c +++ b/ext/openjpeg/gstopenjpegdec.c @@ -802,27 +802,33 @@ gst_openjpeg_dec_negotiate (GstOpenJPEGDec * self, opj_image_t * image) format = GST_VIDEO_FORMAT_AYUV; } } else if (get_highest_prec (image) <= 16) { - if (image->comps[1].dx == 1 && image->comps[1].dy == 1) { - self->fill_frame = fill_frame_planar16_3; + if (image->comps[0].prec == 10 && + image->comps[1].prec == 10 && image->comps[2].prec == 10) { + if (image->comps[1].dx == 1 && image->comps[1].dy == 1) { + self->fill_frame = fill_frame_planar16_3; #if G_BYTE_ORDER == G_LITTLE_ENDIAN - format = GST_VIDEO_FORMAT_Y444_10LE; + format = GST_VIDEO_FORMAT_Y444_10LE; #else - format = GST_VIDEO_FORMAT_Y444_10BE; + format = GST_VIDEO_FORMAT_Y444_10BE; #endif - } else if (image->comps[1].dx == 2 && image->comps[1].dy == 1) { - self->fill_frame = fill_frame_planar16_3; + } else if (image->comps[1].dx == 2 && image->comps[1].dy == 1) { + self->fill_frame = fill_frame_planar16_3; #if G_BYTE_ORDER == G_LITTLE_ENDIAN - format = GST_VIDEO_FORMAT_I422_10LE; + format = GST_VIDEO_FORMAT_I422_10LE; #else - format = GST_VIDEO_FORMAT_I422_10BE; + format = GST_VIDEO_FORMAT_I422_10BE; #endif - } else if (image->comps[1].dx == 2 && image->comps[1].dy == 2) { - self->fill_frame = fill_frame_planar16_3; + } else if (image->comps[1].dx == 2 && image->comps[1].dy == 2) { + self->fill_frame = fill_frame_planar16_3; #if G_BYTE_ORDER == G_LITTLE_ENDIAN - format = GST_VIDEO_FORMAT_I420_10LE; + format = GST_VIDEO_FORMAT_I420_10LE; #else - format = GST_VIDEO_FORMAT_I420_10BE; + format = GST_VIDEO_FORMAT_I420_10BE; #endif + } else { + self->fill_frame = fill_frame_planar16_3_generic; + format = GST_VIDEO_FORMAT_AYUV64; + } } else { self->fill_frame = fill_frame_planar16_3_generic; format = GST_VIDEO_FORMAT_AYUV64; |