diff options
author | James Darnley <james.darnley@gmail.com> | 2016-01-15 18:30:03 +0000 |
---|---|---|
committer | James Darnley <james.darnley@gmail.com> | 2016-01-17 16:03:43 +0100 |
commit | 2cba1825f70c301f5513a799302f755967680651 (patch) | |
tree | c39ebf1ac76c35ab1852cd4555fa155b78d77f4d /libavcodec/v210enc.c | |
parent | 3836f404a8c0ffd7c565260434768ef4ebba85a7 (diff) | |
download | ffmpeg-2cba1825f70c301f5513a799302f755967680651.tar.gz |
avcodec/v210: add avx2 version of the 10-bit line encoder
Around 25% faster than the ssse3 version.
Diffstat (limited to 'libavcodec/v210enc.c')
-rw-r--r-- | libavcodec/v210enc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c index ec63864cc8..00c89dc1d8 100644 --- a/libavcodec/v210enc.c +++ b/libavcodec/v210enc.c @@ -135,13 +135,20 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const uint16_t *v = (const uint16_t *)pic->data[2]; for (h = 0; h < avctx->height; h++) { uint32_t val; - w = (avctx->width / 6) * 6; + w = (avctx->width / (6 * s->sample_factor)) * 6 * s->sample_factor; s->pack_line_10(y, u, v, dst, w); y += w; u += w >> 1; v += w >> 1; - dst += (w / 6) * 16; + dst += (w / (6 * s->sample_factor)) * 16 * s->sample_factor; + + for (; w < avctx->width - 5; w += 6) { + WRITE_PIXELS(u, y, v); + WRITE_PIXELS(y, u, y); + WRITE_PIXELS(v, y, u); + WRITE_PIXELS(y, v, y); + } if (w < avctx->width - 1) { WRITE_PIXELS(u, y, v); |