# HG changeset patch # User michael # Date 1097807824 0 # Node ID 3a8e557a8226ff0c4d2ebf7ffae7cfde2722e8ea # Parent 41b5a7bd9a96f60eef511a0450d01a655e4f12c0 support strictly enforcing gop size diff -r 41b5a7bd9a96 -r 3a8e557a8226 avcodec.h --- a/avcodec.h Thu Oct 14 12:24:16 2004 +0000 +++ b/avcodec.h Fri Oct 15 02:37:04 2004 +0000 @@ -296,6 +296,7 @@ #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< will reserve space for SVCD scan offset user data #define CODEC_FLAG_CLOSED_GOP 0x80000000 #define CODEC_FLAG2_FAST 0x00000001 ///< allow non spec compliant speedup tricks +#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< strictly enforce GOP size /* Unsupported options : * Syntax Arithmetic coding (SAC) diff -r 41b5a7bd9a96 -r 3a8e557a8226 mpegvideo.c --- a/mpegvideo.c Thu Oct 14 12:24:16 2004 +0000 +++ b/mpegvideo.c Fri Oct 15 02:37:04 2004 +0000 @@ -2064,9 +2064,13 @@ } if(s->picture_in_gop_number + b_frames >= s->gop_size){ + if((s->flags2 & CODEC_FLAG2_STRICT_GOP) && s->gop_size > s->picture_in_gop_number){ + b_frames= s->gop_size - s->picture_in_gop_number - 1; + }else{ if(s->flags & CODEC_FLAG_CLOSED_GOP) b_frames=0; s->input_picture[b_frames]->pict_type= I_TYPE; + } } if( (s->flags & CODEC_FLAG_CLOSED_GOP)