mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
[g3dvl] remove empty block handling for now
Maybe this isn't going into the right direction, but it makes handling the code easier for now.
This commit is contained in:
parent
745906257a
commit
e406936b9e
8 changed files with 5 additions and 76 deletions
|
|
@ -42,8 +42,6 @@
|
|||
#define MACROBLOCK_HEIGHT 16
|
||||
#define BLOCK_WIDTH 8
|
||||
#define BLOCK_HEIGHT 8
|
||||
#define ZERO_BLOCK_NIL -1.0f
|
||||
#define ZERO_BLOCK_IS_NIL(zb) ((zb).x < 0.0f)
|
||||
#define SCALE_FACTOR_16_TO_9 (32767.0f / 255.0f)
|
||||
|
||||
struct vertex_shader_consts
|
||||
|
|
@ -512,8 +510,7 @@ init_pipe_state(struct vl_mpeg12_mc_renderer *r)
|
|||
/* Luma filter */
|
||||
filters[0] = PIPE_TEX_FILTER_NEAREST;
|
||||
/* Chroma filters */
|
||||
if (r->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_444 ||
|
||||
r->eb_handling == VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE) {
|
||||
if (r->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_444 || true) { //TODO
|
||||
filters[1] = PIPE_TEX_FILTER_NEAREST;
|
||||
filters[2] = PIPE_TEX_FILTER_NEAREST;
|
||||
}
|
||||
|
|
@ -1199,10 +1196,6 @@ flush(struct vl_mpeg12_mc_renderer *r)
|
|||
|
||||
r->pipe->flush(r->pipe, PIPE_FLUSH_RENDER_CACHE, r->fence);
|
||||
|
||||
if (r->eb_handling == VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE)
|
||||
for (i = 0; i < 3; ++i)
|
||||
r->zero_block[i].x = ZERO_BLOCK_NIL;
|
||||
|
||||
r->num_macroblocks = 0;
|
||||
}
|
||||
|
||||
|
|
@ -1230,17 +1223,6 @@ grab_field_coded_block(short *src, short *dst, unsigned dst_pitch)
|
|||
memcpy(dst + y * dst_pitch * 2, src + y * BLOCK_WIDTH, BLOCK_WIDTH * 2);
|
||||
}
|
||||
|
||||
static void
|
||||
fill_frame_zero_block(short *dst, unsigned dst_pitch)
|
||||
{
|
||||
//unsigned y;
|
||||
//
|
||||
//assert(dst);
|
||||
|
||||
//for (y = 0; y < BLOCK_HEIGHT; ++y)
|
||||
// memset(dst + y * dst_pitch, 0, BLOCK_WIDTH * 2);
|
||||
}
|
||||
|
||||
static void
|
||||
fill_field_zero_block(short *dst, unsigned dst_pitch)
|
||||
{
|
||||
|
|
@ -1284,23 +1266,8 @@ grab_blocks(struct vl_mpeg12_mc_renderer *r, unsigned mbx, unsigned mby,
|
|||
|
||||
++sb;
|
||||
}
|
||||
else if (r->eb_handling != VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_NONE) {
|
||||
if(dct_type == PIPE_MPEG12_DCT_TYPE_FRAME) {
|
||||
|
||||
if (r->eb_handling == VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ALL ||
|
||||
ZERO_BLOCK_IS_NIL(r->zero_block[0])) {
|
||||
|
||||
fill_frame_zero_block(texels + y * tex_pitch * BLOCK_WIDTH + x * BLOCK_WIDTH, tex_pitch);
|
||||
if (r->eb_handling == VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE) {
|
||||
r->zero_block[0].x = (mbx + x * 0.5f);
|
||||
r->zero_block[0].y = (mby + y * 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
fill_field_zero_block(texels + y * tex_pitch + x * BLOCK_WIDTH, tex_pitch);
|
||||
}
|
||||
else if(dct_type == PIPE_MPEG12_DCT_TYPE_FIELD) {
|
||||
fill_field_zero_block(texels + y * tex_pitch + x * BLOCK_WIDTH, tex_pitch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1319,16 +1286,6 @@ grab_blocks(struct vl_mpeg12_mc_renderer *r, unsigned mbx, unsigned mby,
|
|||
grab_frame_coded_block(blocks + sb * BLOCK_WIDTH * BLOCK_HEIGHT, texels, tex_pitch);
|
||||
++sb;
|
||||
}
|
||||
else if (r->eb_handling != VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_NONE) {
|
||||
if (r->eb_handling == VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ALL ||
|
||||
ZERO_BLOCK_IS_NIL(r->zero_block[tb + 1])) {
|
||||
fill_frame_zero_block(texels, tex_pitch);
|
||||
if (r->eb_handling == VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE) {
|
||||
r->zero_block[tb + 1].x = mbx;
|
||||
r->zero_block[tb + 1].y = mby;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1371,18 +1328,12 @@ vl_mpeg12_mc_renderer_init(struct vl_mpeg12_mc_renderer *renderer,
|
|||
unsigned picture_height,
|
||||
enum pipe_video_chroma_format chroma_format,
|
||||
enum VL_MPEG12_MC_RENDERER_BUFFER_MODE bufmode,
|
||||
enum VL_MPEG12_MC_RENDERER_EMPTY_BLOCK eb_handling,
|
||||
bool pot_buffers)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
assert(renderer);
|
||||
assert(pipe);
|
||||
/* TODO: Implement other policies */
|
||||
assert(bufmode == VL_MPEG12_MC_RENDERER_BUFFER_PICTURE);
|
||||
/* TODO: Implement this */
|
||||
/* XXX: XFER_ALL sampling issue at block edges when using bilinear filtering */
|
||||
assert(eb_handling != VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_NONE);
|
||||
/* TODO: Non-pot buffers untested, probably doesn't work without changes to texcoord generation, vert shader, etc */
|
||||
assert(pot_buffers);
|
||||
|
||||
|
|
@ -1393,7 +1344,6 @@ vl_mpeg12_mc_renderer_init(struct vl_mpeg12_mc_renderer *renderer,
|
|||
renderer->picture_height = picture_height;
|
||||
renderer->chroma_format = chroma_format;
|
||||
renderer->bufmode = bufmode;
|
||||
renderer->eb_handling = eb_handling;
|
||||
renderer->pot_buffers = pot_buffers;
|
||||
|
||||
renderer->texview_map = util_new_keymap(sizeof(struct pipe_surface*), -1,
|
||||
|
|
@ -1420,8 +1370,6 @@ vl_mpeg12_mc_renderer_init(struct vl_mpeg12_mc_renderer *renderer,
|
|||
renderer->surface = NULL;
|
||||
renderer->past = NULL;
|
||||
renderer->future = NULL;
|
||||
for (i = 0; i < 3; ++i)
|
||||
renderer->zero_block[i].x = ZERO_BLOCK_NIL;
|
||||
renderer->num_macroblocks = 0;
|
||||
|
||||
xfer_buffers_map(renderer);
|
||||
|
|
|
|||
|
|
@ -44,13 +44,6 @@ enum VL_MPEG12_MC_RENDERER_BUFFER_MODE
|
|||
VL_MPEG12_MC_RENDERER_BUFFER_PICTURE /* Larger batches, more memory */
|
||||
};
|
||||
|
||||
enum VL_MPEG12_MC_RENDERER_EMPTY_BLOCK
|
||||
{
|
||||
VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ALL, /* Waste of memory bandwidth */
|
||||
VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE, /* Can only do point-filtering when interpolating subsampled chroma channels */
|
||||
VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_NONE /* Needs conditional texel fetch! */
|
||||
};
|
||||
|
||||
struct vl_mpeg12_mc_renderer
|
||||
{
|
||||
struct pipe_context *pipe;
|
||||
|
|
@ -58,7 +51,6 @@ struct vl_mpeg12_mc_renderer
|
|||
unsigned picture_height;
|
||||
enum pipe_video_chroma_format chroma_format;
|
||||
enum VL_MPEG12_MC_RENDERER_BUFFER_MODE bufmode;
|
||||
enum VL_MPEG12_MC_RENDERER_EMPTY_BLOCK eb_handling;
|
||||
bool pot_buffers;
|
||||
unsigned macroblocks_per_batch;
|
||||
|
||||
|
|
@ -104,7 +96,6 @@ struct vl_mpeg12_mc_renderer
|
|||
struct pipe_mpeg12_macroblock *macroblock_buf;
|
||||
struct pipe_transfer *tex_transfer[3];
|
||||
short *texels[3];
|
||||
struct vertex2f zero_block[3];
|
||||
|
||||
struct keymap *texview_map;
|
||||
};
|
||||
|
|
@ -115,7 +106,6 @@ bool vl_mpeg12_mc_renderer_init(struct vl_mpeg12_mc_renderer *renderer,
|
|||
unsigned picture_height,
|
||||
enum pipe_video_chroma_format chroma_format,
|
||||
enum VL_MPEG12_MC_RENDERER_BUFFER_MODE bufmode,
|
||||
enum VL_MPEG12_MC_RENDERER_EMPTY_BLOCK eb_handling,
|
||||
bool pot_buffers);
|
||||
|
||||
void vl_mpeg12_mc_renderer_cleanup(struct vl_mpeg12_mc_renderer *renderer);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,5 @@ nv40_video_create(struct pipe_screen *screen, enum pipe_video_profile profile,
|
|||
|
||||
return sp_video_create_ex(pipe, profile, chroma_format, width, height,
|
||||
VL_MPEG12_MC_RENDERER_BUFFER_PICTURE,
|
||||
VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE,
|
||||
true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ nvfx_video_create(struct pipe_screen *screen, enum pipe_video_profile profile,
|
|||
|
||||
return sp_video_create_ex(pipe, profile, chroma_format, width, height,
|
||||
VL_MPEG12_MC_RENDERER_BUFFER_PICTURE,
|
||||
VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE,
|
||||
true,
|
||||
PIPE_FORMAT_VUYX);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,7 +267,6 @@ r300_mpeg12_context_create(struct pipe_screen *screen,
|
|||
if (!vl_mpeg12_mc_renderer_init(&ctx->mc_renderer, ctx->pipe,
|
||||
width, height, chroma_format,
|
||||
VL_MPEG12_MC_RENDERER_BUFFER_PICTURE,
|
||||
VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE,
|
||||
true))
|
||||
{
|
||||
ctx->pipe->destroy(ctx->pipe);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ r600_video_create(struct pipe_screen *screen, enum pipe_video_profile profile,
|
|||
|
||||
return sp_video_create_ex(pipe, profile, chroma_format, width, height,
|
||||
VL_MPEG12_MC_RENDERER_BUFFER_PICTURE,
|
||||
VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE,
|
||||
true,
|
||||
PIPE_FORMAT_VUYX);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -423,7 +423,6 @@ sp_mpeg12_create(struct pipe_context *pipe, enum pipe_video_profile profile,
|
|||
enum pipe_video_chroma_format chroma_format,
|
||||
unsigned width, unsigned height,
|
||||
enum VL_MPEG12_MC_RENDERER_BUFFER_MODE bufmode,
|
||||
enum VL_MPEG12_MC_RENDERER_EMPTY_BLOCK eb_handling,
|
||||
bool pot_buffers,
|
||||
enum pipe_format decode_format)
|
||||
{
|
||||
|
|
@ -466,7 +465,7 @@ sp_mpeg12_create(struct pipe_context *pipe, enum pipe_video_profile profile,
|
|||
|
||||
if (!vl_mpeg12_mc_renderer_init(&ctx->mc_renderer, ctx->pipe,
|
||||
width, height, chroma_format,
|
||||
bufmode, eb_handling, pot_buffers)) {
|
||||
bufmode, pot_buffers)) {
|
||||
ctx->pipe->destroy(ctx->pipe);
|
||||
FREE(ctx);
|
||||
return NULL;
|
||||
|
|
@ -505,12 +504,10 @@ sp_video_create(struct pipe_screen *screen, enum pipe_video_profile profile,
|
|||
return NULL;
|
||||
|
||||
/* TODO: Use slice buffering for softpipe when implemented, no advantage to buffering an entire picture with softpipe */
|
||||
/* TODO: Use XFER_NONE when implemented */
|
||||
return sp_video_create_ex(pipe, profile,
|
||||
chroma_format,
|
||||
width, height,
|
||||
VL_MPEG12_MC_RENDERER_BUFFER_PICTURE,
|
||||
VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE,
|
||||
true,
|
||||
PIPE_FORMAT_XYUV);
|
||||
}
|
||||
|
|
@ -520,7 +517,6 @@ sp_video_create_ex(struct pipe_context *pipe, enum pipe_video_profile profile,
|
|||
enum pipe_video_chroma_format chroma_format,
|
||||
unsigned width, unsigned height,
|
||||
enum VL_MPEG12_MC_RENDERER_BUFFER_MODE bufmode,
|
||||
enum VL_MPEG12_MC_RENDERER_EMPTY_BLOCK eb_handling,
|
||||
bool pot_buffers,
|
||||
enum pipe_format decode_format)
|
||||
{
|
||||
|
|
@ -532,7 +528,7 @@ sp_video_create_ex(struct pipe_context *pipe, enum pipe_video_profile profile,
|
|||
return sp_mpeg12_create(pipe, profile,
|
||||
chroma_format,
|
||||
width, height,
|
||||
bufmode, eb_handling,
|
||||
bufmode,
|
||||
pot_buffers,
|
||||
decode_format);
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ sp_video_create_ex(struct pipe_context *pipe, enum pipe_video_profile profile,
|
|||
enum pipe_video_chroma_format chroma_format,
|
||||
unsigned width, unsigned height,
|
||||
enum VL_MPEG12_MC_RENDERER_BUFFER_MODE bufmode,
|
||||
enum VL_MPEG12_MC_RENDERER_EMPTY_BLOCK eb_handling,
|
||||
bool pot_buffers,
|
||||
enum pipe_format decode_format);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue