#include "vl_vertex_buffers.h"
#include "vl_types.h"
-struct vl_ycbcr_vertex_stream
-{
- uint8_t x;
- uint8_t y;
- uint8_t intra;
- uint8_t field;
-};
-
/* vertices for a quad covering a block */
static const struct vertex2f block_quad[4] = {
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f}
size = width * height;
for (i = 0; i < VL_MAX_PLANES; ++i) {
- buffer->ycbcr[i].num_instances = 0;
buffer->ycbcr[i].resource = pipe_buffer_create
(
pipe->screen,
PIPE_BIND_VERTEX_BUFFER,
PIPE_USAGE_STREAM,
- sizeof(struct vl_ycbcr_vertex_stream) * size * 4
+ sizeof(struct pipe_ycbcr_block) * size * 4
);
}
assert(buffer);
- buf.stride = sizeof(struct vl_ycbcr_vertex_stream);
+ buf.stride = sizeof(struct pipe_ycbcr_block);
buf.buffer_offset = 0;
buf.buffer = buffer->ycbcr[component].resource;
}
-unsigned
-vl_vb_add_ycbcr(struct vl_vertex_buffer *buffer,
- unsigned component, unsigned x, unsigned y,
- bool intra, enum pipe_mpeg12_dct_type type)
+struct pipe_ycbcr_block *
+vl_vb_get_ycbcr_stream(struct vl_vertex_buffer *buffer, int component)
{
- struct vl_ycbcr_vertex_stream *stream;
-
assert(buffer);
- assert(buffer->ycbcr[component].num_instances < buffer->width * buffer->height * 4);
-
- stream = buffer->ycbcr[component].vertex_stream++;
- stream->x = x;
- stream->y = y;
- stream->intra = intra;
- stream->field = type == PIPE_MPEG12_DCT_TYPE_FIELD;
+ assert(component < VL_MAX_PLANES);
- return buffer->ycbcr[component].num_instances++;
+ return buffer->ycbcr[component].vertex_stream;
}
unsigned
}
}
-unsigned
-vl_vb_restart(struct vl_vertex_buffer *buffer, int component)
-{
- unsigned num_instances;
-
- assert(buffer);
-
- num_instances = buffer->ycbcr[component].num_instances;
- buffer->ycbcr[component].num_instances = 0;
- return num_instances;
-}
-
void
vl_vb_cleanup(struct vl_vertex_buffer *buffer)
{