vl: add VL_MAX_SURFACES define
authorChristian König <deathsimple@vodafone.de>
Wed, 25 Jan 2012 12:58:57 +0000 (13:58 +0100)
committerChristian König <deathsimple@vodafone.de>
Mon, 6 Feb 2012 09:35:59 +0000 (10:35 +0100)
Signed-off-by: Christian König <deathsimple@vodafone.de>
src/gallium/auxiliary/vl/vl_defines.h
src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
src/gallium/auxiliary/vl/vl_video_buffer.h

index ffbc653e4fcbd5623d45dc91a1ebe161a15bea0c..6f20706c647d07cf58a01386498c06bcf6aa4228 100644 (file)
@@ -36,6 +36,7 @@
 #define VL_BLOCK_HEIGHT 8
 
 #define VL_NUM_COMPONENTS 3
+#define VL_MAX_SURFACES (VL_NUM_COMPONENTS * 2)
 #define VL_MAX_REF_FRAMES 2
 
 #endif
index 78dfd698670b793e9dca2467f7f577ffa089c8cb..31d96fd316c8d92d8379a3e01bcc754ae5a581b0 100644 (file)
@@ -683,6 +683,7 @@ vl_mpeg12_end_frame(struct pipe_video_decoder *decoder,
    unsigned nr_components;
 
    assert(dec && target && picture);
+   assert(!target->interlaced);
 
    buf = vl_mpeg12_get_decode_buffer(dec, target);
 
@@ -734,7 +735,7 @@ vl_mpeg12_end_frame(struct pipe_video_decoder *decoder,
 
    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_NUM_COMPONENTS; ++i) {
+   for (i = 0, component = 0; component < VL_NUM_COMPONENTS; ++i) {
       if (!target_surfaces[i]) continue;
 
       nr_components = util_format_get_nr_components(target_surfaces[i]->texture->format);
index 16c2e31ce55235258f4f2d2fbca29c168bde9d8d..6e2f8b8291afcbfd79ff52aa7851912ada574329 100644 (file)
@@ -45,7 +45,7 @@ struct vl_video_buffer
    struct pipe_resource     *resources[VL_NUM_COMPONENTS];
    struct pipe_sampler_view *sampler_view_planes[VL_NUM_COMPONENTS];
    struct pipe_sampler_view *sampler_view_components[VL_NUM_COMPONENTS];
-   struct pipe_surface      *surfaces[VL_NUM_COMPONENTS * 2];
+   struct pipe_surface      *surfaces[VL_MAX_SURFACES];
 };
 
 /**