Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMickaƫl Raulet <mraulet@insa-rennes.fr>2014-12-22 16:55:54 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-02-02 20:10:57 +0300
commit7cf6a67ef9c9ac95e57867c753f38104f481f6f1 (patch)
tree8ddd60834f270bb2a709d6fb68c647deaf3867c7 /libavcodec/hevc_ps.c
parentecc92ee717eac18540e236ee27e9052cd2917800 (diff)
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.c11
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;