Skip to content

Commit

Permalink
add fixes for a vaapi-qsv mapping error
Browse files Browse the repository at this point in the history
  • Loading branch information
nyanmisaka committed Nov 27, 2021
1 parent c3da15c commit f842df1
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
61 changes: 61 additions & 0 deletions debian/patches/0030-add-fixes-for-a-vaapi-qsv-mapping-error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Index: jellyfin-ffmpeg/libavcodec/qsvenc_hevc.c
===================================================================
--- jellyfin-ffmpeg.orig/libavcodec/qsvenc_hevc.c
+++ jellyfin-ffmpeg/libavcodec/qsvenc_hevc.c
@@ -260,9 +260,9 @@ static const AVClass class = {
static const AVCodecDefault qsv_enc_defaults[] = {
{ "b", "1M" },
{ "refs", "0" },
- // same as the x264 default
+ // same as the x265 default
{ "g", "248" },
- { "bf", "8" },
+ { "bf", "4" },
{ "qmin", "-1" },
{ "qmax", "-1" },
{ "trellis", "-1" },
Index: jellyfin-ffmpeg/libavcodec/vaapi_decode.c
===================================================================
--- jellyfin-ffmpeg.orig/libavcodec/vaapi_decode.c
+++ jellyfin-ffmpeg/libavcodec/vaapi_decode.c
@@ -572,22 +572,24 @@ static int vaapi_decode_make_config(AVCo
if (err < 0)
goto fail;

- frames->initial_pool_size = 1;
- // Add per-codec number of surfaces used for storing reference frames.
- switch (avctx->codec_id) {
- case AV_CODEC_ID_H264:
- case AV_CODEC_ID_HEVC:
- frames->initial_pool_size += 16;
- break;
- case AV_CODEC_ID_VP9:
- case AV_CODEC_ID_AV1:
- frames->initial_pool_size += 8;
- break;
- case AV_CODEC_ID_VP8:
- frames->initial_pool_size += 3;
- break;
- default:
- frames->initial_pool_size += 2;
+ if (!frames->initial_pool_size) {
+ frames->initial_pool_size = 1;
+ // Add per-codec number of surfaces used for storing reference frames.
+ switch (avctx->codec_id) {
+ case AV_CODEC_ID_H264:
+ case AV_CODEC_ID_HEVC:
+ frames->initial_pool_size += 16;
+ break;
+ case AV_CODEC_ID_VP9:
+ case AV_CODEC_ID_AV1:
+ frames->initial_pool_size += 8;
+ break;
+ case AV_CODEC_ID_VP8:
+ frames->initial_pool_size += 3;
+ break;
+ default:
+ frames->initial_pool_size += 2;
+ }
}
}

1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@
0027-add-fixes-to-improve-the-performance-of-vaapi-encode.patch
0028-add-fixes-for-alignment-issue-when-upload-to-qsv.patch
0029-add-fixes-for-overlay-qsv-to-allow-different-underlying-devices.patch
0030-add-fixes-for-a-vaapi-qsv-mapping-error.patch

0 comments on commit f842df1

Please sign in to comment.