Skip to content

Commit be5740b

Browse files
committed
Fix the black block issue on the right side
Signed-off-by: Liang <xiaoxia.liang@intel.com>
1 parent 374b58c commit be5740b

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

Library/Raisr.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,13 +1261,16 @@ RNLERRORTYPE processSegment(VideoDataType *srcY, VideoDataType *final_outY, Blen
12611261
}
12621262
c += loopItr;
12631263
}
1264-
// Copy right border pixels for this row and left border pixels for next row
1265-
if (step == outY->step) {
1266-
memcpy(outY->pData + r * step - gLoopMargin * pix_bytes, pDst + rOffset * step - gLoopMargin * pix_bytes, 2 * gLoopMargin * pix_bytes);
1264+
int unprocessed = cols - c; // unprocessed pixels on the right
1265+
// Copy right border pixels for this row and left border pixels for next row
1266+
if (step == outY->step) {
1267+
memcpy(outY->pData + r * step - unprocessed * pix_bytes, pDst + rOffset * step - unprocessed * pix_bytes, (unprocessed + gLoopMargin) * pix_bytes);
12671268
} else {
1268-
memcpy(outY->pData + (r -1 ) * outY->step + (outY->width - gLoopMargin) * pix_bytes,
1269-
pDst + rOffset * step - gLoopMargin * pix_bytes,
1270-
gLoopMargin * pix_bytes);
1269+
// copy right border pixels for this row
1270+
memcpy(outY->pData + (r -1 ) * outY->step + (outY->width - unprocessed) * pix_bytes,
1271+
pDst + rOffset * step - unprocessed * pix_bytes,
1272+
unprocessed * pix_bytes);
1273+
// copy left border pixels for nex row
12711274
memcpy(outY->pData + r * outY->step,
12721275
pDst + rOffset * step,
12731276
gLoopMargin * pix_bytes);

0 commit comments

Comments
 (0)