Skip to content

Commit

Permalink
#973: if the input height is odd, libyuv will round up, we round down…
Browse files Browse the repository at this point in the history
….. so we need more padding

git-svn-id: https://xpra.org/svn/Xpra/trunk@12303 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 2, 2016
1 parent 7cfbd25 commit 92c0add
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/xpra/codecs/csc_libyuv/colorspace_converter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,11 @@ cdef class ColorspaceConverter:
self.out_stride[i] = roundup(self.out_width[i], MEMALIGN_ALIGNMENT)
self.out_size[i] = self.out_stride[i] * self.out_height[i]
self.out_offsets[i] = self.out_buffer_size
#add one extra line to height so we can access a full rowstride at a time,
#add two extra lines to height so we can access two rowstrides at a time,
#no matter where we start to read on the last line
#and round up to memalign each plane:
self.out_buffer_size += roundupl(self.out_size[i] + self.out_stride[i], MEMALIGN_ALIGNMENT)
#(why two and not just one? libyuv will do this for input data with odd height)
self.out_buffer_size += roundupl(self.out_size[i] + 2*self.out_stride[i], MEMALIGN_ALIGNMENT)
if self.scaling:
self.scaled_width[i] = dst_width // xdiv
self.scaled_height[i] = dst_height // ydiv
Expand Down

0 comments on commit 92c0add

Please sign in to comment.