1  typedef struct {
       2      int MbInterlace;
       3      int channel_type;
       4  } InputParameters;
       5  typedef struct {
       6      int type;
       7      int NumberofCodedPFrame;
       8      int NumberofGOP;
       9      int NumberofPPicture;
      10      int FieldControl;
      11      int Frame_Total_Number_MB;
      12      int NumberofCodedMacroBlocks;
      13      int BasicUnit;
      14  } ImageParameters;
      15  extern InputParameters *input;
      16  extern ImageParameters *img;
      17  long T;
      18  void rc_init_pict(int fieldpic)
      19  {
      20    if(input->MbInterlace)
      21      T = img->Frame_Total_Number_MB;
      22    img->NumberofCodedMacroBlocks=0;
      23    if(input->channel_type==1
      24       && img->NumberofCodedPFrame==58)
      25      T = 4;
      26    if(fieldpic)
      27      {
      28        switch (img->type)
      29  	{
      30  	  case 0:
      31  	   if(img->NumberofCodedPFrame>0
      32  	      && img->FieldControl==1)
      33  	     T = 3;
      34  	   if(img->NumberofPPicture==1)
      35  	     T = 2;
      36  	}
      37        if(img->type==0
      38  	 && img->NumberofCodedPFrame>0)
      39  	T = 0;
      40      }
      41    if(img->type==0
      42       && img->FieldControl==1)
      43      T = 1;
      44  }