Path: blob/21.2-virgl/src/gallium/auxiliary/vl/vl_zscan.h
4565 views
/**************************************************************************1*2* Copyright 2011 Christian König3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627#ifndef vl_zscan_h28#define vl_zscan_h2930#include "pipe/p_compiler.h"31#include "pipe/p_state.h"3233/*34* shader based zscan and quantification35* expect usage of vl_vertex_buffers as a todo list36*/37struct vl_zscan38{39struct pipe_context *pipe;4041unsigned buffer_width;42unsigned buffer_height;4344unsigned num_channels;4546unsigned blocks_per_line;47unsigned blocks_total;4849void *rs_state;50void *blend;5152void *samplers[3];5354void *vs, *fs;55};5657struct vl_zscan_buffer58{59struct pipe_viewport_state viewport;60struct pipe_framebuffer_state fb_state;6162struct pipe_sampler_view *src, *layout, *quant;63struct pipe_surface *dst;64};6566extern const int vl_zscan_normal_16[];67extern const int vl_zscan_linear[];68extern const int vl_zscan_normal[];69extern const int vl_zscan_alternate[];70extern const int vl_zscan_h265_up_right_diagonal_16[];71extern const int vl_zscan_h265_up_right_diagonal[];7273struct pipe_sampler_view *74vl_zscan_layout(struct pipe_context *pipe, const int layout[64], unsigned blocks_per_line);7576bool77vl_zscan_init(struct vl_zscan *zscan, struct pipe_context *pipe,78unsigned buffer_width, unsigned buffer_height,79unsigned blocks_per_line, unsigned blocks_total,80unsigned num_channels);8182void83vl_zscan_cleanup(struct vl_zscan *zscan);8485bool86vl_zscan_init_buffer(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer,87struct pipe_sampler_view *src, struct pipe_surface *dst);8889void90vl_zscan_cleanup_buffer(struct vl_zscan_buffer *buffer);9192void93vl_zscan_set_layout(struct vl_zscan_buffer *buffer, struct pipe_sampler_view *layout);9495void96vl_zscan_upload_quant(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer,97const uint8_t matrix[64], bool intra);9899void100vl_zscan_render(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, unsigned num_instances);101102#endif103104105