vsp_VPP.h revision 9ab46f9986463a0a5e6ba912fffb71be24d119d9
1/*
2 * Copyright (c) 2011 Intel Corporation. All Rights Reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
14 * of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors:
25 *    Binglin Chen <binglin.chen@intel.com>
26 *
27 */
28
29#ifndef _VSP_VPP_H_
30#define _VSP_VPP_H_
31
32#include "psb_drv_video.h"
33#include <linux/vsp_fw.h>
34
35struct context_VPP_s {
36	object_context_p obj_context; /* back reference */
37
38	uint32_t profile; // ENTDEC BE_PROFILE & FE_PROFILE
39	uint32_t profile_idc; // BE_PROFILEIDC
40
41	struct psb_buffer_s *context_buf;
42
43	VABufferID *filters;
44	unsigned int num_filters;
45
46	enum vsp_format format;
47
48	object_buffer_p filter_buf[VssProcPipelineMaxNumFilters];
49	object_buffer_p frc_buf;
50
51	unsigned int param_sz;
52	unsigned int pic_param_sz;
53	unsigned int pic_param_offset;
54	unsigned int end_param_sz;
55	unsigned int end_param_offset;
56	unsigned int pipeline_param_sz;
57	unsigned int pipeline_param_offset;
58	unsigned int denoise_param_sz;
59	unsigned int denoise_param_offset;
60	unsigned int enhancer_param_sz;
61	unsigned int enhancer_param_offset;
62	unsigned int sharpen_param_sz;
63	unsigned int sharpen_param_offset;
64	unsigned int frc_param_sz;
65	unsigned int frc_param_offset;
66	unsigned int seq_param_sz;
67	unsigned int seq_param_offset;
68	unsigned int frame_width;
69	unsigned int frame_height;
70
71	unsigned int rc_mode;
72
73	struct VssProcDenoiseParameterBuffer denoise_deblock_param;
74	struct VssProcColorEnhancementParameterBuffer enhancer_param;
75	struct VssProcSharpenParameterBuffer sharpen_param;
76};
77
78typedef struct context_VPP_s *context_VPP_p;
79
80extern struct format_vtable_s vsp_VPP_vtable;
81
82/**
83 * Queries video processing filters.
84 *
85 * This function returns the list of video processing filters supported
86 * by the driver. The filters array is allocated by the user and
87 * num_filters shall be initialized to the number of allocated
88 * elements in that array. Upon successful return, the actual number
89 * of filters will be overwritten into num_filters. Otherwise,
90 * VA_STATUS_ERROR_MAX_NUM_EXCEEDED is returned and num_filters
91 * is adjusted to the number of elements that would be returned if enough
92 * space was available.
93 *
94 * The list of video processing filters supported by the driver shall
95 * be ordered in the way they can be iteratively applied. This is needed
96 * for both correctness, i.e. some filters would not mean anything if
97 * applied at the beginning of the pipeline; but also for performance
98 * since some filters can be applied in a single pass (e.g. noise
99 * reduction + deinterlacing).
100 *
101 */
102VAStatus vsp_QueryVideoProcFilters(
103        VADriverContextP    ctx,
104        VAContextID         context,
105        VAProcFilterType   *filters,
106        unsigned int       *num_filters
107	);
108
109/**
110 * Queries video filter capabilities.
111 *
112 * This function returns the list of capabilities supported by the driver
113 * for a specific video filter. The filter_caps array is allocated by
114 * the user and num_filter_caps shall be initialized to the number
115 * of allocated elements in that array. Upon successful return, the
116 * actual number of filters will be overwritten into num_filter_caps.
117 * Otherwise, VA_STATUS_ERROR_MAX_NUM_EXCEEDED is returned and
118 * num_filter_caps is adjusted to the number of elements that would be
119 * returned if enough space was available.
120 *
121 */
122VAStatus vsp_QueryVideoProcFilterCaps(
123        VADriverContextP    ctx,
124        VAContextID         context,
125        VAProcFilterType    type,
126        void               *filter_caps,
127        unsigned int       *num_filter_caps
128	);
129
130/**
131 * Queries video processing pipeline capabilities.
132 *
133 * This function returns the video processing pipeline capabilities. The
134 * filters array defines the video processing pipeline and is an array
135 * of buffers holding filter parameters.
136 *
137 * Note: the VAProcPipelineCaps structure contains user-provided arrays.
138 * If non-NULL, the corresponding num_* fields shall be filled in on
139 * input with the number of elements allocated. Upon successful return,
140 * the actual number of elements will be overwritten into the num_*
141 * fields. Otherwise, VA_STATUS_ERROR_MAX_NUM_EXCEEDED is returned
142 * and num_* fields are adjusted to the number of elements that would
143 * be returned if enough space was available.
144 *
145 */
146VAStatus vsp_QueryVideoProcPipelineCaps(
147	VADriverContextP    ctx,
148        VAContextID         context,
149        VABufferID         *filters,
150        unsigned int        num_filters,
151        VAProcPipelineCaps *pipeline_caps
152    );
153
154#endif /* _VSS_VPP_H_ */
155