[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 3, Fri Mar 8 02:46:11 2002 UTC revision 4, Fri Mar 8 19:17:46 2002 UTC
# Line 15  Line 15 
15  #include "utils/emms.h"  #include "utils/emms.h"
16  #include "bitstream/mbcoding.h"  #include "bitstream/mbcoding.h"
17  #include "quant/adapt_quant.h"  #include "quant/adapt_quant.h"
18    #include "quant/quant_matrix.h"
19    
20  #define ENC_CHECK(X) if(!(X)) return XVID_ERR_FORMAT  #define ENC_CHECK(X) if(!(X)) return XVID_ERR_FORMAT
21    
# Line 216  Line 217 
217      Bitstream bs;      Bitstream bs;
218      uint32_t bits;      uint32_t bits;
219          uint16_t quant_type = 0;          uint16_t quant_type = 0;
220          uint16_t quant_change = 0;          uint16_t write_vol_header = 0;
221    
222      IMAGE *pCurrent = &(pEnc->sCurrent);      IMAGE *pCurrent = &(pEnc->sCurrent);
223    
# Line 273  Line 274 
274    
275          if(pEnc->mbParam.quant_type != quant_type) {          if(pEnc->mbParam.quant_type != quant_type) {
276                  pEnc->mbParam.quant_type = quant_type;                  pEnc->mbParam.quant_type = quant_type;
277                  quant_change = 1;                  write_vol_header = 1;
278          }          }
279          else          else
280                  quant_change = 0;                  write_vol_header = 0;
281    
282            if ((pEnc->mbParam.global_flags & XVID_CUSTOM_QMATRIX) > 0)
283            {
284                    int ret1, ret2;
285                    ret1 = set_intra_matrix(pFrame->quant_intra_matrix);
286                    ret2 = set_inter_matrix(pFrame->quant_inter_matrix);
287                    if(write_vol_header == 0)
288                            write_vol_header = ret1 | ret2;
289            }
290    
291          if (pFrame->intra < 0)          if (pFrame->intra < 0)
292      {      {
# Line 286  Line 295 
295    
296                          pFrame->intra = FrameCodeI(pEnc, &bs, &bits);                          pFrame->intra = FrameCodeI(pEnc, &bs, &bits);
297                  else                  else
298                          pFrame->intra = FrameCodeP(pEnc, &bs, &bits, 0, quant_change);                          pFrame->intra = FrameCodeP(pEnc, &bs, &bits, 0, write_vol_header);
299      }      }
300      else      else
301      {      {
302                  if (pFrame->intra == 1)                  if (pFrame->intra == 1)
303                      pFrame->intra = FrameCodeI(pEnc, &bs, &bits);                      pFrame->intra = FrameCodeI(pEnc, &bs, &bits);
304                  else                  else
305                          pFrame->intra = FrameCodeP(pEnc, &bs, &bits, 1, quant_change);                          pFrame->intra = FrameCodeP(pEnc, &bs, &bits, 1, write_vol_header);
306      }      }
307    
308          BitstreamPutBits(&bs, 0xFFFF, 16);          BitstreamPutBits(&bs, 0xFFFF, 16);

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

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