[x265] [PATCH] Fix incorrectly calculated bitrate.

Steve Borho steve at borho.org
Tue Apr 22 00:35:29 CEST 2014


On Mon, Apr 21, 2014 at 4:19 PM, den c <dncodr at gmail.com> wrote:
> x265: fixes bitrate output when encoding

Can you commit this and email it as a proper patch so it has your full
name associated with it?

If you don't want to bother configuring Mercurial at all, you can do
this in two command lines:

hg commit -u "your name <dncodr at gmail.com>" -m "cli: fix bitrate
output when encoding"
hg export tip > bitrate-fix.patch


> diff -r 78c1f43f12f5 source/x265.cpp
> --- a/source/x265.cpp   Thu Apr 17 16:32:16 2014 -0500
> +++ b/source/x265.cpp   Mon Apr 21 23:59:24 2014 +0300
> @@ -251,9 +251,9 @@
>          return;
>      int64_t elapsed = time - startTime;
>      double fps = elapsed > 0 ? frameNum * 1000000. / elapsed : 0;
> +    float bitrate = 0.008f * totalbytes * (param->fpsNum /
> param->fpsDenom) / ( (float) frameNum);
>      if (framesToBeEncoded)
>      {
> -        float bitrate = 0.008f * totalbytes / ((float)frameNum /
> ((float)param->fpsNum / param->fpsDenom));
>          int eta = (int)(elapsed * (framesToBeEncoded - frameNum) /
> ((int64_t)frameNum * 1000000));
>          sprintf(buf, "x265 [%.1f%%] %d/%d frames, %.2f fps, %.2f
> kb/s, eta %d:%02d:%02d",
>                  100. * frameNum / framesToBeEncoded, frameNum,
> framesToBeEncoded, fps, bitrate,
> @@ -261,7 +261,6 @@
>      }
>      else
>      {
> -        float bitrate = (float)totalbytes * 8 / ((float)1000 *
> param->fpsNum / param->fpsDenom);
>          sprintf(buf, "x265 %d frames: %.2f fps, %.2f kb/s", frameNum,
> fps, bitrate);
>      }
>      fprintf(stderr, "%s  \r", buf + 5);
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>



-- 
Steve Borho


More information about the x265-devel mailing list