[svn] / branches / dev-api-3 / xvidcore / src / encoder.c Repository:
ViewVC logotype

Diff of /branches/dev-api-3/xvidcore/src/encoder.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 619, Sat Nov 2 15:52:31 2002 UTC revision 642, Mon Nov 11 20:53:34 2002 UTC
# Line 39  Line 39 
39   *             MinChen <chenm001@163.com>   *             MinChen <chenm001@163.com>
40   *  14.04.2002 added FrameCodeB()   *  14.04.2002 added FrameCodeB()
41   *   *
42   *  $Id: encoder.c,v 1.76.2.14 2002-11-02 15:52:30 chl Exp $   *  $Id: encoder.c,v 1.76.2.17 2002-11-11 20:53:34 Isibaar Exp $
43   *   *
44   ****************************************************************************/   ****************************************************************************/
45    
# Line 107  Line 107 
107  };  };
108    
109    
 static void __inline  
 image_null(IMAGE * image)  
 {  
         image->y = image->u = image->v = NULL;  
 }  
   
   
110  /*****************************************************************************  /*****************************************************************************
111   * Encoder creation   * Encoder creation
112   *   *
# Line 623  Line 616 
616          start_timer();          start_timer();
617          if (image_input          if (image_input
618                  (&pEnc->queue[pEnc->queue_tail], pEnc->mbParam.width, pEnc->mbParam.height,                  (&pEnc->queue[pEnc->queue_tail], pEnc->mbParam.width, pEnc->mbParam.height,
619                   pEnc->mbParam.edged_width, pFrame->image, pFrame->colorspace))                   pEnc->mbParam.edged_width, pFrame->image, pFrame->stride, pFrame->colorspace, pFrame->general & XVID_INTERLACING))
620                  return;                  return;
621          stop_conv_timer();          stop_conv_timer();
622    
# Line 718  Line 711 
711                          pFrame->length = BitstreamLength(&bs);                          pFrame->length = BitstreamLength(&bs);
712                          pFrame->intra = 0;                          pFrame->intra = 0;
713    
714                            emms();
715    
716                          return XVID_ERR_OK;                          return XVID_ERR_OK;
717                  }                  }
718    
# Line 736  Line 731 
731                  if (input_valid)                  if (input_valid)
732                          queue_image(pEnc, pFrame);                          queue_image(pEnc, pFrame);
733    
734                    emms();
735    
736                  return XVID_ERR_OK;                  return XVID_ERR_OK;
737          }          }
738    
# Line 769  Line 766 
766                          if (input_valid)                          if (input_valid)
767                                  queue_image(pEnc, pFrame);                                  queue_image(pEnc, pFrame);
768    
769                            emms();
770    
771                          return XVID_ERR_OK;                          return XVID_ERR_OK;
772                  }                  }
773          }          }
# Line 799  Line 798 
798                  start_timer();                  start_timer();
799                  if (image_input                  if (image_input
800                          (&pEnc->current->image, pEnc->mbParam.width, pEnc->mbParam.height,                          (&pEnc->current->image, pEnc->mbParam.width, pEnc->mbParam.height,
801                          pEnc->mbParam.edged_width, pFrame->image, pFrame->colorspace))                          pEnc->mbParam.edged_width, pFrame->image, pFrame->stride, pFrame->colorspace, pFrame->general & XVID_INTERLACING))
802                    {
803                            emms();
804                          return XVID_ERR_FORMAT;                          return XVID_ERR_FORMAT;
805                    }
806                  stop_conv_timer();                  stop_conv_timer();
807    
808                  // queue input frame, and dequue next image                  // queue input frame, and dequue next image
# Line 839  Line 841 
841                  }                  }
842    
843                  pFrame->length = BitstreamLength(&bs);                  pFrame->length = BitstreamLength(&bs);
844                    emms();
845                  return XVID_ERR_OK;                  return XVID_ERR_OK;
846          }          }
847    
# Line 978  Line 981 
981                   * NB : sequences like "IIBB" decode fine with msfdam but,                   * NB : sequences like "IIBB" decode fine with msfdam but,
982                   *      go screwy with divx 5.00                   *      go screwy with divx 5.00
983                   */                   */
984          } else if (pEnc->bframenum_tail >= pEnc->mbParam.max_bframes || mode != 0) {          } else if ((pEnc->bframenum_tail >= pEnc->mbParam.max_bframes) || (mode != 0)) {
985    
986                  /*                  /*
987                   * This will be coded as a Predicted Frame                   * This will be coded as a Predicted Frame
988                   */                   */
# Line 995  Line 999 
999                  pFrame->intra = 0;                  pFrame->intra = 0;
1000                  pEnc->flush_bframes = 1;                  pEnc->flush_bframes = 1;
1001    
1002                  if ((pEnc->global & XVID_GLOBAL_PACKED)) {                  if ((pEnc->global & XVID_GLOBAL_PACKED) && (pEnc->bframenum_tail > 0)) {
1003                          BitstreamPadAlways(&bs);                          BitstreamPadAlways(&bs);
1004                          input_valid = 0;                          input_valid = 0;
1005                          goto ipvop_loop;                          goto ipvop_loop;
# Line 1076  Line 1080 
1080          stop_global_timer();          stop_global_timer();
1081          write_timer();          write_timer();
1082    
1083            emms();
1084          return XVID_ERR_OK;          return XVID_ERR_OK;
1085  }  }
1086    
# Line 1130  Line 1135 
1135          start_timer();          start_timer();
1136          if (image_input          if (image_input
1137                  (&pEnc->current->image, pEnc->mbParam.width, pEnc->mbParam.height,                  (&pEnc->current->image, pEnc->mbParam.width, pEnc->mbParam.height,
1138                   pEnc->mbParam.edged_width, pFrame->image, pFrame->colorspace) < 0)                   pEnc->mbParam.edged_width, pFrame->image, pFrame->stride, pFrame->colorspace, pFrame->general & XVID_INTERLACING) < 0)
1139                  return XVID_ERR_FORMAT;                  return XVID_ERR_FORMAT;
1140          stop_conv_timer();          stop_conv_timer();
1141    
# Line 1620  Line 1625 
1625          }          }
1626    
1627          if (pEnc->current->global_flags & XVID_GMC) {          if (pEnc->current->global_flags & XVID_GMC) {
1628                  printf("Global Motion = %d %d quarterpel=%d\n", pEnc->current->GMC_MV.x, pEnc->current->GMC_MV.y,pEnc->current->quarterpel);  //              printf("Global Motion = %d %d quarterpel=%d\n", pEnc->current->GMC_MV.x, pEnc->current->GMC_MV.y,pEnc->current->quarterpel);
1629                    DPRINTF(DPRINTF_HEADER, "Global Motion = %d %d quarterpel=%d\n", pEnc->current->GMC_MV.x, pEnc->current->GMC_MV.y,pEnc->current->quarterpel);
1630                  pEnc->current->coding_type = S_VOP;                  pEnc->current->coding_type = S_VOP;
1631          } else          } else
1632                  pEnc->current->coding_type = P_VOP;                  pEnc->current->coding_type = P_VOP;

Legend:
Removed from v.619  
changed lines
  Added in v.642

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4