summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-03-17 20:13:51 +0100
committerChristian König <[email protected]>2011-03-19 00:06:46 +0100
commit1d72cf6986168a49fbadfa31e9d719ed0222836f (patch)
tree4098d9a8894b9e5d0df1654a217086bd9e4176e4 /src
parenta1fecd09c2c5fdba3da5c38fce567b5bd2e6053d (diff)
move empty block mask into mpeg12 context
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_context.c16
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_context.h1
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c10
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h1
4 files changed, 14 insertions, 14 deletions
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_context.c b/src/gallium/auxiliary/vl/vl_mpeg12_context.c
index 947db1c22be..fb0418c5a47 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_context.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_context.c
@@ -40,6 +40,12 @@
#define NUM_BUFFERS 2
+static const unsigned const_empty_block_mask_420[3][2][2] = {
+ { { 0x20, 0x10 }, { 0x08, 0x04 } },
+ { { 0x02, 0x02 }, { 0x02, 0x02 } },
+ { { 0x01, 0x01 }, { 0x01, 0x01 } }
+};
+
static void
flush_buffer(struct vl_mpeg12_context *ctx)
{
@@ -161,7 +167,7 @@ upload_buffer(struct vl_mpeg12_context *ctx,
for (y = 0; y < 2; ++y) {
for (x = 0; x < 2; ++x, ++tb) {
- if (mb->cbp & (*ctx->mc_renderer.empty_block_mask)[0][y][x]) {
+ if (mb->cbp & (*ctx->empty_block_mask)[0][y][x]) {
vl_idct_add_block(&buffer->idct_y, mb->mbx * 2 + x, mb->mby * 2 + y, blocks);
blocks += BLOCK_WIDTH * BLOCK_HEIGHT;
}
@@ -172,7 +178,7 @@ upload_buffer(struct vl_mpeg12_context *ctx,
assert(ctx->base.chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
for (tb = 1; tb < 3; ++tb) {
- if (mb->cbp & (*ctx->mc_renderer.empty_block_mask)[tb][0][0]) {
+ if (mb->cbp & (*ctx->empty_block_mask)[tb][0][0]) {
if(tb == 1)
vl_idct_add_block(&buffer->idct_cb, mb->mbx, mb->mby, blocks);
else
@@ -289,7 +295,7 @@ vl_mpeg12_decode_macroblocks(struct pipe_video_context *vpipe,
for ( i = 0; i < num_macroblocks; ++i ) {
vl_vb_add_block(&ctx->cur_buffer->vertex_stream, &mpeg12_macroblocks[i],
- ctx->mc_renderer.empty_block_mask);
+ ctx->empty_block_mask);
upload_buffer(ctx, ctx->cur_buffer, &mpeg12_macroblocks[i]);
}
@@ -664,6 +670,10 @@ vl_create_mpeg12_context(struct pipe_context *pipe,
return NULL;
}
+ /* TODO: Implement 422, 444 */
+ assert(chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
+ ctx->empty_block_mask = &const_empty_block_mask_420;
+
if (!(idct_matrix = vl_idct_upload_matrix(ctx->pipe)))
return false;
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_context.h b/src/gallium/auxiliary/vl/vl_mpeg12_context.h
index 6ad734c9fda..6c964fbe92a 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_context.h
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_context.h
@@ -41,6 +41,7 @@ struct vl_mpeg12_context
struct pipe_video_context base;
struct pipe_context *pipe;
struct pipe_surface *decode_target;
+ const unsigned (*empty_block_mask)[3][2][2];
struct pipe_vertex_buffer quads;
unsigned vertex_buffer_size;
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
index df3373ebd88..0e5a21c18b6 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
@@ -56,12 +56,6 @@ enum VS_OUTPUT
VS_O_MV3
};
-static const unsigned const_empty_block_mask_420[3][2][2] = {
- { { 0x20, 0x10 }, { 0x08, 0x04 } },
- { { 0x02, 0x02 }, { 0x02, 0x02 } },
- { { 0x01, 0x01 }, { 0x01, 0x01 } }
-};
-
static void *
create_vert_shader(struct vl_mpeg12_mc_renderer *r)
{
@@ -537,10 +531,6 @@ vl_mpeg12_mc_renderer_init(struct vl_mpeg12_mc_renderer *renderer,
renderer->buffer_height = buffer_height;
renderer->chroma_format = chroma_format;
- /* TODO: Implement 422, 444 */
- assert(chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
- renderer->empty_block_mask = &const_empty_block_mask_420;
-
renderer->texview_map = util_new_keymap(sizeof(struct pipe_surface*), -1,
texview_map_delete);
if (!renderer->texview_map)
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h
index 805fec530b0..b761961b219 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h
@@ -43,7 +43,6 @@ struct vl_mpeg12_mc_renderer
unsigned buffer_width;
unsigned buffer_height;
enum pipe_video_chroma_format chroma_format;
- const unsigned (*empty_block_mask)[3][2][2];
struct pipe_viewport_state viewport;
struct pipe_framebuffer_state fb_state;