tng_vld_dec.h revision 56ada57fd5c4a41fbf281589526d47850bed05fd
1/*
2 * Copyright (c) 2011 Intel Corporation. All Rights Reserved.
3 * Copyright (c) Imagination Technologies Limited, UK
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26/*
27 * Authors:
28 *    Li Zeng <li.zeng@intel.com>
29 */
30#include "psb_cmdbuf.h"
31#include "psb_surface.h"
32#include "tng_yuv_processor.h"
33
34struct context_DEC_s {
35    object_context_p obj_context; /* back reference */
36
37    uint32_t *cmd_params;
38    uint32_t *p_range_mapping_base0;
39    uint32_t *p_range_mapping_base1;
40    uint32_t *p_slice_params; /* pointer to ui32SliceParams in CMD_HEADER */
41    uint32_t *slice_first_pic_last;
42    uint32_t *alt_output_flags;
43
44    struct psb_buffer_s aux_line_buffer_vld;
45    psb_buffer_p preload_buffer;
46    psb_buffer_p slice_data_buffer;
47
48
49    /* Split buffers */
50    int split_buffer_pending;
51
52    /* List of VASliceParameterBuffers */
53    object_buffer_p *slice_param_list;
54    int slice_param_list_size;
55    int slice_param_list_idx;
56
57    unsigned int bits_offset;
58    unsigned int SR_flags;
59
60    void (*begin_slice)(struct context_DEC_s *, VASliceParameterBufferBase *);
61    void (*process_slice)(struct context_DEC_s *, VASliceParameterBufferBase *);
62    void (*end_slice)(struct context_DEC_s *);
63    VAStatus (*process_buffer)(struct context_DEC_s *, object_buffer_p);
64
65    struct psb_buffer_s *colocated_buffers;
66    int colocated_buffers_size;
67    int colocated_buffers_idx;
68    context_yuv_processor_p yuv_ctx;
69};
70
71typedef struct context_DEC_s *context_DEC_p;
72
73void vld_dec_FE_state(object_context_p, psb_buffer_p);
74void vld_dec_setup_alternative_frame(object_context_p);
75VAStatus vld_dec_process_slice_data(context_DEC_p, object_buffer_p);
76VAStatus vld_dec_add_slice_param(context_DEC_p, object_buffer_p);
77VAStatus vld_dec_allocate_colocated_buffer(context_DEC_p, object_surface_p, uint32_t);
78VAStatus vld_dec_CreateContext(context_DEC_p, object_context_p);
79void vld_dec_DestroyContext(context_DEC_p);
80psb_buffer_p vld_dec_lookup_colocated_buffer(context_DEC_p, psb_surface_p);
81void vld_dec_write_kick(object_context_p);
82VAStatus vld_dec_RenderPicture( object_context_p, object_buffer_p *, int);
83
84#define AUX_LINE_BUFFER_VLD_SIZE        (1024*152)
85
86void vld_dec_yuv_rotate(object_context_p, uint32_t, uint32_t);
87