Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | #ifndef QDSP5VIDENCCMDI_H |
| 2 | #define QDSP5VIDENCCMDI_H |
| 3 | |
| 4 | /*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* |
| 5 | |
| 6 | V I D E O E N C O D E R I N T E R N A L C O M M A N D S |
| 7 | |
| 8 | GENERAL DESCRIPTION |
| 9 | This file contains defintions of format blocks of commands |
| 10 | that are accepted by VIDENC Task |
| 11 | |
| 12 | REFERENCES |
| 13 | None |
| 14 | |
| 15 | EXTERNALIZED FUNCTIONS |
| 16 | None |
| 17 | |
Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 18 | Copyright (c) 2008-2009, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 19 | *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ |
| 20 | /*=========================================================================== |
| 21 | |
| 22 | EDIT HISTORY FOR FILE |
| 23 | |
| 24 | This section contains comments describing changes made to this file. |
| 25 | Notice that changes are listed in reverse chronological order. |
| 26 | |
| 27 | Revision History: |
| 28 | |
| 29 | when who what, where, why |
| 30 | -------- --- ---------------------------------------------------------- |
| 31 | 09/25/08 umeshp initial version |
| 32 | ===========================================================================*/ |
| 33 | |
| 34 | #define VIDENC_CMD_CFG 0x0000 |
| 35 | #define VIDENC_CMD_ACTIVE 0x0001 |
| 36 | #define VIDENC_CMD_IDLE 0x0002 |
| 37 | #define VIDENC_CMD_FRAME_START 0x0003 |
| 38 | #define VIDENC_CMD_STATUS_QUERY 0x0004 |
| 39 | #define VIDENC_CMD_RC_CFG 0x0005 |
| 40 | #define VIDENC_CMD_INTRA_REFRESH 0x0006 |
| 41 | #define VIDENC_CMD_CODEC_CONFIG 0x0007 |
| 42 | #define VIDENC_CMD_VIDEO_CONFIG 0x0008 |
| 43 | #define VIDENC_CMD_PARAMETER_UPDATE 0x0009 |
| 44 | #define VIDENC_CMD_VENC_CLOCK 0x000A |
| 45 | #define VIDENC_CMD_DIS_CFG 0x000B |
| 46 | #define VIDENC_CMD_DIS 0x000C |
| 47 | #define VIDENC_CMD_DIGITAL_ZOOM 0x000D |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | /* |
| 53 | * Command to pass the frame message information to VIDENC |
| 54 | */ |
| 55 | |
| 56 | |
| 57 | #define VIDENC_CMD_FRAME_START_LEN \ |
| 58 | sizeof(videnc_cmd_frame_start) |
| 59 | |
| 60 | typedef struct { |
| 61 | unsigned short cmd_id; |
| 62 | unsigned short frame_info; |
| 63 | unsigned short frame_rho_budget_word_high; |
| 64 | unsigned short frame_rho_budget_word_low; |
| 65 | unsigned short input_luma_addr_high; |
| 66 | unsigned short input_luma_addr_low; |
| 67 | unsigned short input_chroma_addr_high; |
| 68 | unsigned short input_chroma_addr_low; |
| 69 | unsigned short ref_vop_buf_ptr_high; |
| 70 | unsigned short ref_vop_buf_ptr_low; |
| 71 | unsigned short enc_pkt_buf_ptr_high; |
| 72 | unsigned short enc_pkt_buf_ptr_low; |
| 73 | unsigned short enc_pkt_buf_size_high; |
| 74 | unsigned short enc_pkt_buf_size_low; |
| 75 | unsigned short unfilt_recon_vop_buf_ptr_high; |
| 76 | unsigned short unfilt_recon_vop_buf_ptr_low; |
| 77 | unsigned short filt_recon_vop_buf_ptr_high; |
| 78 | unsigned short filt_recon_vop_buf_ptr_low; |
| 79 | } __attribute__((packed)) videnc_cmd_frame_start; |
| 80 | |
| 81 | /* |
| 82 | * Command to pass the frame-level digital stabilization parameters to VIDENC |
| 83 | */ |
| 84 | |
| 85 | |
| 86 | #define VIDENC_CMD_DIS_LEN \ |
| 87 | sizeof(videnc_cmd_dis) |
| 88 | |
| 89 | typedef struct { |
| 90 | unsigned short cmd_id; |
| 91 | unsigned short vfe_out_prev_luma_addr_high; |
| 92 | unsigned short vfe_out_prev_luma_addr_low; |
| 93 | unsigned short stabilization_info; |
| 94 | } __attribute__((packed)) videnc_cmd_dis; |
| 95 | |
| 96 | /* |
| 97 | * Command to pass the codec related parameters to VIDENC |
| 98 | */ |
| 99 | |
| 100 | |
| 101 | #define VIDENC_CMD_CFG_LEN \ |
| 102 | sizeof(videnc_cmd_cfg) |
| 103 | |
| 104 | typedef struct { |
| 105 | unsigned short cmd_id; |
| 106 | unsigned short cfg_info_0; |
| 107 | unsigned short cfg_info_1; |
| 108 | unsigned short four_mv_threshold; |
| 109 | unsigned short ise_fse_mv_cost_fac; |
| 110 | unsigned short venc_frame_dim; |
| 111 | unsigned short venc_DM_partition; |
| 112 | } __attribute__((packed)) videnc_cmd_cfg; |
| 113 | |
| 114 | /* |
| 115 | * Command to start the video encoding |
| 116 | */ |
| 117 | |
| 118 | |
| 119 | #define VIDENC_CMD_ACTIVE_LEN \ |
| 120 | sizeof(videnc_cmd_active) |
| 121 | |
| 122 | typedef struct { |
| 123 | unsigned short cmd_id; |
| 124 | } __attribute__((packed)) videnc_cmd_active; |
| 125 | |
| 126 | /* |
| 127 | * Command to stop the video encoding |
| 128 | */ |
| 129 | |
| 130 | |
| 131 | #define VIDENC_CMD_IDLE_LEN \ |
| 132 | sizeof(videnc_cmd_idle) |
| 133 | |
| 134 | typedef struct { |
| 135 | unsigned short cmd_id; |
| 136 | } __attribute__((packed)) videnc_cmd_idle; |
| 137 | |
| 138 | /* |
| 139 | * Command to query staus of VIDENC |
| 140 | */ |
| 141 | |
| 142 | |
| 143 | #define VIDENC_CMD_STATUS_QUERY_LEN \ |
| 144 | sizeof(videnc_cmd_status_query) |
| 145 | |
| 146 | typedef struct { |
| 147 | unsigned short cmd_id; |
| 148 | } __attribute__((packed)) videnc_cmd_status_query; |
| 149 | |
| 150 | /* |
| 151 | * Command to set rate control for a frame |
| 152 | */ |
| 153 | |
| 154 | |
| 155 | #define VIDENC_CMD_RC_CFG_LEN \ |
| 156 | sizeof(videnc_cmd_rc_cfg) |
| 157 | |
| 158 | typedef struct { |
| 159 | unsigned short cmd_id; |
| 160 | unsigned short max_frame_qp_delta; |
| 161 | unsigned short max_min_frame_qp; |
| 162 | } __attribute__((packed)) videnc_cmd_rc_cfg; |
| 163 | |
| 164 | /* |
| 165 | * Command to set intra-refreshing |
| 166 | */ |
| 167 | |
| 168 | |
| 169 | #define VIDENC_CMD_INTRA_REFRESH_LEN \ |
| 170 | sizeof(videnc_cmd_intra_refresh) |
| 171 | |
| 172 | typedef struct { |
| 173 | unsigned short cmd_id; |
| 174 | unsigned short num_mb_refresh; |
| 175 | unsigned short mb_index[15]; |
| 176 | } __attribute__((packed)) videnc_cmd_intra_refresh; |
| 177 | |
| 178 | /* |
| 179 | * Command to pass digital zoom information to the VIDENC |
| 180 | */ |
| 181 | #define VIDENC_CMD_DIGITAL_ZOOM_LEN \ |
| 182 | sizeof(videnc_cmd_digital_zoom) |
| 183 | |
| 184 | typedef struct { |
| 185 | unsigned short cmd_id; |
| 186 | unsigned short digital_zoom_en; |
| 187 | unsigned short luma_frame_shift_X; |
| 188 | unsigned short luma_frame_shift_Y; |
| 189 | unsigned short up_ip_luma_rows; |
| 190 | unsigned short up_ip_luma_cols; |
| 191 | unsigned short up_ip_chroma_rows; |
| 192 | unsigned short up_ip_chroma_cols; |
| 193 | unsigned short luma_ph_incr_V_low; |
| 194 | unsigned short luma_ph_incr_V_high; |
| 195 | unsigned short luma_ph_incr_H_low; |
| 196 | unsigned short luma_ph_incr_H_high; |
| 197 | unsigned short chroma_ph_incr_V_low; |
| 198 | unsigned short chroma_ph_incr_V_high; |
| 199 | unsigned short chroma_ph_incr_H_low; |
| 200 | unsigned short chroma_ph_incr_H_high; |
| 201 | } __attribute__((packed)) videnc_cmd_digital_zoom; |
| 202 | |
| 203 | /* |
| 204 | * Command to configure digital stabilization parameters |
| 205 | */ |
| 206 | |
| 207 | #define VIDENC_CMD_DIS_CFG_LEN \ |
| 208 | sizeof(videnc_cmd_dis_cfg) |
| 209 | |
| 210 | typedef struct { |
| 211 | unsigned short cmd_id; |
| 212 | unsigned short image_stab_subf_start_row_col; |
| 213 | unsigned short image_stab_subf_dim; |
| 214 | unsigned short image_stab_info_0; |
| 215 | } __attribute__((packed)) videnc_cmd_dis_cfg; |
| 216 | |
| 217 | |
| 218 | /* |
| 219 | * Command to set VIDENC_CMD_VENC_CLOCK |
| 220 | */ |
| 221 | |
| 222 | |
| 223 | #define VIDENC_CMD_VENC_CLOCK_LEN \ |
| 224 | sizeof(struct videnc_cmd_venc_clock) |
| 225 | |
| 226 | struct videnc_cmd_venc_clock { |
| 227 | unsigned short cmd_id; |
| 228 | unsigned short payload; |
| 229 | } __attribute__((packed)) ; |
| 230 | |
| 231 | #endif |