[FFmpeg-devel] [PATCH] lavc/qsvenc: set BRCParamMultiplier to aviod BRC overflow
lizhong1008 at gmail.com
Fri Jan 11 16:17:44 EET 2019
Good catch.Yes,that is possible but possibility is smaller than bitrate
since they are in Bytes. I got it too but finally ignored them to make
things simple. Let me send an update version soon.
Carl Eugen Hoyos <ceffmpeg at gmail.com> 于 2019年1月11日周五 下午9:45写道：
> 2019-01-11 14:25 GMT+01:00, Hendrik Leppkes <h.leppkes at gmail.com>:
> > On Fri, Jan 11, 2019 at 1:18 PM Carl Eugen Hoyos <ceffmpeg at gmail.com>
> >> 2019-01-11 13:09 GMT+01:00, Zhong Li <zhong.li at intel.com>:
> >> > + //libmfx BRC parameters are 16 bits thus maybe overflow, then
> >> > BRCParamMultiplier is needed
> >> > + target_bitrate_kbps = avctx->bit_rate / 1000;
> >> > + max_bitrate_kbps = avctx->rc_max_rate / 1000;
> >> > + brc_param_multiplier = (FFMAX(target_bitrate_kbps,
> >> > max_bitrate_kbps) + 0x10000) / 0x10000;
> >> How will this behave if the user sets 100MBit?
> > Its really quite simple math. It'll cause the multipler to become 2,
> > effectively dividing all numbers by two, so instead of trying to pass
> > 102400 kbps bitrate, it'll pass 51200 * 2 kbps bitrate, which fits
> > into the 16-bit value.
> Seems like a useful solution.
> Is there no possibility that BufferSizeInKB or InitialDelayInKB overflow?
> Carl Eugen
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
More information about the ffmpeg-devel