| OLD | NEW |
| 1 /* | 1 /* |
| 2 * audio encoder psychoacoustic model | 2 * audio encoder psychoacoustic model |
| 3 * Copyright (C) 2008 Konstantin Shishkov | 3 * Copyright (C) 2008 Konstantin Shishkov |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void* model_priv_data; ///< psychoacoustic model implementation p
rivate data | 65 void* model_priv_data; ///< psychoacoustic model implementation p
rivate data |
| 66 } FFPsyContext; | 66 } FFPsyContext; |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * codec-specific psychoacoustic model implementation | 69 * codec-specific psychoacoustic model implementation |
| 70 */ | 70 */ |
| 71 typedef struct FFPsyModel { | 71 typedef struct FFPsyModel { |
| 72 const char *name; | 72 const char *name; |
| 73 int (*init) (FFPsyContext *apc); | 73 int (*init) (FFPsyContext *apc); |
| 74 FFPsyWindowInfo (*window)(FFPsyContext *ctx, const int16_t *audio, const int
16_t *la, int channel, int prev_type); | 74 FFPsyWindowInfo (*window)(FFPsyContext *ctx, const int16_t *audio, const int
16_t *la, int channel, int prev_type); |
| 75 void (*analyze)(FFPsyContext *ctx, int channel, const float *coeffs, FFPsyWi
ndowInfo *wi); | 75 void (*analyze)(FFPsyContext *ctx, int channel, const float *coeffs, const F
FPsyWindowInfo *wi); |
| 76 void (*end) (FFPsyContext *apc); | 76 void (*end) (FFPsyContext *apc); |
| 77 } FFPsyModel; | 77 } FFPsyModel; |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * Initialize psychoacoustic model. | 80 * Initialize psychoacoustic model. |
| 81 * | 81 * |
| 82 * @param ctx model context | 82 * @param ctx model context |
| 83 * @param avctx codec context | 83 * @param avctx codec context |
| 84 * @param num_lens number of possible frame lengths | 84 * @param num_lens number of possible frame lengths |
| 85 * @param bands scalefactor band lengths for all frame lengths | 85 * @param bands scalefactor band lengths for all frame lengths |
| (...skipping 23 matching lines...) Expand all Loading... |
| 109 | 109 |
| 110 /** | 110 /** |
| 111 * Perform psychoacoustic analysis and set band info (threshold, energy). | 111 * Perform psychoacoustic analysis and set band info (threshold, energy). |
| 112 * | 112 * |
| 113 * @param ctx model context | 113 * @param ctx model context |
| 114 * @param channel audio channel number | 114 * @param channel audio channel number |
| 115 * @param coeffs pointer to the transformed coefficients | 115 * @param coeffs pointer to the transformed coefficients |
| 116 * @param wi window information | 116 * @param wi window information |
| 117 */ | 117 */ |
| 118 void ff_psy_set_band_info(FFPsyContext *ctx, int channel, const float *coeffs, | 118 void ff_psy_set_band_info(FFPsyContext *ctx, int channel, const float *coeffs, |
| 119 FFPsyWindowInfo *wi); | 119 const FFPsyWindowInfo *wi); |
| 120 | 120 |
| 121 /** | 121 /** |
| 122 * Cleanup model context at the end. | 122 * Cleanup model context at the end. |
| 123 * | 123 * |
| 124 * @param ctx model context | 124 * @param ctx model context |
| 125 */ | 125 */ |
| 126 av_cold void ff_psy_end(FFPsyContext *ctx); | 126 av_cold void ff_psy_end(FFPsyContext *ctx); |
| 127 | 127 |
| 128 | 128 |
| 129 /************************************************************************** | 129 /************************************************************************** |
| (...skipping 19 matching lines...) Expand all Loading... |
| 149 void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, | 149 void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, |
| 150 const int16_t *audio, int16_t *dest, | 150 const int16_t *audio, int16_t *dest, |
| 151 int tag, int channels); | 151 int tag, int channels); |
| 152 | 152 |
| 153 /** | 153 /** |
| 154 * Cleanup audio preprocessing module. | 154 * Cleanup audio preprocessing module. |
| 155 */ | 155 */ |
| 156 av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx); | 156 av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx); |
| 157 | 157 |
| 158 #endif /* AVCODEC_PSYMODEL_H */ | 158 #endif /* AVCODEC_PSYMODEL_H */ |
| OLD | NEW |