summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_mpeg12_decoder.c')
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_decoder.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index bd980891b7..dae063e501 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -678,6 +678,7 @@ vl_mpeg12_end_frame(struct pipe_video_decoder *decoder,
struct pipe_vertex_buffer vb[3];
struct vl_mpeg12_buffer *buf;
+ const unsigned *plane_order;
unsigned i, j, component;
unsigned nr_components;
@@ -731,24 +732,26 @@ vl_mpeg12_end_frame(struct pipe_video_decoder *decoder,
vl_idct_flush(i ? &dec->idct_c : &dec->idct_y, &buf->idct[i], buf->num_ycbcr_blocks[i]);
}
+ plane_order = vl_video_buffer_plane_order(target->buffer_format);
mc_source_sv = dec->mc_source->get_sampler_view_planes(dec->mc_source);
for (i = 0, component = 0; i < VL_MAX_PLANES; ++i) {
if (!target_surfaces[i]) continue;
nr_components = util_format_get_nr_components(target_surfaces[i]->texture->format);
for (j = 0; j < nr_components; ++j, ++component) {
- if (!buf->num_ycbcr_blocks[i]) continue;
+ unsigned plane = plane_order[component];
+ if (!buf->num_ycbcr_blocks[plane]) continue;
- vb[1] = vl_vb_get_ycbcr(&buf->vertex_stream, component);
+ vb[1] = vl_vb_get_ycbcr(&buf->vertex_stream, plane);
dec->base.context->set_vertex_buffers(dec->base.context, 2, vb);
if (dec->base.entrypoint <= PIPE_VIDEO_ENTRYPOINT_IDCT)
- vl_idct_prepare_stage2(i ? &dec->idct_c : &dec->idct_y, &buf->idct[component]);
+ vl_idct_prepare_stage2(i ? &dec->idct_c : &dec->idct_y, &buf->idct[plane]);
else {
- dec->base.context->set_fragment_sampler_views(dec->base.context, 1, &mc_source_sv[component]);
+ dec->base.context->set_fragment_sampler_views(dec->base.context, 1, &mc_source_sv[plane]);
dec->base.context->bind_fragment_sampler_states(dec->base.context, 1, &dec->sampler_ycbcr);
}
- vl_mc_render_ycbcr(i ? &dec->mc_c : &dec->mc_y, &buf->mc[i], j, buf->num_ycbcr_blocks[component]);
+ vl_mc_render_ycbcr(i ? &dec->mc_c : &dec->mc_y, &buf->mc[i], j, buf->num_ycbcr_blocks[plane]);
}
}
++dec->current_buffer;