Allow NetEQ to use real packet durations.

This is a copy of http://review.webrtc.org/864014/

This adds a FuncDurationEst to each codec instance which estimates
the duration of a packet given the packet contents and the duration
of the previous packet. By default, this simply returns the
duration of the previous packet (which is what is currently assumed
to be the duration of all future packets). This patch also provides
an initial implementation of this function for G.711 which returns
the actual number of samples in the packet.

BUG=issue1015

Review URL: https://webrtc-codereview.appspot.com/935016

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3129 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tina.legrand@webrtc.org
2012-11-19 08:02:55 +00:00
parent 3662aa38f3
commit 5ac387c4d1
12 changed files with 230 additions and 43 deletions

View File

@ -167,6 +167,31 @@ int WebRtcNetEQ_PacketBufferFindLowestTimestamp(PacketBuf_t* buffer_inst,
int erase_old_packets,
int16_t* payload_type);
/****************************************************************************
* WebRtcNetEQ_PacketBufferGetPacketSize(...)
*
* Calculate and return an estimate of the data length (in samples) of the
* given packet. If no estimate is available (because we do not know how to
* compute packet durations for the associated payload type), last_duration
* will be returned instead.
*
* Input:
* - buffer_inst : Buffer instance
* - buffer_pos : The index of the buffer of which to estimate the
* duration
* - codec_database : Codec database instance
* - codec_pos : The codec database entry associated with the payload
* type of the specified buffer.
* - last_duration : The duration of the previous frame.
*
* Return value : The buffer size in samples
*/
int WebRtcNetEQ_PacketBufferGetPacketSize(const PacketBuf_t* buffer_inst,
int buffer_pos,
const CodecDbInst_t* codec_database,
int codec_pos, int last_duration);
/****************************************************************************
* WebRtcNetEQ_PacketBufferGetSize(...)
*
@ -177,12 +202,15 @@ int WebRtcNetEQ_PacketBufferFindLowestTimestamp(PacketBuf_t* buffer_inst,
* decoded packet.
*
* Input:
* - bufferInst : Buffer instance
* - buffer_inst : Buffer instance
* - codec_database : Codec database instance
*
* Return value : The buffer size in samples
* Return value : The buffer size in samples
*/
WebRtc_Word32 WebRtcNetEQ_PacketBufferGetSize(const PacketBuf_t *bufferInst);
WebRtc_Word32 WebRtcNetEQ_PacketBufferGetSize(const PacketBuf_t* buffer_inst,
const CodecDbInst_t*
codec_database);
/****************************************************************************
* WebRtcNetEQ_IncrementWaitingTimes(...)