[Ffmpeg-devel] update ratecontol to new eval API

Michael Niedermayer michaelni
Fri Oct 27 21:55:54 CEST 2006


Hi


On Fri, Oct 27, 2006 at 09:42:19PM +0200, Oded Shimon wrote:
> last patch, I think.
> 
> - ods15

> Index: libavcodec/ratecontrol.c
> ===================================================================
> --- libavcodec/ratecontrol.c	(revision 6797)
> +++ libavcodec/ratecontrol.c	(working copy)
> @@ -48,12 +48,70 @@
[...]
> +    rcc->rc_eq_eval = ff_parse(s->avctx->rc_eq, const_names, func1, func1_names, NULL, NULL, &error);
> +    if (!rcc->rc_eq_eval) {
> +        av_log(s->avctx, AV_LOG_ERROR, "Error evaluating rc_eq \"%s\": %s\n", s->avctx->rc_eq, error? error : "");
                                                 ^^^^^^^^^^
parsing


[...]
> -    bits= ff_eval2(s->avctx->rc_eq, const_values, const_names, func1, func1_names, NULL, NULL, rce, &error);
> -    if (isnan(bits)) {
> -        av_log(s->avctx, AV_LOG_ERROR, "Error evaluating rc_eq \"%s\": %s\n", s->avctx->rc_eq, error? error : "");
> -        return -1;
> -    }
> +    bits= ff_parse_eval(rcc->rc_eq_eval, const_values, rce);

NAN can still occur (0/0) so some check should maybe remain

except these the patch looks ok assuming regression tests pass

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list