-
Notifications
You must be signed in to change notification settings - Fork 460
allow ROI rectangle top/left/bottom/right to be 0 for query #1856
Conversation
changed++; | ||
i--; | ||
continue; | ||
if (!(ROI->ROI[i].Top == 0 && ROI->ROI[i].Left == 0 && ROI->ROI[i].Right == 0 && ROI->ROI[i].Bottom == 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guoyejun , HEVC encode got a new design. Please extend the change for it. Seems this is the right place for it:
auto IsInvalidRect = [](const ROI::RectData& rect) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to separate ROI check behavior in Query and run-time - not sure about driver reaction on all-zero ROI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eistarov good point, i'm afraid i have no time for such change, just pass the ball to msdk team, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is nature to fill the ROI rect with zero when query the max supported ROI numbers. Without this change, the query does not work for such case.
cb8def6
to
83b27e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we need comment in code to describe why we have such check
auto IsInvalidRect = [](const ROI::RectData& rect) | ||
{ | ||
if (rect.Top == 0 && rect.Left == 0 && rect.Right == 0 && rect.Bottom == 0) | ||
{ | ||
return false; | ||
} | ||
return ((rect.Left >= rect.Right) || (rect.Top >= rect.Bottom)); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After CheckAndFixRect above we have here top/left aligned down and right/bottom aligned up for the cases when they are not aligned to BlockSize and right/bottom > top/left.
If top/left == right/bottom or top/left > right/bottom inside the same Block we would have top/left==right/bottom here and if top/left > right/bottom and they don't belong to the same Block we would have top/left > right/bottom.
Let me know if you don't agree with it?
So we have to consider a Rect as invalid only the way it was done before i.e. ((rect.Left >= rect.Right) || (rect.Top >= rect.Bottom))
as mentioned above that "@eistarov good point, i'm afraid i have no time for such change, just pass the ball to msdk team, thanks." |
It is nature to fill the ROI rect with zero when query the max
supported ROI numbers. Without this change, the query does not
work for such case.