void DiscardDeint::filter(QQueue< FrameBuffer > &framesQueue) { int insertAt = addFramesToDeinterlace(framesQueue); while (!internalQueue.isEmpty()) { FrameBuffer dequeued = internalQueue.dequeue(); VideoFrame *videoFrame = VideoFrame::fromData(dequeued.data); const bool TFF = isTopFieldFirst(videoFrame); videoFrame->setNoInterlaced(); for (int p = 0; p < 3; ++p) { const int linesize = videoFrame->linesize[p]; quint8 *src = videoFrame->data[p]; quint8 *dst = videoFrame->data[p]; const int lines = (p ? h >> 2 : h >> 1) - 1; if (!TFF) { memcpy(dst, src + linesize, linesize); src += linesize; dst += linesize; } dst += linesize; src += linesize; for (int i = 0; i < lines; ++i) { VideoFilters::averageTwoLines(dst, src - linesize, src + linesize, linesize); src += linesize << 1; dst += linesize << 1; } if (TFF) memcpy(dst, src - linesize, linesize); } framesQueue.insert(insertAt++, dequeued); } }
void BlendDeint::filter(QQueue< FrameBuffer > &framesQueue) { int insertAt = addFramesToDeinterlace(framesQueue); while (!internalQueue.isEmpty()) { FrameBuffer dequeued = internalQueue.dequeue(); VideoFrame *videoFrame = VideoFrame::fromData(dequeued.data); videoFrame->setNoInterlaced(); for (int p = 0; p < 3; ++p) { const int linesize = videoFrame->linesize[p]; quint8 *src = videoFrame->data[p] + linesize; quint8 *dst = videoFrame->data[p] + linesize; const int H = (p ? h >> 1 : h >> 0) - 2; for (int i = 0; i < H; ++i) { VideoFilters::averageTwoLines(dst, src, src + linesize, linesize); src += linesize; dst += linesize; } } framesQueue.insert(insertAt++, dequeued); } }