vedio_gr_peach
Fork of GR-PEACH_video by
drivers/vdec/src/r_vdec.c@0:853f5b7408a7, 2015-06-26 (annotated)
- Committer:
- dkato
- Date:
- Fri Jun 26 02:17:53 2015 +0000
- Revision:
- 0:853f5b7408a7
first commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dkato | 0:853f5b7408a7 | 1 | /******************************************************************************* |
dkato | 0:853f5b7408a7 | 2 | * DISCLAIMER |
dkato | 0:853f5b7408a7 | 3 | * This software is supplied by Renesas Electronics Corporation and is only |
dkato | 0:853f5b7408a7 | 4 | * intended for use with Renesas products. No other uses are authorized. This |
dkato | 0:853f5b7408a7 | 5 | * software is owned by Renesas Electronics Corporation and is protected under |
dkato | 0:853f5b7408a7 | 6 | * all applicable laws, including copyright laws. |
dkato | 0:853f5b7408a7 | 7 | * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING |
dkato | 0:853f5b7408a7 | 8 | * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT |
dkato | 0:853f5b7408a7 | 9 | * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE |
dkato | 0:853f5b7408a7 | 10 | * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. |
dkato | 0:853f5b7408a7 | 11 | * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS |
dkato | 0:853f5b7408a7 | 12 | * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE |
dkato | 0:853f5b7408a7 | 13 | * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR |
dkato | 0:853f5b7408a7 | 14 | * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE |
dkato | 0:853f5b7408a7 | 15 | * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
dkato | 0:853f5b7408a7 | 16 | * Renesas reserves the right, without notice, to make changes to this software |
dkato | 0:853f5b7408a7 | 17 | * and to discontinue the availability of this software. By using this software, |
dkato | 0:853f5b7408a7 | 18 | * you agree to the additional terms and conditions found by accessing the |
dkato | 0:853f5b7408a7 | 19 | * following link: |
dkato | 0:853f5b7408a7 | 20 | * http://www.renesas.com/disclaimer |
dkato | 0:853f5b7408a7 | 21 | * Copyright (C) 2012 - 2015 Renesas Electronics Corporation. All rights reserved. |
dkato | 0:853f5b7408a7 | 22 | *******************************************************************************/ |
dkato | 0:853f5b7408a7 | 23 | /**************************************************************************//** |
dkato | 0:853f5b7408a7 | 24 | * @file r_vdec.c |
dkato | 0:853f5b7408a7 | 25 | * @version 1.00 |
dkato | 0:853f5b7408a7 | 26 | * $Rev: 199 $ |
dkato | 0:853f5b7408a7 | 27 | * $Date:: 2014-05-23 16:33:52 +0900#$ |
dkato | 0:853f5b7408a7 | 28 | * @brief VDEC driver API function |
dkato | 0:853f5b7408a7 | 29 | ******************************************************************************/ |
dkato | 0:853f5b7408a7 | 30 | |
dkato | 0:853f5b7408a7 | 31 | /****************************************************************************** |
dkato | 0:853f5b7408a7 | 32 | Includes <System Includes> , "Project Includes" |
dkato | 0:853f5b7408a7 | 33 | ******************************************************************************/ |
dkato | 0:853f5b7408a7 | 34 | #include "r_vdec.h" |
dkato | 0:853f5b7408a7 | 35 | #include "r_vdec_user.h" |
dkato | 0:853f5b7408a7 | 36 | #include "r_vdec_register.h" |
dkato | 0:853f5b7408a7 | 37 | #include "r_vdec_check_parameter.h" |
dkato | 0:853f5b7408a7 | 38 | |
dkato | 0:853f5b7408a7 | 39 | |
dkato | 0:853f5b7408a7 | 40 | /****************************************************************************** |
dkato | 0:853f5b7408a7 | 41 | Macro definitions |
dkato | 0:853f5b7408a7 | 42 | ******************************************************************************/ |
dkato | 0:853f5b7408a7 | 43 | |
dkato | 0:853f5b7408a7 | 44 | /****************************************************************************** |
dkato | 0:853f5b7408a7 | 45 | Typedef definitions |
dkato | 0:853f5b7408a7 | 46 | ******************************************************************************/ |
dkato | 0:853f5b7408a7 | 47 | |
dkato | 0:853f5b7408a7 | 48 | /****************************************************************************** |
dkato | 0:853f5b7408a7 | 49 | Private global variables and functions |
dkato | 0:853f5b7408a7 | 50 | ******************************************************************************/ |
dkato | 0:853f5b7408a7 | 51 | |
dkato | 0:853f5b7408a7 | 52 | /**************************************************************************//** |
dkato | 0:853f5b7408a7 | 53 | * @brief VDEC driver initialization |
dkato | 0:853f5b7408a7 | 54 | * |
dkato | 0:853f5b7408a7 | 55 | * Description:<br> |
dkato | 0:853f5b7408a7 | 56 | * This function performs the following processing: |
dkato | 0:853f5b7408a7 | 57 | * - Calls the user-defined function specified in init_func. |
dkato | 0:853f5b7408a7 | 58 | * - Sets up the input pins. |
dkato | 0:853f5b7408a7 | 59 | * @param[in] ch : Channel |
dkato | 0:853f5b7408a7 | 60 | * @param[in] vinsel : Input pin control |
dkato | 0:853f5b7408a7 | 61 | * - VDEC_ADC_VINSEL_VIN1 |
dkato | 0:853f5b7408a7 | 62 | * - VDEC_ADC_VINSEL_VIN2 |
dkato | 0:853f5b7408a7 | 63 | * @param[in] init_func : Pointer to a user-defined function |
dkato | 0:853f5b7408a7 | 64 | * @param[in] user_num : User defined number |
dkato | 0:853f5b7408a7 | 65 | * @retval Error code |
dkato | 0:853f5b7408a7 | 66 | *****************************************************************************/ |
dkato | 0:853f5b7408a7 | 67 | vdec_error_t R_VDEC_Initialize ( |
dkato | 0:853f5b7408a7 | 68 | const vdec_channel_t ch, |
dkato | 0:853f5b7408a7 | 69 | const vdec_adc_vinsel_t vinsel, |
dkato | 0:853f5b7408a7 | 70 | void (* const init_func)(uint32_t), |
dkato | 0:853f5b7408a7 | 71 | const uint32_t user_num) |
dkato | 0:853f5b7408a7 | 72 | { |
dkato | 0:853f5b7408a7 | 73 | vdec_error_t vdec_error; |
dkato | 0:853f5b7408a7 | 74 | |
dkato | 0:853f5b7408a7 | 75 | vdec_error = VDEC_OK; |
dkato | 0:853f5b7408a7 | 76 | #ifdef R_VDEC_CHECK_PARAMETERS |
dkato | 0:853f5b7408a7 | 77 | if ((ch != VDEC_CHANNEL_0) && (ch != VDEC_CHANNEL_1)) { |
dkato | 0:853f5b7408a7 | 78 | vdec_error = VDEC_ERR_CHANNEL; /* Channel error */ |
dkato | 0:853f5b7408a7 | 79 | } |
dkato | 0:853f5b7408a7 | 80 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 81 | vdec_error = VDEC_InitializeCheckParam(vinsel); |
dkato | 0:853f5b7408a7 | 82 | } |
dkato | 0:853f5b7408a7 | 83 | #endif /* R_VDEC_CHECK_PARAMETERS */ |
dkato | 0:853f5b7408a7 | 84 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 85 | /* User-defined function */ |
dkato | 0:853f5b7408a7 | 86 | if (init_func != 0) { |
dkato | 0:853f5b7408a7 | 87 | init_func(user_num); |
dkato | 0:853f5b7408a7 | 88 | } |
dkato | 0:853f5b7408a7 | 89 | VDEC_Initialize(ch, vinsel); |
dkato | 0:853f5b7408a7 | 90 | } |
dkato | 0:853f5b7408a7 | 91 | return vdec_error; |
dkato | 0:853f5b7408a7 | 92 | } /* End of function R_VDEC_Initialize() */ |
dkato | 0:853f5b7408a7 | 93 | |
dkato | 0:853f5b7408a7 | 94 | /**************************************************************************//** |
dkato | 0:853f5b7408a7 | 95 | * @brief VDEC driver termination |
dkato | 0:853f5b7408a7 | 96 | * |
dkato | 0:853f5b7408a7 | 97 | * Description:<br> |
dkato | 0:853f5b7408a7 | 98 | * This function performs the following processing: |
dkato | 0:853f5b7408a7 | 99 | * - Calls the user-defined function specified in quit_func. |
dkato | 0:853f5b7408a7 | 100 | * @param[in] ch : Channel |
dkato | 0:853f5b7408a7 | 101 | * @param[in] quit_func : Pointer to a user-defined function |
dkato | 0:853f5b7408a7 | 102 | * @param[in] user_num : User defined number |
dkato | 0:853f5b7408a7 | 103 | * @retval Error code |
dkato | 0:853f5b7408a7 | 104 | *****************************************************************************/ |
dkato | 0:853f5b7408a7 | 105 | vdec_error_t R_VDEC_Terminate (const vdec_channel_t ch, void (* const quit_func)(uint32_t), const uint32_t user_num) |
dkato | 0:853f5b7408a7 | 106 | { |
dkato | 0:853f5b7408a7 | 107 | vdec_error_t vdec_error; |
dkato | 0:853f5b7408a7 | 108 | |
dkato | 0:853f5b7408a7 | 109 | vdec_error = VDEC_OK; |
dkato | 0:853f5b7408a7 | 110 | #ifdef R_VDEC_CHECK_PARAMETERS |
dkato | 0:853f5b7408a7 | 111 | if ((ch != VDEC_CHANNEL_0) && (ch != VDEC_CHANNEL_1)) { |
dkato | 0:853f5b7408a7 | 112 | vdec_error = VDEC_ERR_CHANNEL; /* Channel error */ |
dkato | 0:853f5b7408a7 | 113 | } |
dkato | 0:853f5b7408a7 | 114 | #endif /* R_VDEC_CHECK_PARAMETERS */ |
dkato | 0:853f5b7408a7 | 115 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 116 | /* User-defined function */ |
dkato | 0:853f5b7408a7 | 117 | if (quit_func != 0) { |
dkato | 0:853f5b7408a7 | 118 | quit_func(user_num); |
dkato | 0:853f5b7408a7 | 119 | } |
dkato | 0:853f5b7408a7 | 120 | } |
dkato | 0:853f5b7408a7 | 121 | return vdec_error; |
dkato | 0:853f5b7408a7 | 122 | } /* End of function R_VDEC_Terminate() */ |
dkato | 0:853f5b7408a7 | 123 | |
dkato | 0:853f5b7408a7 | 124 | /**************************************************************************//** |
dkato | 0:853f5b7408a7 | 125 | * @brief Active image period setup |
dkato | 0:853f5b7408a7 | 126 | * |
dkato | 0:853f5b7408a7 | 127 | * Description:<br> |
dkato | 0:853f5b7408a7 | 128 | * This function configures the active image period. |
dkato | 0:853f5b7408a7 | 129 | * @param[in] ch : Channel |
dkato | 0:853f5b7408a7 | 130 | * @param[in] param : Active image period parameter |
dkato | 0:853f5b7408a7 | 131 | * @retval Error code |
dkato | 0:853f5b7408a7 | 132 | *****************************************************************************/ |
dkato | 0:853f5b7408a7 | 133 | vdec_error_t R_VDEC_ActivePeriod (const vdec_channel_t ch, const vdec_active_period_t * const param) |
dkato | 0:853f5b7408a7 | 134 | { |
dkato | 0:853f5b7408a7 | 135 | vdec_error_t vdec_error; |
dkato | 0:853f5b7408a7 | 136 | |
dkato | 0:853f5b7408a7 | 137 | vdec_error = VDEC_OK; |
dkato | 0:853f5b7408a7 | 138 | #ifdef R_VDEC_CHECK_PARAMETERS |
dkato | 0:853f5b7408a7 | 139 | if ((ch != VDEC_CHANNEL_0) && (ch != VDEC_CHANNEL_1)) { |
dkato | 0:853f5b7408a7 | 140 | vdec_error = VDEC_ERR_CHANNEL; /* Channel error */ |
dkato | 0:853f5b7408a7 | 141 | } |
dkato | 0:853f5b7408a7 | 142 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 143 | vdec_error = VDEC_ActivePeriodCheckParam(param); |
dkato | 0:853f5b7408a7 | 144 | } |
dkato | 0:853f5b7408a7 | 145 | #endif /* R_VDEC_CHECK_PARAMETERS */ |
dkato | 0:853f5b7408a7 | 146 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 147 | VDEC_ActivePeriod(ch, param); |
dkato | 0:853f5b7408a7 | 148 | } |
dkato | 0:853f5b7408a7 | 149 | return vdec_error; |
dkato | 0:853f5b7408a7 | 150 | } /* End of function R_VDEC_ActivePeriod() */ |
dkato | 0:853f5b7408a7 | 151 | |
dkato | 0:853f5b7408a7 | 152 | /**************************************************************************//** |
dkato | 0:853f5b7408a7 | 153 | * @brief Sync separation processing |
dkato | 0:853f5b7408a7 | 154 | * |
dkato | 0:853f5b7408a7 | 155 | * Description:<br> |
dkato | 0:853f5b7408a7 | 156 | * This function performs the following processing: |
dkato | 0:853f5b7408a7 | 157 | * - Configures the noise reduction LPF. |
dkato | 0:853f5b7408a7 | 158 | * - Configures the auto level control sync slicer. |
dkato | 0:853f5b7408a7 | 159 | * - Configures the horizontal AFC. |
dkato | 0:853f5b7408a7 | 160 | * - Configures the vertical count-down. |
dkato | 0:853f5b7408a7 | 161 | * - Configures the AGC. |
dkato | 0:853f5b7408a7 | 162 | * - Configures the peak limiter control. |
dkato | 0:853f5b7408a7 | 163 | * @param[in] ch : Channel |
dkato | 0:853f5b7408a7 | 164 | * @param[in] param : Sync separation parameter |
dkato | 0:853f5b7408a7 | 165 | * @retval Error code |
dkato | 0:853f5b7408a7 | 166 | *****************************************************************************/ |
dkato | 0:853f5b7408a7 | 167 | vdec_error_t R_VDEC_SyncSeparation (const vdec_channel_t ch, const vdec_sync_separation_t * const param) |
dkato | 0:853f5b7408a7 | 168 | { |
dkato | 0:853f5b7408a7 | 169 | vdec_error_t vdec_error; |
dkato | 0:853f5b7408a7 | 170 | |
dkato | 0:853f5b7408a7 | 171 | vdec_error = VDEC_OK; |
dkato | 0:853f5b7408a7 | 172 | #ifdef R_VDEC_CHECK_PARAMETERS |
dkato | 0:853f5b7408a7 | 173 | if ((ch != VDEC_CHANNEL_0) && (ch != VDEC_CHANNEL_1)) { |
dkato | 0:853f5b7408a7 | 174 | vdec_error = VDEC_ERR_CHANNEL; /* Channel error */ |
dkato | 0:853f5b7408a7 | 175 | } |
dkato | 0:853f5b7408a7 | 176 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 177 | vdec_error = VDEC_SyncSeparationCheckParam(param); |
dkato | 0:853f5b7408a7 | 178 | } |
dkato | 0:853f5b7408a7 | 179 | #endif /* R_VDEC_CHECK_PARAMETERS */ |
dkato | 0:853f5b7408a7 | 180 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 181 | VDEC_SyncSeparation(ch, param); |
dkato | 0:853f5b7408a7 | 182 | } |
dkato | 0:853f5b7408a7 | 183 | return vdec_error; |
dkato | 0:853f5b7408a7 | 184 | } /* End of function R_VDEC_SyncSeparation() */ |
dkato | 0:853f5b7408a7 | 185 | |
dkato | 0:853f5b7408a7 | 186 | /**************************************************************************//** |
dkato | 0:853f5b7408a7 | 187 | * @brief Y/C separation processing |
dkato | 0:853f5b7408a7 | 188 | * |
dkato | 0:853f5b7408a7 | 189 | * Description:<br> |
dkato | 0:853f5b7408a7 | 190 | * This function performs the following processing: |
dkato | 0:853f5b7408a7 | 191 | * - Configures the over-range control. |
dkato | 0:853f5b7408a7 | 192 | * - Configures the Y/C separation control. |
dkato | 0:853f5b7408a7 | 193 | * - Configures the chroma filter TAP coefficients for Y/C separation. |
dkato | 0:853f5b7408a7 | 194 | * @param[in] ch : Channel |
dkato | 0:853f5b7408a7 | 195 | * @param[in] param : Y/C separation parameter |
dkato | 0:853f5b7408a7 | 196 | * @retval Error code |
dkato | 0:853f5b7408a7 | 197 | *****************************************************************************/ |
dkato | 0:853f5b7408a7 | 198 | vdec_error_t R_VDEC_YcSeparation (const vdec_channel_t ch, const vdec_yc_separation_t * const param) |
dkato | 0:853f5b7408a7 | 199 | { |
dkato | 0:853f5b7408a7 | 200 | vdec_error_t vdec_error; |
dkato | 0:853f5b7408a7 | 201 | |
dkato | 0:853f5b7408a7 | 202 | vdec_error = VDEC_OK; |
dkato | 0:853f5b7408a7 | 203 | #ifdef R_VDEC_CHECK_PARAMETERS |
dkato | 0:853f5b7408a7 | 204 | if ((ch != VDEC_CHANNEL_0) && (ch != VDEC_CHANNEL_1)) { |
dkato | 0:853f5b7408a7 | 205 | vdec_error = VDEC_ERR_CHANNEL; /* Channel error */ |
dkato | 0:853f5b7408a7 | 206 | } |
dkato | 0:853f5b7408a7 | 207 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 208 | vdec_error = VDEC_YcSeparationCheckParam(param); |
dkato | 0:853f5b7408a7 | 209 | } |
dkato | 0:853f5b7408a7 | 210 | #endif /* R_VDEC_CHECK_PARAMETERS */ |
dkato | 0:853f5b7408a7 | 211 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 212 | VDEC_YcSeparation(ch, param); |
dkato | 0:853f5b7408a7 | 213 | } |
dkato | 0:853f5b7408a7 | 214 | return vdec_error; |
dkato | 0:853f5b7408a7 | 215 | } /* End of function R_VDEC_YcSeparation() */ |
dkato | 0:853f5b7408a7 | 216 | |
dkato | 0:853f5b7408a7 | 217 | /**************************************************************************//** |
dkato | 0:853f5b7408a7 | 218 | * @brief Chroma decoding processing |
dkato | 0:853f5b7408a7 | 219 | * |
dkato | 0:853f5b7408a7 | 220 | * Description:<br> |
dkato | 0:853f5b7408a7 | 221 | * This function performs the following processing: |
dkato | 0:853f5b7408a7 | 222 | * - Configures the color system detection. |
dkato | 0:853f5b7408a7 | 223 | * - Configures the BCO. |
dkato | 0:853f5b7408a7 | 224 | * - Configures the ACC/color killer. |
dkato | 0:853f5b7408a7 | 225 | * - Configures the TINT correction/R-Y axis correction. |
dkato | 0:853f5b7408a7 | 226 | * @param[in] ch : Channel |
dkato | 0:853f5b7408a7 | 227 | * @param[in] param : Chroma decoding parameter |
dkato | 0:853f5b7408a7 | 228 | * @retval Error code |
dkato | 0:853f5b7408a7 | 229 | *****************************************************************************/ |
dkato | 0:853f5b7408a7 | 230 | vdec_error_t R_VDEC_ChromaDecoding (const vdec_channel_t ch, const vdec_chroma_decoding_t * const param) |
dkato | 0:853f5b7408a7 | 231 | { |
dkato | 0:853f5b7408a7 | 232 | vdec_error_t vdec_error; |
dkato | 0:853f5b7408a7 | 233 | |
dkato | 0:853f5b7408a7 | 234 | vdec_error = VDEC_OK; |
dkato | 0:853f5b7408a7 | 235 | #ifdef R_VDEC_CHECK_PARAMETERS |
dkato | 0:853f5b7408a7 | 236 | if ((ch != VDEC_CHANNEL_0) && (ch != VDEC_CHANNEL_1)) { |
dkato | 0:853f5b7408a7 | 237 | vdec_error = VDEC_ERR_CHANNEL; /* Channel error */ |
dkato | 0:853f5b7408a7 | 238 | } |
dkato | 0:853f5b7408a7 | 239 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 240 | vdec_error = VDEC_ChromaDecodingCheckParam(param); |
dkato | 0:853f5b7408a7 | 241 | } |
dkato | 0:853f5b7408a7 | 242 | #endif /* R_VDEC_CHECK_PARAMETERS */ |
dkato | 0:853f5b7408a7 | 243 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 244 | VDEC_ChromaDecoding(ch, param); |
dkato | 0:853f5b7408a7 | 245 | } |
dkato | 0:853f5b7408a7 | 246 | return vdec_error; |
dkato | 0:853f5b7408a7 | 247 | } /* End of function R_VDEC_ChromaDecoding() */ |
dkato | 0:853f5b7408a7 | 248 | |
dkato | 0:853f5b7408a7 | 249 | /**************************************************************************//** |
dkato | 0:853f5b7408a7 | 250 | * @brief Digital clamp processing |
dkato | 0:853f5b7408a7 | 251 | * |
dkato | 0:853f5b7408a7 | 252 | * Description:<br> |
dkato | 0:853f5b7408a7 | 253 | * This function performs the following processing: |
dkato | 0:853f5b7408a7 | 254 | * - Configures the digital clamp control. |
dkato | 0:853f5b7408a7 | 255 | * - Configures the center clamp. |
dkato | 0:853f5b7408a7 | 256 | * - Configures the pedestal clamp. |
dkato | 0:853f5b7408a7 | 257 | * - Configures the noise detection control. |
dkato | 0:853f5b7408a7 | 258 | * @param[in] ch : Channel |
dkato | 0:853f5b7408a7 | 259 | * @param[in] param : Digital clamp parameter |
dkato | 0:853f5b7408a7 | 260 | * @retval Error code |
dkato | 0:853f5b7408a7 | 261 | *****************************************************************************/ |
dkato | 0:853f5b7408a7 | 262 | vdec_error_t R_VDEC_DigitalClamp (const vdec_channel_t ch, const vdec_degital_clamp_t * const param) |
dkato | 0:853f5b7408a7 | 263 | { |
dkato | 0:853f5b7408a7 | 264 | vdec_error_t vdec_error; |
dkato | 0:853f5b7408a7 | 265 | |
dkato | 0:853f5b7408a7 | 266 | vdec_error = VDEC_OK; |
dkato | 0:853f5b7408a7 | 267 | #ifdef R_VDEC_CHECK_PARAMETERS |
dkato | 0:853f5b7408a7 | 268 | if ((ch != VDEC_CHANNEL_0) && (ch != VDEC_CHANNEL_1)) { |
dkato | 0:853f5b7408a7 | 269 | vdec_error = VDEC_ERR_CHANNEL; /* Channel error */ |
dkato | 0:853f5b7408a7 | 270 | } |
dkato | 0:853f5b7408a7 | 271 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 272 | vdec_error = VDEC_DigitalClampCheckParam(param); |
dkato | 0:853f5b7408a7 | 273 | } |
dkato | 0:853f5b7408a7 | 274 | #endif /* R_VDEC_CHECK_PARAMETERS */ |
dkato | 0:853f5b7408a7 | 275 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 276 | VDEC_DigitalClamp(ch, param); |
dkato | 0:853f5b7408a7 | 277 | } |
dkato | 0:853f5b7408a7 | 278 | return vdec_error; |
dkato | 0:853f5b7408a7 | 279 | } /* End of function R_VDEC_DigitalClamp() */ |
dkato | 0:853f5b7408a7 | 280 | |
dkato | 0:853f5b7408a7 | 281 | /**************************************************************************//** |
dkato | 0:853f5b7408a7 | 282 | * @brief Output adjustment processing |
dkato | 0:853f5b7408a7 | 283 | * |
dkato | 0:853f5b7408a7 | 284 | * Description:<br> |
dkato | 0:853f5b7408a7 | 285 | * This function makes settings for output adjustment. |
dkato | 0:853f5b7408a7 | 286 | * @param[in] ch : Channel |
dkato | 0:853f5b7408a7 | 287 | * @param[in] param : Output adjustment parameter |
dkato | 0:853f5b7408a7 | 288 | * @retval Error code |
dkato | 0:853f5b7408a7 | 289 | *****************************************************************************/ |
dkato | 0:853f5b7408a7 | 290 | vdec_error_t R_VDEC_Output (const vdec_channel_t ch, const vdec_output_t * const param) |
dkato | 0:853f5b7408a7 | 291 | { |
dkato | 0:853f5b7408a7 | 292 | vdec_error_t vdec_error; |
dkato | 0:853f5b7408a7 | 293 | |
dkato | 0:853f5b7408a7 | 294 | vdec_error = VDEC_OK; |
dkato | 0:853f5b7408a7 | 295 | #ifdef R_VDEC_CHECK_PARAMETERS |
dkato | 0:853f5b7408a7 | 296 | if ((ch != VDEC_CHANNEL_0) && (ch != VDEC_CHANNEL_1)) { |
dkato | 0:853f5b7408a7 | 297 | vdec_error = VDEC_ERR_CHANNEL; /* Channel error */ |
dkato | 0:853f5b7408a7 | 298 | } |
dkato | 0:853f5b7408a7 | 299 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 300 | vdec_error = VDEC_OutputCheckParam(param); |
dkato | 0:853f5b7408a7 | 301 | } |
dkato | 0:853f5b7408a7 | 302 | #endif /* R_VDEC_CHECK_PARAMETERS */ |
dkato | 0:853f5b7408a7 | 303 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 304 | VDEC_Output(ch, param); |
dkato | 0:853f5b7408a7 | 305 | } |
dkato | 0:853f5b7408a7 | 306 | return vdec_error; |
dkato | 0:853f5b7408a7 | 307 | } /* End of function R_VDEC_Output() */ |
dkato | 0:853f5b7408a7 | 308 | |
dkato | 0:853f5b7408a7 | 309 | /**************************************************************************//** |
dkato | 0:853f5b7408a7 | 310 | * @brief VDEC information acquisition processing |
dkato | 0:853f5b7408a7 | 311 | * |
dkato | 0:853f5b7408a7 | 312 | * Description:<br> |
dkato | 0:853f5b7408a7 | 313 | * This gets the parameters of the VDEC modules. The parameters that can be obtained are listed below. |
dkato | 0:853f5b7408a7 | 314 | * - Sync separation parameters |
dkato | 0:853f5b7408a7 | 315 | * - AGC parameters |
dkato | 0:853f5b7408a7 | 316 | * - Chroma decoding parameters |
dkato | 0:853f5b7408a7 | 317 | * - Digital clamp parameters |
dkato | 0:853f5b7408a7 | 318 | * @param[in] ch : Channel |
dkato | 0:853f5b7408a7 | 319 | * @param[out] q_sync_sep : Pointer to the place where the sync separation parameters are stored. |
dkato | 0:853f5b7408a7 | 320 | * @param[out] q_agc : Pointer to the place where the AGC parameters are stored. |
dkato | 0:853f5b7408a7 | 321 | * @param[out] q_chroma_dec : Pointer to the place where the chroma decoding parameters are stored. |
dkato | 0:853f5b7408a7 | 322 | * @param[out] q_digital_clamp : Pointer to the place where the digital clamp parameters are stored. |
dkato | 0:853f5b7408a7 | 323 | * @retval Error code |
dkato | 0:853f5b7408a7 | 324 | *****************************************************************************/ |
dkato | 0:853f5b7408a7 | 325 | vdec_error_t R_VDEC_Query ( |
dkato | 0:853f5b7408a7 | 326 | const vdec_channel_t ch, |
dkato | 0:853f5b7408a7 | 327 | vdec_q_sync_sep_t * const q_sync_sep, |
dkato | 0:853f5b7408a7 | 328 | vdec_q_agc_t * const q_agc, |
dkato | 0:853f5b7408a7 | 329 | vdec_q_chroma_dec_t * const q_chroma_dec, |
dkato | 0:853f5b7408a7 | 330 | vdec_q_digital_clamp_t * const q_digital_clamp) |
dkato | 0:853f5b7408a7 | 331 | { |
dkato | 0:853f5b7408a7 | 332 | vdec_error_t vdec_error; |
dkato | 0:853f5b7408a7 | 333 | |
dkato | 0:853f5b7408a7 | 334 | vdec_error = VDEC_OK; |
dkato | 0:853f5b7408a7 | 335 | #ifdef R_VDEC_CHECK_PARAMETERS |
dkato | 0:853f5b7408a7 | 336 | if ((ch != VDEC_CHANNEL_0) && (ch != VDEC_CHANNEL_1)) { |
dkato | 0:853f5b7408a7 | 337 | vdec_error = VDEC_ERR_CHANNEL; /* Channel error */ |
dkato | 0:853f5b7408a7 | 338 | } |
dkato | 0:853f5b7408a7 | 339 | #endif /* R_VDEC_CHECK_PARAMETERS */ |
dkato | 0:853f5b7408a7 | 340 | if (vdec_error == VDEC_OK) { |
dkato | 0:853f5b7408a7 | 341 | VDEC_Query(ch, q_sync_sep, q_agc, q_chroma_dec, q_digital_clamp); |
dkato | 0:853f5b7408a7 | 342 | } |
dkato | 0:853f5b7408a7 | 343 | return vdec_error; |
dkato | 0:853f5b7408a7 | 344 | } /* End of function R_VDEC_Query() */ |
dkato | 0:853f5b7408a7 | 345 |