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

Diff of /trunk/xvidcore/src/encoder.c

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

revision 73, Thu Mar 28 12:24:41 2002 UTC revision 78, Thu Mar 28 20:57:25 2002 UTC
# Line 255  Line 255 
255          {          {
256                  int * temp_dquants = (int *) xvid_malloc(pEnc->mbParam.mb_width * pEnc->mbParam.mb_height * sizeof(int), CACHE_LINE);                  int * temp_dquants = (int *) xvid_malloc(pEnc->mbParam.mb_width * pEnc->mbParam.mb_height * sizeof(int), CACHE_LINE);
257    
258                  pEnc->mbParam.quant = adaptive_quantization(pEnc->sCurrent.y, pEnc->mbParam.width,                  pEnc->mbParam.quant = adaptive_quantization(pEnc->sCurrent.y,
259                                                              temp_dquants, pFrame->quant, pFrame->quant,                                                              pEnc->mbParam.width,
260                                                              2*pFrame->quant, pEnc->mbParam.mb_width, pEnc->mbParam.mb_height);                                                              temp_dquants,
261                                                                pFrame->quant,
262                                                                pFrame->quant,
263                                                                2*pFrame->quant,
264                                                                pEnc->mbParam.mb_width,
265                                                                pEnc->mbParam.mb_height);
266    
267                  for (y = 0; y < pEnc->mbParam.mb_height; y++)                  for (y = 0; y < pEnc->mbParam.mb_height; y++)
268                          for (x = 0; x < pEnc->mbParam.mb_width; x++)                          for (x = 0; x < pEnc->mbParam.mb_width; x++)
# Line 276  Line 281 
281          else if(pEnc->mbParam.global_flags & XVID_MPEGQUANT) {          else if(pEnc->mbParam.global_flags & XVID_MPEGQUANT) {
282                  int ret1, ret2;                  int ret1, ret2;
283    
284                    ret1 = ret2 = 0;
285    
286                  if(pEnc->mbParam.quant_type != MPEG4_QUANT)                  if(pEnc->mbParam.quant_type != MPEG4_QUANT)
287                          write_vol_header = 1;                          write_vol_header = 1;
288    
# Line 364  Line 371 
371    
372  static int FrameCodeI(Encoder * pEnc, Bitstream * bs, uint32_t *pBits)  static int FrameCodeI(Encoder * pEnc, Bitstream * bs, uint32_t *pBits)
373  {  {
374  #ifdef LINUX  
375          DECLARE_ALIGNED_MATRIX(dct_codes,6,64,int16_t,16);          DECLARE_ALIGNED_MATRIX(dct_codes, 6, 64, int16_t, CACHE_LINE);
376          DECLARE_ALIGNED_MATRIX(qcoeff,6,64,int16_t,16);          DECLARE_ALIGNED_MATRIX(qcoeff,    6, 64, int16_t, CACHE_LINE);
377  #else  
         CACHE_ALIGN int16_t dct_codes[6][64];  
         CACHE_ALIGN int16_t qcoeff[6][64];  
 #endif  
378          uint16_t x, y;          uint16_t x, y;
379    
380          pEnc->iFrameNum = 0;          pEnc->iFrameNum = 0;
# Line 421  Line 425 
425  static int FrameCodeP(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, bool force_inter, bool vol_header)  static int FrameCodeP(Encoder * pEnc, Bitstream * bs, uint32_t *pBits, bool force_inter, bool vol_header)
426  {  {
427          float fSigma;          float fSigma;
428  #ifdef LINUX  
429          DECLARE_ALIGNED_MATRIX(dct_codes,6,64,int16_t,16);          DECLARE_ALIGNED_MATRIX(dct_codes, 6, 64, int16_t, CACHE_LINE);
430          DECLARE_ALIGNED_MATRIX(qcoeff,6,64,int16_t,16);          DECLARE_ALIGNED_MATRIX(qcoeff,    6, 64, int16_t, CACHE_LINE);
 #else  
         CACHE_ALIGN int16_t dct_codes[6][64];  
         CACHE_ALIGN int16_t qcoeff[6][64];  
 #endif  
431    
432          int iLimit;          int iLimit;
433          uint32_t x, y;          uint32_t x, y;
# Line 438  Line 438 
438          IMAGE *pRef = &pEnc->sReference;          IMAGE *pRef = &pEnc->sReference;
439    
440          start_timer();          start_timer();
441          image_setedges(pRef,pEnc->mbParam.edged_width, pEnc->mbParam.edged_height, pEnc->mbParam.width, pEnc->mbParam.height, pEnc->mbParam.global_flags & XVID_INTERLACING);          image_setedges(pRef,
442                           pEnc->mbParam.edged_width,
443                           pEnc->mbParam.edged_height,
444                           pEnc->mbParam.width,
445                           pEnc->mbParam.height,
446                           pEnc->mbParam.global_flags & XVID_INTERLACING);
447          stop_edges_timer();          stop_edges_timer();
448    
449          pEnc->mbParam.rounding_type = 1 - pEnc->mbParam.rounding_type;          pEnc->mbParam.rounding_type = 1 - pEnc->mbParam.rounding_type;
# Line 490  Line 495 
495                          if (!bIntra)                          if (!bIntra)
496                          {                          {
497                                  start_timer();                                  start_timer();
498                                  MBMotionCompensation(pMB, x, y, &pEnc->sReference,                                  MBMotionCompensation(pMB,
499                                                       &pEnc->vInterH, &pEnc->vInterV,                                                       x, y,
500                                                       &pEnc->vInterHV, &pEnc->sCurrent, dct_codes,                                                       &pEnc->sReference,
501                                                         &pEnc->vInterH,
502                                                         &pEnc->vInterV,
503                                                         &pEnc->vInterHV,
504                                                         &pEnc->sCurrent,
505                                                         dct_codes,
506                                                       pEnc->mbParam.width,                                                       pEnc->mbParam.width,
507                                                       pEnc->mbParam.height,                                                       pEnc->mbParam.height,
508                                                       pEnc->mbParam.edged_width,                                                       pEnc->mbParam.edged_width,

Legend:
Removed from v.73  
changed lines
  Added in v.78

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