Changeset 70 for libmpcdec/branches/zorg/src/mpc_decoder.c
- Timestamp:
- 10/06/06 18:51:07 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpcdec/branches/zorg/src/mpc_decoder.c
r68 r70 79 79 static mpc_int32_t f_read(mpc_decoder *d, void *ptr, mpc_int32_t size) 80 80 { 81 return d->r->read(d->r ->data, ptr, size);81 return d->r->read(d->r, ptr, size); 82 82 } 83 83 84 84 static mpc_bool_t f_seek(mpc_decoder *d, mpc_int32_t offset) 85 85 { 86 return d->r->seek(d->r ->data, offset);86 return d->r->seek(d->r, offset); 87 87 } 88 88 … … 861 861 mpc_decoder_reset_bitstream_decode(d); 862 862 mpc_decoder_initialisiere_quantisierungstabellen(d, 1.0f); 863 #if 0864 mpc_decoder_init_huffman_sv6(d);865 mpc_decoder_init_huffman_sv7(d);866 #endif867 863 } 868 864 … … 896 892 } 897 893 898 mpc_bool_t mpc_decoder_initialize(mpc_decoder *d, mpc_streaminfo *si) 899 { 900 mpc_decoder_set_streaminfo(d, si); 894 mpc_status mpc_decoder_init(mpc_decoder **d, mpc_reader *r, mpc_streaminfo *si) 895 { 896 mpc_decoder* p_tmp; 897 898 p_tmp = malloc(sizeof *p_tmp); 899 memset(p_tmp, 0, sizeof *p_tmp); 900 mpc_decoder_setup(p_tmp, r); 901 902 mpc_decoder_set_streaminfo(p_tmp, si); 901 903 902 904 // AB: setting position to the beginning of the data-bitstream 903 mpc_decoder_seek(d, get_initial_fpos(d)); 904 905 d->seeking_pwr = 0; 906 while (d->OverallFrames > (SEEKING_TABLE_SIZE << d->seeking_pwr)) 907 d->seeking_pwr++; 908 d->seeking_table_frames = 0; 909 d->seeking_table[0] = get_initial_fpos(d); 910 911 return TRUE; 905 mpc_decoder_seek(p_tmp, get_initial_fpos(p_tmp)); 906 907 p_tmp->seeking_pwr = 0; 908 while (p_tmp->OverallFrames > (SEEKING_TABLE_SIZE << p_tmp->seeking_pwr)) 909 p_tmp->seeking_pwr++; 910 p_tmp->seeking_table_frames = 0; 911 p_tmp->seeking_table[0] = get_initial_fpos(p_tmp); 912 913 *d = p_tmp; 914 return MPC_STATUS_OK; 915 } 916 917 void mpc_decoder_exit(mpc_decoder *d) 918 { 919 free(d); 912 920 } 913 921
Note: See TracChangeset
for help on using the changeset viewer.