summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl/vl_idct.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-03-16 23:09:52 +0100
committerChristian König <[email protected]>2011-03-16 23:09:52 +0100
commite87bd8c9578dee384ff03039aa792e1a8dae7f36 (patch)
treedef2d5749cb87fb4ba1f67614dad6a59c90ee9e5 /src/gallium/auxiliary/vl/vl_idct.c
parent0f07da0a1c87e1c7b53700c33d6b1f8f03c1fe11 (diff)
[g3dvl] cleanup and documentation
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_idct.c')
-rw-r--r--src/gallium/auxiliary/vl/vl_idct.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/vl/vl_idct.c b/src/gallium/auxiliary/vl/vl_idct.c
index e0307376a38..6b0010a04bb 100644
--- a/src/gallium/auxiliary/vl/vl_idct.c
+++ b/src/gallium/auxiliary/vl/vl_idct.c
@@ -27,6 +27,7 @@
#include "vl_idct.h"
#include "vl_vertex_buffers.h"
+#include "vl_defines.h"
#include "util/u_draw.h"
#include <assert.h>
#include <pipe/p_context.h>
@@ -37,9 +38,6 @@
#include <tgsi/tgsi_ureg.h>
#include "vl_types.h"
-#define BLOCK_WIDTH 8
-#define BLOCK_HEIGHT 8
-
#define SCALE_FACTOR_16_TO_9 (32768.0f / 256.0f)
#define NR_RENDER_TARGETS 4
@@ -504,6 +502,8 @@ cleanup_textures(struct vl_idct *idct, struct vl_idct_buffer *buffer)
struct pipe_resource *
vl_idct_upload_matrix(struct pipe_context *pipe)
{
+ const float scale = sqrtf(SCALE_FACTOR_16_TO_9);
+
struct pipe_resource template, *matrix;
struct pipe_transfer *buf_transfer;
unsigned i, j, pitch;
@@ -544,7 +544,7 @@ vl_idct_upload_matrix(struct pipe_context *pipe)
for(i = 0; i < BLOCK_HEIGHT; ++i)
for(j = 0; j < BLOCK_WIDTH; ++j)
// transpose and scale
- f[i * pitch + j] = const_matrix[j][i] * sqrtf(SCALE_FACTOR_16_TO_9);
+ f[i * pitch + j] = const_matrix[j][i] * scale;
pipe->transfer_unmap(pipe, buf_transfer);
pipe->transfer_destroy(pipe, buf_transfer);