21 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
* |
* |
24 |
* $Id: encoder.c,v 1.104 2004-04-03 10:41:42 syskin Exp $ |
* $Id: encoder.c,v 1.106 2004-07-17 11:42:46 edgomez Exp $ |
25 |
* |
* |
26 |
****************************************************************************/ |
****************************************************************************/ |
27 |
|
|
100 |
i--; |
i--; |
101 |
} |
} |
102 |
|
|
103 |
/* if neccessary, round to 65535 accuracy */ |
if (*base > 65535 || *inc > 65535) { |
104 |
if (*base > 65535) { |
int *biggest; |
105 |
float div = (float) *base / 65535; |
int *other; |
106 |
*base = (int) (*base / div); |
|
107 |
*inc = (int) (*inc / div); |
if (*base > *inc) { |
108 |
|
biggest = base; |
109 |
|
other = inc; |
110 |
|
} else { |
111 |
|
biggest = inc; |
112 |
|
other = base; |
113 |
|
} |
114 |
|
|
115 |
|
float div = ((float)*biggest)/((float)65535); |
116 |
|
*biggest = (int)(((float)*biggest)/div); |
117 |
|
*other = (int)(((float)*other)/div); |
118 |
} |
} |
119 |
} |
} |
120 |
|
|
1866 |
DPRINTF(XVID_DEBUG_DEBUG, "kmu %i %i %i\n", current->sStat.kblks, current->sStat.mblks, current->sStat.ublks); |
DPRINTF(XVID_DEBUG_DEBUG, "kmu %i %i %i\n", current->sStat.kblks, current->sStat.mblks, current->sStat.ublks); |
1867 |
#endif |
#endif |
1868 |
if (current->sStat.kblks + current->sStat.mblks <= |
if (current->sStat.kblks + current->sStat.mblks <= |
1869 |
(pParam->frame_drop_ratio * mb_width * mb_height) / 100) |
(pParam->frame_drop_ratio * mb_width * mb_height) / 100 && |
1870 |
|
( (pEnc->bframenum_head >= pEnc->bframenum_tail) || !(pEnc->mbParam.global_flags & XVID_GLOBAL_CLOSED_GOP)) ) |
1871 |
{ |
{ |
1872 |
current->sStat.kblks = current->sStat.mblks = 0; |
current->sStat.kblks = current->sStat.mblks = 0; |
1873 |
current->sStat.ublks = mb_width * mb_height; |
current->sStat.ublks = mb_width * mb_height; |