[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 4, Fri Mar 8 19:17:46 2002 UTC revision 20, Sat Mar 9 21:44:47 2002 UTC
# Line 216  Line 216 
216      uint16_t x, y;      uint16_t x, y;
217      Bitstream bs;      Bitstream bs;
218      uint32_t bits;      uint32_t bits;
         uint16_t quant_type = 0;  
219          uint16_t write_vol_header = 0;          uint16_t write_vol_header = 0;
220    
     IMAGE *pCurrent = &(pEnc->sCurrent);  
   
221          start_global_timer();          start_global_timer();
222    
223      ENC_CHECK(pEnc);      ENC_CHECK(pEnc);
# Line 267  Line 264 
264                  free(temp_dquants);                  free(temp_dquants);
265          }          }
266    
267          if(pEnc->mbParam.global_flags & XVID_H263QUANT)          if(pEnc->mbParam.global_flags & XVID_H263QUANT) {
268                  quant_type = H263_QUANT;                  if(pEnc->mbParam.quant_type != H263_QUANT)
         else if(pEnc->mbParam.global_flags & XVID_MPEGQUANT)  
                 quant_type = MPEG4_QUANT;  
   
         if(pEnc->mbParam.quant_type != quant_type) {  
                 pEnc->mbParam.quant_type = quant_type;  
269                  write_vol_header = 1;                  write_vol_header = 1;
270                    pEnc->mbParam.quant_type = H263_QUANT;
271          }          }
272          else          else if(pEnc->mbParam.global_flags & XVID_MPEGQUANT) {
                 write_vol_header = 0;  
   
         if ((pEnc->mbParam.global_flags & XVID_CUSTOM_QMATRIX) > 0)  
         {  
273                  int ret1, ret2;                  int ret1, ret2;
274    
275                    if(pEnc->mbParam.quant_type != MPEG4_QUANT)
276                            write_vol_header = 1;
277    
278                    pEnc->mbParam.quant_type = MPEG4_QUANT;
279    
280                    if ((pEnc->mbParam.global_flags & XVID_CUSTOM_QMATRIX) > 0) {
281                            if(pFrame->quant_intra_matrix != NULL)
282                  ret1 = set_intra_matrix(pFrame->quant_intra_matrix);                  ret1 = set_intra_matrix(pFrame->quant_intra_matrix);
283                            if(pFrame->quant_inter_matrix != NULL)
284                  ret2 = set_inter_matrix(pFrame->quant_inter_matrix);                  ret2 = set_inter_matrix(pFrame->quant_inter_matrix);
285                    }
286                    else {
287                            ret1 = set_intra_matrix(get_default_intra_matrix());
288                            ret2 = set_inter_matrix(get_default_inter_matrix());
289                    }
290                  if(write_vol_header == 0)                  if(write_vol_header == 0)
291                          write_vol_header = ret1 | ret2;                          write_vol_header = ret1 | ret2;
292          }          }
# Line 358  Line 361 
361      int16_t dct_codes[6][64];      int16_t dct_codes[6][64];
362      int16_t qcoeff[6][64];      int16_t qcoeff[6][64];
363      uint16_t x, y;      uint16_t x, y;
     IMAGE *pCurrent = &pEnc->sCurrent;  
364    
365      pEnc->iFrameNum = 0;      pEnc->iFrameNum = 0;
366      pEnc->mbParam.rounding_type = 1;      pEnc->mbParam.rounding_type = 1;
# Line 382  Line 384 
384    
385                          CodeIntraMB(pEnc, pMB);                          CodeIntraMB(pEnc, pMB);
386    
387                          MBTransQuantIntra(&pEnc->mbParam, x, y, dct_codes, qcoeff, pCurrent);                          MBTransQuantIntra(&pEnc->mbParam, x, y, dct_codes, qcoeff, &pEnc->sCurrent);
388    
389                          start_timer();                          start_timer();
390                          MBPrediction(&pEnc->mbParam, x, y, pEnc->mbParam.mb_width, qcoeff, pEnc->pMBs);                          MBPrediction(&pEnc->mbParam, x, y, pEnc->mbParam.mb_width, qcoeff, pEnc->pMBs);

Legend:
Removed from v.4  
changed lines
  Added in v.20

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