@@ 304,15 304,15 @@ class CompressFrames(Module):
NextValue(full_lines, full_lines + 1)
)
).Else(
- If(line_within_frame == frame_height - 1,
+ If(last_line,
# Been keeping around MAX_Y_OFFSET extra lines from the previous
# frame but now it's the last line of the frame so can drop them
If(write_port.we,
NextValue(full_lines, full_lines - MAX_Y_OFFSET)
).Else(
- NextValue(full_lines, full_lines - MAX_Y_OFFSET + 1)
+ NextValue(full_lines, full_lines - MAX_Y_OFFSET - 1)
)
- ).Elif(line_within_frame > MAX_Y_OFFSET,
+ ).Elif(line_within_frame >= MAX_Y_OFFSET,
# Keep MAX_Y_OFFSET extra lines from the previous frame for
# prediction
If(~write_port.we,