diff options
author | Mickaƫl Raulet <mraulet@insa-rennes.fr> | 2014-12-22 14:55:54 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-02 18:10:57 +0100 |
commit | 7cf6a67ef9c9ac95e57867c753f38104f481f6f1 (patch) | |
tree | 8ddd60834f270bb2a709d6fb68c647deaf3867c7 /libavcodec/hevc_ps.c | |
parent | ecc92ee717eac18540e236ee27e9052cd2917800 (diff) | |
download | ffmpeg-7cf6a67ef9c9ac95e57867c753f38104f481f6f1.tar.gz |
avcodec/hevc: adding support for monochrome sequences in hevc
cherry picked from commit 8e50557707d2ec11ccad657470b2e140f314348e
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc_ps.c')
-rw-r--r-- | libavcodec/hevc_ps.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index 464176beb0..08fe819d4d 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -755,11 +755,6 @@ int ff_hevc_decode_nal_sps(HEVCContext *s) } sps->chroma_format_idc = get_ue_golomb_long(gb); - if (!(sps->chroma_format_idc == 1 || sps->chroma_format_idc == 2 || sps->chroma_format_idc == 3)) { - avpriv_report_missing_feature(s->avctx, "chroma_format_idc != {1, 2, 3}\n"); - ret = AVERROR_PATCHWELCOME; - goto err; - } if (sps->chroma_format_idc == 3) sps->separate_colour_plane_flag = get_bits1(gb); @@ -799,7 +794,7 @@ int ff_hevc_decode_nal_sps(HEVCContext *s) sps->bit_depth = get_ue_golomb_long(gb) + 8; bit_depth_chroma = get_ue_golomb_long(gb) + 8; - if (bit_depth_chroma != sps->bit_depth) { + if (sps->chroma_format_idc && bit_depth_chroma != sps->bit_depth) { av_log(s->avctx, AV_LOG_ERROR, "Luma bit depth (%d) is different from chroma bit depth (%d), " "this is unsupported.\n", @@ -810,21 +805,25 @@ int ff_hevc_decode_nal_sps(HEVCContext *s) switch (sps->bit_depth) { case 8: + if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY8; if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P; if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P; if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P; break; case 9: + if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY16; if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P9; if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P9; if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P9; break; case 10: + if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY16; if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P10; if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P10; if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P10; break; case 12: + if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY16; if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P12; if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P12; if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P12; |