aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPraveen Karadugattu <praveenkumar@outlook.com>2020-01-23 18:54:17 +0530
committerPaul B Mahol <onemda@gmail.com>2020-02-06 17:04:41 +0100
commit31d7b17c4671329a372e2762b4c5892dd0314ee5 (patch)
treecc2776bb3ebdd010d2004be7142cd9aa76547329
parent270068b5af281dae9280306b1621d1f2b7920adb (diff)
downloadffmpeg-31d7b17c4671329a372e2762b4c5892dd0314ee5.tar.gz
avcodec/hevc: add support for Frame Duplication (Doubling/Tripling)
Parse picture_struct SEI value.
-rw-r--r--libavcodec/hevc_parser.c5
-rw-r--r--libavcodec/hevc_sei.c6
-rw-r--r--libavcodec/hevc_sei.h5
3 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index 87d5dba4f5..84f19b485c 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -235,6 +235,11 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
case HEVC_NAL_RADL_R:
case HEVC_NAL_RASL_N:
case HEVC_NAL_RASL_R:
+ if (ctx->sei.picture_timing.picture_struct == HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING) {
+ s->repeat_pict = 1;
+ } else if (ctx->sei.picture_timing.picture_struct == HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING) {
+ s->repeat_pict = 2;
+ }
ret = hevc_parse_slice_header(s, nal, avctx);
if (ret)
return ret;
diff --git a/libavcodec/hevc_sei.c b/libavcodec/hevc_sei.c
index 562ce8b516..60570690cf 100644
--- a/libavcodec/hevc_sei.c
+++ b/libavcodec/hevc_sei.c
@@ -144,6 +144,12 @@ static int decode_nal_sei_pic_timing(HEVCSEI *s, GetBitContext *gb, const HEVCPa
} else if (pic_struct == 1 || pic_struct == 9 || pic_struct == 11) {
av_log(logctx, AV_LOG_DEBUG, "TOP Field\n");
h->picture_struct = AV_PICTURE_STRUCTURE_TOP_FIELD;
+ } else if (pic_struct == 7) {
+ av_log(logctx, AV_LOG_DEBUG, "Frame/Field Doubling\n");
+ h->picture_struct = HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING;
+ } else if (pic_struct == 8) {
+ av_log(logctx, AV_LOG_DEBUG, "Frame/Field Tripling\n");
+ h->picture_struct = HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING;
}
get_bits(gb, 2); // source_scan_type
get_bits(gb, 1); // duplicate_flag
diff --git a/libavcodec/hevc_sei.h b/libavcodec/hevc_sei.h
index 2769d41445..a44ccca7f8 100644
--- a/libavcodec/hevc_sei.h
+++ b/libavcodec/hevc_sei.h
@@ -59,6 +59,11 @@ typedef enum {
HEVC_SEI_TYPE_ALPHA_CHANNEL_INFO = 165,
} HEVC_SEI_Type;
+typedef enum {
+ HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING = 7,
+ HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING = 8
+} HEVC_SEI_PicStructType;
+
typedef struct HEVCSEIPictureHash {
uint8_t md5[3][16];
uint8_t is_md5;