picture: expand plane_t visible area
A plane_t stores "visible pitch" and "visible lines" fields, but it does
not know anything about possible offsets in the picture (i_x_offset and
i_y_offset in video_format_t).
Therefore, copying a picture having a non-zero offset resulted in the wrong area being copied, so the right and bottom "visible" pixels were lost.
source plane destination plane
+-------------------+ +-------------------+
| | | '''''''''|
| ........... | plane_CopyPixels() | .....'''''''''|
| : visible : | ---------------> | : '''''''''|
| : area : | |'''''''''''''''''''|
| ........... | |'''''''''''''''''''|
| | |'''''''''''''''''''|
+-------------------+ +-------------------+
To avoid the problem, set the i_visible_pitch and i_visible_lines values
so that they include the visible area:
i_visible_pitch
<--------------->
^ +-------------------+
| | '''|
i_visible_lines | | ...........'''|
| | : visible :'''|
| | : area :'''|
v | ...........'''|
|'''''''''''''''''''|
+-------------------+
Alternatives considered:
- Set the "visible" area to the whole
video_format_ti_width×i_height(!2879 (closed)); but this changes the semantics of the existing fields, and potentially impacts allpicture_tusages. - Adapt
plane_CopyPixels()to copy the wholei_pitch×i_linesarea (initially proposed in !2898 (merged)); but this impacts the behavior of allpicture_tusers, even without offsets.
By contrast, extending the visible pitch and lines to include the
visible area has no impact for pictures without offsets, and it makes
the copy of picture_t having offsets correct.
- Refs #27264 (closed)
- Refs !2879 (closed)
- Refs !2898 (merged)
(sample from #27264 (closed))
Before (notice the 2px green band on the right):
After:

