[g3dvl] buffers must be aligned to macroblock size
authorChristian König <deathsimple@vodafone.de>
Tue, 22 Mar 2011 20:52:06 +0000 (21:52 +0100)
committerChristian König <deathsimple@vodafone.de>
Tue, 22 Mar 2011 20:52:06 +0000 (21:52 +0100)
src/gallium/auxiliary/vl/vl_mpeg12_context.c

index 404a6c0c11d0f0c82b40ebfd14ba41f1b611ae21..73e2a950bd4ecc04688aebe31b65b1f494c5c6a4 100644 (file)
@@ -740,8 +740,8 @@ vl_create_mpeg12_context(struct pipe_context *pipe,
       return NULL;
    }
 
-   ctx->buffer_width = pot_buffers ? util_next_power_of_two(width) : width;
-   ctx->buffer_height = pot_buffers ? util_next_power_of_two(height) : height;
+   ctx->buffer_width = pot_buffers ? util_next_power_of_two(width) : align(width, MACROBLOCK_WIDTH);
+   ctx->buffer_height = pot_buffers ? util_next_power_of_two(height) : align(height, MACROBLOCK_HEIGHT);
 
    if (!init_idct(ctx, ctx->buffer_width, ctx->buffer_height)) {
       ctx->pipe->destroy(ctx->pipe);