[FFmpeg-devel] [PATCH] Fixing computation of number of B frames for GXF muxer
Baptiste Coudurier
baptiste.coudurier
Thu Feb 12 01:09:06 CET 2009
Thierry Foucu wrote:
> After chatting with Baptiste, i was told that the variable name b_per_gop is
> for the number of B between I and Pnot the number of B frames per GOP.
>
> So, new patch to still fix the computation of b_per_gop
>
> On Wed, Feb 11, 2009 at 3:35 PM, Thierry Foucu <tfoucu at gmail.com> wrote:
>
>> For GXF muxer, the code to compute the number of B frames in a GOP is
>> wrong.
>> For example:
>> if you have I frames: 75, P frames: 449, B frames: 374
>> Here is the GOP was 12 and 1 B frame between I and P
>> the current code will compute 0 frames per GOP.
>>
>> With the patch, it will compute 5
>>
>>
>> ------------------------------------------------------------------------
>>
>> Index: libavformat/gxfenc.c
>> ===================================================================
>> --- libavformat/gxfenc.c (revision 17163)
>> +++ libavformat/gxfenc.c (working copy)
>> @@ -175,8 +175,11 @@
>> ctx->p_per_gop = ctx->pframes / ctx->iframes;
>> if (ctx->pframes % ctx->iframes)
>> ctx->p_per_gop++;
>> - if (ctx->pframes)
>> + if (ctx->pframes) {
>> ctx->b_per_gop = ctx->bframes / ctx->pframes;
>> + if (ctx->bframes % ctx->pframes)
>> + ctx->b_per_gop++;
>> + }
>> if (ctx->p_per_gop > 9)
>> ctx->p_per_gop = 9; /* ensure value won't take more than one char */
>> if (ctx->b_per_gop > 9)
Thanks, applied with field name changed.
--
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer http://www.ffmpeg.org
More information about the ffmpeg-devel
mailing list