[FFmpeg-devel] [PATCH] G.729 initialization routine (skeleton)
Wed Jun 10 20:45:32 CEST 2009
On Thu, Jun 11, 2009 at 01:14:56AM +0700, Vladimir Voroshilov wrote:
> 2009/6/10 Michael Niedermayer <michaelni at gmx.at>:
> > On Wed, Jun 10, 2009 at 01:55:08AM +0700, Vladimir Voroshilov wrote:
> >> OMG! I've mixed bit_rate and sample_rate.
> >> Well...
> >> First look give me (at least for 8k and 6k4. i'll finally drop out 4k4
> >> in next patch since i've no method to test it):
> >> avctx->sample_rate=8000
> >> avctx->bit_rate = 8000 and 6400 respectively
> >> avctx->frame_size = avctx->sample_rate /100 (1 packet = 10ms)
> >> ctx->subframe_size=avctx->frame_size/2
> >> ctx->packed_frame_size = avctx-bit_rate / 800 (1 packet = 10ms and bits->bytes)
> >> ctx->unpacked_frame_size = avctx->frame_size * sizeof(int16_t)
> >> No format tables at this stage are required (they will due to
> >> different bits allocation in packet)!
> >> I'll test and fix all these calculations in next patch, but i have
> >> several question now:
> >> 1. Who should initialize sample_rate and frame_size (decoder or demuxer) ?
> > whoever is able to
> > the demuxer will set it if it can, the decoder should set it if there is a
> > sample_rate stored in the bitstream
> >> 2. Can i be sure that output buffer passed to decode_frame will be at
> >> least frame_size*2 long or i have to check this explicitly ?
> > if you set frame_size during init then you should not need an explicit
> > check, that said, this is one of the things i dont mind if done redundantly
> >> 3. What should i pass instead of X, Y and Z to av_set_pts(st, X, Y, Z)
> >> in demuxer to ensure that all packets will be
> >> packets_frame_size long (10 and 8 bytes respectively) ? av_set_pts(st,
> >> 10, bit_rate, sample_rate) if all packets are 10ms ?
> > which demuxer ?
> ACT format.
for 10ms packets in a format without timestamps its
av_set_pts_info(st, 64, 1, 100);
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have often repented speaking, but never of holding my tongue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the ffmpeg-devel