2 * Copyright (c) 2007-2012 Intel Corporation. All Rights Reserved.
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:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
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 INTEL 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.
27 * \brief The JPEG decoding API
29 * This file contains the \ref api_dec_jpeg "JPEG decoding API".
42 * \defgroup api_dec_jpeg JPEG decoding API
44 * This JPEG decoding API supports Baseline profile only.
50 * \brief Picture parameter for JPEG decoding.
52 * This structure holds information from the frame header, along with
53 * definitions from additional segments.
55 typedef struct _VAPictureParameterBufferJPEGBaseline {
56 /** \brief Picture width in pixels. */
57 unsigned short picture_width;
58 /** \brief Picture height in pixels. */
59 unsigned short picture_height;
62 /** \brief Component identifier (Ci). */
63 unsigned char component_id;
64 /** \brief Horizontal sampling factor (Hi). */
65 unsigned char h_sampling_factor;
66 /** \brief Vertical sampling factor (Vi). */
67 unsigned char v_sampling_factor;
68 /* \brief Quantization table selector (Tqi). */
69 unsigned char quantiser_table_selector;
71 /** \brief Number of components in frame (Nf). */
72 unsigned char num_components;
73 } VAPictureParameterBufferJPEGBaseline;
76 * \brief Quantization table for JPEG decoding.
78 * This structure holds the complete quantization tables. This is an
79 * aggregation of all quantization table (DQT) segments maintained by
80 * the application. i.e. up to 4 quantization tables are stored in
81 * there for baseline profile.
83 * The #load_quantization_table array can be used as a hint to notify
84 * the VA driver implementation about which table(s) actually changed
85 * since the last submission of this buffer.
87 * The #quantiser_table values are specified in zig-zag scan order.
89 typedef struct _VAIQMatrixBufferJPEGBaseline {
90 /** \brief Specifies which #quantiser_table is valid. */
91 unsigned char load_quantiser_table[4];
92 /** \brief Quanziation tables indexed by table identifier (Tqi). */
93 unsigned char quantiser_table[4][64];
94 } VAIQMatrixBufferJPEGBaseline;
97 * \brief Huffman table for JPEG decoding.
99 * This structure holds the complete Huffman tables. This is an
100 * aggregation of all Huffman table (DHT) segments maintained by the
101 * application. i.e. up to 2 Huffman tables are stored in there for
104 * The #load_huffman_table array can be used as a hint to notify the
105 * VA driver implementation about which table(s) actually changed
106 * since the last submission of this buffer.
108 typedef struct _VAHuffmanTableBufferJPEGBaseline {
109 /** \brief Specifies which #huffman_table is valid. */
110 unsigned char load_huffman_table[2];
111 /** \brief Huffman tables indexed by table identifier (Th). */
113 /** @name DC table (up to 12 categories) */
115 /** \brief Number of Huffman codes of length i + 1 (Li). */
116 unsigned char num_dc_codes[16];
117 /** \brief Value associated with each Huffman code (Vij). */
118 unsigned char dc_values[12];
120 /** @name AC table (2 special codes + up to 16 * 10 codes) */
122 /** \brief Number of Huffman codes of length i + 1 (Li). */
123 unsigned char num_ac_codes[16];
124 /** \brief Value associated with each Huffman code (Vij). */
125 unsigned char ac_values[162];
126 /** \brief Padding to 4-byte boundaries. Must be set to zero. */
127 unsigned char pad[2];
130 } VAHuffmanTableBufferJPEGBaseline;
133 * \brief Slice parameter for JPEG decoding.
135 * This structure holds information from the scan header, along with
136 * definitions from additional segments. The associated slice data
137 * buffer holds all entropy coded segments (ECS) in the scan.
139 typedef struct _VASliceParameterBufferJPEGBaseline {
140 /** @name Codec-independent Slice Parameter Buffer base. */
142 /** \brief Number of bytes in the slice data buffer for this slice. */
143 unsigned int slice_data_size;
144 /** \brief The offset to the first byte of the first MCU. */
145 unsigned int slice_data_offset;
146 /** \brief Slice data buffer flags. See \c VA_SLICE_DATA_FLAG_xxx. */
147 unsigned int slice_data_flag;
150 /** \brief Scan horizontal position. */
151 unsigned int slice_horizontal_position;
152 /** \brief Scan vertical position. */
153 unsigned int slice_vertical_position;
156 /** \brief Scan component selector (Csj). */
157 unsigned char component_selector;
158 /** \brief DC entropy coding table selector (Tdj). */
159 unsigned char dc_table_selector;
160 /** \brief AC entropy coding table selector (Taj). */
161 unsigned char ac_table_selector;
163 /** \brief Number of components in scan (Ns). */
164 unsigned char num_components;
166 /** \brief Restart interval definition (Ri). */
167 unsigned short restart_interval;
168 /** \brief Number of MCUs in a scan. */
169 unsigned int num_mcus;
170 } VASliceParameterBufferJPEGBaseline;
178 #endif /* VA_DEC_JPEG_H */