context->states.mc.viewport.translate[2] = 0;
context->states.mc.viewport.translate[3] = 0;
- context->states.mc.render_target.width = context->video_width;
- context->states.mc.render_target.height = context->video_height;
+ context->states.mc.render_target.width = vlRoundUpPOT(context->video_width);
+ context->states.mc.render_target.height = vlRoundUpPOT(context->video_height);
context->states.mc.render_target.num_cbufs = 1;
/* FB for MC stage is a VL_SURFACE, set in vlSetRenderSurface() */
context->states.mc.render_target.zsbuf = NULL;
#include "vl_defs.h"
#include "vl_util.h"
+/*#define DO_IDCT*/
+
+#ifdef DO_IDCT
static int vlTransformBlock(short *src, short *dst, short bias)
{
static const float basis[8][8] =
}
return 0;
}
+#endif
static int vlGrabFrameCodedBlock(short *src, short *dst, unsigned int dst_pitch)
{
unsigned int tex_pitch;
unsigned int tb, sb = 0;
- short temp_block[64];
-
assert(context);
assert(blocks);
{
if ((coded_block_pattern >> (5 - tb)) & 1)
{
- if (sample_type == VL_FULL_SAMPLE)
- vlTransformBlock(blocks + sb * VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT, temp_block, 128);
- else
- vlTransformBlock(blocks + sb * VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT, temp_block, 0);
+ short *cur_block = blocks + sb * VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT;
+
+#ifdef DO_IDCT
+ vlTransformBlock(cur_block, cur_block, sample_type == VL_FULL_SAMPLE ? 128 : 0);
+#endif
if (dct_type == VL_DCT_FRAME_CODED)
vlGrabFrameCodedBlock
(
- temp_block,
+ cur_block,
texels + tb * tex_pitch * VL_BLOCK_HEIGHT,
tex_pitch
);
else
vlGrabFieldCodedBlock
(
- blocks + sb * VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT,
+ cur_block,
texels + (tb % 2) * tex_pitch * VL_BLOCK_HEIGHT + (tb / 2) * tex_pitch,
tex_pitch
);
if ((coded_block_pattern >> (1 - tb)) & 1)
{
- if (sample_type == VL_FULL_SAMPLE)
- vlTransformBlock(blocks + sb * VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT, temp_block, 128);
- else
- vlTransformBlock(blocks + sb * VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT, temp_block, 0);
+ short *cur_block = blocks + sb * VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT;
+
+#ifdef DO_IDCT
+ vlTransformBlock(cur_block, cur_block, sample_type == VL_FULL_SAMPLE ? 128 : 0);
+#endif
vlGrabFrameCodedBlock
(
- temp_block,
+ cur_block,
texels,
tex_pitch
);