Fixed several issues with cropping. (#275)

* * rocDecode: Fixed several issues with cropping.
  - Fixed the pixel start offset error on streams with non-zero top/left cropping in MD5 calculation.
  - Fixed the pixel start offset error on streams with non-zero top/left cropping, and/or with user specified cropping in YUV frame output.
  - Sorted out code which deals with cropping area specifiied by the bitstream, and cropping area specified by the user.

* * rocDecode: Additional changes after discussion.
 - Set display rect for decoder create/reconfig to displayable area or user specified ROI area.
 - Do not set target rect for decoder create/reconfig. Leave it for future use.
 - Unified naming of display rect in decoder create/reconfig structs.

* * rocDecode: Put back the extra rounding to target width/height specifiied by the coded stream, for peace of mind, based on code review.

* * rocDecode: Added the missing stream specified cropping offset to the starting pixel pointer for none-internal memory modes.

---------

Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
Este commit está contenido en:
jeffqjiangNew
2024-03-11 22:35:11 -04:00
cometido por GitHub
padre 44c14236ae
commit e4614de461
Se han modificado 7 ficheros con 129 adiciones y 115 borrados
+2 -2
Ver fichero
@@ -142,10 +142,10 @@ int main(int argc, char **argv) {
continue;
}
if (!strcmp(argv[i], "-crop")) {
if (++i == argc || 4 != sscanf(argv[i], "%d,%d,%d,%d", &crop_rect.l, &crop_rect.t, &crop_rect.r, &crop_rect.b)) {
if (++i == argc || 4 != sscanf(argv[i], "%d,%d,%d,%d", &crop_rect.left, &crop_rect.top, &crop_rect.right, &crop_rect.bottom)) {
ShowHelpAndExit("-crop");
}
if ((crop_rect.r - crop_rect.l) % 2 == 1 || (crop_rect.b - crop_rect.t) % 2 == 1) {
if ((crop_rect.right - crop_rect.left) % 2 == 1 || (crop_rect.bottom - crop_rect.top) % 2 == 1) {
std::cout << "output crop rectangle must have width and height of even numbers" << std::endl;
exit(1);
}