vah264enc: Avoid precision lost by just rounding up.

The code where dividing by 16 and later multiplying by 16, which is
spurious and a potential loose of precision.
This commit is contained in:
Víctor Manuel Jáquez Leal 2022-09-17 10:14:40 +02:00
parent 69c75f9827
commit a8387fdc6b

View file

@ -1570,8 +1570,9 @@ gst_va_h264_enc_reconfig (GstVaBaseEnc * base)
max_ref_frames = self->gop.num_ref_frames + 3 /* scratch frames */ ;
if (!gst_va_encoder_open (base->encoder, base->profile, base->entrypoint,
GST_VIDEO_INFO_FORMAT (&base->input_state->info), base->rt_format,
self->mb_width * 16, self->mb_height * 16, base->codedbuf_size,
max_ref_frames, self->rc.rc_ctrl_mode, self->packed_headers)) {
GST_ROUND_UP_16 (base->width), GST_ROUND_UP_16 (base->height),
base->codedbuf_size, max_ref_frames, self->rc.rc_ctrl_mode,
self->packed_headers)) {
GST_ERROR_OBJECT (self, "Failed to open the VA encoder.");
return FALSE;
}