| OLD | NEW |
| 1 /* | 1 /* |
| 2 * WMA compatible encoder | 2 * WMA compatible encoder |
| 3 * Copyright (c) 2007 Michael Niedermayer | 3 * Copyright (c) 2007 Michael Niedermayer |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 last_exp= *exp_param++; | 127 last_exp= *exp_param++; |
| 128 assert(last_exp-10 >= 0 && last_exp-10 < 32); | 128 assert(last_exp-10 >= 0 && last_exp-10 < 32); |
| 129 put_bits(&s->pb, 5, last_exp - 10); | 129 put_bits(&s->pb, 5, last_exp - 10); |
| 130 q+= *ptr++; | 130 q+= *ptr++; |
| 131 }else | 131 }else |
| 132 last_exp = 36; | 132 last_exp = 36; |
| 133 while (q < q_end) { | 133 while (q < q_end) { |
| 134 int exp = *exp_param++; | 134 int exp = *exp_param++; |
| 135 int code = exp - last_exp + 60; | 135 int code = exp - last_exp + 60; |
| 136 assert(code >= 0 && code < 120); | 136 assert(code >= 0 && code < 120); |
| 137 put_bits(&s->pb, ff_wma_scale_huffbits[code], ff_wma_scale_huffcodes[cod
e]); | 137 put_bits(&s->pb, ff_aac_scalefactor_bits[code], ff_aac_scalefactor_code[
code]); |
| 138 /* XXX: use a table */ | 138 /* XXX: use a table */ |
| 139 q+= *ptr++; | 139 q+= *ptr++; |
| 140 last_exp= exp; | 140 last_exp= exp; |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
int total_gain){ | 144 static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
int total_gain){ |
| 145 int v, bsize, ch, coef_nb_bits, parse_exponents; | 145 int v, bsize, ch, coef_nb_bits, parse_exponents; |
| 146 float mdct_norm; | 146 float mdct_norm; |
| 147 int nb_coefs[MAX_CHANNELS]; | 147 int nb_coefs[MAX_CHANNELS]; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 "wmav2", | 401 "wmav2", |
| 402 CODEC_TYPE_AUDIO, | 402 CODEC_TYPE_AUDIO, |
| 403 CODEC_ID_WMAV2, | 403 CODEC_ID_WMAV2, |
| 404 sizeof(WMACodecContext), | 404 sizeof(WMACodecContext), |
| 405 encode_init, | 405 encode_init, |
| 406 encode_superframe, | 406 encode_superframe, |
| 407 ff_wma_end, | 407 ff_wma_end, |
| 408 .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, | 408 .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, |
| 409 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"), | 409 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"), |
| 410 }; | 410 }; |
| OLD | NEW |