├── .gitignore ├── Cargo.toml ├── LICENSE-APACHE2 ├── LICENSE-MIT ├── README.md ├── src ├── bin │ └── minimp3_test.rs ├── huffman.rs ├── lib.rs ├── oldlib.rs └── tests.rs ├── test.sh └── vectors ├── ILL2_center2.bit ├── ILL2_center2.pcm ├── ILL2_dual.bit ├── ILL2_dual.pcm ├── ILL2_dynx22.bit ├── ILL2_dynx22.pcm ├── ILL2_dynx31.bit ├── ILL2_dynx31.pcm ├── ILL2_dynx32.bit ├── ILL2_dynx32.pcm ├── ILL2_ext_switching.bit ├── ILL2_ext_switching.pcm ├── ILL2_layer1.bit ├── ILL2_layer1.pcm ├── ILL2_layer3.bit ├── ILL2_layer3.pcm ├── ILL2_mono.bit ├── ILL2_mono.pcm ├── ILL2_multilingual.bit ├── ILL2_multilingual.pcm ├── ILL2_overalloc1.bit ├── ILL2_overalloc1.pcm ├── ILL2_overalloc2.bit ├── ILL2_overalloc2.pcm ├── ILL2_prediction.bit ├── ILL2_prediction.pcm ├── ILL2_samples.bit ├── ILL2_samples.pcm ├── ILL2_scf63.bit ├── ILL2_scf63.pcm ├── ILL2_tca21.bit ├── ILL2_tca21.pcm ├── ILL2_tca30.bit ├── ILL2_tca30.pcm ├── ILL2_tca30_PC.bit ├── ILL2_tca30_PC.pcm ├── ILL2_tca31_PC.bit ├── ILL2_tca31_PC.pcm ├── ILL2_tca31_mtx0.bit ├── ILL2_tca31_mtx0.pcm ├── ILL2_tca31_mtx2.bit ├── ILL2_tca31_mtx2.pcm ├── ILL2_tca32_PC.bit ├── ILL2_tca32_PC.pcm ├── ILL2_wrongcrc.bit ├── ILL2_wrongcrc.pcm ├── ILL4_ext_id1.bit ├── ILL4_ext_id1.pcm ├── ILL4_sync.bit ├── ILL4_sync.pcm ├── ILL4_wrong_length1.bit ├── ILL4_wrong_length1.pcm ├── ILL4_wrong_length2.bit ├── ILL4_wrong_length2.pcm ├── ILL4_wrongcrc.bit ├── ILL4_wrongcrc.pcm ├── M2L3_bitrate_16_all.bit ├── M2L3_bitrate_16_all.pcm ├── M2L3_bitrate_22_all.bit ├── M2L3_bitrate_22_all.pcm ├── M2L3_bitrate_24_all.bit ├── M2L3_bitrate_24_all.pcm ├── M2L3_compl24.bit ├── M2L3_compl24.pcm ├── M2L3_noise.bit ├── M2L3_noise.pcm ├── fuzz └── l3-compl-cut.mp3 ├── l1-fl1.bit ├── l1-fl1.pcm ├── l1-fl2.bit ├── l1-fl2.pcm ├── l1-fl3.bit ├── l1-fl3.pcm ├── l1-fl4.bit ├── l1-fl4.pcm ├── l1-fl5.bit ├── l1-fl5.pcm ├── l1-fl6.bit ├── l1-fl6.pcm ├── l1-fl7.bit ├── l1-fl7.pcm ├── l1-fl8.bit ├── l1-fl8.pcm ├── l2-fl10.bit ├── l2-fl10.pcm ├── l2-fl11.bit ├── l2-fl11.pcm ├── l2-fl12.bit ├── l2-fl12.pcm ├── l2-fl13.bit ├── l2-fl13.pcm ├── l2-fl14.bit ├── l2-fl14.pcm ├── l2-fl15.bit ├── l2-fl15.pcm ├── l2-fl16.bit ├── l2-fl16.pcm ├── l2-nonstandard-fl1_fl2_ff.bit ├── l2-nonstandard-fl1_fl2_ff.pcm ├── l2-nonstandard-free_format.bit ├── l2-nonstandard-free_format.pcm ├── l2-nonstandard-test32-size.bit ├── l2-nonstandard-test32-size.pcm ├── l2-test32.bit ├── l2-test32.pcm ├── l3-compl.bit ├── l3-compl.pcm ├── l3-he_32khz.bit ├── l3-he_32khz.pcm ├── l3-he_44khz.bit ├── l3-he_44khz.pcm ├── l3-he_48khz.bit ├── l3-he_48khz.pcm ├── l3-he_free.bit ├── l3-he_free.pcm ├── l3-he_mode.bit ├── l3-he_mode.pcm ├── l3-hecommon.bit ├── l3-hecommon.pcm ├── l3-id3v2.bit ├── l3-id3v2.pcm ├── l3-nonstandard-big-iscf.bit ├── l3-nonstandard-big-iscf.pcm ├── l3-nonstandard-compl-sideinfo-bigvalues.bit ├── l3-nonstandard-compl-sideinfo-bigvalues.pcm ├── l3-nonstandard-compl-sideinfo-blocktype.bit ├── l3-nonstandard-compl-sideinfo-blocktype.pcm ├── l3-nonstandard-compl-sideinfo-size.bit ├── l3-nonstandard-compl-sideinfo-size.pcm ├── l3-nonstandard-sideinfo-size.bit ├── l3-nonstandard-sideinfo-size.pcm ├── l3-si.bit ├── l3-si.pcm ├── l3-si_block.bit ├── l3-si_block.pcm ├── l3-si_huff.bit ├── l3-si_huff.pcm ├── l3-sin1k0db.bit ├── l3-sin1k0db.pcm ├── l3-test45.bit ├── l3-test45.pcm ├── l3-test46.bit ├── l3-test46.pcm └── performance ├── MEANDR90.MP3 ├── MEANDR_PHASE0.mp3 ├── MEANDR_PHASE90.mp3 ├── MIPSTest.mp3 └── noise_meandr.mp3 /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 6 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 7 | Cargo.lock 8 | 9 | # These are backup files generated by rustfmt 10 | **/*.rs.bk 11 | 12 | /target 13 | **/*.rs.bk 14 | Cargo.lock 15 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rinimp3" 3 | description = "An attempt to make a pure-Rust MP3 decoder, based on `minimp3`." 4 | version = "0.1.0" 5 | authors = ["Simon Heath "] 6 | license = "Apache-2.0/MIT" 7 | documentation = "https://docs.rs/rinimp3/" 8 | repository = "https://github.com/icefoxen/rinimp3" 9 | readme = "README.md" 10 | 11 | keywords = [] 12 | categories = [] 13 | exclude = [ 14 | "vectors/*", 15 | ] 16 | 17 | 18 | [badges] 19 | maintenance = { status = "experimental" } 20 | 21 | [dependencies] 22 | structopt = "0.2" 23 | byteorder = "1.2.6" 24 | 25 | [dev-dependencies] 26 | minimp3 = "0.3" 27 | -------------------------------------------------------------------------------- /LICENSE-APACHE2: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2018 icefoxen 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rinimp3 2 | 3 | An attempt to make a port of [lieff's minimp3](https://github.com/lieff/minimp3) to Rust. The goal is basically to make the minimp3-rs crate, bindings to the C library, unnecessary. 4 | 5 | <<<<<<< HEAD 6 | There is a write-up of the translation process [here](https://wiki.alopex.li/PortingCToRust). 7 | 8 | First step is to just duplicate it as closely as possible, including passing its tests and fuzzing. Next step would be to smooth its API out and make it more Rusty; https://github.com/germangb/minimp3-rs might be useful for inspiration. 9 | ======= 10 | First step is to just duplicate it as closely as possible, including passing its tests and fuzzing. https://wiki.alopex.li/PortingCToRust comments on the conversion. Next step would be to smooth its API out and make it more Rusty; https://github.com/germangb/minimp3-rs might be useful for inspiration. 11 | >>>>>>> e2500fd001aaf5ba07ed0acad3e3d41144a65ff1 12 | 13 | Current status: about 90% translated, but there's still some panics lurking in the test cases. I need to find a nice few days and just finish it off. 14 | 15 | Differences from `minimp3`: 16 | 17 | * i16 output only 18 | * No SIMD 19 | * No conditional compilation -- basically should operate as if the following flags are defined: 20 | * `#define MINIMP3_NO_SIMD` 21 | * `#define MINIMP3_NONSTANDARD_BUT_LOGICAL`??? 22 | -------------------------------------------------------------------------------- /src/bin/minimp3_test.rs: -------------------------------------------------------------------------------- 1 | /// This is a translation of minimp3_test.c, 2 | /// which also includes minimp3_ex.h. 3 | 4 | extern "C" { 5 | fn __errno_location() -> *mut i32; 6 | fn abs(__x: i32) -> i32; 7 | fn close(__fd: i32) -> i32; 8 | fn exit(__status: i32); 9 | fn fclose(__stream: *mut IoFile) -> i32; 10 | fn fopen(__filename: *const u8, __modes: *const u8) -> *mut IoFile; 11 | fn fread( 12 | __ptr: *mut ::std::os::raw::c_void, 13 | __size: usize, 14 | __n: usize, 15 | __stream: *mut IoFile, 16 | ) -> usize; 17 | fn free(__ptr: *mut ::std::os::raw::c_void); 18 | fn fseek(__stream: *mut IoFile, __off: isize, __whence: i32) -> i32; 19 | fn fstat(__fd: i32, __buf: *mut stat) -> i32; 20 | fn ftell(__stream: *mut IoFile) -> isize; 21 | fn fwrite( 22 | __ptr: *const ::std::os::raw::c_void, 23 | __size: usize, 24 | __n: usize, 25 | __s: *mut IoFile, 26 | ) -> usize; 27 | fn malloc(__size: usize) -> *mut ::std::os::raw::c_void; 28 | fn memcpy( 29 | __dest: *mut ::std::os::raw::c_void, 30 | __src: *const ::std::os::raw::c_void, 31 | __n: usize, 32 | ) -> *mut ::std::os::raw::c_void; 33 | fn memset( 34 | __s: *mut ::std::os::raw::c_void, 35 | __c: i32, 36 | __n: usize, 37 | ) -> *mut ::std::os::raw::c_void; 38 | fn mmap( 39 | __addr: *mut ::std::os::raw::c_void, 40 | __len: usize, 41 | __prot: i32, 42 | __flags: i32, 43 | __fd: i32, 44 | __offset: isize, 45 | ) -> *mut ::std::os::raw::c_void; 46 | fn munmap(__addr: *mut ::std::os::raw::c_void, __len: usize) -> i32; 47 | fn open(__file: *const u8, __oflag: i32, ...) -> i32; 48 | fn printf(__format: *const u8, ...) -> i32; 49 | fn realloc(__ptr: *mut ::std::os::raw::c_void, __size: usize) -> *mut ::std::os::raw::c_void; 50 | fn rewind(__stream: *mut IoFile); 51 | fn strcasecmp(__s1: *const u8, __s2: *const u8) -> i32; 52 | fn strncmp(__s1: *const u8, __s2: *const u8, __n: usize) -> i32; 53 | fn strrchr(__s: *const u8, __c: i32) -> *mut u8; 54 | } 55 | 56 | enum IoFile {} 57 | 58 | extern crate rinimp3; 59 | #[allow(unused_imports)] 60 | #[macro_use] 61 | extern crate structopt; 62 | use rinimp3::*; 63 | 64 | #[derive(Copy, Clone)] 65 | #[repr(C)] 66 | pub struct Mp3decFileInfo { 67 | pub buffer: *mut i16, 68 | pub samples: usize, 69 | pub channels: i32, 70 | pub hz: i32, 71 | pub layer: i32, 72 | pub avg_bitrate_kbps: i32, 73 | } 74 | 75 | unsafe fn mp3dec_skip_id3v2(buf: *const u8, buf_size: usize) -> usize { 76 | if buf_size > 10usize 77 | && (strncmp( 78 | buf as (*mut u8) as (*const u8), 79 | (*b"ID3\0").as_ptr(), 80 | 3usize, 81 | ) == 0) 82 | { 83 | (((*buf.offset(6isize) as (i32) & 0x7fi32) << 21i32 84 | | (*buf.offset(7isize) as (i32) & 0x7fi32) << 14i32 85 | | (*buf.offset(8isize) as (i32) & 0x7fi32) << 7i32 86 | | *buf.offset(9isize) as (i32) & 0x7fi32) 87 | + 10i32) as (usize) 88 | } else { 89 | 0usize 90 | } 91 | } 92 | pub unsafe fn mp3dec_load_buf( 93 | dec: *mut Mp3Dec, 94 | mut buf: *const u8, 95 | mut buf_size: usize, 96 | info: *mut Mp3decFileInfo, 97 | progress_cb: unsafe fn(*mut ::std::os::raw::c_void, usize, usize, *mut FrameInfo) -> i32, 98 | user_data: *mut ::std::os::raw::c_void, 99 | ) { 100 | let orig_buf_size: usize = buf_size; 101 | let mut pcm: [i16; 2304] = [0; 2304]; 102 | let mut frame_info: FrameInfo = ::std::mem::zeroed(); 103 | memset( 104 | info as (*mut ::std::os::raw::c_void), 105 | 0i32, 106 | ::std::mem::size_of::(), 107 | ); 108 | memset( 109 | &mut frame_info as (*mut FrameInfo) as (*mut ::std::os::raw::c_void), 110 | 0i32, 111 | ::std::mem::size_of::(), 112 | ); 113 | let id3v2size: usize = mp3dec_skip_id3v2(buf, buf_size); 114 | if id3v2size > buf_size { 115 | } else { 116 | buf = buf.offset(id3v2size as (isize)); 117 | buf_size = buf_size.wrapping_sub(id3v2size); 118 | *dec = Mp3Dec::new(); 119 | let mut samples: i32; 120 | 'loop2: loop { 121 | samples = mp3dec_decode_frame( 122 | &mut *dec, 123 | ::std::slice::from_raw_parts(buf, buf_size), 124 | &mut pcm[..], 125 | &mut frame_info, 126 | ); 127 | buf = buf.offset(frame_info.frame_bytes as (isize)); 128 | buf_size = buf_size.wrapping_sub(frame_info.frame_bytes as (usize)); 129 | if samples != 0 { 130 | break; 131 | } 132 | if frame_info.frame_bytes == 0 { 133 | break; 134 | } 135 | } 136 | (if samples == 0 { 137 | } else { 138 | samples = samples * frame_info.channels; 139 | let mut allocated: usize = buf_size 140 | .wrapping_div(frame_info.frame_bytes as (usize)) 141 | .wrapping_mul(samples as (usize)) 142 | .wrapping_mul(::std::mem::size_of::()) 143 | .wrapping_add( 144 | ((1152i32 * 2i32) as (usize)).wrapping_mul(::std::mem::size_of::()), 145 | ); 146 | (*info).buffer = malloc(allocated) as (*mut i16); 147 | (if (*info).buffer.is_null() { 148 | } else { 149 | (*info).samples = samples as (usize); 150 | memcpy( 151 | (*info).buffer as (*mut ::std::os::raw::c_void), 152 | pcm.as_mut_ptr() as (*const ::std::os::raw::c_void), 153 | (*info).samples.wrapping_mul(::std::mem::size_of::()), 154 | ); 155 | (*info).channels = frame_info.channels; 156 | (*info).hz = frame_info.hz; 157 | (*info).layer = frame_info.layer; 158 | let mut avg_bitrate_kbps: usize = frame_info.bitrate_kbps as (usize); 159 | let mut frames: usize = 1usize; 160 | let mut frame_bytes: i32; 161 | 'loop7: loop { 162 | if allocated 163 | .wrapping_sub((*info).samples.wrapping_mul(::std::mem::size_of::())) 164 | < ((1152i32 * 2i32) as (usize)).wrapping_mul(::std::mem::size_of::()) 165 | { 166 | allocated = allocated.wrapping_mul(2usize); 167 | (*info).buffer = 168 | realloc((*info).buffer as (*mut ::std::os::raw::c_void), allocated) 169 | as (*mut i16); 170 | } 171 | // TODO: ooooh I hope the `allocated` value 172 | // here is correct! 173 | // mp3_decode_frame() doesn't actually need to 174 | // know the length though, it assumes the 175 | // buffer is a fixed size. 176 | let buffer_slice = ::std::slice::from_raw_parts_mut( 177 | (*info).buffer.offset((*info).samples as (isize)), 178 | allocated, 179 | ); 180 | samples = mp3dec_decode_frame( 181 | &mut *dec, 182 | ::std::slice::from_raw_parts(buf, buf_size), 183 | buffer_slice, 184 | // &*info.buffer[info.samples as usize..], 185 | &mut frame_info, 186 | ); 187 | frame_bytes = frame_info.frame_bytes; 188 | buf = buf.offset(frame_bytes as (isize)); 189 | buf_size = buf_size.wrapping_sub(frame_bytes as (usize)); 190 | if samples != 0 { 191 | if (*info).hz != frame_info.hz || (*info).layer != frame_info.layer { 192 | break; 193 | } 194 | if (*info).channels != 0 && ((*info).channels != frame_info.channels) { 195 | (*info).channels = 0i32; 196 | } 197 | (*info).samples = (*info) 198 | .samples 199 | .wrapping_add((samples * frame_info.channels) as (usize)); 200 | avg_bitrate_kbps = 201 | avg_bitrate_kbps.wrapping_add(frame_info.bitrate_kbps as (usize)); 202 | frames = frames.wrapping_add(1usize); 203 | progress_cb( 204 | user_data, 205 | orig_buf_size, 206 | orig_buf_size.wrapping_sub(buf_size), 207 | &mut frame_info as (*mut FrameInfo), 208 | ); 209 | } 210 | if frame_bytes == 0 { 211 | break; 212 | } 213 | } 214 | if allocated != (*info).samples.wrapping_mul(::std::mem::size_of::()) { 215 | (*info).buffer = realloc( 216 | (*info).buffer as (*mut ::std::os::raw::c_void), 217 | (*info).samples.wrapping_mul(::std::mem::size_of::()), 218 | ) as (*mut i16); 219 | } 220 | (*info).avg_bitrate_kbps = avg_bitrate_kbps.wrapping_div(frames) as (i32); 221 | }) 222 | }) 223 | } 224 | } 225 | 226 | pub unsafe fn mp3dec_iterate_buf( 227 | mut buf: *const u8, 228 | mut buf_size: usize, 229 | callback: unsafe fn(*mut ::std::os::raw::c_void, *const u8, i32, usize, *mut FrameInfo) -> i32, 230 | user_data: *mut ::std::os::raw::c_void, 231 | ) { 232 | let mut frame_info: FrameInfo = ::std::mem::zeroed(); 233 | memset( 234 | &mut frame_info as (*mut FrameInfo) as (*mut ::std::os::raw::c_void), 235 | 0i32, 236 | ::std::mem::size_of::(), 237 | ); 238 | let id3v2size: usize = mp3dec_skip_id3v2(buf, buf_size); 239 | (if id3v2size > buf_size { 240 | } else { 241 | let orig_buf: *const u8 = buf; 242 | buf = buf.offset(id3v2size as (isize)); 243 | buf_size = buf_size.wrapping_sub(id3v2size); 244 | 'loop3: loop { 245 | let mut free_format_bytes: i32 = 0i32; 246 | let mut frame_size: i32 = 0i32; 247 | let buf_slice = ::std::slice::from_raw_parts(buf, buf_size); 248 | let i: i32 = mp3d_find_frame( 249 | buf_slice, 250 | buf_size as (i32), 251 | &mut free_format_bytes, 252 | &mut frame_size, 253 | ); 254 | buf = buf.offset(i as (isize)); 255 | buf_size = buf_size.wrapping_sub(i as (usize)); 256 | if !(i != 0 && (frame_size == 0)) { 257 | if frame_size == 0 { 258 | break; 259 | } 260 | let hdr: &[u8] = ::std::slice::from_raw_parts(buf, buf_size); 261 | frame_info.channels = if hdr[3] as (i32) & 0xc0i32 == 0xc0i32 { 262 | 1i32 263 | } else { 264 | 2i32 265 | }; 266 | frame_info.hz = hdr_sample_rate_hz(hdr) as (i32); 267 | // TODO: Double-check precedence on this next line 268 | frame_info.layer = 4i32 - hdr[1] as (i32) >> 1i32 & 3i32; 269 | frame_info.bitrate_kbps = hdr_bitrate_kbps(hdr) as (i32); 270 | frame_info.frame_bytes = frame_size; 271 | if callback( 272 | user_data, 273 | hdr.as_ptr(), 274 | frame_size, 275 | ((hdr.as_ptr() as (isize)).wrapping_sub(orig_buf as (isize)) 276 | / ::std::mem::size_of::() as (isize)) as (usize), 277 | &mut frame_info as (*mut FrameInfo), 278 | ) != 0 279 | { 280 | break; 281 | } 282 | buf = buf.offset(frame_size as (isize)); 283 | buf_size = buf_size.wrapping_sub(frame_size as (usize)); 284 | } 285 | if false { 286 | break; 287 | } 288 | } 289 | }) 290 | } 291 | 292 | #[derive(Copy, Clone)] 293 | #[repr(C)] 294 | pub struct Mp3decMapInfo { 295 | pub buffer: *const u8, 296 | pub size: usize, 297 | } 298 | 299 | #[derive(Copy, Clone)] 300 | #[repr(C)] 301 | pub struct Mp3decEx { 302 | pub mp3d: Mp3Dec, 303 | pub file: Mp3decMapInfo, 304 | pub seek_method: i32, 305 | pub is_file: i32, 306 | } 307 | 308 | pub unsafe fn mp3dec_ex_open_buf( 309 | dec: *mut Mp3decEx, 310 | buf: *const u8, 311 | buf_size: usize, 312 | seek_method: i32, 313 | ) -> i32 { 314 | memset( 315 | dec as (*mut ::std::os::raw::c_void), 316 | 0i32, 317 | ::std::mem::size_of::(), 318 | ); 319 | 320 | (*dec).mp3d = Mp3Dec::new(); 321 | (*dec).file.buffer = buf; 322 | (*dec).file.size = buf_size; 323 | (*dec).seek_method = seek_method; 324 | 0i32 325 | } 326 | 327 | #[derive(Copy, Clone)] 328 | #[repr(C)] 329 | pub struct timespec { 330 | pub tv_sec: isize, 331 | pub tv_nsec: isize, 332 | } 333 | 334 | #[derive(Copy, Clone)] 335 | #[repr(C)] 336 | pub struct stat { 337 | pub st_dev: usize, 338 | pub st_ino: usize, 339 | pub st_nlink: usize, 340 | pub st_mode: u32, 341 | pub st_uid: u32, 342 | pub st_gid: u32, 343 | pub __pad0: i32, 344 | pub st_rdev: usize, 345 | pub st_size: isize, 346 | pub st_blksize: isize, 347 | pub st_blocks: isize, 348 | pub st_atim: timespec, 349 | pub st_mtim: timespec, 350 | pub st_ctim: timespec, 351 | pub __glibc_reserved: [isize; 3], 352 | } 353 | 354 | unsafe fn mp3dec_open_file(file_name: *const u8, map_info: *mut Mp3decMapInfo) -> i32 { 355 | let mut file: i32; 356 | let mut st: stat = ::std::mem::zeroed(); 357 | memset( 358 | map_info as (*mut ::std::os::raw::c_void), 359 | 0i32, 360 | ::std::mem::size_of::(), 361 | ); 362 | 'loop1: loop { 363 | file = open(file_name, 0o0i32); 364 | if !(file < 0i32 && (*__errno_location() == 11i32 || *__errno_location() == 4i32)) { 365 | break; 366 | } 367 | } 368 | if file < 0i32 || fstat(file, &mut st as (*mut stat)) < 0i32 { 369 | close(file); 370 | -1i32 371 | } else { 372 | (*map_info).size = st.st_size as (usize); 373 | 'loop4: loop { 374 | (*map_info).buffer = mmap( 375 | 0i32 as (*mut ::std::os::raw::c_void), 376 | st.st_size as (usize), 377 | 0x1i32, 378 | 0x2i32 | 0x8000i32, 379 | file, 380 | 0isize, 381 | ) as (*const u8); 382 | if !(-1i32 as (*mut ::std::os::raw::c_void) as (*const u8) == (*map_info).buffer 383 | && (*__errno_location() == 11i32 || *__errno_location() == 4i32)) 384 | { 385 | break; 386 | } 387 | } 388 | close(file); 389 | (if -1i32 as (*mut ::std::os::raw::c_void) as (*const u8) == (*map_info).buffer { 390 | -1i32 391 | } else { 392 | 0i32 393 | }) 394 | } 395 | } 396 | 397 | unsafe fn mp3dec_close_file(map_info: *mut Mp3decMapInfo) { 398 | if !(*map_info).buffer.is_null() 399 | && (-1i32 as (*mut ::std::os::raw::c_void) as (*const u8) != (*map_info).buffer) 400 | { 401 | munmap( 402 | (*map_info).buffer as (*mut ::std::os::raw::c_void), 403 | (*map_info).size, 404 | ); 405 | } 406 | (*map_info).buffer = 0i32 as (*const u8); 407 | (*map_info).size = 0usize; 408 | } 409 | 410 | pub unsafe fn mp3dec_load( 411 | dec: *mut Mp3Dec, 412 | file_name: *const u8, 413 | info: *mut Mp3decFileInfo, 414 | progress_cb: unsafe fn(*mut ::std::os::raw::c_void, usize, usize, *mut FrameInfo) -> i32, 415 | user_data: *mut ::std::os::raw::c_void, 416 | ) -> i32 { 417 | let ret: i32; 418 | let mut map_info: Mp3decMapInfo = ::std::mem::zeroed(); 419 | if { 420 | ret = mp3dec_open_file(file_name, &mut map_info as (*mut Mp3decMapInfo)); 421 | ret 422 | } != 0 423 | { 424 | ret 425 | } else { 426 | mp3dec_load_buf( 427 | dec, 428 | map_info.buffer, 429 | map_info.size, 430 | info, 431 | progress_cb, 432 | user_data, 433 | ); 434 | mp3dec_close_file(&mut map_info as (*mut Mp3decMapInfo)); 435 | 0i32 436 | } 437 | } 438 | 439 | pub unsafe fn mp3dec_iterate( 440 | file_name: *const u8, 441 | callback: unsafe fn(*mut ::std::os::raw::c_void, *const u8, i32, usize, *mut FrameInfo) -> i32, 442 | user_data: *mut ::std::os::raw::c_void, 443 | ) -> i32 { 444 | let ret: i32; 445 | let mut map_info: Mp3decMapInfo = ::std::mem::zeroed(); 446 | if { 447 | ret = mp3dec_open_file(file_name, &mut map_info as (*mut Mp3decMapInfo)); 448 | ret 449 | } != 0 450 | { 451 | ret 452 | } else { 453 | mp3dec_iterate_buf(map_info.buffer, map_info.size, callback, user_data); 454 | mp3dec_close_file(&mut map_info as (*mut Mp3decMapInfo)); 455 | 0i32 456 | } 457 | } 458 | 459 | pub unsafe fn mp3dec_ex_close(dec: *mut Mp3decEx) { 460 | if (*dec).is_file != 0 { 461 | mp3dec_close_file(&mut (*dec).file as (*mut Mp3decMapInfo)); 462 | } else { 463 | free((*dec).file.buffer as (*mut ::std::os::raw::c_void)); 464 | } 465 | memset( 466 | dec as (*mut ::std::os::raw::c_void), 467 | 0i32, 468 | ::std::mem::size_of::(), 469 | ); 470 | } 471 | 472 | pub unsafe fn mp3dec_ex_open(dec: *mut Mp3decEx, file_name: *const u8, seek_method: i32) -> i32 { 473 | let ret: i32; 474 | memset( 475 | dec as (*mut ::std::os::raw::c_void), 476 | 0i32, 477 | ::std::mem::size_of::(), 478 | ); 479 | if { 480 | ret = mp3dec_open_file(file_name, &mut (*dec).file as (*mut Mp3decMapInfo)); 481 | ret 482 | } != 0 483 | { 484 | ret 485 | } else { 486 | (*dec).seek_method = seek_method; 487 | (*dec).is_file = 1i32; 488 | 489 | (*dec).mp3d = Mp3Dec::new(); 490 | 0i32 491 | } 492 | } 493 | 494 | use std::fs; 495 | use std::io::Read; 496 | use std::path::PathBuf; 497 | use structopt::StructOpt; 498 | 499 | /// Basic command line stuff... 500 | #[derive(Debug, StructOpt)] 501 | #[structopt(name = "minimp3_test")] 502 | struct Opt { 503 | /// Input file. TODO: Valid input types? 504 | #[structopt(parse(from_os_str))] 505 | input_file: PathBuf, 506 | /// Output file. TODO: Valid output types? 507 | #[structopt(parse(from_os_str))] 508 | output_file: Option, 509 | } 510 | 511 | fn main() { 512 | let opt = Opt::from_args(); 513 | println!("{:?}", opt); 514 | 515 | let mp3d = &mut Mp3Dec::new(); 516 | let input_buf = &mut Vec::new(); 517 | { 518 | let mut f = fs::File::open(opt.input_file).expect("Input file not found"); 519 | f.read_to_end(input_buf).expect("Could not read input file"); 520 | } 521 | let mut data_start = mp3dec_skip_id3v2_slice(&input_buf); 522 | let output_buf = &mut Vec::new(); 523 | let mut total_frames = 1; 524 | let mut total_samples = 0; 525 | loop { 526 | let frame_info = &mut FrameInfo::default(); 527 | // Meh, allocation junk could be better 528 | let buf = &mut Vec::with_capacity(1152); 529 | buf.resize(1152, 0); 530 | let samples = mp3dec_decode_frame(mp3d, &mut input_buf[data_start..], buf, frame_info); 531 | output_buf.extend_from_slice(buf); 532 | total_samples += samples; 533 | total_frames += 1; 534 | println!("Frame info: {:#?}", frame_info); 535 | println!("Samples: {}, frames: {}", total_samples, total_frames); 536 | data_start += frame_info.frame_bytes as usize; 537 | if frame_info.frame_bytes == 0 { 538 | break; 539 | } 540 | } 541 | 542 | /* 543 | let mut i: i32; 544 | let data_bytes: i32; 545 | let mut total_samples: i32 = 0i32; 546 | let mut maxdiff: i32 = 0i32; 547 | let mut mse: f64 = 0.0f64; 548 | let psnr: f64; 549 | let mut info: Mp3decFileInfo = ::std::mem::zeroed(); 550 | unsafe fn callback( 551 | _: *mut ::std::os::raw::c_void, 552 | _: usize, 553 | _: usize, 554 | _: *mut FrameInfo, 555 | ) -> i32 { 556 | 0 557 | }; 558 | if mp3dec_load( 559 | &mut mp3d as (*mut Mp3Dec), 560 | input_file_name, 561 | &mut info as (*mut Mp3decFileInfo), 562 | callback, 563 | 0i32 as (*mut ::std::os::raw::c_void), 564 | ) != 0 565 | { 566 | printf((*b"error: file not found or read error\0").as_ptr()); 567 | exit(1i32); 568 | } 569 | let buffer: *mut i16 = info.buffer; 570 | if wave_out != 0 && !file_out.is_null() { 571 | fwrite( 572 | wav_header(0i32, 0i32, 0i32, 0i32).as_ptr() as (*const ::std::os::raw::c_void), 573 | 1usize, 574 | 44usize, 575 | file_out, 576 | ); 577 | } 578 | if info.samples != 0 { 579 | total_samples = (total_samples as (usize)).wrapping_add(info.samples) as (i32); 580 | if !buf_ref.is_null() { 581 | let max_samples: i32 = (if (ref_size as (usize)).wrapping_div(2usize) > info.samples { 582 | info.samples 583 | } else { 584 | (ref_size as (usize)).wrapping_div(2usize) 585 | }) as (i32); 586 | i = 0i32; 587 | 'loop7: loop { 588 | if !(i < max_samples) { 589 | break; 590 | } 591 | let mse_temp: i32 = abs(*buffer.offset(i as (isize)) as (i32) 592 | - read16le( 593 | &*buf_ref 594 | .offset((i as (usize)).wrapping_mul(::std::mem::size_of::()) 595 | as (isize)) as (*const u8) 596 | as (*const ::std::os::raw::c_void), 597 | ) as (i32)); 598 | if mse_temp > maxdiff { 599 | maxdiff = mse_temp; 600 | } 601 | mse = mse + (mse_temp as (f32) * mse_temp as (f32)) as (f64); 602 | i = i + 1; 603 | } 604 | } 605 | if !file_out.is_null() { 606 | fwrite( 607 | buffer as (*const ::std::os::raw::c_void), 608 | info.samples, 609 | ::std::mem::size_of::(), 610 | file_out, 611 | ); 612 | } 613 | free(buffer as (*mut ::std::os::raw::c_void)); 614 | } 615 | mse = mse / if total_samples != 0 { 616 | total_samples 617 | } else { 618 | 1i32 619 | } as (f64); 620 | if 0i32 as (f64) == mse { 621 | psnr = 99.0f64; 622 | } else { 623 | psnr = 10.0f64 * (0x7fffi32 as (f64) * 0x7fffi32 as (f64) / mse); 624 | } 625 | printf( 626 | (*b"rate=%d samples=%d max_diff=%d PSNR=%f\n\0").as_ptr(), 627 | info.hz, 628 | total_samples, 629 | maxdiff, 630 | psnr, 631 | ); 632 | if psnr < 96i32 as (f64) { 633 | printf((*b"PSNR compliance failed\n\0").as_ptr()); 634 | exit(1i32); 635 | } 636 | if wave_out != 0 && !file_out.is_null() { 637 | data_bytes = (ftell(file_out) - 44isize) as (i32); 638 | rewind(file_out); 639 | fwrite( 640 | wav_header(info.hz, info.channels, 16i32, data_bytes).as_ptr() 641 | as (*const ::std::os::raw::c_void), 642 | 1usize, 643 | 44usize, 644 | file_out, 645 | ); 646 | } 647 | 648 | */ 649 | 650 | return; 651 | /* 652 | use std::os::unix::ffi::OsStringExt; 653 | let mut argv_storage = ::std::env::args_os() 654 | .map(|str| { 655 | let mut vec = str.into_vec(); 656 | vec.push(b'\0'); 657 | vec 658 | }) 659 | .collect::>(); 660 | let mut argv = argv_storage 661 | .iter_mut() 662 | .map(|vec| vec.as_mut_ptr()) 663 | .chain(Some(::std::ptr::null_mut())) 664 | .collect::>(); 665 | let ret = unsafe { _c_main(argv_storage.len() as (i32), argv.as_mut_ptr()) }; 666 | ::std::process::exit(ret); 667 | */ 668 | } 669 | 670 | unsafe fn preload(file: *mut IoFile, data_size: *mut i32) -> *mut u8 { 671 | let data: *mut u8; 672 | *data_size = 0i32; 673 | if file.is_null() { 674 | 0i32 as (*mut u8) 675 | } else if fseek(file, 0isize, 2i32) != 0 { 676 | 0i32 as (*mut u8) 677 | } else { 678 | *data_size = ftell(file) as (i32); 679 | (if *data_size < 0i32 { 680 | 0i32 as (*mut u8) 681 | } else if fseek(file, 0isize, 0i32) != 0 { 682 | 0i32 as (*mut u8) 683 | } else { 684 | data = malloc(*data_size as (usize)) as (*mut u8); 685 | (if data.is_null() { 686 | 0i32 as (*mut u8) 687 | } else { 688 | if fread( 689 | data as (*mut ::std::os::raw::c_void), 690 | 1usize, 691 | *data_size as (usize), 692 | file, 693 | ) as (i32) 694 | != *data_size 695 | { 696 | exit(1i32); 697 | } 698 | data 699 | }) 700 | }) 701 | } 702 | } 703 | 704 | unsafe fn wav_header(hz: i32, ch: i32, bips: i32, data_bytes: i32) -> Vec { 705 | let hdr: &mut Vec = 706 | &mut Vec::from(&b"RIFFsizeWAVEfmt \x10\0\0\0\x01\0ch_hz_abpsbabsdatasize\0"[..]); 707 | let avg_bytes_per_sec: usize = (bips * ch * hz >> 3i32) as (usize); 708 | let block_align: u32 = (bips * ch >> 3i32) as (u32); 709 | *(hdr.as_mut_ptr().offset(0x4isize) as (*mut ::std::os::raw::c_void) as (*mut i32)) = 710 | 44i32 + data_bytes - 8i32; 711 | *(hdr.as_mut_ptr().offset(0x14isize) as (*mut ::std::os::raw::c_void) as (*mut i16)) = 1i16; 712 | *(hdr.as_mut_ptr().offset(0x16isize) as (*mut ::std::os::raw::c_void) as (*mut i16)) = 713 | ch as (i16); 714 | *(hdr.as_mut_ptr().offset(0x18isize) as (*mut ::std::os::raw::c_void) as (*mut i32)) = hz; 715 | *(hdr.as_mut_ptr().offset(0x1cisize) as (*mut ::std::os::raw::c_void) as (*mut i32)) = 716 | avg_bytes_per_sec as (i32); 717 | *(hdr.as_mut_ptr().offset(0x20isize) as (*mut ::std::os::raw::c_void) as (*mut i16)) = 718 | block_align as (i16); 719 | *(hdr.as_mut_ptr().offset(0x22isize) as (*mut ::std::os::raw::c_void) as (*mut i16)) = 720 | bips as (i16); 721 | *(hdr.as_mut_ptr().offset(0x28isize) as (*mut ::std::os::raw::c_void) as (*mut i32)) = 722 | data_bytes; 723 | hdr.clone() 724 | } 725 | 726 | unsafe fn read16le(p: *const ::std::os::raw::c_void) -> i16 { 727 | let src: *const u8 = p as (*const u8); 728 | (*src.offset(0isize) as (i32) << 0i32 | *src.offset(1isize) as (i32) << 8i32) as (i16) 729 | } 730 | 731 | unsafe fn decode_file( 732 | input_file_name: *const u8, 733 | buf_ref: *const u8, 734 | ref_size: i32, 735 | file_out: *mut IoFile, 736 | wave_out: i32, 737 | ) { 738 | let mut mp3d: Mp3Dec = ::std::mem::zeroed(); 739 | let mut i: i32; 740 | let data_bytes: i32; 741 | let mut total_samples: i32 = 0i32; 742 | let mut maxdiff: i32 = 0i32; 743 | let mut mse: f64 = 0.0f64; 744 | let psnr: f64; 745 | let mut info: Mp3decFileInfo = ::std::mem::zeroed(); 746 | unsafe fn callback( 747 | _: *mut ::std::os::raw::c_void, 748 | _: usize, 749 | _: usize, 750 | _: *mut FrameInfo, 751 | ) -> i32 { 752 | 0 753 | }; 754 | if mp3dec_load( 755 | &mut mp3d as (*mut Mp3Dec), 756 | input_file_name, 757 | &mut info as (*mut Mp3decFileInfo), 758 | callback, 759 | 0i32 as (*mut ::std::os::raw::c_void), 760 | ) != 0 761 | { 762 | printf((*b"error: file not found or read error\0").as_ptr()); 763 | exit(1i32); 764 | } 765 | let buffer: *mut i16 = info.buffer; 766 | if wave_out != 0 && !file_out.is_null() { 767 | fwrite( 768 | wav_header(0i32, 0i32, 0i32, 0i32).as_ptr() as (*const ::std::os::raw::c_void), 769 | 1usize, 770 | 44usize, 771 | file_out, 772 | ); 773 | } 774 | if info.samples != 0 { 775 | total_samples = (total_samples as (usize)).wrapping_add(info.samples) as (i32); 776 | if !buf_ref.is_null() { 777 | let max_samples: i32 = (if (ref_size as (usize)).wrapping_div(2usize) > info.samples { 778 | info.samples 779 | } else { 780 | (ref_size as (usize)).wrapping_div(2usize) 781 | }) as (i32); 782 | i = 0i32; 783 | 'loop7: loop { 784 | if !(i < max_samples) { 785 | break; 786 | } 787 | let mse_temp: i32 = abs(*buffer.offset(i as (isize)) as (i32) 788 | - read16le( 789 | &*buf_ref 790 | .offset((i as (usize)).wrapping_mul(::std::mem::size_of::()) 791 | as (isize)) as (*const u8) 792 | as (*const ::std::os::raw::c_void), 793 | ) as (i32)); 794 | if mse_temp > maxdiff { 795 | maxdiff = mse_temp; 796 | } 797 | mse = mse + (mse_temp as (f32) * mse_temp as (f32)) as (f64); 798 | i = i + 1; 799 | } 800 | } 801 | if !file_out.is_null() { 802 | fwrite( 803 | buffer as (*const ::std::os::raw::c_void), 804 | info.samples, 805 | ::std::mem::size_of::(), 806 | file_out, 807 | ); 808 | } 809 | free(buffer as (*mut ::std::os::raw::c_void)); 810 | } 811 | mse = mse / if total_samples != 0 { 812 | total_samples 813 | } else { 814 | 1i32 815 | } as (f64); 816 | if 0i32 as (f64) == mse { 817 | psnr = 99.0f64; 818 | } else { 819 | psnr = 10.0f64 * (0x7fffi32 as (f64) * 0x7fffi32 as (f64) / mse); 820 | } 821 | printf( 822 | (*b"rate=%d samples=%d max_diff=%d PSNR=%f\n\0").as_ptr(), 823 | info.hz, 824 | total_samples, 825 | maxdiff, 826 | psnr, 827 | ); 828 | if psnr < 96i32 as (f64) { 829 | printf((*b"PSNR compliance failed\n\0").as_ptr()); 830 | exit(1i32); 831 | } 832 | if wave_out != 0 && !file_out.is_null() { 833 | data_bytes = (ftell(file_out) - 44isize) as (i32); 834 | rewind(file_out); 835 | fwrite( 836 | wav_header(info.hz, info.channels, 16i32, data_bytes).as_ptr() 837 | as (*const ::std::os::raw::c_void), 838 | 1usize, 839 | 44usize, 840 | file_out, 841 | ); 842 | } 843 | } 844 | 845 | pub unsafe fn _c_main(argc: i32, argv: *mut *mut u8) -> i32 { 846 | let mut wave_out: i32 = 0i32; 847 | let mut ref_size: i32 = 0; 848 | let ref_file_name: *mut u8 = if argc > 2i32 { 849 | *argv.offset(2isize) 850 | } else { 851 | 0i32 as (*mut ::std::os::raw::c_void) as (*mut u8) 852 | }; 853 | let output_file_name: *mut u8 = if argc > 3i32 { 854 | *argv.offset(3isize) 855 | } else { 856 | 0i32 as (*mut ::std::os::raw::c_void) as (*mut u8) 857 | }; 858 | let mut file_out: *mut IoFile = 0i32 as (*mut ::std::os::raw::c_void) as (*mut IoFile); 859 | if !output_file_name.is_null() { 860 | file_out = fopen(output_file_name as (*const u8), (*b"wb\0").as_ptr()); 861 | let ext: *mut u8 = strrchr(output_file_name as (*const u8), b'.' as (i32)); 862 | if !ext.is_null() 863 | && (strcasecmp(ext.offset(1isize) as (*const u8), (*b"wav\0").as_ptr()) == 0) 864 | { 865 | wave_out = 1i32; 866 | } 867 | } 868 | let file_ref: *mut IoFile = if !ref_file_name.is_null() { 869 | fopen(ref_file_name as (*const u8), (*b"rb\0").as_ptr()) 870 | } else { 871 | 0i32 as (*mut ::std::os::raw::c_void) as (*mut IoFile) 872 | }; 873 | let buf_ref: *mut u8 = preload(file_ref, &mut ref_size as (*mut i32)); 874 | if !file_ref.is_null() { 875 | fclose(file_ref); 876 | } 877 | let input_file_name: *mut u8 = if argc > 1i32 { 878 | *argv.offset(1isize) 879 | } else { 880 | 0i32 as (*mut ::std::os::raw::c_void) as (*mut u8) 881 | }; 882 | if input_file_name.is_null() { 883 | printf((*b"error: no file names given\n\0").as_ptr()); 884 | 1i32 885 | } else { 886 | decode_file( 887 | input_file_name as (*const u8), 888 | buf_ref as (*const u8), 889 | ref_size, 890 | file_out, 891 | wave_out, 892 | ); 893 | if !buf_ref.is_null() { 894 | free(buf_ref as (*mut ::std::os::raw::c_void)); 895 | } 896 | if !file_out.is_null() { 897 | fclose(file_out); 898 | } 899 | 0i32 900 | } 901 | } 902 | -------------------------------------------------------------------------------- /src/huffman.rs: -------------------------------------------------------------------------------- 1 | use super::*; 2 | use byteorder::{ByteOrder, BE}; 3 | 4 | fn next_byte(buf: &mut &[u8]) -> u8 { 5 | let head = buf[0]; 6 | *buf = &buf[1..]; 7 | head 8 | } 9 | 10 | pub(crate) fn l3_huffman( 11 | mut dst: &mut [f32], 12 | bs: &mut Bs, 13 | gr_info: &L3GrInfo, 14 | mut scf: &[f32], 15 | layer3gr_limit: i32, 16 | ) { 17 | static TABS: [i16; 512] = [ 18 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19 | 0, 0, 785, 785, 785, 785, 784, 784, 784, 784, 513, 513, 513, 513, 513, 513, 513, 513, 256, 20 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, -255, 1313, 21 | 1298, 1282, 785, 785, 785, 785, 784, 784, 784, 784, 769, 769, 769, 769, 256, 256, 256, 256, 22 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 290, 288, -255, 1313, 1298, 23 | 1282, 769, 769, 769, 769, 529, 529, 529, 529, 529, 529, 529, 529, 528, 528, 528, 528, 528, 24 | 528, 528, 528, 512, 512, 512, 512, 512, 512, 512, 512, 290, 288, -253, -318, -351, -367, 25 | 785, 785, 785, 785, 784, 784, 784, 784, 769, 769, 769, 769, 256, 256, 256, 256, 256, 256, 26 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 819, 818, 547, 547, 275, 275, 275, 275, 27 | 561, 560, 515, 546, 289, 274, 288, 258, -254, -287, 1329, 1299, 1314, 1312, 1057, 1057, 28 | 1042, 1042, 1026, 1026, 784, 784, 784, 784, 529, 529, 529, 529, 529, 529, 529, 529, 769, 29 | 769, 769, 769, 768, 768, 768, 768, 563, 560, 306, 306, 291, 259, -252, -413, -477, -542, 30 | 1298, -575, 1041, 1041, 784, 784, 784, 784, 769, 769, 769, 769, 256, 256, 256, 256, 256, 31 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, -383, -399, 1107, 1092, 1106, 1061, 32 | 849, 849, 789, 789, 1104, 1091, 773, 773, 1076, 1075, 341, 340, 325, 309, 834, 804, 577, 33 | 577, 532, 532, 516, 516, 832, 818, 803, 816, 561, 561, 531, 531, 515, 546, 289, 289, 288, 34 | 258, -252, -429, -493, -559, 1057, 1057, 1042, 1042, 529, 529, 529, 529, 529, 529, 529, 35 | 529, 784, 784, 784, 784, 769, 769, 769, 769, 512, 512, 512, 512, 512, 512, 512, 512, -382, 36 | 1077, -415, 1106, 1061, 1104, 849, 849, 789, 789, 1091, 1076, 1029, 1075, 834, 834, 597, 37 | 581, 340, 340, 339, 324, 804, 833, 532, 532, 832, 772, 818, 803, 817, 787, 816, 771, 290, 38 | 290, 290, 290, 288, 258, -253, -349, -414, -447, -463, 1329, 1299, -479, 1314, 1312, 1057, 39 | 1057, 1042, 1042, 1026, 1026, 785, 785, 785, 785, 784, 784, 784, 784, 769, 769, 769, 769, 40 | 768, 768, 768, 768, -319, 851, 821, -335, 836, 850, 805, 849, 341, 340, 325, 336, 533, 533, 41 | 579, 579, 564, 564, 773, 832, 578, 548, 563, 516, 321, 276, 306, 291, 304, 259, -251, -572, 42 | -733, -830, -863, -879, 1041, 1041, 784, 784, 784, 784, 769, 769, 769, 769, 256, 256, 256, 43 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, -511, -527, -543, 1396, 44 | 1351, 1381, 1366, 1395, 1335, 1380, -559, 1334, 1138, 1138, 1063, 1063, 1350, 1392, 1031, 45 | 1031, 1062, 1062, 1364, 1363, 1120, 1120, 1333, 1348, 881, 881, 881, 881, 375, 374, 359, 46 | 373, 343, 358, 341, 325, 791, 791, 1123, 1122, -703, 1105, 1045, -719, 865, 865, 790, 790, 47 | 774, 774, 48 | ]; 49 | static TAB32: [u8; 28] = [ 50 | 130, 162, 193, 209, 44, 28, 76, 140, 9, 9, 9, 9, 9, 9, 9, 9, 190, 254, 222, 238, 126, 94, 51 | 157, 157, 109, 61, 173, 205, 52 | ]; 53 | static TAB33: [u8; 16] = [ 54 | 252, 236, 220, 204, 188, 172, 156, 140, 124, 108, 92, 76, 60, 44, 28, 12, 55 | ]; 56 | static TABINDEX: [i16; 32] = [ 57 | 0, 32, 64, 98, 0, 132, 180, 218, 292, 364, 426, 538, 648, 746, 0, 1126, 1460, 1460, 1460, 58 | 1460, 1460, 1460, 1460, 1460, 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842, 59 | ]; 60 | static G_LINBITS: [u8; 32] = [ 61 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 8, 10, 13, 4, 5, 6, 7, 8, 9, 62 | 11, 13, 63 | ]; 64 | let mut one: f32 = 0.0; 65 | let mut ireg: i32 = 0; 66 | let mut big_val_cnt: i32 = (*gr_info).big_values as (i32); 67 | let mut sfb: &[u8] = (*gr_info).sfbtab; 68 | 69 | let mut bs_cache: u32 = BE::read_u32(&bs.buf[(bs.pos as usize / 8)..]); 70 | let mut pairs_to_decode: i32; 71 | let mut np: i32; 72 | let mut bs_sh: i32 = ((*bs).pos & 7) - 8; 73 | let mut bs_next_ptr = &bs.buf[(bs.pos as usize / 8) + 4..]; 74 | loop { 75 | if !(big_val_cnt > 0) { 76 | break; 77 | } 78 | let tab_num: i32 = (*gr_info).table_select[ireg as usize] as (i32); 79 | let mut sfb_cnt: i32 = 80 | (*gr_info).region_count[{ 81 | let _old = ireg; 82 | ireg = ireg + 1; 83 | _old 84 | } as usize] as (i32); 85 | let codebook: &[i16] = &TABS[TABINDEX[tab_num as usize] as usize..]; 86 | let linbits: i32 = G_LINBITS[tab_num as usize] as (i32); 87 | loop { 88 | np = { 89 | let _old = sfb; 90 | // sfb = sfb.offset(1); 91 | increment_by(&mut sfb, 1); 92 | _old[0] 93 | } as (i32) 94 | / 2; 95 | pairs_to_decode = if big_val_cnt > np { np } else { big_val_cnt }; 96 | // one = *{ 97 | // let _old = scf; 98 | // scf = scf.offset(1); 99 | // _old 100 | // }; 101 | one = scf[0]; 102 | increment_by(&mut scf, 1); 103 | loop { 104 | let mut j: i32; 105 | let mut w: i32 = 5; 106 | let mut leaf: i32 = codebook[(bs_cache >> (32 - w)) as usize] as i32; 107 | loop { 108 | if !(leaf < 0) { 109 | break; 110 | } 111 | bs_cache = bs_cache << w; 112 | bs_sh = bs_sh + w; 113 | w = leaf & 7; 114 | // TODO: Check that this shouldn't be `wrapping_shr(32) - w, though that doesn't seem sensible. 115 | leaf = codebook[(bs_cache.wrapping_shr((32 - w) as u32)) 116 | .wrapping_sub((leaf >> 3) as (u32)) 117 | as usize] as i32; 118 | } 119 | // bs_cache = bs_cache << (leaf >> 8); 120 | bs_cache = bs_cache.wrapping_shl((leaf >> 8) as u32); 121 | bs_sh = bs_sh + (leaf >> 8); 122 | j = 0; 123 | loop { 124 | if !(j < 2) { 125 | break; 126 | } 127 | let mut lsb: i32 = leaf & 0xfi32; 128 | if lsb == 15 && (linbits != 0) { 129 | lsb = (lsb as (u32)).wrapping_add(bs_cache >> (32 - linbits)) as (i32); 130 | bs_cache = bs_cache << linbits; 131 | bs_sh = bs_sh + linbits; 132 | loop { 133 | if !(bs_sh >= 0) { 134 | break; 135 | } 136 | bs_cache = bs_cache | next_byte(&mut bs_next_ptr) as (u32) << bs_sh; 137 | bs_sh = bs_sh - 8; 138 | } 139 | dst[0] = one 140 | * l3_pow_43(lsb) 141 | * if bs_cache as (i32) < 0 { -1 } else { 1 } as f32; 142 | } else { 143 | dst[0] = GPOW43[((16 + lsb) as (u32)) 144 | .wrapping_sub(16u32.wrapping_mul(bs_cache >> 31)) 145 | as usize] 146 | * one; 147 | } 148 | bs_cache = bs_cache << if lsb != 0 { 1 } else { 0 }; 149 | bs_sh = bs_sh + if lsb != 0 { 1 } else { 0 }; 150 | j = j + 1; 151 | // dst = dst.offset(1); 152 | increment_by_mut(&mut dst, 1); 153 | leaf = leaf >> 4; 154 | } 155 | loop { 156 | if !(bs_sh >= 0) { 157 | break; 158 | } 159 | bs_cache = (bs_cache | next_byte(&mut bs_next_ptr) as (u32)) 160 | .wrapping_shl(bs_sh as u32); 161 | bs_sh = bs_sh - 8; 162 | } 163 | if { 164 | pairs_to_decode = pairs_to_decode - 1; 165 | pairs_to_decode 166 | } == 0 167 | { 168 | break; 169 | } 170 | } 171 | if !({ 172 | big_val_cnt = big_val_cnt - np; 173 | big_val_cnt 174 | } > 0 175 | && ({ 176 | sfb_cnt = sfb_cnt - 1; 177 | sfb_cnt 178 | } >= 0)) 179 | { 180 | break; 181 | } 182 | } 183 | } 184 | np = 1 - big_val_cnt; 185 | loop { 186 | let codebook_count1: &[u8] = if (*gr_info).count1_table != 0 { 187 | &TAB33 188 | } else { 189 | &TAB32 190 | }; 191 | let mut leaf: i32 = codebook_count1[(bs_cache >> (32 - 4)) as usize] as (i32); 192 | if leaf & 8 == 0 { 193 | leaf = codebook_count1 194 | [((leaf >> 3) as (u32)).wrapping_add(bs_cache << 4 >> (32 - (leaf & 3))) as usize] 195 | as (i32); 196 | } 197 | bs_cache = bs_cache << (leaf & 7); 198 | bs_sh = bs_sh + (leaf & 7); 199 | if (bs_next_ptr.as_ptr() as isize).wrapping_sub((*bs).buf.as_ptr() as isize) 200 | / ::std::mem::size_of::() as isize 201 | * 8 202 | - 24 203 | + bs_sh as isize 204 | > layer3gr_limit as isize 205 | { 206 | break; 207 | } 208 | if { 209 | np = np - 1; 210 | np 211 | } == 0 212 | { 213 | np = { 214 | let _old = sfb[0]; 215 | increment_by(&mut sfb, 1); 216 | _old 217 | } as (i32) 218 | / 2; 219 | if np == 0 { 220 | break; 221 | } 222 | // one = *{ 223 | // let _old = scf; 224 | // scf = scf.offset(1); 225 | // _old 226 | // }; 227 | one = scf[0]; 228 | increment_by(&mut scf, 1); 229 | } 230 | if leaf & 128 >> 0 != 0 { 231 | dst[0] = if bs_cache as (i32) < 0 { -one } else { one }; 232 | bs_cache = bs_cache << 1; 233 | bs_sh = bs_sh + 1; 234 | } 235 | if leaf & 128 >> 1 != 0 { 236 | dst[1] = if bs_cache as (i32) < 0 { -one } else { one }; 237 | bs_cache = bs_cache << 1; 238 | bs_sh = bs_sh + 1; 239 | } 240 | if { 241 | np = np - 1; 242 | np 243 | } == 0 244 | { 245 | np = { 246 | let _old = sfb[0]; 247 | increment_by(&mut sfb, 1); 248 | _old 249 | } as (i32) 250 | / 2; 251 | if np == 0 { 252 | break; 253 | } 254 | // one = *{ 255 | // let _old = scf; 256 | // scf = scf.offset(1); 257 | // _old 258 | // }; 259 | one = scf[0]; 260 | increment_by(&mut scf, 1); 261 | } 262 | if leaf & 128 >> 2 != 0 { 263 | dst[2] = if bs_cache as (i32) < 0 { -one } else { one }; 264 | bs_cache = bs_cache << 1; 265 | bs_sh = bs_sh + 1; 266 | } 267 | if leaf & 128 >> 3 != 0 { 268 | dst[3] = if bs_cache as (i32) < 0 { -one } else { one }; 269 | bs_cache = bs_cache << 1; 270 | bs_sh = bs_sh + 1; 271 | } 272 | loop { 273 | if !(bs_sh >= 0) { 274 | break; 275 | } 276 | bs_cache = bs_cache | next_byte(&mut bs_next_ptr) as (u32) << bs_sh; 277 | bs_sh = bs_sh - 8; 278 | } 279 | // dst = dst.offset(4); 280 | increment_by_mut(&mut dst, 4); 281 | } 282 | (*bs).pos = layer3gr_limit; 283 | } 284 | -------------------------------------------------------------------------------- /src/oldlib.rs: -------------------------------------------------------------------------------- 1 | extern crate byteorder; 2 | // use byteorder::{WriteBytesExt, LE}; 3 | 4 | // use std::io::{self, Cursor, Read, Write}; 5 | 6 | pub const MAX_SAMPLES_PER_FRAME: usize = 1152 * 2; 7 | /// More than ISO spec's 8 | pub const MAX_FREE_FORMAT_FRAME_SIZE: usize = 2304; 9 | pub const MAX_FRAME_SYNC_MATCHES: usize = 10; 10 | 11 | /// MUST be >= 320000/8/32000*1152 = 1440 12 | pub const MAX_L3_FRAME_PAYLOAD_BYTES: usize = MAX_FREE_FORMAT_FRAME_SIZE; 13 | 14 | pub const MAX_BITRESERVOIR_BYTES: usize = 511; 15 | pub const SHORT_BLOCK_TYPE: usize = 2; 16 | pub const STOP_BLOCK_TYPE: usize = 3; 17 | pub const MODE_MONO: usize = 3; 18 | pub const MODE_JOINT_STEREO: usize = 1; 19 | pub const HDR_SIZE: usize = 4; 20 | 21 | pub mod corrode_test; 22 | 23 | pub fn hdr_is_mono(h: &[u8]) -> bool { 24 | // TODO: Might be nicer ways to do these bit-tests 25 | (h[3] & 0xC0) == 0xC0 26 | } 27 | 28 | pub fn hdr_is_ms_stereo(h: &[u8]) -> bool { 29 | (h[3] & 0xE0) == 0x60 30 | } 31 | 32 | pub fn hdr_is_free_format(h: &[u8]) -> bool { 33 | (h[2] & 0xF0) == 0 34 | } 35 | 36 | pub fn hdr_is_crc(h: &[u8]) -> bool { 37 | // TODO: Double-check 38 | (h[1] & 1) == 0 39 | } 40 | 41 | pub fn hdr_test_padding(h: &[u8]) -> bool { 42 | (h[2] & 0x2) != 0 43 | } 44 | 45 | pub fn hdr_test_mpeg1(h: &[u8]) -> bool { 46 | (h[1] & 0x08) != 0 47 | } 48 | 49 | pub fn hdr_test_not_mpeg25(h: &[u8]) -> bool { 50 | (h[1] & 0x10) != 0 51 | } 52 | 53 | pub fn hdr_test_i_stereo(h: &[u8]) -> bool { 54 | (h[3] & 0x10) != 0 55 | } 56 | 57 | pub fn hdr_test_ms_stereo(h: &[u8]) -> bool { 58 | (h[3] & 0x20) != 0 59 | } 60 | 61 | pub fn hdr_get_stereo_mode(h: &[u8]) -> u8 { 62 | ((h[3] >> 6) & 3) 63 | } 64 | 65 | pub fn hdr_get_stereo_mode_ext(h: &[u8]) -> u8 { 66 | ((h[3] >> 4) & 3) 67 | } 68 | 69 | pub fn hdr_get_layer(h: &[u8]) -> u8 { 70 | ((h[1] >> 1) & 3) 71 | } 72 | 73 | pub fn hdr_get_bitrate(h: &[u8]) -> u8 { 74 | (h[2] >> 4) 75 | } 76 | 77 | pub fn hdr_get_sample_rate(h: &[u8]) -> u8 { 78 | ((h[2] >> 2) & 3) 79 | } 80 | 81 | pub fn hdr_is_frame_576(h: &[u8]) -> bool { 82 | (h[1] & 14) == 2 83 | } 84 | 85 | pub fn hdr_is_layer_1(h: &[u8]) -> bool { 86 | (h[1] & 6) == 6 87 | } 88 | 89 | pub const BITS_DEQUANTIZER_OUT: i32 = -1; 90 | pub const MAX_SCF: i32 = 255 + BITS_DEQUANTIZER_OUT * 4 - 210; 91 | pub const MAX_SCFI: i32 = (MAX_SCF + 3) & !3; 92 | 93 | pub struct FrameInfo { 94 | pub frame_bytes: i32, 95 | pub channels: i32, 96 | pub hz: i32, 97 | pub layers: i32, 98 | pub bitrate_kbps: i32, 99 | } 100 | 101 | pub struct Mp3Dec { 102 | pub mdct_overlap: [[f32; 2]; 9 * 32], 103 | pub qmf_state: [f32; 15 * 2 * 32], 104 | pub reserv: i32, 105 | pub free_format_bytes: i32, 106 | pub header: [u8; 4], 107 | pub reserv_buf: [u8; 511], 108 | } 109 | 110 | // TODO: float vs. int16 output? 111 | // type Mp3Sample = i16; 112 | 113 | // pub fn decode_frame( 114 | // dec: &Mp3Dec, 115 | // mp3: &[u8], 116 | // mp3_bytes: usize, 117 | // pcm: &[Mp3Sample], 118 | // info: &FrameInfo, 119 | // ) -> i32 { 120 | // 0 121 | // } 122 | 123 | pub struct Bs { 124 | pub buf: Vec, 125 | pub pos: usize, 126 | pub limit: usize, 127 | } 128 | 129 | pub struct L12ScaleInfo { 130 | pub scf: [f32; 3 * 64], 131 | pub total_bands: u8, 132 | pub stereo_bands: u8, 133 | pub bitalloc: [u8; 64], 134 | pub scfcod: [u8; 64], 135 | } 136 | 137 | pub struct L12SubbandAlloc { 138 | pub tab_offset: u8, 139 | pub code_tab_width: u8, 140 | pub band_count: u8, 141 | } 142 | 143 | pub struct L3GrInfo { 144 | pub sfbtab: Vec, 145 | pub part_23_length: u16, 146 | pub big_values: u16, 147 | pub scalefac_compress: u16, 148 | pub global_gain: u8, 149 | pub block_type: u8, 150 | pub mixed_block_flag: u8, 151 | pub n_long_sfb: u8, 152 | pub n_short_sfb: u8, 153 | pub table_select: [u8; 3], 154 | pub region_count: [u8; 3], 155 | pub subblock_gain: [u8; 3], 156 | pub preflag: u8, 157 | pub scalefac_scale: u8, 158 | pub count1_table: u8, 159 | pub scfsi: u8, 160 | } 161 | 162 | pub struct Mp3DecScratch { 163 | pub bs: Bs, 164 | pub maindata: [u8; MAX_BITRESERVOIR_BYTES + MAX_L3_FRAME_PAYLOAD_BYTES], 165 | pub gr_info: [L3GrInfo; 3], 166 | pub grbuf: [[f32; 576]; 2], 167 | pub scf: [f32; 40], 168 | pub syn: [[f32; 2 * 32]; 18 + 15], 169 | pub ist_pos: [[u8; 39]; 2], 170 | } 171 | 172 | impl Bs { 173 | pub fn new(data: Vec, bytes: usize) -> Self { 174 | Self { 175 | buf: data, 176 | pos: 0, 177 | limit: bytes * 8, 178 | } 179 | } 180 | 181 | /// Heckin... this is way more complicated than it 182 | /// needs to be here... 183 | pub fn get_bits(&mut self, n: u32) -> u32 { 184 | let mut next: u32; 185 | let mut cache: u32 = 0; 186 | let s = (self.pos & 7) as u32; 187 | let mut shl: i32 = n as i32 + s as i32; 188 | let mut p = self.pos as u32 / 8; 189 | if self.pos + (n as usize) > self.limit { 190 | return 0; 191 | } 192 | self.pos += n as usize; 193 | p += 1; 194 | next = p & (255 >> s); 195 | while shl > 0 { 196 | shl -= 8; 197 | cache |= next << shl; 198 | next = p; 199 | p += 1; 200 | } 201 | return cache | (next >> -shl); 202 | } 203 | } 204 | 205 | /* 206 | pub fn hdr_valid(h: &[u8]) -> bool { 207 | h[0] == 0xFF 208 | && ((h[1] & 0xF0) == 0xF0 || (h[1] & 0xFE) == 0xE2) 209 | && hdr_get_layer(h) != 0 210 | && hdr_get_bitrate(h) != 15 211 | && hdr_get_sample_rate(h) != 3 212 | } 213 | 214 | pub fn hdr_compare(h1: &[u8], h2: &[u8]) -> bool { 215 | hdr_valid(h2) 216 | && ((h1[1] ^ h2[1]) & 0xFE) == 0 217 | && ((h1[2] ^ h2[2]) & 0x0C) == 0 218 | && !(hdr_is_free_format(h1) ^ hdr_is_free_format(h2)) 219 | } 220 | 221 | pub fn hdr_bitrate_kbps(h: &[u8]) -> u32 { 222 | let halfrate: [[[u32; 15]; 3]; 2] = [ 223 | [ 224 | [0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80], 225 | [0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80], 226 | [0, 16, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96, 112, 128], 227 | ], 228 | [ 229 | [0, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160], 230 | [ 231 | 0, 16, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 232 | ], 233 | [ 234 | 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 235 | ], 236 | ], 237 | ]; 238 | 2 * halfrate[hdr_test_mpeg1(h) as usize][hdr_get_layer(h) as usize - 1] 239 | [hdr_get_bitrate(h) as usize] 240 | } 241 | 242 | pub fn hdr_sample_rate_hz(h: &[u8]) -> u32 { 243 | let g_hz: [u32; 3] = [44100, 48000, 32000]; 244 | g_hz[hdr_get_sample_rate(h) as usize] 245 | >> (!hdr_test_mpeg1(h)) as u32 246 | >> (!hdr_test_not_mpeg25(h)) as u32 247 | } 248 | 249 | pub fn hdr_frame_samples(h: &[u8]) -> u32 { 250 | if hdr_is_layer_1(h) { 251 | 384 252 | } else { 253 | 1152 >> (hdr_is_frame_576(h) as i32) 254 | } 255 | } 256 | 257 | pub fn hdr_frame_bytes(h: &[u8], free_format_size: u32) -> u32 { 258 | let mut frame_bytes = hdr_frame_samples(h) * hdr_bitrate_kbps(h) * 125 / hdr_sample_rate_hz(h); 259 | if hdr_is_layer_1(h) { 260 | // Slot align 261 | frame_bytes &= !3; 262 | } 263 | if frame_bytes != 0 { 264 | frame_bytes 265 | } else { 266 | free_format_size 267 | } 268 | } 269 | 270 | pub fn hdr_padding(h: &[u8]) -> u32 { 271 | if hdr_test_padding(h) { 272 | if hdr_is_layer_1(h) { 273 | 4 274 | } else { 275 | 1 276 | } 277 | } else { 278 | 0 279 | } 280 | } 281 | pub fn L12_subband_alloc_table(hdr: &[u8], sci: &mut L12ScaleInfo) -> Vec { 282 | let mode = hdr_get_stereo_mode(hdr) as usize; 283 | let mut nbands; 284 | let mut alloc: Vec = vec![]; 285 | let stereo_bands = if mode == MODE_MONO { 286 | 0 287 | } else if mode == MODE_JOINT_STEREO { 288 | (hdr_get_stereo_mode_ext(hdr) << 2) + 4 289 | } else { 290 | 32 291 | }; 292 | if hdr_is_layer_1(hdr) { 293 | alloc.push(L12SubbandAlloc { 294 | tab_offset: 76, 295 | code_tab_width: 4, 296 | band_count: 32, 297 | }); 298 | nbands = 32; 299 | } else if !hdr_test_mpeg1(hdr) { 300 | alloc.push(L12SubbandAlloc { 301 | tab_offset: 60, 302 | code_tab_width: 4, 303 | band_count: 4, 304 | }); 305 | alloc.push(L12SubbandAlloc { 306 | tab_offset: 44, 307 | code_tab_width: 3, 308 | band_count: 7, 309 | }); 310 | alloc.push(L12SubbandAlloc { 311 | tab_offset: 44, 312 | code_tab_width: 2, 313 | band_count: 19, 314 | }); 315 | nbands = 30; 316 | } else { 317 | let sample_rate_idx = hdr_get_sample_rate(hdr); 318 | // TODO: Clean up this comparison 319 | let mut kbps = hdr_bitrate_kbps(hdr) >> ((mode != MODE_MONO) as u32); 320 | if kbps == 0 { 321 | kbps = 192; 322 | } 323 | alloc.push(L12SubbandAlloc { 324 | tab_offset: 0, 325 | code_tab_width: 4, 326 | band_count: 3, 327 | }); 328 | alloc.push(L12SubbandAlloc { 329 | tab_offset: 16, 330 | code_tab_width: 4, 331 | band_count: 8, 332 | }); 333 | alloc.push(L12SubbandAlloc { 334 | tab_offset: 32, 335 | code_tab_width: 3, 336 | band_count: 12, 337 | }); 338 | alloc.push(L12SubbandAlloc { 339 | tab_offset: 40, 340 | code_tab_width: 2, 341 | band_count: 7, 342 | }); 343 | nbands = 27; 344 | if kbps < 56 { 345 | alloc.clear(); 346 | alloc.push(L12SubbandAlloc { 347 | tab_offset: 44, 348 | code_tab_width: 4, 349 | band_count: 2, 350 | }); 351 | alloc.push(L12SubbandAlloc { 352 | tab_offset: 44, 353 | code_tab_width: 3, 354 | band_count: 10, 355 | }); 356 | nbands = if sample_rate_idx == 2 { 12 } else { 8 }; 357 | } else if (kbps >= 96 && sample_rate_idx != 1) { 358 | // TODO: sigh, and possibly weep. 359 | // I think this basically just chops off the last few 360 | // entries in the alloc defined above the previous if 361 | // statement. 362 | nbands = 30; 363 | } 364 | } 365 | sci.total_bands = nbands; 366 | sci.stereo_bands = u8::min(stereo_bands, nbands); 367 | alloc 368 | } 369 | 370 | pub fn L12_read_scalefactors(bs: &mut Bs, pba: &[u8], scfcod: &[u8], bands: usize, scf: &mut [f32]) { 371 | // TODO: The C version uses macros to build this array statically, 372 | // which is a PITA so for now we just do it the simple and slower way. 373 | let mut g_deq_L12: Vec = vec![]; 374 | { 375 | let mut DQ = |x: f32| { 376 | g_deq_L12.push(9.53674316e-07 / x); 377 | g_deq_L12.push(7.56931807e-07 / x); 378 | g_deq_L12.push(6.00777173e-07 / x); 379 | }; 380 | 381 | DQ(3.0); 382 | DQ(7.0); 383 | DQ(15.0); 384 | DQ(31.0); 385 | DQ(63.0); 386 | DQ(127.0); 387 | DQ(255.0); 388 | DQ(511.0); 389 | DQ(1023.0); 390 | DQ(2047.0); 391 | DQ(4095.0); 392 | DQ(8191.0); 393 | DQ(16383.0); 394 | DQ(32767.0); 395 | DQ(65535.0); 396 | DQ(3.0); 397 | DQ(5.0); 398 | DQ(9.0); 399 | } 400 | let mut scf_idx = 0; 401 | for i in 0..bands { 402 | let ba = pba[i]; 403 | let mask = if ba != 0 { 404 | 4 + ((19 >> scfcod[i]) & 3) 405 | } else { 406 | 0 407 | }; 408 | let mut m = 4; 409 | while m != 0 { 410 | let s; 411 | if (mask & m) != 0 { 412 | let b = bs.get_bits(6); 413 | let idx = (ba as u32 * 3 - 6 + b % 3) as usize; 414 | s = g_deq_L12[idx] * (1 << 21 >> (b / 3)) as f32; 415 | } else { 416 | s = 0.0; 417 | } 418 | // TODO: Check the post and pre-increment order here!!! 419 | scf[scf_idx] = s; 420 | scf_idx += 1; 421 | } 422 | } 423 | } 424 | 425 | pub fn L12_read_scale_info(hdr: &[u8], bs: &mut Bs, sci: &mut L12ScaleInfo) { 426 | let g_bitalloc_code_tab: &[u8] = &[ 427 | 0, 17, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 17, 18, 3, 19, 4, 5, 6, 7, 8, 9, 428 | 10, 11, 12, 13, 16, 0, 17, 18, 3, 19, 4, 5, 16, 0, 17, 18, 16, 0, 17, 18, 19, 4, 5, 6, 7, 429 | 8, 9, 10, 11, 12, 13, 14, 15, 0, 17, 18, 3, 19, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 2, 430 | 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 431 | ]; 432 | let subband_alloc = L12_subband_alloc_table(hdr, sci); 433 | let mut subband_alloc_idx = 0; 434 | let mut k: usize = 0; 435 | let mut ba_bits = 0; 436 | let mut ba_code_tab_idx: usize = 0; 437 | for i in 0..(sci.total_bands as usize) { 438 | let ba: u8; 439 | if i == k { 440 | let sb = &subband_alloc[subband_alloc_idx]; 441 | k += sb.band_count as usize; 442 | ba_bits = sb.code_tab_width; 443 | ba_code_tab_idx = sb.tab_offset as usize; 444 | subband_alloc_idx += 1; 445 | } 446 | let ba_idx: usize = ba_code_tab_idx + (bs.get_bits(ba_bits as u32) as usize); 447 | ba = g_bitalloc_code_tab[ba_idx]; 448 | sci.bitalloc[2 * i + 1] = if sci.stereo_bands != 0 { ba } else { 0 }; 449 | } 450 | 451 | for i in 0..(2 * sci.total_bands as usize) { 452 | sci.scfcod[i] = if sci.bitalloc[i] != 0 { 453 | if hdr_is_layer_1(hdr) { 454 | 2 455 | } else { 456 | bs.get_bits(2) as u8 457 | } 458 | } else { 459 | 6 460 | }; 461 | } 462 | 463 | L12_read_scalefactors( 464 | bs, 465 | &sci.bitalloc, 466 | &sci.scfcod, 467 | (sci.total_bands * 2) as usize, 468 | &mut sci.scf, 469 | ); 470 | // TODO: This clear can probably be better. 471 | for i in sci.stereo_bands..sci.total_bands { 472 | let i = i as usize; 473 | sci.bitalloc[2 * i + 1] = 0; 474 | } 475 | } 476 | */ 477 | 478 | #[cfg(test)] 479 | mod tests { 480 | #[test] 481 | fn it_works() { 482 | assert_eq!(2 + 2, 4); 483 | } 484 | 485 | /* 486 | pub fn wav_header(hz: i32, ch: i16, bips: i32, data_bytes: i32) -> [u8;44] { 487 | // let buffer: &mut [u8;44] = b"RIFFsizeWAVEfmt \x10\x00\x00\x00\x01\x00ch_hz_abpsbabsdatasize"; 488 | let mut buffer: [u8;44] = [0;44]; 489 | { 490 | let mut c = Cursor::new(&mut buffer[..]); 491 | let size = 44 + data_bytes - 8; // File size - 8 492 | let avg_bytes_per_sec: u64 = bips as u64 * ch as u64 * hz as u64 / 8; 493 | let block_align = bips as u64 * ch as u64 / 8; 494 | // TODO: This alllll needs double checking. 495 | c.write(b"RIFF"); // 0x00 (offset) 496 | c.write_i32::(size); // 0x04 497 | c.write(b"WAVE"); // 0x08 498 | c.write(b"fmt "); // 0x0C 499 | c.write(b"\x10\x00\x00\x00"); // 0x10 500 | c.write_i16::(1); // 0x14 -- Integer PCM file format. 501 | c.write_i16::(ch); // 0x16 502 | c.write_i32::(hz); // 0x18 503 | c.write_i32::(avg_bytes_per_sec as i32); // 0x1C -- TODO, better casts 504 | c.write_i16::(block_align as i16); // 0x20 -- TODO, better casts 505 | c.write_i16::(bips as i16); // 0x22 -- TODO, better casts 506 | c.write(b"data"); // 0x24 507 | c.write_i32::(data_bytes); // 0x28 508 | } 509 | buffer 510 | } 511 | 512 | 513 | /// This shouldn't really be necessary in Rust, I think, since it just 514 | /// reads from the file. Not gonna try factoring it out right now though. 515 | pub fn preload(mut file: impl Read, buf: &mut Vec) -> io::Result { 516 | file.read_to_end(buf) 517 | } 518 | */ 519 | } 520 | -------------------------------------------------------------------------------- /src/tests.rs: -------------------------------------------------------------------------------- 1 | use super::*; 2 | use minimp3; 3 | //extern crate minimp3; 4 | 5 | #[test] 6 | fn test_increment_by_mut() { 7 | let slice: Vec = vec![1, 2, 3, 4, 5, 6]; 8 | let mut slice_to_mongle: &mut [i32] = &mut slice.clone(); 9 | increment_by_mut(&mut slice_to_mongle, 1); 10 | assert_eq!(&slice[1..], slice_to_mongle); 11 | increment_by_mut(&mut slice_to_mongle, 1); 12 | assert_eq!(&slice[2..], slice_to_mongle); 13 | increment_by_mut(&mut slice_to_mongle, 2); 14 | assert_eq!(&slice[4..], slice_to_mongle); 15 | increment_by_mut(&mut slice_to_mongle, 2); 16 | let empty: &[i32] = &[]; 17 | assert_eq!(empty, slice_to_mongle); 18 | assert_eq!(&slice[6..], slice_to_mongle); 19 | } 20 | 21 | #[test] 22 | #[should_panic] 23 | fn test_increment_too_far() { 24 | let slice: Vec = vec![1, 2, 3, 4, 5, 6]; 25 | let mut slice_to_mongle: &mut [i32] = &mut slice.clone(); 26 | increment_by_mut(&mut slice_to_mongle, 99); 27 | } 28 | 29 | #[test] 30 | fn test_rewritten_get_bits() { 31 | unsafe fn get_bits_corroded(bs: &mut Bs, n: i32) -> u32 { 32 | let mut next: u32; 33 | let mut cache: u32 = 0; 34 | let s: u32 = (bs.pos & 7) as (u32); 35 | let mut shl: i32 = (n as (u32)).wrapping_add(s) as (i32); 36 | let mut p: *const u8 = (*bs).buf.as_ptr().offset(((*bs).pos >> 3) as isize); 37 | if { 38 | (*bs).pos = (*bs).pos + n; 39 | (*bs).pos 40 | } > (*bs).limit 41 | { 42 | 0 43 | } else { 44 | next = (*{ 45 | let _old = p; 46 | p = p.offset(1); 47 | _old 48 | } as (i32) 49 | & 255 >> s) as (u32); 50 | loop { 51 | if !({ 52 | shl = shl - 8; 53 | shl 54 | } > 0) 55 | { 56 | break; 57 | } 58 | cache = cache | next << shl; 59 | next = *{ 60 | let _old = p; 61 | p = p.offset(1); 62 | _old 63 | } as (u32); 64 | } 65 | cache | next >> -shl 66 | } 67 | } 68 | 69 | let data = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; 70 | let bs = &mut Bs::new(&data, 0); 71 | // I'm going to crudely assume 0x8FFF is 72 | // Big Enough, I suppose. 73 | for i in 0..0x8FFF { 74 | let orig = unsafe { get_bits_corroded(bs, i as i32) }; 75 | let rewritten = get_bits(bs, i); 76 | assert_eq!(orig, rewritten); 77 | } 78 | } 79 | 80 | use std::io::Cursor; 81 | 82 | fn test_vs_minimp3(test_vector: &[u8]) { 83 | let reader = Cursor::new(&test_vector[..]); 84 | let reference_decoder = &mut minimp3::Decoder::new(reader); 85 | 86 | // Meh, allocation junk could be better 87 | let buf = &mut Vec::with_capacity(1152); 88 | let mp3d = &mut Mp3Dec::new(); 89 | let mut data_start = mp3dec_skip_id3v2_slice(&test_vector[..]); 90 | let output_buf = &mut Vec::new(); 91 | let mut total_frames = 1; 92 | let mut total_samples = 0; 93 | 94 | loop { 95 | let ref_frame = reference_decoder.next_frame(); 96 | 97 | let rini_frame_info = &mut FrameInfo::default(); 98 | buf.clear(); 99 | buf.resize(1152, 0); 100 | let samples = mp3dec_decode_frame(mp3d, &test_vector[data_start..], buf, rini_frame_info); 101 | output_buf.extend_from_slice(buf); 102 | total_samples += samples; 103 | total_frames += 1; 104 | println!("Frame info: {:#?}", rini_frame_info); 105 | println!("Samples: {}, frames: {}", total_samples, total_frames); 106 | data_start += rini_frame_info.frame_bytes as usize; 107 | 108 | if let Ok(ref frame) = ref_frame { 109 | assert_eq!(frame.sample_rate, rini_frame_info.hz); 110 | assert_eq!(frame.channels, rini_frame_info.channels as usize); 111 | assert_eq!(frame.layer, rini_frame_info.layer as usize); 112 | assert_eq!(frame.bitrate, rini_frame_info.bitrate_kbps); 113 | assert_eq!(frame.data.len() * 2, rini_frame_info.frame_bytes as usize); 114 | // TODO: Actually check data :| 115 | // minimp3 has a Vec in the frame, 116 | // we have buf which is a Vec 117 | } 118 | 119 | // Both our decoders agree we are done. 120 | if rini_frame_info.frame_bytes == 0 && ref_frame.is_err() { 121 | break; 122 | } 123 | } 124 | } 125 | 126 | #[test] 127 | #[allow(non_snake_case)] 128 | fn test_reference_vector_ILL2_center() { 129 | let test_vector = include_bytes!("../vectors/ILL2_center2.bit"); 130 | test_vs_minimp3(test_vector); 131 | } 132 | #[test] 133 | #[allow(non_snake_case)] 134 | fn test_reference_vector_ILL2_dual() { 135 | let test_vector = include_bytes!("../vectors/ILL2_dual.bit"); 136 | test_vs_minimp3(test_vector); 137 | } 138 | #[test] 139 | #[allow(non_snake_case)] 140 | fn test_reference_vector_ILL2_dynx22() { 141 | let test_vector = include_bytes!("../vectors/ILL2_dynx22.bit"); 142 | test_vs_minimp3(test_vector); 143 | } 144 | #[test] 145 | #[allow(non_snake_case)] 146 | fn test_reference_vector_ILL2_dynx31() { 147 | let test_vector = include_bytes!("../vectors/ILL2_dynx31.bit"); 148 | test_vs_minimp3(test_vector); 149 | } 150 | #[test] 151 | #[allow(non_snake_case)] 152 | fn test_reference_vector_ILL2_dynx32() { 153 | let test_vector = include_bytes!("../vectors/ILL2_dynx32.bit"); 154 | test_vs_minimp3(test_vector); 155 | } 156 | #[test] 157 | #[allow(non_snake_case)] 158 | fn test_reference_vector_ILL2_ext_switching() { 159 | let test_vector = include_bytes!("../vectors/ILL2_ext_switching.bit"); 160 | test_vs_minimp3(test_vector); 161 | } 162 | #[test] 163 | #[allow(non_snake_case)] 164 | fn test_reference_vector_ILL2_layer1() { 165 | let test_vector = include_bytes!("../vectors/ILL2_layer1.bit"); 166 | test_vs_minimp3(test_vector); 167 | } 168 | #[test] 169 | #[allow(non_snake_case)] 170 | fn test_reference_vector_ILL2_layer3() { 171 | let test_vector = include_bytes!("../vectors/ILL2_layer3.bit"); 172 | test_vs_minimp3(test_vector); 173 | } 174 | #[test] 175 | #[allow(non_snake_case)] 176 | fn test_reference_vector_ILL2_mono() { 177 | let test_vector = include_bytes!("../vectors/ILL2_mono.bit"); 178 | test_vs_minimp3(test_vector); 179 | } 180 | #[test] 181 | #[allow(non_snake_case)] 182 | fn test_reference_vector_ILL2_multilingual() { 183 | let test_vector = include_bytes!("../vectors/ILL2_multilingual.bit"); 184 | test_vs_minimp3(test_vector); 185 | } 186 | #[test] 187 | #[allow(non_snake_case)] 188 | fn test_reference_vector_ILL2_overalloc1() { 189 | let test_vector = include_bytes!("../vectors/ILL2_overalloc1.bit"); 190 | test_vs_minimp3(test_vector); 191 | } 192 | #[test] 193 | #[allow(non_snake_case)] 194 | fn test_reference_vector_ILL2_overalloc2() { 195 | let test_vector = include_bytes!("../vectors/ILL2_overalloc2.bit"); 196 | test_vs_minimp3(test_vector); 197 | } 198 | #[test] 199 | #[allow(non_snake_case)] 200 | fn test_reference_vector_ILL2_prediction() { 201 | let test_vector = include_bytes!("../vectors/ILL2_prediction.bit"); 202 | test_vs_minimp3(test_vector); 203 | } 204 | #[test] 205 | #[allow(non_snake_case)] 206 | fn test_reference_vector_ILL2_samples() { 207 | let test_vector = include_bytes!("../vectors/ILL2_samples.bit"); 208 | test_vs_minimp3(test_vector); 209 | } 210 | #[test] 211 | #[allow(non_snake_case)] 212 | fn test_reference_vector_ILL2_scf63() { 213 | let test_vector = include_bytes!("../vectors/ILL2_scf63.bit"); 214 | test_vs_minimp3(test_vector); 215 | } 216 | #[test] 217 | #[allow(non_snake_case)] 218 | fn test_reference_vector_ILL2_tca21() { 219 | let test_vector = include_bytes!("../vectors/ILL2_tca21.bit"); 220 | test_vs_minimp3(test_vector); 221 | } 222 | #[test] 223 | #[allow(non_snake_case)] 224 | fn test_reference_vector_ILL2_tca30() { 225 | let test_vector = include_bytes!("../vectors/ILL2_tca30.bit"); 226 | test_vs_minimp3(test_vector); 227 | } 228 | #[test] 229 | #[allow(non_snake_case)] 230 | fn test_reference_vector_ILL2_tca30_PC() { 231 | let test_vector = include_bytes!("../vectors/ILL2_tca30_PC.bit"); 232 | test_vs_minimp3(test_vector); 233 | } 234 | #[test] 235 | #[allow(non_snake_case)] 236 | fn test_reference_vector_ILL2_tca31_mtx0() { 237 | let test_vector = include_bytes!("../vectors/ILL2_tca31_mtx0.bit"); 238 | test_vs_minimp3(test_vector); 239 | } 240 | #[test] 241 | #[allow(non_snake_case)] 242 | fn test_reference_vector_ILL2_tca31_mtx2() { 243 | let test_vector = include_bytes!("../vectors/ILL2_tca31_mtx2.bit"); 244 | test_vs_minimp3(test_vector); 245 | } 246 | #[test] 247 | #[allow(non_snake_case)] 248 | fn test_reference_vector_ILL2_tca31_PC() { 249 | let test_vector = include_bytes!("../vectors/ILL2_tca31_PC.bit"); 250 | test_vs_minimp3(test_vector); 251 | } 252 | #[test] 253 | #[allow(non_snake_case)] 254 | fn test_reference_vector_ILL2_tca32_PC() { 255 | let test_vector = include_bytes!("../vectors/ILL2_tca32_PC.bit"); 256 | test_vs_minimp3(test_vector); 257 | } 258 | #[test] 259 | #[allow(non_snake_case)] 260 | fn test_reference_vector_ILL2_wrongcrc() { 261 | let test_vector = include_bytes!("../vectors/ILL2_wrongcrc.bit"); 262 | test_vs_minimp3(test_vector); 263 | } 264 | #[test] 265 | #[allow(non_snake_case)] 266 | fn test_reference_vector_ILL4_ext_id1() { 267 | let test_vector = include_bytes!("../vectors/ILL4_ext_id1.bit"); 268 | test_vs_minimp3(test_vector); 269 | } 270 | #[test] 271 | #[allow(non_snake_case)] 272 | fn test_reference_vector_ILL4_sync() { 273 | let test_vector = include_bytes!("../vectors/ILL4_sync.bit"); 274 | test_vs_minimp3(test_vector); 275 | } 276 | #[test] 277 | #[allow(non_snake_case)] 278 | fn test_reference_vector_ILL4_wrongcrc() { 279 | let test_vector = include_bytes!("../vectors/ILL4_wrongcrc.bit"); 280 | test_vs_minimp3(test_vector); 281 | } 282 | #[test] 283 | #[allow(non_snake_case)] 284 | fn test_reference_vector_ILL4_wrong_length1() { 285 | let test_vector = include_bytes!("../vectors/ILL4_wrong_length1.bit"); 286 | test_vs_minimp3(test_vector); 287 | } 288 | #[test] 289 | #[allow(non_snake_case)] 290 | fn test_reference_vector_ILL4_wrong_length2() { 291 | let test_vector = include_bytes!("../vectors/ILL4_wrong_length2.bit"); 292 | test_vs_minimp3(test_vector); 293 | } 294 | #[test] 295 | fn test_reference_vector_l1_fl1() { 296 | let test_vector = include_bytes!("../vectors/l1-fl1.bit"); 297 | test_vs_minimp3(test_vector); 298 | } 299 | #[test] 300 | fn test_reference_vector_l1_fl2() { 301 | let test_vector = include_bytes!("../vectors/l1-fl2.bit"); 302 | test_vs_minimp3(test_vector); 303 | } 304 | #[test] 305 | fn test_reference_vector_l1_fl3() { 306 | let test_vector = include_bytes!("../vectors/l1-fl3.bit"); 307 | test_vs_minimp3(test_vector); 308 | } 309 | #[test] 310 | fn test_reference_vector_l1_fl4() { 311 | let test_vector = include_bytes!("../vectors/l1-fl4.bit"); 312 | test_vs_minimp3(test_vector); 313 | } 314 | #[test] 315 | fn test_reference_vector_l1_fl5() { 316 | let test_vector = include_bytes!("../vectors/l1-fl5.bit"); 317 | test_vs_minimp3(test_vector); 318 | } 319 | #[test] 320 | fn test_reference_vector_l1_fl6() { 321 | let test_vector = include_bytes!("../vectors/l1-fl6.bit"); 322 | test_vs_minimp3(test_vector); 323 | } 324 | #[test] 325 | fn test_reference_vector_l1_fl7() { 326 | let test_vector = include_bytes!("../vectors/l1-fl7.bit"); 327 | test_vs_minimp3(test_vector); 328 | } 329 | #[test] 330 | fn test_reference_vector_l1_fl8() { 331 | let test_vector = include_bytes!("../vectors/l1-fl8.bit"); 332 | test_vs_minimp3(test_vector); 333 | } 334 | #[test] 335 | fn test_reference_vector_l1_fl10() { 336 | let test_vector = include_bytes!("../vectors/l2-fl10.bit"); 337 | test_vs_minimp3(test_vector); 338 | } 339 | #[test] 340 | fn test_reference_vector_l1_fl11() { 341 | let test_vector = include_bytes!("../vectors/l2-fl11.bit"); 342 | test_vs_minimp3(test_vector); 343 | } 344 | #[test] 345 | fn test_reference_vector_l1_fl12() { 346 | let test_vector = include_bytes!("../vectors/l2-fl12.bit"); 347 | test_vs_minimp3(test_vector); 348 | } 349 | #[test] 350 | fn test_reference_vector_l1_fl13() { 351 | let test_vector = include_bytes!("../vectors/l2-fl13.bit"); 352 | test_vs_minimp3(test_vector); 353 | } 354 | #[test] 355 | fn test_reference_vector_l1_fl14() { 356 | let test_vector = include_bytes!("../vectors/l2-fl14.bit"); 357 | test_vs_minimp3(test_vector); 358 | } 359 | #[test] 360 | fn test_reference_vector_l1_fl15() { 361 | let test_vector = include_bytes!("../vectors/l2-fl15.bit"); 362 | test_vs_minimp3(test_vector); 363 | } 364 | #[test] 365 | fn test_reference_vector_l1_fl16() { 366 | let test_vector = include_bytes!("../vectors/l2-fl16.bit"); 367 | test_vs_minimp3(test_vector); 368 | } 369 | #[test] 370 | fn test_reference_vector_l2_nonstandard_fl1_fl2_ff() { 371 | let test_vector = include_bytes!("../vectors/l2-nonstandard-fl1_fl2_ff.bit"); 372 | test_vs_minimp3(test_vector); 373 | } 374 | #[test] 375 | fn test_reference_vector_l2_nonstandard_free_format() { 376 | let test_vector = include_bytes!("../vectors/l2-nonstandard-free_format.bit"); 377 | test_vs_minimp3(test_vector); 378 | } 379 | #[test] 380 | fn test_reference_vector_l2_nonstandard_test32_size() { 381 | let test_vector = include_bytes!("../vectors/l2-nonstandard-test32-size.bit"); 382 | test_vs_minimp3(test_vector); 383 | } 384 | #[test] 385 | fn test_reference_vector_l2_test32() { 386 | let test_vector = include_bytes!("../vectors/l2-test32.bit"); 387 | test_vs_minimp3(test_vector); 388 | } 389 | #[test] 390 | fn test_reference_vector_l3_compl() { 391 | let test_vector = include_bytes!("../vectors/l3-compl.bit"); 392 | test_vs_minimp3(test_vector); 393 | } 394 | #[test] 395 | fn test_reference_vector_l3_he_32khz() { 396 | let test_vector = include_bytes!("../vectors/l3-he_32khz.bit"); 397 | test_vs_minimp3(test_vector); 398 | } 399 | #[test] 400 | fn test_reference_vector_l3_he_44khz() { 401 | let test_vector = include_bytes!("../vectors/l3-he_44khz.bit"); 402 | test_vs_minimp3(test_vector); 403 | } 404 | #[test] 405 | fn test_reference_vector_l3_he_48khz() { 406 | let test_vector = include_bytes!("../vectors/l3-he_48khz.bit"); 407 | test_vs_minimp3(test_vector); 408 | } 409 | #[test] 410 | fn test_reference_vector_l3_hecommon() { 411 | let test_vector = include_bytes!("../vectors/l3-hecommon.bit"); 412 | test_vs_minimp3(test_vector); 413 | } 414 | #[test] 415 | fn test_reference_vector_l3_he_free() { 416 | let test_vector = include_bytes!("../vectors/l3-he_free.bit"); 417 | test_vs_minimp3(test_vector); 418 | } 419 | #[test] 420 | fn test_reference_vector_l3_he_mode() { 421 | let test_vector = include_bytes!("../vectors/l3-he_mode.bit"); 422 | test_vs_minimp3(test_vector); 423 | } 424 | #[test] 425 | fn test_reference_vector_l3_id3v2() { 426 | let test_vector = include_bytes!("../vectors/l3-id3v2.bit"); 427 | test_vs_minimp3(test_vector); 428 | } 429 | #[test] 430 | fn test_reference_vector_l3_nonstandard_big_iscf() { 431 | let test_vector = include_bytes!("../vectors/l3-nonstandard-big-iscf.bit"); 432 | test_vs_minimp3(test_vector); 433 | } 434 | #[test] 435 | fn test_reference_vector_l3_nonstandard_compl_sideinfo_bigvalues() { 436 | let test_vector = include_bytes!("../vectors/l3-nonstandard-compl-sideinfo-bigvalues.bit"); 437 | test_vs_minimp3(test_vector); 438 | } 439 | #[test] 440 | fn test_reference_vector_l3_nonstandard_compl_sideinfo_blocktype() { 441 | let test_vector = include_bytes!("../vectors/l3-nonstandard-compl-sideinfo-blocktype.bit"); 442 | test_vs_minimp3(test_vector); 443 | } 444 | #[test] 445 | fn test_reference_vector_l3_nonstandard_compl_sideinfo_size() { 446 | let test_vector = include_bytes!("../vectors/l3-nonstandard-compl-sideinfo-size.bit"); 447 | test_vs_minimp3(test_vector); 448 | } 449 | #[test] 450 | fn test_reference_vector_l3_nonstandard_sideinfo_size() { 451 | let test_vector = include_bytes!("../vectors/l3-nonstandard-sideinfo-size.bit"); 452 | test_vs_minimp3(test_vector); 453 | } 454 | #[test] 455 | fn test_reference_vector_l3_si() { 456 | let test_vector = include_bytes!("../vectors/l3-si.bit"); 457 | test_vs_minimp3(test_vector); 458 | } 459 | #[test] 460 | fn test_reference_vector_l3_si_block() { 461 | let test_vector = include_bytes!("../vectors/l3-si_block.bit"); 462 | test_vs_minimp3(test_vector); 463 | } 464 | #[test] 465 | fn test_reference_vector_l3_si_huff() { 466 | let test_vector = include_bytes!("../vectors/l3-si_huff.bit"); 467 | test_vs_minimp3(test_vector); 468 | } 469 | #[test] 470 | fn test_reference_vector_l3_sin1k0db() { 471 | let test_vector = include_bytes!("../vectors/l3-sin1k0db.bit"); 472 | test_vs_minimp3(test_vector); 473 | } 474 | #[test] 475 | fn test_reference_vector_l3_test45() { 476 | let test_vector = include_bytes!("../vectors/l3-test45.bit"); 477 | test_vs_minimp3(test_vector); 478 | } 479 | #[test] 480 | fn test_reference_vector_l3_test46() { 481 | let test_vector = include_bytes!("../vectors/l3-test46.bit"); 482 | test_vs_minimp3(test_vector); 483 | } 484 | #[test] 485 | #[allow(non_snake_case)] 486 | fn test_reference_vector_M2L3_bitrate_16_all() { 487 | let test_vector = include_bytes!("../vectors/M2L3_bitrate_16_all.bit"); 488 | test_vs_minimp3(test_vector); 489 | } 490 | #[test] 491 | #[allow(non_snake_case)] 492 | fn test_reference_vector_M2L3_bitrate_22_all() { 493 | let test_vector = include_bytes!("../vectors/M2L3_bitrate_22_all.bit"); 494 | test_vs_minimp3(test_vector); 495 | } 496 | #[test] 497 | #[allow(non_snake_case)] 498 | fn test_reference_vector_M2L3_bitrate_24_all() { 499 | let test_vector = include_bytes!("../vectors/M2L3_bitrate_24_all.bit"); 500 | test_vs_minimp3(test_vector); 501 | } 502 | #[test] 503 | #[allow(non_snake_case)] 504 | fn test_reference_vector_M2L3_compl24() { 505 | let test_vector = include_bytes!("../vectors/M2L3_compl24.bit"); 506 | test_vs_minimp3(test_vector); 507 | } 508 | #[test] 509 | #[allow(non_snake_case)] 510 | fn test_reference_vector_M2L3_noise() { 511 | let test_vector = include_bytes!("../vectors/M2L3_noise.bit"); 512 | test_vs_minimp3(test_vector); 513 | } 514 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for v in vectors/*.pcm vectors/*.bit; do 3 | cargo run --bin minimp3_test -- $v 4 | done; 5 | -------------------------------------------------------------------------------- /vectors/ILL2_center2.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_center2.bit -------------------------------------------------------------------------------- /vectors/ILL2_center2.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_center2.pcm -------------------------------------------------------------------------------- /vectors/ILL2_dual.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_dual.bit -------------------------------------------------------------------------------- /vectors/ILL2_dual.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_dual.pcm -------------------------------------------------------------------------------- /vectors/ILL2_dynx22.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_dynx22.bit -------------------------------------------------------------------------------- /vectors/ILL2_dynx22.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_dynx22.pcm -------------------------------------------------------------------------------- /vectors/ILL2_dynx31.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_dynx31.bit -------------------------------------------------------------------------------- /vectors/ILL2_dynx31.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_dynx31.pcm -------------------------------------------------------------------------------- /vectors/ILL2_dynx32.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_dynx32.bit -------------------------------------------------------------------------------- /vectors/ILL2_dynx32.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_dynx32.pcm -------------------------------------------------------------------------------- /vectors/ILL2_ext_switching.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_ext_switching.bit -------------------------------------------------------------------------------- /vectors/ILL2_ext_switching.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_ext_switching.pcm -------------------------------------------------------------------------------- /vectors/ILL2_layer1.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_layer1.bit -------------------------------------------------------------------------------- /vectors/ILL2_layer1.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_layer1.pcm -------------------------------------------------------------------------------- /vectors/ILL2_layer3.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_layer3.bit -------------------------------------------------------------------------------- /vectors/ILL2_layer3.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_layer3.pcm -------------------------------------------------------------------------------- /vectors/ILL2_mono.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_mono.bit -------------------------------------------------------------------------------- /vectors/ILL2_mono.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_mono.pcm -------------------------------------------------------------------------------- /vectors/ILL2_multilingual.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_multilingual.bit -------------------------------------------------------------------------------- /vectors/ILL2_multilingual.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_multilingual.pcm -------------------------------------------------------------------------------- /vectors/ILL2_overalloc1.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_overalloc1.bit -------------------------------------------------------------------------------- /vectors/ILL2_overalloc1.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_overalloc1.pcm -------------------------------------------------------------------------------- /vectors/ILL2_overalloc2.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_overalloc2.bit -------------------------------------------------------------------------------- /vectors/ILL2_overalloc2.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_overalloc2.pcm -------------------------------------------------------------------------------- /vectors/ILL2_prediction.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_prediction.bit -------------------------------------------------------------------------------- /vectors/ILL2_prediction.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_prediction.pcm -------------------------------------------------------------------------------- /vectors/ILL2_samples.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_samples.bit -------------------------------------------------------------------------------- /vectors/ILL2_samples.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_samples.pcm -------------------------------------------------------------------------------- /vectors/ILL2_scf63.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_scf63.bit -------------------------------------------------------------------------------- /vectors/ILL2_scf63.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_scf63.pcm -------------------------------------------------------------------------------- /vectors/ILL2_tca21.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca21.bit -------------------------------------------------------------------------------- /vectors/ILL2_tca21.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca21.pcm -------------------------------------------------------------------------------- /vectors/ILL2_tca30.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca30.bit -------------------------------------------------------------------------------- /vectors/ILL2_tca30.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca30.pcm -------------------------------------------------------------------------------- /vectors/ILL2_tca30_PC.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca30_PC.bit -------------------------------------------------------------------------------- /vectors/ILL2_tca30_PC.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca30_PC.pcm -------------------------------------------------------------------------------- /vectors/ILL2_tca31_PC.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca31_PC.bit -------------------------------------------------------------------------------- /vectors/ILL2_tca31_PC.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca31_PC.pcm -------------------------------------------------------------------------------- /vectors/ILL2_tca31_mtx0.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca31_mtx0.bit -------------------------------------------------------------------------------- /vectors/ILL2_tca31_mtx0.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca31_mtx0.pcm -------------------------------------------------------------------------------- /vectors/ILL2_tca31_mtx2.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca31_mtx2.bit -------------------------------------------------------------------------------- /vectors/ILL2_tca31_mtx2.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca31_mtx2.pcm -------------------------------------------------------------------------------- /vectors/ILL2_tca32_PC.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca32_PC.bit -------------------------------------------------------------------------------- /vectors/ILL2_tca32_PC.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_tca32_PC.pcm -------------------------------------------------------------------------------- /vectors/ILL2_wrongcrc.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_wrongcrc.bit -------------------------------------------------------------------------------- /vectors/ILL2_wrongcrc.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL2_wrongcrc.pcm -------------------------------------------------------------------------------- /vectors/ILL4_ext_id1.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL4_ext_id1.bit -------------------------------------------------------------------------------- /vectors/ILL4_ext_id1.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL4_ext_id1.pcm -------------------------------------------------------------------------------- /vectors/ILL4_sync.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL4_sync.bit -------------------------------------------------------------------------------- /vectors/ILL4_sync.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL4_sync.pcm -------------------------------------------------------------------------------- /vectors/ILL4_wrong_length1.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL4_wrong_length1.bit -------------------------------------------------------------------------------- /vectors/ILL4_wrong_length1.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL4_wrong_length1.pcm -------------------------------------------------------------------------------- /vectors/ILL4_wrong_length2.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL4_wrong_length2.bit -------------------------------------------------------------------------------- /vectors/ILL4_wrong_length2.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL4_wrong_length2.pcm -------------------------------------------------------------------------------- /vectors/ILL4_wrongcrc.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL4_wrongcrc.bit -------------------------------------------------------------------------------- /vectors/ILL4_wrongcrc.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/ILL4_wrongcrc.pcm -------------------------------------------------------------------------------- /vectors/M2L3_bitrate_16_all.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/M2L3_bitrate_16_all.bit -------------------------------------------------------------------------------- /vectors/M2L3_bitrate_16_all.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/M2L3_bitrate_16_all.pcm -------------------------------------------------------------------------------- /vectors/M2L3_bitrate_22_all.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/M2L3_bitrate_22_all.bit -------------------------------------------------------------------------------- /vectors/M2L3_bitrate_22_all.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/M2L3_bitrate_22_all.pcm -------------------------------------------------------------------------------- /vectors/M2L3_bitrate_24_all.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/M2L3_bitrate_24_all.bit -------------------------------------------------------------------------------- /vectors/M2L3_bitrate_24_all.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/M2L3_bitrate_24_all.pcm -------------------------------------------------------------------------------- /vectors/M2L3_compl24.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/M2L3_compl24.bit -------------------------------------------------------------------------------- /vectors/M2L3_compl24.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/M2L3_compl24.pcm -------------------------------------------------------------------------------- /vectors/M2L3_noise.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/M2L3_noise.bit -------------------------------------------------------------------------------- /vectors/M2L3_noise.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/M2L3_noise.pcm -------------------------------------------------------------------------------- /vectors/fuzz/l3-compl-cut.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/fuzz/l3-compl-cut.mp3 -------------------------------------------------------------------------------- /vectors/l1-fl1.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl1.bit -------------------------------------------------------------------------------- /vectors/l1-fl1.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl1.pcm -------------------------------------------------------------------------------- /vectors/l1-fl2.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl2.bit -------------------------------------------------------------------------------- /vectors/l1-fl2.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl2.pcm -------------------------------------------------------------------------------- /vectors/l1-fl3.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl3.bit -------------------------------------------------------------------------------- /vectors/l1-fl3.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl3.pcm -------------------------------------------------------------------------------- /vectors/l1-fl4.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl4.bit -------------------------------------------------------------------------------- /vectors/l1-fl4.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl4.pcm -------------------------------------------------------------------------------- /vectors/l1-fl5.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl5.bit -------------------------------------------------------------------------------- /vectors/l1-fl5.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl5.pcm -------------------------------------------------------------------------------- /vectors/l1-fl6.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl6.bit -------------------------------------------------------------------------------- /vectors/l1-fl6.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl6.pcm -------------------------------------------------------------------------------- /vectors/l1-fl7.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl7.bit -------------------------------------------------------------------------------- /vectors/l1-fl7.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl7.pcm -------------------------------------------------------------------------------- /vectors/l1-fl8.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl8.bit -------------------------------------------------------------------------------- /vectors/l1-fl8.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l1-fl8.pcm -------------------------------------------------------------------------------- /vectors/l2-fl10.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl10.bit -------------------------------------------------------------------------------- /vectors/l2-fl10.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl10.pcm -------------------------------------------------------------------------------- /vectors/l2-fl11.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl11.bit -------------------------------------------------------------------------------- /vectors/l2-fl11.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl11.pcm -------------------------------------------------------------------------------- /vectors/l2-fl12.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl12.bit -------------------------------------------------------------------------------- /vectors/l2-fl12.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl12.pcm -------------------------------------------------------------------------------- /vectors/l2-fl13.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl13.bit -------------------------------------------------------------------------------- /vectors/l2-fl13.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl13.pcm -------------------------------------------------------------------------------- /vectors/l2-fl14.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl14.bit -------------------------------------------------------------------------------- /vectors/l2-fl14.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl14.pcm -------------------------------------------------------------------------------- /vectors/l2-fl15.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl15.bit -------------------------------------------------------------------------------- /vectors/l2-fl15.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl15.pcm -------------------------------------------------------------------------------- /vectors/l2-fl16.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl16.bit -------------------------------------------------------------------------------- /vectors/l2-fl16.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-fl16.pcm -------------------------------------------------------------------------------- /vectors/l2-nonstandard-fl1_fl2_ff.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-nonstandard-fl1_fl2_ff.bit -------------------------------------------------------------------------------- /vectors/l2-nonstandard-fl1_fl2_ff.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-nonstandard-fl1_fl2_ff.pcm -------------------------------------------------------------------------------- /vectors/l2-nonstandard-free_format.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-nonstandard-free_format.bit -------------------------------------------------------------------------------- /vectors/l2-nonstandard-free_format.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-nonstandard-free_format.pcm -------------------------------------------------------------------------------- /vectors/l2-nonstandard-test32-size.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-nonstandard-test32-size.bit -------------------------------------------------------------------------------- /vectors/l2-nonstandard-test32-size.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-nonstandard-test32-size.pcm -------------------------------------------------------------------------------- /vectors/l2-test32.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-test32.bit -------------------------------------------------------------------------------- /vectors/l2-test32.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l2-test32.pcm -------------------------------------------------------------------------------- /vectors/l3-compl.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-compl.bit -------------------------------------------------------------------------------- /vectors/l3-compl.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-compl.pcm -------------------------------------------------------------------------------- /vectors/l3-he_32khz.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-he_32khz.bit -------------------------------------------------------------------------------- /vectors/l3-he_32khz.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-he_32khz.pcm -------------------------------------------------------------------------------- /vectors/l3-he_44khz.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-he_44khz.bit -------------------------------------------------------------------------------- /vectors/l3-he_44khz.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-he_44khz.pcm -------------------------------------------------------------------------------- /vectors/l3-he_48khz.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-he_48khz.bit -------------------------------------------------------------------------------- /vectors/l3-he_48khz.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-he_48khz.pcm -------------------------------------------------------------------------------- /vectors/l3-he_free.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-he_free.bit -------------------------------------------------------------------------------- /vectors/l3-he_free.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-he_free.pcm -------------------------------------------------------------------------------- /vectors/l3-he_mode.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-he_mode.bit -------------------------------------------------------------------------------- /vectors/l3-he_mode.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-he_mode.pcm -------------------------------------------------------------------------------- /vectors/l3-hecommon.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-hecommon.bit -------------------------------------------------------------------------------- /vectors/l3-hecommon.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-hecommon.pcm -------------------------------------------------------------------------------- /vectors/l3-id3v2.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-id3v2.bit -------------------------------------------------------------------------------- /vectors/l3-id3v2.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-id3v2.pcm -------------------------------------------------------------------------------- /vectors/l3-nonstandard-big-iscf.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-nonstandard-big-iscf.bit -------------------------------------------------------------------------------- /vectors/l3-nonstandard-big-iscf.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-nonstandard-big-iscf.pcm -------------------------------------------------------------------------------- /vectors/l3-nonstandard-compl-sideinfo-bigvalues.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-nonstandard-compl-sideinfo-bigvalues.bit -------------------------------------------------------------------------------- /vectors/l3-nonstandard-compl-sideinfo-bigvalues.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-nonstandard-compl-sideinfo-bigvalues.pcm -------------------------------------------------------------------------------- /vectors/l3-nonstandard-compl-sideinfo-blocktype.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-nonstandard-compl-sideinfo-blocktype.bit -------------------------------------------------------------------------------- /vectors/l3-nonstandard-compl-sideinfo-blocktype.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-nonstandard-compl-sideinfo-blocktype.pcm -------------------------------------------------------------------------------- /vectors/l3-nonstandard-compl-sideinfo-size.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-nonstandard-compl-sideinfo-size.bit -------------------------------------------------------------------------------- /vectors/l3-nonstandard-compl-sideinfo-size.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-nonstandard-compl-sideinfo-size.pcm -------------------------------------------------------------------------------- /vectors/l3-nonstandard-sideinfo-size.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-nonstandard-sideinfo-size.bit -------------------------------------------------------------------------------- /vectors/l3-nonstandard-sideinfo-size.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-nonstandard-sideinfo-size.pcm -------------------------------------------------------------------------------- /vectors/l3-si.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-si.bit -------------------------------------------------------------------------------- /vectors/l3-si.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-si.pcm -------------------------------------------------------------------------------- /vectors/l3-si_block.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-si_block.bit -------------------------------------------------------------------------------- /vectors/l3-si_block.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-si_block.pcm -------------------------------------------------------------------------------- /vectors/l3-si_huff.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-si_huff.bit -------------------------------------------------------------------------------- /vectors/l3-si_huff.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-si_huff.pcm -------------------------------------------------------------------------------- /vectors/l3-sin1k0db.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-sin1k0db.bit -------------------------------------------------------------------------------- /vectors/l3-sin1k0db.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-sin1k0db.pcm -------------------------------------------------------------------------------- /vectors/l3-test45.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-test45.bit -------------------------------------------------------------------------------- /vectors/l3-test45.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-test45.pcm -------------------------------------------------------------------------------- /vectors/l3-test46.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-test46.bit -------------------------------------------------------------------------------- /vectors/l3-test46.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/l3-test46.pcm -------------------------------------------------------------------------------- /vectors/performance/MEANDR90.MP3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/performance/MEANDR90.MP3 -------------------------------------------------------------------------------- /vectors/performance/MEANDR_PHASE0.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/performance/MEANDR_PHASE0.mp3 -------------------------------------------------------------------------------- /vectors/performance/MEANDR_PHASE90.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/performance/MEANDR_PHASE90.mp3 -------------------------------------------------------------------------------- /vectors/performance/MIPSTest.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/performance/MIPSTest.mp3 -------------------------------------------------------------------------------- /vectors/performance/noise_meandr.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icefoxen/rinimp3/16ec8afef8bab3dda0d3b5888b4a42ec9af179ae/vectors/performance/noise_meandr.mp3 --------------------------------------------------------------------------------