cubicibo / SUPer

HDMV PGS (BD SUP) subtitle encoder compatible with typesetting effects.
GNU General Public License v3.0
21 stars 4 forks source link

Adapt palette distribution to ratio of object sizes on normal cases redefinition #28

Closed cubicibo closed 6 months ago

cubicibo commented 6 months ago

Windows may be of vastly different sizes in an epoch. Furthermore, the buffer slots are not necessarily sized to the windows but to the largest occupied area in a frame. In normal case redefinition data stream sections, the palette is distributed between the two objects, and no ID shall be shared. On occasions where the two objects differ vastly in surface area, the largest object should have more palette entries than the smaller one.

This MR adds logic to shift the boundary (within reasonable limits) whenever the object areas mismatch is significant.