[FFmpeg-devel] [PATCH] avcodec: Switch bitrate to 64bit with the bump

Michael Niedermayer michaelni at gmx.at
Mon Sep 14 16:31:56 CEST 2015


On Mon, Sep 14, 2015 at 01:16:34AM +0200, Carl Eugen Hoyos wrote:
> On Monday 14 September 2015 12:48:27 am Michael Niedermayer wrote:
> > the entries in avcodec_options are wrong
> 
> New patch attached.

[...]

> diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> index d6a5c69..f92bc25 100644
> --- a/libavcodec/options_table.h
> +++ b/libavcodec/options_table.h
> @@ -42,8 +42,8 @@
>  #define AV_CODEC_DEFAULT_BITRATE 200*1000
>  
>  static const AVOption avcodec_options[] = {
> -{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = AV_CODEC_DEFAULT_BITRATE }, 0, INT_MAX, A|V|E},
> -{"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 128*1000 }, 0, INT_MAX, A|E},
> +{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT64, {.i64 = AV_CODEC_DEFAULT_BITRATE }, 0, INT_MAX, A|V|E},
> +{"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT64, {.i64 = 128*1000 }, 0, INT_MAX, A|E},
>  {"bt", "Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate tolerance specifies how far "
>         "ratecontrol is willing to deviate from the target average bitrate value. This is not related "
>         "to minimum/maximum bitrate. Lowering tolerance too much has an adverse effect on quality.",
[...]
> diff --git a/libavformat/rdt.c b/libavformat/rdt.c
> index 046d273..79c0314 100644
> --- a/libavformat/rdt.c
> +++ b/libavformat/rdt.c
> @@ -448,7 +448,7 @@ real_parse_asm_rule(AVStream *st, const char *p, const char *end)
>  {
>      do {
>          /* can be either averagebandwidth= or AverageBandwidth= */
> -        if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%d", &st->codec->bit_rate) == 1)
> +        if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%"SCNd64, (int64_t *)&st->codec->bit_rate) == 1)

if the type is not already int64 then this is broken

also noone objected to droping ABI compatibility either on the ML
nor on IRC when it was asked. Thus there is currently a unanimous
consent to droping it.
I dont understand why you modify this patch to support a case you
conset to be removed

that said, the patches are fine, the bugs are just in cases that
the there exist unanimous consent that they should be dropped

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150914/b933507a/attachment.sig>


More information about the ffmpeg-devel mailing list