diff --git a/src/util/vpc_util.cpp b/src/util/vpc_util.cpp index 8bca82c..01b780d 100755 --- a/src/util/vpc_util.cpp +++ b/src/util/vpc_util.cpp @@ -139,8 +139,10 @@ vpc_img_info VPCUtil::crop(DeviceMemory *devMem, video_object_info obj) { acldvppSetPicDescHeightStride(vpcInputDesc_, devMem->getHeightStride()); acldvppSetPicDescSize(vpcInputDesc_, devMem->getSize()); + uint32_t width_stride = ALIGN_UP64(cropSizeWidth); + uint32_t height_stride = ALIGN_UP16(cropSizeHeight); /* processdecode */ - uint32_t vpcOutBufferSize_ = cropSizeWidth * cropSizeHeight * 3 / 2; + uint32_t vpcOutBufferSize_ = width_stride * height_stride * 3 / 2; void *vpcOutBufferDev_ = nullptr; acldvppMalloc(&vpcOutBufferDev_, vpcOutBufferSize_); acldvppPicDesc *vpcOutputDesc_ = acldvppCreatePicDesc(); @@ -148,8 +150,8 @@ vpc_img_info VPCUtil::crop(DeviceMemory *devMem, video_object_info obj) { acldvppSetPicDescFormat(vpcOutputDesc_, PIXEL_FORMAT_YUV_SEMIPLANAR_420); acldvppSetPicDescWidth(vpcOutputDesc_, cropSizeWidth); acldvppSetPicDescHeight(vpcOutputDesc_, cropSizeHeight); - acldvppSetPicDescWidthStride(vpcOutputDesc_, cropSizeWidth); - acldvppSetPicDescHeightStride(vpcOutputDesc_, cropSizeHeight); + acldvppSetPicDescWidthStride(vpcOutputDesc_, width_stride); + acldvppSetPicDescHeightStride(vpcOutputDesc_, height_stride); acldvppSetPicDescSize(vpcOutputDesc_, vpcOutBufferSize_); bool bRet = false;