[Live-devel] AMRDeinterleavingBuffer class - fFrames member

Ross Finlayson finlayson at live.com
Wed Dec 8 10:38:56 PST 2004


>I don't know what AMRDeinterleavingBuffer does exactly (not easy by just
>reading the source code...) but isn't there a mistake in the declaration
>or init of fFrames ?
[...]
>=========
>class AMRDeinterleavingBuffer {
>...
>   FrameDescriptor* fFrames[2];
>...
>};
>
>AMRDeinterleavingBuffer
>::AMRDeinterleavingBuffer(...)
>{
>...
>  fFrames[0] = new FrameDescriptor[fMaxInterleaveGroupSize];
>  fFrames[1] = new FrameDescriptor[fMaxInterleaveGroupSize];

I believe this (current) code is correct.  The intention is to have two 
banks of "FrameDescriptor"s: one bank to store incoming frames (within an 
interleave group that is still arriving); the other bank to store outgoing 
frames (from the previously-arrived interleave group).  Each bank needs to 
be large enough to hold the maximum possible interleave group 
("fMaxInterleaveGroupSize").  We toggle between the banks when we switch to 
a new interleave group - this is done by the line:
         fIncomingBankId ^= 1;

>Then, could you tell me a scenario of AMRDeinterleaver usage ?

AMR audio frames can be interleaved within RTP packets.  This reduces the 
effect of losing a single packet.  See RFC 3267.


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list