Added extended version of vc_deinterlace()

Allows not in-place deinterlacing.
This commit is contained in:
Martin Pulec
2018-07-12 10:17:42 +02:00
parent 594fdc915c
commit 73e67da2d0
2 changed files with 19 additions and 0 deletions

View File

@@ -612,6 +612,24 @@ static void vc_deinterlace_unaligned(unsigned char *src, long src_linesize, int
}
#endif
/**
* Extended version of vc_deinterlace(). The former version was in-place only.
* This allows to output to different buffer.
*/
void vc_deinterlace_ex(unsigned char *src, size_t src_linesize, unsigned char *dst, size_t dst_pitch, size_t lines)
{
for (size_t y = 0; y < lines; y += 2) {
for (size_t x = 0; x < src_linesize; ++x) {
int val = (*src + src[src_linesize] + 1) >> 1;
*dst = dst[dst_pitch] = val;
src++;
dst++;
}
src += src_linesize;
dst += dst_pitch;
}
}
/**
* @brief Converts v210 to UYVY
* @param[out] dst 4-byte aligned output buffer where UYVY will be stored

View File

@@ -93,6 +93,7 @@ bool codec_is_in_set(codec_t codec, codec_t *set) ATTRIBUTE(pure);
int codec_is_const_size(codec_t codec) ATTRIBUTE(pure);
void vc_deinterlace(unsigned char *src, long src_linesize, int lines);
void vc_deinterlace_ex(unsigned char *src, size_t src_linesize, unsigned char *dst, size_t dst_pitch, size_t lines);
void vc_copylineDVS10(unsigned char *dst, const unsigned char *src, int dst_len);
void vc_copylinev210(unsigned char *dst, const unsigned char *src, int dst_len);
void vc_copylineYUYV(unsigned char *dst, const unsigned char *src, int dst_len);