Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/codec/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ FramePtr Frame::Interlace(FramePtr top, FramePtr bottom)
int Frame::generate_linesize_bytes(int width, PixelFormat format,
int channel_count)
{
// Align to 32 bytes (not sure if this is necessary?)
return VideoParams::GetBytesPerPixel(format, channel_count) *
((width + 31) & ~31);
// Calculate the raw bytes required for the image row and Align to a multiple of 4 bytes.
int row_bytes = VideoParams::GetBytesPerPixel(format, channel_count) * width;
return (row_bytes + 3) & ~3;
}

Color Frame::get_pixel(int x, int y) const
Expand Down