Path: blob/21.2-virgl/src/gallium/auxiliary/vl/vl_mpeg12_decoder.h
4565 views
/**************************************************************************1*2* Copyright 2009 Younes Manton.3* 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_mpeg12_decoder_h28#define vl_mpeg12_decoder_h2930#include "pipe/p_video_codec.h"3132#include "util/list.h"3334#include "vl_mpeg12_bitstream.h"35#include "vl_zscan.h"36#include "vl_idct.h"37#include "vl_mc.h"3839#include "vl_vertex_buffers.h"40#include "vl_video_buffer.h"4142struct pipe_screen;43struct pipe_context;4445struct vl_mpeg12_decoder46{47struct pipe_video_codec base;48struct pipe_context *context;4950unsigned chroma_width, chroma_height;5152unsigned blocks_per_line;53unsigned num_blocks;54unsigned width_in_macroblocks;5556enum pipe_format zscan_source_format;5758struct pipe_vertex_buffer quads;59struct pipe_vertex_buffer pos;6061void *ves_ycbcr;62void *ves_mv;6364void *sampler_ycbcr;6566struct pipe_sampler_view *zscan_linear;67struct pipe_sampler_view *zscan_normal;68struct pipe_sampler_view *zscan_alternate;6970struct pipe_video_buffer *idct_source;71struct pipe_video_buffer *mc_source;7273struct vl_zscan zscan_y, zscan_c;74struct vl_idct idct_y, idct_c;75struct vl_mc mc_y, mc_c;7677void *dsa;7879unsigned current_buffer;80struct vl_mpeg12_buffer *dec_buffers[4];8182struct list_head buffer_privates;83};8485struct vl_mpeg12_buffer86{87struct vl_vertex_buffer vertex_stream;8889unsigned block_num;90unsigned num_ycbcr_blocks[3];9192struct pipe_sampler_view *zscan_source;9394struct vl_mpg12_bs bs;95struct vl_zscan_buffer zscan[VL_NUM_COMPONENTS];96struct vl_idct_buffer idct[VL_NUM_COMPONENTS];97struct vl_mc_buffer mc[VL_NUM_COMPONENTS];9899struct pipe_transfer *tex_transfer;100short *texels;101102struct vl_ycbcr_block *ycbcr_stream[VL_NUM_COMPONENTS];103struct vl_motionvector *mv_stream[VL_MAX_REF_FRAMES];104};105106/**107* creates a shader based mpeg12 decoder108*/109struct pipe_video_codec *110vl_create_mpeg12_decoder(struct pipe_context *pipe,111const struct pipe_video_codec *templat);112113#endif /* vl_mpeg12_decoder_h */114115116