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.
This commit is contained in:
Sebastian Dröge 2012-12-23 09:51:42 +01:00
parent 85690b802d
commit fe38fc2b5a

View file

@ -802,6 +802,8 @@ gst_openjpeg_dec_negotiate (GstOpenJPEGDec * self, opj_image_t * image)
format = GST_VIDEO_FORMAT_AYUV; format = GST_VIDEO_FORMAT_AYUV;
} }
} else if (get_highest_prec (image) <= 16) { } else if (get_highest_prec (image) <= 16) {
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) { if (image->comps[1].dx == 1 && image->comps[1].dy == 1) {
self->fill_frame = fill_frame_planar16_3; self->fill_frame = fill_frame_planar16_3;
#if G_BYTE_ORDER == G_LITTLE_ENDIAN #if G_BYTE_ORDER == G_LITTLE_ENDIAN
@ -827,6 +829,10 @@ gst_openjpeg_dec_negotiate (GstOpenJPEGDec * self, opj_image_t * image)
self->fill_frame = fill_frame_planar16_3_generic; self->fill_frame = fill_frame_planar16_3_generic;
format = GST_VIDEO_FORMAT_AYUV64; format = GST_VIDEO_FORMAT_AYUV64;
} }
} else {
self->fill_frame = fill_frame_planar16_3_generic;
format = GST_VIDEO_FORMAT_AYUV64;
}
} else { } else {
GST_ERROR_OBJECT (self, "Unsupported depth %d", GST_ERROR_OBJECT (self, "Unsupported depth %d",
get_highest_prec (image)); get_highest_prec (image));