]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Update buffer size for h264 and hevc
authorOvaron <ovaron@myovaron.de>
Thu, 10 Feb 2022 20:51:21 +0000 (21:51 +0100)
committerFlole998 <Flole998@users.noreply.github.com>
Sat, 12 Feb 2022 18:30:59 +0000 (19:30 +0100)
Increased buffer for h264 and hevc transcoding (from ((self->bit_rate) * 1000) * 2 to ((self->bit_rate) * 1000) * 3).
With bigger buffer picture creates less artefacts on lower bitrates.

src/transcoding/codec/codecs/libs/vaapi.c

index 8fa33402d27419dc8e212835dabb248ab8be0989..6c18d596c17435eff4d4c6f8af77bfc9e69ed972 100644 (file)
@@ -177,7 +177,7 @@ tvh_codec_profile_vaapi_h264_open(tvh_codec_profile_vaapi_t *self,
     if (self->bit_rate) {
         AV_DICT_SET_BIT_RATE(opts, self->bit_rate);
         AV_DICT_SET_INT(opts, "maxrate", (self->bit_rate) * 1000, AV_DICT_DONT_OVERWRITE);
-        AV_DICT_SET_INT(opts, "bufsize", ((self->bit_rate) * 1000) * 2, AV_DICT_DONT_OVERWRITE);
+        AV_DICT_SET_INT(opts, "bufsize", ((self->bit_rate) * 1000) * 3, AV_DICT_DONT_OVERWRITE);
         AV_DICT_SET(opts, "force_key_frames", "expr:gte(t,n_forced*3)", AV_DICT_DONT_OVERWRITE);
     }
     else {
@@ -239,7 +239,7 @@ tvh_codec_profile_vaapi_hevc_open(tvh_codec_profile_vaapi_t *self,
     if (self->bit_rate) {
         AV_DICT_SET_BIT_RATE(opts, self->bit_rate);
         AV_DICT_SET_INT(opts, "maxrate", (self->bit_rate) * 1000, AV_DICT_DONT_OVERWRITE);
-        AV_DICT_SET_INT(opts, "bufsize", ((self->bit_rate) * 1000) * 2, AV_DICT_DONT_OVERWRITE);
+        AV_DICT_SET_INT(opts, "bufsize", ((self->bit_rate) * 1000) * 3, AV_DICT_DONT_OVERWRITE);
         AV_DICT_SET(opts, "force_key_frames", "expr:gte(t,n_forced*3)", AV_DICT_DONT_OVERWRITE);
     }
     else {