[XviD-devel] Variable frame rate -plugin_single.c
Makira
makira at sympatico.ca
Fri Sep 19 18:13:35 CEST 2003
I sent this on 16 sep., but I think it didn't get to the list since I hadn't
subscribe. Sorry if this is a double post.
Makira
------
I'm using xvid in OpenShiiva (http://openshiiva.sf.net).
Just updated to xvid dev-api-4 cvs of today (a few hours ago).
The only file I changed is the plugin_single.c file. If you could integrate
the patch for vfr, I wouldn't have to keep a local copy... I think it is
safe, it shouldn't affect normal usage afaik.
Makira
Here's the diff:
23c23
< * $Id: plugin_single.c,v 1.1.2.4 2003/07/24 12:00:06 Isibaar Exp $
---
> * $Id: plugin_single.c,v 1.1 2003/06/25 16:48:57 makira Exp $
92,99d91
< /*
< * single needs to caclculate the average frame size. In order to do
that,
< * we really need valid fps
< */
< if (create->fincr == 0) {
< return XVID_ERR_FAIL;
< }
<
106d97
< rc->target_framesize =(double) rc->bytes_per_sec / ((double)
create->fbase / create->fincr);
121c112
< rc->avg_framesize = rc->target_framesize;
---
> rc->avg_framesize = 0;
183a175,179
>
> /* Update target frame size - vfr */
> /* framenum begins at 0 */
> rc->target_framesize = (double) rc->bytes_per_sec / ((double)
(data->frame_num + 1) / rc->time);
> if (!rc->avg_framesize) rc->avg_framesize = rc->target_framesize;
More information about the XviD-devel
mailing list