Changeset 139
- Timestamp:
- 11/15/06 18:32:43 (18 years ago)
- Location:
- libmpc/branches/r2d/libmpcdec
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/branches/r2d/libmpcdec/internal.h
r104 r139 72 72 mpc_uint32_t bytes_total; 73 73 mpc_bits_reader bits_reader; 74 mpc_uint32_t block_bits; // bits remaining in current audio block 74 mpc_uint32_t block_bits; /// bits remaining in current audio block 75 mpc_bool_t end; /// end of stream flag 75 76 }; 76 77 -
libmpc/branches/r2d/libmpcdec/mpc_demux.c
r138 r139 138 138 if (memcmp(b.key, "SI", 2) == 0){ 139 139 int ret = streaminfo_read_header_sv8(&d->si, &d->bits_reader, b.size); 140 if (ret != MPC_STATUS_OK) 141 return ret; 140 if (ret != MPC_STATUS_OK) return ret; 142 141 } else if (memcmp(b.key, "EI", 2) == 0) 143 142 streaminfo_encoder_info(&d->si, &d->bits_reader); … … 164 163 p_tmp->bits_reader.count = 8; 165 164 p_tmp->block_bits = 0; 165 p_tmp->end = MPC_FALSE; 166 166 // lire entête 167 167 if (mpc_demux_header(p_tmp) == MPC_STATUS_OK) { … … 192 192 if (d->si.stream_version == 8) { 193 193 mpc_bits_reader r; 194 if (d->block_bits < 8 && (d->d->decoded_samples < d->d->samples || d->d->samples == 0)){194 if (d->block_bits < 8 && d->end == MPC_FALSE){ 195 195 mpc_block b; 196 196 d->bits_reader.count &= -8; … … 198 198 mpc_bits_get_block(&d->bits_reader, &b); 199 199 while( memcmp(b.key, "AD", 2) != 0 ){ // scan all blocks until audio 200 if (memcmp(b.key, "SE", 2) == 0) // end block 201 d->end = MPC_TRUE; 200 202 mpc_demux_fill(d, 11 + b.size, 0); 201 203 d->bits_reader.buff += b.size; … … 218 220 } 219 221 220 // static mpc_uint32_t221 // mpc_decoder_decode_internal(mpc_decoder *d, MPC_SAMPLE_FORMAT *buffer)222 // {223 // mpc_uint32_t output_frame_length = MPC_FRAME_LENGTH;224 // mpc_uint32_t FwdJumpInfo = 0;225 // mpc_uint32_t FrameBitCnt = 0;226 //227 // if (d->decoded_frames >= d->OverallFrames) {228 // return (mpc_uint32_t)(-1); // end of file -> abort decoding229 // }230 //231 // // add seeking info232 // if (d->seeking_table_frames < d->decoded_frames &&233 // (d->decoded_frames & ((1 << d->seeking_pwr) - 1)) == 0) {234 // d->seeking_table[d->decoded_frames >> d->seeking_pwr] = mpc_decoder_bits_read(d);235 // d->seeking_table_frames = d->decoded_frames;236 // }237 //238 // switch (d->StreamVersion) {239 // case 0x07:240 // case 0x17:241 // // read jump-info for validity check of frame242 // FwdJumpInfo = mpc_decoder_bitstream_read(d, 20);243 // // decode data and check for validity of frame244 // FrameBitCnt = mpc_decoder_bits_read(d);245 //246 // d->FrameWasValid = mpc_decoder_bits_read(d) - FrameBitCnt == FwdJumpInfo;247 // break;248 // case 0x08:249 // if (d->BlockBits < 8){250 // mpc_block block;251 // // trouver le block252 // mpc_decoder_bitstream_read(d, d->BlockBits);253 // while (1) {254 // mpc_decoder_get_block(d, &block);255 // if (memcmp(block.key, "AD", 2) != 0)256 // mpc_decoder_seek(d, mpc_decoder_bits_read(d) + block.size * 8);257 // else258 // break;259 // }260 // d->BlockBits = block.size * 8;261 // }262 // FrameBitCnt = mpc_decoder_bits_read(d);263 // mpc_decoder_read_bitstream_sv7(d, FALSE);264 // d->BlockBits -= mpc_decoder_bits_read(d) - FrameBitCnt;265 // d->FrameWasValid = 1;266 // break;267 // default:268 // return (mpc_uint32_t)(-1);269 // }270 //271 // return output_frame_length;272 // }273 //274 // mpc_uint32_t mpc_decoder_decode(275 // mpc_decoder *d,276 // MPC_SAMPLE_FORMAT *buffer,277 // mpc_uint32_t *vbr_update_acc,278 // mpc_uint32_t *vbr_update_bits)279 // {280 // for(;;)281 // {282 // //const mpc_int32_t MaxBrokenFrames = 0; // PluginSettings.MaxBrokenFrames283 //284 // mpc_uint32_t RING = d->Zaehler;285 // mpc_int32_t vbr_ring = (RING << 5) + d->pos;286 //287 // mpc_uint32_t valid_samples = mpc_decoder_decode_internal(d, buffer);288 //289 // if (valid_samples == (mpc_uint32_t)(-1) ) {290 // return 0;291 // }292 //293 // /**************** ERROR CONCEALMENT *****************/294 // if (d->FrameWasValid == 0 ) {295 // // error occurred in bitstream296 // return (mpc_uint32_t)(-1);297 // }298 // else {299 // if (vbr_update_acc && vbr_update_bits) {300 // (*vbr_update_acc) ++;301 // vbr_ring = (d->Zaehler << 5) + d->pos - vbr_ring;302 // if (vbr_ring < 0) {303 // vbr_ring += 524288;304 // }305 // (*vbr_update_bits) += vbr_ring;306 // }307 //308 // }309 // mpc_decoder_update_buffer(d, RING);310 //311 // if (valid_samples > 0) {312 // return valid_samples;313 // }314 // }315 // }316
Note: See TracChangeset
for help on using the changeset viewer.