[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.3, Mon Jun 9 13:55:07 2003 UTC revision 1.1.2.9, Fri Dec 5 14:44:35 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 5  #define DEFAULT_INITIAL_QUANTIZER 8
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 173  Line 182 
182          double base_quality;          double base_quality;
183          double target_quality;          double target_quality;
184    
   
185          /* Update internal values */          /* Update internal values */
186          rc->time += (double) data->fincr / data->fbase;          rc->time += (double) data->fincr / data->fbase;
187          rc->total_size += data->length;          rc->total_size += data->length;
188    
189            if(data->type == XVID_TYPE_BVOP)
190                    return (0);
191    
192            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 241  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 262  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.3  
changed lines
  Added in v.1.1.2.9

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