[cvs] / xvidcore / src / plugins / plugin_single.c Repository:
ViewVC logotype

Diff of /xvidcore/src/plugins/plugin_single.c

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

revision 1.1.2.5, Wed Oct 1 23:23:01 2003 UTC revision 1.1.2.10, Wed Dec 17 13:15:33 2003 UTC
# Line 30  Line 30 
30  #include "../xvid.h"  #include "../xvid.h"
31  #include "../image/image.h"  #include "../image/image.h"
32    
33  #define DEFAULT_INITIAL_QUANTIZER 8  #define DEFAULT_INITIAL_QUANTIZER 4
34    
35  #define DEFAULT_BITRATE 900000  /* 900kbps */  #define DEFAULT_BITRATE 900000  /* 900kbps */
36  #define DEFAULT_DELAY_FACTOR 16  #define DEFAULT_DELAY_FACTOR 16
# Line 153  Line 153 
153              data->quant = (int)rc->fq_error;              data->quant = (int)rc->fq_error;
154              rc->fq_error -= data->quant;              rc->fq_error -= data->quant;
155          }else {          }else {
156                  data->quant = rc->rtn_quant;                          int q = rc->rtn_quant;
157                            /* limit to min/max range
158                               we don't know frame type of the next frame, so we just use
159                               P-VOP's range... */
160                            if (q > data->max_quant[XVID_TYPE_PVOP-1])
161                                    q = data->max_quant[XVID_TYPE_PVOP-1];
162                            else if (q < data->min_quant[XVID_TYPE_PVOP-1])
163                                    q = data->min_quant[XVID_TYPE_PVOP-1];
164    
165                            data->quant = q;
166          }          }
167      }      }
168          return 0;          return 0;
# Line 183  Line 192 
192          rc->rtn_quant = data->quant;          rc->rtn_quant = data->quant;
193    
194          /* Compute the deviation from expected total size */          /* Compute the deviation from expected total size */
195          deviation = (int64_t)          deviation =
196                  ((double) rc->total_size - (double) rc->bytes_per_sec * rc->time);                  rc->total_size - rc->bytes_per_sec * rc->time;
197    
198    
199          if (data->quant >= 2) {          if (data->quant >= 2) {
# Line 245  Line 254 
254          else if (rtn_quant < data->quant - 1)          else if (rtn_quant < data->quant - 1)
255                  rtn_quant = data->quant - 1;                  rtn_quant = data->quant - 1;
256    
     /* limit to min/max range */  
         if (rtn_quant > data->max_quant[data->type-1])  
                 rtn_quant = data->max_quant[data->type-1];  
         else if (rtn_quant < data->min_quant[data->type-1])  
                 rtn_quant = data->min_quant[data->type-1];  
   
257          rc->rtn_quant = rtn_quant;          rc->rtn_quant = rtn_quant;
258    
259          return (0);          return (0);
# Line 266  Line 269 
269  {  {
270          switch (opt) {          switch (opt) {
271          case XVID_PLG_INFO:          case XVID_PLG_INFO:
272            case XVID_PLG_FRAME :
273                  return 0;                  return 0;
274    
275          case XVID_PLG_CREATE:          case XVID_PLG_CREATE:

Legend:
Removed from v.1.1.2.5  
changed lines
  Added in v.1.1.2.10

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