| OLD | NEW |
| 1 /* | 1 /* |
| 2 * MPEG-4 Audio common code | 2 * MPEG-4 Audio common code |
| 3 * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier@free.fr> | 3 * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier@free.fr> |
| 4 * Copyright (c) 2009 Alex Converse <alex.converse@gmail.com> | 4 * Copyright (c) 2009 Alex Converse <alex.converse@gmail.com> |
| 5 * | 5 * |
| 6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
| 7 * | 7 * |
| 8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 c->ext_object_type = get_object_type(&gb); | 124 c->ext_object_type = get_object_type(&gb); |
| 125 if (c->ext_object_type == AOT_SBR && (c->sbr = get_bits1(&gb)) =
= 1) | 125 if (c->ext_object_type == AOT_SBR && (c->sbr = get_bits1(&gb)) =
= 1) |
| 126 c->ext_sample_rate = get_sample_rate(&gb, &c->ext_sampling_i
ndex); | 126 c->ext_sample_rate = get_sample_rate(&gb, &c->ext_sampling_i
ndex); |
| 127 if (get_bits_left(&gb) > 11 && get_bits(&gb, 11) == 0x548) | 127 if (get_bits_left(&gb) > 11 && get_bits(&gb, 11) == 0x548) |
| 128 c->ps = get_bits1(&gb); | 128 c->ps = get_bits1(&gb); |
| 129 break; | 129 break; |
| 130 } else | 130 } else |
| 131 get_bits1(&gb); // skip 1 bit | 131 get_bits1(&gb); // skip 1 bit |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 |
| 135 //PS requires SBR |
| 136 if (!c->sbr) |
| 137 c->ps = 0; |
| 138 //Limit implicit PS to the HE-AACv2 Profile |
| 139 if ((c->ps == -1 && c->object_type != AOT_AAC_LC) || c->channels & ~0x01) |
| 140 c->ps = 0; |
| 141 |
| 134 return specific_config_bitindex; | 142 return specific_config_bitindex; |
| 135 } | 143 } |
| 136 | 144 |
| 137 static av_always_inline unsigned int copy_bits(PutBitContext *pb, | 145 static av_always_inline unsigned int copy_bits(PutBitContext *pb, |
| 138 GetBitContext *gb, | 146 GetBitContext *gb, |
| 139 int bits) | 147 int bits) |
| 140 { | 148 { |
| 141 unsigned int el = get_bits(gb, bits); | 149 unsigned int el = get_bits(gb, bits); |
| 142 put_bits(pb, bits, el); | 150 put_bits(pb, bits, el); |
| 143 return el; | 151 return el; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 166 if (bits) | 174 if (bits) |
| 167 copy_bits(pb, gb, bits); | 175 copy_bits(pb, gb, bits); |
| 168 align_put_bits(pb); | 176 align_put_bits(pb); |
| 169 align_get_bits(gb); | 177 align_get_bits(gb); |
| 170 comment_size = copy_bits(pb, gb, 8); | 178 comment_size = copy_bits(pb, gb, 8); |
| 171 for (; comment_size > 0; comment_size--) | 179 for (; comment_size > 0; comment_size--) |
| 172 copy_bits(pb, gb, 8); | 180 copy_bits(pb, gb, 8); |
| 173 | 181 |
| 174 return put_bits_count(pb) - offset; | 182 return put_bits_count(pb) - offset; |
| 175 } | 183 } |
| OLD | NEW |