for (i = 0; i < ref_frames; ++i) {
for (j = 0; j < 2; ++j) {
if(j < mv_per_frame) {
- vmv[count] = ureg_DECL_vs_input(shader, VS_I_MV0 + i * 2 + j);
+ vmv[count] = ureg_DECL_vs_input(shader, VS_I_MV0 + count);
o_vmv[count] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_MV0 + count);
count++;
}
- /* workaround for r600g */
- else if(ref_frames == 2)
- ureg_DECL_vs_input(shader, VS_I_MV0 + i * 2 + j);
}
}
if (handler->interlaced == NULL)
return false;
- for (i = 0; i < 4 /*TODO: ref_frames * mv_per_frame */; ++i) {
+ for (i = 0; i < ref_frames * mv_per_frame; ++i) {
handler->mv[i] = MALLOC(sizeof(struct vertex2f) * r->macroblocks_per_batch * 4);
if (handler->mv[i] == NULL)
return false;
handler->interlaced = MALLOC(sizeof(float) * r->macroblocks_per_batch * 4);
FREE(handler->interlaced);
- for (i = 0; i < 4 /*TODO: ref_frames * mv_per_frame */; ++i)
+ for (i = 0; i < ref_frames * mv_per_frame; ++i)
FREE(handler->mv[i]);
}
struct vl_mc_mbtype_handler *handler = &r->mbtype_handlers[i];
unsigned count = vl_vb_upload(&handler->pos, pos);
if (count > 0) {
+ unsigned ref_frames, mv_per_frame;
+
+ ref_frames = const_mbtype_config[i][0];
+ mv_per_frame = const_mbtype_config[i][1];
+
pos += count;
memcpy(interlaced, handler->interlaced, sizeof(float) * count * 4);
interlaced += count * 4;
- for (j = 0; j < 4 /* TODO */; ++j) {
+ for (j = 0; j < ref_frames * mv_per_frame; ++j)
memcpy(mv[j], handler->mv[j], sizeof(struct vertex2f) * count * 4);
+
+ for (j = 0; j < 4; ++j)
mv[j] += count * 4;
- }
}
num_macroblocks[i] = count;
}
{
if (mb->mo_type == PIPE_MPEG12_MOTION_TYPE_FRAME) {
- mv[2].x = mb->pmv[0][1][0];
- mv[2].y = mb->pmv[0][1][1];
+ mv[1].x = mb->pmv[0][1][0];
+ mv[1].y = mb->pmv[0][1][1];
} else {
mv[2].x = mb->pmv[0][1][0];
get_motion_vectors(mb, mv);
for ( i = 0; i < 4; ++i ) {
handler->interlaced[i + pos] = mb->dct_type == PIPE_MPEG12_DCT_TYPE_FIELD ? 1.0f : 0.0f;
- for ( j = 0; j < 4 /*TODO: ref_frames * mv_per_frame */; ++j )
+ for ( j = 0; j < ref_frames * mv_per_frame; ++j )
handler->mv[j][i + pos] = mv[j];
}
}