[FFmpeg-cvslog] hevc: fix pcm with different chroma luma bit widths( cherry picked from commit 6a444516f338424d062c0ef2806714036283603b)

Mickaël Raulet git at videolan.org
Thu Oct 17 02:48:02 CEST 2013


ffmpeg | branch: master | Mickaël Raulet <mraulet at insa-rennes.fr> | Wed Oct 16 16:03:57 2013 +0200| [a7e300649a7a2105a4f7edfaf936f0a9e05a2d43] | committer: Michael Niedermayer

hevc: fix pcm with different chroma luma bit widths(cherry picked from commit 6a444516f338424d062c0ef2806714036283603b)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7e300649a7a2105a4f7edfaf936f0a9e05a2d43
---

 libavcodec/hevc.c    |    4 ++--
 libavcodec/hevc.h    |    1 +
 libavcodec/hevc_ps.c |   12 +-----------
 3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index ad82012..056018f 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1426,8 +1426,8 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
         return ret;
 
     s->hevcdsp.put_pcm(dst0, stride0, cb_size, &gb, s->sps->pcm.bit_depth);
-    s->hevcdsp.put_pcm(dst1, stride1, cb_size / 2, &gb, s->sps->pcm.bit_depth);
-    s->hevcdsp.put_pcm(dst2, stride2, cb_size / 2, &gb, s->sps->pcm.bit_depth);
+    s->hevcdsp.put_pcm(dst1, stride1, cb_size / 2, &gb, s->sps->pcm.bit_depth_chroma);
+    s->hevcdsp.put_pcm(dst2, stride2, cb_size / 2, &gb, s->sps->pcm.bit_depth_chroma);
     return 0;
 }
 
diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h
index 9e91c3b..ee53ef0 100644
--- a/libavcodec/hevc.h
+++ b/libavcodec/hevc.h
@@ -413,6 +413,7 @@ typedef struct HEVCSPS {
 
     struct {
         uint8_t bit_depth;
+        uint8_t bit_depth_chroma;
         unsigned int log2_min_pcm_cb_size;
         unsigned int log2_max_pcm_cb_size;
         uint8_t loop_filter_disable_flag;
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index b9015ae..b44b7fe 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -715,18 +715,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
 
     sps->pcm_enabled_flag = get_bits1(gb);
     if (sps->pcm_enabled_flag) {
-        int pcm_bit_depth_chroma;
         sps->pcm.bit_depth   = get_bits(gb, 4) + 1;
-        pcm_bit_depth_chroma = get_bits(gb, 4) + 1;
-        if (pcm_bit_depth_chroma != sps->pcm.bit_depth) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "PCM Luma bit depth (%d) is different from PCM chroma"\
-                   "bit depth (%d), this is unsupported.\n",
-                   sps->pcm.bit_depth, pcm_bit_depth_chroma);
-            ret = AVERROR_INVALIDDATA;
-            goto err;
-        }
-
+        sps->pcm.bit_depth_chroma = get_bits(gb, 4) + 1;
         sps->pcm.log2_min_pcm_cb_size = get_ue_golomb_long(gb) + 3;
         sps->pcm.log2_max_pcm_cb_size = sps->pcm.log2_min_pcm_cb_size +
                                         get_ue_golomb_long(gb);



More information about the ffmpeg-cvslog mailing list