diff options
author | Andy Furniss <[email protected]> | 2016-09-26 10:44:35 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2016-09-27 14:21:45 +0200 |
commit | a5993022275c20061ac025d9adc26c5f9d02afee (patch) | |
tree | 32994a1b3c98deac79f49172f86837e9df3d1657 /src/gallium/state_trackers/va | |
parent | a543f231d712dbdfd309ff589766179c5cb32b20 (diff) |
st/va Avoid VBR bitrate calculation overflow v2
VBR bitrate calc needs 64 bits at high rates.
v2: use float.
Signed-off-by: Andy Furniss <[email protected]>
Reviewed-by: Christian König <[email protected]>
Cc: [email protected]
Diffstat (limited to 'src/gallium/state_trackers/va')
-rw-r--r-- | src/gallium/state_trackers/va/picture.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c index 7f3d96d67ab..399667f8f8e 100644 --- a/src/gallium/state_trackers/va/picture.c +++ b/src/gallium/state_trackers/va/picture.c @@ -322,7 +322,7 @@ handleVAEncMiscParameterTypeRateControl(vlVaContext *context, VAEncMiscParameter PIPE_H264_ENC_RATE_CONTROL_METHOD_CONSTANT) context->desc.h264enc.rate_ctrl.target_bitrate = rc->bits_per_second; else - context->desc.h264enc.rate_ctrl.target_bitrate = rc->bits_per_second * rc->target_percentage / 100; + context->desc.h264enc.rate_ctrl.target_bitrate = rc->bits_per_second * (rc->target_percentage / 100.0); context->desc.h264enc.rate_ctrl.peak_bitrate = rc->bits_per_second; if (context->desc.h264enc.rate_ctrl.target_bitrate < 2000000) context->desc.h264enc.rate_ctrl.vbv_buffer_size = MIN2((context->desc.h264enc.rate_ctrl.target_bitrate * 2.75), 2000000); |