[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.32, Wed May 1 13:00:01 2002 UTC revision 1.35, Mon May 6 10:07:18 2002 UTC
# Line 264  Line 264 
264  #ifdef BFRAMES  #ifdef BFRAMES
265    
266          // TODO: handle malloc() == NULL          // TODO: handle malloc() == NULL
267          pEnc->max_bframes = pParam->max_bframes;          pEnc->mbParam.max_bframes = pParam->max_bframes;
268          pEnc->bquant_ratio = pParam->bquant_ratio;          pEnc->bquant_ratio = pParam->bquant_ratio;
269          if (pEnc->max_bframes > 0)          if (pEnc->mbParam.max_bframes > 0)
270          {          {
271                  int n;                  int n;
272    
273                  pEnc->bframes = malloc(pEnc->max_bframes * sizeof(FRAMEINFO *));                  pEnc->bframes = malloc(pEnc->mbParam.max_bframes * sizeof(FRAMEINFO *));
274    
275                  for (n = 0; n < pEnc->max_bframes; n++)                  for (n = 0; n < pEnc->mbParam.max_bframes; n++)
276                  {                  {
277                          pEnc->bframes[n] = malloc(sizeof(FRAMEINFO));                          pEnc->bframes[n] = malloc(sizeof(FRAMEINFO));
278                          pEnc->bframes[n]->mbs = malloc(sizeof(MACROBLOCK) * pEnc->mbParam.mb_width * pEnc->mbParam.mb_height);                          pEnc->bframes[n]->mbs = malloc(sizeof(MACROBLOCK) * pEnc->mbParam.mb_width * pEnc->mbParam.mb_height);
# Line 316  Line 316 
316    
317  // =================================================================  // =================================================================
318  #ifdef BFRAMES  #ifdef BFRAMES
319          if (pEnc->max_bframes > 0)          if (pEnc->mbParam.max_bframes > 0)
320          {          {
321                  int n;                  int n;
322                  for (n = 0; n < pEnc->max_bframes; n++)                  for (n = 0; n < pEnc->mbParam.max_bframes; n++)
323                  {                  {
324                          image_destroy(&pEnc->bframes[n]->image, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height);                          image_destroy(&pEnc->bframes[n]->image, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height);
325                          free(pEnc->bframes[n]->mbs);                          free(pEnc->bframes[n]->mbs);
# Line 327  Line 327 
327                  }                  }
328                  free(pEnc->bframes);                  free(pEnc->bframes);
329          }          }
330  #endif BFRAMES  #endif
331  //====================================================================  //====================================================================
332    
333          image_destroy(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height);          image_destroy(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height);
# Line 433  Line 433 
433          SWAP(pEnc->current, pEnc->reference);          SWAP(pEnc->current, pEnc->reference);
434    
435          pEnc->current->quant = (pFrame->quant == 0) ? RateControlGetQ(0) : pFrame->quant;          pEnc->current->quant = (pFrame->quant == 0) ? RateControlGetQ(0) : pFrame->quant;
436    
437            if(pEnc->current->quant < 1)
438                    pEnc->current->quant = 1;
439    
440            if(pEnc->current->quant > 31)
441                    pEnc->current->quant = 31;
442    
443          pEnc->current->global_flags = pFrame->general;          pEnc->current->global_flags = pFrame->general;
444          pEnc->current->motion_flags = pFrame->motion;          pEnc->current->motion_flags = pFrame->motion;
445          pEnc->current->seconds = pEnc->mbParam.m_seconds;          pEnc->current->seconds = pEnc->mbParam.m_seconds;
# Line 500  Line 507 
507                  /* note: sequences like "IIBB" decode fine with msfdam but,                  /* note: sequences like "IIBB" decode fine with msfdam but,
508                     go screwy with divx5.00 */                     go screwy with divx5.00 */
509          }          }
510          else if (pEnc->bframenum_tail >= pEnc->max_bframes)          else if (pEnc->bframenum_tail >= pEnc->mbParam.max_bframes)
511          {          {
512                  dprintf("--- PFRAME ---");                  dprintf("--- PFRAME ---");
513    

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.35

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