diff options
author | James Darnley <james.darnley@gmail.com> | 2015-12-30 17:20:59 +0000 |
---|---|---|
committer | James Darnley <james.darnley@gmail.com> | 2016-01-17 16:03:43 +0100 |
commit | 3836f404a8c0ffd7c565260434768ef4ebba85a7 (patch) | |
tree | ab80a28b382bb5dec0629671a85cb07804836f31 /libavcodec/v210enc.c | |
parent | 61625dcc395f98ad77e9378ec4eb48cf7c981bce (diff) | |
download | ffmpeg-3836f404a8c0ffd7c565260434768ef4ebba85a7.tar.gz |
avcodec/v210: add avx2 version of the 8-bit line encoder
Around 35% faster than the avx version.
Signed-off-by: Henrik Gramner <henrik@gramner.com>
Diffstat (limited to 'libavcodec/v210enc.c')
-rw-r--r-- | libavcodec/v210enc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c index 061224885f..ec63864cc8 100644 --- a/libavcodec/v210enc.c +++ b/libavcodec/v210enc.c @@ -86,6 +86,7 @@ av_cold void ff_v210enc_init(V210EncContext *s) { s->pack_line_8 = v210_planar_pack_8_c; s->pack_line_10 = v210_planar_pack_10_c; + s->sample_factor = 1; if (ARCH_X86) ff_v210enc_init_x86(s); @@ -172,13 +173,13 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const uint8_t *v = pic->data[2]; for (h = 0; h < avctx->height; h++) { uint32_t val; - w = (avctx->width / 12) * 12; + w = (avctx->width / (12 * s->sample_factor)) * 12 * s->sample_factor; s->pack_line_8(y, u, v, dst, w); y += w; u += w >> 1; v += w >> 1; - dst += (w / 12) * 32; + dst += (w / (12 * s->sample_factor)) * 32 * s->sample_factor; for (; w < avctx->width - 5; w += 6) { WRITE_PIXELS8(u, y, v); |