Mesa (pipe-video): [g3dvl] move alignment of buffers to mb size into context

Christian König deathsimple at kemper.freedesktop.org
Sun May 15 17:24:33 UTC 2011


Module: Mesa
Branch: pipe-video
Commit: 56457ffe11fd2b325f2bef3d99ca7e57b44e5c6a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=56457ffe11fd2b325f2bef3d99ca7e57b44e5c6a

Author: Christian König <deathsimple at vodafone.de>
Date:   Sun May 15 13:08:38 2011 +0200

[g3dvl] move alignment of buffers to mb size into context

---

 src/gallium/auxiliary/vl/vl_context.c        |    8 ++++----
 src/gallium/auxiliary/vl/vl_mpeg12_decoder.c |    3 ---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_context.c b/src/gallium/auxiliary/vl/vl_context.c
index be28bb5..e4805ea 100644
--- a/src/gallium/auxiliary/vl/vl_context.c
+++ b/src/gallium/auxiliary/vl/vl_context.c
@@ -195,8 +195,8 @@ vl_context_create_decoder(struct pipe_video_context *context,
    assert(context);
    assert(width > 0 && height > 0);
 
-   buffer_width = ctx->pot_buffers ? util_next_power_of_two(width) : width;
-   buffer_height = ctx->pot_buffers ? util_next_power_of_two(height) : height;
+   buffer_width = ctx->pot_buffers ? util_next_power_of_two(width) : align(width, MACROBLOCK_WIDTH);
+   buffer_height = ctx->pot_buffers ? util_next_power_of_two(height) : align(height, MACROBLOCK_HEIGHT);
 
    switch (u_reduce_video_profile(profile)) {
       case PIPE_VIDEO_CODEC_MPEG12:
@@ -237,8 +237,8 @@ vl_context_create_buffer(struct pipe_video_context *context,
       return NULL;
    }
 
-   buffer_width = ctx->pot_buffers ? util_next_power_of_two(width) : width;
-   buffer_height = ctx->pot_buffers ? util_next_power_of_two(height) : height;
+   buffer_width = ctx->pot_buffers ? util_next_power_of_two(width) : align(width, MACROBLOCK_WIDTH);
+   buffer_height = ctx->pot_buffers ? util_next_power_of_two(height) : align(height, MACROBLOCK_HEIGHT);
 
    result = vl_video_buffer_init(context, ctx->pipe,
                                  buffer_width, buffer_height, 1,
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index b7d9b47..f3e1986 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -877,9 +877,6 @@ vl_create_mpeg12_decoder(struct pipe_video_context *context,
    dec->base.create_buffer = vl_mpeg12_create_buffer;
    dec->base.flush_buffer = vl_mpeg12_decoder_flush_buffer;
 
-   dec->base.width = align(width, MACROBLOCK_WIDTH);
-   dec->base.height = align(height, MACROBLOCK_HEIGHT);
-
    dec->pipe = pipe;
 
    dec->quads = vl_vb_upload_quads(dec->pipe);




More information about the mesa-commit mailing list