Change the name and call logic of CheckRefPicturesComplete function

Change the name and call logic of CheckRefPicturesComplete function, protection when EC or error bitstream