From 99259738f87321d194ad1fbfe0edc5df7d6389b9 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Thu, 19 Jan 2012 09:00:48 +0800 Subject: [PATCH] Map JPEG component id to Y, Cb, Cr Signed-off-by: Xiang, Haihao --- src/gen7_mfd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gen7_mfd.c b/src/gen7_mfd.c index 0e05f72..509eacc 100644 --- a/src/gen7_mfd.c +++ b/src/gen7_mfd.c @@ -2142,14 +2142,12 @@ gen7_mfd_jpeg_qm_state(VADriverContextP ctx, assert(pic_param->num_components <= 3); for (index = 0; index < pic_param->num_components; index++) { - int qm_type = va_to_gen7_jpeg_qm[pic_param->components[index].component_id]; + int qm_type = va_to_gen7_jpeg_qm[pic_param->components[index].component_id - pic_param->components[0].component_id + VA_JPEG_COMPONENT_ID_Y]; unsigned char *qm = iq_matrix->quantiser_matrix[pic_param->components[index].quantiser_table_selector]; int precision = iq_matrix->precision[pic_param->components[index].quantiser_table_selector]; unsigned char raster_qm[64]; int j; - assert(pic_param->components[index].component_id >= VA_JPEG_COMPONENT_ID_Y && - pic_param->components[index].component_id <= VA_JPEG_COMPONENT_ID_A); assert(precision == 0); for (j = 0; j < 64; j++) @@ -2176,7 +2174,7 @@ gen7_mfd_jpeg_bsd_object(VADriverContextP ctx, assert(slice_param->num_components <= pic_param->num_components); for (i = 0; i < slice_param->num_components; i++) { - switch (slice_param->components[i].component_id) { + switch (slice_param->components[i].component_id - pic_param->components[0].component_id + VA_JPEG_COMPONENT_ID_Y) { case VA_JPEG_COMPONENT_ID_Y: scan_component_mask |= (1 << 0); break; -- 2.7.4