| 1 | /* | 
| 2 |  * Copyright (c) 2007-2012 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 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. | 
| 23 |  */ | 
| 24 |  | 
| 25 | /** | 
| 26 |  * \file va_dec_jpeg.h | 
| 27 |  * \brief The JPEG decoding API | 
| 28 |  * | 
| 29 |  * This file contains the \ref api_dec_jpeg "JPEG decoding API". | 
| 30 |  */ | 
| 31 |  | 
| 32 | #ifndef VA_DEC_JPEG_H | 
| 33 | #define VA_DEC_JPEG_H | 
| 34 |  | 
| 35 | #ifdef __cplusplus | 
| 36 | extern "C"  { | 
| 37 | #endif | 
| 38 |  | 
| 39 | #include <va/va.h> | 
| 40 |  | 
| 41 | /** | 
| 42 |  * \defgroup api_dec_jpeg JPEG decoding API | 
| 43 |  * | 
| 44 |  * This JPEG decoding API supports Baseline profile only. | 
| 45 |  * | 
| 46 |  * @{ | 
| 47 |  */ | 
| 48 |  | 
| 49 | /** | 
| 50 |  * \brief Picture parameter for JPEG decoding. | 
| 51 |  * | 
| 52 |  * This structure holds information from the frame header, along with | 
| 53 |  * definitions from additional segments. | 
| 54 |  */ | 
| 55 | typedef struct _VAPictureParameterBufferJPEGBaseline { | 
| 56 |     /** \brief Picture width in pixels. */ | 
| 57 |     uint16_t      picture_width; | 
| 58 |     /** \brief Picture height in pixels. */ | 
| 59 |     uint16_t      picture_height; | 
| 60 |  | 
| 61 |     struct { | 
| 62 |         /** \brief Component identifier (Ci). */ | 
| 63 |         uint8_t   component_id; | 
| 64 |         /** \brief Horizontal sampling factor (Hi). */ | 
| 65 |         uint8_t   h_sampling_factor; | 
| 66 |         /** \brief Vertical sampling factor (Vi). */ | 
| 67 |         uint8_t   v_sampling_factor; | 
| 68 |         /* \brief Quantization table selector (Tqi). */ | 
| 69 |         uint8_t   quantiser_table_selector; | 
| 70 |     }                   components[255]; | 
| 71 |     /** \brief Number of components in frame (Nf). */ | 
| 72 |     uint8_t       num_components; | 
| 73 |  | 
| 74 |     /** \brief Input color space 0: YUV, 1: RGB, 2: BGR, others: reserved */ | 
| 75 |     uint8_t       color_space; | 
| 76 |     /** \brief Set to VA_ROTATION_* for a single rotation angle reported by VAConfigAttribDecJPEG. */ | 
| 77 |     uint32_t      rotation; | 
| 78 |     /** \brief Reserved bytes for future use, must be zero */ | 
| 79 |     uint32_t                va_reserved[VA_PADDING_MEDIUM - 1]; | 
| 80 | } VAPictureParameterBufferJPEGBaseline; | 
| 81 |  | 
| 82 | /** | 
| 83 |  * \brief Quantization table for JPEG decoding. | 
| 84 |  * | 
| 85 |  * This structure holds the complete quantization tables. This is an | 
| 86 |  * aggregation of all quantization table (DQT) segments maintained by | 
| 87 |  * the application. i.e. up to 4 quantization tables are stored in | 
| 88 |  * there for baseline profile. | 
| 89 |  * | 
| 90 |  * The #load_quantization_table array can be used as a hint to notify | 
| 91 |  * the VA driver implementation about which table(s) actually changed | 
| 92 |  * since the last submission of this buffer. | 
| 93 |  * | 
| 94 |  * The #quantiser_table values are specified in zig-zag scan order. | 
| 95 |  */ | 
| 96 | typedef struct _VAIQMatrixBufferJPEGBaseline { | 
| 97 |     /** \brief Specifies which #quantiser_table is valid. */ | 
| 98 |     uint8_t       load_quantiser_table[4]; | 
| 99 |     /** \brief Quanziation tables indexed by table identifier (Tqi). */ | 
| 100 |     uint8_t       quantiser_table[4][64]; | 
| 101 |  | 
| 102 |     /** \brief Reserved bytes for future use, must be zero */ | 
| 103 |     uint32_t                va_reserved[VA_PADDING_LOW]; | 
| 104 | } VAIQMatrixBufferJPEGBaseline; | 
| 105 |  | 
| 106 | /** | 
| 107 |  * \brief Slice parameter for JPEG decoding. | 
| 108 |  * | 
| 109 |  * This structure holds information from the scan header, along with | 
| 110 |  * definitions from additional segments. The associated slice data | 
| 111 |  * buffer holds all entropy coded segments (ECS) in the scan. | 
| 112 |  */ | 
| 113 | typedef struct _VASliceParameterBufferJPEGBaseline { | 
| 114 |     /** @name Codec-independent Slice Parameter Buffer base. */ | 
| 115 |     /**@{*/ | 
| 116 |     /** \brief Number of bytes in the slice data buffer for this slice. */ | 
| 117 |     uint32_t        slice_data_size; | 
| 118 |     /** \brief The offset to the first byte of the first MCU. */ | 
| 119 |     uint32_t        slice_data_offset; | 
| 120 |     /** \brief Slice data buffer flags. See \c VA_SLICE_DATA_FLAG_xxx. */ | 
| 121 |     uint32_t        slice_data_flag; | 
| 122 |     /**@}*/ | 
| 123 |  | 
| 124 |     /** \brief Scan horizontal position. */ | 
| 125 |     uint32_t        slice_horizontal_position; | 
| 126 |     /** \brief Scan vertical position. */ | 
| 127 |     uint32_t        slice_vertical_position; | 
| 128 |  | 
| 129 |     struct { | 
| 130 |         /** \brief Scan component selector (Csj). */ | 
| 131 |         uint8_t   component_selector; | 
| 132 |         /** \brief DC entropy coding table selector (Tdj). */ | 
| 133 |         uint8_t   dc_table_selector; | 
| 134 |         /** \brief AC entropy coding table selector (Taj). */ | 
| 135 |         uint8_t   ac_table_selector; | 
| 136 |     }                   components[4]; | 
| 137 |     /** \brief Number of components in scan (Ns). */ | 
| 138 |     uint8_t       num_components; | 
| 139 |  | 
| 140 |     /** \brief Restart interval definition (Ri). */ | 
| 141 |     uint16_t      restart_interval; | 
| 142 |     /** \brief Number of MCUs in a scan. */ | 
| 143 |     uint32_t        num_mcus; | 
| 144 |  | 
| 145 |     /** \brief Reserved bytes for future use, must be zero */ | 
| 146 |     uint32_t                va_reserved[VA_PADDING_LOW]; | 
| 147 | } VASliceParameterBufferJPEGBaseline; | 
| 148 |  | 
| 149 | /**@}*/ | 
| 150 |  | 
| 151 | #ifdef __cplusplus | 
| 152 | } | 
| 153 | #endif | 
| 154 |  | 
| 155 | #endif /* VA_DEC_JPEG_H */ | 
| 156 |  |