#11551: [HEVC] Incorrect PCM Coding Block Length Derivation For YUV400
--------------------------------+--------------------------------------
             Reporter:  ksthey  |                     Type:  defect
               Status:  new     |                 Priority:  normal
            Component:  ffmpeg  |                  Version:  git-master
             Keywords:  Hevc    |               Blocked By:
             Blocking:          |  Reproduced by developer:  0
Analyzed by developer:  0       |
--------------------------------+--------------------------------------
 In hevcdec.c, hls_pcm_sample(), the derivation of length below doesn't
 consider the case of YUV400 (chroma_format_idc == 0), which results in
 incorrect byte skipped and parsing errors for later blocks, when YUV400
 PCM blocks appear.
 =============================================================================
     int length         = cb_size * cb_size * sps->pcm.bit_depth +
                          (((cb_size >> sps->hshift[1]) * (cb_size >>
 sps->vshift[1])) +
                           ((cb_size >> sps->hshift[2]) * (cb_size >>
 sps->vshift[2]))) *
                           sps->pcm.bit_depth_chroma;
 =============================================================================



 Modify the code as below does solve the problem:
 =============================================================================
     int length         = cb_size * cb_size * sps->pcm.bit_depth +
 ((sps->chroma_format_idc != 0) ?
                          ((((cb_size >> sps->hshift[1]) * (cb_size >>
 sps->vshift[1])) +
                            ((cb_size >> sps->hshift[2]) * (cb_size >>
 sps->vshift[2]))) *
                            sps->pcm.bit_depth_chroma) : 0);
 =============================================================================
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11551>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to