[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 158, Fri May 3 15:26:30 2002 UTC revision 168, Thu May 9 00:15:51 2002 UTC
# Line 32  Line 32 
32   *   *
33   *  History   *  History
34   *   *
35     *  08.05.2002 fix some problem in DEBUG mode;
36     *             MinChen <chenm001@163.com>
37   *  14.04.2002 added FrameCodeB()   *  14.04.2002 added FrameCodeB()
38   *   *
39   *  $Id: encoder.c,v 1.34 2002-05-03 15:26:30 edgomez Exp $   *  $Id: encoder.c,v 1.36 2002-05-09 00:15:50 chenm001 Exp $
40   *   *
41   ***************************************************************************/   ***************************************************************************/
42    
# Line 264  Line 266 
266  #ifdef BFRAMES  #ifdef BFRAMES
267    
268          // TODO: handle malloc() == NULL          // TODO: handle malloc() == NULL
269          pEnc->max_bframes = pParam->max_bframes;          pEnc->mbParam.max_bframes = pParam->max_bframes;
270          pEnc->bquant_ratio = pParam->bquant_ratio;          pEnc->bquant_ratio = pParam->bquant_ratio;
271          if (pEnc->max_bframes > 0)          if (pEnc->mbParam.max_bframes > 0)
272          {          {
273                  int n;                  int n;
274    
275                  pEnc->bframes = malloc(pEnc->max_bframes * sizeof(FRAMEINFO *));                  pEnc->bframes = malloc(pEnc->mbParam.max_bframes * sizeof(FRAMEINFO *));
276    
277                  for (n = 0; n < pEnc->max_bframes; n++)                  for (n = 0; n < pEnc->mbParam.max_bframes; n++)
278                  {                  {
279                          pEnc->bframes[n] = malloc(sizeof(FRAMEINFO));                          pEnc->bframes[n] = malloc(sizeof(FRAMEINFO));
280                          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 318 
318    
319  // =================================================================  // =================================================================
320  #ifdef BFRAMES  #ifdef BFRAMES
321          if (pEnc->max_bframes > 0)          if (pEnc->mbParam.max_bframes > 0)
322          {          {
323                  int n;                  int n;
324                  for (n = 0; n < pEnc->max_bframes; n++)                  for (n = 0; n < pEnc->mbParam.max_bframes; n++)
325                  {                  {
326                          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);
327                          free(pEnc->bframes[n]->mbs);                          free(pEnc->bframes[n]->mbs);
# Line 365  Line 367 
367          Bitstream bs;          Bitstream bs;
368          uint32_t bits;          uint32_t bits;
369    
370    #ifdef _DEBUG
371            float psnr;
372            char temp[128];
373    #endif
374    
375          ENC_CHECK(pEnc);          ENC_CHECK(pEnc);
376          ENC_CHECK(pFrame);          ENC_CHECK(pFrame);
377    
# Line 457  Line 464 
464          stop_conv_timer();          stop_conv_timer();
465    
466  #ifdef _DEBUG  #ifdef _DEBUG
467          image_copy(&pEnc->sOriginal, &pEnc->sCurrent, pEnc->mbParam.edged_width, pEnc->mbParam.height);          image_copy(&pEnc->sOriginal, &pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height);
468  #endif  #endif
469    
470    
# Line 507  Line 514 
514                  /* note: sequences like "IIBB" decode fine with msfdam but,                  /* note: sequences like "IIBB" decode fine with msfdam but,
515                     go screwy with divx5.00 */                     go screwy with divx5.00 */
516          }          }
517          else if (pEnc->bframenum_tail >= pEnc->max_bframes)          else if (pEnc->bframenum_tail >= pEnc->mbParam.max_bframes)
518          {          {
519                  dprintf("--- PFRAME ---");                  dprintf("--- PFRAME ---");
520    

Legend:
Removed from v.158  
changed lines
  Added in v.168

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