[cvs] / xvidcore / src / encoder.c Repository:
ViewVC logotype

Diff of /xvidcore/src/encoder.c

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

revision 1.119, Mon Aug 1 10:53:46 2005 UTC revision 1.120.2.1, Mon Jul 10 15:05:30 2006 UTC
# Line 203  Line 203 
203    
204                  memset(&pinfo, 0, sizeof(xvid_plg_info_t));                  memset(&pinfo, 0, sizeof(xvid_plg_info_t));
205                  pinfo.version = XVID_VERSION;                  pinfo.version = XVID_VERSION;
206                  if (create->plugins[n].func(0, XVID_PLG_INFO, &pinfo, 0) >= 0) {                  if (create->plugins[n].func(NULL, XVID_PLG_INFO, &pinfo, NULL) >= 0) {
207                          pEnc->mbParam.plugin_flags |= pinfo.flags;                          pEnc->mbParam.plugin_flags |= pinfo.flags;
208                  }                  }
209    
# Line 220  Line 220 
220                  pcreate.param = create->plugins[n].param;                  pcreate.param = create->plugins[n].param;
221    
222                  pEnc->plugins[n].func = NULL;   /* disable plugins that fail */                  pEnc->plugins[n].func = NULL;   /* disable plugins that fail */
223                  if (create->plugins[n].func(0, XVID_PLG_CREATE, &pcreate, &pEnc->plugins[n].param) >= 0) {                  if (create->plugins[n].func(NULL, XVID_PLG_CREATE, &pcreate, &pEnc->plugins[n].param) >= 0) {
224                          pEnc->plugins[n].func = create->plugins[n].func;                          pEnc->plugins[n].func = create->plugins[n].func;
225                  }                  }
226          }          }
# Line 522  Line 522 
522    xvid_err_memory0:    xvid_err_memory0:
523          for (n=0; n<pEnc->num_plugins;n++) {          for (n=0; n<pEnc->num_plugins;n++) {
524                  if (pEnc->plugins[n].func) {                  if (pEnc->plugins[n].func) {
525                          pEnc->plugins[n].func(pEnc->plugins[n].param, XVID_PLG_DESTROY, 0, 0);                          pEnc->plugins[n].func(pEnc->plugins[n].param, XVID_PLG_DESTROY, NULL, NULL);
526                  }                  }
527          }          }
528          xvid_free(pEnc->plugins);          xvid_free(pEnc->plugins);
# Line 627  Line 627 
627    
628                  for (i=0; i<pEnc->num_plugins;i++) {                  for (i=0; i<pEnc->num_plugins;i++) {
629                          if (pEnc->plugins[i].func) {                          if (pEnc->plugins[i].func) {
630                                  pEnc->plugins[i].func(pEnc->plugins[i].param, XVID_PLG_DESTROY, &pdestroy, 0);                                  pEnc->plugins[i].func(pEnc->plugins[i].param, XVID_PLG_DESTROY, &pdestroy, NULL);
631                          }                          }
632                  }                  }
633                  xvid_free(pEnc->plugins);                  xvid_free(pEnc->plugins);
# Line 787  Line 787 
787          for (i=0; i<(unsigned int)pEnc->num_plugins;i++) {          for (i=0; i<(unsigned int)pEnc->num_plugins;i++) {
788                  emms();                  emms();
789                  if (pEnc->plugins[i].func) {                  if (pEnc->plugins[i].func) {
790                          if (pEnc->plugins[i].func(pEnc->plugins[i].param, opt, &data, 0) < 0) {                          if (pEnc->plugins[i].func(pEnc->plugins[i].param, opt, &data, NULL) < 0) {
791                                  continue;                                  continue;
792                          }                          }
793                  }                  }
# Line 1010  Line 1010 
1010                          }                          }
1011    
1012                          FrameCodeB(pEnc, pEnc->bframes[pEnc->bframenum_head], &bs);                          FrameCodeB(pEnc, pEnc->bframes[pEnc->bframenum_head], &bs);
1013                          call_plugins(pEnc, pEnc->bframes[pEnc->bframenum_head], &pEnc->sOriginal2, XVID_PLG_AFTER, 0, 0, stats);                          call_plugins(pEnc, pEnc->bframes[pEnc->bframenum_head], &pEnc->sOriginal2, XVID_PLG_AFTER, NULL, NULL, stats);
1014                          pEnc->bframenum_head++;                          pEnc->bframenum_head++;
1015    
1016                          goto done;                          goto done;
# Line 1042  Line 1042 
1042    
1043                          /* add the not-coded length to the reference frame size */                          /* add the not-coded length to the reference frame size */
1044                          pEnc->current->length += (BitstreamPos(&bs) - bits) / 8;                          pEnc->current->length += (BitstreamPos(&bs) - bits) / 8;
1045                          call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, 0, 0, stats);                          call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, NULL, NULL, stats);
1046    
1047                          /* flush complete: reset counters */                          /* flush complete: reset counters */
1048                          pEnc->flush_bframes = 0;                          pEnc->flush_bframes = 0;
# Line 1070  Line 1070 
1070                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
1071    
1072                          if (!(pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) && pEnc->mbParam.max_bframes > 0) {                          if (!(pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) && pEnc->mbParam.max_bframes > 0) {
1073                                  call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, 0, 0, stats);                                  call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, NULL, NULL, stats);
1074                          }                          }
1075    
1076                          /* if the very last frame is to be b-vop, we must change it to a p-vop */                          /* if the very last frame is to be b-vop, we must change it to a p-vop */
# Line 1099  Line 1099 
1099    
1100    
1101                                  if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) && pEnc->bframenum_tail==0) {                                  if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) && pEnc->bframenum_tail==0) {
1102                                          call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, 0, 0, stats);                                          call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, NULL, NULL, stats);
1103                                  }else{                                  }else{
1104                                          pEnc->flush_bframes = 1;                                          pEnc->flush_bframes = 1;
1105                                          goto done;                                          goto done;
# Line 1223  Line 1223 
1223          if (!(pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) && pEnc->mbParam.max_bframes > 0)          if (!(pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) && pEnc->mbParam.max_bframes > 0)
1224          {          {
1225                  if (pEnc->current->stamp > 0) {                  if (pEnc->current->stamp > 0) {
1226                          call_plugins(pEnc, pEnc->reference, &pEnc->sOriginal, XVID_PLG_AFTER, 0, 0, stats);                          call_plugins(pEnc, pEnc->reference, &pEnc->sOriginal, XVID_PLG_AFTER, NULL, NULL, stats);
1227                  }                  }
1228                  else                  else
1229                          stats->type = XVID_TYPE_NOTHING;                          stats->type = XVID_TYPE_NOTHING;
# Line 1346  Line 1346 
1346    
1347                  if ( FrameCodeP(pEnc, &bs) == 0 ) {                  if ( FrameCodeP(pEnc, &bs) == 0 ) {
1348                          /* N-VOP, we mustn't code b-frames yet */                          /* N-VOP, we mustn't code b-frames yet */
1349                          call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, 0, 0, stats);                          if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) ||
1350                                     pEnc->mbParam.max_bframes == 0)
1351                                    call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, NULL, NULL, stats);
1352                          goto done;                          goto done;
1353                  }                  }
1354          }          }
# Line 1367  Line 1369 
1369    
1370          /* packed or no-bframes or no-bframes-queued: output stats */          /* packed or no-bframes or no-bframes-queued: output stats */
1371          if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) || pEnc->mbParam.max_bframes == 0 ) {          if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) || pEnc->mbParam.max_bframes == 0 ) {
1372                  call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, 0, 0, stats);                  call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, NULL, NULL, stats);
1373          }          }
1374    
1375          /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Line 1757  Line 1759 
1759                  (pParam->frame_drop_ratio * mb_width * mb_height) / 100 &&                  (pParam->frame_drop_ratio * mb_width * mb_height) / 100 &&
1760                  ( (pEnc->bframenum_head >= pEnc->bframenum_tail) || !(pEnc->mbParam.global_flags & XVID_GLOBAL_CLOSED_GOP)) )                  ( (pEnc->bframenum_head >= pEnc->bframenum_tail) || !(pEnc->mbParam.global_flags & XVID_GLOBAL_CLOSED_GOP)) )
1761          {          {
1762                  current->sStat.kblks = current->sStat.mblks = 0;                  current->sStat.kblks = current->sStat.mblks = current->sStat.iTextBits = 0;
1763                  current->sStat.ublks = mb_width * mb_height;                  current->sStat.ublks = mb_width * mb_height;
1764    
1765                  BitstreamReset(bs);                  BitstreamReset(bs);

Legend:
Removed from v.1.119  
changed lines
  Added in v.1.120.2.1

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