| 1 | /* -*- mode: C; mode: fold -*- */cxx . . $ `<file>/external/lame/set_get.c`/ |
| 2 | /* |
| 3 | * set/get functions for lame_global_flags |
| 4 | * |
| 5 | * Copyright (c) 2001-2005 Alexander Leidinger |
| 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Library General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Library General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Library General Public |
| 18 | * License along with this library; if not, write to the |
| 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 20 | * Boston, MA 02111-1307, USA. |
| 21 | */ |
| 22 | |
| 23 | /* $Id: set_get.c,v 1.104 2017/09/06 15:07:30 robert Exp $ */ |
| 24 | |
| 25 | //#ifdef HAVE_CONFIG_H |
| 26 | #include "lame__config.h"cxx . . $ `<file>/external/lame/lame__config.h`/ |
| 27 | //#endif |
| 28 | |
| 29 | #include "lame.h"cxx . . $ `<file>/external/lame/lame.h`/ |
| 30 | #include "machine.h"cxx . . $ `<file>/external/lame/machine.h`/ |
| 31 | #include "encoder.h"cxx . . $ `<file>/external/lame/encoder.h`/ |
| 32 | #include "util.h"cxx . . $ `<file>/external/lame/util.h`/ |
| 33 | #include "bitstream.h"cxx . . $ `<file>/external/lame/bitstream.h`/ /* because of compute_flushbits */ |
| 34 | |
| 35 | #include "set_get.h"cxx . . $ `<file>/external/lame/set_get.h`/ |
| 36 | #include "lame_global_flags.h"cxx . . $ `<file>/external/lame/lame_global_flags.h`/ |
| 37 | |
| 38 | /* |
| 39 | * input stream description |
| 40 | */ |
| 41 | |
| 42 | |
| 43 | /* number of samples */ |
| 44 | /* it's unlikely for this function to return an error */ |
| 45 | int |
| 46 | lame_set_num_samplescxx . . $ lame_set_num_samples(e07c05463b4dfa97).(lame_global_flagscxx . . $ lame_global_flags# * gfp, unsigned long num_samples) |
| 47 | { |
| 48 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 49 | /* default = 2^32-1 */ |
| 50 | gfp->num_samplescxx . . $ lame_global_struct#num_samples. = num_samples; |
| 51 | return 0; |
| 52 | } |
| 53 | return -1; |
| 54 | } |
| 55 | |
| 56 | unsigned long |
| 57 | lame_get_num_samplescxx . . $ lame_get_num_samples(b69cde88739cfe76).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 58 | { |
| 59 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 60 | return gfp->num_samplescxx . . $ lame_global_struct#num_samples.; |
| 61 | } |
| 62 | return 0; |
| 63 | } |
| 64 | |
| 65 | |
| 66 | /* input samplerate */ |
| 67 | int |
| 68 | lame_set_in_sampleratecxx . . $ lame_set_in_samplerate(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int in_samplerate) |
| 69 | { |
| 70 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 71 | if (in_samplerate < 1) |
| 72 | return -1; |
| 73 | /* input sample rate in Hz, default = 44100 Hz */ |
| 74 | gfp->samplerate_incxx . . $ lame_global_struct#samplerate_in. = in_samplerate; |
| 75 | return 0; |
| 76 | } |
| 77 | return -1; |
| 78 | } |
| 79 | |
| 80 | int |
| 81 | lame_get_in_sampleratecxx . . $ lame_get_in_samplerate(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 82 | { |
| 83 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 84 | return gfp->samplerate_incxx . . $ lame_global_struct#samplerate_in.; |
| 85 | } |
| 86 | return 0; |
| 87 | } |
| 88 | |
| 89 | |
| 90 | /* number of channels in input stream */ |
| 91 | int |
| 92 | lame_set_num_channelscxx . . $ lame_set_num_channels(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int num_channels) |
| 93 | { |
| 94 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 95 | /* default = 2 */ |
| 96 | if (2 < num_channels || 0 >= num_channels) { |
| 97 | return -1; /* we don't support more than 2 channels */ |
| 98 | } |
| 99 | gfp->num_channelscxx . . $ lame_global_struct#num_channels. = num_channels; |
| 100 | return 0; |
| 101 | } |
| 102 | return -1; |
| 103 | } |
| 104 | |
| 105 | int |
| 106 | lame_get_num_channelscxx . . $ lame_get_num_channels(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 107 | { |
| 108 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 109 | return gfp->num_channelscxx . . $ lame_global_struct#num_channels.; |
| 110 | } |
| 111 | return 0; |
| 112 | } |
| 113 | |
| 114 | |
| 115 | /* scale the input by this amount before encoding (not used for decoding) */ |
| 116 | int |
| 117 | lame_set_scalecxx . . $ lame_set_scale(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float scale) |
| 118 | { |
| 119 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 120 | /* default = 1 */ |
| 121 | gfp->scalecxx . . $ lame_global_struct#scale. = scale; |
| 122 | return 0; |
| 123 | } |
| 124 | return -1; |
| 125 | } |
| 126 | |
| 127 | float |
| 128 | lame_get_scalecxx . . $ lame_get_scale(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 129 | { |
| 130 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 131 | return gfp->scalecxx . . $ lame_global_struct#scale.; |
| 132 | } |
| 133 | return 0; |
| 134 | } |
| 135 | |
| 136 | |
| 137 | /* scale the channel 0 (left) input by this amount before |
| 138 | encoding (not used for decoding) */ |
| 139 | int |
| 140 | lame_set_scale_leftcxx . . $ lame_set_scale_left(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float scale) |
| 141 | { |
| 142 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 143 | /* default = 1 */ |
| 144 | gfp->scale_leftcxx . . $ lame_global_struct#scale_left. = scale; |
| 145 | return 0; |
| 146 | } |
| 147 | return -1; |
| 148 | } |
| 149 | |
| 150 | float |
| 151 | lame_get_scale_leftcxx . . $ lame_get_scale_left(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 152 | { |
| 153 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 154 | return gfp->scale_leftcxx . . $ lame_global_struct#scale_left.; |
| 155 | } |
| 156 | return 0; |
| 157 | } |
| 158 | |
| 159 | |
| 160 | /* scale the channel 1 (right) input by this amount before |
| 161 | encoding (not used for decoding) */ |
| 162 | int |
| 163 | lame_set_scale_rightcxx . . $ lame_set_scale_right(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float scale) |
| 164 | { |
| 165 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 166 | /* default = 1 */ |
| 167 | gfp->scale_rightcxx . . $ lame_global_struct#scale_right. = scale; |
| 168 | return 0; |
| 169 | } |
| 170 | return -1; |
| 171 | } |
| 172 | |
| 173 | float |
| 174 | lame_get_scale_rightcxx . . $ lame_get_scale_right(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 175 | { |
| 176 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 177 | return gfp->scale_rightcxx . . $ lame_global_struct#scale_right.; |
| 178 | } |
| 179 | return 0; |
| 180 | } |
| 181 | |
| 182 | |
| 183 | /* output sample rate in Hz */ |
| 184 | int |
| 185 | lame_set_out_sampleratecxx . . $ lame_set_out_samplerate(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int out_samplerate) |
| 186 | { |
| 187 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 188 | /* |
| 189 | * default = 0: LAME picks best value based on the amount |
| 190 | * of compression |
| 191 | * MPEG only allows: |
| 192 | * MPEG1 32, 44.1, 48khz |
| 193 | * MPEG2 16, 22.05, 24 |
| 194 | * MPEG2.5 8, 11.025, 12 |
| 195 | * |
| 196 | * (not used by decoding routines) |
| 197 | */ |
| 198 | if (out_samplerate != 0) { |
| 199 | int v=0; |
| 200 | if (SmpFrqIndexcxx . . $ SmpFrqIndex(ac48f4a6ffa9e770).(out_samplerate, &v) < 0) |
| 201 | return -1; |
| 202 | } |
| 203 | gfp->samplerate_outcxx . . $ lame_global_struct#samplerate_out. = out_samplerate; |
| 204 | return 0; |
| 205 | } |
| 206 | return -1; |
| 207 | } |
| 208 | |
| 209 | int |
| 210 | lame_get_out_sampleratecxx . . $ lame_get_out_samplerate(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 211 | { |
| 212 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 213 | return gfp->samplerate_outcxx . . $ lame_global_struct#samplerate_out.; |
| 214 | } |
| 215 | return 0; |
| 216 | } |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | /* |
| 222 | * general control parameters |
| 223 | */ |
| 224 | |
| 225 | /* collect data for an MP3 frame analzyer */ |
| 226 | int |
| 227 | lame_set_analysiscxx . . $ lame_set_analysis(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int analysis) |
| 228 | { |
| 229 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 230 | /* default = 0 */ |
| 231 | |
| 232 | /* enforce disable/enable meaning, if we need more than two values |
| 233 | we need to switch to an enum to have an apropriate representation |
| 234 | of the possible meanings of the value */ |
| 235 | if (0 > analysis || 1 < analysis) |
| 236 | return -1; |
| 237 | gfp->analysiscxx . . $ lame_global_struct#analysis. = analysis; |
| 238 | return 0; |
| 239 | } |
| 240 | return -1; |
| 241 | } |
| 242 | |
| 243 | int |
| 244 | lame_get_analysiscxx . . $ lame_get_analysis(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 245 | { |
| 246 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 247 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->analysis && 1 >= gfp->analysis); |
| 248 | return gfp->analysiscxx . . $ lame_global_struct#analysis.; |
| 249 | } |
| 250 | return 0; |
| 251 | } |
| 252 | |
| 253 | |
| 254 | /* write a Xing VBR header frame */ |
| 255 | int |
| 256 | lame_set_bWriteVbrTagcxx . . $ lame_set_bWriteVbrTag(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int bWriteVbrTag) |
| 257 | { |
| 258 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 259 | /* default = 1 (on) for VBR/ABR modes, 0 (off) for CBR mode */ |
| 260 | |
| 261 | /* enforce disable/enable meaning, if we need more than two values |
| 262 | we need to switch to an enum to have an apropriate representation |
| 263 | of the possible meanings of the value */ |
| 264 | if (0 > bWriteVbrTag || 1 < bWriteVbrTag) |
| 265 | return -1; |
| 266 | gfp->write_lame_tagcxx . . $ lame_global_struct#write_lame_tag. = bWriteVbrTag; |
| 267 | return 0; |
| 268 | } |
| 269 | return -1; |
| 270 | } |
| 271 | |
| 272 | int |
| 273 | lame_get_bWriteVbrTagcxx . . $ lame_get_bWriteVbrTag(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 274 | { |
| 275 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 276 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->write_lame_tag && 1 >= gfp->write_lame_tag); |
| 277 | return gfp->write_lame_tagcxx . . $ lame_global_struct#write_lame_tag.; |
| 278 | } |
| 279 | return 0; |
| 280 | } |
| 281 | |
| 282 | |
| 283 | |
| 284 | /* decode only, use lame/mpglib to convert mp3 to wav */ |
| 285 | int |
| 286 | lame_set_decode_onlycxx . . $ lame_set_decode_only(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int decode_only) |
| 287 | { |
| 288 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 289 | /* default = 0 (disabled) */ |
| 290 | |
| 291 | /* enforce disable/enable meaning, if we need more than two values |
| 292 | we need to switch to an enum to have an apropriate representation |
| 293 | of the possible meanings of the value */ |
| 294 | if (0 > decode_only || 1 < decode_only) |
| 295 | return -1; |
| 296 | gfp->decode_onlycxx . . $ lame_global_struct#decode_only. = decode_only; |
| 297 | return 0; |
| 298 | } |
| 299 | return -1; |
| 300 | } |
| 301 | |
| 302 | int |
| 303 | lame_get_decode_onlycxx . . $ lame_get_decode_only(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 304 | { |
| 305 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 306 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->decode_only && 1 >= gfp->decode_only); |
| 307 | return gfp->decode_onlycxx . . $ lame_global_struct#decode_only.; |
| 308 | } |
| 309 | return 0; |
| 310 | } |
| 311 | |
| 312 | |
| 313 | #if DEPRECATED_OR_OBSOLETE_CODE_REMOVEDcxx . . $ `external/lame/lame.h:49:9`! |
| 314 | /* 1=encode a Vorbis .ogg file. default=0 */ |
| 315 | /* DEPRECATED */ |
| 316 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_set_oggcxx . . $ lame_set_ogg(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# *, int); |
| 317 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_get_oggcxx . . $ lame_get_ogg(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# *); |
| 318 | #else |
| 319 | #endif |
| 320 | |
| 321 | /* encode a Vorbis .ogg file */ |
| 322 | /* DEPRECATED */ |
| 323 | int |
| 324 | lame_set_oggcxx . . $ lame_set_ogg(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int ogg) |
| 325 | { |
| 326 | (void) gfp; |
| 327 | (void) ogg; |
| 328 | return -1; |
| 329 | } |
| 330 | |
| 331 | int |
| 332 | lame_get_oggcxx . . $ lame_get_ogg(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 333 | { |
| 334 | (void) gfp; |
| 335 | return 0; |
| 336 | } |
| 337 | |
| 338 | |
| 339 | /* |
| 340 | * Internal algorithm selection. |
| 341 | * True quality is determined by the bitrate but this variable will effect |
| 342 | * quality by selecting expensive or cheap algorithms. |
| 343 | * quality=0..9. 0=best (very slow). 9=worst. |
| 344 | * recommended: 3 near-best quality, not too slow |
| 345 | * 5 good quality, fast |
| 346 | * 7 ok quality, really fast |
| 347 | */ |
| 348 | int |
| 349 | lame_set_qualitycxx . . $ lame_set_quality(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int quality) |
| 350 | { |
| 351 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 352 | if (quality < 0) { |
| 353 | gfp->qualitycxx . . $ lame_global_struct#quality. = 0; |
| 354 | } |
| 355 | else if (quality > 9) { |
| 356 | gfp->qualitycxx . . $ lame_global_struct#quality. = 9; |
| 357 | } |
| 358 | else { |
| 359 | gfp->qualitycxx . . $ lame_global_struct#quality. = quality; |
| 360 | } |
| 361 | return 0; |
| 362 | } |
| 363 | return -1; |
| 364 | } |
| 365 | |
| 366 | int |
| 367 | lame_get_qualitycxx . . $ lame_get_quality(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 368 | { |
| 369 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 370 | return gfp->qualitycxx . . $ lame_global_struct#quality.; |
| 371 | } |
| 372 | return 0; |
| 373 | } |
| 374 | |
| 375 | |
| 376 | /* mode = STEREO, JOINT_STEREO, DUAL_CHANNEL (not supported), MONO */ |
| 377 | int |
| 378 | lame_set_modecxx . . $ lame_set_mode(230f783671acd547).(lame_global_flagscxx . . $ lame_global_flags# * gfp, MPEG_modecxx . . $ MPEG_mode# mode) |
| 379 | { |
| 380 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 381 | int mpg_mode = mode; |
| 382 | /* default: lame chooses based on compression ratio and input channels */ |
| 383 | if (mpg_mode < 0 || MAX_INDICATORcxx . . $ MAX_INDICATOR. <= mpg_mode) |
| 384 | return -1; /* Unknown MPEG mode! */ |
| 385 | gfp->modecxx . . $ lame_global_struct#mode. = mode; |
| 386 | return 0; |
| 387 | } |
| 388 | return -1; |
| 389 | } |
| 390 | |
| 391 | MPEG_modecxx . . $ MPEG_mode# |
| 392 | lame_get_modecxx . . $ lame_get_mode(2c8fa46fdecf762).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 393 | { |
| 394 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 395 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(gfp->mode < MAX_INDICATOR); |
| 396 | return gfp->modecxx . . $ lame_global_struct#mode.; |
| 397 | } |
| 398 | return NOT_SETcxx . . $ NOT_SET.; |
| 399 | } |
| 400 | |
| 401 | |
| 402 | #if DEPRECATED_OR_OBSOLETE_CODE_REMOVEDcxx . . $ `external/lame/lame.h:49:9`! |
| 403 | /* |
| 404 | mode_automs. Use a M/S mode with a switching threshold based on |
| 405 | compression ratio |
| 406 | DEPRECATED |
| 407 | */ |
| 408 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_set_mode_automscxx . . $ lame_set_mode_automs(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# *, int); |
| 409 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_get_mode_automscxx . . $ lame_get_mode_automs(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# *); |
| 410 | #else |
| 411 | #endif |
| 412 | |
| 413 | /* Us a M/S mode with a switching threshold based on compression ratio */ |
| 414 | /* DEPRECATED */ |
| 415 | int |
| 416 | lame_set_mode_automscxx . . $ lame_set_mode_automs(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int mode_automs) |
| 417 | { |
| 418 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 419 | /* default = 0 (disabled) */ |
| 420 | |
| 421 | /* enforce disable/enable meaning, if we need more than two values |
| 422 | we need to switch to an enum to have an apropriate representation |
| 423 | of the possible meanings of the value */ |
| 424 | if (0 > mode_automs || 1 < mode_automs) |
| 425 | return -1; |
| 426 | lame_set_modecxx . . $ lame_set_mode(230f783671acd547).(gfp, JOINT_STEREOcxx . . $ JOINT_STEREO.); |
| 427 | return 0; |
| 428 | } |
| 429 | return -1; |
| 430 | } |
| 431 | |
| 432 | int |
| 433 | lame_get_mode_automscxx . . $ lame_get_mode_automs(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 434 | { |
| 435 | (void) gfp; |
| 436 | return 1; |
| 437 | } |
| 438 | |
| 439 | |
| 440 | /* |
| 441 | * Force M/S for all frames. For testing only. |
| 442 | * Requires mode = 1. |
| 443 | */ |
| 444 | int |
| 445 | lame_set_force_mscxx . . $ lame_set_force_ms(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int force_ms) |
| 446 | { |
| 447 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 448 | /* default = 0 (disabled) */ |
| 449 | |
| 450 | /* enforce disable/enable meaning, if we need more than two values |
| 451 | we need to switch to an enum to have an apropriate representation |
| 452 | of the possible meanings of the value */ |
| 453 | if (0 > force_ms || 1 < force_ms) |
| 454 | return -1; |
| 455 | gfp->force_mscxx . . $ lame_global_struct#force_ms. = force_ms; |
| 456 | return 0; |
| 457 | } |
| 458 | return -1; |
| 459 | } |
| 460 | |
| 461 | int |
| 462 | lame_get_force_mscxx . . $ lame_get_force_ms(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 463 | { |
| 464 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 465 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->force_ms && 1 >= gfp->force_ms); |
| 466 | return gfp->force_mscxx . . $ lame_global_struct#force_ms.; |
| 467 | } |
| 468 | return 0; |
| 469 | } |
| 470 | |
| 471 | |
| 472 | /* Use free_format. */ |
| 473 | int |
| 474 | lame_set_free_formatcxx . . $ lame_set_free_format(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int free_format) |
| 475 | { |
| 476 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 477 | /* default = 0 (disabled) */ |
| 478 | |
| 479 | /* enforce disable/enable meaning, if we need more than two values |
| 480 | we need to switch to an enum to have an apropriate representation |
| 481 | of the possible meanings of the value */ |
| 482 | if (0 > free_format || 1 < free_format) |
| 483 | return -1; |
| 484 | gfp->free_formatcxx . . $ lame_global_struct#free_format. = free_format; |
| 485 | return 0; |
| 486 | } |
| 487 | return -1; |
| 488 | } |
| 489 | |
| 490 | int |
| 491 | lame_get_free_formatcxx . . $ lame_get_free_format(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 492 | { |
| 493 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 494 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->free_format && 1 >= gfp->free_format); |
| 495 | return gfp->free_formatcxx . . $ lame_global_struct#free_format.; |
| 496 | } |
| 497 | return 0; |
| 498 | } |
| 499 | |
| 500 | |
| 501 | |
| 502 | /* Perform ReplayGain analysis */ |
| 503 | int |
| 504 | lame_set_findReplayGaincxx . . $ lame_set_findReplayGain(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int findReplayGain) |
| 505 | { |
| 506 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 507 | /* default = 0 (disabled) */ |
| 508 | |
| 509 | /* enforce disable/enable meaning, if we need more than two values |
| 510 | we need to switch to an enum to have an apropriate representation |
| 511 | of the possible meanings of the value */ |
| 512 | if (0 > findReplayGain || 1 < findReplayGain) |
| 513 | return -1; |
| 514 | gfp->findReplayGaincxx . . $ lame_global_struct#findReplayGain. = findReplayGain; |
| 515 | return 0; |
| 516 | } |
| 517 | return -1; |
| 518 | } |
| 519 | |
| 520 | int |
| 521 | lame_get_findReplayGaincxx . . $ lame_get_findReplayGain(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 522 | { |
| 523 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 524 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->findReplayGain && 1 >= gfp->findReplayGain); |
| 525 | return gfp->findReplayGaincxx . . $ lame_global_struct#findReplayGain.; |
| 526 | } |
| 527 | return 0; |
| 528 | } |
| 529 | |
| 530 | |
| 531 | /* Decode on the fly. Find the peak sample. If ReplayGain analysis is |
| 532 | enabled then perform it on the decoded data. */ |
| 533 | int |
| 534 | lame_set_decode_on_the_flycxx . . $ lame_set_decode_on_the_fly(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int decode_on_the_fly) |
| 535 | { |
| 536 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 537 | #ifndef DECODE_ON_THE_FLY |
| 538 | return -1; |
| 539 | #else |
| 540 | /* default = 0 (disabled) */ |
| 541 | |
| 542 | /* enforce disable/enable meaning, if we need more than two values |
| 543 | we need to switch to an enum to have an apropriate representation |
| 544 | of the possible meanings of the value */ |
| 545 | if (0 > decode_on_the_fly || 1 < decode_on_the_fly) |
| 546 | return -1; |
| 547 | |
| 548 | gfp->decode_on_the_fly = decode_on_the_fly; |
| 549 | |
| 550 | return 0; |
| 551 | #endif |
| 552 | } |
| 553 | return -1; |
| 554 | } |
| 555 | |
| 556 | int |
| 557 | lame_get_decode_on_the_flycxx . . $ lame_get_decode_on_the_fly(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 558 | { |
| 559 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 560 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->decode_on_the_fly && 1 >= gfp->decode_on_the_fly); |
| 561 | return gfp->decode_on_the_flycxx . . $ lame_global_struct#decode_on_the_fly.; |
| 562 | } |
| 563 | return 0; |
| 564 | } |
| 565 | |
| 566 | #if DEPRECATED_OR_OBSOLETE_CODE_REMOVEDcxx . . $ `external/lame/lame.h:49:9`! |
| 567 | /* DEPRECATED: now does the same as lame_set_findReplayGain() |
| 568 | default = 0 (disabled) */ |
| 569 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_set_ReplayGain_inputcxx . . $ lame_set_ReplayGain_input(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# *, int); |
| 570 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_get_ReplayGain_inputcxx . . $ lame_get_ReplayGain_input(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# *); |
| 571 | |
| 572 | /* DEPRECATED: now does the same as |
| 573 | lame_set_decode_on_the_fly() && lame_set_findReplayGain() |
| 574 | default = 0 (disabled) */ |
| 575 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_set_ReplayGain_decodecxx . . $ lame_set_ReplayGain_decode(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# *, int); |
| 576 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_get_ReplayGain_decodecxx . . $ lame_get_ReplayGain_decode(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# *); |
| 577 | |
| 578 | /* DEPRECATED: now does the same as lame_set_decode_on_the_fly() |
| 579 | default = 0 (disabled) */ |
| 580 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_set_findPeakSamplecxx . . $ lame_set_findPeakSample(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# *, int); |
| 581 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_get_findPeakSamplecxx . . $ lame_get_findPeakSample(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# *); |
| 582 | #else |
| 583 | #endif |
| 584 | |
| 585 | /* DEPRECATED. same as lame_set_decode_on_the_fly() */ |
| 586 | int |
| 587 | lame_set_findPeakSamplecxx . . $ lame_set_findPeakSample(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int arg) |
| 588 | { |
| 589 | return lame_set_decode_on_the_flycxx . . $ lame_set_decode_on_the_fly(3f7580c1167cd249).(gfp, arg); |
| 590 | } |
| 591 | |
| 592 | int |
| 593 | lame_get_findPeakSamplecxx . . $ lame_get_findPeakSample(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 594 | { |
| 595 | return lame_get_decode_on_the_flycxx . . $ lame_get_decode_on_the_fly(a5abb0ff158568ac).(gfp); |
| 596 | } |
| 597 | |
| 598 | /* DEPRECATED. same as lame_set_findReplayGain() */ |
| 599 | int |
| 600 | lame_set_ReplayGain_inputcxx . . $ lame_set_ReplayGain_input(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int arg) |
| 601 | { |
| 602 | return lame_set_findReplayGaincxx . . $ lame_set_findReplayGain(3f7580c1167cd249).(gfp, arg); |
| 603 | } |
| 604 | |
| 605 | int |
| 606 | lame_get_ReplayGain_inputcxx . . $ lame_get_ReplayGain_input(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 607 | { |
| 608 | return lame_get_findReplayGaincxx . . $ lame_get_findReplayGain(a5abb0ff158568ac).(gfp); |
| 609 | } |
| 610 | |
| 611 | /* DEPRECATED. same as lame_set_decode_on_the_fly() && |
| 612 | lame_set_findReplayGain() */ |
| 613 | int |
| 614 | lame_set_ReplayGain_decodecxx . . $ lame_set_ReplayGain_decode(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int arg) |
| 615 | { |
| 616 | if (lame_set_decode_on_the_flycxx . . $ lame_set_decode_on_the_fly(3f7580c1167cd249).(gfp, arg) < 0 || lame_set_findReplayGaincxx . . $ lame_set_findReplayGain(3f7580c1167cd249).(gfp, arg) < 0) |
| 617 | return -1; |
| 618 | else |
| 619 | return 0; |
| 620 | } |
| 621 | |
| 622 | int |
| 623 | lame_get_ReplayGain_decodecxx . . $ lame_get_ReplayGain_decode(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 624 | { |
| 625 | if (lame_get_decode_on_the_flycxx . . $ lame_get_decode_on_the_fly(a5abb0ff158568ac).(gfp) > 0 && lame_get_findReplayGaincxx . . $ lame_get_findReplayGain(a5abb0ff158568ac).(gfp) > 0) |
| 626 | return 1; |
| 627 | else |
| 628 | return 0; |
| 629 | } |
| 630 | |
| 631 | |
| 632 | /* set and get some gapless encoding flags */ |
| 633 | |
| 634 | int |
| 635 | lame_set_nogap_totalcxx . . $ lame_set_nogap_total(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int the_nogap_total) |
| 636 | { |
| 637 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 638 | gfp->nogap_totalcxx . . $ lame_global_struct#nogap_total. = the_nogap_total; |
| 639 | return 0; |
| 640 | } |
| 641 | return -1; |
| 642 | } |
| 643 | |
| 644 | int |
| 645 | lame_get_nogap_totalcxx . . $ lame_get_nogap_total(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 646 | { |
| 647 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 648 | return gfp->nogap_totalcxx . . $ lame_global_struct#nogap_total.; |
| 649 | } |
| 650 | return 0; |
| 651 | } |
| 652 | |
| 653 | int |
| 654 | lame_set_nogap_currentindexcxx . . $ lame_set_nogap_currentindex(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int the_nogap_index) |
| 655 | { |
| 656 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 657 | gfp->nogap_currentcxx . . $ lame_global_struct#nogap_current. = the_nogap_index; |
| 658 | return 0; |
| 659 | } |
| 660 | return -1; |
| 661 | } |
| 662 | |
| 663 | int |
| 664 | lame_get_nogap_currentindexcxx . . $ lame_get_nogap_currentindex(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 665 | { |
| 666 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 667 | return gfp->nogap_currentcxx . . $ lame_global_struct#nogap_current.; |
| 668 | } |
| 669 | return 0; |
| 670 | } |
| 671 | |
| 672 | |
| 673 | /* message handlers */ |
| 674 | int |
| 675 | lame_set_errorfcxx . . $ lame_set_errorf(91afad8a1f27b639).(lame_global_flagscxx . . $ lame_global_flags# * gfp, void (*func) (const char *, va_listcxx . . $ va_list#)) |
| 676 | { |
| 677 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 678 | gfp->reportcxx . . $ lame_global_struct#report..errorfcxx . . $ lame_global_struct#$anonymous_type_0#errorf. = func; |
| 679 | return 0; |
| 680 | } |
| 681 | return -1; |
| 682 | } |
| 683 | |
| 684 | int |
| 685 | lame_set_debugfcxx . . $ lame_set_debugf(91afad8a1f27b639).(lame_global_flagscxx . . $ lame_global_flags# * gfp, void (*func) (const char *, va_listcxx . . $ va_list#)) |
| 686 | { |
| 687 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 688 | gfp->reportcxx . . $ lame_global_struct#report..debugfcxx . . $ lame_global_struct#$anonymous_type_0#debugf. = func; |
| 689 | return 0; |
| 690 | } |
| 691 | return -1; |
| 692 | } |
| 693 | |
| 694 | int |
| 695 | lame_set_msgfcxx . . $ lame_set_msgf(91afad8a1f27b639).(lame_global_flagscxx . . $ lame_global_flags# * gfp, void (*func) (const char *, va_listcxx . . $ va_list#)) |
| 696 | { |
| 697 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 698 | gfp->reportcxx . . $ lame_global_struct#report..msgfcxx . . $ lame_global_struct#$anonymous_type_0#msgf. = func; |
| 699 | return 0; |
| 700 | } |
| 701 | return -1; |
| 702 | } |
| 703 | |
| 704 | |
| 705 | /* |
| 706 | * Set one of |
| 707 | * - brate |
| 708 | * - compression ratio. |
| 709 | * |
| 710 | * Default is compression ratio of 11. |
| 711 | */ |
| 712 | int |
| 713 | lame_set_bratecxx . . $ lame_set_brate(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int brate) |
| 714 | { |
| 715 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 716 | gfp->bratecxx . . $ lame_global_struct#brate. = brate; |
| 717 | if (brate > 320) { |
| 718 | gfp->disable_reservoircxx . . $ lame_global_struct#disable_reservoir. = 1; |
| 719 | } |
| 720 | return 0; |
| 721 | } |
| 722 | return -1; |
| 723 | } |
| 724 | |
| 725 | int |
| 726 | lame_get_bratecxx . . $ lame_get_brate(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 727 | { |
| 728 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 729 | return gfp->bratecxx . . $ lame_global_struct#brate.; |
| 730 | } |
| 731 | return 0; |
| 732 | } |
| 733 | |
| 734 | int |
| 735 | lame_set_compression_ratiocxx . . $ lame_set_compression_ratio(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float compression_ratio) |
| 736 | { |
| 737 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 738 | gfp->compression_ratiocxx . . $ lame_global_struct#compression_ratio. = compression_ratio; |
| 739 | return 0; |
| 740 | } |
| 741 | return -1; |
| 742 | } |
| 743 | |
| 744 | float |
| 745 | lame_get_compression_ratiocxx . . $ lame_get_compression_ratio(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 746 | { |
| 747 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 748 | return gfp->compression_ratiocxx . . $ lame_global_struct#compression_ratio.; |
| 749 | } |
| 750 | return 0; |
| 751 | } |
| 752 | |
| 753 | |
| 754 | |
| 755 | |
| 756 | /* |
| 757 | * frame parameters |
| 758 | */ |
| 759 | |
| 760 | /* Mark as copyright protected. */ |
| 761 | int |
| 762 | lame_set_copyrightcxx . . $ lame_set_copyright(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int copyright) |
| 763 | { |
| 764 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 765 | /* default = 0 (disabled) */ |
| 766 | |
| 767 | /* enforce disable/enable meaning, if we need more than two values |
| 768 | we need to switch to an enum to have an apropriate representation |
| 769 | of the possible meanings of the value */ |
| 770 | if (0 > copyright || 1 < copyright) |
| 771 | return -1; |
| 772 | gfp->copyrightcxx . . $ lame_global_struct#copyright. = copyright; |
| 773 | return 0; |
| 774 | } |
| 775 | return -1; |
| 776 | } |
| 777 | |
| 778 | int |
| 779 | lame_get_copyrightcxx . . $ lame_get_copyright(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 780 | { |
| 781 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 782 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->copyright && 1 >= gfp->copyright); |
| 783 | return gfp->copyrightcxx . . $ lame_global_struct#copyright.; |
| 784 | } |
| 785 | return 0; |
| 786 | } |
| 787 | |
| 788 | |
| 789 | /* Mark as original. */ |
| 790 | int |
| 791 | lame_set_originalcxx . . $ lame_set_original(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int original) |
| 792 | { |
| 793 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 794 | /* default = 1 (enabled) */ |
| 795 | |
| 796 | /* enforce disable/enable meaning, if we need more than two values |
| 797 | we need to switch to an enum to have an apropriate representation |
| 798 | of the possible meanings of the value */ |
| 799 | if (0 > original || 1 < original) |
| 800 | return -1; |
| 801 | gfp->originalcxx . . $ lame_global_struct#original. = original; |
| 802 | return 0; |
| 803 | } |
| 804 | return -1; |
| 805 | } |
| 806 | |
| 807 | int |
| 808 | lame_get_originalcxx . . $ lame_get_original(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 809 | { |
| 810 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 811 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->original && 1 >= gfp->original); |
| 812 | return gfp->originalcxx . . $ lame_global_struct#original.; |
| 813 | } |
| 814 | return 0; |
| 815 | } |
| 816 | |
| 817 | |
| 818 | /* |
| 819 | * error_protection. |
| 820 | * Use 2 bytes from each frame for CRC checksum. |
| 821 | */ |
| 822 | int |
| 823 | lame_set_error_protectioncxx . . $ lame_set_error_protection(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int error_protection) |
| 824 | { |
| 825 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 826 | /* default = 0 (disabled) */ |
| 827 | |
| 828 | /* enforce disable/enable meaning, if we need more than two values |
| 829 | we need to switch to an enum to have an apropriate representation |
| 830 | of the possible meanings of the value */ |
| 831 | if (0 > error_protection || 1 < error_protection) |
| 832 | return -1; |
| 833 | gfp->error_protectioncxx . . $ lame_global_struct#error_protection. = error_protection; |
| 834 | return 0; |
| 835 | } |
| 836 | return -1; |
| 837 | } |
| 838 | |
| 839 | int |
| 840 | lame_get_error_protectioncxx . . $ lame_get_error_protection(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 841 | { |
| 842 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 843 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->error_protection && 1 >= gfp->error_protection); |
| 844 | return gfp->error_protectioncxx . . $ lame_global_struct#error_protection.; |
| 845 | } |
| 846 | return 0; |
| 847 | } |
| 848 | |
| 849 | |
| 850 | #if DEPRECATED_OR_OBSOLETE_CODE_REMOVEDcxx . . $ `external/lame/lame.h:49:9`! |
| 851 | /* padding_type. 0=pad no frames 1=pad all frames 2=adjust padding(default) */ |
| 852 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_set_padding_typecxx . . $ lame_set_padding_type(dd6fedb4dc7c598b).(lame_global_flagscxx . . $ lame_global_flags# *, Padding_typecxx . . $ Padding_type#); |
| 853 | Padding_typecxx . . $ Padding_type# CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_get_padding_typecxx . . $ lame_get_padding_type(bdb9e051c6da178).(const lame_global_flagscxx . . $ lame_global_flags# *); |
| 854 | #else |
| 855 | #endif |
| 856 | |
| 857 | /* |
| 858 | * padding_type. |
| 859 | * PAD_NO = pad no frames |
| 860 | * PAD_ALL = pad all frames |
| 861 | * PAD_ADJUST = adjust padding |
| 862 | */ |
| 863 | int |
| 864 | lame_set_padding_typecxx . . $ lame_set_padding_type(dd6fedb4dc7c598b).(lame_global_flagscxx . . $ lame_global_flags# * gfp, Padding_typecxx . . $ Padding_type# padding_type) |
| 865 | { |
| 866 | (void) gfp; |
| 867 | (void) padding_type; |
| 868 | return 0; |
| 869 | } |
| 870 | |
| 871 | Padding_typecxx . . $ Padding_type# |
| 872 | lame_get_padding_typecxx . . $ lame_get_padding_type(bdb9e051c6da178).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 873 | { |
| 874 | (void) gfp; |
| 875 | return PAD_ADJUSTcxx . . $ PAD_ADJUST.; |
| 876 | } |
| 877 | |
| 878 | |
| 879 | /* MP3 'private extension' bit. Meaningless. */ |
| 880 | int |
| 881 | lame_set_extensioncxx . . $ lame_set_extension(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int extension) |
| 882 | { |
| 883 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 884 | /* default = 0 (disabled) */ |
| 885 | /* enforce disable/enable meaning, if we need more than two values |
| 886 | we need to switch to an enum to have an apropriate representation |
| 887 | of the possible meanings of the value */ |
| 888 | if (0 > extension || 1 < extension) |
| 889 | return -1; |
| 890 | gfp->extensioncxx . . $ lame_global_struct#extension. = extension; |
| 891 | return 0; |
| 892 | } |
| 893 | return -1; |
| 894 | } |
| 895 | |
| 896 | int |
| 897 | lame_get_extensioncxx . . $ lame_get_extension(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 898 | { |
| 899 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 900 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->extension && 1 >= gfp->extension); |
| 901 | return gfp->extensioncxx . . $ lame_global_struct#extension.; |
| 902 | } |
| 903 | return 0; |
| 904 | } |
| 905 | |
| 906 | |
| 907 | /* Enforce strict ISO compliance. */ |
| 908 | int |
| 909 | lame_set_strict_ISOcxx . . $ lame_set_strict_ISO(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int val) |
| 910 | { |
| 911 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 912 | /* default = 0 (disabled) */ |
| 913 | /* enforce disable/enable meaning, if we need more than two values |
| 914 | we need to switch to an enum to have an apropriate representation |
| 915 | of the possible meanings of the value */ |
| 916 | if (val < MDB_DEFAULTcxx . . $ MDB_DEFAULT. || MDB_MAXIMUMcxx . . $ MDB_MAXIMUM. < val) |
| 917 | return -1; |
| 918 | gfp->strict_ISOcxx . . $ lame_global_struct#strict_ISO. = val; |
| 919 | return 0; |
| 920 | } |
| 921 | return -1; |
| 922 | } |
| 923 | |
| 924 | int |
| 925 | lame_get_strict_ISOcxx . . $ lame_get_strict_ISO(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 926 | { |
| 927 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 928 | return gfp->strict_ISOcxx . . $ lame_global_struct#strict_ISO.; |
| 929 | } |
| 930 | return 0; |
| 931 | } |
| 932 | |
| 933 | |
| 934 | |
| 935 | |
| 936 | /******************************************************************** |
| 937 | * quantization/noise shaping |
| 938 | ***********************************************************************/ |
| 939 | |
| 940 | /* Disable the bit reservoir. For testing only. */ |
| 941 | int |
| 942 | lame_set_disable_reservoircxx . . $ lame_set_disable_reservoir(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int disable_reservoir) |
| 943 | { |
| 944 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 945 | /* default = 0 (disabled) */ |
| 946 | |
| 947 | /* enforce disable/enable meaning, if we need more than two values |
| 948 | we need to switch to an enum to have an apropriate representation |
| 949 | of the possible meanings of the value */ |
| 950 | if (0 > disable_reservoir || 1 < disable_reservoir) |
| 951 | return -1; |
| 952 | gfp->disable_reservoircxx . . $ lame_global_struct#disable_reservoir. = disable_reservoir; |
| 953 | return 0; |
| 954 | } |
| 955 | return -1; |
| 956 | } |
| 957 | |
| 958 | int |
| 959 | lame_get_disable_reservoircxx . . $ lame_get_disable_reservoir(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 960 | { |
| 961 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 962 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->disable_reservoir && 1 >= gfp->disable_reservoir); |
| 963 | return gfp->disable_reservoircxx . . $ lame_global_struct#disable_reservoir.; |
| 964 | } |
| 965 | return 0; |
| 966 | } |
| 967 | |
| 968 | |
| 969 | |
| 970 | |
| 971 | int |
| 972 | lame_set_experimentalXcxx . . $ lame_set_experimentalX(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int experimentalX) |
| 973 | { |
| 974 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 975 | lame_set_quant_compcxx . . $ lame_set_quant_comp(3f7580c1167cd249).(gfp, experimentalX); |
| 976 | lame_set_quant_comp_shortcxx . . $ lame_set_quant_comp_short(3f7580c1167cd249).(gfp, experimentalX); |
| 977 | return 0; |
| 978 | } |
| 979 | return -1; |
| 980 | } |
| 981 | |
| 982 | int |
| 983 | lame_get_experimentalXcxx . . $ lame_get_experimentalX(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 984 | { |
| 985 | return lame_get_quant_compcxx . . $ lame_get_quant_comp(a5abb0ff158568ac).(gfp); |
| 986 | } |
| 987 | |
| 988 | |
| 989 | /* Select a different "best quantization" function. default = 0 */ |
| 990 | int |
| 991 | lame_set_quant_compcxx . . $ lame_set_quant_comp(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int quant_type) |
| 992 | { |
| 993 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 994 | gfp->quant_compcxx . . $ lame_global_struct#quant_comp. = quant_type; |
| 995 | return 0; |
| 996 | } |
| 997 | return -1; |
| 998 | } |
| 999 | |
| 1000 | int |
| 1001 | lame_get_quant_compcxx . . $ lame_get_quant_comp(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1002 | { |
| 1003 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1004 | return gfp->quant_compcxx . . $ lame_global_struct#quant_comp.; |
| 1005 | } |
| 1006 | return 0; |
| 1007 | } |
| 1008 | |
| 1009 | |
| 1010 | /* Select a different "best quantization" function. default = 0 */ |
| 1011 | int |
| 1012 | lame_set_quant_comp_shortcxx . . $ lame_set_quant_comp_short(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int quant_type) |
| 1013 | { |
| 1014 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1015 | gfp->quant_comp_shortcxx . . $ lame_global_struct#quant_comp_short. = quant_type; |
| 1016 | return 0; |
| 1017 | } |
| 1018 | return -1; |
| 1019 | } |
| 1020 | |
| 1021 | int |
| 1022 | lame_get_quant_comp_shortcxx . . $ lame_get_quant_comp_short(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1023 | { |
| 1024 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1025 | return gfp->quant_comp_shortcxx . . $ lame_global_struct#quant_comp_short.; |
| 1026 | } |
| 1027 | return 0; |
| 1028 | } |
| 1029 | |
| 1030 | |
| 1031 | /* Another experimental option. For testing only. */ |
| 1032 | int |
| 1033 | lame_set_experimentalYcxx . . $ lame_set_experimentalY(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int experimentalY) |
| 1034 | { |
| 1035 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1036 | gfp->experimentalYcxx . . $ lame_global_struct#experimentalY. = experimentalY; |
| 1037 | return 0; |
| 1038 | } |
| 1039 | return -1; |
| 1040 | } |
| 1041 | |
| 1042 | int |
| 1043 | lame_get_experimentalYcxx . . $ lame_get_experimentalY(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1044 | { |
| 1045 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1046 | return gfp->experimentalYcxx . . $ lame_global_struct#experimentalY.; |
| 1047 | } |
| 1048 | return 0; |
| 1049 | } |
| 1050 | |
| 1051 | |
| 1052 | int |
| 1053 | lame_set_experimentalZcxx . . $ lame_set_experimentalZ(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int experimentalZ) |
| 1054 | { |
| 1055 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1056 | gfp->experimentalZcxx . . $ lame_global_struct#experimentalZ. = experimentalZ; |
| 1057 | return 0; |
| 1058 | } |
| 1059 | return -1; |
| 1060 | } |
| 1061 | |
| 1062 | int |
| 1063 | lame_get_experimentalZcxx . . $ lame_get_experimentalZ(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1064 | { |
| 1065 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1066 | return gfp->experimentalZcxx . . $ lame_global_struct#experimentalZ.; |
| 1067 | } |
| 1068 | return 0; |
| 1069 | } |
| 1070 | |
| 1071 | |
| 1072 | /* Naoki's psycho acoustic model. */ |
| 1073 | int |
| 1074 | lame_set_exp_nspsytunecxx . . $ lame_set_exp_nspsytune(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int exp_nspsytune) |
| 1075 | { |
| 1076 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1077 | /* default = 0 (disabled) */ |
| 1078 | gfp->exp_nspsytunecxx . . $ lame_global_struct#exp_nspsytune. = exp_nspsytune; |
| 1079 | return 0; |
| 1080 | } |
| 1081 | return -1; |
| 1082 | } |
| 1083 | |
| 1084 | int |
| 1085 | lame_get_exp_nspsytunecxx . . $ lame_get_exp_nspsytune(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1086 | { |
| 1087 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1088 | return gfp->exp_nspsytunecxx . . $ lame_global_struct#exp_nspsytune.; |
| 1089 | } |
| 1090 | return 0; |
| 1091 | } |
| 1092 | |
| 1093 | |
| 1094 | |
| 1095 | |
| 1096 | /******************************************************************** |
| 1097 | * VBR control |
| 1098 | ***********************************************************************/ |
| 1099 | |
| 1100 | /* Types of VBR. default = vbr_off = CBR */ |
| 1101 | int |
| 1102 | lame_set_VBRcxx . . $ lame_set_VBR(5ed231f02a8fafe1).(lame_global_flagscxx . . $ lame_global_flags# * gfp, vbr_modecxx . . $ vbr_mode# VBR) |
| 1103 | { |
| 1104 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1105 | int vbr_q = VBR; |
| 1106 | if (0 > vbr_q || vbr_max_indicatorcxx . . $ vbr_max_indicator. <= vbr_q) |
| 1107 | return -1; /* Unknown VBR mode! */ |
| 1108 | gfp->VBRcxx . . $ lame_global_struct#VBR. = VBR; |
| 1109 | return 0; |
| 1110 | } |
| 1111 | return -1; |
| 1112 | } |
| 1113 | |
| 1114 | vbr_modecxx . . $ vbr_mode# |
| 1115 | lame_get_VBRcxx . . $ lame_get_VBR(7e8299508d2c9a58).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1116 | { |
| 1117 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1118 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(gfp->VBR < vbr_max_indicator); |
| 1119 | return gfp->VBRcxx . . $ lame_global_struct#VBR.; |
| 1120 | } |
| 1121 | return vbr_offcxx . . $ vbr_off.; |
| 1122 | } |
| 1123 | |
| 1124 | |
| 1125 | /* |
| 1126 | * VBR quality level. |
| 1127 | * 0 = highest |
| 1128 | * 9 = lowest |
| 1129 | */ |
| 1130 | int |
| 1131 | lame_set_VBR_qcxx . . $ lame_set_VBR_q(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int VBR_q) |
| 1132 | { |
| 1133 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1134 | int ret = 0; |
| 1135 | |
| 1136 | if (0 > VBR_q) { |
| 1137 | ret = -1; /* Unknown VBR quality level! */ |
| 1138 | VBR_q = 0; |
| 1139 | } |
| 1140 | if (9 < VBR_q) { |
| 1141 | ret = -1; |
| 1142 | VBR_q = 9; |
| 1143 | } |
| 1144 | gfp->VBR_qcxx . . $ lame_global_struct#VBR_q. = VBR_q; |
| 1145 | gfp->VBR_q_fraccxx . . $ lame_global_struct#VBR_q_frac. = 0; |
| 1146 | return ret; |
| 1147 | } |
| 1148 | return -1; |
| 1149 | } |
| 1150 | |
| 1151 | int |
| 1152 | lame_get_VBR_qcxx . . $ lame_get_VBR_q(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1153 | { |
| 1154 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1155 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->VBR_q && 10 > gfp->VBR_q); |
| 1156 | return gfp->VBR_qcxx . . $ lame_global_struct#VBR_q.; |
| 1157 | } |
| 1158 | return 0; |
| 1159 | } |
| 1160 | |
| 1161 | int |
| 1162 | lame_set_VBR_qualitycxx . . $ lame_set_VBR_quality(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float VBR_q) |
| 1163 | { |
| 1164 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1165 | int ret = 0; |
| 1166 | |
| 1167 | if (0 > VBR_q) { |
| 1168 | ret = -1; /* Unknown VBR quality level! */ |
| 1169 | VBR_q = 0; |
| 1170 | } |
| 1171 | if (9.999 < VBR_q) { |
| 1172 | ret = -1; |
| 1173 | VBR_q = 9.999; |
| 1174 | } |
| 1175 | |
| 1176 | gfp->VBR_qcxx . . $ lame_global_struct#VBR_q. = (int) VBR_q; |
| 1177 | gfp->VBR_q_fraccxx . . $ lame_global_struct#VBR_q_frac. = VBR_q - gfp->VBR_qcxx . . $ lame_global_struct#VBR_q.; |
| 1178 | |
| 1179 | return ret; |
| 1180 | } |
| 1181 | return -1; |
| 1182 | } |
| 1183 | |
| 1184 | float |
| 1185 | lame_get_VBR_qualitycxx . . $ lame_get_VBR_quality(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1186 | { |
| 1187 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1188 | return gfp->VBR_qcxx . . $ lame_global_struct#VBR_q. + gfp->VBR_q_fraccxx . . $ lame_global_struct#VBR_q_frac.; |
| 1189 | } |
| 1190 | return 0; |
| 1191 | } |
| 1192 | |
| 1193 | |
| 1194 | /* Ignored except for VBR = vbr_abr (ABR mode) */ |
| 1195 | int |
| 1196 | lame_set_VBR_mean_bitrate_kbpscxx . . $ lame_set_VBR_mean_bitrate_kbps(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int VBR_mean_bitrate_kbps) |
| 1197 | { |
| 1198 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1199 | gfp->VBR_mean_bitrate_kbpscxx . . $ lame_global_struct#VBR_mean_bitrate_kbps. = VBR_mean_bitrate_kbps; |
| 1200 | return 0; |
| 1201 | } |
| 1202 | return -1; |
| 1203 | } |
| 1204 | |
| 1205 | int |
| 1206 | lame_get_VBR_mean_bitrate_kbpscxx . . $ lame_get_VBR_mean_bitrate_kbps(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1207 | { |
| 1208 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1209 | return gfp->VBR_mean_bitrate_kbpscxx . . $ lame_global_struct#VBR_mean_bitrate_kbps.; |
| 1210 | } |
| 1211 | return 0; |
| 1212 | } |
| 1213 | |
| 1214 | int |
| 1215 | lame_set_VBR_min_bitrate_kbpscxx . . $ lame_set_VBR_min_bitrate_kbps(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int VBR_min_bitrate_kbps) |
| 1216 | { |
| 1217 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1218 | gfp->VBR_min_bitrate_kbpscxx . . $ lame_global_struct#VBR_min_bitrate_kbps. = VBR_min_bitrate_kbps; |
| 1219 | return 0; |
| 1220 | } |
| 1221 | return -1; |
| 1222 | } |
| 1223 | |
| 1224 | int |
| 1225 | lame_get_VBR_min_bitrate_kbpscxx . . $ lame_get_VBR_min_bitrate_kbps(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1226 | { |
| 1227 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1228 | return gfp->VBR_min_bitrate_kbpscxx . . $ lame_global_struct#VBR_min_bitrate_kbps.; |
| 1229 | } |
| 1230 | return 0; |
| 1231 | } |
| 1232 | |
| 1233 | int |
| 1234 | lame_set_VBR_max_bitrate_kbpscxx . . $ lame_set_VBR_max_bitrate_kbps(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int VBR_max_bitrate_kbps) |
| 1235 | { |
| 1236 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1237 | gfp->VBR_max_bitrate_kbpscxx . . $ lame_global_struct#VBR_max_bitrate_kbps. = VBR_max_bitrate_kbps; |
| 1238 | return 0; |
| 1239 | } |
| 1240 | return -1; |
| 1241 | } |
| 1242 | |
| 1243 | int |
| 1244 | lame_get_VBR_max_bitrate_kbpscxx . . $ lame_get_VBR_max_bitrate_kbps(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1245 | { |
| 1246 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1247 | return gfp->VBR_max_bitrate_kbpscxx . . $ lame_global_struct#VBR_max_bitrate_kbps.; |
| 1248 | } |
| 1249 | return 0; |
| 1250 | } |
| 1251 | |
| 1252 | |
| 1253 | /* |
| 1254 | * Strictly enforce VBR_min_bitrate. |
| 1255 | * Normally it will be violated for analog silence. |
| 1256 | */ |
| 1257 | int |
| 1258 | lame_set_VBR_hard_mincxx . . $ lame_set_VBR_hard_min(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int VBR_hard_min) |
| 1259 | { |
| 1260 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1261 | /* default = 0 (disabled) */ |
| 1262 | |
| 1263 | /* enforce disable/enable meaning, if we need more than two values |
| 1264 | we need to switch to an enum to have an apropriate representation |
| 1265 | of the possible meanings of the value */ |
| 1266 | if (0 > VBR_hard_min || 1 < VBR_hard_min) |
| 1267 | return -1; |
| 1268 | |
| 1269 | gfp->VBR_hard_mincxx . . $ lame_global_struct#VBR_hard_min. = VBR_hard_min; |
| 1270 | |
| 1271 | return 0; |
| 1272 | } |
| 1273 | return -1; |
| 1274 | } |
| 1275 | |
| 1276 | int |
| 1277 | lame_get_VBR_hard_mincxx . . $ lame_get_VBR_hard_min(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1278 | { |
| 1279 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1280 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->VBR_hard_min && 1 >= gfp->VBR_hard_min); |
| 1281 | return gfp->VBR_hard_mincxx . . $ lame_global_struct#VBR_hard_min.; |
| 1282 | } |
| 1283 | return 0; |
| 1284 | } |
| 1285 | |
| 1286 | |
| 1287 | /******************************************************************** |
| 1288 | * Filtering control |
| 1289 | ***********************************************************************/ |
| 1290 | |
| 1291 | /* |
| 1292 | * Freqency in Hz to apply lowpass. |
| 1293 | * 0 = default = lame chooses |
| 1294 | * -1 = disabled |
| 1295 | */ |
| 1296 | int |
| 1297 | lame_set_lowpassfreqcxx . . $ lame_set_lowpassfreq(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int lowpassfreq) |
| 1298 | { |
| 1299 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1300 | gfp->lowpassfreqcxx . . $ lame_global_struct#lowpassfreq. = lowpassfreq; |
| 1301 | return 0; |
| 1302 | } |
| 1303 | return -1; |
| 1304 | } |
| 1305 | |
| 1306 | int |
| 1307 | lame_get_lowpassfreqcxx . . $ lame_get_lowpassfreq(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1308 | { |
| 1309 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1310 | return gfp->lowpassfreqcxx . . $ lame_global_struct#lowpassfreq.; |
| 1311 | } |
| 1312 | return 0; |
| 1313 | } |
| 1314 | |
| 1315 | |
| 1316 | /* |
| 1317 | * Width of transition band (in Hz). |
| 1318 | * default = one polyphase filter band |
| 1319 | */ |
| 1320 | int |
| 1321 | lame_set_lowpasswidthcxx . . $ lame_set_lowpasswidth(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int lowpasswidth) |
| 1322 | { |
| 1323 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1324 | gfp->lowpasswidthcxx . . $ lame_global_struct#lowpasswidth. = lowpasswidth; |
| 1325 | return 0; |
| 1326 | } |
| 1327 | return -1; |
| 1328 | } |
| 1329 | |
| 1330 | int |
| 1331 | lame_get_lowpasswidthcxx . . $ lame_get_lowpasswidth(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1332 | { |
| 1333 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1334 | return gfp->lowpasswidthcxx . . $ lame_global_struct#lowpasswidth.; |
| 1335 | } |
| 1336 | return 0; |
| 1337 | } |
| 1338 | |
| 1339 | |
| 1340 | /* |
| 1341 | * Frequency in Hz to apply highpass. |
| 1342 | * 0 = default = lame chooses |
| 1343 | * -1 = disabled |
| 1344 | */ |
| 1345 | int |
| 1346 | lame_set_highpassfreqcxx . . $ lame_set_highpassfreq(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int highpassfreq) |
| 1347 | { |
| 1348 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1349 | gfp->highpassfreqcxx . . $ lame_global_struct#highpassfreq. = highpassfreq; |
| 1350 | return 0; |
| 1351 | } |
| 1352 | return -1; |
| 1353 | } |
| 1354 | |
| 1355 | int |
| 1356 | lame_get_highpassfreqcxx . . $ lame_get_highpassfreq(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1357 | { |
| 1358 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1359 | return gfp->highpassfreqcxx . . $ lame_global_struct#highpassfreq.; |
| 1360 | } |
| 1361 | return 0; |
| 1362 | } |
| 1363 | |
| 1364 | |
| 1365 | /* |
| 1366 | * Width of transition band (in Hz). |
| 1367 | * default = one polyphase filter band |
| 1368 | */ |
| 1369 | int |
| 1370 | lame_set_highpasswidthcxx . . $ lame_set_highpasswidth(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int highpasswidth) |
| 1371 | { |
| 1372 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1373 | gfp->highpasswidthcxx . . $ lame_global_struct#highpasswidth. = highpasswidth; |
| 1374 | return 0; |
| 1375 | } |
| 1376 | return -1; |
| 1377 | } |
| 1378 | |
| 1379 | int |
| 1380 | lame_get_highpasswidthcxx . . $ lame_get_highpasswidth(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1381 | { |
| 1382 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1383 | return gfp->highpasswidthcxx . . $ lame_global_struct#highpasswidth.; |
| 1384 | } |
| 1385 | return 0; |
| 1386 | } |
| 1387 | |
| 1388 | |
| 1389 | |
| 1390 | |
| 1391 | /* |
| 1392 | * psycho acoustics and other arguments which you should not change |
| 1393 | * unless you know what you are doing |
| 1394 | */ |
| 1395 | |
| 1396 | |
| 1397 | /* Adjust masking values. */ |
| 1398 | int |
| 1399 | lame_set_maskingadjustcxx . . $ lame_set_maskingadjust(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float adjust) |
| 1400 | { |
| 1401 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1402 | gfp->maskingadjustcxx . . $ lame_global_struct#maskingadjust. = adjust; |
| 1403 | return 0; |
| 1404 | } |
| 1405 | return -1; |
| 1406 | } |
| 1407 | |
| 1408 | float |
| 1409 | lame_get_maskingadjustcxx . . $ lame_get_maskingadjust(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1410 | { |
| 1411 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1412 | return gfp->maskingadjustcxx . . $ lame_global_struct#maskingadjust.; |
| 1413 | } |
| 1414 | return 0; |
| 1415 | } |
| 1416 | |
| 1417 | int |
| 1418 | lame_set_maskingadjust_shortcxx . . $ lame_set_maskingadjust_short(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float adjust) |
| 1419 | { |
| 1420 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1421 | gfp->maskingadjust_shortcxx . . $ lame_global_struct#maskingadjust_short. = adjust; |
| 1422 | return 0; |
| 1423 | } |
| 1424 | return -1; |
| 1425 | } |
| 1426 | |
| 1427 | float |
| 1428 | lame_get_maskingadjust_shortcxx . . $ lame_get_maskingadjust_short(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1429 | { |
| 1430 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1431 | return gfp->maskingadjust_shortcxx . . $ lame_global_struct#maskingadjust_short.; |
| 1432 | } |
| 1433 | return 0; |
| 1434 | } |
| 1435 | |
| 1436 | /* Only use ATH for masking. */ |
| 1437 | int |
| 1438 | lame_set_ATHonlycxx . . $ lame_set_ATHonly(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int ATHonly) |
| 1439 | { |
| 1440 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1441 | gfp->ATHonlycxx . . $ lame_global_struct#ATHonly. = ATHonly; |
| 1442 | return 0; |
| 1443 | } |
| 1444 | return -1; |
| 1445 | } |
| 1446 | |
| 1447 | int |
| 1448 | lame_get_ATHonlycxx . . $ lame_get_ATHonly(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1449 | { |
| 1450 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1451 | return gfp->ATHonlycxx . . $ lame_global_struct#ATHonly.; |
| 1452 | } |
| 1453 | return 0; |
| 1454 | } |
| 1455 | |
| 1456 | |
| 1457 | /* Only use ATH for short blocks. */ |
| 1458 | int |
| 1459 | lame_set_ATHshortcxx . . $ lame_set_ATHshort(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int ATHshort) |
| 1460 | { |
| 1461 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1462 | gfp->ATHshortcxx . . $ lame_global_struct#ATHshort. = ATHshort; |
| 1463 | return 0; |
| 1464 | } |
| 1465 | return -1; |
| 1466 | } |
| 1467 | |
| 1468 | int |
| 1469 | lame_get_ATHshortcxx . . $ lame_get_ATHshort(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1470 | { |
| 1471 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1472 | return gfp->ATHshortcxx . . $ lame_global_struct#ATHshort.; |
| 1473 | } |
| 1474 | return 0; |
| 1475 | } |
| 1476 | |
| 1477 | |
| 1478 | /* Disable ATH. */ |
| 1479 | int |
| 1480 | lame_set_noATHcxx . . $ lame_set_noATH(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int noATH) |
| 1481 | { |
| 1482 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1483 | gfp->noATHcxx . . $ lame_global_struct#noATH. = noATH; |
| 1484 | return 0; |
| 1485 | } |
| 1486 | return -1; |
| 1487 | } |
| 1488 | |
| 1489 | int |
| 1490 | lame_get_noATHcxx . . $ lame_get_noATH(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1491 | { |
| 1492 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1493 | return gfp->noATHcxx . . $ lame_global_struct#noATH.; |
| 1494 | } |
| 1495 | return 0; |
| 1496 | } |
| 1497 | |
| 1498 | |
| 1499 | /* Select ATH formula. */ |
| 1500 | int |
| 1501 | lame_set_ATHtypecxx . . $ lame_set_ATHtype(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int ATHtype) |
| 1502 | { |
| 1503 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1504 | /* XXX: ATHtype should be converted to an enum. */ |
| 1505 | gfp->ATHtypecxx . . $ lame_global_struct#ATHtype. = ATHtype; |
| 1506 | return 0; |
| 1507 | } |
| 1508 | return -1; |
| 1509 | } |
| 1510 | |
| 1511 | int |
| 1512 | lame_get_ATHtypecxx . . $ lame_get_ATHtype(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1513 | { |
| 1514 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1515 | return gfp->ATHtypecxx . . $ lame_global_struct#ATHtype.; |
| 1516 | } |
| 1517 | return 0; |
| 1518 | } |
| 1519 | |
| 1520 | |
| 1521 | /* Select ATH formula 4 shape. */ |
| 1522 | int |
| 1523 | lame_set_ATHcurvecxx . . $ lame_set_ATHcurve(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float ATHcurve) |
| 1524 | { |
| 1525 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1526 | gfp->ATHcurvecxx . . $ lame_global_struct#ATHcurve. = ATHcurve; |
| 1527 | return 0; |
| 1528 | } |
| 1529 | return -1; |
| 1530 | } |
| 1531 | |
| 1532 | float |
| 1533 | lame_get_ATHcurvecxx . . $ lame_get_ATHcurve(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1534 | { |
| 1535 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1536 | return gfp->ATHcurvecxx . . $ lame_global_struct#ATHcurve.; |
| 1537 | } |
| 1538 | return 0; |
| 1539 | } |
| 1540 | |
| 1541 | |
| 1542 | /* Lower ATH by this many db. */ |
| 1543 | int |
| 1544 | lame_set_ATHlowercxx . . $ lame_set_ATHlower(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float ATHlower) |
| 1545 | { |
| 1546 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1547 | gfp->ATH_lower_dbcxx . . $ lame_global_struct#ATH_lower_db. = ATHlower; |
| 1548 | return 0; |
| 1549 | } |
| 1550 | return -1; |
| 1551 | } |
| 1552 | |
| 1553 | float |
| 1554 | lame_get_ATHlowercxx . . $ lame_get_ATHlower(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1555 | { |
| 1556 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1557 | return gfp->ATH_lower_dbcxx . . $ lame_global_struct#ATH_lower_db.; |
| 1558 | } |
| 1559 | return 0; |
| 1560 | } |
| 1561 | |
| 1562 | |
| 1563 | /* Select ATH adaptive adjustment scheme. */ |
| 1564 | int |
| 1565 | lame_set_athaa_typecxx . . $ lame_set_athaa_type(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int athaa_type) |
| 1566 | { |
| 1567 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1568 | gfp->athaa_typecxx . . $ lame_global_struct#athaa_type. = athaa_type; |
| 1569 | return 0; |
| 1570 | } |
| 1571 | return -1; |
| 1572 | } |
| 1573 | |
| 1574 | int |
| 1575 | lame_get_athaa_typecxx . . $ lame_get_athaa_type(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1576 | { |
| 1577 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1578 | return gfp->athaa_typecxx . . $ lame_global_struct#athaa_type.; |
| 1579 | } |
| 1580 | return 0; |
| 1581 | } |
| 1582 | |
| 1583 | |
| 1584 | #if DEPRECATED_OR_OBSOLETE_CODE_REMOVEDcxx . . $ `external/lame/lame.h:49:9`! |
| 1585 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_set_athaa_loudapproxcxx . . $ lame_set_athaa_loudapprox(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int athaa_loudapprox); |
| 1586 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_get_athaa_loudapproxcxx . . $ lame_get_athaa_loudapprox(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp); |
| 1587 | #else |
| 1588 | #endif |
| 1589 | |
| 1590 | /* Select the loudness approximation used by the ATH adaptive auto-leveling. */ |
| 1591 | int |
| 1592 | lame_set_athaa_loudapproxcxx . . $ lame_set_athaa_loudapprox(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int athaa_loudapprox) |
| 1593 | { |
| 1594 | (void) gfp; |
| 1595 | (void) athaa_loudapprox; |
| 1596 | return 0; |
| 1597 | } |
| 1598 | |
| 1599 | int |
| 1600 | lame_get_athaa_loudapproxcxx . . $ lame_get_athaa_loudapprox(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1601 | { |
| 1602 | (void) gfp; |
| 1603 | /* obsolete, the type known under number 2 is the only survival */ |
| 1604 | return 2; |
| 1605 | } |
| 1606 | |
| 1607 | |
| 1608 | /* Adjust (in dB) the point below which adaptive ATH level adjustment occurs. */ |
| 1609 | int |
| 1610 | lame_set_athaa_sensitivitycxx . . $ lame_set_athaa_sensitivity(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float athaa_sensitivity) |
| 1611 | { |
| 1612 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1613 | gfp->athaa_sensitivitycxx . . $ lame_global_struct#athaa_sensitivity. = athaa_sensitivity; |
| 1614 | return 0; |
| 1615 | } |
| 1616 | return -1; |
| 1617 | } |
| 1618 | |
| 1619 | float |
| 1620 | lame_get_athaa_sensitivitycxx . . $ lame_get_athaa_sensitivity(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1621 | { |
| 1622 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1623 | return gfp->athaa_sensitivitycxx . . $ lame_global_struct#athaa_sensitivity.; |
| 1624 | } |
| 1625 | return 0; |
| 1626 | } |
| 1627 | |
| 1628 | |
| 1629 | /* Predictability limit (ISO tonality formula) */ |
| 1630 | int lame_set_cwlimitcxx . . $ lame_set_cwlimit(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int cwlimit); |
| 1631 | int lame_get_cwlimitcxx . . $ lame_get_cwlimit(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp); |
| 1632 | |
| 1633 | int |
| 1634 | lame_set_cwlimitcxx . . $ lame_set_cwlimit(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int cwlimit) |
| 1635 | { |
| 1636 | (void) gfp; |
| 1637 | (void) cwlimit; |
| 1638 | return 0; |
| 1639 | } |
| 1640 | |
| 1641 | int |
| 1642 | lame_get_cwlimitcxx . . $ lame_get_cwlimit(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1643 | { |
| 1644 | (void) gfp; |
| 1645 | return 0; |
| 1646 | } |
| 1647 | |
| 1648 | |
| 1649 | |
| 1650 | /* |
| 1651 | * Allow blocktypes to differ between channels. |
| 1652 | * default: |
| 1653 | * 0 for jstereo => block types coupled |
| 1654 | * 1 for stereo => block types may differ |
| 1655 | */ |
| 1656 | int |
| 1657 | lame_set_allow_diff_shortcxx . . $ lame_set_allow_diff_short(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int allow_diff_short) |
| 1658 | { |
| 1659 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1660 | gfp->short_blockscxx . . $ lame_global_struct#short_blocks. = allow_diff_short ? short_block_allowedcxx . . $ short_block_allowed. : short_block_coupledcxx . . $ short_block_coupled.; |
| 1661 | return 0; |
| 1662 | } |
| 1663 | return -1; |
| 1664 | } |
| 1665 | |
| 1666 | int |
| 1667 | lame_get_allow_diff_shortcxx . . $ lame_get_allow_diff_short(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1668 | { |
| 1669 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1670 | if (gfp->short_blockscxx . . $ lame_global_struct#short_blocks. == short_block_allowedcxx . . $ short_block_allowed.) |
| 1671 | return 1; /* short blocks allowed to differ */ |
| 1672 | else |
| 1673 | return 0; /* not set, dispensed, forced or coupled */ |
| 1674 | } |
| 1675 | return 0; |
| 1676 | } |
| 1677 | |
| 1678 | |
| 1679 | /* Use temporal masking effect */ |
| 1680 | int |
| 1681 | lame_set_useTemporalcxx . . $ lame_set_useTemporal(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int useTemporal) |
| 1682 | { |
| 1683 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1684 | /* default = 1 (enabled) */ |
| 1685 | |
| 1686 | /* enforce disable/enable meaning, if we need more than two values |
| 1687 | we need to switch to an enum to have an apropriate representation |
| 1688 | of the possible meanings of the value */ |
| 1689 | if (0 <= useTemporal && useTemporal <= 1) { |
| 1690 | gfp->useTemporalcxx . . $ lame_global_struct#useTemporal. = useTemporal; |
| 1691 | return 0; |
| 1692 | } |
| 1693 | } |
| 1694 | return -1; |
| 1695 | } |
| 1696 | |
| 1697 | int |
| 1698 | lame_get_useTemporalcxx . . $ lame_get_useTemporal(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1699 | { |
| 1700 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1701 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->useTemporal && 1 >= gfp->useTemporal); |
| 1702 | return gfp->useTemporalcxx . . $ lame_global_struct#useTemporal.; |
| 1703 | } |
| 1704 | return 0; |
| 1705 | } |
| 1706 | |
| 1707 | |
| 1708 | /* Use inter-channel masking effect */ |
| 1709 | int |
| 1710 | lame_set_interChRatiocxx . . $ lame_set_interChRatio(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float ratio) |
| 1711 | { |
| 1712 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1713 | /* default = 0.0 (no inter-channel maskin) */ |
| 1714 | if (0 <= ratio && ratio <= 1.0) { |
| 1715 | gfp->interChRatiocxx . . $ lame_global_struct#interChRatio. = ratio; |
| 1716 | return 0; |
| 1717 | } |
| 1718 | } |
| 1719 | return -1; |
| 1720 | } |
| 1721 | |
| 1722 | float |
| 1723 | lame_get_interChRatiocxx . . $ lame_get_interChRatio(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1724 | { |
| 1725 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1726 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!((0 <= gfp->interChRatio && gfp->interChRatio <= 1.0) || EQcxx . . $ `external/lame/machine.h:169:9`!(gfp->interChRatio, -1)); |
| 1727 | return gfp->interChRatiocxx . . $ lame_global_struct#interChRatio.; |
| 1728 | } |
| 1729 | return 0; |
| 1730 | } |
| 1731 | |
| 1732 | |
| 1733 | /* Use pseudo substep shaping method */ |
| 1734 | int |
| 1735 | lame_set_substepcxx . . $ lame_set_substep(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int method) |
| 1736 | { |
| 1737 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1738 | /* default = 0.0 (no substep noise shaping) */ |
| 1739 | if (0 <= method && method <= 7) { |
| 1740 | gfp->substep_shapingcxx . . $ lame_global_struct#substep_shaping. = method; |
| 1741 | return 0; |
| 1742 | } |
| 1743 | } |
| 1744 | return -1; |
| 1745 | } |
| 1746 | |
| 1747 | int |
| 1748 | lame_get_substepcxx . . $ lame_get_substep(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1749 | { |
| 1750 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1751 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->substep_shaping && gfp->substep_shaping <= 7); |
| 1752 | return gfp->substep_shapingcxx . . $ lame_global_struct#substep_shaping.; |
| 1753 | } |
| 1754 | return 0; |
| 1755 | } |
| 1756 | |
| 1757 | /* scalefactors scale */ |
| 1758 | int |
| 1759 | lame_set_sfscalecxx . . $ lame_set_sfscale(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int val) |
| 1760 | { |
| 1761 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1762 | gfp->noise_shapingcxx . . $ lame_global_struct#noise_shaping. = (val != 0) ? 2 : 1; |
| 1763 | return 0; |
| 1764 | } |
| 1765 | return -1; |
| 1766 | } |
| 1767 | |
| 1768 | int |
| 1769 | lame_get_sfscalecxx . . $ lame_get_sfscale(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1770 | { |
| 1771 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1772 | return (gfp->noise_shapingcxx . . $ lame_global_struct#noise_shaping. == 2) ? 1 : 0; |
| 1773 | } |
| 1774 | return 0; |
| 1775 | } |
| 1776 | |
| 1777 | /* subblock gain */ |
| 1778 | int |
| 1779 | lame_set_subblock_gaincxx . . $ lame_set_subblock_gain(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int sbgain) |
| 1780 | { |
| 1781 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1782 | gfp->subblock_gaincxx . . $ lame_global_struct#subblock_gain. = sbgain; |
| 1783 | return 0; |
| 1784 | } |
| 1785 | return -1; |
| 1786 | } |
| 1787 | |
| 1788 | int |
| 1789 | lame_get_subblock_gaincxx . . $ lame_get_subblock_gain(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1790 | { |
| 1791 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1792 | return gfp->subblock_gaincxx . . $ lame_global_struct#subblock_gain.; |
| 1793 | } |
| 1794 | return 0; |
| 1795 | } |
| 1796 | |
| 1797 | |
| 1798 | /* Disable short blocks. */ |
| 1799 | int |
| 1800 | lame_set_no_short_blockscxx . . $ lame_set_no_short_blocks(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int no_short_blocks) |
| 1801 | { |
| 1802 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1803 | /* enforce disable/enable meaning, if we need more than two values |
| 1804 | we need to switch to an enum to have an apropriate representation |
| 1805 | of the possible meanings of the value */ |
| 1806 | if (0 <= no_short_blocks && no_short_blocks <= 1) { |
| 1807 | gfp->short_blockscxx . . $ lame_global_struct#short_blocks. = no_short_blocks ? short_block_dispensedcxx . . $ short_block_dispensed. : short_block_allowedcxx . . $ short_block_allowed.; |
| 1808 | return 0; |
| 1809 | } |
| 1810 | } |
| 1811 | return -1; |
| 1812 | } |
| 1813 | |
| 1814 | int |
| 1815 | lame_get_no_short_blockscxx . . $ lame_get_no_short_blocks(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1816 | { |
| 1817 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1818 | switch (gfp->short_blockscxx . . $ lame_global_struct#short_blocks.) { |
| 1819 | default: |
| 1820 | case short_block_not_setcxx . . $ short_block_not_set.: |
| 1821 | return -1; |
| 1822 | case short_block_dispensedcxx . . $ short_block_dispensed.: |
| 1823 | return 1; |
| 1824 | case short_block_allowedcxx . . $ short_block_allowed.: |
| 1825 | case short_block_coupledcxx . . $ short_block_coupled.: |
| 1826 | case short_block_forcedcxx . . $ short_block_forced.: |
| 1827 | return 0; |
| 1828 | } |
| 1829 | } |
| 1830 | return -1; |
| 1831 | } |
| 1832 | |
| 1833 | |
| 1834 | /* Force short blocks. */ |
| 1835 | int |
| 1836 | lame_set_force_short_blockscxx . . $ lame_set_force_short_blocks(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int short_blocks) |
| 1837 | { |
| 1838 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1839 | /* enforce disable/enable meaning, if we need more than two values |
| 1840 | we need to switch to an enum to have an apropriate representation |
| 1841 | of the possible meanings of the value */ |
| 1842 | if (0 > short_blocks || 1 < short_blocks) |
| 1843 | return -1; |
| 1844 | |
| 1845 | if (short_blocks == 1) |
| 1846 | gfp->short_blockscxx . . $ lame_global_struct#short_blocks. = short_block_forcedcxx . . $ short_block_forced.; |
| 1847 | else if (gfp->short_blockscxx . . $ lame_global_struct#short_blocks. == short_block_forcedcxx . . $ short_block_forced.) |
| 1848 | gfp->short_blockscxx . . $ lame_global_struct#short_blocks. = short_block_allowedcxx . . $ short_block_allowed.; |
| 1849 | |
| 1850 | return 0; |
| 1851 | } |
| 1852 | return -1; |
| 1853 | } |
| 1854 | |
| 1855 | int |
| 1856 | lame_get_force_short_blockscxx . . $ lame_get_force_short_blocks(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1857 | { |
| 1858 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1859 | switch (gfp->short_blockscxx . . $ lame_global_struct#short_blocks.) { |
| 1860 | default: |
| 1861 | case short_block_not_setcxx . . $ short_block_not_set.: |
| 1862 | return -1; |
| 1863 | case short_block_dispensedcxx . . $ short_block_dispensed.: |
| 1864 | case short_block_allowedcxx . . $ short_block_allowed.: |
| 1865 | case short_block_coupledcxx . . $ short_block_coupled.: |
| 1866 | return 0; |
| 1867 | case short_block_forcedcxx . . $ short_block_forced.: |
| 1868 | return 1; |
| 1869 | } |
| 1870 | } |
| 1871 | return -1; |
| 1872 | } |
| 1873 | |
| 1874 | int |
| 1875 | lame_set_short_threshold_lrmcxx . . $ lame_set_short_threshold_lrm(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float lrm) |
| 1876 | { |
| 1877 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1878 | gfp->attackthrecxx . . $ lame_global_struct#attackthre. = lrm; |
| 1879 | return 0; |
| 1880 | } |
| 1881 | return -1; |
| 1882 | } |
| 1883 | |
| 1884 | float |
| 1885 | lame_get_short_threshold_lrmcxx . . $ lame_get_short_threshold_lrm(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1886 | { |
| 1887 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1888 | return gfp->attackthrecxx . . $ lame_global_struct#attackthre.; |
| 1889 | } |
| 1890 | return 0; |
| 1891 | } |
| 1892 | |
| 1893 | int |
| 1894 | lame_set_short_threshold_scxx . . $ lame_set_short_threshold_s(3b7a42a296db7ad7).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float s) |
| 1895 | { |
| 1896 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1897 | gfp->attackthre_scxx . . $ lame_global_struct#attackthre_s. = s; |
| 1898 | return 0; |
| 1899 | } |
| 1900 | return -1; |
| 1901 | } |
| 1902 | |
| 1903 | float |
| 1904 | lame_get_short_threshold_scxx . . $ lame_get_short_threshold_s(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1905 | { |
| 1906 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1907 | return gfp->attackthre_scxx . . $ lame_global_struct#attackthre_s.; |
| 1908 | } |
| 1909 | return 0; |
| 1910 | } |
| 1911 | |
| 1912 | int |
| 1913 | lame_set_short_thresholdcxx . . $ lame_set_short_threshold(61164348949cb0a8).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float lrm, float s) |
| 1914 | { |
| 1915 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1916 | lame_set_short_threshold_lrmcxx . . $ lame_set_short_threshold_lrm(3b7a42a296db7ad7).(gfp, lrm); |
| 1917 | lame_set_short_threshold_scxx . . $ lame_set_short_threshold_s(3b7a42a296db7ad7).(gfp, s); |
| 1918 | return 0; |
| 1919 | } |
| 1920 | return -1; |
| 1921 | } |
| 1922 | |
| 1923 | |
| 1924 | /* |
| 1925 | * Input PCM is emphased PCM |
| 1926 | * (for instance from one of the rarely emphased CDs). |
| 1927 | * |
| 1928 | * It is STRONGLY not recommended to use this, because psycho does not |
| 1929 | * take it into account, and last but not least many decoders |
| 1930 | * ignore these bits |
| 1931 | */ |
| 1932 | int |
| 1933 | lame_set_emphasiscxx . . $ lame_set_emphasis(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int emphasis) |
| 1934 | { |
| 1935 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1936 | /* XXX: emphasis should be converted to an enum */ |
| 1937 | if (0 <= emphasis && emphasis < 4) { |
| 1938 | gfp->emphasiscxx . . $ lame_global_struct#emphasis. = emphasis; |
| 1939 | return 0; |
| 1940 | } |
| 1941 | } |
| 1942 | return -1; |
| 1943 | } |
| 1944 | |
| 1945 | int |
| 1946 | lame_get_emphasiscxx . . $ lame_get_emphasis(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1947 | { |
| 1948 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1949 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(0 <= gfp->emphasis && gfp->emphasis < 4); |
| 1950 | return gfp->emphasiscxx . . $ lame_global_struct#emphasis.; |
| 1951 | } |
| 1952 | return 0; |
| 1953 | } |
| 1954 | |
| 1955 | |
| 1956 | |
| 1957 | |
| 1958 | /***************************************************************/ |
| 1959 | /* internal variables, cannot be set... */ |
| 1960 | /* provided because they may be of use to calling application */ |
| 1961 | /***************************************************************/ |
| 1962 | |
| 1963 | /* MPEG version. |
| 1964 | * 0 = MPEG-2 |
| 1965 | * 1 = MPEG-1 |
| 1966 | * (2 = MPEG-2.5) |
| 1967 | */ |
| 1968 | int |
| 1969 | lame_get_versioncxx . . $ lame_get_version(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1970 | { |
| 1971 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1972 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 1973 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 1974 | return gfc->cfgcxx . . $ lame_internal_flags#cfg..versioncxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#version.; |
| 1975 | } |
| 1976 | } |
| 1977 | return 0; |
| 1978 | } |
| 1979 | |
| 1980 | |
| 1981 | /* Encoder delay. */ |
| 1982 | int |
| 1983 | lame_get_encoder_delaycxx . . $ lame_get_encoder_delay(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1984 | { |
| 1985 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1986 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 1987 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 1988 | return gfc->ov_enccxx . . $ lame_internal_flags#ov_enc..encoder_delaycxx . . $ $anonymous_type_fa6ce02aa65ebf3c_9#encoder_delay.; |
| 1989 | } |
| 1990 | } |
| 1991 | return 0; |
| 1992 | } |
| 1993 | |
| 1994 | /* padding added to the end of the input */ |
| 1995 | int |
| 1996 | lame_get_encoder_paddingcxx . . $ lame_get_encoder_padding(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 1997 | { |
| 1998 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 1999 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2000 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2001 | return gfc->ov_enccxx . . $ lame_internal_flags#ov_enc..encoder_paddingcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_9#encoder_padding.; |
| 2002 | } |
| 2003 | } |
| 2004 | return 0; |
| 2005 | } |
| 2006 | |
| 2007 | |
| 2008 | /* Size of MPEG frame. */ |
| 2009 | int |
| 2010 | lame_get_framesizecxx . . $ lame_get_framesize(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2011 | { |
| 2012 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2013 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2014 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2015 | SessionConfig_tcxx . . $ SessionConfig_t# const *const cfg = &gfc->cfgcxx . . $ lame_internal_flags#cfg.; |
| 2016 | return 576 * cfg->mode_grcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#mode_gr.; |
| 2017 | } |
| 2018 | } |
| 2019 | return 0; |
| 2020 | } |
| 2021 | |
| 2022 | |
| 2023 | /* Number of frames encoded so far. */ |
| 2024 | int |
| 2025 | lame_get_frameNumcxx . . $ lame_get_frameNum(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2026 | { |
| 2027 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2028 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2029 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2030 | return gfc->ov_enccxx . . $ lame_internal_flags#ov_enc..frame_numbercxx . . $ $anonymous_type_fa6ce02aa65ebf3c_9#frame_number.; |
| 2031 | } |
| 2032 | } |
| 2033 | return 0; |
| 2034 | } |
| 2035 | |
| 2036 | int |
| 2037 | lame_get_mf_samples_to_encodecxx . . $ lame_get_mf_samples_to_encode(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2038 | { |
| 2039 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2040 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2041 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2042 | return gfc->sv_enccxx . . $ lame_internal_flags#sv_enc..mf_samples_to_encodecxx . . $ $anonymous_type_fa6ce02aa65ebf3c_7#mf_samples_to_encode.; |
| 2043 | } |
| 2044 | } |
| 2045 | return 0; |
| 2046 | } |
| 2047 | |
| 2048 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! |
| 2049 | lame_get_size_mp3buffercxx . . $ lame_get_size_mp3buffer(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2050 | { |
| 2051 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2052 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2053 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2054 | int size; |
| 2055 | compute_flushbitscxx . . $ compute_flushbits(36af73b8620c595).(gfc, &size); |
| 2056 | return size; |
| 2057 | } |
| 2058 | } |
| 2059 | return 0; |
| 2060 | } |
| 2061 | |
| 2062 | int |
| 2063 | lame_get_RadioGaincxx . . $ lame_get_RadioGain(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2064 | { |
| 2065 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2066 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2067 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2068 | return gfc->ov_rpgcxx . . $ lame_internal_flags#ov_rpg..RadioGaincxx . . $ $anonymous_type_fa6ce02aa65ebf3c_12#RadioGain.; |
| 2069 | } |
| 2070 | } |
| 2071 | return 0; |
| 2072 | } |
| 2073 | |
| 2074 | int |
| 2075 | lame_get_AudiophileGaincxx . . $ lame_get_AudiophileGain(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2076 | { |
| 2077 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2078 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2079 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2080 | return 0; |
| 2081 | } |
| 2082 | } |
| 2083 | return 0; |
| 2084 | } |
| 2085 | |
| 2086 | float |
| 2087 | lame_get_PeakSamplecxx . . $ lame_get_PeakSample(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2088 | { |
| 2089 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2090 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2091 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2092 | return (float) gfc->ov_rpgcxx . . $ lame_internal_flags#ov_rpg..PeakSamplecxx . . $ $anonymous_type_fa6ce02aa65ebf3c_12#PeakSample.; |
| 2093 | } |
| 2094 | } |
| 2095 | return 0; |
| 2096 | } |
| 2097 | |
| 2098 | int |
| 2099 | lame_get_noclipGainChangecxx . . $ lame_get_noclipGainChange(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2100 | { |
| 2101 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2102 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2103 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2104 | return gfc->ov_rpgcxx . . $ lame_internal_flags#ov_rpg..noclipGainChangecxx . . $ $anonymous_type_fa6ce02aa65ebf3c_12#noclipGainChange.; |
| 2105 | } |
| 2106 | } |
| 2107 | return 0; |
| 2108 | } |
| 2109 | |
| 2110 | float |
| 2111 | lame_get_noclipScalecxx . . $ lame_get_noclipScale(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2112 | { |
| 2113 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2114 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2115 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2116 | return gfc->ov_rpgcxx . . $ lame_internal_flags#ov_rpg..noclipScalecxx . . $ $anonymous_type_fa6ce02aa65ebf3c_12#noclipScale.; |
| 2117 | } |
| 2118 | } |
| 2119 | return 0; |
| 2120 | } |
| 2121 | |
| 2122 | |
| 2123 | /* |
| 2124 | * LAME's estimate of the total number of frames to be encoded. |
| 2125 | * Only valid if calling program set num_samples. |
| 2126 | */ |
| 2127 | int |
| 2128 | lame_get_totalframescxx . . $ lame_get_totalframes(a5abb0ff158568ac).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2129 | { |
| 2130 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2131 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2132 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2133 | SessionConfig_tcxx . . $ SessionConfig_t# const *const cfg = &gfc->cfgcxx . . $ lame_internal_flags#cfg.; |
| 2134 | unsigned long const pcm_samples_per_frame = 576 * cfg->mode_grcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#mode_gr.; |
| 2135 | unsigned long pcm_samples_to_encode = gfp->num_samplescxx . . $ lame_global_struct#num_samples.; |
| 2136 | unsigned long end_padding = 0; |
| 2137 | int frames = 0; |
| 2138 | |
| 2139 | if (pcm_samples_to_encode == (0ul-1ul)) |
| 2140 | return 0; /* unknown */ |
| 2141 | |
| 2142 | /* estimate based on user set num_samples: */ |
| 2143 | if (cfg->samplerate_incxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#samplerate_in. != cfg->samplerate_outcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#samplerate_out.) { |
| 2144 | /* resampling, estimate new samples_to_encode */ |
| 2145 | double resampled_samples_to_encode = 0.0, frames_f = 0.0; |
| 2146 | if (cfg->samplerate_incxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#samplerate_in. > 0) { |
| 2147 | resampled_samples_to_encode = pcm_samples_to_encode; |
| 2148 | resampled_samples_to_encode *= cfg->samplerate_outcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#samplerate_out.; |
| 2149 | resampled_samples_to_encode /= cfg->samplerate_incxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#samplerate_in.; |
| 2150 | } |
| 2151 | if (resampled_samples_to_encode <= 0.0) |
| 2152 | return 0; /* unlikely to happen, so what, no estimate! */ |
| 2153 | frames_f = floorcxx . . $ floor(447c67c6676f75c3).(resampled_samples_to_encode / pcm_samples_per_frame); |
| 2154 | if (frames_f >= (INT_MAXcxx . . $ `<external>/67164224788392828/limits.h:120:9`!-2)) |
| 2155 | return 0; /* overflow, happens eventually, no estimate! */ |
| 2156 | frames = frames_f; |
| 2157 | resampled_samples_to_encode -= frames * pcm_samples_per_frame; |
| 2158 | pcm_samples_to_encode = ceilcxx . . $ ceil(447c67c6676f75c3).(resampled_samples_to_encode); |
| 2159 | } |
| 2160 | else { |
| 2161 | frames = pcm_samples_to_encode / pcm_samples_per_frame; |
| 2162 | pcm_samples_to_encode -= frames * pcm_samples_per_frame; |
| 2163 | } |
| 2164 | pcm_samples_to_encode += 576ul; |
| 2165 | end_padding = pcm_samples_per_frame - (pcm_samples_to_encode % pcm_samples_per_frame); |
| 2166 | if (end_padding < 576ul) { |
| 2167 | end_padding += pcm_samples_per_frame; |
| 2168 | } |
| 2169 | pcm_samples_to_encode += end_padding; |
| 2170 | frames += (pcm_samples_to_encode / pcm_samples_per_frame); |
| 2171 | /* check to see if we underestimated totalframes */ |
| 2172 | /* if (totalframes < gfp->frameNum) */ |
| 2173 | /* totalframes = gfp->frameNum; */ |
| 2174 | return frames; |
| 2175 | } |
| 2176 | } |
| 2177 | return 0; |
| 2178 | } |
| 2179 | |
| 2180 | |
| 2181 | |
| 2182 | |
| 2183 | |
| 2184 | int |
| 2185 | lame_set_presetcxx . . $ lame_set_preset(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int preset) |
| 2186 | { |
| 2187 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2188 | gfp->presetcxx . . $ lame_global_struct#preset. = preset; |
| 2189 | return apply_presetcxx . . $ apply_preset(bc3aa82e4f3f190c).(gfp, preset, 1); |
| 2190 | } |
| 2191 | return -1; |
| 2192 | } |
| 2193 | |
| 2194 | |
| 2195 | |
| 2196 | int |
| 2197 | lame_set_asm_optimizationscxx . . $ lame_set_asm_optimizations(bc3aa82e4f3f190c).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int optim, int mode) |
| 2198 | { |
| 2199 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2200 | mode = (mode == 1 ? 1 : 0); |
| 2201 | switch (optim) { |
| 2202 | case MMXcxx . . $ MMX.:{ |
| 2203 | gfp->asm_optimizationscxx . . $ lame_global_struct#asm_optimizations..mmxcxx . . $ lame_global_struct#$anonymous_type_1#mmx. = mode; |
| 2204 | return optim; |
| 2205 | } |
| 2206 | case AMD_3DNOWcxx . . $ AMD_3DNOW.:{ |
| 2207 | gfp->asm_optimizationscxx . . $ lame_global_struct#asm_optimizations..amd3dnowcxx . . $ lame_global_struct#$anonymous_type_1#amd3dnow. = mode; |
| 2208 | return optim; |
| 2209 | } |
| 2210 | case SSEcxx . . $ SSE.:{ |
| 2211 | gfp->asm_optimizationscxx . . $ lame_global_struct#asm_optimizations..ssecxx . . $ lame_global_struct#$anonymous_type_1#sse. = mode; |
| 2212 | return optim; |
| 2213 | } |
| 2214 | default: |
| 2215 | return optim; |
| 2216 | } |
| 2217 | } |
| 2218 | return -1; |
| 2219 | } |
| 2220 | |
| 2221 | |
| 2222 | void |
| 2223 | lame_set_write_id3tag_automaticcxx . . $ lame_set_write_id3tag_automatic(371b626edddab936).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int v) |
| 2224 | { |
| 2225 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2226 | gfp->write_id3tag_automaticcxx . . $ lame_global_struct#write_id3tag_automatic. = v; |
| 2227 | } |
| 2228 | } |
| 2229 | |
| 2230 | |
| 2231 | int |
| 2232 | lame_get_write_id3tag_automaticcxx . . $ lame_get_write_id3tag_automatic(a5abb0ff158568ac).(lame_global_flagscxx . . $ lame_global_flags# const *gfp) |
| 2233 | { |
| 2234 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2235 | return gfp->write_id3tag_automaticcxx . . $ lame_global_struct#write_id3tag_automatic.; |
| 2236 | } |
| 2237 | return 1; |
| 2238 | } |
| 2239 | |
| 2240 | |
| 2241 | /* |
| 2242 | |
| 2243 | UNDOCUMENTED, experimental settings. These routines are not prototyped |
| 2244 | in lame.h. You should not use them, they are experimental and may |
| 2245 | change. |
| 2246 | |
| 2247 | */ |
| 2248 | |
| 2249 | |
| 2250 | /* |
| 2251 | * just another daily changing developer switch |
| 2252 | */ |
| 2253 | void CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_set_tunecxx . . $ lame_set_tune(c9c9a545eaea60e8).(lame_global_flagscxx . . $ lame_global_flags# *, float); |
| 2254 | |
| 2255 | void |
| 2256 | lame_set_tunecxx . . $ lame_set_tune(c9c9a545eaea60e8).(lame_global_flagscxx . . $ lame_global_flags# * gfp, float val) |
| 2257 | { |
| 2258 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2259 | gfp->tune_value_acxx . . $ lame_global_struct#tune_value_a. = val; |
| 2260 | gfp->tunecxx . . $ lame_global_struct#tune. = 1; |
| 2261 | } |
| 2262 | } |
| 2263 | |
| 2264 | /* Custom msfix hack */ |
| 2265 | void |
| 2266 | lame_set_msfixcxx . . $ lame_set_msfix(404f7e20968e6842).(lame_global_flagscxx . . $ lame_global_flags# * gfp, double msfix) |
| 2267 | { |
| 2268 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2269 | /* default = 0 */ |
| 2270 | gfp->msfixcxx . . $ lame_global_struct#msfix. = msfix; |
| 2271 | } |
| 2272 | } |
| 2273 | |
| 2274 | float |
| 2275 | lame_get_msfixcxx . . $ lame_get_msfix(20fdb60ca712131b).(const lame_global_flagscxx . . $ lame_global_flags# * gfp) |
| 2276 | { |
| 2277 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2278 | return gfp->msfixcxx . . $ lame_global_struct#msfix.; |
| 2279 | } |
| 2280 | return 0; |
| 2281 | } |
| 2282 | |
| 2283 | #if DEPRECATED_OR_OBSOLETE_CODE_REMOVEDcxx . . $ `external/lame/lame.h:49:9`! |
| 2284 | int CDECLcxx . . $ `external/lame/lame.h:46:9`! lame_set_preset_expoptscxx . . $ lame_set_preset_expopts(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# *, int); |
| 2285 | #else |
| 2286 | #endif |
| 2287 | |
| 2288 | int |
| 2289 | lame_set_preset_expoptscxx . . $ lame_set_preset_expopts(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int preset_expopts) |
| 2290 | { |
| 2291 | (void) gfp; |
| 2292 | (void) preset_expopts; |
| 2293 | return 0; |
| 2294 | } |
| 2295 | |
| 2296 | |
| 2297 | int |
| 2298 | lame_set_preset_notunecxx . . $ lame_set_preset_notune(3f7580c1167cd249).(lame_global_flagscxx . . $ lame_global_flags# * gfp, int preset_notune) |
| 2299 | { |
| 2300 | (void) gfp; |
| 2301 | (void) preset_notune; |
| 2302 | return 0; |
| 2303 | } |
| 2304 | |
| 2305 | static int |
| 2306 | calc_maximum_input_samples_for_buffer_sizecxx . . $ calc_maximum_input_samples_for_buffer_size(e137bb04d213514).(lame_internal_flagscxx . . $ lame_internal_flags# const* gfc, size_t buffer_size) |
| 2307 | { |
| 2308 | SessionConfig_tcxx . . $ SessionConfig_t# const *const cfg = &gfc->cfgcxx . . $ lame_internal_flags#cfg.; |
| 2309 | int const pcm_samples_per_frame = 576 * cfg->mode_grcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#mode_gr.; |
| 2310 | int frames_per_buffer = 0, input_samples_per_buffer = 0; |
| 2311 | int kbps = 320; |
| 2312 | |
| 2313 | if (cfg->samplerate_outcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#samplerate_out. < 16000) |
| 2314 | kbps = 64; |
| 2315 | else if (cfg->samplerate_outcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#samplerate_out. < 32000) |
| 2316 | kbps = 160; |
| 2317 | else |
| 2318 | kbps = 320; |
| 2319 | if (cfg->free_formatcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#free_format.) |
| 2320 | kbps = cfg->avg_bitratecxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#avg_bitrate.; |
| 2321 | else if (cfg->vbrcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#vbr. == vbr_offcxx . . $ vbr_off.) { |
| 2322 | kbps = cfg->avg_bitratecxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#avg_bitrate.; |
| 2323 | } |
| 2324 | { |
| 2325 | int const pad = 1; |
| 2326 | int const bpf = ((cfg->versioncxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#version. + 1) * 72000 * kbps / cfg->samplerate_outcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#samplerate_out. + pad); |
| 2327 | frames_per_buffer = buffer_size / bpf; |
| 2328 | } |
| 2329 | { |
| 2330 | double ratio = (double) cfg->samplerate_incxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#samplerate_in. / cfg->samplerate_outcxx . . $ $anonymous_type_fa6ce02aa65ebf3c_13#samplerate_out.; |
| 2331 | input_samples_per_buffer = pcm_samples_per_frame * frames_per_buffer * ratio; |
| 2332 | } |
| 2333 | return input_samples_per_buffer; |
| 2334 | } |
| 2335 | |
| 2336 | int |
| 2337 | lame_get_maximum_number_of_samplescxx . . $ lame_get_maximum_number_of_samples(e07c05463b4dfa97).(lame_tcxx . . $ lame_t# gfp, size_t buffer_size) |
| 2338 | { |
| 2339 | if (is_lame_global_flags_validcxx . . $ is_lame_global_flags_valid(a5abb0ff158568ac).(gfp)) { |
| 2340 | lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc = gfp->internal_flagscxx . . $ lame_global_struct#internal_flags.; |
| 2341 | if (is_lame_internal_flags_validcxx . . $ is_lame_internal_flags_valid(b815612886108da).(gfc)) { |
| 2342 | return calc_maximum_input_samples_for_buffer_sizecxx . . $ calc_maximum_input_samples_for_buffer_size(e137bb04d213514).(gfc, buffer_size); |
| 2343 | } |
| 2344 | } |
| 2345 | return LAME_GENERICERRORcxx . . $ LAME_GENERICERROR.; |
| 2346 | } |