| OLD | NEW |
| 1 /* | 1 /* |
| 2 * QDM2 compatible decoder | 2 * QDM2 compatible decoder |
| 3 * Copyright (c) 2003 Ewald Snel | 3 * Copyright (c) 2003 Ewald Snel |
| 4 * Copyright (c) 2005 Benjamin Larsson | 4 * Copyright (c) 2005 Benjamin Larsson |
| 5 * Copyright (c) 2005 Alex Beregszaszi | 5 * Copyright (c) 2005 Alex Beregszaszi |
| 6 * Copyright (c) 2005 Roberto Togni | 6 * Copyright (c) 2005 Roberto Togni |
| 7 * | 7 * |
| 8 * This file is part of FFmpeg. | 8 * This file is part of FFmpeg. |
| 9 * | 9 * |
| 10 * FFmpeg is free software; you can redistribute it and/or | 10 * FFmpeg is free software; you can redistribute it and/or |
| (...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 av_log(NULL,AV_LOG_ERROR,"bad superblock type\n"); | 1202 av_log(NULL,AV_LOG_ERROR,"bad superblock type\n"); |
| 1203 return; | 1203 return; |
| 1204 } | 1204 } |
| 1205 | 1205 |
| 1206 q->superblocktype_2_3 = (header.type == 2 || header.type == 3); | 1206 q->superblocktype_2_3 = (header.type == 2 || header.type == 3); |
| 1207 packet_bytes = (q->compressed_size - get_bits_count(&gb) / 8); | 1207 packet_bytes = (q->compressed_size - get_bits_count(&gb) / 8); |
| 1208 | 1208 |
| 1209 init_get_bits(&gb, header.data, header.size*8); | 1209 init_get_bits(&gb, header.data, header.size*8); |
| 1210 | 1210 |
| 1211 if (header.type == 2 || header.type == 4 || header.type == 5) { | 1211 if (header.type == 2 || header.type == 4 || header.type == 5) { |
| 1212 int csum = 257 * get_bits(&gb, 8) + 2 * get_bits(&gb, 8); | 1212 int csum = 257 * get_bits(&gb, 8); |
| 1213 csum += 2 * get_bits(&gb, 8); |
| 1213 | 1214 |
| 1214 csum = qdm2_packet_checksum(q->compressed_data, q->checksum_size, csum); | 1215 csum = qdm2_packet_checksum(q->compressed_data, q->checksum_size, csum); |
| 1215 | 1216 |
| 1216 if (csum != 0) { | 1217 if (csum != 0) { |
| 1217 q->has_errors = 1; | 1218 q->has_errors = 1; |
| 1218 av_log(NULL,AV_LOG_ERROR,"bad packet checksum\n"); | 1219 av_log(NULL,AV_LOG_ERROR,"bad packet checksum\n"); |
| 1219 return; | 1220 return; |
| 1220 } | 1221 } |
| 1221 } | 1222 } |
| 1222 | 1223 |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1974 { | 1975 { |
| 1975 .name = "qdm2", | 1976 .name = "qdm2", |
| 1976 .type = AVMEDIA_TYPE_AUDIO, | 1977 .type = AVMEDIA_TYPE_AUDIO, |
| 1977 .id = CODEC_ID_QDM2, | 1978 .id = CODEC_ID_QDM2, |
| 1978 .priv_data_size = sizeof(QDM2Context), | 1979 .priv_data_size = sizeof(QDM2Context), |
| 1979 .init = qdm2_decode_init, | 1980 .init = qdm2_decode_init, |
| 1980 .close = qdm2_decode_close, | 1981 .close = qdm2_decode_close, |
| 1981 .decode = qdm2_decode_frame, | 1982 .decode = qdm2_decode_frame, |
| 1982 .long_name = NULL_IF_CONFIG_SMALL("QDesign Music Codec 2"), | 1983 .long_name = NULL_IF_CONFIG_SMALL("QDesign Music Codec 2"), |
| 1983 }; | 1984 }; |
| OLD | NEW |