[Ffmpeg-devel] [PATCH] flv adpcm encoder
Benjamin Larsson
banan
Tue Mar 6 10:28:42 CET 2007
Michael Niedermayer skrev:
> Hi
>
>
> On Mon, Mar 05, 2007 at 08:04:40AM +0100, Benjamin Larsson wrote:
>
>> Jeff Clagg wrote:
>>
>>> On Sun, Mar 04, 2007 at 10:51:50PM +0100, Benjamin Larsson wrote:
>>>
>>>> Hi, this is an almost working by the specs adpcm encoder for flv and swf
>>>> files. I think the reason it isn't work so well is because of the muxing
>>>> and not the encoding. If the muxing isn't fixed there is not much reason
>>>> for this patch to be applied.
>>>>
>>> I'm very impressed by how small and elegant the code is.
>>>
>> Thanks.
>>
>> Anyway, here is an updated less elegant version.
>>
>
> [...]
>
>> @@ -180,6 +180,9 @@
>> avctx->frame_size = BLKSIZE * avctx->channels;
>> avctx->block_align = BLKSIZE;
>> break;
>> + case CODEC_ID_ADPCM_SWF:
>> + avctx->frame_size = 4*BLKSIZE * avctx->channels;
>> + break;
>>
>
> shouldnt block_align be initalized here too?
>
> [...]
>
I don't know what block_align does. It made no changes when I used it.
And it seams that the frame_size needs to be different depending on the
sampling frequency and video frame rate. So I guess the specs are wrong
or missleading.
> [...]
> for(i=0; i<avctx->channels; i++){
> put_bits(&pb, 16, samples[i] & 0xFFFF);
> put_bits(&pb, 6, c->status[i].step_index & 0x3F);
> c->status[i].prev_sample = (signed short)samples[i];
> }
>
I'll change that when the encoding and muxing are working. Can it be
applied when those issues are sorted out ?
MvH
Benjamin Larsson
More information about the ffmpeg-devel
mailing list