-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add fixes for HEVC 10bit HDR decoding in bsf
- Loading branch information
1 parent
3fb7dd3
commit da8aafc
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
debian/patches/0024-add-fixes-for-HEVC-10-bit-HDR-decoding-in-bsf.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Index: jellyfin-ffmpeg/libavcodec/hevc_mp4toannexb_bsf.c | ||
=================================================================== | ||
--- jellyfin-ffmpeg.orig/libavcodec/hevc_mp4toannexb_bsf.c | ||
+++ jellyfin-ffmpeg/libavcodec/hevc_mp4toannexb_bsf.c | ||
@@ -121,7 +121,7 @@ static int hevc_mp4toannexb_filter(AVBSF | ||
HEVCBSFContext *s = ctx->priv_data; | ||
AVPacket *in; | ||
GetByteContext gb; | ||
- | ||
+ int has_sps = 0, has_pps = 0; | ||
int got_irap = 0; | ||
int i, ret = 0; | ||
|
||
@@ -155,10 +155,13 @@ static int hevc_mp4toannexb_filter(AVBSF | ||
} | ||
|
||
nalu_type = (bytestream2_peek_byte(&gb) >> 1) & 0x3f; | ||
+ has_sps = (has_sps || nalu_type == HEVC_NAL_SPS); | ||
+ has_pps = (has_pps || nalu_type == HEVC_NAL_PPS); | ||
|
||
/* prepend extradata to IRAP frames */ | ||
is_irap = nalu_type >= 16 && nalu_type <= 23; | ||
- add_extradata = is_irap && !got_irap; | ||
+ /* ignore the extradata if IRAP frame has sps and pps */ | ||
+ add_extradata = is_irap && !got_irap && !(has_sps && has_pps); | ||
extra_size = add_extradata * ctx->par_out->extradata_size; | ||
got_irap |= is_irap; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters