ureg_MOV(shader, ureg_writemask(o_vpos, TGSI_WRITEMASK_XY), ureg_src(t_vpos));
ureg_MOV(shader, ureg_writemask(o_vpos, TGSI_WRITEMASK_ZW), vpos);
- ureg_MUL(shader, ureg_writemask(t_vpos, TGSI_WRITEMASK_Z),
- ureg_scalar(flags, TGSI_SWIZZLE_W),
- ureg_imm1f(shader, 0.5f));
-
for (i = 0; i < 2; ++i)
for (j = 0; j < 2; ++j) {
ureg_MAD(shader, ureg_writemask(o_vmv[i][j], TGSI_WRITEMASK_XY), mv_scale, vmv[i][j], ureg_src(t_vpos));
- ureg_MOV(shader, ureg_writemask(o_vmv[i][j], TGSI_WRITEMASK_Z), ureg_src(t_vpos));
+ ureg_MOV(shader, ureg_writemask(o_vmv[i][j], TGSI_WRITEMASK_Z), ureg_scalar(flags, TGSI_SWIZZLE_Z + i));
}
ureg_MOV(shader, ureg_writemask(o_vtex[0], TGSI_WRITEMASK_XY), ureg_src(t_vpos));
ureg_MUL(shader, ureg_writemask(o_line, TGSI_WRITEMASK_Y),
vrect, ureg_imm1f(shader, MACROBLOCK_HEIGHT / 2));
ureg_MOV(shader, ureg_writemask(o_line, TGSI_WRITEMASK_Z),
- ureg_scalar(flags, TGSI_SWIZZLE_Z));
+ ureg_scalar(flags, TGSI_SWIZZLE_Y));
ureg_IF(shader, ureg_scalar(flags, TGSI_SWIZZLE_X), &label);
ureg_TEX(shader, ref[0], TGSI_TEXTURE_2D, ureg_src(ref[0]), sampler[0]);
ureg_TEX(shader, ref[1], TGSI_TEXTURE_2D, ureg_src(ref[1]), sampler[1]);
- ureg_LRP(shader, result,
+ ureg_LRP(shader, ref[0],
ureg_scalar(tc[0][0], TGSI_SWIZZLE_Z),
- ureg_src(ref[1]), ureg_src(ref[0]));
+ ureg_src(ref[0]), ureg_imm1f(shader, 0.0f));
+
+ ureg_LRP(shader, ref[1],
+ ureg_scalar(tc[1][0], TGSI_SWIZZLE_Z),
+ ureg_src(ref[1]), ureg_imm1f(shader, 0.0f));
+
+ ureg_ADD(shader, result, ureg_src(ref[0]), ureg_src(ref[1]));
ureg_fixup_label(shader, intra_label, ureg_get_instruction_number(shader));
ureg_ENDIF(shader);
struct vl_vertex_stream
{
struct vertex2s pos;
- int8_t eb[3][2][2];
- int8_t dct_type_field;
- int8_t mo_type_frame;
- int8_t mb_type_intra;
- int8_t mv_wheights;
+ uint8_t eb[3][2][2];
+ uint8_t dct_type_field;
+ uint8_t mb_type_intra;
+ uint8_t mv_wheights[2];
struct vertex2s mv[4];
};
/* empty block element of selected component */
vertex_elems[VS_I_EB].src_offset = 4 + component * 4;
- vertex_elems[VS_I_EB].src_format = PIPE_FORMAT_R8G8B8A8_SSCALED;
+ vertex_elems[VS_I_EB].src_format = PIPE_FORMAT_R8G8B8A8_USCALED;
/* flags */
vertex_elems[VS_I_FLAGS].src_offset = 16;
- vertex_elems[VS_I_FLAGS].src_format = PIPE_FORMAT_R8G8B8A8_SSCALED;
+ vertex_elems[VS_I_FLAGS].src_format = PIPE_FORMAT_R8G8B8A8_UNORM;
/* motion vector 0 TOP element */
vertex_elems[VS_I_MV0_TOP].src_format = PIPE_FORMAT_R16G16_SSCALED;
stream->eb[i][j][k] = !(mb->cbp & (*empty_block_mask)[i][j][k]);
stream->dct_type_field = mb->dct_type == PIPE_MPEG12_DCT_TYPE_FIELD;
- stream->mo_type_frame = mb->mo_type == PIPE_MPEG12_MOTION_TYPE_FRAME;
+ //stream->mo_type_frame = mb->mo_type == PIPE_MPEG12_MOTION_TYPE_FRAME;
stream->mb_type_intra = mb->mb_type != PIPE_MPEG12_MACROBLOCK_TYPE_INTRA;
switch (mb->mb_type) {
case PIPE_MPEG12_MACROBLOCK_TYPE_FWD:
- stream->mv_wheights = 0;
+ stream->mv_wheights[0] = 255;
+ stream->mv_wheights[1] = 0;
break;
case PIPE_MPEG12_MACROBLOCK_TYPE_BI:
- stream->mv_wheights = 1;
+ stream->mv_wheights[0] = 127;
+ stream->mv_wheights[1] = 127;
break;
case PIPE_MPEG12_MACROBLOCK_TYPE_BKWD:
- stream->mv_wheights = 2;
+ stream->mv_wheights[0] = 0;
+ stream->mv_wheights[1] = 255;
break;
default:
- stream->mv_wheights = 0;
+ stream->mv_wheights[0] = 0;
+ stream->mv_wheights[1] = 0;
}
get_motion_vectors(mb, stream->mv);