• Xu Guangxin's avatar
    lavc/hevc_refs: Fix the logic of find_ref_idx() · 8b5ffaea
    Xu Guangxin authored
    Currently find_ref_idx() would trigger 2 scans in DPB to find the
    requested POC:
    1. Firstly, ignore MSB of ref->poc and search for the requested POC;
    2. Secondly, compare the entire ref->poc with requested POC;
    
    For long term reference, we are able to only check LSB if MSB is not
    presented(e.g. delta_poc_msb_present_flag == 0). However, for short
    term reference, we should never ignore poc's MSB and it should be
    kind of bit-exact. (Details in 8.3.2)
    
    Otherwise this leads to decoding failures like:
    [hevc @ 0x5638f4328600] Error constructing the frame RPS.
    [hevc @ 0x5638f4328600] Error parsing NAL unit #2.
    [hevc @ 0x5638f4338a80] Could not find ref with POC 21
    Error while decoding stream #0:0: Invalid data found when processing input
    
    Search the requested POC based on whether MSB is used, and avoid
    the 2-times scan for DPB buffer. This benefits both native HEVC
    decoder and integrated HW decoders.
    Signed-off-by: 's avatarXu Guangxin <guangxin.xu@intel.com>
    Signed-off-by: 's avatarLinjie Fu <linjie.fu@intel.com>
    8b5ffaea
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...