int main(void)
{
decoder_specific_struct dec_ptr;
//Initialize the decoder.
mips_sai_dec_init(&dec_ptr);
//Open the bitstream input device.
open_input();
//Open the audio output device.
open_output();
//Allocate buffers for decoder operation.
allocate_buffers(&dec_ptr);
while(not-end-of-input-bitstream)
//Read the input bitstream.
read_input(&dec_ptr);
//Read the frame header for encoded stream parameters.
mips_sai_dec_readheader(&dec_ptr);
//Set up params for decoder operation.
setup_params(&dec_ptr);
//Decode the frame
mips_sai_dec_process(&dec_ptr);
//write the decoder output to the device driver.
write_output(&dec_ptr);
end-while
//Close the input and output devices.
close_input();
close_output();
return 0;
}