diff options
author | James Darnley <james.darnley@gmail.com> | 2016-01-15 20:35:06 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2016-02-01 13:40:07 +0100 |
commit | 15ec7aa4170ed05ad1b17000ef1e3940d0a0c5e7 (patch) | |
tree | d6f2196721a51809d931883aa7039096991a112c /libavcodec/v210enc.c | |
parent | d29237e5578a187c5a8d91338cd70ce0fd6f6003 (diff) | |
download | ffmpeg-15ec7aa4170ed05ad1b17000ef1e3940d0a0c5e7.tar.gz |
v210: Add avx2 version of the 10-bit line encoder
Around 25% faster than the ssse3 version.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
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 ce690f1634..da0b23f074 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); |