struct vert_stream_0
{
struct vertex2f pos;
- struct vertex2f luma_tc;
- struct vertex2f cb_tc;
- struct vertex2f cr_tc;
+ float luma_eb;
+ float cb_eb;
+ float cr_eb;
};
enum MACROBLOCK_TYPE
r->sampler_views.all[i] = r->pipe->create_sampler_view(r->pipe, r->textures.all[i], &sampler_view);
}
- r->vertex_bufs.individual.ycbcr.stride = sizeof(struct vertex2f) * 4;
+ r->vertex_bufs.individual.ycbcr.stride = sizeof(struct vert_stream_0);
r->vertex_bufs.individual.ycbcr.max_index = 24 * r->macroblocks_per_batch - 1;
r->vertex_bufs.individual.ycbcr.buffer_offset = 0;
/* XXX: Create with usage DYNAMIC or STREAM */
(
r->pipe->screen,
PIPE_BIND_VERTEX_BUFFER,
- sizeof(struct vertex2f) * 4 * 24 * r->macroblocks_per_batch
+ sizeof(struct vert_stream_0) * 24 * r->macroblocks_per_batch
);
for (i = 1; i < 3; ++i) {
vertex_elems[1].src_offset = sizeof(struct vertex2f);
vertex_elems[1].instance_divisor = 0;
vertex_elems[1].vertex_buffer_index = 0;
- vertex_elems[1].src_format = PIPE_FORMAT_R32G32_FLOAT;
+ vertex_elems[1].src_format = PIPE_FORMAT_R32_FLOAT;
/* Chroma Cr texcoord element */
- vertex_elems[2].src_offset = sizeof(struct vertex2f) * 2;
+ vertex_elems[2].src_offset = sizeof(struct vertex2f) + sizeof(float);
vertex_elems[2].instance_divisor = 0;
vertex_elems[2].vertex_buffer_index = 0;
- vertex_elems[2].src_format = PIPE_FORMAT_R32G32_FLOAT;
+ vertex_elems[2].src_format = PIPE_FORMAT_R32_FLOAT;
/* Chroma Cb texcoord element */
- vertex_elems[3].src_offset = sizeof(struct vertex2f) * 3;
+ vertex_elems[3].src_offset = sizeof(struct vertex2f) + sizeof(float) * 2;
vertex_elems[3].instance_divisor = 0;
vertex_elems[3].vertex_buffer_index = 0;
- vertex_elems[3].src_format = PIPE_FORMAT_R32G32_FLOAT;
+ vertex_elems[3].src_format = PIPE_FORMAT_R32_FLOAT;
/* First ref surface top field texcoord element */
vertex_elems[4].src_offset = 0;
return -1;
}
-static void
+void
gen_block_verts(struct vert_stream_0 *vb, struct pipe_mpeg12_macroblock *mb,
const struct vertex2f *offset,
unsigned luma_mask, unsigned cb_mask, unsigned cr_mask,
if (!use_zeroblocks || cbp & luma_mask || mb->dct_type == PIPE_MPEG12_DCT_TYPE_FIELD) {
v.x = 0.0f;
- v.y = 0.0f;
}
else {
v.x = -1.0f;
- v.y = 0.0f;
}
- vb[0].luma_tc.x = v.x;
- vb[0].luma_tc.y = v.y;
- vb[1].luma_tc.x = v.x;
- vb[1].luma_tc.y = v.y;// + half.y;
- vb[2].luma_tc.x = v.x;// + half.x;
- vb[2].luma_tc.y = v.y;
- vb[3].luma_tc.x = v.x;// + half.x;
- vb[3].luma_tc.y = v.y;
- vb[4].luma_tc.x = v.x;
- vb[4].luma_tc.y = v.y;// + half.y;
- vb[5].luma_tc.x = v.x;// + half.x;
- vb[5].luma_tc.y = v.y;// + half.y;
+ vb[0].luma_eb = v.x;
+ vb[1].luma_eb = v.x;
+ vb[2].luma_eb = v.x;
+ vb[3].luma_eb = v.x;
+ vb[4].luma_eb = v.x;
+ vb[5].luma_eb = v.x;
if (!use_zeroblocks || cbp & cb_mask) {
v.x = 0.0f;
- v.y = 0.0f;
}
else {
v.x = -1.0f;
- v.y = 0.0f;
}
- vb[0].cb_tc.x = v.x;
- vb[0].cb_tc.y = v.y;
- vb[1].cb_tc.x = v.x;
- vb[1].cb_tc.y = v.y;// + half.y;
- vb[2].cb_tc.x = v.x;// + half.x;
- vb[2].cb_tc.y = v.y;
- vb[3].cb_tc.x = v.x;// + half.x;
- vb[3].cb_tc.y = v.y;
- vb[4].cb_tc.x = v.x;
- vb[4].cb_tc.y = v.y;// + half.y;
- vb[5].cb_tc.x = v.x;// + half.x;
- vb[5].cb_tc.y = v.y;// + half.y;
+ vb[0].cb_eb = v.x;
+ vb[1].cb_eb = v.x;
+ vb[2].cb_eb = v.x;
+ vb[3].cb_eb = v.x;
+ vb[4].cb_eb = v.x;
+ vb[5].cb_eb = v.x;
if (!use_zeroblocks || cbp & cr_mask) {
v.x = 0.0f;
- v.y = 0.0f;
}
else {
v.x = -1.0f;
- v.y = 0.0f;
}
- vb[0].cr_tc.x = v.x;
- vb[0].cr_tc.y = v.y;
- vb[1].cr_tc.x = v.x;
- vb[1].cr_tc.y = v.y; // + half.y;
- vb[2].cr_tc.x = v.x; // + half.x;
- vb[2].cr_tc.y = v.y;
- vb[3].cr_tc.x = v.x; // + half.x;
- vb[3].cr_tc.y = v.y;
- vb[4].cr_tc.x = v.x;
- vb[4].cr_tc.y = v.y; // + half.y;
- vb[5].cr_tc.x = v.x; // + half.x;
- vb[5].cr_tc.y = v.y; // + half.y;
+ vb[0].cr_eb = v.x;
+ vb[1].cr_eb = v.x;
+ vb[2].cr_eb = v.x;
+ vb[3].cr_eb = v.x;
+ vb[4].cr_eb = v.x;
+ vb[5].cr_eb = v.x;
}
-static void
+void
gen_macroblock_verts(struct vl_mpeg12_mc_renderer *r,
struct pipe_mpeg12_macroblock *mb, unsigned pos,
struct vert_stream_0 *ycbcr_vb, struct vertex2f **ref_vb)
static void
fill_frame_zero_block(short *dst, unsigned dst_pitch)
{
- unsigned y;
-
- assert(dst);
+ //unsigned y;
+ //
+ //assert(dst);
- for (y = 0; y < BLOCK_HEIGHT; ++y)
- memset(dst + y * dst_pitch, 0, BLOCK_WIDTH * 2);
+ //for (y = 0; y < BLOCK_HEIGHT; ++y)
+ // memset(dst + y * dst_pitch, 0, BLOCK_WIDTH * 2);
}
static void